clone

a deno framework for local-first web apps that open instantly, work offline and sync when users choose

release: 0.6.1 — generated apps resolve the vendored crypto dependencies (#138)

FelineStateMachine committed 67572fb
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>
5 files changed, +17 -7
Mdeno.json2+-
Mpackage/astro/mod.ts10++++++++++
Mpackage/create_core_test.ts8++++----
Mpackage/testdata/starter.snapshot.json2+-
Mpackage/version.ts2+-
M deno.json +1 -1
M package/astro/mod.ts +10 -0
@@ -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" },
M package/create_core_test.ts +4 -4
M package/testdata/starter.snapshot.json +1 -1
M package/version.ts +1 -1