Skip to content

Commit 105dc3d

Browse files
committed
chore: update ci tooling and docs to reflect change in linter
1 parent e918f09 commit 105dc3d

File tree

7 files changed

+47
-53
lines changed

7 files changed

+47
-53
lines changed

.circleci/config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ jobs:
217217
- run:
218218
name: Lint
219219
command: yarn lint
220-
- run: yarn analyze
221220
- run:
222221
name: Are there changes?
223222
command: git diff-files --exit-code

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ tools/**/*.test-vrt.ts
6565
# cache directories
6666
.wireit
6767
.eslintcache
68+
.stylelintcache
6869

6970
stats.html
7071

.husky/pre-commit

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
#!/usr/bin/env bash
2-
bash << EOF
3-
yarn lint-staged
4-
5-
VERSION_FILE=$(dirname "$0")/../tools/base/src/version.js
6-
yarn genversion --es6 --semi $VERSION_FILE
7-
git add $VERSION_FILE
8-
EOF
1+
yarn lint-staged --allow-empty

.prettierrc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ bracketSpacing: true
77
arrowParens: always
88
htmlWhitespaceSensitivity: ignore
99
overrides:
10-
- files: '{tools,packages}/*/src/spectrum-*.css'
10+
- files: '{tools,packages}/*/src/*.css'
1111
options:
1212
printWidth: 500

README.md

+34-35
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ To this end, Spectrum Web Components only targets _modern_, evergreen browsers t
66

77
# Requirements
88

9-
- NodeJS >= 20.0.0
10-
- Typescript
11-
- Supported desktop browsers:
12-
- Last 2 versions of Chrome
13-
- Last 2 versions of Firefox
14-
- Last 2 versions of Safari
15-
- Last 2 versions of Edge
16-
- Or appropriate [polyfills](https://github.com/webcomponents/webcomponentsjs) in older browsers.
17-
- We support all viewport sizes across supported desktop browsers.
18-
- While our components are designed to be responsive and mobile-friendly, we do not yet fully support mobile browsers due to limited testing in mobile hardware. We advise testing updates on mobile devices before updating and are happy to address any reported issues.
9+
- NodeJS >= 20.0.0
10+
- Typescript
11+
- Supported desktop browsers:
12+
- Last 2 versions of Chrome
13+
- Last 2 versions of Firefox
14+
- Last 2 versions of Safari
15+
- Last 2 versions of Edge
16+
- Or appropriate [polyfills](https://github.com/webcomponents/webcomponentsjs) in older browsers.
17+
- We support all viewport sizes across supported desktop browsers.
18+
- While our components are designed to be responsive and mobile-friendly, we do not yet fully support mobile browsers due to limited testing in mobile hardware. We advise testing updates on mobile devices before updating and are happy to address any reported issues.
1919

2020
# Getting started
2121

@@ -34,7 +34,7 @@ Typical development will involve running `yarn storybook`, `yarn test`, and `yar
3434
Creating a new component from the command line can be done by running the following:
3535

3636
```bash
37-
$ yarn new-package
37+
yarn new-package
3838
```
3939

4040
This will scaffold your component's required architecture by prompting you for 2 data points - the desired name for your package and the name of the Spectrum CSS asset from which you will be building.
@@ -81,8 +81,8 @@ yarn docs:build
8181

8282
There are two mechanisms for broadly updating SWC's Spectrum CSS dependencies:
8383

84-
- `yarn update:spectrum-css` brings all Spectrum CSS dependencies to 'latest'
85-
- `yarn update:spectrum-css:nonbreaking` brings them to the latest minor or patch version
84+
- `yarn update:spectrum-css` brings all Spectrum CSS dependencies to 'latest'
85+
- `yarn update:spectrum-css:nonbreaking` brings them to the latest minor or patch version
8686

8787
We aim to keep Spectrum CSS as current as possible, to track the Spectrum design system closely.
8888
The `:nonbreaking` variant lets us release patch updates quickly in cases where more work is required to be compatible with 'latest.'
@@ -91,11 +91,10 @@ The `:nonbreaking` variant lets us release patch updates quickly in cases where
9191

9292
There are several commands that can be useful in specific scenarios:
9393

94-
- `yarn build:clear-cache` to remove previously created artifacts of the `tsc build` process.
95-
- `yarn spectrum-vars` to ensure that theme files are up-to-date.
96-
- `yarn process-icons` to make sure that the most recent icons are included.
97-
- `yarn process-spectrum` to process the spectrum CSS style sources into the individual packages.
98-
- `yarn build` to make sure the available JS has been built from the current TS source.
94+
- `yarn build:clear-cache` to remove previously created artifacts of the `tsc build` process.
95+
- `yarn process-icons` to make sure that the most recent icons are included.
96+
- `yarn process-spectrum` to process the spectrum CSS style sources into the individual packages.
97+
- `yarn build` to make sure the available JS has been built from the current TS source.
9998

10099
## Linting
101100

@@ -179,23 +178,23 @@ This will run the defined [Tachometer](https://www.npmjs.com/package/tachometer)
179178

180179
There is extended documentation on adding a new component to the library in the [documentation site](https://opensource.adobe.com/spectrum-web-components/guides/generating-components). However, at a high level, you will be building the following structure:
181180

182-
- packages
183-
- new-component-name
184-
- src
185-
- index.ts
186-
- new-component-name.css
187-
- new-component-name.ts
188-
- spectrum-config.js
189-
- spectrum-new-component-name.css
190-
- stories
191-
- new-component-name.stories.ts
192-
- test
193-
- benchmark
194-
- test-basic.ts
195-
- new-component-name.test.ts
196-
- package.json
197-
- README.md
198-
- tsconfig.json
181+
- packages
182+
- new-component-name
183+
- src
184+
- index.ts
185+
- new-component-name.css
186+
- new-component-name.ts
187+
- spectrum-config.js
188+
- spectrum-new-component-name.css
189+
- stories
190+
- new-component-name.stories.ts
191+
- test
192+
- benchmark
193+
- test-basic.ts
194+
- new-component-name.test.ts
195+
- package.json
196+
- README.md
197+
- tsconfig.json
199198

200199
For a list of component waiting to be implemented, visit our [`missing components`](https://github.com/adobe/spectrum-web-components/labels/missing%20components) tag.
201200

lint-staged.config.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,22 @@ governing permissions and limitations under the License.
1111
*/
1212

1313
export default {
14-
'*': [
15-
'prettier --cache --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write',
16-
],
1714
'*.css': [
1815
'stylelint --fix --cache --allow-empty-input --report-descriptionless-disables --report-invalid-scope-disables --report-needless-disables',
16+
'prettier --cache --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write',
1917
],
20-
'{packages,tools}/**/*.ts': [
18+
'*.ts': [
2119
'eslint --fix --format pretty --cache --no-error-on-unmatched-pattern --quiet',
20+
'prettier --cache --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write',
2221
],
2322
'{packages,tools}/*/src/**/!(*.css).ts': ['yarn lit-analyzer'],
2423
'package.json': () => [
24+
'genversion --es6 --semi tools/base/src/version.js',
2525
'yarn constraints --fix',
2626
'yarn install --refresh-lockfile',
2727
'git add yarn.lock',
2828
],
29+
'!(*.css|*.ts)': [
30+
'prettier --cache --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write',
31+
],
2932
};

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"docs:review": "alex packages/**/*.md",
3737
"docs:start": "yarn workspace documentation serve --watch",
3838
"find": "test -f custom-elements.json",
39-
"format:css": "stylelint --fix --cache --allow-empty-input --report-descriptionless-disables --report-invalid-scope-disables --report-needless-disables {packages,tools}/**/*.css && prettier --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write --config .prettierrc {packages,tools}/**/*.css",
4039
"gen-react-wrapper": "node ./tasks/gen-react-wrapper.js",
4140
"icons": "wireit",
4241
"icons:ui": "wireit",
@@ -85,7 +84,7 @@
8584
"test:watch:flags:focus": "yarn build && run-p build:watch \"test:start --watch --group {1} --config web-test-runner.config.ci-chromium-flags.js\" --",
8685
"test:watch:focus": "yarn build && run-p build:watch \"test:start --watch --group {1}\" --",
8786
"update:spectrum-css": "node ./scripts/update-spectrum-css.js --latest || yarn update:spectrum-css:cleanup",
88-
"update:spectrum-css:cleanup": "yarn lint-staged && yarn --ignore-scripts && yarn process-spectrum",
87+
"update:spectrum-css:cleanup": "yarn --ignore-scripts && yarn process-spectrum && yarn lint",
8988
"update:spectrum-css:nonbreaking": "node ./scripts/update-spectrum-css.js || yarn update:spectrum-css:cleanup",
9089
"verify-build-artifacts": "node ./scripts/verify-build-artifacts.js",
9190
"vrt:preview": "yarn wds --config test/visual/wds-vrt.config.js",
@@ -314,7 +313,7 @@
314313
]
315314
},
316315
"icons": {
317-
"command": "node ./scripts/process-icons.js && git status --porcelain && git add . && yarn lint-staged",
316+
"command": "node ./scripts/process-icons.js && yarn lint",
318317
"files": [
319318
"scripts/process-icons.js"
320319
],
@@ -379,7 +378,7 @@
379378
]
380379
},
381380
"process-spectrum": {
382-
"command": "node ./scripts/spectrum-vars.js && node ./tasks/process-spectrum.js && node ./scripts/generate-tokens.js && yarn format:css",
381+
"command": "node ./scripts/spectrum-vars.js && node ./tasks/process-spectrum.js && node ./scripts/generate-tokens.js && yarn lint",
383382
"files": [
384383
"tasks/process-spectrum.js",
385384
"packages/**/spectrum-config.js",

0 commit comments

Comments
 (0)