openvibers/openvibe.games Commits
Untrack committed nodemodules symlinks and ignore them in git
Changes
@@@ -1,4 +1,7 @@--node_modules/++# No trailing slash: pnpm can leave a project's node_modules a symlink, and git does not call a++# symlink a directory, so `node_modules/` would not ignore it — `git add -A` then commits it and++# CI checks it out dangling, where pnpm install dies before any test runs.++node_modulesdist/dist-types/*.tsbuildinfoddeleted file mode 120000@@@ -1 +0,0 @@--/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/apps/client/node_modules\\ No newline at end of fileddeleted file mode 120000@@@ -1 +0,0 @@--/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/apps/server/node_modules\\ No newline at end of filennew file mode 100644@@@ -0,0 +1,28 @@++import { execFileSync } from 'node:child_process'++import { existsSync } from 'node:fs'++import { dirname, join } from 'node:path'++import { fileURLToPath } from 'node:url'++import { describe, expect, it } from 'vitest'++++/**++ * Repository hygiene: no `node_modules` is tracked.++ *++ * pnpm can leave a project's `node_modules` as a symlink — the agent worktrees point theirs at a++ * sibling checkout. `.gitignore` spells the rule without the trailing slash because git does not++ * treat a symlink as a directory, so `node_modules/` would leave those symlinks visible to++ * `git add -A`. One committed by accident reaches CI as a dangling link, and++ * `pnpm install --frozen-lockfile` then dies in linkDirectDepsOfProject with ENOENT before a single++ * test runs. The ignore rule keeps them out; this is what fails if one is tracked anyway.++ */++++const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..')++++describe('repository hygiene', () => {++ it('tracks no node_modules', () => {++ if (!existsSync(join(ROOT, '.git'))) return // an exported copy has no index to check++ const tracked = execFileSync('git', ['ls-files', '-z'], { cwd: ROOT, encoding: 'utf8' })++ .split('\0')++ .filter(Boolean)++ expect(tracked.filter((path) => path.split('/').includes('node_modules'))).toEqual([])++ })++})ddeleted file mode 120000@@@ -1 +0,0 @@--/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/content/node_modules\\ No newline at end of fileddeleted file mode 120000@@@ -1 +0,0 @@--/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/gameplay/node_modules\\ No newline at end of fileddeleted file mode 120000@@@ -1 +0,0 @@--/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/persistence/node_modules\\ No newline at end of fileddeleted file mode 120000@@@ -1 +0,0 @@--/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/physics/node_modules\\ No newline at end of fileddeleted file mode 120000@@@ -1 +0,0 @@--/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/protocol/node_modules\\ No newline at end of filennew file mode 100644@@@ -0,0 +1,3 @@++// file: 'apps/server/scripts/repoHygiene.test.ts'++// covers: 'apps/server/scripts'++// Generated by node test/run.js --index; do not edit.
@@ -1,4 +1,7 @@
@@ -1,4 +1,7 @@
-node_modules/
+# No trailing slash: pnpm can leave a project's node_modules a symlink, and git does not call a
+# symlink a directory, so `node_modules/` would not ignore it — `git add -A` then commits it and
+# CI checks it out dangling, where pnpm install dies before any test runs.
+node_modules
dist/
dist/
dist-types/
dist-types/
*.tsbuildinfo
*.tsbuildinfo
deleted file mode 120000
deleted file mode 120000
@@ -1 +0,0 @@
@@ -1 +0,0 @@
-/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/apps/client/node_modules
\ No newline at end of file
\ No newline at end of file
deleted file mode 120000
deleted file mode 120000
@@ -1 +0,0 @@
@@ -1 +0,0 @@
-/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/apps/server/node_modules
\ No newline at end of file
\ No newline at end of file
new file mode 100644
new file mode 100644
@@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
+import { execFileSync } from 'node:child_process'
+import { existsSync } from 'node:fs'
+import { dirname, join } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { describe, expect, it } from 'vitest'
+
+/**
+ * Repository hygiene: no `node_modules` is tracked.
+ *
+ * pnpm can leave a project's `node_modules` as a symlink — the agent worktrees point theirs at a
+ * sibling checkout. `.gitignore` spells the rule without the trailing slash because git does not
+ * treat a symlink as a directory, so `node_modules/` would leave those symlinks visible to
+ * `git add -A`. One committed by accident reaches CI as a dangling link, and
+ * `pnpm install --frozen-lockfile` then dies in linkDirectDepsOfProject with ENOENT before a single
+ * test runs. The ignore rule keeps them out; this is what fails if one is tracked anyway.
+ */
+
+const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..')
+
+describe('repository hygiene', () => {
+ it('tracks no node_modules', () => {
+ if (!existsSync(join(ROOT, '.git'))) return // an exported copy has no index to check
+ const tracked = execFileSync('git', ['ls-files', '-z'], { cwd: ROOT, encoding: 'utf8' })
+ .split('\0')
+ .filter(Boolean)
+ expect(tracked.filter((path) => path.split('/').includes('node_modules'))).toEqual([])
+ })
+})
deleted file mode 120000
deleted file mode 120000
@@ -1 +0,0 @@
@@ -1 +0,0 @@
-/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/content/node_modules
\ No newline at end of file
\ No newline at end of file
deleted file mode 120000
deleted file mode 120000
@@ -1 +0,0 @@
@@ -1 +0,0 @@
-/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/gameplay/node_modules
\ No newline at end of file
\ No newline at end of file
deleted file mode 120000
deleted file mode 120000
@@ -1 +0,0 @@
@@ -1 +0,0 @@
-/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/persistence/node_modules
\ No newline at end of file
\ No newline at end of file
deleted file mode 120000
deleted file mode 120000
@@ -1 +0,0 @@
@@ -1 +0,0 @@
-/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/physics/node_modules
\ No newline at end of file
\ No newline at end of file
deleted file mode 120000
deleted file mode 120000
@@ -1 +0,0 @@
@@ -1 +0,0 @@
-/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/protocol/node_modules
\ No newline at end of file
\ No newline at end of file
new file mode 100644
new file mode 100644
@@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
+// file: 'apps/server/scripts/repoHygiene.test.ts'
+// covers: 'apps/server/scripts'
+// Generated by node test/run.js --index; do not edit.