Skip to content

Commit ee6690a

Browse files
committed
Update demo script documentation and add pnpm demos:update script
1 parent 33c2884 commit ee6690a

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"docs:start": "pnpm --filter docs start",
1919
"docs:clear": "pnpm --filter docs clear",
2020
"demos:link": "tsc -b scripts && node scripts/dist/demos-use-workspace.js",
21+
"demos:update": "tsc -b scripts && node scripts/dist/bump-demo-packages.js",
2122
"format": "prettier --write .",
2223
"lint": "eslint .",
2324
"release": "pnpm build:packages:prod && pnpm changeset publish",

scripts/demos-use-workspace.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
/**
2-
* Users want to be able to run 'pnpm build:packages', cd into a demo,
3-
* run 'pnpm install && pnpm build', and have just that demo's packages
4-
* installed. Currently, this is not possible, as demos are included in
5-
* the pnpm workspace and therefore all demos' packages will be installed.
2+
* This script is for use by SDK devs who want to test their local
3+
* package changes against the demo apps.
64
*
7-
* This script goes through every package in 'demos/*' and replaces the
8-
* workspace packages' versions with 'workspace:*', allowing for easy
9-
* testing of new versions for SDK developers, as well as small
10-
* node_modules folders for SDK users.
11-
*
12-
* This way, users can use 'pnpm --ignore-workspace install && pnpm build',
13-
* while SDK devs can use 'tsx ./scripts/link-demos.ts' to build demos.
14-
*
15-
* Most of this code is copied from './scripts/isolated-demo-test.ts'.
5+
* Make sure to add ` - demos/*` to the root pnpm-workspace.yaml.
6+
* If you want to restore the demos' package.json versions, either run
7+
* `git restore demos`, or run `pnpm demos:update` if you have made
8+
* other modifications to the package.json.
169
*/
1710

1811
import { findWorkspacePackages } from '@pnpm/workspace.find-packages';

0 commit comments

Comments
 (0)