File tree Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,3 @@ tsconfig.json
55dist /
66.DS_Store
77.idea
8- pnpm-lock.yaml
Original file line number Diff line number Diff line change 55 "snippets" : " rimraf snippets && ts-node scripts/separate-snippets.ts" ,
66 "lint" : " git ls-files | grep -v 'snippets/' | grep '.js$' | xargs npx eslint" ,
77 "format" : " npm run lint -- --fix" ,
8- "bootstrap" : " pnpm recursive install" ,
9- "compile" : " pnpm recursive run compile --workspace-concurrency=4 "
8+ "bootstrap" : " find . -type f -name package.json -not -path '*/node_modules/*' -exec bash -c 'cd $(dirname {}) && npm install' \\ ; " ,
9+ "compile" : " bash scripts/ compile.sh "
1010 },
1111 "license" : " Apache-2.0" ,
1212 "devDependencies" : {
1313 "@types/node" : " ^24.9.1" ,
1414 "eslint" : " ^9.38.0" ,
15- "pnpm" : " ^10.19.0" ,
1615 "rimraf" : " ^5.0.10" ,
1716 "ts-node" : " ^10.9.2" ,
1817 "typescript" : " ^5.9.0"
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Runs `npm run compile` across all snippet directories.
4+
5+ echo " Starting package compilation search..."
6+
7+ # Iterate over all direct subdirectories (ending with /)
8+ # The glob pattern '*/' ensures we only look at directories at this level.
9+ for dir in * /; do
10+ # Strip the trailing slash for cleaner output and directory path usage
11+ subdir=" ${dir%/ } "
12+
13+ # Check if a package.json file exists in the current subdirectory
14+ if [ -f " $subdir /package.json" ]; then
15+ echo " --> Found package.json in '$subdir '. Running 'npm run compile'..."
16+
17+ # Use a subshell (parentheses) for the 'cd' command.
18+ # This executes 'cd' and 'npm run compile' in a separate process,
19+ # ensuring the main script's working directory doesn't change,
20+ # and the loop continues correctly from the parent path.
21+ if (cd " $subdir " && npm run compile); then
22+ echo " Successfully compiled '$subdir '."
23+ else
24+ echo " ERROR: Compilation failed for '$subdir '. Check the output above."
25+ exit 1
26+ fi
27+
28+ else
29+ : # skip directories like snippets and .github
30+ fi
31+ done
32+
33+ echo " Package compilation search complete."
You can’t perform that action at this time.
0 commit comments