@rsc-kit/core 0.30.24 → 0.30.26
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/dist/commands.js +22 -2
- package/dist/commands.js.map +1 -1
- package/dist/native.d.ts +123 -0
- package/dist/native.js +612 -0
- package/dist/native.js.map +1 -0
- package/dist/vite.d.ts +0 -21
- package/dist/vite.js +39 -0
- package/dist/vite.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACnH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAExD,gEAAgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAA;AAUzC,yCAAyC;AACzC,MAAM,UAAU,YAAY;IAC1B,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAA;IAErF,MAAM,MAAM,GAAI,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,EAAgE,EAAE,MAAM,CAAA;IAEnH,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,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AI,CAAC,IAAI,EAAE,aAAa,CAAC,EACzB,yFAAyF;QACvF,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,0BAA0B,GAAG,EAAE,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9H,yBAAyB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK;QAClD,2BAA2B,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAC3G,CAAA;IACD,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,CAAC,EAAE,cAAc,CAAC,CAAA;IAE/D,aAAa,CACX,YAAY,EACZ,iFAAiF;QAC/E,+EAA+E;QAC/E,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;QAC1B,cAAc,gBAAgB,kBAAkB,CACnD,CAAA;IAED,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;AACrD,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;AAChF,CAAC","sourcesContent":["/**\n * Native packages inside a compiled binary.\n *\n * A package with a native binary - sharp, a database driver - is left external\n * by the build, and Nitro traces it into .output/server/node_modules. A server\n * run from that directory loads it from there. `bun build --compile` cannot:\n * it bundles the package's JavaScript, and the package then looks for its\n * `.node` file beside a module that is no longer on disk, so the binary starts\n * and dies on the first import of it.\n *\n * So a binary carries those packages as files, and writes them to disk the\n * first time it runs: to `<RSC_KIT_RUNTIME_DIR>/<hash>/node_modules`, the\n * binary's own directory when the variable is unset. The hash is of the files,\n * so two versions sharing one directory during a deploy never share a tree,\n * and a second start of the same version writes nothing.\n *\n * Inside a binary Bun resolves no package by name, from anywhere - not from\n * the bundle, and not from a file on disk that the bundle loaded. Neither a\n * `Module._resolveFilename` hook nor a runtime plugin sees an ESM import there.\n * So every name is resolved here, at build time, while the tree is on disk:\n * each import and require of a package in the tree is rewritten to a relative\n * path, and the app's own imports of one go through a shim that loads it from\n * the written tree. The hook stays, for a require whose name is computed.\n *\n * An app with nothing traced gets none of this: its compile entry is the one\n * it always had.\n */\n\nimport { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs'\nimport { createHash } from 'node:crypto'\nimport { isBuiltin } from 'node:module'\nimport { dirname, join, relative, sep } from 'node:path'\n\n/** Where the compile tree is written, beside .output/server. */\nexport const COMPILE_TREE_DIR = 'compile'\n\n/** A platform a binary runs on, in the terms a package.json's os, cpu and libc use. */\nexport interface Platform {\n os: string\n arch: string\n /** Only on linux. */\n libc?: 'glibc' | 'musl'\n}\n\n/** The platform this process runs on. */\nexport function hostPlatform(): Platform {\n if (process.platform !== 'linux') return { os: process.platform, arch: process.arch }\n\n const header = (process.report?.getReport?.() as { header?: { glibcVersionRuntime?: string } } | undefined)?.header\n\n return { os: 'linux', arch: process.arch, libc: header && !header.glibcVersionRuntime ? 'musl' : 'glibc' }\n}\n\n/**\n * The platform a compile script targets: `--target=bun-linux-x64-musl`, or\n * the build machine's own when it names none. `baseline` and `modern` are CPU\n * levels of the same arch, and change nothing a package declares.\n */\nexport function targetPlatform(script: string | undefined, host: Platform = hostPlatform()): Platform {\n const target = script?.match(/--target[=\\s]+[\"']?bun-([a-z0-9]+)-([a-z0-9]+)((?:-[a-z]+)*)/)\n\n if (!target) return host\n\n const [, os, arch, modifiers] = target\n const platform = os === 'windows' ? 'win32' : os\n\n if (platform !== 'linux') return { os: platform, arch }\n\n return { os: platform, arch, libc: modifiers.includes('-musl') ? 'musl' : 'glibc' }\n}\n\nexport function describePlatform(platform: Platform): string {\n return `${platform.os}-${platform.arch}${platform.libc ? ` (${platform.libc})` : ''}`\n}\n\ninterface PackageJson {\n name?: string\n version?: string\n main?: string\n exports?: unknown\n os?: string[]\n cpu?: string[]\n libc?: string[]\n optionalDependencies?: Record<string, string>\n}\n\n/** npm's rule for os, cpu and libc: a list of allowed values, or of `!`-negated ones. */\nfunction allows(list: string[] | undefined, value: string | undefined): boolean {\n if (!list || list.length === 0 || value === undefined) return true\n\n const denied = list.filter((v) => v.startsWith('!')).map((v) => v.slice(1))\n const allowed = list.filter((v) => !v.startsWith('!'))\n\n if (denied.includes(value)) return false\n\n return allowed.length === 0 || allowed.includes(value)\n}\n\nexport function runsOn(pkg: PackageJson, platform: Platform): boolean {\n return allows(pkg.os, platform.os) && allows(pkg.cpu, platform.arch) && allows(pkg.libc, platform.libc)\n}\n\nfunction readJson(path: string): PackageJson | undefined {\n try {\n return JSON.parse(readFileSync(path, 'utf-8')) as PackageJson\n } catch {\n return undefined\n }\n}\n\n/** A directory, following a symlink: Nitro links each traced package into node_modules from a store beside it. */\nfunction isDir(path: string): boolean {\n try {\n return statSync(path).isDirectory()\n } catch {\n return false\n }\n}\n\n/** Every package directory under a node_modules, scoped and nested ones included. */\nfunction packageDirs(nodeModules: string): string[] {\n if (!isDir(nodeModules)) return []\n\n const dirs: string[] = []\n\n for (const name of readdirSync(nodeModules)) {\n const path = join(nodeModules, name)\n\n if (name.startsWith('.') || !isDir(path)) continue\n\n if (name.startsWith('@')) {\n for (const scoped of readdirSync(path)) {\n if (isDir(join(path, scoped))) dirs.push(join(path, scoped), ...packageDirs(join(path, scoped, 'node_modules')))\n }\n } else {\n dirs.push(path, ...packageDirs(join(path, 'node_modules')))\n }\n }\n\n return dirs\n}\n\n/** Every file under a directory, following symlinks, and not into a package's own node_modules when `packageOnly`. */\nfunction files(dir: string, packageOnly = false): string[] {\n const found: string[] = []\n\n const walk = (sub: string) => {\n for (const name of readdirSync(join(dir, sub))) {\n const rel = sub ? `${sub}/${name}` : name\n\n if (packageOnly && name === 'node_modules') continue\n if (isDir(join(dir, rel))) walk(rel)\n else if (existsSync(join(dir, rel))) found.push(rel)\n }\n }\n\n walk('')\n\n return found.sort()\n}\n\n/**\n * A platform in a package's name: `darwin-arm64`, `linuxmusl-x64`,\n * `linux-x64-gnu`. Packages that ship one binary per platform name each one\n * this way, which is how the one for another platform is found.\n */\nconst PLATFORM_IN_NAME = /(darwin|linux|linuxmusl|win32|freebsd|android)-(x64|arm64|arm|ia32|ppc64|riscv64|s390x)(-(?:gnu|musl|msvc|gnueabihf|musleabihf))?/\n\nfunction nameFor(name: string, platform: Platform): string | undefined {\n const found = name.match(PLATFORM_IN_NAME)\n\n if (!found) return undefined\n\n const [token, os, , suffix] = found\n const musl = platform.libc === 'musl'\n let replacement: string\n\n if (suffix) {\n // napi-rs: linux-x64-gnu / linux-x64-musl, darwin-arm64, win32-x64-msvc.\n const libc = platform.os === 'linux' ? (musl ? '-musl' : '-gnu') : platform.os === 'win32' ? '-msvc' : ''\n replacement = `${platform.os}-${platform.arch}${libc}`\n } else {\n // sharp: linux-x64 / linuxmusl-x64.\n replacement = `${platform.os === 'linux' && musl ? 'linuxmusl' : platform.os}-${platform.arch}`\n }\n\n return os === undefined ? undefined : name.replace(token, replacement)\n}\n\n/**\n * The package as it was installed, rather than as Nitro traced it. The trace\n * copies the files the server's imports reach, and only those: an import's\n * entry and not a require's, and not a file read at a path the tracer cannot\n * work out. A package written to disk whole finds whatever it looks for\n * beside its own code.\n */\nfunction installedCopy(pkg: PackageJson | undefined, projectRoot: string): string | undefined {\n if (!pkg?.name) return undefined\n\n const candidates = [\n join(projectRoot, 'node_modules', pkg.name),\n // Bun's isolated store.\n join(projectRoot, 'node_modules', '.bun', `${pkg.name.replace('/', '+')}@${pkg.version}`, 'node_modules', pkg.name),\n ]\n\n return candidates.find((dir) => {\n const found = readJson(join(dir, 'package.json'))\n return found !== undefined && found.name === pkg.name && found.version === pkg.version\n })\n}\n\nexport interface MissingPackage {\n name: string\n version?: string\n}\n\nexport interface NativeSet {\n /** Package directory (relative to the tree's node_modules) to the directory its files are read from. */\n packages: Map<string, string>\n missing: MissingPackage[]\n}\n\n/**\n * The packages a binary for `target` needs: what Nitro traced, with each\n * package built for the build machine swapped for the one built for the\n * target. Nitro traces what is installed and loads on this machine, so a Mac\n * compiling for linux-x64 traced darwin binaries; the linux ones are found\n * beside them in the project's node_modules, or reported as missing.\n */\nexport function nativeSet(serverNodeModules: string, projectRoot: string, target: Platform, named: readonly string[] = []): NativeSet {\n const packages = new Map<string, string>()\n const missing: MissingPackage[] = []\n const traced = packageDirs(serverNodeModules)\n const optional = new Map<string, string>()\n\n for (const dir of traced) {\n for (const [name, version] of Object.entries(readJson(join(dir, 'package.json'))?.optionalDependencies ?? {})) {\n optional.set(name, version)\n }\n }\n\n for (const dir of traced) {\n const rel = relative(serverNodeModules, dir).split(sep).join('/')\n const pkg = readJson(join(dir, 'package.json'))\n\n if (!pkg || runsOn(pkg, target)) {\n packages.set(rel, installedCopy(pkg, projectRoot) ?? dir)\n continue\n }\n\n const name = pkg.name ?? rel\n const wanted = nameFor(name, target)\n\n // A platform package with no counterpart for the target - fsevents, say,\n // which only exists on macOS - is one the package itself does without.\n if (!wanted || !optional.has(wanted)) continue\n\n const installed = [join(projectRoot, 'node_modules', wanted), join(dir, '..', '..', wanted)].find((candidate) =>\n existsSync(join(candidate, 'package.json')),\n )\n const found = installed && readJson(join(installed, 'package.json'))\n\n if (installed && found && runsOn(found, target)) {\n packages.set(rel.slice(0, rel.length - name.length) + wanted, installed)\n } else {\n missing.push({ name: wanted, version: optional.get(wanted) })\n }\n }\n\n return { packages: onDisk(packages, named), missing }\n}\n\n/**\n * The packages that have to be on disk, out of all Nitro traced: one with a\n * `.node` or `.wasm`, or built for one platform; one that depends on such a\n * package, since it finds it from its own location; what those depend on, so\n * their imports resolve beside them; and any the app names in\n * serverExternalPackages, whose author said it reads its own files. The rest\n * - a polyfill, tslib - Bun bundles as it always did.\n */\nfunction onDisk(packages: Map<string, string>, named: readonly string[]): Map<string, string> {\n const info = new Map(\n [...packages].map(([rel, dir]) => {\n const pkg = readJson(join(dir, 'package.json')) ?? {}\n const deps = Object.keys({ ...(pkg as { dependencies?: object }).dependencies, ...pkg.optionalDependencies, ...(pkg as { peerDependencies?: object }).peerDependencies })\n const native = !!(pkg.os || pkg.cpu) || files(dir, true).some((file) => /\\.(node|wasm)$/.test(file))\n\n return [rel, { name: pkg.name ?? rel, deps, native }] as const\n }),\n )\n const disk = new Set([...info].filter(([, p]) => p.native || named.includes(p.name)).map(([rel]) => rel))\n const names = () => new Set([...disk].map((rel) => info.get(rel)!.name))\n\n for (let grew = true; grew; ) {\n grew = false\n const onDiskNames = names()\n for (const [rel, p] of info) {\n if (!disk.has(rel) && p.deps.some((dep) => onDiskNames.has(dep))) {\n disk.add(rel)\n grew = true\n }\n }\n }\n\n for (let grew = true; grew; ) {\n grew = false\n const wanted = new Set([...disk].flatMap((rel) => info.get(rel)!.deps))\n for (const [rel, p] of info) {\n if (!disk.has(rel) && wanted.has(p.name)) {\n disk.add(rel)\n grew = true\n }\n }\n }\n\n return new Map([...packages].filter(([rel]) => disk.has(rel)))\n}\n\nexport function missingMessage(missing: MissingPackage[], target: Platform, host: Platform): string {\n return (\n `[rsc-kit] The binary is compiled for ${describePlatform(target)}, and these native packages for it are not installed:\\n\\n` +\n missing.map((m) => ` ${m.name}${m.version ? `@${m.version}` : ''}`).join('\\n') +\n '\\n\\n' +\n `Install them for that platform, then compile again:\\n\\n` +\n ` bun install ${[...new Set([host.os, target.os])].map((os) => `--os=${os}`).join(' ')} ${[...new Set([host.arch, target.arch])].map((cpu) => `--cpu=${cpu}`).join(' ')}\\n\\n` +\n `This machine's own stay installed beside them, since the build loads them here.\\n` +\n `Compiled from this machine's packages instead, the binary would start and crash on the first import of one.`\n )\n}\n\n/** The entry a package exports for `sub` ('.' or './x'), under the conditions an import or a require uses. */\nfunction entryOf(pkgDir: string, sub: string, conditions: readonly string[], exists: (path: string) => boolean): string | undefined {\n const pkg = readJson(join(pkgDir, 'package.json'))\n\n if (!pkg) return undefined\n\n const pick = (target: unknown): string | undefined => {\n if (typeof target === 'string') return exists(join(pkgDir, target)) ? target : undefined\n if (Array.isArray(target)) {\n for (const item of target) {\n const found = pick(item)\n if (found) return found\n }\n return undefined\n }\n if (target && typeof target === 'object') {\n for (const condition of conditions) {\n if (condition in target) {\n const found = pick((target as Record<string, unknown>)[condition])\n if (found) return found\n }\n }\n }\n return undefined\n }\n\n const exported = pkg.exports\n\n if (exported !== undefined && exported !== null) {\n const keys = typeof exported === 'object' && !Array.isArray(exported) ? Object.keys(exported) : []\n const isMap = keys.length > 0 && keys.every((key) => key.startsWith('.'))\n\n if (!isMap) return sub === '.' ? pick(exported) : undefined\n\n const map = exported as Record<string, unknown>\n\n if (sub in map) return pick(map[sub])\n\n // A pattern: \"./*\": \"./dist/*.js\".\n for (const key of keys) {\n const star = key.indexOf('*')\n if (star === -1) continue\n\n const before = key.slice(0, star)\n const after = key.slice(star + 1)\n\n if (sub.startsWith(before) && sub.endsWith(after)) {\n const middle = sub.slice(before.length, sub.length - after.length)\n const target = JSON.parse(JSON.stringify(map[key]).replaceAll('*', middle)) as unknown\n return pick(target)\n }\n }\n\n return undefined\n }\n\n const candidates =\n sub === '.'\n ? [pkg.main, pkg.main && `${pkg.main}.js`, pkg.main && `${pkg.main}/index.js`, 'index.js']\n : [sub, `${sub}.js`, `${sub}.json`, `${sub}/index.js`]\n\n return candidates.find((candidate): candidate is string => !!candidate && exists(join(pkgDir, candidate)))\n}\n\nconst IMPORT_CONDITIONS = ['bun', 'node', 'import', 'module', 'default'] as const\nconst REQUIRE_CONDITIONS = ['bun', 'node', 'require', 'default'] as const\n\n/** The file a package specifier names, looked up the way Node walks node_modules from `fromDir`. */\nfunction resolveInTree(\n specifier: string,\n fromDir: string,\n treeRoot: string,\n kind: 'import' | 'require',\n exists: (path: string) => boolean,\n): string | undefined {\n const parts = specifier.split('/')\n const name = specifier.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0]\n const sub = '.' + specifier.slice(name.length)\n\n for (let dir = fromDir; dir.startsWith(treeRoot); dir = dirname(dir)) {\n const pkgDir = join(dir, 'node_modules', name)\n\n if (exists(join(pkgDir, 'package.json'))) {\n const entry = entryOf(pkgDir, sub, kind === 'import' ? IMPORT_CONDITIONS : REQUIRE_CONDITIONS, exists)\n return entry && join(pkgDir, entry)\n }\n\n if (dir === treeRoot) break\n }\n\n return undefined\n}\n\ntype Node = { type: string; start: number; end: number; [key: string]: unknown }\n\nfunction isBare(specifier: string): boolean {\n return !specifier.startsWith('.') && !specifier.startsWith('/') && !specifier.includes(':') && !isBuiltin(specifier)\n}\n\n/**\n * Every package name in a module's imports and requires, rewritten to the\n * relative path of the file it resolves to inside the tree. A name the tree\n * does not have - a branch for another platform, an optional peer - is left\n * as it is. A file the parser cannot read is left whole; its requires reach\n * the hook at runtime.\n */\nexport function rewriteSpecifiers(\n code: string,\n file: string,\n treeRoot: string,\n parse: (code: string) => unknown,\n exists: (path: string) => boolean = existsSync,\n): string {\n let ast: unknown\n\n try {\n ast = parse(code)\n } catch {\n return code\n }\n\n const edits: { start: number; end: number; text: string }[] = []\n\n const rewrite = (literal: unknown, kind: 'import' | 'require') => {\n const node = literal as Node | undefined\n\n if (!node || node.type !== 'Literal' || typeof node.value !== 'string' || !isBare(node.value)) return\n\n const resolved = resolveInTree(node.value, dirname(file), treeRoot, kind, exists)\n\n if (!resolved) return\n\n let path = relative(dirname(file), resolved).split(sep).join('/')\n if (!path.startsWith('.')) path = `./${path}`\n\n edits.push({ start: node.start, end: node.end, text: JSON.stringify(path) })\n }\n\n const visit = (value: unknown) => {\n if (Array.isArray(value)) {\n for (const item of value) visit(item)\n return\n }\n\n if (!value || typeof value !== 'object') return\n\n const node = value as Node\n\n switch (node.type) {\n case 'ImportDeclaration':\n case 'ExportNamedDeclaration':\n case 'ExportAllDeclaration':\n case 'ImportExpression':\n rewrite(node.source, 'import')\n break\n case 'CallExpression': {\n const callee = node.callee as Node & { name?: string; object?: Node & { name?: string }; property?: Node & { name?: string } }\n const args = node.arguments as unknown[]\n const isRequire =\n (callee.type === 'Identifier' && callee.name === 'require') ||\n (callee.type === 'MemberExpression' && callee.object?.name === 'require' && callee.property?.name === 'resolve')\n\n if (isRequire && args.length > 0) rewrite(args[0], 'require')\n break\n }\n }\n\n for (const key in node) {\n if (key !== 'type' && key !== 'start' && key !== 'end') visit(node[key])\n }\n }\n\n visit(ast)\n\n if (edits.length === 0) return code\n\n edits.sort((a, b) => b.start - a.start)\n\n let out = code\n for (const edit of edits) out = out.slice(0, edit.start) + edit.text + out.slice(edit.end)\n\n return out\n}\n\n/**\n * What the binary runs before the first import of a native package: write the\n * tree if this version has not, then answer each shim's require from it.\n *\n * Extraction is into a temporary directory renamed into place, so a tree that\n * exists is a whole one: two copies starting at once each write their own,\n * one rename wins, and the other discards its copy. A running copy touches its\n * tree hourly, and a start removes the trees of other versions that nothing\n * has touched for a day - never its own, and never one a running copy of\n * another version is still using.\n */\nexport const RUNTIME_SOURCE = `'use strict'\nconst { hash, files } = require('./natives.mjs')\nconst fs = require('node:fs')\nconst path = require('node:path')\nconst Module = require('node:module')\n\nconst HOUR = 60 * 60 * 1000\nconst STALE = 24 * HOUR\n\nlet base\n\nfunction prepare() {\n const root = process.env.RSC_KIT_RUNTIME_DIR ? path.resolve(process.env.RSC_KIT_RUNTIME_DIR) : path.dirname(process.execPath)\n const dir = path.join(root, hash)\n\n if (!fs.existsSync(dir)) {\n try {\n fs.mkdirSync(root, { recursive: true })\n const tmp = fs.mkdtempSync(path.join(root, '.' + hash + '-'))\n for (const [rel, src] of files) {\n const to = path.join(tmp, 'node_modules', rel)\n fs.mkdirSync(path.dirname(to), { recursive: true })\n fs.writeFileSync(to, fs.readFileSync(src))\n }\n try {\n fs.renameSync(tmp, dir)\n console.log('[rsc-kit] native packages: wrote ' + files.length + ' files to ' + dir)\n } catch (error) {\n fs.rmSync(tmp, { recursive: true, force: true })\n if (!fs.existsSync(dir)) throw error\n }\n } catch (error) {\n error.message =\n '[rsc-kit] the binary could not write its native packages to ' + root + ': ' + error.message +\n '. Set RSC_KIT_RUNTIME_DIR to a directory it can write to.'\n throw error\n }\n }\n\n const touch = () => { try { const now = new Date(); fs.utimesSync(dir, now, now) } catch {} }\n touch()\n setInterval(touch, HOUR).unref()\n sweep(root, path.basename(dir))\n\n base = path.join(dir, 'node_modules')\n\n // A require whose name is computed - require(name) - was not rewritten at\n // build time, and the binary's resolver cannot find it on disk. Answered\n // from the tree, for files inside it only.\n const resolve = Module._resolveFilename\n Module._resolveFilename = function (request, parent, ...rest) {\n try {\n return resolve.call(this, request, parent, ...rest)\n } catch (error) {\n const from = parent && parent.filename\n if (!from || !from.startsWith(dir) || request.startsWith('.') || request.startsWith('/') || Module.isBuiltin(request)) throw error\n const found = lookup(request, path.dirname(from))\n if (!found) throw error\n return found\n }\n }\n}\n\nfunction sweep(root, current) {\n let entries\n try { entries = fs.readdirSync(root, { withFileTypes: true }) } catch { return }\n const now = Date.now()\n for (const entry of entries) {\n if (!entry.isDirectory() || entry.name === current) continue\n const isTree = /^[0-9a-f]{16}$/.test(entry.name)\n const isPartial = /^\\\\.[0-9a-f]{16}-/.test(entry.name)\n if (!isTree && !isPartial) continue\n try {\n const age = now - fs.statSync(path.join(root, entry.name)).mtimeMs\n if (age > (isTree ? STALE : HOUR)) fs.rmSync(path.join(root, entry.name), { recursive: true, force: true })\n } catch {}\n }\n}\n\nfunction lookup(request, fromDir) {\n const parts = request.split('/')\n const name = request.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0]\n const sub = request.slice(name.length)\n for (let dir = fromDir; dir.startsWith(base) || dir === path.dirname(base); dir = path.dirname(dir)) {\n const pkgDir = path.join(dir, 'node_modules', name)\n if (fs.existsSync(path.join(pkgDir, 'package.json'))) {\n if (sub) return path.join(pkgDir, sub)\n const pkg = JSON.parse(fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf8'))\n return path.join(pkgDir, pkg.main || 'index.js')\n }\n if (dir === path.dirname(base)) break\n }\n}\n\nmodule.exports = function load(entry) {\n if (!base) prepare()\n const loaded = require(path.join(base, entry))\n // A package with only an ES module: required, it is a namespace, which an\n // import of the shim would otherwise take as a CommonJS module's exports.\n if (Object.prototype.toString.call(loaded) === '[object Module]') return { __esModule: true, ...loaded }\n return loaded\n}\n`\n\nexport interface CompileTree {\n hash: string\n files: number\n packages: string[]\n}\n\n/**\n * Write the compile tree for a server whose build traced external packages,\n * and point compile.mjs at it. Returns undefined, and touches nothing, when\n * there is nothing traced.\n *\n * The tree is a copy of the server with each traced package replaced by a\n * shim, so `bun build --compile` bundles the shim and embeds the package's\n * files: the server's own chunks import packages by name, and Bun resolves a\n * name from the importing file's location, so the copy is what makes those\n * names land on the shims rather than on the real packages beside the server.\n */\nexport function writeCompileTree(options: {\n serverDir: string\n projectRoot: string\n target: Platform\n parse: (code: string) => unknown\n /** serverExternalPackages, which go to disk whether or not they have a binary. */\n named?: readonly string[]\n}): CompileTree | { missing: MissingPackage[] } | undefined {\n const { serverDir, projectRoot, target, parse, named = [] } = options\n const serverNodeModules = join(serverDir, 'node_modules')\n const compileEntry = join(serverDir, 'compile.mjs')\n\n if (!existsSync(compileEntry) || packageDirs(serverNodeModules).length === 0) return undefined\n\n const { packages, missing } = nativeSet(serverNodeModules, projectRoot, target, named)\n\n if (missing.length > 0) return { missing }\n if (packages.size === 0) return undefined\n\n const tree = join(dirname(serverDir), COMPILE_TREE_DIR)\n const embedded = join(tree, '.native', 'node_modules')\n\n rmSync(tree, { recursive: true, force: true })\n\n // The server, without the stored pages (the inline module carries them).\n // Its node_modules too, links as they are, so a package that stays bundled\n // is found exactly where it was; the ones going to disk are replaced by\n // shims below.\n cpSync(serverDir, tree, {\n recursive: true,\n verbatimSymlinks: true,\n filter: (path) => {\n const rel = relative(serverDir, path).split(sep).join('/')\n return rel !== 'rsc-static' && !rel.startsWith('rsc-static/')\n },\n })\n\n // Each package intact, so a file it reads beside its own code - a .wasm, a\n // data file, its package.json - is where it looks.\n for (const [rel, from] of packages) {\n cpSync(from, join(embedded, rel), {\n recursive: true,\n dereference: true,\n filter: (path) => !relative(from, path).split(sep).includes('node_modules'),\n })\n }\n\n const list = files(embedded)\n const hasher = createHash('sha256')\n\n for (const rel of list) {\n const path = join(embedded, rel)\n\n if (/\\.(c|m)?js$/.test(rel)) {\n const code = readFileSync(path, 'utf-8')\n const rewritten = rewriteSpecifiers(code, path, dirname(embedded), parse)\n if (rewritten !== code) writeFileSync(path, rewritten)\n }\n\n hasher.update(rel)\n hasher.update('\\0')\n hasher.update(readFileSync(path))\n }\n\n const hash = hasher.digest('hex').slice(0, 16)\n const tops = [...packages.keys()].filter((rel) => !rel.includes('/node_modules/'))\n\n // What the app's chunks import by name. The entry each one loads is looked\n // up now, so the runtime only joins a path - the require entry, since the\n // shim is a require: an import of a CommonJS module's default is the whole\n // module, and of an ES module's namespace is the namespace.\n for (const name of tops) {\n const entry =\n resolveInTree(name, dirname(embedded), dirname(embedded), 'require', existsSync) ??\n resolveInTree(name, dirname(embedded), dirname(embedded), 'import', existsSync)\n const shimDir = join(tree, 'node_modules', name)\n const runtime = relative(shimDir, join(tree, 'rsc-kit-native.cjs')).split(sep).join('/')\n\n rmSync(shimDir, { recursive: true, force: true })\n mkdirSync(shimDir, { recursive: true })\n writeFileSync(join(shimDir, 'package.json'), JSON.stringify({ name, main: 'index.cjs' }) + '\\n')\n writeFileSync(\n join(shimDir, 'index.cjs'),\n entry\n ? `module.exports = require(${JSON.stringify(runtime)})(${JSON.stringify(relative(embedded, entry).split(sep).join('/'))})\\n`\n : `throw new Error(${JSON.stringify(`[rsc-kit] ${name} has no entry the binary can load`)})\\n`,\n )\n }\n\n writeFileSync(\n join(tree, 'natives.mjs'),\n '// Every file of the packages that run from disk, embedded by importing it as a file.\\n' +\n list.map((rel, i) => `import f${i} from ${JSON.stringify(`./.native/node_modules/${rel}`)} with { type: \"file\" };`).join('\\n') +\n `\\nexport const hash = ${JSON.stringify(hash)};\\n` +\n `export const files = [\\n${list.map((rel, i) => ` [${JSON.stringify(rel)}, f${i}]`).join(',\\n')}\\n];\\n`,\n )\n writeFileSync(join(tree, 'rsc-kit-native.cjs'), RUNTIME_SOURCE)\n\n writeFileSync(\n compileEntry,\n '// The entry to compile into one binary. This app has native packages, so the\\n' +\n `// entry is a copy of the server whose imports of them load them from disk:\\n` +\n `// ${tops.join(', ')}.\\n` +\n `import \"../${COMPILE_TREE_DIR}/compile.mjs\";\\n`,\n )\n\n return { hash, files: list.length, packages: tops }\n}\n\n/** The size of a directory, for the build's one line about it. */\nexport function sizeOf(dir: string): number {\n return files(dir).reduce((sum, rel) => sum + statSync(join(dir, rel)).size, 0)\n}\n"]}
|
package/dist/vite.d.ts
CHANGED
|
@@ -440,27 +440,6 @@ export interface KnownAction {
|
|
|
440
440
|
* its own - is its character code, so no two paths share an alias.
|
|
441
441
|
*/
|
|
442
442
|
export declare function toAlias(name: string): string;
|
|
443
|
-
/**
|
|
444
|
-
* Which of the two metadata exports a module actually has.
|
|
445
|
-
*
|
|
446
|
-
* Both are read separately because the generated entry names each one it
|
|
447
|
-
* mentions, and naming an export that is not there is a bundler warning on
|
|
448
|
-
* every build — `Import 'generateMetadata' will always be undefined`. Most
|
|
449
|
-
* pages export only the static object, so referencing both meant that warning
|
|
450
|
-
* for almost every route in an app.
|
|
451
|
-
*/
|
|
452
|
-
/**
|
|
453
|
-
* The root layout's metadataBase, read from the source. Wanted while the
|
|
454
|
-
* manifest is built, before there is a bundle to execute - the same reason
|
|
455
|
-
* generateStaticParams is detected by reading. A `new URL('…')` or a string
|
|
456
|
-
* literal; anything computed is not seen, and rscKit({ hosts }) says it.
|
|
457
|
-
*/
|
|
458
|
-
/**
|
|
459
|
-
* The app's single-binary step, as its package.json declares it: the script
|
|
460
|
-
* named compile, and the file its --outfile writes. Read from the app's own
|
|
461
|
-
* script, so a deploy runs what the app runs and never assumes a path. None
|
|
462
|
-
* when the app has no such script - a server it starts with node or bun.
|
|
463
|
-
*/
|
|
464
443
|
export declare function compileStep(root: string): {
|
|
465
444
|
compile?: string;
|
|
466
445
|
binary?: string;
|
package/dist/vite.js
CHANGED
|
@@ -2780,6 +2780,15 @@ function discover(dir) {
|
|
|
2780
2780
|
* script, so a deploy runs what the app runs and never assumes a path. None
|
|
2781
2781
|
* when the app has no such script - a server it starts with node or bun.
|
|
2782
2782
|
*/
|
|
2783
|
+
/** The app's compile script, which names the platform a binary is built for. */
|
|
2784
|
+
function compileScript(root) {
|
|
2785
|
+
try {
|
|
2786
|
+
return JSON.parse(readFileSync(join(root, "package.json"), "utf-8")).scripts?.compile;
|
|
2787
|
+
}
|
|
2788
|
+
catch {
|
|
2789
|
+
return undefined;
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2783
2792
|
export function compileStep(root) {
|
|
2784
2793
|
try {
|
|
2785
2794
|
const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf-8"));
|
|
@@ -7369,6 +7378,36 @@ export function rscKit(options = {}) {
|
|
|
7369
7378
|
}
|
|
7370
7379
|
writeFileSync(join(serverDir, "commands.mjs"), commandsEntrySource(commandEntryOptions()));
|
|
7371
7380
|
});
|
|
7381
|
+
// A binary carries what the server would read from node_modules. Once
|
|
7382
|
+
// Nitro has traced the native packages there, the compile entry is
|
|
7383
|
+
// pointed at a copy of the server that loads them from disk. See
|
|
7384
|
+
// native.ts. Building for the compile script and missing the target's
|
|
7385
|
+
// packages is a failure: the binary would start and die on the first
|
|
7386
|
+
// import of one. Any other build only says so.
|
|
7387
|
+
if (!nitro.options.preset?.startsWith("cloudflare")) {
|
|
7388
|
+
nitro.hooks.hook("compiled", async () => {
|
|
7389
|
+
const native = await import("./native.js");
|
|
7390
|
+
const script = compileScript(projectRoot);
|
|
7391
|
+
const target = native.targetPlatform(script);
|
|
7392
|
+
const tree = native.writeCompileTree({
|
|
7393
|
+
serverDir: nitro.options.output.serverDir,
|
|
7394
|
+
projectRoot,
|
|
7395
|
+
target,
|
|
7396
|
+
parse: (code) => parseAst(code),
|
|
7397
|
+
named: options.serverExternalPackages ?? [],
|
|
7398
|
+
});
|
|
7399
|
+
if (!tree)
|
|
7400
|
+
return;
|
|
7401
|
+
if ("missing" in tree) {
|
|
7402
|
+
const message = native.missingMessage(tree.missing, target, native.hostPlatform());
|
|
7403
|
+
if (process.env.npm_lifecycle_event === "compile")
|
|
7404
|
+
throw new Error(message);
|
|
7405
|
+
log(message.replace(/^\[rsc-kit\] /, "").replace("The binary is compiled", "A binary compiled now would be"));
|
|
7406
|
+
return;
|
|
7407
|
+
}
|
|
7408
|
+
log(`native packages: ${tree.packages.join(", ")} (${tree.files} files) travel inside the binary, written to disk on its first start`);
|
|
7409
|
+
});
|
|
7410
|
+
}
|
|
7372
7411
|
// On Workers the stored pages ride the static assets, not the bundle.
|
|
7373
7412
|
// Copied once Nitro has listed its public files, so the copies are
|
|
7374
7413
|
// not in that list: a path in it is served as an asset before the
|