@mozaic-ds/css-dev-tools
Advanced tools
Comparing version 1.11.0 to 1.12.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.12.0](https://github.com/adeo/mozaic-design-system/compare/v1.11.0...v1.12.0) (2021-06-23) | ||
### Bug Fixes | ||
* **tools/stylelint:** turn off the rule 'no-invalid-position-at-import-rule' ([#853](https://github.com/adeo/mozaic-design-system/issues/853)) ([a337c91](https://github.com/adeo/mozaic-design-system/commit/a337c91c1c6bc1d52a5d29c2228758753c9c094a)) | ||
# [1.11.0](https://github.com/adeo/mozaic-design-system/compare/v1.10.0...v1.11.0) (2021-06-09) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@mozaic-ds/css-dev-tools", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"dependencies": { | ||
@@ -9,3 +9,3 @@ "@mozaic-ds/configuration-manager": "^1.0.1", | ||
"@mozaic-ds/postcss-sass": "^4.0.0-next.0", | ||
"@mozaic-ds/stylelint-plugin-mozaic": "^1.11.0", | ||
"@mozaic-ds/stylelint-plugin-mozaic": "^1.12.0", | ||
"autoprefixer": "^10.2.6", | ||
@@ -12,0 +12,0 @@ "cssnano": "^5.0.5", |
@@ -17,33 +17,6 @@ require("dotenv").config() | ||
// test for user configured additional paths | ||
const additionalPaths = CM.getKey("sass.includePaths") | ||
const styleLintConfig = require("./styleLintConfig") | ||
// test for user configured custom tokens paths | ||
const tokensBuildPath = CM.getKey("tokens.localTokensExportPath") | ||
const baseSassConfig = require("./sassConfig") | ||
const basePaths = [ | ||
"./node_modules/@mozaic-ds/styles/", | ||
"./node_modules/@mozaic-ds/styles/components/", | ||
"./node_modules/@mozaic-ds/styles/generic/", | ||
"./node_modules/@mozaic-ds/styles/layouts/", | ||
"./node_modules/@mozaic-ds/styles/settings-tools/", | ||
"./node_modules/@mozaic-ds/styles/typography/", | ||
"./node_modules/@mozaic-ds/styles/utilities/", | ||
"./node_modules/", | ||
] | ||
const tokensPath = tokensBuildPath | ||
? basePaths.concat([`${tokensBuildPath}scss/`]) | ||
: basePaths.concat(["./node_modules/@mozaic-ds/tokens/build/scss/"]) | ||
const includePaths = additionalPaths | ||
? tokensPath.concat(additionalPaths) | ||
: tokensPath | ||
// test for user configured space indent | ||
const userIndent = CM.getKey("sass.indentWidth") | ||
const indentWidth = userIndent ? userIndent : 2 | ||
const styleLintConfig = require("./styleLintConfig") | ||
// load browserlist config | ||
@@ -54,2 +27,6 @@ const borwserslistConfig = CM.getKey("browserslist") | ||
const sassConfig = CM.getKey("sass.config") | ||
? CM.getKey("sass.config") | ||
: baseSassConfig | ||
console.info(`Running ${mozaicEnvScssVar} plugins`) | ||
@@ -61,7 +38,3 @@ | ||
cssprepend(`$mozaic-env: ${mozaicEnvScssVar};`), | ||
sass({ | ||
includePaths, | ||
outputStyle: "expanded", | ||
indentWidth, | ||
}), | ||
sass(sassConfig), | ||
base64({ | ||
@@ -79,9 +52,13 @@ pattern: /<svg.*<\/svg>/i, | ||
if (CM.getKey("stylelint.disabled")) { | ||
plugins.shift() | ||
} | ||
if (CM.getKey("autoprefixer.disabled")) { | ||
plugins.pop() | ||
} | ||
const productionPlugins = [ | ||
cssprepend(`$mozaic-env: ${mozaicEnvScssVar};`), | ||
sass({ | ||
includePaths, | ||
outputStyle: "expanded", | ||
indentWidth, | ||
}), | ||
sass(sassConfig), | ||
base64({ | ||
@@ -100,2 +77,6 @@ pattern: /<svg.*<\/svg>/i, | ||
if (CM.getKey("autoprefixer.disabled")) { | ||
productionPlugins.pop() | ||
} | ||
module.exports = MOZAIC_ENV === "production" ? productionPlugins : plugins |
@@ -1,16 +0,16 @@ | ||
'use strict' | ||
const CM = require('@mozaic-ds/configuration-manager') | ||
"use strict" | ||
const CM = require("@mozaic-ds/configuration-manager") | ||
const configDefault = { | ||
caseStyle: 'kebab-case', | ||
caseStyle: "kebab-case", | ||
bemEntitiesDelimiters: { | ||
modifier: '--', | ||
element: '__', | ||
media: '@', | ||
modifier: "--", | ||
element: "__", | ||
media: "@", | ||
}, | ||
prefixes: ['mc-', 'ml-', 'mu-', 'mt-', 'mdu-'], | ||
prefixes: ["mc-", "ml-", "mu-", "mt-", "mdu-"], | ||
} | ||
const pickConfig = () => { | ||
const configUser = CM.getKey('stylelint') | ||
const configUser = CM.getKey("stylelint") | ||
if (configUser) { | ||
@@ -35,9 +35,10 @@ configUser.caseStyle = | ||
module.exports = { | ||
extends: ['stylelint-config-standard'], | ||
plugins: ['@mozaic-ds/stylelint-plugin-mozaic', 'stylelint-scss'], | ||
extends: ["stylelint-config-standard"], | ||
plugins: ["@mozaic-ds/stylelint-plugin-mozaic", "stylelint-scss"], | ||
rules: { | ||
'at-rule-no-unknown': null, | ||
'max-empty-lines': null, | ||
'plugin/mozaic-bem-pattern': [pickConfig()], | ||
"at-rule-no-unknown": null, | ||
"max-empty-lines": null, | ||
"plugin/mozaic-bem-pattern": [pickConfig()], | ||
"no-invalid-position-at-import-rule": null, | ||
}, | ||
} |
15046
6
153