Skip to content

Commit 47765ef

Browse files
committed
chore(package): add setup script
1 parent 09020ab commit 47765ef

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

CONTRIBUTING.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,22 @@ git remote -v
2727

2828
### Install
2929

30-
Install the project dependencies.
30+
Install all dependencies (root and docs) and generate TypeScript definitions and `docs/src/COMPONENT_API.json`:
3131

3232
```sh
33-
bun install
33+
bun setup
3434
```
3535

36+
This single command runs `bun install` in both the project root and `docs/`, then runs `bun build:docs`.
37+
3638
## Documentation set-up
3739

3840
Component documentation is located in the `docs` folder. The site uses [Vite](https://vitejs.dev/), [Routify 3](https://routify.dev/docs), Svelte 5, and MDsveX. The Vite config resolves `carbon-components-svelte` to the repository root, so edits under `src/` are picked up without a separate package link.
3941

40-
When developing the docs site, you must first generate `docs/src/COMPONENT_API.json` and the TypeScript definitions in `src/` (these are not committed; see `.gitignore`). From the project root, run:
41-
42-
```sh
43-
bun i
44-
bun build:docs
45-
```
46-
47-
Then install docs dependencies and start the dev server:
42+
After running `bun setup`, start the docs dev server:
4843

4944
```sh
5045
cd docs
51-
bun i
5246
bun dev
5347
```
5448

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"css/*.css"
3131
],
3232
"scripts": {
33+
"setup": "bun install && cd docs && bun install && cd .. && bun build:docs",
3334
"test": "vitest",
3435
"test:src-types": "tsc --project tsconfig.types.json",
3536
"test:types": "svelte-check --workspace tests --fail-on-warnings",

0 commit comments

Comments
 (0)