Skip to content

Commit 5b6021c

Browse files
authored
chore: add constraints and bundler logic to precommit (#3578)
1 parent 7d37682 commit 5b6021c

File tree

9 files changed

+383
-418
lines changed

9 files changed

+383
-418
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ The following tasks are available:
217217
| `clean` | Cleans all output files for the project and all components | `yarn clean` |
218218
| `build` | Performs a build of all components | `yarn build` |
219219
| `bundle` | Creates a bundled asset for use in demos or development environments | `yarn bundle` |
220-
| `refresh:bundle` | Updates the `tools/bundle/package.json` to accurately reflect the packages in `components/*` and refreshes the `tools/bundle/src/index.css` to include all relevant imports. | `yarn refresh:bundle` |
221220
| `start` | Performs a local development build of Storybook | `yarn start` |
222221
| `compare` | This compares the current version of components with the previous versions published to NPM and output a list of all the changes that have been made. This is useful for reviewing changes before a release. The information is provided in the command-line output as well as in a simple web page that is opened in your default browser upon completion. The web page includes links to the visual diffs for each component when the file sizes have changed. <ul><li>Components with no changes are not included in the output.</li><li>To run comparisons on one or multiple components, `compare` accepts a list of components as arguments. For example, `yarn compare button` will compare the current version of the button component with the previous version published to NPM. `yarn compare button checkbox` will compare the current version of the button and checkbox components with the previous versions published to NPM.</li><li>Named components should be space-separated.</li><li>Running `compare` with no inputs will automatically run against all packages.</li></ul> | `yarn compare`<br/>`yarn compare accordion`<br/>`yarn compare accordion actionbutton` |
223222
| `lint` | Provides helpful updates and warnings for a component's package.json file. This helps keep all components in alignment. Use `format` to automatically fix any issues that are found. To run on a single component, use `yarn linter accordion` (where `accordion` is the name of the component or components you want to lint). | `yarn lint`<br/>`yarn linter accordion`<br/>`yarn linter accordion actionbutton` |

components/commons/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@spectrum-css/tokens": ">=16.0.1"
3131
},
3232
"devDependencies": {
33-
"@spectrum-css/tokens": "workspace:^"
33+
"@spectrum-css/tokens": "16.0.1"
3434
},
3535
"keywords": [
3636
"design-system",

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"precommit": "lint-staged --allow-empty --config lint-staged.config.js",
4343
"publish:docs": "cross-env NODE_ENV=production yarn build:docs && gh-pages -d dist/ -f -e . --nojekyll",
4444
"refresh": "yarn refresh:env && yarn refresh:config",
45-
"refresh:bundle": "nx refresh bundle",
4645
"refresh:config": "bash ./tasks/chromatic-config-creation.sh || exit 0",
4746
"refresh:env": "bash ./tasks/copy-env-from-root.sh || exit 0",
4847
"release": "yarn ci && changeset publish",
@@ -72,9 +71,9 @@
7271
"@commitlint/cli": "^19.6.1",
7372
"@commitlint/config-conventional": "^19.6.0",
7473
"@nx/devkit": "^19.8.2",
75-
"@spectrum-tools/postcss-add-theming-layer": "workspace:^",
76-
"@spectrum-tools/postcss-property-rollup": "workspace:^",
77-
"@spectrum-tools/postcss-rgb-mapping": "workspace:^",
74+
"@spectrum-tools/postcss-add-theming-layer": "1.0.1",
75+
"@spectrum-tools/postcss-property-rollup": "0.0.1",
76+
"@spectrum-tools/postcss-rgb-mapping": "1.0.0",
7877
"@yarnpkg/types": "^4.0.0",
7978
"at-rule-packer": "^0.4.2",
8079
"autoprefixer": "^10.4.19",

tools/bundle/package.json

+89-86
Original file line numberDiff line numberDiff line change
@@ -30,91 +30,91 @@
3030
},
3131
"main": "dist/index.css",
3232
"devDependencies": {
33-
"@spectrum-css/accordion": "workspace:^",
34-
"@spectrum-css/actionbar": "workspace:^",
35-
"@spectrum-css/actionbutton": "workspace:^",
36-
"@spectrum-css/actiongroup": "workspace:^",
37-
"@spectrum-css/actionmenu": "workspace:^",
38-
"@spectrum-css/alertbanner": "workspace:^",
39-
"@spectrum-css/alertdialog": "workspace:^",
40-
"@spectrum-css/asset": "workspace:^",
41-
"@spectrum-css/assetcard": "workspace:^",
42-
"@spectrum-css/assetlist": "workspace:^",
43-
"@spectrum-css/avatar": "workspace:^",
44-
"@spectrum-css/badge": "workspace:^",
45-
"@spectrum-css/breadcrumb": "workspace:^",
46-
"@spectrum-css/button": "workspace:^",
47-
"@spectrum-css/buttongroup": "workspace:^",
48-
"@spectrum-css/calendar": "workspace:^",
49-
"@spectrum-css/card": "workspace:^",
50-
"@spectrum-css/checkbox": "workspace:^",
51-
"@spectrum-css/clearbutton": "workspace:^",
52-
"@spectrum-css/closebutton": "workspace:^",
53-
"@spectrum-css/coachindicator": "workspace:^",
54-
"@spectrum-css/coachmark": "workspace:^",
55-
"@spectrum-css/colorarea": "workspace:^",
56-
"@spectrum-css/colorhandle": "workspace:^",
57-
"@spectrum-css/colorloupe": "workspace:^",
58-
"@spectrum-css/colorslider": "workspace:^",
59-
"@spectrum-css/colorwheel": "workspace:^",
60-
"@spectrum-css/combobox": "workspace:^",
61-
"@spectrum-css/commons": "workspace:^",
62-
"@spectrum-css/contextualhelp": "workspace:^",
63-
"@spectrum-css/datepicker": "workspace:^",
64-
"@spectrum-css/dial": "workspace:^",
65-
"@spectrum-css/dialog": "workspace:^",
66-
"@spectrum-css/divider": "workspace:^",
67-
"@spectrum-css/dropindicator": "workspace:^",
68-
"@spectrum-css/dropzone": "workspace:^",
69-
"@spectrum-css/fieldgroup": "workspace:^",
70-
"@spectrum-css/fieldlabel": "workspace:^",
71-
"@spectrum-css/floatingactionbutton": "workspace:^",
72-
"@spectrum-css/form": "workspace:^",
73-
"@spectrum-css/helptext": "workspace:^",
74-
"@spectrum-css/icon": "workspace:^",
75-
"@spectrum-css/illustratedmessage": "workspace:^",
76-
"@spectrum-css/infieldbutton": "workspace:^",
77-
"@spectrum-css/inlinealert": "workspace:^",
78-
"@spectrum-css/link": "workspace:^",
79-
"@spectrum-css/logicbutton": "workspace:^",
80-
"@spectrum-css/menu": "workspace:^",
81-
"@spectrum-css/meter": "workspace:^",
82-
"@spectrum-css/miller": "workspace:^",
83-
"@spectrum-css/modal": "workspace:^",
84-
"@spectrum-css/opacitycheckerboard": "workspace:^",
85-
"@spectrum-css/page": "workspace:^",
86-
"@spectrum-css/pagination": "workspace:^",
87-
"@spectrum-css/picker": "workspace:^",
88-
"@spectrum-css/pickerbutton": "workspace:^",
89-
"@spectrum-css/popover": "workspace:^",
90-
"@spectrum-css/progressbar": "workspace:^",
91-
"@spectrum-css/progresscircle": "workspace:^",
92-
"@spectrum-css/radio": "workspace:^",
93-
"@spectrum-css/rating": "workspace:^",
94-
"@spectrum-css/search": "workspace:^",
95-
"@spectrum-css/sidenav": "workspace:^",
96-
"@spectrum-css/slider": "workspace:^",
97-
"@spectrum-css/splitview": "workspace:^",
98-
"@spectrum-css/statuslight": "workspace:^",
99-
"@spectrum-css/steplist": "workspace:^",
100-
"@spectrum-css/stepper": "workspace:^",
101-
"@spectrum-css/swatch": "workspace:^",
102-
"@spectrum-css/swatchgroup": "workspace:^",
103-
"@spectrum-css/switch": "workspace:^",
104-
"@spectrum-css/table": "workspace:^",
105-
"@spectrum-css/tabs": "workspace:^",
106-
"@spectrum-css/tag": "workspace:^",
107-
"@spectrum-css/taggroup": "workspace:^",
108-
"@spectrum-css/textfield": "workspace:^",
109-
"@spectrum-css/thumbnail": "workspace:^",
110-
"@spectrum-css/toast": "workspace:^",
111-
"@spectrum-css/tokens": "workspace:^",
112-
"@spectrum-css/tooltip": "workspace:^",
113-
"@spectrum-css/tray": "workspace:^",
114-
"@spectrum-css/treeview": "workspace:^",
115-
"@spectrum-css/typography": "workspace:^",
116-
"@spectrum-css/underlay": "workspace:^",
117-
"@spectrum-css/well": "workspace:^",
33+
"@spectrum-css/accordion": "7.1.0",
34+
"@spectrum-css/actionbar": "10.1.1",
35+
"@spectrum-css/actionbutton": "7.1.1",
36+
"@spectrum-css/actiongroup": "6.1.0",
37+
"@spectrum-css/actionmenu": "7.1.1",
38+
"@spectrum-css/alertbanner": "3.1.0",
39+
"@spectrum-css/alertdialog": "4.1.0",
40+
"@spectrum-css/asset": "7.1.0",
41+
"@spectrum-css/assetcard": "5.1.0",
42+
"@spectrum-css/assetlist": "8.1.0",
43+
"@spectrum-css/avatar": "9.1.0",
44+
"@spectrum-css/badge": "6.1.0",
45+
"@spectrum-css/breadcrumb": "11.1.0",
46+
"@spectrum-css/button": "14.1.1",
47+
"@spectrum-css/buttongroup": "9.1.0",
48+
"@spectrum-css/calendar": "7.1.0",
49+
"@spectrum-css/card": "11.1.0",
50+
"@spectrum-css/checkbox": "10.1.0",
51+
"@spectrum-css/clearbutton": "7.1.0",
52+
"@spectrum-css/closebutton": "6.1.0",
53+
"@spectrum-css/coachindicator": "4.1.0",
54+
"@spectrum-css/coachmark": "9.1.1",
55+
"@spectrum-css/colorarea": "7.1.0",
56+
"@spectrum-css/colorhandle": "10.1.0",
57+
"@spectrum-css/colorloupe": "7.1.0",
58+
"@spectrum-css/colorslider": "8.1.0",
59+
"@spectrum-css/colorwheel": "6.1.0",
60+
"@spectrum-css/combobox": "4.1.1",
61+
"@spectrum-css/commons": "11.0.0",
62+
"@spectrum-css/contextualhelp": "5.1.2",
63+
"@spectrum-css/datepicker": "4.1.1",
64+
"@spectrum-css/dial": "5.1.0",
65+
"@spectrum-css/dialog": "12.1.0",
66+
"@spectrum-css/divider": "5.1.0",
67+
"@spectrum-css/dropindicator": "7.1.0",
68+
"@spectrum-css/dropzone": "8.1.0",
69+
"@spectrum-css/fieldgroup": "7.1.0",
70+
"@spectrum-css/fieldlabel": "10.1.0",
71+
"@spectrum-css/floatingactionbutton": "4.1.0",
72+
"@spectrum-css/form": "1.1.0",
73+
"@spectrum-css/helptext": "7.1.0",
74+
"@spectrum-css/icon": "9.1.0",
75+
"@spectrum-css/illustratedmessage": "9.1.0",
76+
"@spectrum-css/infieldbutton": "6.1.0",
77+
"@spectrum-css/inlinealert": "10.1.0",
78+
"@spectrum-css/link": "7.1.0",
79+
"@spectrum-css/logicbutton": "6.1.0",
80+
"@spectrum-css/menu": "9.1.0",
81+
"@spectrum-css/meter": "1.1.0",
82+
"@spectrum-css/miller": "8.1.0",
83+
"@spectrum-css/modal": "7.1.0",
84+
"@spectrum-css/opacitycheckerboard": "4.1.0",
85+
"@spectrum-css/page": "9.1.0",
86+
"@spectrum-css/pagination": "10.1.0",
87+
"@spectrum-css/picker": "9.1.1",
88+
"@spectrum-css/pickerbutton": "6.1.1",
89+
"@spectrum-css/popover": "8.2.0",
90+
"@spectrum-css/progressbar": "6.1.0",
91+
"@spectrum-css/progresscircle": "5.1.0",
92+
"@spectrum-css/radio": "10.1.0",
93+
"@spectrum-css/rating": "6.1.0",
94+
"@spectrum-css/search": "8.1.0",
95+
"@spectrum-css/sidenav": "7.1.0",
96+
"@spectrum-css/slider": "6.1.0",
97+
"@spectrum-css/splitview": "7.1.0",
98+
"@spectrum-css/statuslight": "9.1.0",
99+
"@spectrum-css/steplist": "7.1.0",
100+
"@spectrum-css/stepper": "7.1.0",
101+
"@spectrum-css/swatch": "8.1.1",
102+
"@spectrum-css/swatchgroup": "5.1.0",
103+
"@spectrum-css/switch": "6.1.0",
104+
"@spectrum-css/table": "8.1.0",
105+
"@spectrum-css/tabs": "6.1.1",
106+
"@spectrum-css/tag": "10.1.0",
107+
"@spectrum-css/taggroup": "7.1.0",
108+
"@spectrum-css/textfield": "8.1.0",
109+
"@spectrum-css/thumbnail": "8.1.0",
110+
"@spectrum-css/toast": "11.1.0",
111+
"@spectrum-css/tokens": "16.0.1",
112+
"@spectrum-css/tooltip": "7.1.0",
113+
"@spectrum-css/tray": "5.1.0",
114+
"@spectrum-css/treeview": "12.1.0",
115+
"@spectrum-css/typography": "8.1.0",
116+
"@spectrum-css/underlay": "6.1.0",
117+
"@spectrum-css/well": "7.1.0",
118118
"colors": "^1.4.0",
119119
"postcss": "^8.5.3",
120120
"postcss-licensing": "^2.0.0"
@@ -125,5 +125,8 @@
125125
"spectrum-css",
126126
"adobe",
127127
"adobe-spectrum"
128-
]
128+
],
129+
"publishConfig": {
130+
"access": "public"
131+
}
129132
}

tools/bundle/project.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"targets": {
99
"build": {
10-
"dependsOn": ["clean", "^build"],
10+
"dependsOn": ["clean", "^build", "refresh"],
1111
"executor": "nx:run-commands",
1212
"inputs": [
1313
"core",
@@ -25,7 +25,12 @@
2525
"{projectRoot}/dist/index.css.map"
2626
]
2727
},
28-
"clean": {},
28+
"clean": {
29+
"inputs": [
30+
"{projectRoot}/dist/*.{css,json}",
31+
{ "externalDependencies": ["rimraf"] }
32+
]
33+
},
2934
"format": {},
3035
"lint": {},
3136
"refresh": {

tools/bundle/src/index.css

+1-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
* governing permissions and limitations under the License.
1212
*/
1313

14-
/**
15-
* This file is machine generated.
16-
*
17-
* To update, run `yarn refresh:bundle`
18-
* from the project root for Spectrum CSS.
19-
*/
14+
/** This file is machine generated. */
2015

2116
/* --- CORE TOKENS --- */
2217
@import "@spectrum-css/tokens";

0 commit comments

Comments
 (0)