@moonsjs/vite 0.1.17 → 0.2.0
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/{index-v5sbd3az.js → index-0agjty3z.js} +21 -18
- package/dist/index-0agjty3z.js.map +15 -0
- package/dist/index-f8w073cm.js +30 -0
- package/dist/index-f8w073cm.js.map +10 -0
- package/dist/{index-snbxks72.js → index-tbph0859.js} +80 -80
- package/dist/{index-snbxks72.js.map → index-tbph0859.js.map} +4 -4
- package/dist/index.js +33 -33
- package/dist/index.js.map +4 -4
- package/dist/server/handler.d.ts.map +1 -1
- package/dist/server/index.js +104 -93
- package/dist/server/index.js.map +10 -10
- package/dist/server/test-server.d.ts +6 -0
- package/dist/server/test-server.d.ts.map +1 -1
- package/dist/testing-preload.d.ts +2 -0
- package/dist/testing-preload.d.ts.map +1 -0
- package/dist/testing-preload.js +10 -0
- package/dist/testing-preload.js.map +10 -0
- package/dist/testing.d.ts +11 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +13 -0
- package/dist/testing.js.map +9 -0
- package/dist/transform.js +1 -1
- package/package.json +15 -5
- package/src/api.ts +14 -14
- package/src/devtools.ts +5 -5
- package/src/manifest.ts +2 -2
- package/src/plugin.ts +21 -21
- package/src/server/dev.ts +6 -1
- package/src/server/handler.ts +69 -47
- package/src/server/isr.ts +5 -5
- package/src/server/node-server.ts +6 -6
- package/src/server/node.ts +2 -2
- package/src/server/plugins.ts +1 -1
- package/src/server/prerender.ts +29 -29
- package/src/server/shell.ts +8 -8
- package/src/server/shutdown.ts +5 -5
- package/src/server/storage.ts +1 -1
- package/src/server/test-server.ts +12 -1
- package/src/server-only.ts +7 -7
- package/src/testing-preload.ts +5 -0
- package/src/testing.ts +34 -0
- package/src/transform.ts +76 -76
- package/dist/index-v5sbd3az.js.map +0 -15
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/transform.ts", "../src/server-only.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { MoonsError, computeFnHash, fnRegistryKey } from \"@moonsjs/core\";\nimport { parse, parseExpression } from \"@babel/parser\";\nimport { existsSync, readdirSync, readFileSync, realpathSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\nimport {\n createServerOnlyClassifier,\n serverOnlyImportError,\n type PackageJsonInfo,\n} from \"./server-only\";\n\n/**\n * Spec §12: analisis `.server.ts` + stub client + injeksi meta server +\n * penolakan import (E_SERVER_IMPORT_IN_CLIENT / E_FORBIDDEN_SERVER_IMPORT).\n */\n\nexport interface ServerFnInfo {\n name: string;\n hash: string;\n line: number;\n input: { start: number; end: number };\n output: { start: number; end: number };\n objectStart: number;\n}\n\nexport interface ServerFileAnalysis {\n /** Absolute path. */\n file: string;\n serverFns: ServerFnInfo[];\n /** Semua nama export top-level (langsung). */\n exportNames: string[];\n /** Pernyataan `export { X as Y } from \"./z.server\"` (untuk resolusi re-export). */\n reExports: Array<{ source: string; names: Array<{ local: string; exported: string }> }>;\n /** `export * from \"./z.server\"`. */\n exportAllFrom: string[];\n}\n\ninterface AstNode {\n type: string;\n start: number | null;\n end: number | null;\n loc?: { start: { line: number } } | null;\n [key: string]: unknown;\n}\n\nconst SERVER_SPECIFIER = /\\.server(\\.(ts|tsx|js|jsx|mts|cts|mjs|cjs))?$/i;\nconst CONTRACT_SERVER_FILE = /\\.server\\.(ts|tsx)$/i;\nconst NON_CONTRACT_SERVER_FILE = /\\.server\\.(js|jsx|mts|cts|mjs|cjs)$/i;\n\nexport function isServerFilePath(path: string): boolean {\n return CONTRACT_SERVER_FILE.test(stripQuery(path));\n}\n\n/** File server dengan ekstensi di luar kontrak §12 (tidak bisa di-stub). */\nexport function isNonContractServerFile(path: string): boolean {\n return NON_CONTRACT_SERVER_FILE.test(stripQuery(path));\n}\n\nexport function isServerSpecifier(specifier: string): boolean {\n return SERVER_SPECIFIER.test(specifier);\n}\n\n/**\n * Resolusi sinkron untuk specifier `*.server` (relatif/absolut).\n * Import alias/virtual untuk file server tidak didukung — tidak dibutuhkan app.\n */\nexport function resolveServerSpecifierSync(importerFile: string, specifier: string): string | null {\n if (!isServerSpecifier(specifier)) {\n return null;\n }\n const base = specifier.startsWith(\".\")\n ? resolve(dirname(importerFile), specifier)\n : isAbsolute(specifier)\n ? specifier\n : null;\n if (base === null) {\n return null;\n }\n for (const candidate of [base, `${base}.ts`, `${base}.tsx`]) {\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n return null;\n}\n\nexport function stripQuery(id: string): string {\n const queryIndex = id.indexOf(\"?\");\n return queryIndex === -1 ? id : id.slice(0, queryIndex);\n}\n\nfunction parseModule(code: string, filename: string): AstNode {\n return parse(code, {\n sourceType: \"module\",\n plugins: filename.endsWith(\".tsx\") ? [\"typescript\", \"jsx\"] : [\"typescript\"],\n errorRecovery: false,\n }) as unknown as AstNode;\n}\n\nfunction walk(\n node: unknown,\n visit: (node: AstNode, ancestors: AstNode[]) => void,\n ancestors: AstNode[] = [],\n): void {\n if (node === null || typeof node !== \"object\") {\n return;\n }\n if (Array.isArray(node)) {\n for (const item of node) {\n walk(item, visit, ancestors);\n }\n return;\n }\n const candidate = node as AstNode;\n if (typeof candidate.type !== \"string\" || typeof candidate.start !== \"number\") {\n return;\n }\n visit(candidate, ancestors);\n const nextAncestors = [...ancestors, candidate];\n for (const key of Object.keys(candidate)) {\n if (key === \"loc\" || key === \"start\" || key === \"end\" || key === \"extra\") {\n continue;\n }\n walk(candidate[key], visit, nextAncestors);\n }\n}\n\nfunction topLevelStatements(ast: AstNode): AstNode[] {\n const program = ast[\"program\"] as { body?: AstNode[] } | undefined;\n return program?.body ?? [];\n}\n\n/**\n * Type-only import/export (Addendum C.1): `import type ...`, `export type ...`,\n * atau seluruh specifier bertanda `type`. Terhapus saat kompilasi sehingga\n * dikecualikan dari gate paket server-only. `export * from` = bernilai.\n */\nfunction isTypeOnlyImportExport(statement: AstNode): boolean {\n const declarationKind = (statement[\"importKind\"] ?? statement[\"exportKind\"]) as\n | string\n | undefined;\n if (declarationKind === \"type\") {\n return true;\n }\n const specifiers = (statement[\"specifiers\"] ?? []) as AstNode[];\n if (specifiers.length === 0) {\n return false;\n }\n return specifiers.every(\n (item) => ((item[\"importKind\"] ?? item[\"exportKind\"]) as string | undefined) === \"type\",\n );\n}\n\nfunction keyName(node: unknown): string | null {\n const key = node as AstNode | undefined;\n if (key?.type === \"Identifier\") {\n return key[\"name\"] as string;\n }\n if (key?.type === \"StringLiteral\") {\n return key[\"value\"] as string;\n }\n return null;\n}\n\nfunction extractServerFnInit(init: unknown): {\n input: { start: number; end: number };\n output: { start: number; end: number };\n line: number;\n objectStart: number;\n} | null {\n const call = init as AstNode | undefined;\n if (call?.type !== \"CallExpression\") {\n return null;\n }\n const callee = call[\"callee\"] as AstNode | undefined;\n if (callee?.type !== \"Identifier\" || callee[\"name\"] !== \"serverFn\") {\n return null;\n }\n const args = (call[\"arguments\"] ?? []) as AstNode[];\n const first = args[0];\n if (first?.type !== \"ObjectExpression\") {\n return null;\n }\n\n const properties = new Map<string, AstNode>();\n for (const property of (first[\"properties\"] ?? []) as AstNode[]) {\n if (property.type !== \"ObjectProperty\") {\n continue;\n }\n const name = keyName(property[\"key\"]);\n if (name !== null) {\n properties.set(name, property);\n }\n }\n\n const input = properties.get(\"input\")?.[\"value\"] as AstNode | undefined;\n const output = properties.get(\"output\")?.[\"value\"] as AstNode | undefined;\n if (\n input?.start == null ||\n input.end == null ||\n output?.start == null ||\n output.end == null\n ) {\n return null;\n }\n\n return {\n input: { start: input.start, end: input.end },\n output: { start: output.start, end: output.end },\n line: call.loc?.start.line ?? 1,\n objectStart: first.start ?? 0,\n };\n}\n\nexport function analyzeServerFile(\n source: string,\n filename: string,\n projectRoot: string,\n): ServerFileAnalysis {\n const ast = parseModule(source, filename);\n const serverFns: ServerFnInfo[] = [];\n const exportNames: string[] = [];\n const reExports: ServerFileAnalysis[\"reExports\"] = [];\n const exportAllFrom: string[] = [];\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type === \"ExportNamedDeclaration\") {\n const declaration = statement[\"declaration\"] as AstNode | null | undefined;\n\n if (declaration?.type === \"VariableDeclaration\") {\n for (const declarator of (declaration[\"declarations\"] ?? []) as AstNode[]) {\n const id = declarator[\"id\"] as AstNode | undefined;\n if (id?.type !== \"Identifier\") {\n continue;\n }\n const name = id[\"name\"] as string;\n exportNames.push(name);\n const info = extractServerFnInit(declarator[\"init\"]);\n if (info !== null) {\n serverFns.push({\n name,\n hash: computeFnHash(projectRoot, filename, name),\n line: info.line,\n input: info.input,\n output: info.output,\n objectStart: info.objectStart,\n });\n }\n }\n } else if (declaration?.type === \"FunctionDeclaration\") {\n const id = declaration[\"id\"] as AstNode | undefined;\n if (id?.type === \"Identifier\") {\n exportNames.push(id[\"name\"] as string);\n }\n }\n\n for (const specifier of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n const exported = specifier[\"exported\"] as AstNode | undefined;\n if (exported?.type === \"Identifier\") {\n exportNames.push(exported[\"name\"] as string);\n }\n }\n\n const sourceNode = statement[\"source\"] as AstNode | undefined;\n if (sourceNode?.type === \"StringLiteral\" && isServerSpecifier(sourceNode[\"value\"] as string)) {\n reExports.push({\n source: sourceNode[\"value\"] as string,\n names: ((statement[\"specifiers\"] ?? []) as AstNode[]).map((specifier) => ({\n local: ((specifier[\"local\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\",\n exported: (((specifier[\"exported\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\"),\n })),\n });\n }\n } else if (statement.type === \"ExportDefaultDeclaration\") {\n exportNames.push(\"default\");\n } else if (statement.type === \"ExportAllDeclaration\") {\n const sourceNode = statement[\"source\"] as AstNode | undefined;\n if (sourceNode?.type === \"StringLiteral\" && isServerSpecifier(sourceNode[\"value\"] as string)) {\n exportAllFrom.push(sourceNode[\"value\"] as string);\n }\n }\n }\n\n return { file: filename, serverFns, exportNames, reExports, exportAllFrom };\n}\n\n/** Nama-nama yang diekspor sebagai serverFn stub dari file (langsung atau via re-export). */\nexport function serverFnExportNames(\n analysis: ServerFileAnalysis,\n analyzeTarget: (specifier: string) => ServerFileAnalysis | null,\n seen = new Set<string>(),\n): Set<string> {\n const names = new Set(analysis.serverFns.map((fn) => fn.name));\n\n for (const reExport of analysis.reExports) {\n const target = analyzeTarget(reExport.source);\n if (target === null || seen.has(reExport.source)) {\n continue;\n }\n seen.add(reExport.source);\n const targetNames = serverFnExportNames(target, analyzeTarget, seen);\n for (const { local, exported } of reExport.names) {\n if (local === \"*\" || targetNames.has(local)) {\n names.add(exported);\n }\n }\n }\n\n for (const specifier of analysis.exportAllFrom) {\n const target = analyzeTarget(specifier);\n if (target === null || seen.has(specifier)) {\n continue;\n }\n seen.add(specifier);\n for (const name of serverFnExportNames(target, analyzeTarget, seen)) {\n names.add(name);\n }\n }\n\n return names;\n}\n\nfunction collectRetainedText(source: string, analysis: ServerFileAnalysis): string {\n return analysis.serverFns\n .map((fn) => `${source.slice(fn.input.start, fn.input.end)}\\n${source.slice(fn.output.start, fn.output.end)}`)\n .join(\"\\n\");\n}\n\nfunction isUsed(name: string, retainedText: string): boolean {\n return new RegExp(`(^|[^\\\\w$])${escapeRegExp(name)}([^\\\\w$]|$)`).test(retainedText);\n}\n\nfunction escapeRegExp(text: string): string {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction collectPatternNames(node: AstNode | undefined, into: Set<string>): void {\n if (node === undefined) {\n return;\n }\n switch (node.type) {\n case \"Identifier\": {\n const name = node[\"name\"] as string | undefined;\n if (name !== undefined) {\n into.add(name);\n }\n return;\n }\n case \"ObjectPattern\":\n for (const property of (node[\"properties\"] ?? []) as AstNode[]) {\n collectPatternNames(\n (property.type === \"RestElement\" ? property[\"argument\"] : property[\"value\"]) as\n | AstNode\n | undefined,\n into,\n );\n }\n return;\n case \"ArrayPattern\":\n for (const element of (node[\"elements\"] ?? []) as AstNode[]) {\n collectPatternNames(element, into);\n }\n return;\n case \"AssignmentPattern\":\n collectPatternNames(node[\"left\"] as AstNode | undefined, into);\n return;\n case \"RestElement\":\n collectPatternNames(node[\"argument\"] as AstNode | undefined, into);\n return;\n default:\n return;\n }\n}\n\n/** Nama deklarasi nilai top-level (bukan import) — yang DIBUANG dari stub §12.3. */\nfunction localTopLevelNames(ast: AstNode): Set<string> {\n const names = new Set<string>();\n const declare = (decl: AstNode | null | undefined): void => {\n if (decl === undefined || decl === null) {\n return;\n }\n if (decl.type === \"VariableDeclaration\") {\n for (const declarator of (decl[\"declarations\"] ?? []) as AstNode[]) {\n collectPatternNames(declarator[\"id\"] as AstNode | undefined, names);\n }\n return;\n }\n if (decl.type === \"FunctionDeclaration\" || decl.type === \"ClassDeclaration\") {\n const name = ((decl[\"id\"] as AstNode | undefined)?.[\"name\"] as string | undefined) ?? \"\";\n if (name.length > 0) {\n names.add(name);\n }\n }\n };\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type === \"ExportNamedDeclaration\" || statement.type === \"ExportDefaultDeclaration\") {\n declare(statement[\"declaration\"] as AstNode | null | undefined);\n } else {\n declare(statement);\n }\n }\n return names;\n}\n\n/** Identifier posisi-nilai yang direferensikan di dalam ekspresi (key/member di-skip). */\nfunction referencedIdentifiers(expression: string, filename: string): Set<string> {\n const ast = parseExpression(expression, {\n plugins: filename.endsWith(\".tsx\") ? [\"typescript\", \"jsx\"] : [\"typescript\"],\n }) as unknown as AstNode;\n const names = new Set<string>();\n\n walk(ast, (node, ancestors) => {\n if (node.type !== \"Identifier\") {\n return;\n }\n const parent = ancestors[ancestors.length - 1];\n if (parent !== undefined) {\n const parentType = parent.type as string;\n const nonComputed = parent[\"computed\"] !== true;\n if (\n nonComputed &&\n (parentType === \"MemberExpression\" || parentType === \"OptionalMemberExpression\") &&\n parent[\"property\"] === node\n ) {\n return;\n }\n if (\n nonComputed &&\n (parentType === \"ObjectProperty\" ||\n parentType === \"ObjectMethod\" ||\n parentType === \"ClassProperty\" ||\n parentType === \"TSPropertySignature\") &&\n parent[\"key\"] === node\n ) {\n return;\n }\n }\n names.add((node[\"name\"] as string | undefined) ?? \"\");\n });\n\n return names;\n}\n\nexport interface StubDependencies {\n /** Resolve specifier relatif file sumber → analysis (null bila tidak bisa). */\n analyzeSpecifier: (sourceFile: string, specifier: string) => ServerFileAnalysis | null;\n}\n\nexport interface RenderStubResult {\n code: string;\n /** Specifier server file yang di-referensikan (untuk keperluan cache/diagnostik). */\n referenced: string[];\n}\n\n/**\n * Bangun stub client §12.2/§12.3 dari sumber `.server.ts`:\n * hanya import yang dipakai schema + `__moons_createStub` per serverFn.\n */\nexport function renderServerFnStub(\n source: string,\n filename: string,\n analysis: ServerFileAnalysis,\n dependencies: StubDependencies,\n): RenderStubResult {\n const ast = parseModule(source, filename);\n const retainedText = collectRetainedText(source, analysis);\n const localNames = localTopLevelNames(ast);\n const importLines: string[] = [];\n const referenced: string[] = [];\n // Addendum J.4 (D2): nama yang diimpor dari file `*.server.ts` lain — dipakai\n // untuk mendeteksi referensi schema ke nilai server (dulu `MISSING_EXPORT`).\n const serverImportedNames = new Map<string, { specifier: string; imported: string }>();\n let needsCreateStub = analysis.serverFns.length > 0;\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type !== \"ImportDeclaration\") {\n continue;\n }\n const sourceNode = statement[\"source\"] as AstNode;\n const specifier = sourceNode[\"value\"] as string;\n\n if (/^@moons\\/server(\\/|$)/.test(specifier)) {\n continue; // serverFn/env tidak dibawa ke client (§12.2)\n }\n if (specifier.startsWith(\"node:\") || specifier.startsWith(\"bun:\")) {\n continue; // import server-only dibuang\n }\n\n const specifiers = (statement[\"specifiers\"] ?? []) as AstNode[];\n const kept: AstNode[] = [];\n\n if (isServerSpecifier(specifier)) {\n referenced.push(specifier);\n for (const item of specifiers) {\n if (item.type === \"ImportDefaultSpecifier\" || item.type === \"ImportNamespaceSpecifier\") {\n continue; // default / * as dari *.server → dibuang (§12.2)\n }\n const local = ((item[\"local\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\";\n if (local.length > 0 && isUsed(local, retainedText)) {\n kept.push(item);\n const imported =\n ((item[\"imported\"] as AstNode | undefined)?.[\"name\"] as string | undefined) ?? local;\n serverImportedNames.set(local, { specifier, imported });\n }\n }\n } else {\n for (const item of specifiers) {\n const local = ((item[\"local\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\";\n if (local.length > 0 && isUsed(local, retainedText)) {\n kept.push(item);\n }\n }\n }\n\n if (kept.length === 0) {\n continue; // import tak terpakai → dipangkas (§12.3)\n }\n\n const keptText = kept\n .map((item) => source.slice(item.start ?? 0, item.end ?? 0))\n .join(\", \");\n importLines.push(`import { ${keptText} } from ${JSON.stringify(specifier)};`);\n }\n\n if (needsCreateStub) {\n importLines.push('import { __moons_createStub } from \"@moonsjs/server/client\";');\n }\n\n const exportLines: string[] = [];\n for (const fn of analysis.serverFns) {\n const input = source.slice(fn.input.start, fn.input.end);\n const output = source.slice(fn.output.start, fn.output.end);\n\n // E_SCHEMA_LOCAL_REF: deklarasi lokal dibuang dari stub, jadi referensinya\n // menjadi `undefined` di browser (crash hydration — dulu lolos build).\n for (const [kind, slice] of [\n [\"input\", input],\n [\"output\", output],\n ] as const) {\n for (const reference of referencedIdentifiers(slice, filename)) {\n if (reference.length === 0) {\n continue;\n }\n const serverImport = serverImportedNames.get(reference);\n if (serverImport !== undefined) {\n const target = dependencies.analyzeSpecifier(filename, serverImport.specifier);\n const isServerFn =\n target !== null && target.serverFns.some((fn) => fn.name === serverImport.imported);\n if (!isServerFn) {\n throw new MoonsError({\n code: \"E_SCHEMA_SERVER_REF\",\n file: filename,\n line: fn.line,\n annotation: fn.name,\n message: `schema ${kind} serverFn \\`${fn.name}\\` merujuk nilai server \\`${reference}\\` dari \\`${serverImport.specifier}\\``,\n details:\n `\\`${reference}\\` diimpor dari file server lain dan bukan serverFn — stub client tidak mengekspornya (dulu gagal dengan error mentah bundler \\`MISSING_EXPORT\\`).\\n\\n` +\n \"Pilih salah satu:\\n\" +\n \" // a) pindahkan konstanta/schema ke modul client-safe\\n\" +\n ` import { ${reference} } from \"../shared/schemas\";\\n` +\n \" // b) inline nilai yang memang publik di schema, atau\\n\" +\n \" // c) validasi tambahan di handler (server) tanpa mereferensikan nilai server di schema\",\n suggestions: [\n \"Pindahkan deklarasi yang dirujuk ke modul bersama yang client-safe (mis. `src/shared/schemas.ts`)\",\n \"Atau lakukan validasi di handler server, bukan di ekspresi schema\",\n ],\n });\n }\n continue;\n }\n if (!localNames.has(reference)) {\n continue;\n }\n throw new MoonsError({\n code: \"E_SCHEMA_LOCAL_REF\",\n file: filename,\n line: fn.line,\n annotation: fn.name,\n message: `schema ${kind} serverFn \\`${fn.name}\\` merujuk deklarasi lokal \\`${reference}\\``,\n details:\n `\\`${reference}\\` dibuang dari stub client, sehingga nilainya \\`undefined\\` di browser (crash hydration).\\n\\n` +\n \"Sebelum (ditolak):\\n\" +\n ` const ${reference} = z.object({ … }); // deklarasi lokal di file yang sama\\n` +\n ` export const ${fn.name} = serverFn({ ${kind}: ${reference}, … });\\n\\n` +\n \"Sesudah (pilih salah satu):\\n\" +\n ` // a) inline schema di argumen\\n` +\n ` export const ${fn.name} = serverFn({ ${kind}: z.object({ … }), … });\\n` +\n ` // b) pindahkan deklarasi ke modul bersama yang boleh masuk client (mis. src/shared/schemas.ts)\\n` +\n ` import { ${reference} } from \"../shared/schemas\";`,\n suggestions: [\n `Inline schema di argumen \\`serverFn({ ${kind}: … })\\`, atau`,\n `Pindahkan \\`${reference}\\` ke modul bersama (mis. \\`src/shared/schemas.ts\\`) lalu impor dari sana`,\n \"Jangan memindahkan nilai rahasia ke shared — schema harus client-safe (zod/Standard Schema)\",\n ],\n });\n }\n }\n\n exportLines.push(\n `export const ${fn.name} = __moons_createStub({ hash: ${JSON.stringify(fn.hash)}, input: ${input}, output: ${output} });`,\n );\n }\n\n for (const reExport of analysis.reExports) {\n const target = dependencies.analyzeSpecifier(filename, reExport.source);\n if (target === null) {\n throw new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: filename,\n message: `tidak bisa me-resolve \\`${reExport.source}\\` untuk re-export`,\n details: \"Re-export dari `*.server.ts` harus bisa di-resolve statis.\",\n suggestions: [\"Perbaiki path re-export\", \"Hindari re-export dinamis dari file server\"],\n });\n }\n const targetNames = serverFnExportNames(target, (specifier) =>\n dependencies.analyzeSpecifier(filename, specifier),\n );\n const keptNames = reExport.names.filter(({ local }) => local !== \"\" && targetNames.has(local));\n if (keptNames.length > 0) {\n const specifiers = keptNames\n .map(({ local, exported }) => (local === exported ? local : `${local} as ${exported}`))\n .join(\", \");\n exportLines.push(`export { ${specifiers} } from ${JSON.stringify(reExport.source)};`);\n }\n }\n\n for (const specifier of analysis.exportAllFrom) {\n const target = dependencies.analyzeSpecifier(filename, specifier);\n if (target === null) {\n throw new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: filename,\n message: `\\`export *\\` dari \\`${specifier}\\` tidak bisa di-resolve`,\n details: \"`export *` dari `*.server.ts` wajib bisa di-expand statis.\",\n suggestions: [\"Perbaiki path re-export\", \"Ganti menjadi named re-export\"],\n });\n }\n const targetNames = serverFnExportNames(target, (nested) =>\n dependencies.analyzeSpecifier(filename, nested),\n );\n if (targetNames.size > 0) {\n exportLines.push(\n `export { ${[...targetNames].join(\", \")} } from ${JSON.stringify(specifier)};`,\n );\n }\n }\n\n if (importLines.length === 0 && exportLines.length === 0) {\n return { code: \"// @moons: tidak ada serverFn yang di-export\\nexport {};\\n\", referenced };\n }\n\n return { code: `${[...importLines, \"\", ...exportLines].join(\"\\n\")}\\n`, referenced };\n}\n\n/** Inject meta §7.2 ke deklarasi serverFn (env ssr; handler tetap utuh). */\nexport function injectServerFnMeta(\n source: string,\n analysis: ServerFileAnalysis,\n projectRoot: string,\n): string {\n let output = source;\n const inserts = [...analysis.serverFns].sort((a, b) => b.objectStart - a.objectStart);\n\n for (const fn of inserts) {\n const meta =\n ` __hash: ${JSON.stringify(fn.hash)},` +\n ` __file: ${JSON.stringify(fnRegistryKey(projectRoot, analysis.file, fn.name).split(\"#\")[0] as string)},` +\n ` __line: ${fn.line},` +\n ` __exportName: ${JSON.stringify(fn.name)},`;\n const at = fn.objectStart + 1;\n output = output.slice(0, at) + meta + output.slice(at);\n }\n\n return output;\n}\n\nexport interface ClientImportCheckContext {\n /** Absolute path file yang sedang diperiksa. */\n file: string;\n code: string;\n projectRoot: string;\n /**\n * Resolve specifier dengan importer tertentu → absolute path (null bila tidak\n * ada). Boleh sinkron maupun async (plugin memakai `this.resolve`, sehingga\n * alias Vite & `tsconfig paths` ikut terperiksa — audit ronde 2).\n */\n resolve: (specifier: string, importer: string) => string | null | Promise<string | null>;\n /** Analysis untuk file server (hasil cache plugin). */\n analyze: (absoluteFile: string) => ServerFileAnalysis | null;\n /** Direktori `src/api` (absolut) — modul API server-only (Addendum D.1). */\n apiDir?: string;\n /** File config (absolut) — server-only (Addendum J.4). */\n configFile?: string;\n /** Direktori `src/server` (absolut) — server-only (Addendum J.4). */\n serverDir?: string;\n /** Paket server-only tambahan dari `security.serverOnlyPackages` (Addendum C). */\n serverOnlyPackages?: ReadonlyArray<string>;\n /** Cache package.json lintas modul (performa; dikelola plugin). */\n packageCache?: Map<string, PackageJsonInfo | null>;\n}\n\n/** Nama serverFn (langsung atau via re-export) — versi async untuk pemeriksaan resolve. */\nasync function serverFnExportNamesAsync(\n analysis: ServerFileAnalysis,\n analyzeSpecifier: (specifier: string, importer: string) => Promise<ServerFileAnalysis | null>,\n seen = new Set<string>(),\n): Promise<Set<string>> {\n const names = new Set(analysis.serverFns.map((fn) => fn.name));\n\n for (const reExport of analysis.reExports) {\n const key = `${analysis.file}\\0${reExport.source}`;\n if (seen.has(key)) {\n continue;\n }\n seen.add(key);\n const target = await analyzeSpecifier(reExport.source, analysis.file);\n if (target === null) {\n continue;\n }\n const targetNames = await serverFnExportNamesAsync(target, analyzeSpecifier, seen);\n for (const { local, exported } of reExport.names) {\n if (local === \"*\" || targetNames.has(local)) {\n names.add(exported);\n }\n }\n }\n\n for (const specifier of analysis.exportAllFrom) {\n const key = `${analysis.file}\\0${specifier}`;\n if (seen.has(key)) {\n continue;\n }\n seen.add(key);\n const target = await analyzeSpecifier(specifier, analysis.file);\n if (target === null) {\n continue;\n }\n for (const name of await serverFnExportNamesAsync(target, analyzeSpecifier, seen)) {\n names.add(name);\n }\n }\n\n return names;\n}\n\nexport function nonContractServerFileError(file: string, projectRoot: string): MoonsError {\n return new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: toRelative(projectRoot, file),\n message: \"file server memakai ekstensi di luar kontrak `*.server.ts`\",\n details:\n \"Transform zero-trust hanya menangani `*.server.ts`/`*.server.tsx`; file server dengan ekstensi lain tidak bisa di-stub dan tidak boleh masuk graph client.\",\n suggestions: [\n \"Ganti nama file menjadi `*.server.ts`/`*.server.tsx` dan taruh `serverFn` di dalamnya\",\n \"Atau pindahkan nilai yang dibutuhkan ke file non-server\",\n ],\n });\n}\n\n/** Periksa import modul client terhadap §12.4/§12.7/§12.8 — berbasis hasil resolve. */\ninterface TraceFileRecord {\n ast: AstNode | null;\n mentionsServer: boolean;\n}\n\n/**\n * Addendum K.1: telusuri apakah `name` dari sebuah modul client pada akhirnya\n * berasal dari `*.server.ts` (langsung atau lewat rantai re-export/barrel),\n * dan bukan serverFn. Mengembalikan file server yang bermasalah, atau null.\n */\nasync function traceValueToServer(input: {\n file: string;\n name: string;\n resolveSafe: (specifier: string, importer: string) => Promise<string | null>;\n analyze: (absoluteFile: string) => ServerFileAnalysis | null;\n cache: Map<string, TraceFileRecord>;\n seen: Set<string>;\n}): Promise<string | null> {\n const key = `${input.file}#${input.name}`;\n if (input.seen.has(key) || input.seen.size > 64) {\n return null;\n }\n input.seen.add(key);\n\n const record = loadTraceFile(input.file, input.cache);\n if (record === null || record.ast === null || !record.mentionsServer) {\n return null;\n }\n const ast = record.ast;\n if (localTopLevelNames(ast).has(input.name)) {\n return null; // didefinisikan lokal = kode client\n }\n\n const importBindings = new Map<string, { specifier: string; imported: string }>();\n const edges: Array<{ specifier: string; local: string }> = [];\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type === \"ImportDeclaration\") {\n const source = (statement[\"source\"] as AstNode | null | undefined)?.[\"value\"];\n if (typeof source !== \"string\") {\n continue;\n }\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n if (item.type !== \"ImportSpecifier\") {\n continue;\n }\n const local = (item[\"local\"] as AstNode | undefined)?.[\"name\"] as string | undefined;\n const imported = ((item[\"imported\"] as AstNode | undefined)?.[\"name\"] as string | undefined) ?? local;\n if (local !== undefined && imported !== undefined) {\n importBindings.set(local, { specifier: source, imported });\n }\n }\n continue;\n }\n\n if (statement.type === \"ExportNamedDeclaration\") {\n const source = (statement[\"source\"] as AstNode | null | undefined)?.[\"value\"];\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n if (item.type !== \"ExportSpecifier\") {\n continue;\n }\n const local = (item[\"local\"] as AstNode | undefined)?.[\"name\"] as string | undefined;\n const exported = ((item[\"exported\"] as AstNode | undefined)?.[\"name\"] as string | undefined) ?? local;\n if (local === undefined || exported !== input.name) {\n continue;\n }\n if (typeof source === \"string\") {\n edges.push({ specifier: source, local });\n } else {\n const binding = importBindings.get(local);\n if (binding !== undefined) {\n edges.push({ specifier: binding.specifier, local: binding.imported });\n }\n }\n }\n continue;\n }\n\n const exportedAll = statement[\"exported\"];\n if (\n statement.type === \"ExportAllDeclaration\" &&\n (exportedAll === null || exportedAll === undefined)\n ) {\n const source = (statement[\"source\"] as AstNode | null | undefined)?.[\"value\"];\n if (typeof source === \"string\") {\n edges.push({ specifier: source, local: input.name });\n }\n }\n }\n\n for (const edge of edges) {\n const next = await input.resolveSafe(edge.specifier, input.file);\n if (next === null) {\n continue;\n }\n if (isServerFilePath(next)) {\n const analysis = input.analyze(next);\n const isServerFn =\n analysis !== null && analysis.serverFns.some((fn) => fn.name === edge.local);\n if (!isServerFn) {\n return next;\n }\n continue;\n }\n const deeper = await traceValueToServer({\n ...input,\n file: next,\n name: edge.local,\n });\n if (deeper !== null) {\n return deeper;\n }\n }\n return null;\n}\n\nfunction loadTraceFile(file: string, cache: Map<string, TraceFileRecord>): TraceFileRecord | null {\n const cached = cache.get(file);\n if (cached !== undefined) {\n return cached;\n }\n let record: TraceFileRecord | null = null;\n try {\n const source = readFileSync(file, \"utf8\");\n // Pra-filter murah: hanya modul yang (a) menyebut `.server` atau (b)\n // punya re-export (`export … from`) yang bisa menjadi mata rantai barrel.\n const isBarrel = /(^|\\n)\\s*export\\s+(\\*|\\{[^}]*\\})\\s+from\\s/.test(source);\n const mentionsServer = source.includes(\".server\") || isBarrel;\n record = {\n ast: mentionsServer ? parseModule(source, file) : null,\n mentionsServer,\n };\n } catch {\n record = null;\n }\n cache.set(file, record ?? { ast: null, mentionsServer: false });\n return record;\n}\n\nexport async function checkClientModuleImports(\n context: ClientImportCheckContext,\n): Promise<void> {\n const { file, code, projectRoot, resolve, analyze } = context;\n const ast = parseModule(code, file);\n const traceCache = new Map<string, TraceFileRecord>();\n const relativeFile = toRelative(projectRoot, file);\n // Addendum C: gate paket server-only (daftar bawaan ∪ security.serverOnlyPackages ∪ marker).\n const serverOnly = createServerOnlyClassifier({\n configured: context.serverOnlyPackages ?? [],\n ...(context.packageCache === undefined ? {} : { cache: context.packageCache }),\n });\n // Addendum D.1: `src/api/**` server-only (endpoint HTTP mentah).\n let apiDirReal: string | null = null;\n if (context.apiDir !== undefined && context.apiDir.length > 0) {\n try {\n apiDirReal = realpathSync(context.apiDir);\n } catch {\n apiDirReal = context.apiDir;\n }\n }\n\n // Addendum J.4: config + direktori `src/server/**` server-only.\n let configFileReal: string | null = null;\n if (context.configFile !== undefined) {\n try {\n configFileReal = realpathSync(context.configFile);\n } catch {\n configFileReal = context.configFile;\n }\n }\n let serverDirReal: string | null = null;\n if (context.serverDir !== undefined) {\n try {\n serverDirReal = realpathSync(context.serverDir);\n } catch {\n serverDirReal = context.serverDir;\n }\n }\n\n const rejectConfigImport = (line: number, specifier: string): never => {\n throw new MoonsError({\n code: \"E_FORBIDDEN_SERVER_IMPORT\",\n file: relativeFile,\n line,\n message: `mengimpor \\`${specifier}\\` — \\`moons.config.ts\\` adalah modul server-only`,\n details:\n \"Config memuat `context`/`middleware` (kode server) dan tidak pernah masuk bundle client (Addendum J.4).\",\n suggestions: [\n \"Pindahkan nilai yang dibutuhkan ke modul client-safe (mis. `src/shared/…`)\",\n \"Ambil nilai dari server lewat loader/serverFn\",\n ],\n });\n };\n\n const rejectServerDirImport = (line: number, specifier: string, resolvedTarget: string): never => {\n throw new MoonsError({\n code: \"E_FORBIDDEN_SERVER_IMPORT\",\n file: relativeFile,\n line,\n message: `mengimpor \\`${specifier}\\` — \\`${toRelative(projectRoot, resolvedTarget)}\\` ada di \\`src/server/**\\` (server-only)`,\n details:\n \"Direktori `src/server/**` hanya untuk kode server (Addendum J.4); suffix `.server.ts` bukan satu-satunya jaminan.\",\n suggestions: [\n \"Pindahkan kode yang client-safe ke `src/shared/`\",\n \"Akses nilainya dari server lewat loader/serverFn\",\n ],\n });\n };\n\n const rejectApiImport = (line: number, specifier: string, resolvedTarget: string): never => {\n const relApi = toRelative(projectRoot, resolvedTarget);\n throw new MoonsError({\n code: \"E_FORBIDDEN_SERVER_IMPORT\",\n file: relativeFile,\n line,\n message: `mengimpor \\`${specifier}\\` — \\`${relApi}\\` adalah modul API server-only`,\n details:\n \"`src/api/**` hanya berjalan di server (endpoint HTTP) dan tidak pernah masuk bundle client.\",\n suggestions: [\n \"Pindahkan operasi tersebut ke `*.server.ts` dan panggil lewat serverFn\",\n \"Jangan mengimpor file `src/api` dari route/komponen client\",\n ],\n });\n };\n\n const resolveSafe = async (specifier: string, importer: string): Promise<string | null> => {\n try {\n const result = await resolve(specifier, importer);\n if (result === null) {\n return null;\n }\n const clean = stripQuery(result);\n // Audit ronde 2: normalisasi realpath — symlink ke `*.server.ts` harus\n // tertangkap walau resolver mengembalikan path link.\n try {\n return realpathSync(clean);\n } catch {\n return clean;\n }\n } catch {\n return null;\n }\n };\n\n const analyzeResolved = async (\n specifier: string,\n importer: string,\n ): Promise<ServerFileAnalysis | null> => {\n const absolute = await resolveSafe(specifier, importer);\n return absolute === null ? null : analyze(absolute);\n };\n\n const isAllowedServerFnImport = async (\n resolvedTarget: string | null,\n specifier: string,\n name: string,\n ): Promise<boolean> => {\n const target =\n resolvedTarget === null ? await analyzeResolved(specifier, file) : analyze(resolvedTarget);\n if (target === null) {\n return false;\n }\n const names = await serverFnExportNamesAsync(target, (nested, importer) =>\n analyzeResolved(nested, importer),\n );\n return names.has(name);\n };\n\n const reject = (line: number, message: string, details: string): never => {\n throw new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: relativeFile,\n line,\n message,\n details,\n suggestions: [\n \"Buat server function yang mengembalikan data yang dibutuhkan, atau\",\n \"Jika nilainya memang publik, definisikan ulang konstanta itu di modul yang boleh masuk client (jangan memindahkan nilai rahasia)\",\n ],\n });\n };\n\n const rejectForbidden = (line: number, specifier: string): never => {\n throw new MoonsError({\n code: \"E_FORBIDDEN_SERVER_IMPORT\",\n file: relativeFile,\n line,\n message: `mengimpor \\`${specifier}\\` di modul client`,\n details: \"Modul server-only hanya boleh di-import dari *.server.ts.\",\n suggestions: [\n \"Pindahkan operasi tersebut ke serverFn, atau\",\n \"Hapus import tersebut\",\n ],\n });\n };\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type === \"ImportDeclaration\" || statement.type === \"ExportNamedDeclaration\" || statement.type === \"ExportAllDeclaration\") {\n const sourceNode = statement[\"source\"] as AstNode | null | undefined;\n if (sourceNode?.type !== \"StringLiteral\") {\n continue;\n }\n const rawSpecifier = sourceNode[\"value\"] as string;\n // Query Vite (`?raw`, `?url`, `?inline`, dst.) dinormalisasi untuk\n // pencocokan & resolusi (audit adversarial M6).\n const specifier = stripQuery(rawSpecifier);\n const line = statement.loc?.start.line ?? 1;\n // Addendum C: type-only (`import type ...`, seluruh specifier tipe)\n // terhapus saat kompilasi → dikecualikan dari gate paket server-only.\n const typeOnly = isTypeOnlyImportExport(statement);\n\n if (specifier.startsWith(\"node:\") || specifier.startsWith(\"bun:\")) {\n rejectForbidden(line, specifier);\n }\n\n const resolvedTarget = await resolveSafe(specifier, file);\n\n // Addendum D.1: modul `src/api/**` server-only.\n if (apiDirReal !== null && resolvedTarget !== null && isInsideDir(resolvedTarget, apiDirReal)) {\n rejectApiImport(line, rawSpecifier, resolvedTarget);\n }\n\n // Addendum J.4: `moons.config.ts` + direktori `src/server/**` server-only\n // (impor nilai; type-only dikecualikan — J.5).\n if (!typeOnly && resolvedTarget !== null) {\n if (configFileReal !== null && resolvedTarget === configFileReal) {\n rejectConfigImport(line, rawSpecifier);\n }\n if (\n serverDirReal !== null &&\n isInsideDir(resolvedTarget, serverDirReal) &&\n !isServerFilePath(resolvedTarget) &&\n // File non-kontrak (`*.server.mts` dll.) punya error khusus yang\n // lebih tepat — biarkan jatuh ke pemeriksaan di bawah.\n !isNonContractServerFile(resolvedTarget)\n ) {\n rejectServerDirImport(line, rawSpecifier, resolvedTarget);\n }\n }\n\n // Addendum C: paket server-only (nama paket hasil resolve — subpath,\n // alias, tsconfig paths, symlink/workspace ikut tertangkap).\n if (!typeOnly) {\n const match = serverOnly.check({\n specifier,\n resolvedFile: resolvedTarget,\n importerFile: file,\n });\n if (match !== null) {\n throw serverOnlyImportError({\n relativeFile,\n line,\n specifier: rawSpecifier,\n packageName: match.packageName,\n source: match.source,\n ...(match.source === \"marker\"\n ? { markerPath: toRelative(projectRoot, join(match.packageDir, \"package.json\")) }\n : {}),\n });\n }\n }\n\n // Audit ronde 2: file server di luar kontrak §12 ditolak (tidak bisa di-stub).\n if (resolvedTarget !== null && isNonContractServerFile(resolvedTarget)) {\n throw nonContractServerFileError(resolvedTarget, projectRoot);\n }\n\n // Audit ronde 2: keputusan berbasis hasil resolve — menangkap alias Vite,\n // `tsconfig paths`, dan symlink (realpath) yang menunjuk `*.server.ts`.\n const serverBySpecifier = isServerSpecifier(specifier);\n const serverByResolve = resolvedTarget !== null && isServerFilePath(resolvedTarget);\n if (!serverBySpecifier && !serverByResolve) {\n // Addendum K.1: rantai re-export ke `*.server.ts` (barrel) — pesan Moons\n // menggantikan `MISSING_EXPORT` bundler. Hanya nilai (bukan type-only).\n if (!typeOnly && resolvedTarget !== null && /[.](ts|tsx)$/.test(resolvedTarget)) {\n const requestedNames: string[] = [];\n if (statement.type === \"ImportDeclaration\") {\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n if (item.type !== \"ImportSpecifier\") {\n continue;\n }\n const kind = (item[\"importKind\"] ?? statement[\"importKind\"]) as string | undefined;\n if (kind === \"type\") {\n continue;\n }\n const imported = (item[\"imported\"] as AstNode | undefined)?.[\"name\"] as string | undefined;\n if (imported !== undefined) {\n requestedNames.push(imported);\n }\n }\n } else if (statement.type === \"ExportNamedDeclaration\") {\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n const kind = (item[\"importKind\"] ??\n statement[\"importKind\"] ??\n item[\"exportKind\"] ??\n statement[\"exportKind\"]) as string | undefined;\n if (kind === \"type\") {\n continue;\n }\n const local = (item[\"local\"] as AstNode | undefined)?.[\"name\"] as string | undefined;\n if (local !== undefined) {\n requestedNames.push(local);\n }\n }\n }\n for (const name of requestedNames) {\n const serverFile = await traceValueToServer({\n file: resolvedTarget,\n name,\n resolveSafe,\n analyze,\n cache: traceCache,\n seen: new Set<string>(),\n });\n if (serverFile !== null) {\n throw new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: relativeFile,\n line,\n message: `mengimpor \\`${name}\\` — berasal dari \\`${toRelative(projectRoot, serverFile)}\\` (via rantai re-export)`,\n details:\n `\\`${toRelative(projectRoot, resolvedTarget)}\\` me-re-export nilai dari file server; ` +\n \"stub client tidak mengekspornya (dulu gagal dengan error mentah bundler `MISSING_EXPORT`).\",\n suggestions: [\n \"Buat server function yang mengembalikan data yang dibutuhkan, atau\",\n \"Definisikan ulang konstanta publik itu di modul client-safe (jangan pindahkan nilai rahasia)\",\n ],\n });\n }\n }\n }\n continue;\n }\n\n const targetRelative =\n resolvedTarget === null ? rawSpecifier : toRelative(projectRoot, resolvedTarget);\n\n if (statement.type === \"ExportAllDeclaration\") {\n if (resolvedTarget === null) {\n reject(line, `\\`export *\\` dari \\`${targetRelative}\\` tidak bisa di-resolve`, \"Re-export dari `*.server.ts` wajib bisa di-resolve statis.\");\n }\n continue; // aman: target menjadi stub\n }\n\n const specifiers = (statement[\"specifiers\"] ?? []) as AstNode[];\n for (const item of specifiers) {\n if (item.type === \"ImportDefaultSpecifier\") {\n reject(line, `mengimpor default dari ${targetRelative}`, \"Default export dari file server tidak boleh menyeberang ke client.\");\n }\n if (item.type === \"ImportNamespaceSpecifier\") {\n reject(line, `mengimpor namespace (\\`* as\\`) dari ${targetRelative}`, \"Import namespace dari file server tidak boleh menyeberang ke client.\");\n }\n const name = ((item[\"local\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\";\n // Type-only (Addendum J.5): Babel menaruh `importKind: \"type\"` di\n // statement untuk `import type { X }`, dan di specifier untuk\n // `import { type X }` — keduanya harus dibaca (D1).\n const specifierKind = item[\"importKind\"] as string | undefined;\n const statementKind = statement[\"importKind\"] as string | undefined;\n if (specifierKind === \"type\" || statementKind === \"type\") {\n continue;\n }\n if (name.length > 0 && !(await isAllowedServerFnImport(resolvedTarget, specifier, name))) {\n reject(\n line,\n `mengimpor \\`${name}\\` dari ${targetRelative}`,\n \"Kode server tidak boleh muncul di client.\\nHanya `serverFn` yang diizinkan menyeberang.\",\n );\n }\n }\n }\n }\n\n // §12.4: pemanggilan env() di modul client (juga @moonsjs/server import env).\n const envBindings = new Set<string>();\n for (const statement of topLevelStatements(ast)) {\n if (statement.type !== \"ImportDeclaration\") {\n continue;\n }\n const sourceNode = statement[\"source\"] as AstNode | undefined;\n const specifier = sourceNode?.type === \"StringLiteral\" ? (sourceNode[\"value\"] as string) : \"\";\n if (specifier !== \"@moonsjs/server\" && !specifier.startsWith(\"@moonsjs/server/\")) {\n continue;\n }\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n if (item.type !== \"ImportSpecifier\") {\n continue;\n }\n const imported = item[\"imported\"] as AstNode | undefined;\n const local = item[\"local\"] as AstNode | undefined;\n if (imported?.type === \"Identifier\" && imported[\"name\"] === \"env\" && local?.type === \"Identifier\") {\n envBindings.add(local[\"name\"] as string);\n }\n }\n }\n\n if (envBindings.size > 0) {\n walk(ast, (node) => {\n if (node.type !== \"CallExpression\") {\n return;\n }\n const callee = node[\"callee\"] as AstNode | undefined;\n if (callee?.type !== \"Identifier\" || !envBindings.has(callee[\"name\"] as string)) {\n return;\n }\n const callText = code\n .slice(node.start ?? 0, node.end ?? 0)\n .replace(/\\s+/g, \" \")\n .slice(0, 80);\n throw new MoonsError({\n code: \"E_ENV_IN_CLIENT\",\n file: relativeFile,\n line: node.loc?.start.line ?? 1,\n message: `memanggil \\`${callText}\\` di modul yang masuk client`,\n details: \"`env()` hanya legal di server.\",\n suggestions: [\n \"Pindahkan pemanggilan ke dalam serverFn, atau\",\n \"Gunakan import.meta.env untuk nilai publik\",\n ],\n });\n });\n }\n\n // Dynamic import (§12.7/§12.8) — literal maupun template dengan teks `.server`,\n // plus resolusi (alias/tsconfig paths/symlink) — audit ronde 2.\n const dynamicRequests: Array<{ request: DynamicImportRequest; guarded: boolean }> = [];\n walk(ast, (node, ancestors) => {\n const request = dynamicImportRequest(node);\n if (request !== null) {\n dynamicRequests.push({\n request,\n guarded: ancestors.some((ancestor) => isDevGuard(ancestor)),\n });\n }\n });\n\n for (const { request, guarded } of dynamicRequests) {\n if (guarded) {\n continue; // §12.8: branch DEV/PROD mati saat build → tidak perlu diperiksa\n }\n\n const specifier = stripQuery(request.text);\n const resolvedTarget = await resolveSafe(specifier, file);\n\n // Addendum D.1: dynamic import modul `src/api/**` juga ditolak.\n if (apiDirReal !== null && resolvedTarget !== null && isInsideDir(resolvedTarget, apiDirReal)) {\n rejectApiImport(request.node.loc?.start.line ?? 1, request.text, resolvedTarget);\n }\n\n // Addendum C: dynamic import paket server-only juga digerbang.\n const match = serverOnly.check({\n specifier,\n resolvedFile: resolvedTarget,\n importerFile: file,\n });\n if (match !== null) {\n throw serverOnlyImportError({\n relativeFile,\n line: request.node.loc?.start.line ?? 1,\n specifier: request.text,\n packageName: match.packageName,\n source: match.source,\n dynamic: true,\n ...(match.source === \"marker\"\n ? { markerPath: toRelative(projectRoot, join(match.packageDir, \"package.json\")) }\n : {}),\n });\n }\n\n if (resolvedTarget !== null && isNonContractServerFile(resolvedTarget)) {\n throw nonContractServerFileError(resolvedTarget, projectRoot);\n }\n\n const serverBySpecifier = isServerSpecifier(specifier);\n const serverByResolve = resolvedTarget !== null && isServerFilePath(resolvedTarget);\n if (!serverBySpecifier && !serverByResolve) {\n continue;\n }\n\n const targetRelative =\n resolvedTarget === null ? request.text : toRelative(projectRoot, resolvedTarget);\n reject(request.node.loc?.start.line ?? 1, `mengimpor (dynamic) \\`${request.text}\\` dari ${targetRelative}`, \"Client tidak boleh melakukan dynamic import ke `*.server.ts`.\");\n }\n\n // `import.meta.glob` yang mencakup `*.server.ts` (§12.7) — audit adversarial M6.\n walk(ast, (node) => {\n if (node.type !== \"CallExpression\") {\n return;\n }\n const callee = node[\"callee\"] as AstNode | undefined;\n if (callee?.type !== \"MemberExpression\") {\n return;\n }\n const object = callee[\"object\"] as AstNode | undefined;\n const property = callee[\"property\"] as AstNode | undefined;\n if (\n object?.type !== \"MetaProperty\" ||\n property?.type !== \"Identifier\" ||\n property[\"name\"] !== \"glob\"\n ) {\n return;\n }\n\n for (const pattern of globPatterns(((node[\"arguments\"] ?? []) as AstNode[])[0])) {\n if (!isServerSpecifier(pattern)) {\n continue;\n }\n throw new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: relativeFile,\n line: node.loc?.start.line ?? 1,\n message: `mengimpor (glob) \\`${pattern}\\` di modul client`,\n details: \"`import.meta.glob` yang mencakup `*.server.ts` dilarang di client.\",\n suggestions: [\n \"Import statis `serverFn` dari `*.server.ts` (hanya itu yang boleh menyeberang), atau\",\n \"Pindahkan kebutuhan data ke dalam server function\",\n ],\n });\n }\n });\n}\n\ninterface DynamicImportRequest {\n /** Teks specifier literal, atau gabungan quasi template (`*` untuk ekspresi). */\n text: string;\n node: AstNode;\n}\n\n/** Dukung Babel 8 (`ImportExpression`) dan bentuk lama (`CallExpression` + callee `Import`). */\nfunction dynamicImportRequest(node: AstNode): DynamicImportRequest | null {\n let sourceNode: AstNode | null = null;\n\n if (node.type === \"ImportExpression\") {\n sourceNode = (node[\"source\"] as AstNode | undefined) ?? null;\n } else if (node.type === \"CallExpression\") {\n const callee = node[\"callee\"] as AstNode | undefined;\n if (callee?.type !== \"Import\") {\n return null;\n }\n sourceNode = ((node[\"arguments\"] ?? []) as AstNode[])[0] ?? null;\n }\n\n if (sourceNode === null) {\n return null;\n }\n if (sourceNode.type === \"StringLiteral\") {\n return { text: sourceNode[\"value\"] as string, node: sourceNode };\n }\n if (sourceNode.type === \"TemplateLiteral\") {\n const text = ((sourceNode[\"quasis\"] ?? []) as AstNode[])\n .map((quasi) => ((quasi[\"value\"] as { cooked?: string | null } | undefined)?.cooked ?? \"\"))\n .join(\"*\");\n return { text, node: sourceNode };\n }\n return null;\n}\n\nfunction globPatterns(node: AstNode | undefined): string[] { if (node?.type === \"StringLiteral\") {\n return [node[\"value\"] as string];\n }\n if (node?.type === \"ArrayExpression\") {\n return ((node[\"elements\"] ?? []) as Array<AstNode | null>)\n .filter((element): element is AstNode => element?.type === \"StringLiteral\")\n .map((element) => element[\"value\"] as string);\n }\n return [];\n}\n\nfunction isDevGuard(node: AstNode): boolean {\n if (node.type !== \"IfStatement\") {\n return false;\n }\n const test = node[\"test\"] as AstNode | undefined;\n return isImportMetaFlag(test, \"DEV\") || isNegatedImportMetaFlag(test, \"PROD\");\n}\n\nfunction isImportMetaFlag(node: AstNode | undefined, flag: string): boolean {\n const member = node;\n if (member?.type !== \"MemberExpression\") {\n return false;\n }\n const property = member[\"property\"] as AstNode | undefined;\n if (property?.type !== \"Identifier\" || property[\"name\"] !== flag) {\n return false;\n }\n const object = member[\"object\"] as AstNode | undefined;\n return isImportMetaEnv(object);\n}\n\nfunction isNegatedImportMetaFlag(node: AstNode | undefined, flag: string): boolean {\n if (node?.type !== \"UnaryExpression\" || node[\"operator\"] !== \"!\") {\n return false;\n }\n return isImportMetaFlag(node[\"argument\"] as AstNode | undefined, flag);\n}\n\nfunction isImportMetaEnv(node: AstNode | undefined): boolean {\n if (node?.type !== \"MemberExpression\") {\n return false;\n }\n const property = node[\"property\"] as AstNode | undefined;\n if (property?.type !== \"Identifier\" || property[\"name\"] !== \"env\") {\n return false;\n }\n const object = node[\"object\"] as AstNode | undefined;\n return object?.type === \"MetaProperty\";\n}\n\nfunction toRelative(projectRoot: string, file: string): string {\n const relative = file.startsWith(projectRoot)\n ? file.slice(projectRoot.length).replace(/^[/\\\\]/, \"\")\n : file;\n return relative.split(\"\\\\\").join(\"/\");\n}\n\nfunction isInsideDir(file: string, dir: string): boolean {\n const normalized = dir.endsWith(\"/\") ? dir : `${dir}/`;\n return file === dir || file.startsWith(normalized);\n}\n\nexport interface RouteExportCheckContext {\n file: string;\n code: string;\n routesDir: string;\n projectRoot: string;\n}\n\n/**\n * §11.2 + §12.4: export legal per jenis modul route.\n * page: `default|loader|meta|prerender|paths` (D.5); layout: `default|loader`;\n * `_error`/`_404`: `default`.\n */\nexport function checkRouteModuleExports(context: RouteExportCheckContext): void {\n const { file, code, routesDir, projectRoot } = context;\n if (!file.startsWith(routesDir) || !file.endsWith(\".tsx\")) {\n return;\n }\n\n const base = file.slice(file.lastIndexOf(\"/\") + 1);\n if (base.startsWith(\"_\") && base !== \"_layout.tsx\" && base !== \"_error.tsx\" && base !== \"_404.tsx\") {\n return; // bukan route (diabaikan scanner)\n }\n\n const allowed =\n base === \"_layout.tsx\"\n ? [\"default\", \"loader\"]\n : base === \"_error.tsx\" || base === \"_404.tsx\"\n ? [\"default\"]\n : [\"default\", \"loader\", \"meta\", \"prerender\", \"paths\", \"revalidate\"];\n const allowedText = `Hanya ${allowed.map((name) => `\\`${name}\\``).join(\", \")} yang boleh di-export.`;\n const relativeFile = toRelative(projectRoot, file);\n const ast = parseModule(code, file);\n\n const declarations: Array<{ name: string; line: number }> = [];\n let hasDefault = false;\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type === \"ExportDefaultDeclaration\") {\n hasDefault = true;\n continue;\n }\n\n if (statement.type === \"ExportAllDeclaration\") {\n throw new MoonsError({\n code: \"E_ROUTE_EXPORT_INVALID\",\n file: relativeFile,\n line: statement.loc?.start.line ?? 1,\n message: \"`export *` tidak diizinkan di modul route\",\n details: allowedText,\n suggestions: [\n `Pindahkan isi file ke luar ${toRelative(projectRoot, routesDir)}/, atau`,\n \"Hapus `export *` tersebut\",\n ],\n });\n }\n\n if (statement.type !== \"ExportNamedDeclaration\") {\n continue;\n }\n\n const declaration = statement[\"declaration\"] as AstNode | null | undefined;\n if (declaration !== null && declaration !== undefined) {\n for (const name of declarationNames(declaration)) {\n declarations.push({ name, line: declaration.loc?.start.line ?? 1 });\n }\n }\n\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n const exported = item[\"exported\"] as AstNode | undefined;\n const name =\n exported?.type === \"Identifier\"\n ? (exported[\"name\"] as string)\n : exported?.type === \"StringLiteral\"\n ? (exported[\"value\"] as string)\n : null;\n if (name !== null) {\n declarations.push({ name, line: item.loc?.start.line ?? statement.loc?.start.line ?? 1 });\n }\n }\n }\n\n for (const entry of declarations) {\n if (!allowed.includes(entry.name)) {\n throw new MoonsError({\n code: \"E_ROUTE_EXPORT_INVALID\",\n file: relativeFile,\n line: entry.line,\n message: `export \\`${entry.name}\\` tidak diizinkan di modul route`,\n details: allowedText,\n suggestions: [\n `Pindahkan \\`${entry.name}\\` ke file di luar ${toRelative(projectRoot, routesDir)}/, atau`,\n \"Hapus export tersebut\",\n ],\n });\n }\n }\n\n if (!hasDefault) {\n throw new MoonsError({\n code: \"E_ROUTE_EXPORT_INVALID\",\n file: relativeFile,\n message: \"modul route wajib mengekspor `default`\",\n details: \"Setiap file route harus punya `export default` berupa komponen React.\",\n suggestions: [\"Tambahkan `export default function Page() { ... }`\"],\n });\n }\n}\n\nfunction declarationNames(declaration: AstNode): string[] {\n switch (declaration.type) {\n case \"VariableDeclaration\":\n return ((declaration[\"declarations\"] ?? []) as AstNode[])\n .map((declarator) => ((declarator[\"id\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\")\n .filter((name) => name.length > 0);\n case \"FunctionDeclaration\":\n case \"ClassDeclaration\":\n case \"TSInterfaceDeclaration\":\n case \"TSTypeAliasDeclaration\":\n case \"TSEnumDeclaration\":\n return [((declaration[\"id\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\"].filter(\n (name) => name.length > 0,\n );\n default:\n return [];\n }\n}\n\n/** Scan semua `*.server.{ts,tsx}` di bawah root (exclude direktori build/dependency). */\nexport function scanServerFiles(projectRoot: string): string[] {\n const excluded = new Set([\"node_modules\", \"dist\", \".moons\", \".git\"]);\n const result: string[] = [];\n\n const walkDir = (dir: string): void => {\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n if (entry.isDirectory()) {\n if (excluded.has(entry.name)) {\n continue;\n }\n walkDir(join(dir, entry.name));\n } else if (entry.isFile() && isServerFilePath(entry.name)) {\n result.push(join(dir, entry.name));\n }\n }\n };\n\n walkDir(projectRoot);\n return result.sort();\n}\n\nexport interface FnRegistryJson {\n [key: string]: string;\n}\n\n/** Bangun isi `fn-registry.json` (bentuk yang dibaca §21.3). */\nexport function buildFnRegistry(projectRoot: string, files: string[]): FnRegistryJson {\n const registry: FnRegistryJson = {};\n for (const file of files) {\n let source: string;\n try {\n source = readFileSync(file, \"utf8\");\n } catch {\n continue;\n }\n const analysis = analyzeServerFile(source, file, projectRoot);\n for (const fn of analysis.serverFns) {\n registry[fnRegistryKey(projectRoot, file, fn.name)] = fn.hash;\n }\n }\n return registry;\n}\n",
|
|
6
|
-
"import { MoonsError } from \"@moonsjs/core\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\n\n/**\n * Gate paket server-only (PRD Addendum C): paket npm yang tidak boleh masuk\n * graph client — di-import dari route/client/shared → build gagal.\n *\n * Daftar bawaan adalah **minimum normatif** dan TIDAK dapat dihapus app:\n * gate kebocoran tidak boleh bisa dilonggarkan (prinsip \"batas lebih ketat\n * menang\"); salah-tangkap diperbaiki lewat rilis framework.\n */\nexport const DEFAULT_SERVER_ONLY_PACKAGES: ReadonlyArray<string> = [\n \"pg\",\n \"postgres\",\n \"mysql\",\n \"mysql2\",\n \"sqlite3\",\n \"better-sqlite3\",\n \"drizzle-orm\",\n \"@prisma/client\",\n \"prisma\",\n \"mongodb\",\n \"mongoose\",\n \"redis\",\n \"ioredis\",\n \"bcrypt\",\n \"bcryptjs\",\n \"argon2\",\n \"jsonwebtoken\",\n \"nodemailer\",\n \"sharp\",\n \"execa\",\n \"cross-spawn\",\n \"dotenv\",\n \"knex\",\n \"typeorm\",\n \"sequelize\",\n \"@libsql/client\",\n];\n\nexport type ServerOnlyMatchSource = \"builtin\" | \"config\" | \"marker\";\n\nexport interface PackageJsonInfo {\n /** Direktori package (tempat package.json berada). */\n dir: string;\n name: string;\n serverOnlyMarker: boolean;\n}\n\nexport interface ServerOnlyMatch {\n packageName: string;\n source: ServerOnlyMatchSource;\n packageDir: string;\n}\n\nexport interface ServerOnlyClassifier {\n check(input: {\n specifier: string;\n resolvedFile: string | null;\n importerFile: string;\n }): ServerOnlyMatch | null;\n}\n\nexport interface ServerOnlyClassifierOptions {\n /** `security.serverOnlyPackages` — tambahan milik app (tidak menghapus bawaan). */\n configured?: ReadonlyArray<string>;\n /** Cache package.json per-direktori; bagikan lintas modul demi performa. */\n cache?: Map<string, PackageJsonInfo | null>;\n}\n\n/** Nama paket dari specifier bare (dipakai sebagai info pelengkap; pencocokan utama lewat resolve). */\nexport function packageNameFromSpecifier(specifier: string): string | null {\n if (\n specifier.length === 0 ||\n specifier.startsWith(\".\") ||\n specifier.startsWith(\"/\") ||\n specifier.startsWith(\"\\0\") ||\n specifier.includes(\":\")\n ) {\n return null;\n }\n const parts = specifier.split(\"/\");\n if (specifier.startsWith(\"@\")) {\n if (parts.length < 2 || (parts[1] ?? \"\").length === 0) {\n return null;\n }\n return `${parts[0]}/${parts[1]}`;\n }\n return parts[0] ?? null;\n}\n\n/** Baca package.json pada direktori tertentu (null bila tidak ada/gagal). */\nexport function tryReadPackageJson(dir: string): PackageJsonInfo | null {\n const candidate = join(dir, \"package.json\");\n if (!existsSync(candidate)) {\n return null;\n }\n try {\n const json = JSON.parse(readFileSync(candidate, \"utf8\")) as {\n name?: unknown;\n moons?: unknown;\n };\n const moons = json.moons as { serverOnly?: unknown } | undefined;\n return {\n dir,\n name: typeof json.name === \"string\" ? json.name : \"\",\n serverOnlyMarker: moons?.serverOnly === true,\n };\n } catch {\n return null;\n }\n}\n\n/** Baca package.json terdekat dari sebuah file absolut (menelusuri ke atas). */\nexport function readPackageJsonFrom(file: string): PackageJsonInfo | null {\n let dir = dirname(file);\n for (let depth = 0; depth < 64; depth += 1) {\n const info = tryReadPackageJson(dir);\n if (info !== null) {\n return info;\n }\n const parent = dirname(dir);\n if (parent === dir) {\n return null;\n }\n dir = parent;\n }\n return null;\n}\n\nexport function createServerOnlyClassifier(\n options: ServerOnlyClassifierOptions = {},\n): ServerOnlyClassifier {\n const cache = options.cache ?? new Map<string, PackageJsonInfo | null>();\n const configured = new Set(options.configured ?? []);\n const builtin = new Set(DEFAULT_SERVER_ONLY_PACKAGES);\n\n const infoOf = (file: string): PackageJsonInfo | null => {\n let dir = dirname(file);\n for (let depth = 0; depth < 64; depth += 1) {\n if (cache.has(dir)) {\n return cache.get(dir) ?? null;\n }\n const info = tryReadPackageJson(dir);\n if (info !== null) {\n cache.set(dir, info);\n return info;\n }\n // Direktori tanpa package.json: lanjut ke atas (tidak di-cache agar\n // penelusuran berikutnya tetap benar untuk subtree berbeda).\n const parent = dirname(dir);\n if (parent === dir) {\n return null;\n }\n dir = parent;\n }\n return null;\n };\n\n return {\n check({ specifier: _specifier, resolvedFile, importerFile }) {\n if (resolvedFile === null) {\n return null;\n }\n const info = infoOf(resolvedFile);\n if (info === null || info.name.length === 0) {\n return null;\n }\n // Gate menyasar dependency: import di dalam package yang sama diabaikan.\n const importer = infoOf(importerFile);\n if (importer !== null && importer.dir === info.dir) {\n return null;\n }\n if (builtin.has(info.name)) {\n return { packageName: info.name, source: \"builtin\", packageDir: info.dir };\n }\n if (configured.has(info.name)) {\n return { packageName: info.name, source: \"config\", packageDir: info.dir };\n }\n if (info.serverOnlyMarker) {\n return { packageName: info.name, source: \"marker\", packageDir: info.dir };\n }\n return null;\n },\n };\n}\n\n/**\n * Error §15 untuk import paket server-only (kode tetap\n * `E_FORBIDDEN_SERVER_IMPORT`, PRD Addendum C.3).\n */\nexport function serverOnlyImportError(input: {\n relativeFile: string;\n line: number;\n specifier: string;\n packageName: string;\n source: ServerOnlyMatchSource;\n /** Path package.json relatif project — untuk sumber kecocokan \"marker\". */\n markerPath?: string;\n dynamic?: boolean;\n}): MoonsError {\n const sourceLabel =\n input.source === \"builtin\"\n ? \"
|
|
5
|
+
"import { MoonsError, computeFnHash, fnRegistryKey } from \"@moonsjs/core\";\nimport { parse, parseExpression } from \"@babel/parser\";\nimport { existsSync, readdirSync, readFileSync, realpathSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\nimport {\n createServerOnlyClassifier,\n serverOnlyImportError,\n type PackageJsonInfo,\n} from \"./server-only\";\n\n/**\n * Spec §12: analisis `.server.ts` + stub client + injeksi meta server +\n * penolakan import (E_SERVER_IMPORT_IN_CLIENT / E_FORBIDDEN_SERVER_IMPORT).\n */\n\nexport interface ServerFnInfo {\n name: string;\n hash: string;\n line: number;\n input: { start: number; end: number };\n output: { start: number; end: number };\n objectStart: number;\n}\n\nexport interface ServerFileAnalysis {\n /** Absolute path. */\n file: string;\n serverFns: ServerFnInfo[];\n /** Semua nama export top-level (langsung). */\n exportNames: string[];\n /** Pernyataan `export { X as Y } from \"./z.server\"` (untuk resolusi re-export). */\n reExports: Array<{ source: string; names: Array<{ local: string; exported: string }> }>;\n /** `export * from \"./z.server\"`. */\n exportAllFrom: string[];\n}\n\ninterface AstNode {\n type: string;\n start: number | null;\n end: number | null;\n loc?: { start: { line: number } } | null;\n [key: string]: unknown;\n}\n\nconst SERVER_SPECIFIER = /\\.server(\\.(ts|tsx|js|jsx|mts|cts|mjs|cjs))?$/i;\nconst CONTRACT_SERVER_FILE = /\\.server\\.(ts|tsx)$/i;\nconst NON_CONTRACT_SERVER_FILE = /\\.server\\.(js|jsx|mts|cts|mjs|cjs)$/i;\n\nexport function isServerFilePath(path: string): boolean {\n return CONTRACT_SERVER_FILE.test(stripQuery(path));\n}\n\n/** File server dengan ekstensi di luar kontrak §12 (tidak bisa di-stub). */\nexport function isNonContractServerFile(path: string): boolean {\n return NON_CONTRACT_SERVER_FILE.test(stripQuery(path));\n}\n\nexport function isServerSpecifier(specifier: string): boolean {\n return SERVER_SPECIFIER.test(specifier);\n}\n\n/**\n * Resolusi sinkron untuk specifier `*.server` (relatif/absolut).\n * Import alias/virtual untuk file server tidak didukung — tidak dibutuhkan app.\n */\nexport function resolveServerSpecifierSync(importerFile: string, specifier: string): string | null {\n if (!isServerSpecifier(specifier)) {\n return null;\n }\n const base = specifier.startsWith(\".\")\n ? resolve(dirname(importerFile), specifier)\n : isAbsolute(specifier)\n ? specifier\n : null;\n if (base === null) {\n return null;\n }\n for (const candidate of [base, `${base}.ts`, `${base}.tsx`]) {\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n return null;\n}\n\nexport function stripQuery(id: string): string {\n const queryIndex = id.indexOf(\"?\");\n return queryIndex === -1 ? id : id.slice(0, queryIndex);\n}\n\nfunction parseModule(code: string, filename: string): AstNode {\n return parse(code, {\n sourceType: \"module\",\n plugins: filename.endsWith(\".tsx\") ? [\"typescript\", \"jsx\"] : [\"typescript\"],\n errorRecovery: false,\n }) as unknown as AstNode;\n}\n\nfunction walk(\n node: unknown,\n visit: (node: AstNode, ancestors: AstNode[]) => void,\n ancestors: AstNode[] = [],\n): void {\n if (node === null || typeof node !== \"object\") {\n return;\n }\n if (Array.isArray(node)) {\n for (const item of node) {\n walk(item, visit, ancestors);\n }\n return;\n }\n const candidate = node as AstNode;\n if (typeof candidate.type !== \"string\" || typeof candidate.start !== \"number\") {\n return;\n }\n visit(candidate, ancestors);\n const nextAncestors = [...ancestors, candidate];\n for (const key of Object.keys(candidate)) {\n if (key === \"loc\" || key === \"start\" || key === \"end\" || key === \"extra\") {\n continue;\n }\n walk(candidate[key], visit, nextAncestors);\n }\n}\n\nfunction topLevelStatements(ast: AstNode): AstNode[] {\n const program = ast[\"program\"] as { body?: AstNode[] } | undefined;\n return program?.body ?? [];\n}\n\n/**\n * Type-only import/export (Addendum C.1): `import type ...`, `export type ...`,\n * atau seluruh specifier bertanda `type`. Terhapus saat kompilasi sehingga\n * dikecualikan dari gate paket server-only. `export * from` = bernilai.\n */\nfunction isTypeOnlyImportExport(statement: AstNode): boolean {\n const declarationKind = (statement[\"importKind\"] ?? statement[\"exportKind\"]) as\n | string\n | undefined;\n if (declarationKind === \"type\") {\n return true;\n }\n const specifiers = (statement[\"specifiers\"] ?? []) as AstNode[];\n if (specifiers.length === 0) {\n return false;\n }\n return specifiers.every(\n (item) => ((item[\"importKind\"] ?? item[\"exportKind\"]) as string | undefined) === \"type\",\n );\n}\n\nfunction keyName(node: unknown): string | null {\n const key = node as AstNode | undefined;\n if (key?.type === \"Identifier\") {\n return key[\"name\"] as string;\n }\n if (key?.type === \"StringLiteral\") {\n return key[\"value\"] as string;\n }\n return null;\n}\n\nfunction extractServerFnInit(init: unknown): {\n input: { start: number; end: number };\n output: { start: number; end: number };\n line: number;\n objectStart: number;\n} | null {\n const call = init as AstNode | undefined;\n if (call?.type !== \"CallExpression\") {\n return null;\n }\n const callee = call[\"callee\"] as AstNode | undefined;\n if (callee?.type !== \"Identifier\" || callee[\"name\"] !== \"serverFn\") {\n return null;\n }\n const args = (call[\"arguments\"] ?? []) as AstNode[];\n const first = args[0];\n if (first?.type !== \"ObjectExpression\") {\n return null;\n }\n\n const properties = new Map<string, AstNode>();\n for (const property of (first[\"properties\"] ?? []) as AstNode[]) {\n if (property.type !== \"ObjectProperty\") {\n continue;\n }\n const name = keyName(property[\"key\"]);\n if (name !== null) {\n properties.set(name, property);\n }\n }\n\n const input = properties.get(\"input\")?.[\"value\"] as AstNode | undefined;\n const output = properties.get(\"output\")?.[\"value\"] as AstNode | undefined;\n if (\n input?.start == null ||\n input.end == null ||\n output?.start == null ||\n output.end == null\n ) {\n return null;\n }\n\n return {\n input: { start: input.start, end: input.end },\n output: { start: output.start, end: output.end },\n line: call.loc?.start.line ?? 1,\n objectStart: first.start ?? 0,\n };\n}\n\nexport function analyzeServerFile(\n source: string,\n filename: string,\n projectRoot: string,\n): ServerFileAnalysis {\n const ast = parseModule(source, filename);\n const serverFns: ServerFnInfo[] = [];\n const exportNames: string[] = [];\n const reExports: ServerFileAnalysis[\"reExports\"] = [];\n const exportAllFrom: string[] = [];\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type === \"ExportNamedDeclaration\") {\n const declaration = statement[\"declaration\"] as AstNode | null | undefined;\n\n if (declaration?.type === \"VariableDeclaration\") {\n for (const declarator of (declaration[\"declarations\"] ?? []) as AstNode[]) {\n const id = declarator[\"id\"] as AstNode | undefined;\n if (id?.type !== \"Identifier\") {\n continue;\n }\n const name = id[\"name\"] as string;\n exportNames.push(name);\n const info = extractServerFnInit(declarator[\"init\"]);\n if (info !== null) {\n serverFns.push({\n name,\n hash: computeFnHash(projectRoot, filename, name),\n line: info.line,\n input: info.input,\n output: info.output,\n objectStart: info.objectStart,\n });\n }\n }\n } else if (declaration?.type === \"FunctionDeclaration\") {\n const id = declaration[\"id\"] as AstNode | undefined;\n if (id?.type === \"Identifier\") {\n exportNames.push(id[\"name\"] as string);\n }\n }\n\n for (const specifier of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n const exported = specifier[\"exported\"] as AstNode | undefined;\n if (exported?.type === \"Identifier\") {\n exportNames.push(exported[\"name\"] as string);\n }\n }\n\n const sourceNode = statement[\"source\"] as AstNode | undefined;\n if (sourceNode?.type === \"StringLiteral\" && isServerSpecifier(sourceNode[\"value\"] as string)) {\n reExports.push({\n source: sourceNode[\"value\"] as string,\n names: ((statement[\"specifiers\"] ?? []) as AstNode[]).map((specifier) => ({\n local: ((specifier[\"local\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\",\n exported: (((specifier[\"exported\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\"),\n })),\n });\n }\n } else if (statement.type === \"ExportDefaultDeclaration\") {\n exportNames.push(\"default\");\n } else if (statement.type === \"ExportAllDeclaration\") {\n const sourceNode = statement[\"source\"] as AstNode | undefined;\n if (sourceNode?.type === \"StringLiteral\" && isServerSpecifier(sourceNode[\"value\"] as string)) {\n exportAllFrom.push(sourceNode[\"value\"] as string);\n }\n }\n }\n\n return { file: filename, serverFns, exportNames, reExports, exportAllFrom };\n}\n\n/** Nama-nama yang diekspor sebagai serverFn stub dari file (langsung atau via re-export). */\nexport function serverFnExportNames(\n analysis: ServerFileAnalysis,\n analyzeTarget: (specifier: string) => ServerFileAnalysis | null,\n seen = new Set<string>(),\n): Set<string> {\n const names = new Set(analysis.serverFns.map((fn) => fn.name));\n\n for (const reExport of analysis.reExports) {\n const target = analyzeTarget(reExport.source);\n if (target === null || seen.has(reExport.source)) {\n continue;\n }\n seen.add(reExport.source);\n const targetNames = serverFnExportNames(target, analyzeTarget, seen);\n for (const { local, exported } of reExport.names) {\n if (local === \"*\" || targetNames.has(local)) {\n names.add(exported);\n }\n }\n }\n\n for (const specifier of analysis.exportAllFrom) {\n const target = analyzeTarget(specifier);\n if (target === null || seen.has(specifier)) {\n continue;\n }\n seen.add(specifier);\n for (const name of serverFnExportNames(target, analyzeTarget, seen)) {\n names.add(name);\n }\n }\n\n return names;\n}\n\nfunction collectRetainedText(source: string, analysis: ServerFileAnalysis): string {\n return analysis.serverFns\n .map((fn) => `${source.slice(fn.input.start, fn.input.end)}\\n${source.slice(fn.output.start, fn.output.end)}`)\n .join(\"\\n\");\n}\n\nfunction isUsed(name: string, retainedText: string): boolean {\n return new RegExp(`(^|[^\\\\w$])${escapeRegExp(name)}([^\\\\w$]|$)`).test(retainedText);\n}\n\nfunction escapeRegExp(text: string): string {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction collectPatternNames(node: AstNode | undefined, into: Set<string>): void {\n if (node === undefined) {\n return;\n }\n switch (node.type) {\n case \"Identifier\": {\n const name = node[\"name\"] as string | undefined;\n if (name !== undefined) {\n into.add(name);\n }\n return;\n }\n case \"ObjectPattern\":\n for (const property of (node[\"properties\"] ?? []) as AstNode[]) {\n collectPatternNames(\n (property.type === \"RestElement\" ? property[\"argument\"] : property[\"value\"]) as\n | AstNode\n | undefined,\n into,\n );\n }\n return;\n case \"ArrayPattern\":\n for (const element of (node[\"elements\"] ?? []) as AstNode[]) {\n collectPatternNames(element, into);\n }\n return;\n case \"AssignmentPattern\":\n collectPatternNames(node[\"left\"] as AstNode | undefined, into);\n return;\n case \"RestElement\":\n collectPatternNames(node[\"argument\"] as AstNode | undefined, into);\n return;\n default:\n return;\n }\n}\n\n/** Nama deklarasi nilai top-level (bukan import) — yang DIBUANG dari stub §12.3. */\nfunction localTopLevelNames(ast: AstNode): Set<string> {\n const names = new Set<string>();\n const declare = (decl: AstNode | null | undefined): void => {\n if (decl === undefined || decl === null) {\n return;\n }\n if (decl.type === \"VariableDeclaration\") {\n for (const declarator of (decl[\"declarations\"] ?? []) as AstNode[]) {\n collectPatternNames(declarator[\"id\"] as AstNode | undefined, names);\n }\n return;\n }\n if (decl.type === \"FunctionDeclaration\" || decl.type === \"ClassDeclaration\") {\n const name = ((decl[\"id\"] as AstNode | undefined)?.[\"name\"] as string | undefined) ?? \"\";\n if (name.length > 0) {\n names.add(name);\n }\n }\n };\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type === \"ExportNamedDeclaration\" || statement.type === \"ExportDefaultDeclaration\") {\n declare(statement[\"declaration\"] as AstNode | null | undefined);\n } else {\n declare(statement);\n }\n }\n return names;\n}\n\n/** Identifier posisi-nilai yang direferensikan di dalam ekspresi (key/member di-skip). */\nfunction referencedIdentifiers(expression: string, filename: string): Set<string> {\n const ast = parseExpression(expression, {\n plugins: filename.endsWith(\".tsx\") ? [\"typescript\", \"jsx\"] : [\"typescript\"],\n }) as unknown as AstNode;\n const names = new Set<string>();\n\n walk(ast, (node, ancestors) => {\n if (node.type !== \"Identifier\") {\n return;\n }\n const parent = ancestors[ancestors.length - 1];\n if (parent !== undefined) {\n const parentType = parent.type as string;\n const nonComputed = parent[\"computed\"] !== true;\n if (\n nonComputed &&\n (parentType === \"MemberExpression\" || parentType === \"OptionalMemberExpression\") &&\n parent[\"property\"] === node\n ) {\n return;\n }\n if (\n nonComputed &&\n (parentType === \"ObjectProperty\" ||\n parentType === \"ObjectMethod\" ||\n parentType === \"ClassProperty\" ||\n parentType === \"TSPropertySignature\") &&\n parent[\"key\"] === node\n ) {\n return;\n }\n }\n names.add((node[\"name\"] as string | undefined) ?? \"\");\n });\n\n return names;\n}\n\nexport interface StubDependencies {\n /** Resolve specifier relatif file sumber → analysis (null bila tidak bisa). */\n analyzeSpecifier: (sourceFile: string, specifier: string) => ServerFileAnalysis | null;\n}\n\nexport interface RenderStubResult {\n code: string;\n /** Specifier server file yang di-referensikan (untuk keperluan cache/diagnostik). */\n referenced: string[];\n}\n\n/**\n * Bangun stub client §12.2/§12.3 dari sumber `.server.ts`:\n * hanya import yang dipakai schema + `__moons_createStub` per serverFn.\n */\nexport function renderServerFnStub(\n source: string,\n filename: string,\n analysis: ServerFileAnalysis,\n dependencies: StubDependencies,\n): RenderStubResult {\n const ast = parseModule(source, filename);\n const retainedText = collectRetainedText(source, analysis);\n const localNames = localTopLevelNames(ast);\n const importLines: string[] = [];\n const referenced: string[] = [];\n // Addendum J.4 (D2): nama yang diimpor dari file `*.server.ts` lain — dipakai\n // untuk mendeteksi referensi schema ke nilai server (dulu `MISSING_EXPORT`).\n const serverImportedNames = new Map<string, { specifier: string; imported: string }>();\n let needsCreateStub = analysis.serverFns.length > 0;\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type !== \"ImportDeclaration\") {\n continue;\n }\n const sourceNode = statement[\"source\"] as AstNode;\n const specifier = sourceNode[\"value\"] as string;\n\n if (/^@moons\\/server(\\/|$)/.test(specifier)) {\n continue; // serverFn/env tidak dibawa ke client (§12.2)\n }\n if (specifier.startsWith(\"node:\") || specifier.startsWith(\"bun:\")) {\n continue; // import server-only dibuang\n }\n\n const specifiers = (statement[\"specifiers\"] ?? []) as AstNode[];\n const kept: AstNode[] = [];\n\n if (isServerSpecifier(specifier)) {\n referenced.push(specifier);\n for (const item of specifiers) {\n if (item.type === \"ImportDefaultSpecifier\" || item.type === \"ImportNamespaceSpecifier\") {\n continue; // default / * as dari *.server → dibuang (§12.2)\n }\n const local = ((item[\"local\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\";\n if (local.length > 0 && isUsed(local, retainedText)) {\n kept.push(item);\n const imported =\n ((item[\"imported\"] as AstNode | undefined)?.[\"name\"] as string | undefined) ?? local;\n serverImportedNames.set(local, { specifier, imported });\n }\n }\n } else {\n for (const item of specifiers) {\n const local = ((item[\"local\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\";\n if (local.length > 0 && isUsed(local, retainedText)) {\n kept.push(item);\n }\n }\n }\n\n if (kept.length === 0) {\n continue; // import tak terpakai → dipangkas (§12.3)\n }\n\n const keptText = kept\n .map((item) => source.slice(item.start ?? 0, item.end ?? 0))\n .join(\", \");\n importLines.push(`import { ${keptText} } from ${JSON.stringify(specifier)};`);\n }\n\n if (needsCreateStub) {\n importLines.push('import { __moons_createStub } from \"@moonsjs/server/client\";');\n }\n\n const exportLines: string[] = [];\n for (const fn of analysis.serverFns) {\n const input = source.slice(fn.input.start, fn.input.end);\n const output = source.slice(fn.output.start, fn.output.end);\n\n // E_SCHEMA_LOCAL_REF: deklarasi lokal dibuang dari stub, jadi referensinya\n // menjadi `undefined` di browser (crash hydration — dulu lolos build).\n for (const [kind, slice] of [\n [\"input\", input],\n [\"output\", output],\n ] as const) {\n for (const reference of referencedIdentifiers(slice, filename)) {\n if (reference.length === 0) {\n continue;\n }\n const serverImport = serverImportedNames.get(reference);\n if (serverImport !== undefined) {\n const target = dependencies.analyzeSpecifier(filename, serverImport.specifier);\n const isServerFn =\n target !== null && target.serverFns.some((fn) => fn.name === serverImport.imported);\n if (!isServerFn) {\n throw new MoonsError({\n code: \"E_SCHEMA_SERVER_REF\",\n file: filename,\n line: fn.line,\n annotation: fn.name,\n message: `schema ${kind} of serverFn \\`${fn.name}\\` references server value \\`${reference}\\` from \\`${serverImport.specifier}\\``,\n details:\n `\\`${reference}\\` is imported from another server file and is not a serverFn — the client stub does not export it (previously a raw bundler \\`MISSING_EXPORT\\` error).\\n\\n` +\n \"Pick one:\\n\" +\n \" // a) move the constant/schema to a client-safe module\\n\" +\n ` import { ${reference} } from \"../shared/schemas\";\\n` +\n \" // b) inline the value if it is genuinely public in the schema, or\\n\" +\n \" // c) do extra validation in the server handler without referencing server values in the schema\",\n suggestions: [\n \"Move the referenced declaration to a client-safe shared module (e.g. `src/shared/schemas.ts`)\",\n \"Or do the validation in the server handler instead of the schema expression\",\n ],\n });\n }\n continue;\n }\n if (!localNames.has(reference)) {\n continue;\n }\n throw new MoonsError({\n code: \"E_SCHEMA_LOCAL_REF\",\n file: filename,\n line: fn.line,\n annotation: fn.name,\n message: `schema ${kind} of serverFn \\`${fn.name}\\` references local declaration \\`${reference}\\``,\n details:\n `\\`${reference}\\` is dropped from the client stub, so its value is \\`undefined\\` in the browser (hydration crash).\\n\\n` +\n \"Before (rejected):\\n\" +\n ` const ${reference} = z.object({ … }); // local declaration in the same file\\n` +\n ` export const ${fn.name} = serverFn({ ${kind}: ${reference}, … });\\n\\n` +\n \"After (pick one):\\n\" +\n ` // a) inline the schema in the argument\\n` +\n ` export const ${fn.name} = serverFn({ ${kind}: z.object({ … }), … });\\n` +\n ` // b) move the declaration to a shared module that may enter the client (e.g. src/shared/schemas.ts)\\n` +\n ` import { ${reference} } from \"../shared/schemas\";`,\n suggestions: [\n `Inline the schema in the argument \\`serverFn({ ${kind}: … })\\`, or`,\n `Move \\`${reference}\\` to a shared module (e.g. \\`src/shared/schemas.ts\\`) and import it from there`,\n \"Never move secret values to shared — the schema must be client-safe (zod/Standard Schema)\",\n ],\n });\n }\n }\n\n exportLines.push(\n `export const ${fn.name} = __moons_createStub({ hash: ${JSON.stringify(fn.hash)}, input: ${input}, output: ${output} });`,\n );\n }\n\n for (const reExport of analysis.reExports) {\n const target = dependencies.analyzeSpecifier(filename, reExport.source);\n if (target === null) {\n throw new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: filename,\n message: `cannot resolve \\`${reExport.source}\\` for re-export`,\n details: \"Re-exports from `*.server.ts` must be statically resolvable.\",\n suggestions: [\"Fix the re-export path\", \"Avoid dynamic re-exports from server files\"],\n });\n }\n const targetNames = serverFnExportNames(target, (specifier) =>\n dependencies.analyzeSpecifier(filename, specifier),\n );\n const keptNames = reExport.names.filter(({ local }) => local !== \"\" && targetNames.has(local));\n if (keptNames.length > 0) {\n const specifiers = keptNames\n .map(({ local, exported }) => (local === exported ? local : `${local} as ${exported}`))\n .join(\", \");\n exportLines.push(`export { ${specifiers} } from ${JSON.stringify(reExport.source)};`);\n }\n }\n\n for (const specifier of analysis.exportAllFrom) {\n const target = dependencies.analyzeSpecifier(filename, specifier);\n if (target === null) {\n throw new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: filename,\n message: `\\`export *\\` from \\`${specifier}\\` cannot be resolved`,\n details: \"`export *` from `*.server.ts` must be statically expandable.\",\n suggestions: [\"Fix the re-export path\", \"Replace it with named re-exports\"],\n });\n }\n const targetNames = serverFnExportNames(target, (nested) =>\n dependencies.analyzeSpecifier(filename, nested),\n );\n if (targetNames.size > 0) {\n exportLines.push(\n `export { ${[...targetNames].join(\", \")} } from ${JSON.stringify(specifier)};`,\n );\n }\n }\n\n if (importLines.length === 0 && exportLines.length === 0) {\n return { code: \"// @moons: no serverFn exported\\nexport {};\\n\", referenced };\n }\n\n return { code: `${[...importLines, \"\", ...exportLines].join(\"\\n\")}\\n`, referenced };\n}\n\n/** Inject meta §7.2 ke deklarasi serverFn (env ssr; handler tetap utuh). */\nexport function injectServerFnMeta(\n source: string,\n analysis: ServerFileAnalysis,\n projectRoot: string,\n): string {\n let output = source;\n const inserts = [...analysis.serverFns].sort((a, b) => b.objectStart - a.objectStart);\n\n for (const fn of inserts) {\n const meta =\n ` __hash: ${JSON.stringify(fn.hash)},` +\n ` __file: ${JSON.stringify(fnRegistryKey(projectRoot, analysis.file, fn.name).split(\"#\")[0] as string)},` +\n ` __line: ${fn.line},` +\n ` __exportName: ${JSON.stringify(fn.name)},`;\n const at = fn.objectStart + 1;\n output = output.slice(0, at) + meta + output.slice(at);\n }\n\n return output;\n}\n\nexport interface ClientImportCheckContext {\n /** Absolute path file yang sedang diperiksa. */\n file: string;\n code: string;\n projectRoot: string;\n /**\n * Resolve specifier dengan importer tertentu → absolute path (null bila tidak\n * ada). Boleh sinkron maupun async (plugin memakai `this.resolve`, sehingga\n * alias Vite & `tsconfig paths` ikut terperiksa — audit ronde 2).\n */\n resolve: (specifier: string, importer: string) => string | null | Promise<string | null>;\n /** Analysis untuk file server (hasil cache plugin). */\n analyze: (absoluteFile: string) => ServerFileAnalysis | null;\n /** Direktori `src/api` (absolut) — modul API server-only (Addendum D.1). */\n apiDir?: string;\n /** File config (absolut) — server-only (Addendum J.4). */\n configFile?: string;\n /** Direktori `src/server` (absolut) — server-only (Addendum J.4). */\n serverDir?: string;\n /** Paket server-only tambahan dari `security.serverOnlyPackages` (Addendum C). */\n serverOnlyPackages?: ReadonlyArray<string>;\n /** Cache package.json lintas modul (performa; dikelola plugin). */\n packageCache?: Map<string, PackageJsonInfo | null>;\n}\n\n/** Nama serverFn (langsung atau via re-export) — versi async untuk pemeriksaan resolve. */\nasync function serverFnExportNamesAsync(\n analysis: ServerFileAnalysis,\n analyzeSpecifier: (specifier: string, importer: string) => Promise<ServerFileAnalysis | null>,\n seen = new Set<string>(),\n): Promise<Set<string>> {\n const names = new Set(analysis.serverFns.map((fn) => fn.name));\n\n for (const reExport of analysis.reExports) {\n const key = `${analysis.file}\\0${reExport.source}`;\n if (seen.has(key)) {\n continue;\n }\n seen.add(key);\n const target = await analyzeSpecifier(reExport.source, analysis.file);\n if (target === null) {\n continue;\n }\n const targetNames = await serverFnExportNamesAsync(target, analyzeSpecifier, seen);\n for (const { local, exported } of reExport.names) {\n if (local === \"*\" || targetNames.has(local)) {\n names.add(exported);\n }\n }\n }\n\n for (const specifier of analysis.exportAllFrom) {\n const key = `${analysis.file}\\0${specifier}`;\n if (seen.has(key)) {\n continue;\n }\n seen.add(key);\n const target = await analyzeSpecifier(specifier, analysis.file);\n if (target === null) {\n continue;\n }\n for (const name of await serverFnExportNamesAsync(target, analyzeSpecifier, seen)) {\n names.add(name);\n }\n }\n\n return names;\n}\n\nexport function nonContractServerFileError(file: string, projectRoot: string): MoonsError {\n return new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: toRelative(projectRoot, file),\n message: \"server file uses an extension outside the `*.server.ts` contract\",\n details:\n \"The zero-trust transform only handles `*.server.ts`/`*.server.tsx`; server files with other extensions cannot be stubbed and must not enter the client graph.\",\n suggestions: [\n \"Rename the file to `*.server.ts`/`*.server.tsx` and put the `serverFn` inside it\",\n \"Or move the value you need into a non-server file\",\n ],\n });\n}\n\n/** Periksa import modul client terhadap §12.4/§12.7/§12.8 — berbasis hasil resolve. */\ninterface TraceFileRecord {\n ast: AstNode | null;\n mentionsServer: boolean;\n}\n\n/**\n * Addendum K.1: telusuri apakah `name` dari sebuah modul client pada akhirnya\n * berasal dari `*.server.ts` (langsung atau lewat rantai re-export/barrel),\n * dan bukan serverFn. Mengembalikan file server yang bermasalah, atau null.\n */\nasync function traceValueToServer(input: {\n file: string;\n name: string;\n resolveSafe: (specifier: string, importer: string) => Promise<string | null>;\n analyze: (absoluteFile: string) => ServerFileAnalysis | null;\n cache: Map<string, TraceFileRecord>;\n seen: Set<string>;\n}): Promise<string | null> {\n const key = `${input.file}#${input.name}`;\n if (input.seen.has(key) || input.seen.size > 64) {\n return null;\n }\n input.seen.add(key);\n\n const record = loadTraceFile(input.file, input.cache);\n if (record === null || record.ast === null || !record.mentionsServer) {\n return null;\n }\n const ast = record.ast;\n if (localTopLevelNames(ast).has(input.name)) {\n return null; // didefinisikan lokal = kode client\n }\n\n const importBindings = new Map<string, { specifier: string; imported: string }>();\n const edges: Array<{ specifier: string; local: string }> = [];\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type === \"ImportDeclaration\") {\n const source = (statement[\"source\"] as AstNode | null | undefined)?.[\"value\"];\n if (typeof source !== \"string\") {\n continue;\n }\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n if (item.type !== \"ImportSpecifier\") {\n continue;\n }\n const local = (item[\"local\"] as AstNode | undefined)?.[\"name\"] as string | undefined;\n const imported = ((item[\"imported\"] as AstNode | undefined)?.[\"name\"] as string | undefined) ?? local;\n if (local !== undefined && imported !== undefined) {\n importBindings.set(local, { specifier: source, imported });\n }\n }\n continue;\n }\n\n if (statement.type === \"ExportNamedDeclaration\") {\n const source = (statement[\"source\"] as AstNode | null | undefined)?.[\"value\"];\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n if (item.type !== \"ExportSpecifier\") {\n continue;\n }\n const local = (item[\"local\"] as AstNode | undefined)?.[\"name\"] as string | undefined;\n const exported = ((item[\"exported\"] as AstNode | undefined)?.[\"name\"] as string | undefined) ?? local;\n if (local === undefined || exported !== input.name) {\n continue;\n }\n if (typeof source === \"string\") {\n edges.push({ specifier: source, local });\n } else {\n const binding = importBindings.get(local);\n if (binding !== undefined) {\n edges.push({ specifier: binding.specifier, local: binding.imported });\n }\n }\n }\n continue;\n }\n\n const exportedAll = statement[\"exported\"];\n if (\n statement.type === \"ExportAllDeclaration\" &&\n (exportedAll === null || exportedAll === undefined)\n ) {\n const source = (statement[\"source\"] as AstNode | null | undefined)?.[\"value\"];\n if (typeof source === \"string\") {\n edges.push({ specifier: source, local: input.name });\n }\n }\n }\n\n for (const edge of edges) {\n const next = await input.resolveSafe(edge.specifier, input.file);\n if (next === null) {\n continue;\n }\n if (isServerFilePath(next)) {\n const analysis = input.analyze(next);\n const isServerFn =\n analysis !== null && analysis.serverFns.some((fn) => fn.name === edge.local);\n if (!isServerFn) {\n return next;\n }\n continue;\n }\n const deeper = await traceValueToServer({\n ...input,\n file: next,\n name: edge.local,\n });\n if (deeper !== null) {\n return deeper;\n }\n }\n return null;\n}\n\nfunction loadTraceFile(file: string, cache: Map<string, TraceFileRecord>): TraceFileRecord | null {\n const cached = cache.get(file);\n if (cached !== undefined) {\n return cached;\n }\n let record: TraceFileRecord | null = null;\n try {\n const source = readFileSync(file, \"utf8\");\n // Pra-filter murah: hanya modul yang (a) menyebut `.server` atau (b)\n // punya re-export (`export … from`) yang bisa menjadi mata rantai barrel.\n const isBarrel = /(^|\\n)\\s*export\\s+(\\*|\\{[^}]*\\})\\s+from\\s/.test(source);\n const mentionsServer = source.includes(\".server\") || isBarrel;\n record = {\n ast: mentionsServer ? parseModule(source, file) : null,\n mentionsServer,\n };\n } catch {\n record = null;\n }\n cache.set(file, record ?? { ast: null, mentionsServer: false });\n return record;\n}\n\nexport async function checkClientModuleImports(\n context: ClientImportCheckContext,\n): Promise<void> {\n const { file, code, projectRoot, resolve, analyze } = context;\n const ast = parseModule(code, file);\n const traceCache = new Map<string, TraceFileRecord>();\n const relativeFile = toRelative(projectRoot, file);\n // Addendum C: gate paket server-only (daftar bawaan ∪ security.serverOnlyPackages ∪ marker).\n const serverOnly = createServerOnlyClassifier({\n configured: context.serverOnlyPackages ?? [],\n ...(context.packageCache === undefined ? {} : { cache: context.packageCache }),\n });\n // Addendum D.1: `src/api/**` server-only (endpoint HTTP mentah).\n let apiDirReal: string | null = null;\n if (context.apiDir !== undefined && context.apiDir.length > 0) {\n try {\n apiDirReal = realpathSync(context.apiDir);\n } catch {\n apiDirReal = context.apiDir;\n }\n }\n\n // Addendum J.4: config + direktori `src/server/**` server-only.\n let configFileReal: string | null = null;\n if (context.configFile !== undefined) {\n try {\n configFileReal = realpathSync(context.configFile);\n } catch {\n configFileReal = context.configFile;\n }\n }\n let serverDirReal: string | null = null;\n if (context.serverDir !== undefined) {\n try {\n serverDirReal = realpathSync(context.serverDir);\n } catch {\n serverDirReal = context.serverDir;\n }\n }\n\n const rejectConfigImport = (line: number, specifier: string): never => {\n throw new MoonsError({\n code: \"E_FORBIDDEN_SERVER_IMPORT\",\n file: relativeFile,\n line,\n message: `importing \\`${specifier}\\` — \\`moons.config.ts\\` is a server-only module`,\n details:\n \"The config contains `context`/`middleware` (server code) and never enters the client bundle (Addendum J.4).\",\n suggestions: [\n \"Move the value you need into a client-safe module (e.g. `src/shared/…`)\",\n \"Get the value from the server via a loader/serverFn\",\n ],\n });\n };\n\n const rejectServerDirImport = (line: number, specifier: string, resolvedTarget: string): never => {\n throw new MoonsError({\n code: \"E_FORBIDDEN_SERVER_IMPORT\",\n file: relativeFile,\n line,\n message: `importing \\`${specifier}\\` — \\`${toRelative(projectRoot, resolvedTarget)}\\` is inside \\`src/server/**\\` (server-only)`,\n details:\n \"The `src/server/**` directory is for server code only (Addendum J.4); the `.server.ts` suffix is not the only guarantee.\",\n suggestions: [\n \"Move client-safe code to `src/shared/`\",\n \"Access the value from the server via a loader/serverFn\",\n ],\n });\n };\n\n const rejectApiImport = (line: number, specifier: string, resolvedTarget: string): never => {\n const relApi = toRelative(projectRoot, resolvedTarget);\n throw new MoonsError({\n code: \"E_FORBIDDEN_SERVER_IMPORT\",\n file: relativeFile,\n line,\n message: `importing \\`${specifier}\\` — \\`${relApi}\\` is a server-only API module`,\n details:\n \"`src/api/**` only runs on the server (HTTP endpoints) and never enters the client bundle.\",\n suggestions: [\n \"Move the operation into `*.server.ts` and call it via a serverFn\",\n \"Do not import `src/api` files from client routes/components\",\n ],\n });\n };\n\n const resolveSafe = async (specifier: string, importer: string): Promise<string | null> => {\n try {\n const result = await resolve(specifier, importer);\n if (result === null) {\n return null;\n }\n const clean = stripQuery(result);\n // Audit ronde 2: normalisasi realpath — symlink ke `*.server.ts` harus\n // tertangkap walau resolver mengembalikan path link.\n try {\n return realpathSync(clean);\n } catch {\n return clean;\n }\n } catch {\n return null;\n }\n };\n\n const analyzeResolved = async (\n specifier: string,\n importer: string,\n ): Promise<ServerFileAnalysis | null> => {\n const absolute = await resolveSafe(specifier, importer);\n return absolute === null ? null : analyze(absolute);\n };\n\n const isAllowedServerFnImport = async (\n resolvedTarget: string | null,\n specifier: string,\n name: string,\n ): Promise<boolean> => {\n const target =\n resolvedTarget === null ? await analyzeResolved(specifier, file) : analyze(resolvedTarget);\n if (target === null) {\n return false;\n }\n const names = await serverFnExportNamesAsync(target, (nested, importer) =>\n analyzeResolved(nested, importer),\n );\n return names.has(name);\n };\n\n const reject = (line: number, message: string, details: string): never => {\n throw new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: relativeFile,\n line,\n message,\n details,\n suggestions: [\n \"Create a server function that returns the data you need, or\",\n \"If the value is genuinely public, redefine the constant in a client-safe module (never move secret values)\",\n ],\n });\n };\n\n const rejectForbidden = (line: number, specifier: string): never => {\n throw new MoonsError({\n code: \"E_FORBIDDEN_SERVER_IMPORT\",\n file: relativeFile,\n line,\n message: `importing \\`${specifier}\\` in a client module`,\n details: \"Server-only modules may only be imported from *.server.ts.\",\n suggestions: [\n \"Move the operation into a serverFn, or\",\n \"Remove the import\",\n ],\n });\n };\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type === \"ImportDeclaration\" || statement.type === \"ExportNamedDeclaration\" || statement.type === \"ExportAllDeclaration\") {\n const sourceNode = statement[\"source\"] as AstNode | null | undefined;\n if (sourceNode?.type !== \"StringLiteral\") {\n continue;\n }\n const rawSpecifier = sourceNode[\"value\"] as string;\n // Query Vite (`?raw`, `?url`, `?inline`, dst.) dinormalisasi untuk\n // pencocokan & resolusi (audit adversarial M6).\n const specifier = stripQuery(rawSpecifier);\n const line = statement.loc?.start.line ?? 1;\n // Addendum C: type-only (`import type ...`, seluruh specifier tipe)\n // terhapus saat kompilasi → dikecualikan dari gate paket server-only.\n const typeOnly = isTypeOnlyImportExport(statement);\n\n if (specifier.startsWith(\"node:\") || specifier.startsWith(\"bun:\")) {\n rejectForbidden(line, specifier);\n }\n\n const resolvedTarget = await resolveSafe(specifier, file);\n\n // Addendum D.1: modul `src/api/**` server-only.\n if (apiDirReal !== null && resolvedTarget !== null && isInsideDir(resolvedTarget, apiDirReal)) {\n rejectApiImport(line, rawSpecifier, resolvedTarget);\n }\n\n // Addendum J.4: `moons.config.ts` + direktori `src/server/**` server-only\n // (impor nilai; type-only dikecualikan — J.5).\n if (!typeOnly && resolvedTarget !== null) {\n if (configFileReal !== null && resolvedTarget === configFileReal) {\n rejectConfigImport(line, rawSpecifier);\n }\n if (\n serverDirReal !== null &&\n isInsideDir(resolvedTarget, serverDirReal) &&\n !isServerFilePath(resolvedTarget) &&\n // File non-kontrak (`*.server.mts` dll.) punya error khusus yang\n // lebih tepat — biarkan jatuh ke pemeriksaan di bawah.\n !isNonContractServerFile(resolvedTarget)\n ) {\n rejectServerDirImport(line, rawSpecifier, resolvedTarget);\n }\n }\n\n // Addendum C: paket server-only (nama paket hasil resolve — subpath,\n // alias, tsconfig paths, symlink/workspace ikut tertangkap).\n if (!typeOnly) {\n const match = serverOnly.check({\n specifier,\n resolvedFile: resolvedTarget,\n importerFile: file,\n });\n if (match !== null) {\n throw serverOnlyImportError({\n relativeFile,\n line,\n specifier: rawSpecifier,\n packageName: match.packageName,\n source: match.source,\n ...(match.source === \"marker\"\n ? { markerPath: toRelative(projectRoot, join(match.packageDir, \"package.json\")) }\n : {}),\n });\n }\n }\n\n // Audit ronde 2: file server di luar kontrak §12 ditolak (tidak bisa di-stub).\n if (resolvedTarget !== null && isNonContractServerFile(resolvedTarget)) {\n throw nonContractServerFileError(resolvedTarget, projectRoot);\n }\n\n // Audit ronde 2: keputusan berbasis hasil resolve — menangkap alias Vite,\n // `tsconfig paths`, dan symlink (realpath) yang menunjuk `*.server.ts`.\n const serverBySpecifier = isServerSpecifier(specifier);\n const serverByResolve = resolvedTarget !== null && isServerFilePath(resolvedTarget);\n if (!serverBySpecifier && !serverByResolve) {\n // Addendum K.1: rantai re-export ke `*.server.ts` (barrel) — pesan Moons\n // menggantikan `MISSING_EXPORT` bundler. Hanya nilai (bukan type-only).\n if (!typeOnly && resolvedTarget !== null && /[.](ts|tsx)$/.test(resolvedTarget)) {\n const requestedNames: string[] = [];\n if (statement.type === \"ImportDeclaration\") {\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n if (item.type !== \"ImportSpecifier\") {\n continue;\n }\n const kind = (item[\"importKind\"] ?? statement[\"importKind\"]) as string | undefined;\n if (kind === \"type\") {\n continue;\n }\n const imported = (item[\"imported\"] as AstNode | undefined)?.[\"name\"] as string | undefined;\n if (imported !== undefined) {\n requestedNames.push(imported);\n }\n }\n } else if (statement.type === \"ExportNamedDeclaration\") {\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n const kind = (item[\"importKind\"] ??\n statement[\"importKind\"] ??\n item[\"exportKind\"] ??\n statement[\"exportKind\"]) as string | undefined;\n if (kind === \"type\") {\n continue;\n }\n const local = (item[\"local\"] as AstNode | undefined)?.[\"name\"] as string | undefined;\n if (local !== undefined) {\n requestedNames.push(local);\n }\n }\n }\n for (const name of requestedNames) {\n const serverFile = await traceValueToServer({\n file: resolvedTarget,\n name,\n resolveSafe,\n analyze,\n cache: traceCache,\n seen: new Set<string>(),\n });\n if (serverFile !== null) {\n throw new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: relativeFile,\n line,\n message: `importing \\`${name}\\` — comes from \\`${toRelative(projectRoot, serverFile)}\\` (via a re-export chain)`,\n details:\n `\\`${toRelative(projectRoot, resolvedTarget)}\\` re-exports a value from a server file; ` +\n \"the client stub does not export it (previously a raw bundler `MISSING_EXPORT` error).\",\n suggestions: [\n \"Create a server function that returns the data you need, or\",\n \"Redefine the public constant in a client-safe module (never move secret values)\",\n ],\n });\n }\n }\n }\n continue;\n }\n\n const targetRelative =\n resolvedTarget === null ? rawSpecifier : toRelative(projectRoot, resolvedTarget);\n\n if (statement.type === \"ExportAllDeclaration\") {\n if (resolvedTarget === null) {\n reject(line, `\\`export *\\` from \\`${targetRelative}\\` cannot be resolved`, \"Re-exports from `*.server.ts` must be statically resolvable.\");\n }\n continue; // aman: target menjadi stub\n }\n\n const specifiers = (statement[\"specifiers\"] ?? []) as AstNode[];\n for (const item of specifiers) {\n if (item.type === \"ImportDefaultSpecifier\") {\n reject(line, `importing the default export from ${targetRelative}`, \"Default exports from a server file must not cross to the client.\");\n }\n if (item.type === \"ImportNamespaceSpecifier\") {\n reject(line, `importing the namespace (\\`* as\\`) from ${targetRelative}`, \"Namespace imports from a server file must not cross to the client.\");\n }\n const name = ((item[\"local\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\";\n // Type-only (Addendum J.5): Babel menaruh `importKind: \"type\"` di\n // statement untuk `import type { X }`, dan di specifier untuk\n // `import { type X }` — keduanya harus dibaca (D1).\n const specifierKind = item[\"importKind\"] as string | undefined;\n const statementKind = statement[\"importKind\"] as string | undefined;\n if (specifierKind === \"type\" || statementKind === \"type\") {\n continue;\n }\n if (name.length > 0 && !(await isAllowedServerFnImport(resolvedTarget, specifier, name))) {\n reject(\n line,\n `importing \\`${name}\\` from ${targetRelative}`,\n \"Server code must not appear in the client.\\nOnly `serverFn` may cross.\",\n );\n }\n }\n }\n }\n\n // §12.4: pemanggilan env() di modul client (juga @moonsjs/server import env).\n const envBindings = new Set<string>();\n for (const statement of topLevelStatements(ast)) {\n if (statement.type !== \"ImportDeclaration\") {\n continue;\n }\n const sourceNode = statement[\"source\"] as AstNode | undefined;\n const specifier = sourceNode?.type === \"StringLiteral\" ? (sourceNode[\"value\"] as string) : \"\";\n if (specifier !== \"@moonsjs/server\" && !specifier.startsWith(\"@moonsjs/server/\")) {\n continue;\n }\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n if (item.type !== \"ImportSpecifier\") {\n continue;\n }\n const imported = item[\"imported\"] as AstNode | undefined;\n const local = item[\"local\"] as AstNode | undefined;\n if (imported?.type === \"Identifier\" && imported[\"name\"] === \"env\" && local?.type === \"Identifier\") {\n envBindings.add(local[\"name\"] as string);\n }\n }\n }\n\n if (envBindings.size > 0) {\n walk(ast, (node) => {\n if (node.type !== \"CallExpression\") {\n return;\n }\n const callee = node[\"callee\"] as AstNode | undefined;\n if (callee?.type !== \"Identifier\" || !envBindings.has(callee[\"name\"] as string)) {\n return;\n }\n const callText = code\n .slice(node.start ?? 0, node.end ?? 0)\n .replace(/\\s+/g, \" \")\n .slice(0, 80);\n throw new MoonsError({\n code: \"E_ENV_IN_CLIENT\",\n file: relativeFile,\n line: node.loc?.start.line ?? 1,\n message: `calling \\`${callText}\\` in a client module`,\n details: \"`env()` is only legal on the server.\",\n suggestions: [\n \"Move the call into a serverFn, or\",\n \"Use import.meta.env for public values\",\n ],\n });\n });\n }\n\n // Dynamic import (§12.7/§12.8) — literal maupun template dengan teks `.server`,\n // plus resolusi (alias/tsconfig paths/symlink) — audit ronde 2.\n const dynamicRequests: Array<{ request: DynamicImportRequest; guarded: boolean }> = [];\n walk(ast, (node, ancestors) => {\n const request = dynamicImportRequest(node);\n if (request !== null) {\n dynamicRequests.push({\n request,\n guarded: ancestors.some((ancestor) => isDevGuard(ancestor)),\n });\n }\n });\n\n for (const { request, guarded } of dynamicRequests) {\n if (guarded) {\n continue; // §12.8: branch DEV/PROD mati saat build → tidak perlu diperiksa\n }\n\n const specifier = stripQuery(request.text);\n const resolvedTarget = await resolveSafe(specifier, file);\n\n // Addendum D.1: dynamic import modul `src/api/**` juga ditolak.\n if (apiDirReal !== null && resolvedTarget !== null && isInsideDir(resolvedTarget, apiDirReal)) {\n rejectApiImport(request.node.loc?.start.line ?? 1, request.text, resolvedTarget);\n }\n\n // Addendum C: dynamic import paket server-only juga digerbang.\n const match = serverOnly.check({\n specifier,\n resolvedFile: resolvedTarget,\n importerFile: file,\n });\n if (match !== null) {\n throw serverOnlyImportError({\n relativeFile,\n line: request.node.loc?.start.line ?? 1,\n specifier: request.text,\n packageName: match.packageName,\n source: match.source,\n dynamic: true,\n ...(match.source === \"marker\"\n ? { markerPath: toRelative(projectRoot, join(match.packageDir, \"package.json\")) }\n : {}),\n });\n }\n\n if (resolvedTarget !== null && isNonContractServerFile(resolvedTarget)) {\n throw nonContractServerFileError(resolvedTarget, projectRoot);\n }\n\n const serverBySpecifier = isServerSpecifier(specifier);\n const serverByResolve = resolvedTarget !== null && isServerFilePath(resolvedTarget);\n if (!serverBySpecifier && !serverByResolve) {\n continue;\n }\n\n const targetRelative =\n resolvedTarget === null ? request.text : toRelative(projectRoot, resolvedTarget);\n reject(request.node.loc?.start.line ?? 1, `importing (dynamic) \\`${request.text}\\` from ${targetRelative}`, \"The client must not dynamically import `*.server.ts`.\");\n }\n\n // `import.meta.glob` yang mencakup `*.server.ts` (§12.7) — audit adversarial M6.\n walk(ast, (node) => {\n if (node.type !== \"CallExpression\") {\n return;\n }\n const callee = node[\"callee\"] as AstNode | undefined;\n if (callee?.type !== \"MemberExpression\") {\n return;\n }\n const object = callee[\"object\"] as AstNode | undefined;\n const property = callee[\"property\"] as AstNode | undefined;\n if (\n object?.type !== \"MetaProperty\" ||\n property?.type !== \"Identifier\" ||\n property[\"name\"] !== \"glob\"\n ) {\n return;\n }\n\n for (const pattern of globPatterns(((node[\"arguments\"] ?? []) as AstNode[])[0])) {\n if (!isServerSpecifier(pattern)) {\n continue;\n }\n throw new MoonsError({\n code: \"E_SERVER_IMPORT_IN_CLIENT\",\n file: relativeFile,\n line: node.loc?.start.line ?? 1,\n message: `importing (glob) \\`${pattern}\\` in a client module`,\n details: \"`import.meta.glob` patterns covering `*.server.ts` are forbidden in the client.\",\n suggestions: [\n \"Statically import the `serverFn` from `*.server.ts` (that is all that may cross), or\",\n \"Move the data requirement into a server function\",\n ],\n });\n }\n });\n}\n\ninterface DynamicImportRequest {\n /** Teks specifier literal, atau gabungan quasi template (`*` untuk ekspresi). */\n text: string;\n node: AstNode;\n}\n\n/** Dukung Babel 8 (`ImportExpression`) dan bentuk lama (`CallExpression` + callee `Import`). */\nfunction dynamicImportRequest(node: AstNode): DynamicImportRequest | null {\n let sourceNode: AstNode | null = null;\n\n if (node.type === \"ImportExpression\") {\n sourceNode = (node[\"source\"] as AstNode | undefined) ?? null;\n } else if (node.type === \"CallExpression\") {\n const callee = node[\"callee\"] as AstNode | undefined;\n if (callee?.type !== \"Import\") {\n return null;\n }\n sourceNode = ((node[\"arguments\"] ?? []) as AstNode[])[0] ?? null;\n }\n\n if (sourceNode === null) {\n return null;\n }\n if (sourceNode.type === \"StringLiteral\") {\n return { text: sourceNode[\"value\"] as string, node: sourceNode };\n }\n if (sourceNode.type === \"TemplateLiteral\") {\n const text = ((sourceNode[\"quasis\"] ?? []) as AstNode[])\n .map((quasi) => ((quasi[\"value\"] as { cooked?: string | null } | undefined)?.cooked ?? \"\"))\n .join(\"*\");\n return { text, node: sourceNode };\n }\n return null;\n}\n\nfunction globPatterns(node: AstNode | undefined): string[] { if (node?.type === \"StringLiteral\") {\n return [node[\"value\"] as string];\n }\n if (node?.type === \"ArrayExpression\") {\n return ((node[\"elements\"] ?? []) as Array<AstNode | null>)\n .filter((element): element is AstNode => element?.type === \"StringLiteral\")\n .map((element) => element[\"value\"] as string);\n }\n return [];\n}\n\nfunction isDevGuard(node: AstNode): boolean {\n if (node.type !== \"IfStatement\") {\n return false;\n }\n const test = node[\"test\"] as AstNode | undefined;\n return isImportMetaFlag(test, \"DEV\") || isNegatedImportMetaFlag(test, \"PROD\");\n}\n\nfunction isImportMetaFlag(node: AstNode | undefined, flag: string): boolean {\n const member = node;\n if (member?.type !== \"MemberExpression\") {\n return false;\n }\n const property = member[\"property\"] as AstNode | undefined;\n if (property?.type !== \"Identifier\" || property[\"name\"] !== flag) {\n return false;\n }\n const object = member[\"object\"] as AstNode | undefined;\n return isImportMetaEnv(object);\n}\n\nfunction isNegatedImportMetaFlag(node: AstNode | undefined, flag: string): boolean {\n if (node?.type !== \"UnaryExpression\" || node[\"operator\"] !== \"!\") {\n return false;\n }\n return isImportMetaFlag(node[\"argument\"] as AstNode | undefined, flag);\n}\n\nfunction isImportMetaEnv(node: AstNode | undefined): boolean {\n if (node?.type !== \"MemberExpression\") {\n return false;\n }\n const property = node[\"property\"] as AstNode | undefined;\n if (property?.type !== \"Identifier\" || property[\"name\"] !== \"env\") {\n return false;\n }\n const object = node[\"object\"] as AstNode | undefined;\n return object?.type === \"MetaProperty\";\n}\n\nfunction toRelative(projectRoot: string, file: string): string {\n const relative = file.startsWith(projectRoot)\n ? file.slice(projectRoot.length).replace(/^[/\\\\]/, \"\")\n : file;\n return relative.split(\"\\\\\").join(\"/\");\n}\n\nfunction isInsideDir(file: string, dir: string): boolean {\n const normalized = dir.endsWith(\"/\") ? dir : `${dir}/`;\n return file === dir || file.startsWith(normalized);\n}\n\nexport interface RouteExportCheckContext {\n file: string;\n code: string;\n routesDir: string;\n projectRoot: string;\n}\n\n/**\n * §11.2 + §12.4: export legal per jenis modul route.\n * page: `default|loader|meta|prerender|paths` (D.5); layout: `default|loader`;\n * `_error`/`_404`: `default`.\n */\nexport function checkRouteModuleExports(context: RouteExportCheckContext): void {\n const { file, code, routesDir, projectRoot } = context;\n if (!file.startsWith(routesDir) || !file.endsWith(\".tsx\")) {\n return;\n }\n\n const base = file.slice(file.lastIndexOf(\"/\") + 1);\n if (base.startsWith(\"_\") && base !== \"_layout.tsx\" && base !== \"_error.tsx\" && base !== \"_404.tsx\") {\n return; // bukan route (diabaikan scanner)\n }\n\n const allowed =\n base === \"_layout.tsx\"\n ? [\"default\", \"loader\"]\n : base === \"_error.tsx\" || base === \"_404.tsx\"\n ? [\"default\"]\n : [\"default\", \"loader\", \"meta\", \"prerender\", \"paths\", \"revalidate\"];\n const allowedText = `Only ${allowed.map((name) => `\\`${name}\\``).join(\", \")} may be exported.`;\n const relativeFile = toRelative(projectRoot, file);\n const ast = parseModule(code, file);\n\n const declarations: Array<{ name: string; line: number }> = [];\n let hasDefault = false;\n\n for (const statement of topLevelStatements(ast)) {\n if (statement.type === \"ExportDefaultDeclaration\") {\n hasDefault = true;\n continue;\n }\n\n if (statement.type === \"ExportAllDeclaration\") {\n throw new MoonsError({\n code: \"E_ROUTE_EXPORT_INVALID\",\n file: relativeFile,\n line: statement.loc?.start.line ?? 1,\n message: \"`export *` is not allowed in route modules\",\n details: allowedText,\n suggestions: [\n `Move the file contents outside ${toRelative(projectRoot, routesDir)}/, or`,\n \"Remove the `export *`\",\n ],\n });\n }\n\n if (statement.type !== \"ExportNamedDeclaration\") {\n continue;\n }\n\n const declaration = statement[\"declaration\"] as AstNode | null | undefined;\n if (declaration !== null && declaration !== undefined) {\n for (const name of declarationNames(declaration)) {\n declarations.push({ name, line: declaration.loc?.start.line ?? 1 });\n }\n }\n\n for (const item of (statement[\"specifiers\"] ?? []) as AstNode[]) {\n const exported = item[\"exported\"] as AstNode | undefined;\n const name =\n exported?.type === \"Identifier\"\n ? (exported[\"name\"] as string)\n : exported?.type === \"StringLiteral\"\n ? (exported[\"value\"] as string)\n : null;\n if (name !== null) {\n declarations.push({ name, line: item.loc?.start.line ?? statement.loc?.start.line ?? 1 });\n }\n }\n }\n\n for (const entry of declarations) {\n if (!allowed.includes(entry.name)) {\n throw new MoonsError({\n code: \"E_ROUTE_EXPORT_INVALID\",\n file: relativeFile,\n line: entry.line,\n message: `export \\`${entry.name}\\` is not allowed in route modules`,\n details: allowedText,\n suggestions: [\n `Move \\`${entry.name}\\` to a file outside ${toRelative(projectRoot, routesDir)}/, or`,\n \"Remove the export\",\n ],\n });\n }\n }\n\n if (!hasDefault) {\n throw new MoonsError({\n code: \"E_ROUTE_EXPORT_INVALID\",\n file: relativeFile,\n message: \"route module must export `default`\",\n details: \"Every route file needs an `export default` React component.\",\n suggestions: [\"Add `export default function Page() { ... }`\"],\n });\n }\n}\n\nfunction declarationNames(declaration: AstNode): string[] {\n switch (declaration.type) {\n case \"VariableDeclaration\":\n return ((declaration[\"declarations\"] ?? []) as AstNode[])\n .map((declarator) => ((declarator[\"id\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\")\n .filter((name) => name.length > 0);\n case \"FunctionDeclaration\":\n case \"ClassDeclaration\":\n case \"TSInterfaceDeclaration\":\n case \"TSTypeAliasDeclaration\":\n case \"TSEnumDeclaration\":\n return [((declaration[\"id\"] as AstNode | undefined)?.[\"name\"] as string) ?? \"\"].filter(\n (name) => name.length > 0,\n );\n default:\n return [];\n }\n}\n\n/** Scan semua `*.server.{ts,tsx}` di bawah root (exclude direktori build/dependency). */\nexport function scanServerFiles(projectRoot: string): string[] {\n const excluded = new Set([\"node_modules\", \"dist\", \".moons\", \".git\"]);\n const result: string[] = [];\n\n const walkDir = (dir: string): void => {\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n if (entry.isDirectory()) {\n if (excluded.has(entry.name)) {\n continue;\n }\n walkDir(join(dir, entry.name));\n } else if (entry.isFile() && isServerFilePath(entry.name)) {\n result.push(join(dir, entry.name));\n }\n }\n };\n\n walkDir(projectRoot);\n return result.sort();\n}\n\nexport interface FnRegistryJson {\n [key: string]: string;\n}\n\n/** Bangun isi `fn-registry.json` (bentuk yang dibaca §21.3). */\nexport function buildFnRegistry(projectRoot: string, files: string[]): FnRegistryJson {\n const registry: FnRegistryJson = {};\n for (const file of files) {\n let source: string;\n try {\n source = readFileSync(file, \"utf8\");\n } catch {\n continue;\n }\n const analysis = analyzeServerFile(source, file, projectRoot);\n for (const fn of analysis.serverFns) {\n registry[fnRegistryKey(projectRoot, file, fn.name)] = fn.hash;\n }\n }\n return registry;\n}\n",
|
|
6
|
+
"import { MoonsError } from \"@moonsjs/core\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\n\n/**\n * Gate paket server-only (PRD Addendum C): paket npm yang tidak boleh masuk\n * graph client — di-import dari route/client/shared → build gagal.\n *\n * Daftar bawaan adalah **minimum normatif** dan TIDAK dapat dihapus app:\n * gate kebocoran tidak boleh bisa dilonggarkan (prinsip \"batas lebih ketat\n * menang\"); salah-tangkap diperbaiki lewat rilis framework.\n */\nexport const DEFAULT_SERVER_ONLY_PACKAGES: ReadonlyArray<string> = [\n \"pg\",\n \"postgres\",\n \"mysql\",\n \"mysql2\",\n \"sqlite3\",\n \"better-sqlite3\",\n \"drizzle-orm\",\n \"@prisma/client\",\n \"prisma\",\n \"mongodb\",\n \"mongoose\",\n \"redis\",\n \"ioredis\",\n \"bcrypt\",\n \"bcryptjs\",\n \"argon2\",\n \"jsonwebtoken\",\n \"nodemailer\",\n \"sharp\",\n \"execa\",\n \"cross-spawn\",\n \"dotenv\",\n \"knex\",\n \"typeorm\",\n \"sequelize\",\n \"@libsql/client\",\n];\n\nexport type ServerOnlyMatchSource = \"builtin\" | \"config\" | \"marker\";\n\nexport interface PackageJsonInfo {\n /** Direktori package (tempat package.json berada). */\n dir: string;\n name: string;\n serverOnlyMarker: boolean;\n}\n\nexport interface ServerOnlyMatch {\n packageName: string;\n source: ServerOnlyMatchSource;\n packageDir: string;\n}\n\nexport interface ServerOnlyClassifier {\n check(input: {\n specifier: string;\n resolvedFile: string | null;\n importerFile: string;\n }): ServerOnlyMatch | null;\n}\n\nexport interface ServerOnlyClassifierOptions {\n /** `security.serverOnlyPackages` — tambahan milik app (tidak menghapus bawaan). */\n configured?: ReadonlyArray<string>;\n /** Cache package.json per-direktori; bagikan lintas modul demi performa. */\n cache?: Map<string, PackageJsonInfo | null>;\n}\n\n/** Nama paket dari specifier bare (dipakai sebagai info pelengkap; pencocokan utama lewat resolve). */\nexport function packageNameFromSpecifier(specifier: string): string | null {\n if (\n specifier.length === 0 ||\n specifier.startsWith(\".\") ||\n specifier.startsWith(\"/\") ||\n specifier.startsWith(\"\\0\") ||\n specifier.includes(\":\")\n ) {\n return null;\n }\n const parts = specifier.split(\"/\");\n if (specifier.startsWith(\"@\")) {\n if (parts.length < 2 || (parts[1] ?? \"\").length === 0) {\n return null;\n }\n return `${parts[0]}/${parts[1]}`;\n }\n return parts[0] ?? null;\n}\n\n/** Baca package.json pada direktori tertentu (null bila tidak ada/gagal). */\nexport function tryReadPackageJson(dir: string): PackageJsonInfo | null {\n const candidate = join(dir, \"package.json\");\n if (!existsSync(candidate)) {\n return null;\n }\n try {\n const json = JSON.parse(readFileSync(candidate, \"utf8\")) as {\n name?: unknown;\n moons?: unknown;\n };\n const moons = json.moons as { serverOnly?: unknown } | undefined;\n return {\n dir,\n name: typeof json.name === \"string\" ? json.name : \"\",\n serverOnlyMarker: moons?.serverOnly === true,\n };\n } catch {\n return null;\n }\n}\n\n/** Baca package.json terdekat dari sebuah file absolut (menelusuri ke atas). */\nexport function readPackageJsonFrom(file: string): PackageJsonInfo | null {\n let dir = dirname(file);\n for (let depth = 0; depth < 64; depth += 1) {\n const info = tryReadPackageJson(dir);\n if (info !== null) {\n return info;\n }\n const parent = dirname(dir);\n if (parent === dir) {\n return null;\n }\n dir = parent;\n }\n return null;\n}\n\nexport function createServerOnlyClassifier(\n options: ServerOnlyClassifierOptions = {},\n): ServerOnlyClassifier {\n const cache = options.cache ?? new Map<string, PackageJsonInfo | null>();\n const configured = new Set(options.configured ?? []);\n const builtin = new Set(DEFAULT_SERVER_ONLY_PACKAGES);\n\n const infoOf = (file: string): PackageJsonInfo | null => {\n let dir = dirname(file);\n for (let depth = 0; depth < 64; depth += 1) {\n if (cache.has(dir)) {\n return cache.get(dir) ?? null;\n }\n const info = tryReadPackageJson(dir);\n if (info !== null) {\n cache.set(dir, info);\n return info;\n }\n // Direktori tanpa package.json: lanjut ke atas (tidak di-cache agar\n // penelusuran berikutnya tetap benar untuk subtree berbeda).\n const parent = dirname(dir);\n if (parent === dir) {\n return null;\n }\n dir = parent;\n }\n return null;\n };\n\n return {\n check({ specifier: _specifier, resolvedFile, importerFile }) {\n if (resolvedFile === null) {\n return null;\n }\n const info = infoOf(resolvedFile);\n if (info === null || info.name.length === 0) {\n return null;\n }\n // Gate menyasar dependency: import di dalam package yang sama diabaikan.\n const importer = infoOf(importerFile);\n if (importer !== null && importer.dir === info.dir) {\n return null;\n }\n if (builtin.has(info.name)) {\n return { packageName: info.name, source: \"builtin\", packageDir: info.dir };\n }\n if (configured.has(info.name)) {\n return { packageName: info.name, source: \"config\", packageDir: info.dir };\n }\n if (info.serverOnlyMarker) {\n return { packageName: info.name, source: \"marker\", packageDir: info.dir };\n }\n return null;\n },\n };\n}\n\n/**\n * Error §15 untuk import paket server-only (kode tetap\n * `E_FORBIDDEN_SERVER_IMPORT`, PRD Addendum C.3).\n */\nexport function serverOnlyImportError(input: {\n relativeFile: string;\n line: number;\n specifier: string;\n packageName: string;\n source: ServerOnlyMatchSource;\n /** Path package.json relatif project — untuk sumber kecocokan \"marker\". */\n markerPath?: string;\n dynamic?: boolean;\n}): MoonsError {\n const sourceLabel =\n input.source === \"builtin\"\n ? \"Match source: framework built-in server-only package list.\"\n : input.source === \"config\"\n ? \"Match source: `security.serverOnlyPackages` in moons.config.ts.\"\n : `Match source: marker \\`\"moons\": { \"serverOnly\": true }\\` in ${input.markerPath ?? \"package.json\"}.`;\n return new MoonsError({\n code: \"E_FORBIDDEN_SERVER_IMPORT\",\n file: input.relativeFile,\n line: input.line,\n message: `importing${input.dynamic === true ? \" (dynamic)\" : \"\"} \\`${input.specifier}\\` — server-only package \\`${input.packageName}\\``,\n details: `${sourceLabel}\\nServer-only packages must not enter the client bundle.`,\n suggestions: [\n \"Move the operation into `*.server.ts` and call it via a serverFn\",\n \"Or replace/remove the import in the client module\",\n ],\n });\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";AAAA,uBAAS;AACT;AACA,uBAAS,0CAAyB;AAClC,oBAAS,8BAAqB;;;ACH9B;AACA;AACA;AAUO,IAAM,+BAAsD;AAAA,EACjE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAsDO,SAAS,kBAAkB,CAAC,KAAqC;AAAA,EACtE,MAAM,YAAY,KAAK,KAAK,cAAc;AAAA,EAC1C,IAAI,CAAC,WAAW,SAAS,GAAG;AAAA,IAC1B,OAAO;AAAA,EACT;AAAA,EACA,IAAI;AAAA,IACF,MAAM,OAAO,KAAK,MAAM,aAAa,WAAW,MAAM,CAAC;AAAA,IAIvD,MAAM,QAAQ,KAAK;AAAA,IACnB,OAAO;AAAA,MACL;AAAA,MACA,MAAM,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO;AAAA,MAClD,kBAAkB,OAAO,eAAe;AAAA,IAC1C;AAAA,IACA,MAAM;AAAA,IACN,OAAO;AAAA;AAAA;AAqBJ,SAAS,0BAA0B,CACxC,UAAuC,CAAC,GAClB;AAAA,EACtB,MAAM,QAAQ,QAAQ,SAAS,IAAI;AAAA,EACnC,MAAM,aAAa,IAAI,IAAI,QAAQ,cAAc,CAAC,CAAC;AAAA,EACnD,MAAM,UAAU,IAAI,IAAI,4BAA4B;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