cursedbelt-server 4.24.0 → 4.24.1
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Loaded only under Node — the `node` condition of `cursedbelt-server/worker-argon2`.
|
|
2
|
+
//
|
|
3
|
+
// This subpath's two `.wasm` files are STATIC imports, which is the one shape workerd will run
|
|
4
|
+
// (`./argon2.ts`). Node 24 reads the same import through its WebAssembly ESM integration and
|
|
5
|
+
// instantiates the module itself, resolving its imports from a package called `env` — so the
|
|
6
|
+
// real module fails under Node with `ERR_MODULE_NOT_FOUND: Cannot find package 'env'`, deep in
|
|
7
|
+
// `argon2id/dist/no-simd.wasm` (measured by tools/proveInstall.ts publishing 4.24.0, 2026-09-23).
|
|
8
|
+
// Nothing in this generation runs it on Node: a Worker gets it through wrangler (`workerd`
|
|
9
|
+
// resolves `import`), a Mac server through Bun (`bun`), and a Mac server already HAS
|
|
10
|
+
// `Bun.password`. So Node gets this sentence instead. Same shape as `../_bunOnly.ts`.
|
|
11
|
+
throw new Error("cursedbelt-server/worker-argon2 runs on workerd (through wrangler) and Bun — not Node, which cannot load its static `.wasm` imports. " +
|
|
12
|
+
"A Node server should hash with a native argon2 (`@node-rs/argon2`).");
|
|
13
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cursedbelt-server",
|
|
3
|
-
"version": "4.24.
|
|
3
|
+
"version": "4.24.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The app-facing Bun/Hono server tier of the cursedbelt split — storage, sharing, activity, guard, sync. React-free; cursedbelt-core below it.",
|
|
@@ -219,6 +219,7 @@
|
|
|
219
219
|
"types": "./dist/server/worker-argon2/index.d.ts",
|
|
220
220
|
"bun": "./src/server/worker-argon2/index.ts",
|
|
221
221
|
"source": "./src/server/worker-argon2/index.ts",
|
|
222
|
+
"node": "./dist/server/worker-argon2/_nodeRefuses.js",
|
|
222
223
|
"import": "./dist/server/worker-argon2/index.js"
|
|
223
224
|
},
|
|
224
225
|
"./request-log": {
|
|
@@ -58,6 +58,20 @@ describe('🔴 cursedbelt-server/worker-argon2 — it exists to be imported by a
|
|
|
58
58
|
};
|
|
59
59
|
expect(pkg.exports['./worker-argon2']?.import).toBe('./dist/server/worker-argon2/index.js');
|
|
60
60
|
});
|
|
61
|
+
|
|
62
|
+
test('Node is refused by name — its WebAssembly ESM integration cannot load the static `.wasm` imports', async () => {
|
|
63
|
+
// 4.24.0 published with no `node` condition and failed proveInstall: node read the `.wasm`
|
|
64
|
+
// as an ES module and died on `Cannot find package 'env'`. wrangler never activates `node`
|
|
65
|
+
// (a dry-run bundle of the probe Worker carries both `.wasm` modules), so this costs a Worker nothing.
|
|
66
|
+
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf8')) as {
|
|
67
|
+
exports: Record<string, Record<string, string>>;
|
|
68
|
+
};
|
|
69
|
+
const conditions = Object.keys(pkg.exports['./worker-argon2'] ?? {});
|
|
70
|
+
expect(pkg.exports['./worker-argon2']?.node).toBe('./dist/server/worker-argon2/_nodeRefuses.js');
|
|
71
|
+
expect(conditions.indexOf('node')).toBeLessThan(conditions.indexOf('import'));
|
|
72
|
+
expect(conditions.indexOf('bun')).toBeLessThan(conditions.indexOf('node'));
|
|
73
|
+
await expect(import('./worker-argon2/_nodeRefuses.ts')).rejects.toThrow('not Node');
|
|
74
|
+
});
|
|
61
75
|
});
|
|
62
76
|
|
|
63
77
|
describe('cursedbelt-server/telemetry', () => {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Loaded only under Node — the `node` condition of `cursedbelt-server/worker-argon2`.
|
|
2
|
+
//
|
|
3
|
+
// This subpath's two `.wasm` files are STATIC imports, which is the one shape workerd will run
|
|
4
|
+
// (`./argon2.ts`). Node 24 reads the same import through its WebAssembly ESM integration and
|
|
5
|
+
// instantiates the module itself, resolving its imports from a package called `env` — so the
|
|
6
|
+
// real module fails under Node with `ERR_MODULE_NOT_FOUND: Cannot find package 'env'`, deep in
|
|
7
|
+
// `argon2id/dist/no-simd.wasm` (measured by tools/proveInstall.ts publishing 4.24.0, 2026-09-23).
|
|
8
|
+
// Nothing in this generation runs it on Node: a Worker gets it through wrangler (`workerd`
|
|
9
|
+
// resolves `import`), a Mac server through Bun (`bun`), and a Mac server already HAS
|
|
10
|
+
// `Bun.password`. So Node gets this sentence instead. Same shape as `../_bunOnly.ts`.
|
|
11
|
+
throw new Error(
|
|
12
|
+
"cursedbelt-server/worker-argon2 runs on workerd (through wrangler) and Bun — not Node, which cannot load its static `.wasm` imports. " +
|
|
13
|
+
"A Node server should hash with a native argon2 (`@node-rs/argon2`).",
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export {};
|