Skip to content

Commit 174939c

Browse files
committed
chore: update play script
1 parent 98e943c commit 174939c

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"build": "turbo run build --concurrency=3",
1818
"watch": "pnpm -r run watch",
1919
"play": "tsx scripts/play.ts",
20+
"dev": "tsx scripts/play.ts",
2021
"docs": "pnpm -C docs run docs",
2122
"docs:build": "pnpm -C docs run docs:build",
2223
"docs:serve": "pnpm -C docs run docs:serve",

scripts/play.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import prompts from 'prompts'
1212
* new example, plugin, or other playground shows up here for free, with no
1313
* change to this script.
1414
*/
15-
const WORKSPACE_PATTERNS = ['packages/*', 'plugins/*', 'examples/*', 'storybook', 'docs']
15+
const WORKSPACE_PATTERNS = ['examples/*', 'packages/*', 'plugins/*', 'storybook']
1616

1717
/**
1818
* Script names that make a workspace package runnable as a "play" — the
1919
* first one present in a package's `scripts` wins.
2020
*/
21-
const RUN_SCRIPTS = ['dev', 'storybook', 'docs', 'start']
21+
const RUN_SCRIPTS = ['dev', 'storybook', 'start']
2222

2323
const rootDir = resolve(dirname(fileURLToPath(import.meta.url)), '..')
2424

@@ -38,6 +38,7 @@ function expandPattern(pattern: string): string[] {
3838
return readdirSync(baseDir, { withFileTypes: true })
3939
.filter(entry => entry.isDirectory())
4040
.map(entry => `${base}/${entry.name}`)
41+
.sort((a, b) => a.localeCompare(b))
4142
}
4243

4344
function findPlay(dir: string): Play | undefined {
@@ -61,7 +62,6 @@ async function main(): Promise<void> {
6162
.flatMap(expandPattern)
6263
.map(findPlay)
6364
.filter((play): play is Play => play !== undefined)
64-
.sort((a, b) => a.dir.localeCompare(b.dir))
6565

6666
if (plays.length === 0) {
6767
console.error(`No playgrounds found — none of ${WORKSPACE_PATTERNS.join(', ')} has a package.json with a ${RUN_SCRIPTS.join('/')} script.`)

0 commit comments

Comments
 (0)