Skip to content

Commit 5b5dd12

Browse files
fix: restore generated/ paths, mkdir guard, gitignore DEPENDENCIES.json
Re-apply generated/ output paths for gen-deps.cjs and publish.yml, add mkdir -p guards for fresh clones, and gitignore both generated/DEPENDENCIES.md and generated/DEPENDENCIES.json.
1 parent c713ce6 commit 5b5dd12

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ jobs:
264264
265265
- name: Generate DEPENDENCIES.json
266266
if: github.event_name != 'push'
267-
run: npm ls --json --all --omit=dev > DEPENDENCIES.json 2>/dev/null || true
267+
run: mkdir -p generated && npm ls --json --all --omit=dev > generated/DEPENDENCIES.json 2>/dev/null || true
268268

269269
- name: Push version bump via PR
270270
if: github.event_name != 'push'
@@ -276,10 +276,10 @@ jobs:
276276
BRANCH="release/v${VERSION}"
277277
278278
# Check if there are version bump changes to push
279-
if git diff --quiet HEAD -- package.json package-lock.json CHANGELOG.md DEPENDENCIES.json; then
279+
if git diff --quiet HEAD -- package.json package-lock.json CHANGELOG.md generated/DEPENDENCIES.json; then
280280
echo "No version bump commit to push — skipping PR"
281281
else
282-
git add package.json package-lock.json CHANGELOG.md DEPENDENCIES.json
282+
git add package.json package-lock.json CHANGELOG.md generated/DEPENDENCIES.json
283283
git commit -m "chore: release v${VERSION}"
284284
git push origin "HEAD:refs/heads/${BRANCH}"
285285
gh pr create \

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ coverage/
66
grammars/*.wasm
77
.claude/session-edits.log
88
.claude/codegraph-checked.log
9+
generated/DEPENDENCIES.md
10+
generated/DEPENDENCIES.json
911
artifacts/
1012
pkg/

scripts/gen-deps.cjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
const { execSync } = require('child_process');
22
const fs = require('fs');
3+
const path = require('path');
4+
5+
const outFile = path.join('generated', 'DEPENDENCIES.md');
6+
fs.mkdirSync(path.dirname(outFile), { recursive: true });
37

48
try {
59
const tree = execSync('npm ls --all --omit=dev', { encoding: 'utf8' });
6-
fs.writeFileSync(
7-
'DEPENDENCIES.md',
8-
'# Dependencies\n\n```\n' + tree + '```\n',
9-
);
10+
fs.writeFileSync(outFile, '# Dependencies\n\n```\n' + tree + '```\n');
1011
} catch (err) {
1112
// npm ls exits non-zero on ELSPROBLEMS (version mismatches in optional deps).
1213
// If stdout still has content, write it; otherwise skip silently.
1314
if (err.stdout) {
1415
fs.writeFileSync(
15-
'DEPENDENCIES.md',
16+
outFile,
1617
'# Dependencies\n\n```\n' + err.stdout + '```\n',
1718
);
1819
} else {

0 commit comments

Comments
 (0)