Skip to content

Commit 502ffc8

Browse files
TarunAdoberubencarvalhocaseyisonit
authored
chore: command orchestration (#5791)
* chore: hoist dev commands to root packagejson * chore: add a root level eslint config file * fix(progress-circle): remove @spectrum-web-component/base dependency from next-gen * chore: update build commands in root packagejson * chore: run hmr on core for storybook and test * chore: fix test command in second-gen and add eslint dev dependency * chore: explicitly run prestorybook in second-gen * chore: update cem analyze command * chore: build ts before storybook in first-gen * chore: hoist license eslint rule to top --------- Co-authored-by: Rúben Carvalho <rubcar@sapo.pt> Co-authored-by: Casey Eickhoff <48574582+caseyisonit@users.noreply.github.com> Co-authored-by: Ruben Carvalho <rcarvalho@adobe.com>
1 parent a2c2853 commit 502ffc8

File tree

12 files changed

+290
-169
lines changed

12 files changed

+290
-169
lines changed

.eslintrc.json

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:prettier/recommended"
11+
],
12+
"overrides": [
13+
{
14+
"extends": ["plugin:jsonc/recommended-with-jsonc"],
15+
"files": ["*.json"],
16+
"parser": "jsonc-eslint-parser",
17+
"rules": {
18+
"jsonc/sort-keys": ["warn"]
19+
}
20+
},
21+
{
22+
"extends": ["plugin:jsonc/recommended-with-jsonc"],
23+
"files": ["package.json"],
24+
"parser": "jsonc-eslint-parser",
25+
"rules": {
26+
"jsonc/sort-keys": [
27+
"warn",
28+
{
29+
"hasProperties": ["type"],
30+
"order": [
31+
"$schema",
32+
"name",
33+
"version",
34+
"private",
35+
"description",
36+
"license",
37+
"author",
38+
"maintainers",
39+
"contributors",
40+
"homepage",
41+
"repository",
42+
"bugs",
43+
"type",
44+
"exports",
45+
"main",
46+
"module",
47+
"browser",
48+
"man",
49+
"preferGlobal",
50+
"bin",
51+
"files",
52+
"directories",
53+
"scripts",
54+
"config",
55+
"sideEffects",
56+
"types",
57+
"typings",
58+
"workspaces",
59+
"resolutions",
60+
"dependencies",
61+
"bundleDependencies",
62+
"bundledDependencies",
63+
"peerDependencies",
64+
"peerDependenciesMeta",
65+
"optionalDependencies",
66+
"devDependencies",
67+
"keywords",
68+
"engines",
69+
"engineStrict",
70+
"os",
71+
"cpu",
72+
"publishConfig"
73+
],
74+
"pathPattern": "^$"
75+
},
76+
{
77+
"order": { "type": "asc" },
78+
"pathPattern": "^(?!exports\\[).*"
79+
}
80+
]
81+
}
82+
},
83+
{
84+
"extends": ["./first-gen/.eslintrc.json"],
85+
"files": ["first-gen/**/*"],
86+
"rules": {
87+
"notice/notice": [
88+
"error",
89+
{
90+
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
91+
"templateFile": "config/license.js"
92+
}
93+
]
94+
}
95+
},
96+
{
97+
"extends": ["./second-gen/.eslintrc.json"],
98+
"files": ["second-gen/**/*"],
99+
"rules": {
100+
"notice/notice": [
101+
"error",
102+
{
103+
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
104+
"templateFile": "../../../config/license.js"
105+
}
106+
]
107+
}
108+
}
109+
],
110+
"parser": "@typescript-eslint/parser",
111+
"parserOptions": {
112+
"ecmaVersion": "latest",
113+
"sourceType": "module"
114+
},
115+
"plugins": ["@typescript-eslint"],
116+
"root": true,
117+
"rules": {
118+
"no-console": [
119+
"error",
120+
{
121+
"allow": ["warn", "error"]
122+
}
123+
],
124+
"no-debugger": 2
125+
}
126+
}

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@ jobs:
122122
level: error
123123
reporter: github-pr-review
124124
filter_mode: diff_context
125-
eslint_flags: '${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}'
125+
eslint_flags: '--config .eslintrc.json ${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}'
File renamed without changes.

first-gen/.eslintrc.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,11 @@
103103
],
104104
"parser": "@typescript-eslint/parser",
105105
"parserOptions": {
106-
"ecmaVersion": 2020,
106+
"ecmaVersion": "latest",
107107
"sourceType": "module"
108108
},
109109
"plugins": [
110110
"@typescript-eslint",
111-
"notice",
112111
"@spectrum-web-components",
113112
"import",
114113
"require-extensions"
@@ -150,13 +149,6 @@
150149
}
151150
],
152151
"no-debugger": 2,
153-
"notice/notice": [
154-
"error",
155-
{
156-
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
157-
"templateFile": "first-gen/config/license.js"
158-
}
159-
],
160152
"sort-imports": [
161153
"error",
162154
{

first-gen/package.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"scripts": {
1919
"analyze": "lit-analyzer \"{packages,tools}/*/src/**/!(*.css).ts\"",
2020
"build": "wireit",
21+
"prebuild": "wireit",
2122
"build:clear-cache": "rimraf packages/*/tsconfig.tsbuildinfo && rimraf tools/*/tsconfig.tsbuildinfo",
2223
"build:confirm": "node ./scripts/confirm-build.js",
2324
"build:css": "wireit",
@@ -62,7 +63,8 @@
6263
"process-icons": "wireit",
6364
"publish:react": "yarn changeset publish --no-git-tag --tag latest --no-push",
6465
"push-to-remote": "git add . && git commit -m \"chore: release new versions #publish\" && git push",
65-
"start": "yarn storybook",
66+
"dev:core": "yarn workspace @swc/core dev",
67+
"start": "run-p dev:core storybook",
6668
"storybook": "wireit",
6769
"storybook:build": "NODE_ENV=production storybook build -o projects/documentation/dist/storybook -c storybook",
6870
"storybook:quick": "run-p build:watch storybook:run",
@@ -82,7 +84,7 @@
8284
"test:visual:clean:current": "rimraf test/visual/screenshots-current",
8385
"test:watch": "yarn test:watch:focus unit",
8486
"test:watch:flags:focus": "yarn build && run-p build:watch \"test:start --watch --group {1} --config web-test-runner.config.ci-chromium-flags.js\" --",
85-
"test:watch:focus": "yarn build && run-p build:watch \"test:start --watch --group {1}\" --",
87+
"test:watch:focus": "yarn dev:core & yarn build && run-p build:watch \"test:start --watch --group {1}\" --",
8688
"version:update": "genversion --verbose --semi --esm ./tools/base/src/version.js",
8789
"vrt:preview": "yarn wds --config test/visual/wds-vrt.config.js"
8890
},
@@ -221,10 +223,21 @@
221223
"wireit": {
222224
"build": {
223225
"dependencies": [
226+
"prebuild",
224227
"build:ts",
225228
"build:types"
226229
]
227230
},
231+
"prebuild": {
232+
"command": "yarn workspace @swc/core build",
233+
"files": [
234+
"../second-gen/packages/core/components/**/*",
235+
"../second-gen/packages/core/shared/**/*",
236+
"../second-gen/packages/core/package.json",
237+
"../second-gen/packages/core/vite.config.js",
238+
"../second-gen/packages/core/tsconfig.json"
239+
]
240+
},
228241
"build:css": {
229242
"clean": "if-file-deleted",
230243
"command": "node ./scripts/build-css.js",
@@ -396,6 +409,7 @@
396409
"storybook": {
397410
"command": "storybook dev -p 8080 -c storybook",
398411
"dependencies": [
412+
"build:ts",
399413
"build:watch",
400414
"prestorybook"
401415
],

first-gen/packages/.eslintrc.json

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -142,48 +142,30 @@
142142
"@spectrum-web-components",
143143
"import"
144144
],
145-
"root": true,
146145
"rules": {
147-
"import/no-extraneous-dependencies": [
148-
"error",
149-
{
150-
"devDependencies": false,
151-
"optionalDependencies": false,
152-
"peerDependencies": false
153-
}
154-
],
155-
"no-debugger": 2,
156-
"no-console": [
157-
"error",
158-
{
159-
"allow": ["warn", "error"]
160-
}
161-
],
146+
"@spectrum-web-components/document-active-element": ["error"],
162147
"@spectrum-web-components/prevent-argument-names": [
163148
"error",
164149
["e", "ev", "evt", "err"]
165150
],
166-
"@spectrum-web-components/document-active-element": ["error"],
167-
"notice/notice": [
168-
"error",
169-
{
170-
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
171-
"templateFile": "first-gen/config/license.js"
172-
}
173-
],
174151
"@typescript-eslint/explicit-function-return-type": [
175152
1,
176153
{
177154
"allowExpressions": true
178155
}
179156
],
180-
"sort-imports": [
157+
"@typescript-eslint/no-unused-vars": [
181158
"error",
182159
{
183-
"ignoreCase": true,
184-
"ignoreDeclarationSort": true,
185-
"ignoreMemberSort": false,
186-
"allowSeparatedGroups": false
160+
"argsIgnorePattern": "^_"
161+
}
162+
],
163+
"import/no-extraneous-dependencies": [
164+
"error",
165+
{
166+
"devDependencies": false,
167+
"optionalDependencies": false,
168+
"peerDependencies": false
187169
}
188170
],
189171
"lit-a11y/click-events-have-key-events": [
@@ -201,10 +183,27 @@
201183
]
202184
}
203185
],
204-
"@typescript-eslint/no-unused-vars": [
186+
"no-console": [
205187
"error",
206188
{
207-
"argsIgnorePattern": "^_"
189+
"allow": ["warn", "error"]
190+
}
191+
],
192+
"no-debugger": 2,
193+
"notice/notice": [
194+
"error",
195+
{
196+
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
197+
"templateFile": "config/license.js"
198+
}
199+
],
200+
"sort-imports": [
201+
"error",
202+
{
203+
"allowSeparatedGroups": false,
204+
"ignoreCase": true,
205+
"ignoreDeclarationSort": true,
206+
"ignoreMemberSort": false
208207
}
209208
]
210209
}

0 commit comments

Comments
 (0)