You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Don't mess with things that don't have .spectrum-Heading in them
260
+
return selector;
261
+
},
262
+
}),
263
+
],
309
264
};
310
265
```
311
266
@@ -322,71 +277,53 @@ yarn install
322
277
yarn start
323
278
```
324
279
325
-
Your `dist/` folder should now have a local copy of the Spectrum CSS docs and minimal CSS files, and your browser should be open with the project's preview site. Editing any of the `.css` or the `.stories.js` files in `components/*` will update the project documentation and live reload in your browser.
280
+
Your `dist/` folder should now have a local copy of the compiled CSS files, and your browser should be open with the project's preview site. Editing any of the `.css` or the `.stories.js` files in `components/*` will update the project documentation and live reload in your browser.
326
281
327
-
**Important:** Ensure you have Node.js > 14 installed or the build system will not run. Node.js > 16.x is preferred.
282
+
**Important:** Ensure you have Node.js >= 14 installed or the build system will not run. Node.js 16.x is preferred.
328
283
329
-
This project is leveraging caching from [Nx](https://nx.dev/) to speed up the build process. If you are seeing unexpected results, you can clear the cache by running `yarn nx clean` or `yarn nx run-many --target clean --all`.
284
+
This project is leveraging caching from [Nx](https://nx.dev/) to speed up the build process. If you are seeing unexpected results, you can clear the cache by running `yarn nx reset`.
330
285
331
286
To spin up the local development environment ([Storybook](https://storybook.js.org/docs/web-components/get-started/introduction)) without first building the components, use: `SKIP_BUILD=true yarn start` as `yarn start` alone will start from a clean build.
332
287
333
288
### Documentation site
334
289
335
290
#### Local documentation site
336
291
337
-
Building the project will build and launch the project documentation site in your browser automatically.
338
-
339
-
See [site generation](site/README.md) for more information.
340
-
341
-
#### Generating and deploying external documentation site
342
-
343
-
Checkout `nextjs` branch, pull, and install dependencies.
344
-
345
-
```shell
346
-
git checkout nextjs
347
-
git pull
348
-
yarn install
349
-
```
350
-
351
-
Update `yml` data from main
352
-
353
-
```shell
354
-
yarn importdata
355
-
```
356
-
357
-
Run `prep` script to build the static site locally
292
+
After installing the project, you can spin up a local view of the documentation site with:
358
293
359
294
```shell
360
-
yarn prep
295
+
yarn dev
361
296
```
362
297
363
-
Commit changes
298
+
See [site generation](site/README.md) for more information. This is being imminently updated to 11ty so it's advised to hold off opening any pull requests to change the site until that is complete.
364
299
365
-
```shell
366
-
git commit -am '<message here>'
367
-
```
300
+
#### Generating and deploying external documentation site
368
301
369
-
Deploy
302
+
To generate the documentation site, run the following command:
370
303
371
304
```shell
372
-
yarn deploy
305
+
yarn release:site
373
306
```
374
307
375
-
Push changes to `nextjs` branch
376
-
377
-
```shell
378
-
git push origin nextjs
379
-
```
308
+
This will generate the documentation site in the `dist/` folder and push that content to gh-pages.
380
309
381
310
### CLI
382
311
383
312
The following tasks are available:
384
313
385
-
-`yarn build:all` - Performs a build of all components, documentation site, and storybook
386
-
-`yarn build` - Performs a build of all components
387
-
-`yarn dev` - Performs a component build, runs storybook, and serves the documentation on the default port (3000), then starts watching components and website files
388
-
-`yarn clean` - Cleans all output files for the project and all components
389
-
-`yarn watch` - Assuming a build has already been performed, re-starts starts watching components and website files. Presumes a browser is already open to your locally served docs
314
+
-`yarn build:all`: Performs a build of all components, documentation site, and storybook
315
+
-`yarn build`: Performs a build of all components
316
+
-`yarn build:components`: Builds components in parallel; uses cache
-`yarn clean`: Cleans all output files for the project and all components
320
+
-`yarn ci:storybook`: Builds storybook & dependencies (all components) for CI
321
+
-`yarn clean:components`: Deletes compiled assets for all component folders
322
+
-`yarn clean:preview`: Deletes the storybook compiled assets
323
+
-`yarn dev` - Performs a component build, runs storybook in the background on port (3000), then builds the documentation site, opening the content from `dist/`
324
+
-`yarn lint`: Lints packages and css for components
325
+
-`yarn start`: Triggers storybook build and dev server
326
+
-`yarn watch` - Assuming a build has already been performed, re-starts starts watching components and website files; Presumes a browser is already open to your locally served docs
390
327
391
328
---
392
329
@@ -396,41 +333,42 @@ The following tasks are available:
396
333
397
334
Releasing individual components is handled by Lerna. When any component or its dependencies change, Lerna will queue that component (and all of its dependents) up for a release.
398
335
399
-
To release everything that has changed, simply run:
336
+
To release everything that has changed, run:
400
337
401
338
```shell
402
339
yarn release
403
340
```
404
341
405
-
Version numbers are automatically determined, changelogs generated, and packages published.
342
+
A build of all components is run, then a `lerna publish` command is fired (with settings to prevent publishing private packages). Version numbers are automatically determined, changelogs generated, and packages published to npm.
406
343
407
-
### Releasing the website
344
+
<details>
345
+
<summary>Prereleases</summary>
408
346
409
-
After performing a release, run the following command to release the website:
347
+
Before changes are considered production-ready, a prerelease tag might be created to facilitate testing in downstream projects.
348
+
349
+
**Before starting, ensure that you're working from a branch other than `main`.**
350
+
351
+
Commit changes using the typical conventional commit syntax.
352
+
353
+
To publish a prerelease:
410
354
411
355
```shell
412
-
yarn release:docs
356
+
yarn release:beta
413
357
```
414
358
415
-
### Publishing prereleases
359
+
This will build the affected package(s) locally, then attempt to bump the version numbers in the affected package(s) (via `lerna publish from-package --conventional-prerelease --preid beta --pre-dist-tag beta --no-private`).
416
360
417
-
Occasionally, it can be helpful for our subscribers to test CSS changes before they're considered ready to be part of a stable release. To facilitate this, we can publish prerelease versions.
361
+
- Before publishing to npm, Lerna will show a preview of the affected package version numbers that look something like:
418
362
419
-
To publish prerelease versions:
420
-
421
-
- First, be sure that you're working on a branch other than `main`.
422
-
- Once your change(s) are ready to be committed, be aware of the severity of the change(s), and be sure to author your commit message so that Lerna understands how to increase the version number(s) of the affected components.
423
-
- Once your changes are committed, you **must** build the affected package(s) locally **before** publishing them to npm. An npm task for cleaning, building, and beta publishing is available, and it can be run via the following command: `yarn release:beta-from-package`. This command will perform a full `clean` (via the `clean` task), a full `build` (via the `build` task), and will attempt to bump the version numbers in the affected package(s) (via `lerna publish --conventional-prerelease --preid beta --pre-dist-tag beta --no-private`).
424
-
- Depending on the severity of your change(s), and before publishing to npm, Lerna should show a preview of the affected package version numbers that look something like: `@spectrum-css/tag: 3.3.8 => 3.3.9-beta.0`. Additionally, at this time, Lerna will ask if you would like to continue with publishing the changes or cancel.
425
-
- Selecting `y` to publish will publish the affected package(s) to npm.
At this time, Lerna will ask if you would like to continue with publishing the changes or cancel. Selecting `y` to publish will publish the affected package(s) to npm (assuming you have permissions to publish to npm for the project).
428
371
429
-
Occasionally, you may want to run a prerelease for an individual package and skip a version bump for consuming packages. It's possible to manually change a package's version number to achieve this.
372
+
Not sure if you have permissions? Try `npm login` first. Do not run the lerna release if you do not have permissions to publish to npm as it will leave the package(s) in a hanging state with tags in github but no published package(s) on npm.
430
373
431
-
- For the package that you want to prerelease, manually alter the version number in the package's `package.json` file.
432
-
- For example, let's say you'd like to release a `beta` version of the Switch component. In the Switch's `package.json`, manually change the `version` number from its current number (`"version": "1.0.23"`) to the next appropriate semver version number (`"version": "2.0.0-beta.0"`).
433
-
- Save your changes, and commit them with the appropriate conventional commit-style commit message: `chore(switch): manual version bump for beta release` or something similar.
434
-
- You **must** run a build **before** continuing with the prerelease. An npm task for cleaning, building, and beta publishing is available, and it can be run via the following command: `yarn release:beta-from-package`. This command will perform a full `clean` (via the `clean` task), a full `build` (via the `build` task), and will attempt to publish the package (via `lerna publish --conventional-prerelease --preid beta --pre-dist-tag beta --no-private`).
435
-
- Depending on the severity of your change(s), and before publishing to npm, Lerna should show a preview of the affected package version number that looks something like: `@spectrum-css/switch: 1.0.23 => 2.0.0-beta.0`. Additionally, at this time, Lerna will ask if you would like to continue with publishing the changes or cancel.
436
-
- Selecting `y` to publish will publish the affected package(s) to npm.
0 commit comments