Skip to content

Commit e94f0f3

Browse files
committed
chore: improve css import results; optimize precommit runs
1 parent a6fc662 commit e94f0f3

File tree

92 files changed

+3423
-16472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+3423
-16472
lines changed

Diff for: .husky/pre-commit

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
STAGED_FILES_TO_LINT=$(git diff --name-only --cached --diff-filter=d -- "*.ts" "*.js")
2+
STAGED_FILES_TO_ANALYZE=$(git diff --name-only --cached --diff-filter=d -- "{packages,tools}/*/src/**/!(*.css).ts")
3+
STAGED_CSS_FILES=$(git diff --name-only --cached --diff-filter=d -- "{packages,tools}/**/*.css")
24
VERSION_FILE=$(dirname "$0")/../tools/base/src/version.js
3-
yarn eslint -f pretty $STAGED_FILES_TO_LINT
4-
yarn analyze
5-
yarn lint:css
5+
6+
[[ -z "$STAGED_FILES_TO_LINT" ]] || yarn eslint -f pretty $STAGED_FILES_TO_LINT
7+
[[ -z "$STAGED_FILES_TO_ANALYZE" ]] || yarn lit-analyzer $STAGED_FILES_TO_ANALYZE
8+
[[ -z "$STAGED_CSS_FILES" ]] || yarn stylelint $STAGED_CSS_FILES
9+
610
yarn pretty-quick --staged
11+
712
yarn genversion --es6 --semi $VERSION_FILE
813
git add $VERSION_FILE

Diff for: .prettierrc.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ trailingComma: es5
66
bracketSpacing: true
77
arrowParens: always
88
htmlWhitespaceSensitivity: ignore
9+
overrides:
10+
- files: '{tools,packages}/*/src/spectrum-*.css'
11+
options:
12+
printWidth: 500

Diff for: .stylelintrc.json

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
{
22
"plugins": ["stylelint-header"],
3-
"extends": ["stylelint-config-standard"],
3+
"extends": [],
44
"rules": {
5-
"header/header": ["config/license.js", {}],
6-
"length-zero-no-unit": [true, { "ignore": "custom-properties" }],
7-
"selector-type-no-unknown": [true, { "ignore": ["custom-elements"] }],
8-
"selector-pseudo-element-colon-notation": ["single", {}],
9-
"custom-property-pattern": "^_?([a-z][a-z0-9]*)(-[a-z0-9]+)*$",
10-
"no-duplicate-selectors": null,
11-
"selector-class-pattern": null,
12-
"no-descending-specificity": null,
13-
"declaration-block-no-redundant-longhand-properties": null
5+
"header/header": ["config/license.js", {}]
146
},
157
"overrides": [
168
{
179
"files": [
18-
"packages/**/src/spectrum-*.css",
19-
"tools/**/src/spectrum-*.css",
20-
"tools/styles/**/*.css"
10+
"!packages/**/src/spectrum-*.css",
11+
"!tools/**/src/spectrum-*.css",
12+
"!tools/styles/**/*.css"
2113
],
22-
"extends": [],
14+
"extends": ["stylelint-config-standard"],
2315
"rules": {
24-
"header/header": ["config/license.js", {}]
16+
"header/header": ["config/license.js", {}],
17+
"length-zero-no-unit": [
18+
true,
19+
{ "ignore": "custom-properties" }
20+
],
21+
"selector-type-no-unknown": [
22+
true,
23+
{ "ignore": ["custom-elements"] }
24+
],
25+
"selector-pseudo-element-colon-notation": ["single", {}],
26+
"custom-property-pattern": "^_?([a-z][a-z0-9]*)(-[a-z0-9]+)*$",
27+
"no-duplicate-selectors": null,
28+
"selector-class-pattern": null,
29+
"no-descending-specificity": null,
30+
"declaration-block-no-redundant-longhand-properties": null
2531
}
2632
}
2733
]

Diff for: package.json

+4-8
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@
6666
"process-spectrum": "wireit",
6767
"publish:react": "yarn changeset publish --no-git-tag --tag snapshot --no-push",
6868
"push-to-remote": "git add . && git commit -m \"chore: release new versions #publish\" && git push",
69-
"spectrum-css": "wireit",
70-
"spectrum-tokens": "wireit",
71-
"spectrum-vars": "wireit",
7269
"start": "yarn storybook",
7370
"storybook": "wireit",
7471
"storybook:build": "NODE_ENV=production storybook build -o projects/documentation/dist/storybook -c storybook",
@@ -97,9 +94,6 @@
9794
"vrt:preview": "yarn wds --config test/visual/wds-vrt.config.js",
9895
"vrt:quick-link": "yarn netlify deploy --alias=vrt --dir=projects/vrt-quick-link"
9996
},
100-
"peerDependencies": {
101-
"common-tags": "^1.8.0"
102-
},
10397
"devDependencies": {
10498
"@changesets/changelog-github": "^0.5.0",
10599
"@changesets/cli": "^2.27.5",
@@ -387,7 +381,7 @@
387381
]
388382
},
389383
"process-spectrum": {
390-
"command": "node ./scripts/spectrum-vars.js && node ./tasks/process-spectrum.js && node ./scripts/generate-tokens.js && yarn lint:css --fix && pretty-quick --pattern \"{packages,tools}/**/*.css\" && pretty-quick --pattern \"packages/dialog/src/spectrum-dialog.css\"",
384+
"command": "node ./scripts/spectrum-vars.js && node ./tasks/process-spectrum.js && node ./scripts/generate-tokens.js && yarn lint:css --fix && pretty-quick --pattern \"{packages,tools}/**/*.css\"",
391385
"files": [
392386
"tasks/process-spectrum.js",
393387
"packages/**/spectrum-config.js",
@@ -397,7 +391,9 @@
397391
"scripts/generate-tokens-wrapper.js",
398392
"node_modules/@spectrum-css/**/*.css",
399393
"scripts/spectrum-vars.js",
400-
"tools/styles/package.json"
394+
"tools/styles/package.json",
395+
".prettierrc.yaml",
396+
".stylelintrc.json"
401397
],
402398
"output": [
403399
"packages/*/src/spectrum-*.css",

0 commit comments

Comments
 (0)