@ai-ecoverse/slicc-shared-web 1.29.7 → 1.29.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,7 @@ Configuration shared by SLICC's web repos ([slicc-bios](https://github.com/ai-ec
10
10
  | `tsconfig.json` | TypeScript base for Node's type stripping | `tsconfig.json`: `{ "extends": "@ai-ecoverse/slicc-shared-web/tsconfig.json", "include": ["src/**/*.ts"] }` |
11
11
  | `lefthook.yml` | Pre-commit hooks: Biome, typecheck, no comments, no unit tests in git, AGENTS.md, and diff coverage over [only the unit tests the change reaches](#which-unit-tests-a-commit-runs) | `lefthook.yml`: `extends: [node_modules/@ai-ecoverse/slicc-shared-web/lefthook.yml]`, and `prepare`: `slicc-install-hooks` plus the committed `.githooks/` it writes ([one hooks directory per worktree](#one-hooks-directory-per-worktree)) |
12
12
  | `mcr.config.mjs` | Unit-test coverage for JS and TS sources (`.js`, `.mjs`, `.cjs`, `.ts`, `.mts`, `.cts`) in `src/` or the `slicc.unitSources` directories (TS types are stripped first; TS that strip-only mode rejects, such as enums and parameter properties, is transformed with [amaro](https://github.com/nodejs/amaro) under the tests too, through an `--import` loader the config adds to `NODE_OPTIONS`, and its coverage is mapped back to the `.ts` lines), written to `coverage/unit/lcov.info`. Every source file is in it, tested or not, and paths are matched relative to the repo root, so a checkout under a dot-directory such as `~/.bb/` still reports untested files to diff coverage. With `SLICC_UNIT_TESTS` set, `node --test` runs only those files ([below](#which-unit-tests-a-commit-runs)) | `test:unit`: `mcr -c node_modules/@ai-ecoverse/slicc-shared-web/mcr.config.mjs node --test 'test/unit/**/*.test.mjs'` |
13
- | `bin/` | `slicc-lint` runs every check below plus Biome and, if the repo has one, `typecheck`. Every step prints its own `<step>: PASS …` line, and slicc-lint checks for it: a step that exits 0 without one fails the run with exit 70 (`slicc-lint: FAIL <step> (no PASS line from it)`), so a check that silently stops early can't pass. The last line, `slicc-lint: PASS`, comes only after every step has printed its PASS, and a gate can require it. `slicc-lint-comments` runs the [slicc no-comment checker](https://github.com/ai-ecoverse/slicc/tree/main/packages/dev-tools/no-comment) at a pinned commit, allowing AGENTS.md and [`# renovate:` annotations](#versions-pinned-in-workflow-files) in workflow and action files. `slicc-agents-md`, `slicc-no-unit-tests` and `slicc-diff-cover` complete the set, and `slicc-unit-cover` is the diff-coverage hook. `slicc-minidump <file.dmp>...` prints a crash dump's stack, described [below](#crash-dumps). `slicc-memory-peak` prints the job's [memory peak](#memory-peak). `slicc-install-hooks` installs the hooks into [this worktree's own directory](#one-hooks-directory-per-worktree) | `lint`: `slicc-lint`, and the hooks above |
13
+ | `bin/` | `slicc-lint` runs every check below plus Biome and, if the repo has one, `typecheck`. Every step prints its own `<step>: PASS …` line, and slicc-lint checks for it: a step that exits 0 without one fails the run with exit 70 (`slicc-lint: FAIL <step> (no PASS line from it)`), so a check that silently stops early can't pass. The last line, `slicc-lint: PASS`, comes only after every step has printed its PASS, and a gate can require it. `slicc-lint-comments` runs the [slicc no-comment checker](https://github.com/ai-ecoverse/slicc/tree/main/packages/dev-tools/no-comment) at a pinned commit, allowing AGENTS.md and [`# renovate:` annotations](#versions-pinned-in-workflow-files) in workflow and action files. `slicc-agents-md`, `slicc-no-unit-tests` and `slicc-diff-cover` complete the set, and `slicc-unit-cover` is the diff-coverage hook. `slicc-minidump <file.dmp>...` prints a crash dump's stack, described [below](#crash-dumps). `slicc-memory-peak` prints the job's [memory peak](#memory-peak). `slicc-install-hooks` installs the hooks into [this worktree's own directory](#one-hooks-directory-per-worktree), and on Windows does nothing and exits 0, so `npm ci` works there | `lint`: `slicc-lint`, and the hooks above |
14
14
  | `pnpmfile.mjs` | pnpm's counterpart to the Renovate preset: an `updateConfig` hook that adds `@ai-ecoverse/*` to `minimumReleaseAgeExclude`, so pnpm 12 doesn't hold back our own fresh releases (`ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`) while third-party packages keep its age check | in a repo with a pnpm lockfile, as a [config dependency](https://pnpm.io/config-dependencies) in `pnpm-workspace.yaml`: `configDependencies: { '@ai-ecoverse/slicc-shared-web': X.Y.Z }` plus `pnpmfile: node_modules/.pnpm-config/@ai-ecoverse/slicc-shared-web/pnpmfile.mjs` |
15
15
  | `harness/` | The CDP integration-test harness, described [below](#integration-test-harness) | `import { launch } from '@ai-ecoverse/slicc-shared-web/harness'`, and `--test-global-setup=node_modules/@ai-ecoverse/slicc-shared-web/harness/global.mjs` |
16
16
 
@@ -217,6 +217,9 @@ and the PR commits the `.githooks/` directory that the first `npm install` write
217
217
  - **What it does:** sets one shared, relative `core.hooksPath` of `.githooks` (`<dir>/.githooks` for a package in a subdirectory of the repo), runs `lefthook install --force` with its output pointed at this worktree's gitignored `node_modules/.git-hooks/`, and writes a shim into `.githooks/` for every hook lefthook installed that has none yet. It never overwrites an existing shim. Git resolves a relative `core.hooksPath` against the top of the worktree a commit runs in, so each worktree runs its own committed shim, and the shim runs that worktree's own `node_modules/.git-hooks/<hook>`. No `extensions.worktreeConfig`, no per-worktree config, and `core.bare` stays where it is, so worktrees of a bare repo work too. Running it again changes nothing.
218
218
  - **Hooks are never shared:** whatever another worktree installs later, removing a worktree removes only its own hooks, and a moved checkout keeps working. Lefthook's own `postinstall` refuses the custom `core.hooksPath`, writes nothing and doesn't fail the install, and git never reads `.git/hooks/` once `core.hooksPath` is set, so `allowScripts` needs no entry for lefthook.
219
219
  - **A worktree that never ran `npm install`** fails every commit with `pre-commit: run npm install`, since its shim finds no `node_modules/.git-hooks/pre-commit`.
220
+ - **A checkout without the committed `.githooks/`** (a branch cut before the rollout PR) has no shim, so its commits run no hooks until it merges or rebases onto the rollout.
221
+ - **A hook type added to `lefthook.yml` later** needs `npm install` again in each worktree, and its new shim committed: lefthook skips its own hook sync while `core.hooksPath` is set.
222
+ - **Lefthook's `core.hooksPath is set locally` notice** on commits is expected. Don't follow its advice to unset `core.hooksPath`: that sends every worktree back to the shared `.git/hooks/`.
220
223
  - **Clones set up by the previous version** (2.1.1, 1.29.3), which set an absolute per-worktree `core.hooksPath` into a `worktree-hooks/` directory: it unsets that in the current worktree's `config.worktree`. It leaves `extensions.worktreeConfig` and the moved `core.bare` alone.
221
224
  - **Outside a git checkout** (a packed tarball, say) it does nothing and exits 0.
222
225
 
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ if (process.platform === 'win32') process.exit(0);
6
+ const script = fileURLToPath(new URL('slicc-install-hooks.sh', import.meta.url));
7
+ const run = spawnSync('sh', [script, ...process.argv.slice(2)], { stdio: 'inherit' });
8
+ if (run.error) throw run.error;
9
+ process.exit(run.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-shared-web",
3
- "version": "1.29.7",
3
+ "version": "1.29.8",
4
4
  "description": "Shared Renovate, Biome, TypeScript, lefthook and GitHub Actions configuration, plus the CDP integration-test harness, for SLICC's web repos",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  "bin": {
35
35
  "slicc-agents-md": "bin/slicc-agents-md.sh",
36
36
  "slicc-diff-cover": "bin/slicc-diff-cover.sh",
37
- "slicc-install-hooks": "bin/slicc-install-hooks.sh",
37
+ "slicc-install-hooks": "bin/slicc-install-hooks.mjs",
38
38
  "slicc-lint": "bin/slicc-lint.sh",
39
39
  "slicc-lint-comments": "bin/slicc-lint-comments.sh",
40
40
  "slicc-memory-peak": "bin/slicc-memory-peak.sh",
@@ -54,7 +54,7 @@
54
54
  "unit"
55
55
  ],
56
56
  "scripts": {
57
- "prepare": "bin/slicc-install-hooks.sh",
57
+ "prepare": "node bin/slicc-install-hooks.mjs",
58
58
  "lint": "bin/slicc-lint.sh && shellcheck bin/*.sh",
59
59
  "pretest": "playwright-core install --no-shell chromium",
60
60
  "test": "SLICC_PROFILE=1 node --test --test-global-setup=harness/global.mjs test/integration/*.test.mjs && node test/integration/verify.mjs",