@ai-ecoverse/slicc-shared-web 1.13.0 → 1.13.2

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
@@ -4,7 +4,7 @@ Configuration shared by SLICC's web repos ([slicc-bios](https://github.com/ai-ec
4
4
 
5
5
  | File | What it is | How a repo uses it |
6
6
  |---|---|---|
7
- | `default.json` | Root Renovate preset: automerge on, one dependency per PR, exact pins, 7-day release age (14 for majors, 0 for vulnerability fixes and for our own `@ai-ecoverse` packages and `github.com/ai-ecoverse/*` Go modules, which also jump the PR queue), `go mod tidy` after every Go module update (plus import-path rewrites on majors), and a manager for jsDelivr pins inside `src/` | `renovate.json`: `{ "extends": ["github>ai-ecoverse/slicc-shared-web"] }` |
7
+ | `default.json` | Root Renovate preset: automerge on, one dependency per PR, exact pins, 7-day release age (14 for majors, 0 for vulnerability fixes and for our own `@ai-ecoverse` packages and `github.com/ai-ecoverse/*` Go modules, which also jump the PR queue), `<upstream>-slicc.<n>` prereleases (and only those, never past `latest`) for `@ai-ecoverse/fnox` and its `@ai-ecoverse/fnox-*` platform packages, including jumps to a new upstream fnox, one PR each, majors included, for the certified pairs `@ai-ecoverse/slicc-kernel` + `@ai-ecoverse/wasi-pnpm` ("kernel and pnpm") and `@ai-ecoverse/wasm-coreutils` + `@ai-ecoverse/wasm-procps` ("coreutils and procps"), `go mod tidy` after every Go module update (plus import-path rewrites on majors), and a manager for jsDelivr pins inside `src/` | `renovate.json`: `{ "extends": ["github>ai-ecoverse/slicc-shared-web"] }` |
8
8
  | `.github/workflows/node-ci.yml` | Reusable CI: `npm ci`, lint, Chromium's system libraries, integration tests, hotspots and the stack of every crash dump in the job summary, coverage/profiles/screenshots/crash dumps as artifacts. The browser itself comes from each repo's `pretest` | `jobs: { ci: { uses: ai-ecoverse/slicc-shared-web/.github/workflows/node-ci.yml@vX.Y.Z } }` |
9
9
  | `biome.json` | Formatter settings and slicc's strict linter: cognitive complexity ≤ 25, functions ≤ 150 lines, no unused variables or imports, no floating or misused promises, naming conventions, `import type`/`export type`. Test files under `test/` get slicc's test exemptions | `biome.json`: `{ "extends": ["@ai-ecoverse/slicc-shared-web/biome"] }` |
10
10
  | `tsconfig.json` | TypeScript base for Node's type stripping | `tsconfig.json`: `{ "extends": "@ai-ecoverse/slicc-shared-web/tsconfig.json", "include": ["src/**/*.ts"] }` |
@@ -96,6 +96,7 @@ Why it works the way it does:
96
96
  - monocart's `add()` from parallel test processes loses data, so each test writes raw JSON and the teardown merges it once.
97
97
  - Coverage of a script served from `chrome.overrides` would be mapped onto the file on disk, so a path overridden during a test is left out of that test's coverage.
98
98
  - A CI cache restored with a prefix key kept packuments from before a release, so pnpm in the page saw an outdated `latest` and failed with `ERR_PNPM_NO_MATCHING_VERSION`. Tarballs and versioned CDN files never change and stay cached forever; registry documents do change, so the disk copy is only the offline fallback.
99
+ - An unscoped packument cached at `registry.npmjs.org/<name>` sat where the tarball directory `registry.npmjs.org/<name>/-/` goes, so saving one after the other failed with `EISDIR` and pnpm in the page saw `ECONNREFUSED`. Registry documents are now cached as `<path>/index.json`; a file left at the old place is a miss and is removed when something needs its place.
99
100
  - `--disable-extensions --disable-component-extensions-with-background-pages` keeps a Hangouts service worker out of every run.
100
101
  - The attach event can arrive before `Target.createTarget` returns, so new tabs wait on a slot keyed by target id.
101
102
  - A worker blocked in `Atomics.wait`, or one that is already gone, may never answer; snapshots give up after 3 s, and closing a context or the browser after 10 s. A call to a target that detaches or crashes fails instead of waiting forever, and a new tab that never attaches fails after 10 s.
package/default.json CHANGED
@@ -57,6 +57,27 @@
57
57
  "minimumReleaseAge": "0 days",
58
58
  "prPriority": 10
59
59
  },
60
+ {
61
+ "description": "fnox-build publishes @ai-ecoverse/fnox and its platform packages only as <upstream fnox version>-slicc.<build> prereleases, with latest pointing at the newest. Renovate skips prereleases by default, and from 1.39.0-slicc.1 would only offer 1.39.0-slicc.2, never 1.40.0-slicc.1, so allow unstable versions, but only -slicc.N ones and never past latest.",
62
+ "matchPackageNames": ["@ai-ecoverse/fnox", "@ai-ecoverse/fnox-*"],
63
+ "ignoreUnstable": false,
64
+ "respectLatest": true,
65
+ "allowedVersions": "/-slicc\\.\\d+$/"
66
+ },
67
+ {
68
+ "description": "@ai-ecoverse/slicc-kernel and @ai-ecoverse/wasi-pnpm are certified together: move them in one PR, majors included, so they pass CI as a pair. A repo that pins only one of them still gets its PR.",
69
+ "matchPackageNames": ["@ai-ecoverse/slicc-kernel", "@ai-ecoverse/wasi-pnpm"],
70
+ "groupName": "kernel and pnpm",
71
+ "groupSlug": "kernel-and-pnpm",
72
+ "separateMajorMinor": false
73
+ },
74
+ {
75
+ "description": "@ai-ecoverse/wasm-coreutils and @ai-ecoverse/wasm-procps are certified together: move them in one PR, majors included. A repo that pins only one of them still gets its PR.",
76
+ "matchPackageNames": ["@ai-ecoverse/wasm-coreutils", "@ai-ecoverse/wasm-procps"],
77
+ "groupName": "coreutils and procps",
78
+ "groupSlug": "coreutils-and-procps",
79
+ "separateMajorMinor": false
80
+ },
60
81
  {
61
82
  "description": "Go modules: run go mod tidy after every update, so a bump that changes indirect requirements passes go mod tidy -diff in CI, and rewrite import paths on major updates.",
62
83
  "matchManagers": ["gomod"],
package/harness/cdn.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { mkdir, readFile, rename, writeFile } from 'node:fs/promises';
2
- import { dirname } from 'node:path';
1
+ import { mkdir, readFile, rename, stat, unlink, writeFile } from 'node:fs/promises';
2
+ import { dirname, join, relative, sep } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { type } from './server.mjs';
5
5
  import { cache, ignore } from './util.mjs';
@@ -28,8 +28,24 @@ export function mutable(url) {
28
28
  return hostname.startsWith('registry.') && !/\/-\/[^/]+\.tgz$/.test(pathname);
29
29
  }
30
30
 
31
+ async function unblock(dir) {
32
+ const root = fileURLToPath(store);
33
+ let path = root;
34
+ for (const part of relative(root, dir).split(sep)) {
35
+ path = join(path, part);
36
+ const found = await stat(path).catch(ignore);
37
+ if (!found) return;
38
+ if (!found.isDirectory()) return unlink(path).catch(ignore);
39
+ }
40
+ }
41
+
31
42
  async function save(file, body) {
32
- await mkdir(dirname(fileURLToPath(file)), { recursive: true });
43
+ const dir = dirname(fileURLToPath(file));
44
+ await mkdir(dir, { recursive: true }).catch(async (error) => {
45
+ if (error.code !== 'EEXIST' && error.code !== 'ENOTDIR') throw error;
46
+ await unblock(dir);
47
+ await mkdir(dir, { recursive: true });
48
+ });
33
49
  const partial = new URL(`${file.href}.${process.pid}`);
34
50
  await writeFile(partial, body);
35
51
  await rename(partial, file);
@@ -50,8 +66,9 @@ async function refresh(url, file) {
50
66
  export async function download(url) {
51
67
  const { host, pathname, search } = new URL(url);
52
68
  const query = search ? encodeURIComponent(search) : '';
53
- const file = new URL(`./${host}${pathname}${query}`.replaceAll('%', '%25'), store);
69
+ const path = `./${host}${pathname}${query}`;
54
70
  if (mutable(url)) {
71
+ const file = new URL(`${path}/index.json`.replaceAll('%', '%25'), store);
55
72
  if (!fresh.has(url)) {
56
73
  const pending = refresh(url, file);
57
74
  fresh.set(url, pending);
@@ -59,6 +76,7 @@ export async function download(url) {
59
76
  }
60
77
  return fresh.get(url);
61
78
  }
79
+ const file = new URL(path.replaceAll('%', '%25'), store);
62
80
  const hit = await readFile(file).catch(ignore);
63
81
  if (hit) return hit;
64
82
  return save(file, await fetched(url));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-shared-web",
3
- "version": "1.13.0",
3
+ "version": "1.13.2",
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",