The vendored schema module's cipher imports are loaded only by files Vite serves, so nothing on the Deno side materialized @noble into a generated project's node_modules and the dev server failed its dependency scan — 0.6.0's post-publish gate caught it (local runs were masked by the monorepo root's node_modules on the parent-resolution path). The generated Astro config now imports the cipher modules at config time, pinning them into the project's own node_modules, and aliases their npm: specifiers to bare imports like the existing jazz-tools and preact lines. Validated by running golden with the monorepo's @noble quarantined: the created app is self-sufficient and every stage passes.
- commit
- 67572fbb844a9773a7afb120df35e6e152471246
- parent
- ca2563182b4a2fd6fc7ee976701c13006a71d54e
- author
- FelineStateMachine <dami.etoile@gmail.com>
| M | deno.json | 2 | +- |
| M | package/ | 10 | ++++++++++ |
| M | package/ | 8 | ++++---- |
| M | package/ | 2 | +- |
| M | package/ | 2 | +- |
@@ -152,6 +152,13 @@ function renderConfig(projectRoot: string): string {
152152 import { defineConfig } from "astro/config";153153 import { jazzPlugin } from "jazz-tools/dev/vite";154154 import { resolve } from "node:path";155+// The vendored runtime's crypto dependencies are imported only by files Vite156+// serves, so nothing on the Deno side would otherwise materialize them into157+// node_modules where Vite resolves bare specifiers. Loading them here pins158+// them into the project's node_modules at config time.159+import "@noble/ciphers/chacha";160+import "@noble/hashes/hkdf";161+import "@noble/hashes/sha2";155162 156163 const projectRoot = Deno.cwd();157164 const schemaDir = resolve(projectRoot, "src");@@ -229,6 +236,9 @@ export default defineConfig({
229236 { find: /^npm:preact@[^/]+\\/jsx-dev-runtime$/, replacement: "preact/jsx-dev-runtime" },230237 { find: /^npm:preact@[^/]+\\/jsx-runtime$/, replacement: "preact/jsx-runtime" },231238 { find: /^npm:preact@[^/]+$/, replacement: "preact" },239+ { find: /^npm:@noble\\/ciphers@[^/]+\\/chacha$/, replacement: "@noble/ciphers/chacha" },240+ { find: /^npm:@noble\\/hashes@[^/]+\\/hkdf$/, replacement: "@noble/hashes/hkdf" },241+ { find: /^npm:@noble\\/hashes@[^/]+\\/sha2$/, replacement: "@noble/hashes/sha2" },232242 { find: /^npm:jazz-tools@[^/]+\\/passkey-backup$/, replacement: "jazz-tools/passkey-backup" },233243 { find: /^npm:jazz-tools@[^/]+\\/passphrase$/, replacement: "jazz-tools/passphrase" },234244 { find: /^npm:jazz-tools@[^/]+$/, replacement: "jazz-tools" },@@ -99,9 +99,9 @@ Deno.test("createProject materializes the complete starter snapshot", async () =
9999 );100100 }101101 const config = JSON.parse(await Deno.readTextFile(join(result.destination, "deno.json")));102- assertEquals(config.imports["@nzip/lofi"], "jsr:@nzip/lofi@0.6.0");103- assertEquals(config.imports["@nzip/lofi/"], "jsr:@nzip/lofi@0.6.0/");104- assertEquals(config.imports["@nzip/lofi/testing"], "jsr:@nzip/lofi@0.6.0/testing");102+ assertEquals(config.imports["@nzip/lofi"], "jsr:@nzip/lofi@0.6.1");103+ assertEquals(config.imports["@nzip/lofi/"], "jsr:@nzip/lofi@0.6.1/");104+ assertEquals(config.imports["@nzip/lofi/testing"], "jsr:@nzip/lofi@0.6.1/testing");105105 const lofiSpecifiers = Object.entries(config.imports)106106 .filter(([name]) => name.startsWith("@nzip/lofi/"))107107 .map(([, specifier]) => String(specifier));@@ -110,7 +110,7 @@ Deno.test("createProject materializes the complete starter snapshot", async () =
110110 `expected one package prefix, access, schema, two integrations, six commands, seven recipes, and testing, received ${lofiSpecifiers.length}`,111111 );112112 assert(113- lofiSpecifiers.every((specifier) => specifier.startsWith("jsr:@nzip/lofi@0.6.0/")),113+ lofiSpecifiers.every((specifier) => specifier.startsWith("jsr:@nzip/lofi@0.6.1/")),114114 "generated lofi commands do not resolve through one exact package version",115115 );116116 const pngSignature = [137, 80, 78, 71, 13, 10, 26, 10];@@ -1,7 +1,7 @@
11 {22 ".env.example": "0cfad81a3ba6442ac15d7cbe44a00374bf4dbf8af68ca412e54fb100241ddeab",33 ".gitignore": "9b9fa4b95f8f728ce80e93fc224d430328786b620096b80f067a3190c410a00e",4- "deno.json": "153e069bab393b5d2fca9173ebc24887de510ea94c2e8242ba314759a11c7c4c",4+ "deno.json": "05da5b9859589bed3c05fce89037113c743d6e0525a2e5bd13466e6d6ce410e2",55 "public/apple-touch-icon.png": "be2b77066d9681709210388413ddcd94318906799ddd6645934b789a04bd4a61",66 "public/favicon.svg": "35b92ad48231c470b348eaebe6d6fe14acf2ec4a86e6726a03ccb130328a0d85",77 "public/icon-192.png": "6ee711f9ec990ec55f789d7943813c5193973bf2ca9199078ee85d285317e07c",@@ -1,5 +1,5 @@
11 /** The single source version for generated @nzip/lofi references. */2-export const LOFI_VERSION = "0.6.0";2+export const LOFI_VERSION = "0.6.1";33 44 /** The exact JSR package prefix emitted into generated projects. */55 export const LOFI_PACKAGE_PREFIX = `jsr:@nzip/lofi@${LOFI_VERSION}/`;