Skip to content

Commit e0f9c5f

Browse files
committed
chore: script clean-up for packages and tokens[swc-808]
1 parent c20587b commit e0f9c5f

Some content is hidden

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

42 files changed

+227
-2645
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ custom-elements.json
3131
packages/*/src/**/*.css.js
3232
packages/*/custom-elements.json
3333
packages/**/*.js
34-
packages/**/spectrum-vars.json
3534
packages/**/*.js.map
3635
packages/**/*.d.ts
3736
packages/**/*.test-vrt.ts
@@ -50,7 +49,6 @@ projects/**/*.d.ts
5049

5150
tools/*/src/**/*.css.js
5251
tools/*/custom-elements.json
53-
tools/**/spectrum-vars.json
5452
tools/**/*.js
5553
tools/**/*.js.map
5654
tools/**/*.d.ts

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"files.exclude": {
33
"**/*.css.ts": { "when": "$(basename)" },
4-
"packages/*/src/spectrum-vars.json": true,
54
"packages/**/*.js.map": true,
65
"packages/**/*.js": { "when": "$(basename).ts" },
76
"packages/**/*.dev.js": { "when": "$(basename).js" },

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
@@ -92,9 +92,7 @@ The `:nonbreaking` variant lets us release patch updates quickly in cases where
9292
There are several commands that can be useful in specific scenarios:
9393

9494
- `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.
9695
- `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.
9896
- `yarn build` to make sure the available JS has been built from the current TS source.
9997

10098
## Linting

package.json

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"changeset-publish": "yarn prepublishOnly && yarn changeset version && yarn install && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag && yarn push-to-remote && yarn create-git-tag && yarn postpublish",
2727
"update-version": "node ./tasks/update-version.js",
2828
"chromatic": "chromatic --build-script-name storybook:build # note that --project-token must be set in your env variables",
29-
"create-git-tag": "node --no-warnings tasks/create-git-tag.js",
3029
"custom-element-json": "node tasks/custom-element-json.js",
3130
"docs:analyze": "cem analyze --globs \"packages/**/*.ts\" --exclude \"**/*.d.ts\" --exclude \"**/stories/**\" --exclude \"**/icons/**\" --exclude \"**/elements/**\" --outdir projects/documentation --litelement",
3231
"docs:build": "yarn workspace documentation build",
@@ -50,7 +49,6 @@
5049
"lint:versions": "node ./scripts/lint-versions.js",
5150
"new-package": "cd projects/templates && plop",
5251
"postcustom-element-json": "node ./tasks/run-check-cem.js",
53-
"postdocs:analyze": "node ./scripts/add-custom-properties.js --src=\"projects/documentation/custom-elements.json\"",
5452
"postinstall": "husky || true && patch-package",
5553
"postpublish": "yarn prepublish:react && yarn publish:react && yarn postpublish:react",
5654
"postpublish:react": "git reset --hard HEAD^ && git prune && rimraf react",
@@ -65,7 +63,6 @@
6563
"pretest:bench": "yarn build:tests && test -f test/benchmark/cli.js ||:",
6664
"pretest:visual": "yarn build && yarn build",
6765
"process-icons": "wireit",
68-
"process-spectrum": "wireit",
6966
"publish:react": "yarn changeset publish --no-git-tag --tag snapshot --no-push",
7067
"push-to-remote": "git add . && git commit -m \"chore: release new versions #publish\" && git push",
7168
"start": "yarn storybook",
@@ -89,9 +86,6 @@
8986
"test:watch": "yarn test:watch:focus unit",
9087
"test:watch:flags:focus": "yarn build && run-p build:watch \"test:start --watch --group {1} --config web-test-runner.config.ci-chromium-flags.js\" --",
9188
"test:watch:focus": "yarn build && run-p build:watch \"test:start --watch --group {1}\" --",
92-
"update:spectrum-css": "node ./scripts/update-spectrum-css.js --latest || yarn update:spectrum-css:cleanup",
93-
"update:spectrum-css:cleanup": "yarn lint:packagejson && yarn --ignore-scripts && yarn process-spectrum",
94-
"update:spectrum-css:nonbreaking": "node ./scripts/update-spectrum-css.js || yarn update:spectrum-css:cleanup",
9589
"verify-build-artifacts": "node ./scripts/verify-build-artifacts.js",
9690
"vrt:preview": "yarn wds --config test/visual/wds-vrt.config.js",
9791
"vrt:quick-link": "yarn netlify deploy --alias=vrt --dir=projects/vrt-quick-link"
@@ -212,14 +206,10 @@
212206
},
213207
"build:css": {
214208
"command": "node ./tasks/build-css.js",
215-
"dependencies": [
216-
"process-spectrum"
217-
],
218209
"files": [
219210
"packages/**/*.css",
220211
"tools/**/*.css",
221-
"tasks/build-css.js",
222-
"tasks/css-tools.js"
212+
"tasks/build-css.js"
223213
],
224214
"output": [
225215
"packages/**/*.css.ts",
@@ -385,33 +375,6 @@
385375
"icons:workflow"
386376
]
387377
},
388-
"process-spectrum": {
389-
"command": "node ./scripts/spectrum-vars.js && node ./tasks/process-spectrum.js && node ./scripts/generate-tokens.js && yarn format:css",
390-
"files": [
391-
"tasks/process-spectrum.js",
392-
"packages/**/spectrum-config.js",
393-
"tools/**/spectrum-config.js",
394-
"node_modules/@spectrum-css/**/index-vars.css",
395-
"scripts/generate-tokens.js",
396-
"scripts/generate-tokens-wrapper.js",
397-
"node_modules/@spectrum-css/**/*.css",
398-
"scripts/spectrum-vars.js",
399-
"tools/styles/package.json",
400-
".prettierrc.yaml",
401-
".stylelintrc.json"
402-
],
403-
"output": [
404-
"packages/*/src/spectrum-*.css",
405-
"tools/*/src/spectrum-*.css",
406-
"tools/styles/*.css",
407-
"tools/styles/express/*.css",
408-
"!tools/styles/scale-*.css",
409-
"!tools/styles/theme-*.css",
410-
"!tools/styles/express/scale-*.css",
411-
"!tools/styles/express/theme-*.css"
412-
],
413-
"clean": false
414-
},
415378
"storybook": {
416379
"command": "storybook dev -p 8080 -c storybook",
417380
"service": true,

packages/action-group/src/action-group.css

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,16 @@ governing permissions and limitations under the License.
1616
:host([size='xs']) {
1717
--spectrum-actiongroup-horizontal-spacing-regular: var(
1818
--spectrum-spacing-75
19-
); /* .spectrum-ActionGroup--sizeS */
19+
);
2020

2121
--spectrum-actiongroup-vertical-spacing-regular: var(--spectrum-spacing-75);
2222
}
2323

24-
/**
25-
* The following styles corrects issues found in the Spectrum CSS output
26-
* that are tracked via: https://github.com/adobe/spectrum-css/issues/795
27-
*/
28-
2924
:host([dir][compact][vertical]) ::slotted(:nth-child(n)) {
3025
margin-right: 0;
3126
margin-left: 0;
3227
}
3328

34-
/**
35-
* End Spectrum CSS #795 fixes.
36-
*/
37-
38-
/**
39-
* The following styles correct realities outlined in https://github.com/adobe/spectrum-web-components/issues/1434
40-
*/
41-
4229
:host([justified]) ::slotted(:not([role])),
4330
:host([vertical]) ::slotted(:not([role])) {
4431
display: flex;
@@ -47,13 +34,11 @@ governing permissions and limitations under the License.
4734
}
4835

4936
:host([compact]:not([quiet])) ::slotted(:not([role])) {
50-
/* .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item */
5137
--overriden-border-radius: 0;
5238
--mod-actionbutton-border-radius: var(--overriden-border-radius);
5339
}
5440

5541
:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):first-child) {
56-
/* [dir=ltr] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:first-child */
5742
--overriden-border-radius: var(
5843
--mod-actiongroup-border-radius,
5944
var(--spectrum-actiongroup-border-radius)
@@ -66,7 +51,6 @@ governing permissions and limitations under the License.
6651
}
6752

6853
:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):last-child) {
69-
/* [dir=ltr] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:last-child */
7054
--overriden-border-radius: 0 0
7155
var(
7256
--mod-actiongroup-border-radius,
@@ -80,7 +64,6 @@ governing permissions and limitations under the License.
8064

8165
:host([dir='ltr'][compact]:not([quiet], [vertical]))
8266
::slotted(:not([role]):first-child) {
83-
/* [dir=ltr] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:first-child */
8467
--overriden-border-radius: var(
8568
--mod-actiongroup-border-radius,
8669
var(--spectrum-actiongroup-border-radius)
@@ -94,7 +77,6 @@ governing permissions and limitations under the License.
9477

9578
:host([dir='rtl'][compact]:not([quiet], [vertical]))
9679
::slotted(:not([role]):first-child) {
97-
/* [dir=rtl] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:first-child */
9880
--overriden-border-radius: 0
9981
var(
10082
--mod-actiongroup-border-radius,
@@ -109,7 +91,6 @@ governing permissions and limitations under the License.
10991

11092
:host([dir='ltr'][compact]:not([quiet], [vertical]))
11193
::slotted(:not([role]):last-child) {
112-
/* [dir=ltr] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:last-child */
11394
--overriden-border-radius: 0
11495
var(
11596
--mod-actiongroup-border-radius,
@@ -124,7 +105,6 @@ governing permissions and limitations under the License.
124105

125106
:host([dir='rtl'][compact]:not([quiet], [vertical]))
126107
::slotted(:not([role]):last-child) {
127-
/* [dir=rtl] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:last-child */
128108
--overriden-border-radius: var(
129109
--mod-actiongroup-border-radius,
130110
var(--spectrum-actiongroup-border-radius)
@@ -141,7 +121,6 @@ governing permissions and limitations under the License.
141121
}
142122

143123
:host([compact][vertical]:not([quiet])) ::slotted(:first-child) {
144-
/* [dir=ltr] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:first-child */
145124
--mod-actionbutton-focus-ring-border-radius: var(
146125
--spectrum-alias-component-border-radius
147126
)
@@ -153,7 +132,6 @@ governing permissions and limitations under the License.
153132
}
154133

155134
:host([compact][vertical]:not([quiet])) ::slotted(:last-child) {
156-
/* [dir=ltr] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:last-child */
157135
--mod-actionbutton-focus-ring-border-radius: 0 0
158136
var(
159137
--mod-actiongroup-border-radius,
@@ -166,7 +144,6 @@ governing permissions and limitations under the License.
166144
}
167145

168146
:host([dir='ltr'][compact]:not([quiet], [vertical])) ::slotted(:first-child) {
169-
/* [dir=ltr] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:first-child */
170147
--mod-actionbutton-focus-ring-border-radius: var(
171148
--spectrum-alias-component-border-radius
172149
)
@@ -178,7 +155,6 @@ governing permissions and limitations under the License.
178155
}
179156

180157
:host([dir='rtl'][compact]:not([quiet], [vertical])) ::slotted(:first-child) {
181-
/* [dir=rtl] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:first-child */
182158
--mod-actionbutton-focus-ring-border-radius: 0
183159
var(
184160
--mod-actiongroup-border-radius,
@@ -192,7 +168,6 @@ governing permissions and limitations under the License.
192168
}
193169

194170
:host([dir='ltr'][compact]:not([quiet], [vertical])) ::slotted(:last-child) {
195-
/* [dir=ltr] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:last-child */
196171
--mod-actionbutton-focus-ring-border-radius: 0
197172
var(
198173
--mod-actiongroup-border-radius,
@@ -206,7 +181,6 @@ governing permissions and limitations under the License.
206181
}
207182

208183
:host([dir='rtl'][compact]:not([quiet], [vertical])) ::slotted(:last-child) {
209-
/* [dir=rtl] .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:last-child */
210184
--mod-actionbutton-focus-ring-border-radius: var(
211185
--spectrum-alias-component-border-radius
212186
)

packages/button/src/button-base.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ governing permissions and limitations under the License.
2121
}
2222

2323
:host([dir]) {
24-
/* spectrum-css uses "-webkit-appearance: button" to workaround an
25-
* iOS and Safari issue. However, it results in incorrect styling
26-
* when applied in :host
27-
*/
2824
-webkit-appearance: none; /* stylelint-disable-line */
2925
}
3026

packages/card/src/card.css

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ governing permissions and limitations under the License.
3535
margin-right: auto;
3636
}
3737

38-
/* The description slot has a psuedo-element that also needs to receive the font styling.
38+
/* The description slot has a psuedo-element that also needs to receive the font styling.
3939
We need to add the declaration to the slot as well */
4040
slot[name='description'] {
4141
font-size: var(
@@ -54,8 +54,7 @@ slot[name='description'] {
5454
display: block;
5555

5656
/* Since we're using <img> tags instead of background-image for the cover photo,
57-
we need an additional object-fit property to preserve the aspect ratio of the image
58-
In spectrum-css, background-size is used */
57+
we need an additional object-fit property to preserve the aspect ratio of the image */
5958
object-fit: cover;
6059
}
6160

@@ -81,15 +80,14 @@ sp-popover {
8180
}
8281

8382
/**
84-
* Allow that the heading element will take specified use of the available width whether
83+
* Allow that the heading element will take specified use of the available width whether
8584
* "actions" are supplied to the element or not.
8685
**/
8786
.title {
8887
width: var(--spectrum-card-title-width);
8988
}
9089

9190
.subtitle {
92-
/* Override until https://github.com/adobe/spectrum-css/issues/1054 is fixed */
9391
text-transform: none;
9492
}
9593

packages/icons-workflow/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
"case": "^1.6.1",
6161
"cheerio": "^1.0.0-rc.2",
6262
"fast-glob": "^3.2.12",
63-
"fs": "^0.0.1-security",
64-
"path": "^0.12.7",
6563
"prettier": "^3.0.0"
6664
},
6765
"types": "./src/index.d.ts",

packages/radio/src/radio.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ governing permissions and limitations under the License.
2121
pointer-events: none;
2222
}
2323

24-
/**
25-
* Work around for https://github.com/adobe/spectrum-css/issues/2251
26-
**/
2724
:host([dir='rtl']) #button:after {
2825
transform: translateX(50%) translateY(-50%);
2926
}
30-
31-
/**
32-
* End workaround
33-
**/

packages/slider/src/slider.css

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ governing permissions and limitations under the License.
1313
@import url('./spectrum-slider.css');
1414
@import url('./slider-overrides.css');
1515

16-
/*
16+
/**
1717
* Removes blue outline from :host when it is being focused.
18-
* This situation is not addressed in spectrum-css because the slider element itself
19-
* is not intended to receive focus.
20-
* This is not the case with web-components. The :host will receive focus when
21-
* interacting with the slider via the mouse.
18+
* The :host will receive focus when interacting with the
19+
* slider via the mouse.
2220
*/
2321
:host(:focus) {
2422
outline: 0;
@@ -95,11 +93,6 @@ governing permissions and limitations under the License.
9593
transform: translate(50%, -50%);
9694
}
9795

98-
/*
99-
* The following three declarationsa required while https://github.com/adobe/spectrum-css/issues/521
100-
* waits to be addressed at the Spectrum CSS level.
101-
*/
102-
10396
.track:before {
10497
background-size: var(--spectrum-slider-track-background-size) !important;
10598
}

packages/swatch/src/swatch.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ governing permissions and limitations under the License.
1313
@import url('./spectrum-swatch.css');
1414
@import url('./swatch-overrides.css');
1515

16-
/**
17-
* Begin work around for https://github.com/adobe/spectrum-css/issues/1460
18-
*/
19-
2016
.fill:before {
2117
background: var(--spectrum-picked-color, transparent);
2218
}
@@ -28,7 +24,3 @@ governing permissions and limitations under the License.
2824
:host .is-image .fill:before {
2925
background: #0000;
3026
}
31-
32-
/**
33-
* End workaround for https://github.com/adobe/spectrum-css/issues/1460
34-
*/

packages/switch/src/switch-legacy.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ governing permissions and limitations under the License.
1111
*/
1212

1313
#switch::before {
14-
/* This rule includes all of the transitions from spectrum-css except the
15-
* one for the transform attribute, which causes issue in Edge.
16-
*/
1714
transition:
1815
background var(--spectrum-animation-duration-100, 0.13s) ease-in-out,
1916
border var(--spectrum-animation-duration-100, 0.13s) ease-in-out,

packages/tabs/src/tabs.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ governing permissions and limitations under the License.
5555
color: var(--mod-tabs-color-disabled, var(--spectrum-tabs-color-disabled));
5656
}
5757

58-
/*
59-
* TODO remove after next tabs release
60-
* While https://github.com/adobe/spectrum-css/issues/641 goes unaddressed,
61-
* then we'll need to place this at `top: 0;` ourselves.
62-
*/
6358
:host([direction='vertical-right']) #list #selection-indicator,
6459
:host([direction='vertical']) #list #selection-indicator {
6560
inset-block-start: 0;

0 commit comments

Comments
 (0)