@meekojs/meeko 0.0.4 → 0.1.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/README.md +21 -19
- package/dist/autoimports-ts.d.ts +4 -4
- package/dist/autoimports-ts.js +86 -30
- package/dist/autoimports-ts.js.map +1 -1
- package/dist/autoimports.d.ts +2 -2
- package/dist/autoimports.js +23 -7
- package/dist/autoimports.js.map +1 -1
- package/dist/check.js +39 -10
- package/dist/check.js.map +1 -1
- package/dist/cli.js +37 -4
- package/dist/cli.js.map +1 -1
- package/dist/compiler/events.d.ts +2 -0
- package/dist/compiler/events.js +6 -0
- package/dist/compiler/events.js.map +1 -0
- package/dist/compiler/props.d.ts +12 -0
- package/dist/compiler/props.js +32 -0
- package/dist/compiler/props.js.map +1 -0
- package/dist/compiler.js +55 -12
- package/dist/compiler.js.map +1 -1
- package/dist/component-errors.d.ts +18 -0
- package/dist/component-errors.js +65 -0
- package/dist/component-errors.js.map +1 -0
- package/dist/devtools.js +2 -4
- package/dist/devtools.js.map +1 -1
- package/dist/dom.d.ts +11 -5
- package/dist/dom.js +288 -88
- package/dist/dom.js.map +1 -1
- package/dist/error-observer.d.ts +6 -0
- package/dist/error-observer.js +41 -0
- package/dist/error-observer.js.map +1 -0
- package/dist/framework/check-app.js +160 -5
- package/dist/framework/check-app.js.map +1 -1
- package/dist/framework/check-project.d.ts +4 -0
- package/dist/framework/check-project.js +42 -0
- package/dist/framework/check-project.js.map +1 -0
- package/dist/framework/client.d.ts +3 -0
- package/dist/framework/client.js +136 -33
- package/dist/framework/client.js.map +1 -1
- package/dist/framework/clients.js +12 -4
- package/dist/framework/clients.js.map +1 -1
- package/dist/framework/contracts-generate.js +66 -3
- package/dist/framework/contracts-generate.js.map +1 -1
- package/dist/framework/init.js +21 -200
- package/dist/framework/init.js.map +1 -1
- package/dist/framework/middleware.d.ts +14 -0
- package/dist/framework/middleware.js +16 -0
- package/dist/framework/middleware.js.map +1 -0
- package/dist/framework/page-contracts-check.d.ts +8 -0
- package/dist/framework/page-contracts-check.js +110 -0
- package/dist/framework/page-contracts-check.js.map +1 -0
- package/dist/framework/page-contracts-generate.d.ts +2 -0
- package/dist/framework/page-contracts-generate.js +94 -0
- package/dist/framework/page-contracts-generate.js.map +1 -0
- package/dist/framework/page.d.ts +7 -3
- package/dist/framework/page.js +3 -1
- package/dist/framework/page.js.map +1 -1
- package/dist/framework/prerender.js +11 -5
- package/dist/framework/prerender.js.map +1 -1
- package/dist/framework/project-templates.d.ts +3 -0
- package/dist/framework/project-templates.js +119 -0
- package/dist/framework/project-templates.js.map +1 -0
- package/dist/framework/project.d.ts +9 -0
- package/dist/framework/project.js +272 -0
- package/dist/framework/project.js.map +1 -0
- package/dist/framework/router.d.ts +3 -1
- package/dist/framework/router.js +94 -8
- package/dist/framework/router.js.map +1 -1
- package/dist/framework/server.d.ts +17 -3
- package/dist/framework/server.js +71 -24
- package/dist/framework/server.js.map +1 -1
- package/dist/framework/socket-contracts-generate.js +8 -5
- package/dist/framework/socket-contracts-generate.js.map +1 -1
- package/dist/framework/socket.d.ts +2 -0
- package/dist/framework/socket.js +119 -17
- package/dist/framework/socket.js.map +1 -1
- package/dist/framework/standard-schema-types.d.ts +7 -0
- package/dist/framework/standard-schema-types.js +69 -0
- package/dist/framework/standard-schema-types.js.map +1 -0
- package/dist/framework/state.d.ts +7 -0
- package/dist/framework/state.js +78 -14
- package/dist/framework/state.js.map +1 -1
- package/dist/framework/styles.d.ts +2 -0
- package/dist/framework/styles.js +6 -0
- package/dist/framework/styles.js.map +1 -0
- package/dist/framework/type-declarations.d.ts +5 -0
- package/dist/framework/type-declarations.js +84 -0
- package/dist/framework/type-declarations.js.map +1 -0
- package/dist/framework-server/contracts.d.ts +11 -2
- package/dist/framework-server/contracts.js +62 -7
- package/dist/framework-server/contracts.js.map +1 -1
- package/dist/framework-server/discovery.d.ts +4 -1
- package/dist/framework-server/discovery.js +21 -16
- package/dist/framework-server/discovery.js.map +1 -1
- package/dist/framework-server/local.d.ts +2 -0
- package/dist/framework-server/local.js +5 -3
- package/dist/framework-server/local.js.map +1 -1
- package/dist/framework-server/middleware.d.ts +4 -0
- package/dist/framework-server/middleware.js +56 -0
- package/dist/framework-server/middleware.js.map +1 -0
- package/dist/framework-server/node-upgrade.js +27 -9
- package/dist/framework-server/node-upgrade.js.map +1 -1
- package/dist/framework-server/node-websocket.js +4 -2
- package/dist/framework-server/node-websocket.js.map +1 -1
- package/dist/framework-server/session-stores.d.ts +9 -2
- package/dist/framework-server/session-stores.js +37 -11
- package/dist/framework-server/session-stores.js.map +1 -1
- package/dist/framework-server/sessions.d.ts +6 -0
- package/dist/framework-server/sessions.js +41 -10
- package/dist/framework-server/sessions.js.map +1 -1
- package/dist/framework-server/socket.js +62 -27
- package/dist/framework-server/socket.js.map +1 -1
- package/dist/framework-server.d.ts +2 -0
- package/dist/framework-server.js +1 -0
- package/dist/framework-server.js.map +1 -1
- package/dist/framework.d.ts +3 -1
- package/dist/framework.js +1 -0
- package/dist/framework.js.map +1 -1
- package/dist/hmr.js +74 -24
- package/dist/hmr.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/init.js +27 -1
- package/dist/init.js.map +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +2 -2
- package/dist/internal.js.map +1 -1
- package/dist/node.d.ts +5 -1
- package/dist/node.js +80 -10
- package/dist/node.js.map +1 -1
- package/dist/reactivity.d.ts +12 -3
- package/dist/reactivity.js +94 -17
- package/dist/reactivity.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.js +3 -1
- package/dist/types.js.map +1 -1
- package/dist/vite.js +29 -9
- package/dist/vite.js.map +1 -1
- package/package.json +2 -2
package/dist/autoimports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoimports.js","sourceRoot":"","sources":["../src/autoimports.ts"],"names":[],"mappings":"AAAA,O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,YAAY,EAAE,OAAO,CAAC,YAAY,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ;KAC1L,CAAC;AACJ,CAAC","sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { extname, isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport ts from \"@typescript/typescript6\";\nimport { compile } from \"./compiler.js\";\nimport type { CompileOptions, CompileResult } from \"./compiler.js\";\nimport { projectRoot } from \"./compiler/project-root.js\";\nimport { parseSfc } from \"./compiler/sfc.js\";\nimport { loadMeekoConfig, readMeekoConfigSync, resolveConfigSources } from \"./framework/config.js\";\n\nexport type ImportScope = \"client\" | \"server\" | \"shared\";\nexport interface AutoImport {\n name: string;\n imported: string;\n file: string;\n scope: ImportScope;\n typeOnly: boolean;\n component: boolean;\n specifier?: string;\n}\n\nconst directories = [\n \"app/components\", \"app/composables\", \"app/utils\", \"app/stores\",\n \"shared/types\", \"shared/schemas\", \"shared/utils\", \"shared/constants\", \"shared/enums\",\n \"server/utils\",\n] as const;\n\nfunction scopeOf(file: string): ImportScope {\n if (/\\.shared\\.[cm]?tsx?$/.test(file)) return \"shared\";\n if (/\\.server\\.[cm]?tsx?$/.test(file)) return \"server\";\n if (/\\.client\\.[cm]?tsx?$/.test(file)) return \"client\";\n if (file.includes(`${sep}server${sep}`)) return \"server\";\n if (file.includes(`${sep}app${sep}`)) return \"client\";\n return \"shared\";\n}\n\nasync function filesIn(path: string): Promise<string[]> {\n const entries = await readdir(path, { withFileTypes: true }).catch(() => []);\n const files: string[] = [];\n for (const entry of entries) {\n const filename = join(path, entry.name);\n if (entry.isDirectory()) files.push(...await filesIn(filename));\n else if (/\\.(?:meeko|[cm]?ts)$/.test(entry.name) && !/\\.(?:test|spec|d)\\.[cm]?ts$/.test(entry.name)) files.push(filename);\n }\n return files;\n}\n\nfunction filesInSync(path: string): string[] {\n let entries;\n try { entries = readdirSync(path, { withFileTypes: true }); }\n catch (error) { if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return []; throw error; }\n const files: string[] = [];\n for (const entry of entries) {\n const filename = join(path, entry.name);\n if (entry.isDirectory()) files.push(...filesInSync(filename));\n else if (/\\.(?:meeko|[cm]?ts)$/.test(entry.name) && !/\\.(?:test|spec|d)\\.[cm]?ts$/.test(entry.name)) files.push(filename);\n }\n return files;\n}\n\nfunction builtins(root: string): AutoImport[] {\n const entries: AutoImport[] = [\n ...[\"signal\", \"computed\", \"effect\", \"batch\", \"onCleanup\", \"provide\", \"inject\", \"createContext\"].map((name): AutoImport => ({ name, imported: name, file: \"@meekojs/meeko\", specifier: \"@meekojs/meeko\", scope: \"shared\", typeOnly: false, component: false })),\n ...[\"useState\", \"href\"].map((name): AutoImport => ({ name, imported: name, file: \"@meekojs/meeko/framework\", specifier: \"@meekojs/meeko/framework\", scope: \"shared\", typeOnly: false, component: false })),\n ];\n for (const scope of [\"client\", \"server\"] as const) {\n const file = join(root, \".meeko\", \"generated\", `clients.${scope}.ts`);\n if (!existsSync(file)) continue;\n for (const name of [\"api\", \"rpc\", \"socket\", \"useSocket\"]) entries.push({ name, imported: name, file, scope, typeOnly: false, component: false });\n }\n if (!entries.some((entry) => entry.name === \"useSocket\")) {\n entries.push({ name: \"useSocket\", imported: \"useSocket\", file: \"@meekojs/meeko/framework\", specifier: \"@meekojs/meeko/framework\", scope: \"shared\", typeOnly: false, component: false });\n }\n return entries;\n}\n\nfunction addFileImports(result: AutoImport[], root: string, directory: string, file: string, source?: string): void {\n const scope = scopeOf(file);\n if (extname(file) === \".meeko\") {\n if (directory !== \"app/components\") return;\n const path = relative(join(root, directory), file).replace(/\\.meeko$/, \"\");\n const name = path.split(/[\\\\/]/).map((part) => part.replace(/(^|[-_])(\\w)/g, (_, _dash: string, letter: string) => letter.toUpperCase())).join(\"\");\n result.push({ name, imported: \"*\", file, scope, typeOnly: false, component: true });\n return;\n }\n const ast = ts.createSourceFile(file, source ?? \"\", ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n for (const statement of ast.statements) {\n const exported = ts.canHaveModifiers(statement) && ts.getModifiers(statement)?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword);\n if (exported && (ts.isFunctionDeclaration(statement) || ts.isClassDeclaration(statement) || ts.isInterfaceDeclaration(statement) || ts.isTypeAliasDeclaration(statement) || ts.isEnumDeclaration(statement)) && statement.name) {\n result.push({ name: statement.name.text, imported: statement.name.text, file, scope, typeOnly: ts.isInterfaceDeclaration(statement) || ts.isTypeAliasDeclaration(statement), component: false });\n }\n if (exported && ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) if (ts.isIdentifier(declaration.name)) {\n result.push({ name: declaration.name.text, imported: declaration.name.text, file, scope, typeOnly: false, component: false });\n }\n }\n if (ts.isExportDeclaration(statement) && statement.exportClause && ts.isNamedExports(statement.exportClause)) {\n for (const element of statement.exportClause.elements) result.push({ name: element.name.text, imported: element.name.text, file, scope, typeOnly: statement.isTypeOnly || element.isTypeOnly, component: false });\n }\n }\n}\n\n/** Construye el registro a partir de exports sintácticos, sin ejecutar módulos de la aplicación. */\nexport async function discoverAutoImports(root: string): Promise<AutoImport[]> {\n const result: AutoImport[] = builtins(root);\n const config = await loadMeekoConfig(root);\n const sources = await resolveConfigSources(root, config);\n for (const source of sources) {\n for (const directory of configuredDirectories(config.imports?.serverDirs)) {\n for (const file of await filesIn(join(source.root, directory))) {\n addFileImports(result, source.root, directory, file, extname(file) === \".meeko\" ? undefined : await readFile(file, \"utf8\"));\n }\n }\n }\n return result;\n}\n\n/** Same static registry used by the synchronous VS Code Language Service. */\nexport function discoverAutoImportsSync(root: string): AutoImport[] {\n const result = builtins(root);\n const config = readMeekoConfigSync(root);\n const sourceRoots = [resolve(root)];\n for (const entry of [...(config.extends ?? []), ...(config.modules ?? [])]) {\n const sourceRoot = resolve(root, entry);\n const path = relative(root, sourceRoot);\n if (path === \"..\" || path.startsWith(`..${sep}`) || isAbsolute(path)) throw new Error(`Configured autoimport source escapes project root: ${entry}`);\n sourceRoots.push(sourceRoot);\n }\n for (const sourceRoot of sourceRoots) {\n for (const directory of configuredDirectories(config.imports?.serverDirs)) {\n for (const file of filesInSync(join(sourceRoot, directory))) {\n addFileImports(result, sourceRoot, directory, file, extname(file) === \".meeko\" ? undefined : readFileSync(file, \"utf8\"));\n }\n }\n }\n return result;\n}\n\nfunction configuredDirectories(serverDirs: readonly string[] | undefined): readonly string[] {\n const result = new Set<string>(directories);\n for (const raw of serverDirs ?? []) {\n const directory = raw.replaceAll(\"\\\\\", \"/\").replace(/\\/$/, \"\");\n const parts = directory.split(\"/\");\n if (parts[0] !== \"server\" || parts.length < 2 || parts.some((part) => !part || part === \".\" || part === \"..\")) {\n throw new Error(`Autoimport serverDir must be a relative path under server/: ${raw}`);\n }\n result.add(directory);\n }\n return [...result];\n}\n\nfunction bindingNames(name: ts.BindingName, names: Set<string>): void {\n if (ts.isIdentifier(name)) names.add(name.text);\n else for (const element of name.elements) if (ts.isBindingElement(element)) bindingNames(element.name, names);\n}\n\nfunction scopeNames(node: ts.Node): Set<string> {\n const names = new Set<string>();\n if (ts.isFunctionLike(node)) {\n for (const parameter of node.parameters) bindingNames(parameter.name, names);\n for (const parameter of node.typeParameters ?? []) names.add(parameter.name.text);\n }\n if (ts.isCatchClause(node) && node.variableDeclaration) bindingNames(node.variableDeclaration.name, names);\n if (ts.isForStatement(node) && node.initializer && ts.isVariableDeclarationList(node.initializer)) {\n for (const declaration of node.initializer.declarations) bindingNames(declaration.name, names);\n }\n if ((ts.isForOfStatement(node) || ts.isForInStatement(node)) && ts.isVariableDeclarationList(node.initializer)) {\n for (const declaration of node.initializer.declarations) bindingNames(declaration.name, names);\n }\n if (ts.isSourceFile(node) || ts.isBlock(node)) {\n for (const statement of node.statements) {\n if (ts.isVariableStatement(statement)) for (const declaration of statement.declarationList.declarations) bindingNames(declaration.name, names);\n if ((ts.isFunctionDeclaration(statement) || ts.isClassDeclaration(statement) || ts.isInterfaceDeclaration(statement) || ts.isTypeAliasDeclaration(statement) || ts.isEnumDeclaration(statement)) && statement.name) names.add(statement.name.text);\n if (ts.isImportDeclaration(statement)) {\n const clause = statement.importClause;\n if (clause?.name) names.add(clause.name.text);\n if (clause?.namedBindings) {\n if (ts.isNamespaceImport(clause.namedBindings)) names.add(clause.namedBindings.name.text);\n else for (const element of clause.namedBindings.elements) names.add(element.name.text);\n }\n }\n }\n }\n return names;\n}\n\nfunction introducesScope(node: ts.Node): boolean {\n return ts.isSourceFile(node) || ts.isBlock(node) || ts.isFunctionLike(node) || ts.isCatchClause(node)\n || ts.isForStatement(node) || ts.isForOfStatement(node) || ts.isForInStatement(node);\n}\n\nfunction isReference(node: ts.Identifier): boolean {\n const parent = node.parent;\n if (!parent) return false;\n if (ts.isPropertyAccessExpression(parent) && parent.name === node) return false;\n if (ts.isQualifiedName(parent) && parent.right === node) return false;\n if (ts.isPropertyAssignment(parent) && parent.name === node) return false;\n if (ts.isPropertyDeclaration(parent) && parent.name === node) return false;\n if (ts.isMethodDeclaration(parent) && parent.name === node) return false;\n if (ts.isImportSpecifier(parent) || ts.isExportSpecifier(parent) || ts.isImportClause(parent) || ts.isNamespaceImport(parent)) return false;\n if (ts.isTypeReferenceNode(parent) && parent.typeName === node) return true;\n if (ts.isParameter(parent) && parent.name === node) return false;\n if (ts.isTypeParameterDeclaration(parent) && parent.name === node) return false;\n if (ts.isVariableDeclaration(parent) && parent.name === node) return false;\n if ((ts.isFunctionDeclaration(parent) || ts.isClassDeclaration(parent) || ts.isInterfaceDeclaration(parent) || ts.isTypeAliasDeclaration(parent)) && parent.name === node) return false;\n if (ts.isPropertySignature(parent) && parent.name === node) return false;\n return true;\n}\n\n/** Añade imports ESM para referencias libres del módulo generado. */\nexport function applyAutoImports(code: string, filename: string, registry: readonly AutoImport[], target: \"client\" | \"server\"): string {\n const ast = ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const referenced = new Set<string>();\n const visit = (node: ts.Node, scopes: readonly Set<string>[]): void => {\n const active = introducesScope(node) ? [...scopes, scopeNames(node)] : scopes;\n if (ts.isIdentifier(node) && isReference(node) && !active.some((scope) => scope.has(node.text))) referenced.add(node.text);\n ts.forEachChild(node, (child) => visit(child, active));\n };\n visit(ast, []);\n const imports: string[] = [];\n for (const name of [...referenced].sort()) {\n const candidates = registry.filter((entry) => entry.name === name);\n if (candidates.length === 0) continue;\n const allowed = candidates.filter((entry) => entry.scope === \"shared\" || entry.scope === target);\n if (allowed.length === 0) throw new Error(`Autoimport ${name} is unavailable in ${target} scope`);\n if (allowed.length > 1) throw new Error(`Ambiguous autoimport ${name}: ${allowed.map((entry) => entry.file).join(\", \")}`);\n const entry = allowed[0]!;\n let specifier = entry.specifier ?? relative(resolve(filename, \"..\"), entry.file).replaceAll(\"\\\\\", \"/\");\n if (!entry.specifier && !specifier.startsWith(\".\")) specifier = `./${specifier}`;\n if (!entry.component && !entry.specifier) specifier = specifier.replace(/\\.[cm]?ts$/, \".js\");\n if (entry.component) imports.push(`import * as ${name} from ${JSON.stringify(specifier)};`);\n else imports.push(`import ${entry.typeOnly ? \"type \" : \"\"}{ ${entry.imported} as ${name} } from ${JSON.stringify(specifier)};`);\n }\n return imports.length ? `${imports.join(\"\\n\")}\\n${code}` : code;\n}\n\n/** Transforma un SFC usando exactamente el mismo compilador que el plugin Vite. */\nexport function transformAutoImports(source: string, filename: string, code: string, registry: readonly AutoImport[], target: \"client\" | \"server\"): string {\n parseSfc(source, filename);\n return applyAutoImports(code, filename, registry, target);\n}\n\n/** Compile result shared by Vite, CLI checks and declaration generation. */\nexport async function compileWithAutoImports(source: string, filename: string, options: CompileOptions = {}, target: \"client\" | \"server\" = \"client\"): Promise<CompileResult> {\n const compiled = compile(source, filename, options);\n const registry = await discoverAutoImports(projectRoot(filename));\n const code = transformAutoImports(source, filename, compiled.code, registry, target);\n const offset = code.length - compiled.code.length;\n return {\n ...compiled,\n code,\n mappings: offset ? compiled.mappings.map((mapping) => ({ ...mapping, generatedStart: mapping.generatedStart + offset, generatedEnd: mapping.generatedEnd + offset })) : compiled.mappings,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"autoimports.js","sourceRoot":"","sources":["../src/autoimports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAanG,MAAM,WAAW,GAAG;IAClB,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY;IAC9D,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc;IACpF,cAAc;CACN,CAAC;AAEX,SAAS,OAAO,CAAC,IAAY;IAC3B,IAAI,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACvD,IAAI,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACvD,IAAI,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACvD,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,SAAS,GAAG,EAAE,CAAC;QAAE,OAAO,QAAQ,CAAC;IACzD,yFAAy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QAAgB,EAAE,IAAY,EAAE,QAA+B,EAAE,MAA2B;IAC/I,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3B,OAAO,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,MAAc,EAAE,QAAgB,EAAE,OAAO,GAAmB,EAAE,EAAE,MAAM,GAAwB,QAAQ;IACjJ,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClE,MAAM,IAAI,GAAG,oBAAoB,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACrF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;IAClD,OAAO;QACL,GAAG,QAAQ;QACX,IAAI;QACJ,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,GAAG,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ;KAC1L,CAAC;AACJ,CAAC","sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { extname, isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport ts from \"@typescript/typescript6\";\nimport { compile } from \"./compiler.js\";\nimport type { CompileOptions, CompileResult } from \"./compiler.js\";\nimport { projectRoot } from \"./compiler/project-root.js\";\nimport { parseSfc } from \"./compiler/sfc.js\";\nimport { loadMeekoConfig, readMeekoConfigSync, resolveConfigSources } from \"./framework/config.js\";\n\nexport type ImportScope = \"client\" | \"server\" | \"shared\" | \"app\";\nexport interface AutoImport {\n name: string;\n imported: string;\n file: string;\n scope: ImportScope;\n typeOnly: boolean;\n component: boolean;\n specifier?: string;\n}\n\nconst directories = [\n \"app/components\", \"app/composables\", \"app/utils\", \"app/stores\",\n \"shared/types\", \"shared/schemas\", \"shared/utils\", \"shared/constants\", \"shared/enums\",\n \"server/utils\",\n] as const;\n\nfunction scopeOf(file: string): ImportScope {\n if (/\\.shared\\.[cm]?tsx?$/.test(file)) return \"shared\";\n if (/\\.server\\.[cm]?tsx?$/.test(file)) return \"server\";\n if (/\\.client\\.[cm]?tsx?$/.test(file)) return \"client\";\n if (file.includes(`${sep}server${sep}`)) return \"server\";\n // App modules render on both sides during SSR, but are not available to shared/ sources.\n if (file.includes(`${sep}app${sep}`)) return \"app\";\n return \"shared\";\n}\n\nasync function filesIn(path: string): Promise<string[]> {\n const entries = await readdir(path, { withFileTypes: true }).catch(() => []);\n const files: string[] = [];\n for (const entry of entries) {\n const filename = join(path, entry.name);\n if (entry.isDirectory()) files.push(...await filesIn(filename));\n else if (/\\.(?:meeko|[cm]?ts)$/.test(entry.name) && !/\\.(?:test|spec|d)\\.[cm]?ts$/.test(entry.name)) files.push(filename);\n }\n return files;\n}\n\nfunction filesInSync(path: string): string[] {\n let entries;\n try { entries = readdirSync(path, { withFileTypes: true }); }\n catch (error) { if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return []; throw error; }\n const files: string[] = [];\n for (const entry of entries) {\n const filename = join(path, entry.name);\n if (entry.isDirectory()) files.push(...filesInSync(filename));\n else if (/\\.(?:meeko|[cm]?ts)$/.test(entry.name) && !/\\.(?:test|spec|d)\\.[cm]?ts$/.test(entry.name)) files.push(filename);\n }\n return files;\n}\n\nfunction builtins(root: string): AutoImport[] {\n const entries: AutoImport[] = [\n ...[\"signal\", \"computed\", \"effect\", \"batch\", \"onCleanup\", \"provide\", \"inject\", \"createContext\", \"provideErrorHandler\"].map((name): AutoImport => ({ name, imported: name, file: \"@meekojs/meeko\", specifier: \"@meekojs/meeko\", scope: \"shared\", typeOnly: false, component: false })),\n ...[\"useState\", \"href\"].map((name): AutoImport => ({ name, imported: name, file: \"@meekojs/meeko/framework\", specifier: \"@meekojs/meeko/framework\", scope: \"shared\", typeOnly: false, component: false })),\n ];\n for (const scope of [\"client\", \"server\"] as const) {\n const file = join(root, \".meeko\", \"generated\", `clients.${scope}.ts`);\n if (!existsSync(file)) continue;\n for (const name of [\"api\", \"rpc\", \"socket\", \"useSocket\"]) entries.push({ name, imported: name, file, scope, typeOnly: false, component: false });\n }\n if (!entries.some((entry) => entry.name === \"useSocket\")) {\n entries.push({ name: \"useSocket\", imported: \"useSocket\", file: \"@meekojs/meeko/framework\", specifier: \"@meekojs/meeko/framework\", scope: \"shared\", typeOnly: false, component: false });\n }\n return entries;\n}\n\nfunction addAutoImport(result: AutoImport[], entry: AutoImport): void {\n const previous = result.find((candidate) => candidate.name === entry.name\n && candidate.imported === entry.imported\n && candidate.file === entry.file\n && candidate.scope === entry.scope\n && candidate.component === entry.component);\n if (!previous) {\n result.push(entry);\n return;\n }\n // Function overloads and declaration merging describe one exported symbol.\n // Prefer the value-bearing form when a type and value share that symbol.\n if (previous.typeOnly && !entry.typeOnly) previous.typeOnly = false;\n}\n\nfunction addFileImports(result: AutoImport[], root: string, directory: string, file: string, source?: string): void {\n const scope = scopeOf(file);\n if (extname(file) === \".meeko\") {\n if (directory !== \"app/components\") return;\n const path = relative(join(root, directory), file).replace(/\\.meeko$/, \"\");\n const name = path.split(/[\\\\/]/).map((part) => part.replace(/(^|[-_])(\\w)/g, (_, _dash: string, letter: string) => letter.toUpperCase())).join(\"\");\n addAutoImport(result, { name, imported: \"*\", file, scope, typeOnly: false, component: true });\n return;\n }\n const ast = ts.createSourceFile(file, source ?? \"\", ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n for (const statement of ast.statements) {\n const exported = ts.canHaveModifiers(statement) && ts.getModifiers(statement)?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword);\n if (exported && (ts.isFunctionDeclaration(statement) || ts.isClassDeclaration(statement) || ts.isInterfaceDeclaration(statement) || ts.isTypeAliasDeclaration(statement) || ts.isEnumDeclaration(statement)) && statement.name) {\n addAutoImport(result, { name: statement.name.text, imported: statement.name.text, file, scope, typeOnly: ts.isInterfaceDeclaration(statement) || ts.isTypeAliasDeclaration(statement), component: false });\n }\n if (exported && ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) if (ts.isIdentifier(declaration.name)) {\n addAutoImport(result, { name: declaration.name.text, imported: declaration.name.text, file, scope, typeOnly: false, component: false });\n }\n }\n if (ts.isExportDeclaration(statement) && statement.exportClause && ts.isNamedExports(statement.exportClause)) {\n for (const element of statement.exportClause.elements) addAutoImport(result, { name: element.name.text, imported: element.name.text, file, scope, typeOnly: statement.isTypeOnly || element.isTypeOnly, component: false });\n }\n }\n}\n\n/** Construye el registro a partir de exports sintácticos, sin ejecutar módulos de la aplicación. */\nexport async function discoverAutoImports(root: string): Promise<AutoImport[]> {\n const result: AutoImport[] = builtins(root);\n const config = await loadMeekoConfig(root);\n const sources = await resolveConfigSources(root, config);\n for (const source of sources) {\n for (const directory of configuredDirectories(config.imports?.serverDirs)) {\n for (const file of await filesIn(join(source.root, directory))) {\n addFileImports(result, source.root, directory, file, extname(file) === \".meeko\" ? undefined : await readFile(file, \"utf8\"));\n }\n }\n }\n return result;\n}\n\n/** Same static registry used by the synchronous VS Code Language Service. */\nexport function discoverAutoImportsSync(root: string): AutoImport[] {\n const result = builtins(root);\n const config = readMeekoConfigSync(root);\n const sourceRoots = [resolve(root)];\n for (const entry of [...(config.extends ?? []), ...(config.modules ?? [])]) {\n const sourceRoot = resolve(root, entry);\n const path = relative(root, sourceRoot);\n if (path === \"..\" || path.startsWith(`..${sep}`) || isAbsolute(path)) throw new Error(`Configured autoimport source escapes project root: ${entry}`);\n sourceRoots.push(sourceRoot);\n }\n for (const sourceRoot of sourceRoots) {\n for (const directory of configuredDirectories(config.imports?.serverDirs)) {\n for (const file of filesInSync(join(sourceRoot, directory))) {\n addFileImports(result, sourceRoot, directory, file, extname(file) === \".meeko\" ? undefined : readFileSync(file, \"utf8\"));\n }\n }\n }\n return result;\n}\n\nfunction configuredDirectories(serverDirs: readonly string[] | undefined): readonly string[] {\n const result = new Set<string>(directories);\n for (const raw of serverDirs ?? []) {\n const directory = raw.replaceAll(\"\\\\\", \"/\").replace(/\\/$/, \"\");\n const parts = directory.split(\"/\");\n if (parts[0] !== \"server\" || parts.length < 2 || parts.some((part) => !part || part === \".\" || part === \"..\")) {\n throw new Error(`Autoimport serverDir must be a relative path under server/: ${raw}`);\n }\n result.add(directory);\n }\n return [...result];\n}\n\nfunction bindingNames(name: ts.BindingName, names: Set<string>): void {\n if (ts.isIdentifier(name)) names.add(name.text);\n else for (const element of name.elements) if (ts.isBindingElement(element)) bindingNames(element.name, names);\n}\n\nfunction scopeNames(node: ts.Node): Set<string> {\n const names = new Set<string>();\n if (ts.isFunctionLike(node)) {\n for (const parameter of node.parameters) bindingNames(parameter.name, names);\n for (const parameter of node.typeParameters ?? []) names.add(parameter.name.text);\n }\n if (ts.isCatchClause(node) && node.variableDeclaration) bindingNames(node.variableDeclaration.name, names);\n if (ts.isForStatement(node) && node.initializer && ts.isVariableDeclarationList(node.initializer)) {\n for (const declaration of node.initializer.declarations) bindingNames(declaration.name, names);\n }\n if ((ts.isForOfStatement(node) || ts.isForInStatement(node)) && ts.isVariableDeclarationList(node.initializer)) {\n for (const declaration of node.initializer.declarations) bindingNames(declaration.name, names);\n }\n if (ts.isSourceFile(node) || ts.isBlock(node)) {\n for (const statement of node.statements) {\n if (ts.isVariableStatement(statement)) for (const declaration of statement.declarationList.declarations) bindingNames(declaration.name, names);\n if ((ts.isFunctionDeclaration(statement) || ts.isClassDeclaration(statement) || ts.isInterfaceDeclaration(statement) || ts.isTypeAliasDeclaration(statement) || ts.isEnumDeclaration(statement)) && statement.name) names.add(statement.name.text);\n if (ts.isImportDeclaration(statement)) {\n const clause = statement.importClause;\n if (clause?.name) names.add(clause.name.text);\n if (clause?.namedBindings) {\n if (ts.isNamespaceImport(clause.namedBindings)) names.add(clause.namedBindings.name.text);\n else for (const element of clause.namedBindings.elements) names.add(element.name.text);\n }\n }\n }\n }\n return names;\n}\n\nfunction introducesScope(node: ts.Node): boolean {\n return ts.isSourceFile(node) || ts.isBlock(node) || ts.isFunctionLike(node) || ts.isCatchClause(node)\n || ts.isForStatement(node) || ts.isForOfStatement(node) || ts.isForInStatement(node);\n}\n\nfunction isReference(node: ts.Identifier): boolean {\n const parent = node.parent;\n if (!parent) return false;\n if (ts.isPropertyAccessExpression(parent) && parent.name === node) return false;\n if (ts.isQualifiedName(parent) && parent.right === node) return false;\n if (ts.isPropertyAssignment(parent) && parent.name === node) return false;\n if (ts.isPropertyDeclaration(parent) && parent.name === node) return false;\n if (ts.isMethodDeclaration(parent) && parent.name === node) return false;\n if (ts.isImportSpecifier(parent) || ts.isExportSpecifier(parent) || ts.isImportClause(parent) || ts.isNamespaceImport(parent)) return false;\n if (ts.isTypeReferenceNode(parent) && parent.typeName === node) return true;\n if (ts.isParameter(parent) && parent.name === node) return false;\n if (ts.isTypeParameterDeclaration(parent) && parent.name === node) return false;\n if (ts.isVariableDeclaration(parent) && parent.name === node) return false;\n if ((ts.isFunctionDeclaration(parent) || ts.isClassDeclaration(parent) || ts.isInterfaceDeclaration(parent) || ts.isTypeAliasDeclaration(parent)) && parent.name === node) return false;\n if (ts.isPropertySignature(parent) && parent.name === node) return false;\n return true;\n}\n\n/** Añade imports ESM para referencias libres del módulo generado. */\nexport function applyAutoImports(code: string, filename: string, registry: readonly AutoImport[], target: \"client\" | \"server\" | \"shared\"): string {\n const ast = ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const referenced = new Set<string>();\n const visit = (node: ts.Node, scopes: readonly Set<string>[]): void => {\n const active = introducesScope(node) ? [...scopes, scopeNames(node)] : scopes;\n if (ts.isIdentifier(node) && isReference(node) && !active.some((scope) => scope.has(node.text))) referenced.add(node.text);\n ts.forEachChild(node, (child) => visit(child, active));\n };\n visit(ast, []);\n const imports: string[] = [];\n for (const name of [...referenced].sort()) {\n const candidates = registry.filter((entry) => entry.name === name);\n if (candidates.length === 0) continue;\n const allowed = candidates.filter((entry) => entry.scope === \"shared\" || entry.scope === target || (target !== \"shared\" && entry.scope === \"app\"));\n if (allowed.length === 0) throw new Error(`Autoimport ${name} is unavailable in ${target} scope`);\n if (allowed.length > 1) throw new Error(`Ambiguous autoimport ${name}: ${allowed.map((entry) => entry.file).join(\", \")}`);\n const entry = allowed[0]!;\n let specifier = entry.specifier ?? relative(resolve(filename, \"..\"), entry.file).replaceAll(\"\\\\\", \"/\");\n if (!entry.specifier && !specifier.startsWith(\".\")) specifier = `./${specifier}`;\n if (!entry.component && !entry.specifier) specifier = specifier.replace(/\\.[cm]?ts$/, \".js\");\n if (entry.component) imports.push(`import * as ${name} from ${JSON.stringify(specifier)};`);\n else imports.push(`import ${entry.typeOnly ? \"type \" : \"\"}{ ${entry.imported} as ${name} } from ${JSON.stringify(specifier)};`);\n }\n return imports.length ? `${imports.join(\"\\n\")}\\n${code}` : code;\n}\n\n/** Transforma un SFC usando exactamente el mismo compilador que el plugin Vite. */\nexport function transformAutoImports(source: string, filename: string, code: string, registry: readonly AutoImport[], target: \"client\" | \"server\"): string {\n parseSfc(source, filename);\n return applyAutoImports(code, filename, registry, target);\n}\n\n/** Compile result shared by Vite, CLI checks and declaration generation. */\nexport async function compileWithAutoImports(source: string, filename: string, options: CompileOptions = {}, target: \"client\" | \"server\" = \"client\"): Promise<CompileResult> {\n const compiled = compile(source, filename, options);\n const registry = await discoverAutoImports(projectRoot(filename));\n const code = transformAutoImports(source, filename, compiled.code, registry, target);\n const offset = code.length - compiled.code.length;\n return {\n ...compiled,\n code,\n mappings: offset ? compiled.mappings.map((mapping) => ({ ...mapping, generatedStart: mapping.generatedStart + offset, generatedEnd: mapping.generatedEnd + offset })) : compiled.mappings,\n };\n}\n"]}
|
package/dist/check.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { createRequire as createModuleRequire } from "node:module";
|
|
4
5
|
import { dirname, join, relative, resolve } from "node:path";
|
|
5
6
|
import { promisify } from "node:util";
|
|
6
7
|
import { fileURLToPath } from "node:url";
|
|
@@ -10,7 +11,13 @@ import { moduleSpecifiers } from "./compiler/import-graph.js";
|
|
|
10
11
|
import { projectRoot } from "./compiler/project-root.js";
|
|
11
12
|
import { compileError, MeekoCompileError, locate } from "./compiler/sfc.js";
|
|
12
13
|
const execFileAsync = promisify(execFile);
|
|
13
|
-
const
|
|
14
|
+
const typescriptPackage = fileURLToPath(import.meta.resolve("typescript/package.json"));
|
|
15
|
+
const tscPath = join(dirname(typescriptPackage), "bin", "tsc");
|
|
16
|
+
// The JS launcher spawns tsc.exe without windowsHide, which flashes a terminal in VS Code.
|
|
17
|
+
const nativeTscPath = process.platform === "win32"
|
|
18
|
+
? join(dirname(createModuleRequire(typescriptPackage).resolve(`@typescript/typescript-win32-${process.arch}/package.json`)), "lib", "tsc.exe")
|
|
19
|
+
: undefined;
|
|
20
|
+
const tscExecutable = nativeTscPath && nativeTscPath.length >= 248 ? `\\\\?\\${nativeTscPath}` : nativeTscPath ?? process.execPath;
|
|
14
21
|
async function compileGraph(source, filename) {
|
|
15
22
|
const byOriginal = new Map();
|
|
16
23
|
const byGenerated = new Map();
|
|
@@ -111,12 +118,12 @@ export async function checkSource(source, filename) {
|
|
|
111
118
|
await writeFile(entry.generated, entry.code, { encoding: "utf8", flag: "wx" });
|
|
112
119
|
}
|
|
113
120
|
try {
|
|
114
|
-
const result = await execFileAsync(
|
|
115
|
-
tscPath, "--ignoreConfig", "--noEmit", "--pretty", "false", "--strict", "--skipLibCheck",
|
|
121
|
+
const result = await execFileAsync(tscExecutable, [
|
|
122
|
+
...(nativeTscPath ? [] : [tscPath]), "--ignoreConfig", "--noEmit", "--pretty", "false", "--strict", "--skipLibCheck",
|
|
116
123
|
"--noUncheckedIndexedAccess", "--exactOptionalPropertyTypes", "--verbatimModuleSyntax",
|
|
117
124
|
"--module", "nodenext", "--moduleResolution", "nodenext", "--target", "es2022",
|
|
118
125
|
"--lib", "es2022,dom", graph.root.generated,
|
|
119
|
-
], { cwd: dirname(absolute), maxBuffer: 8 * 1024 * 1024 });
|
|
126
|
+
], { cwd: dirname(absolute), maxBuffer: 8 * 1024 * 1024, windowsHide: true });
|
|
120
127
|
output = result.stdout + result.stderr;
|
|
121
128
|
}
|
|
122
129
|
catch (error) {
|
|
@@ -132,11 +139,33 @@ export async function checkSource(source, filename) {
|
|
|
132
139
|
const typed = parseTypeScriptOutput(output);
|
|
133
140
|
if (typed.length === 0 && output.trim())
|
|
134
141
|
throw new Error(`TypeScript 7 check failed: ${output.trim()}`);
|
|
135
|
-
return typed.map((diagnostic) => {
|
|
136
|
-
const
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
return Promise.all(typed.map(async (diagnostic) => {
|
|
143
|
+
const reported = resolve(dirname(absolute), diagnostic.file);
|
|
144
|
+
const entry = graph.entries.get(reported);
|
|
145
|
+
if (entry) {
|
|
146
|
+
const offset = originalOffset(entry.mappings, generatedOffset(entry.code, diagnostic.line, diagnostic.column));
|
|
147
|
+
return {
|
|
148
|
+
code: diagnostic.code,
|
|
149
|
+
message: offset === undefined ? `Generated TypeScript: ${diagnostic.message}` : diagnostic.message,
|
|
150
|
+
filename: entry.original,
|
|
151
|
+
location: locate(entry.source, offset ?? 0),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
// TypeScript also checks .ts dependencies imported by the .meeko graph.
|
|
155
|
+
// Their positions already refer to the original file, not generated code.
|
|
156
|
+
let imported;
|
|
157
|
+
try {
|
|
158
|
+
imported = await readFile(reported, "utf8");
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
return { code: diagnostic.code, message: `Generated TypeScript: ${diagnostic.message}`, filename: absolute, location: locate(source, 0) };
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
code: diagnostic.code,
|
|
165
|
+
message: diagnostic.message,
|
|
166
|
+
filename: reported,
|
|
167
|
+
location: locate(imported, generatedOffset(imported, diagnostic.line, diagnostic.column)),
|
|
168
|
+
};
|
|
169
|
+
}));
|
|
141
170
|
}
|
|
142
171
|
//# sourceMappingURL=check.js.map
|
package/dist/check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,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MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7E,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACnI,MAAM,OAAO,GAAG,KAAK,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,UAAU,CAAC,OAAO,EAAE,CAAC;QACnH,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,IAAI,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC;IAC3I,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { execFile } from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport { mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { dirname, join, relative, resolve } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { fileURLToPath } from \"node:url\";\nimport { compileWithAutoImports } from \"./autoimports.js\";\nimport { originalOffset } from \"./compiler/mapping.js\";\nimport type { SourceMapping } from \"./compiler/mapping.js\";\nimport { moduleSpecifiers } from \"./compiler/import-graph.js\";\nimport { projectRoot } from \"./compiler/project-root.js\";\nimport { compileError, MeekoCompileError, locate } from \"./compiler/sfc.js\";\nimport type { CompileDiagnostic } from \"./compiler/sfc.js\";\n\nconst execFileAsync = promisify(execFile);\nconst tscPath = join(dirname(fileURLToPath(import.meta.resolve(\"typescript/package.json\"))), \"bin\", \"tsc\");\n\ninterface GeneratedEntry {\n original: string;\n generated: string;\n source: string;\n code: string;\n mappings: SourceMapping[];\n}\n\nasync function compileGraph(source: string, filename: string): Promise<{ root: GeneratedEntry; entries: Map<string, GeneratedEntry>; tempDirectory: string }> {\n const byOriginal = new Map<string, GeneratedEntry>();\n const byGenerated = new Map<string, GeneratedEntry>();\n const nonce = randomUUID();\n const rootDirectory = projectRoot(filename);\n const generatedDirectory = join(rootDirectory, \".meeko\", \"check\", nonce);\n async function add(original: string, content: string): Promise<GeneratedEntry> {\n const previous = byOriginal.get(original);\n if (previous) return previous;\n const target = relative(rootDirectory, original).split(/[\\\\/]/)[0] === \"server\" ? \"server\" : \"client\";\n const compiled = await compileWithAutoImports(content, original, {}, target);\n const entry: GeneratedEntry = {\n original, source: content, code: compiled.code,\n generated: join(generatedDirectory, relative(rootDirectory, original) + \".ts\"),\n mappings: compiled.mappings.map((mapping) => ({ ...mapping })),\n };\n byOriginal.set(original, entry);\n byGenerated.set(entry.generated, entry);\n const edits: Array<{ start: number; end: number; text: string }> = [];\n for (const specifier of moduleSpecifiers(entry.code, entry.generated)) {\n const { value, start, end } = specifier;\n if (!value.endsWith(\".meeko\") && !value.startsWith(\".\")) continue;\n if (value.endsWith(\".meeko\") && !value.startsWith(\".\")) {\n throw compileError(content, original, \"MEEK033\", \"Component imports must use relative .meeko paths\", originalOffset(entry.mappings, start) ?? 0);\n }\n let destination: string;\n if (value.endsWith(\".meeko\")) {\n const childFilename = resolve(dirname(original), value);\n let childSource: string;\n try {\n childSource = await readFile(childFilename, \"utf8\");\n } catch {\n throw compileError(content, original, \"MEEK034\", `Component import not found: ${value}`, originalOffset(entry.mappings, start) ?? 0);\n }\n const child = await add(childFilename, childSource);\n destination = child.generated.replace(/\\.ts$/, \".js\");\n } else {\n destination = resolve(dirname(original), value);\n }\n let target = relative(dirname(entry.generated), destination).replaceAll(\"\\\\\", \"/\");\n if (!target.startsWith(\"./\") && !target.startsWith(\"../\")) target = `./${target}`;\n edits.push({ start, end, text: target });\n }\n for (const edit of edits.reverse()) {\n const delta = edit.text.length - (edit.end - edit.start);\n entry.code = entry.code.slice(0, edit.start) + edit.text + entry.code.slice(edit.end);\n for (const mapping of entry.mappings) {\n if (mapping.generatedStart >= edit.end) mapping.generatedStart += delta;\n if (mapping.generatedEnd >= edit.end) mapping.generatedEnd += delta;\n }\n }\n return entry;\n }\n const root = await add(filename, source);\n return { root, entries: byGenerated, tempDirectory: generatedDirectory };\n}\n\nfunction generatedOffset(code: string, line: number, column: number): number {\n const lines = code.split(\"\\n\");\n let offset = 0;\n for (let index = 0; index < line - 1; index++) offset += (lines[index]?.length ?? 0) + 1;\n return offset + column - 1;\n}\n\nfunction parseTypeScriptOutput(output: string): Array<{ file: string; line: number; column: number; code: string; message: string }> {\n const diagnostics: Array<{ file: string; line: number; column: number; code: string; message: string }> = [];\n for (const line of output.split(/\\r?\\n/)) {\n const match = /^(.*)\\((\\d+),(\\d+)\\): error TS(\\d+): (.*)$/.exec(line);\n if (match) diagnostics.push({ file: match[1] ?? \"\", line: Number(match[2]), column: Number(match[3]), code: `TS${match[4]}`, message: match[5] ?? \"\" });\n else if (line.trim() && diagnostics.length > 0) diagnostics[diagnostics.length - 1]!.message += `\\n${line}`;\n }\n return diagnostics;\n}\n\n/** Comprueba un componente con TypeScript 7 y devuelve errores ubicados en el .meeko original. */\nexport async function checkSource(source: string, filename: string): Promise<CompileDiagnostic[]> {\n const absolute = resolve(filename);\n let graph: Awaited<ReturnType<typeof compileGraph>>;\n try {\n graph = await compileGraph(source, absolute);\n } catch (error) {\n if (error instanceof MeekoCompileError) return [error.diagnostic];\n throw error;\n }\n\n let output = \"\";\n try {\n for (const entry of graph.entries.values()) {\n await mkdir(dirname(entry.generated), { recursive: true });\n await writeFile(entry.generated, entry.code, { encoding: \"utf8\", flag: \"wx\" });\n }\n try {\n const result = await execFileAsync(process.execPath, [\n tscPath, \"--ignoreConfig\", \"--noEmit\", \"--pretty\", \"false\", \"--strict\", \"--skipLibCheck\",\n \"--noUncheckedIndexedAccess\", \"--exactOptionalPropertyTypes\", \"--verbatimModuleSyntax\",\n \"--module\", \"nodenext\", \"--moduleResolution\", \"nodenext\", \"--target\", \"es2022\",\n \"--lib\", \"es2022,dom\", graph.root.generated,\n ], { cwd: dirname(absolute), maxBuffer: 8 * 1024 * 1024 });\n output = result.stdout + result.stderr;\n } catch (error) {\n const failure = error as Error & { stdout?: string; stderr?: string };\n output = `${failure.stdout ?? \"\"}${failure.stderr ?? \"\"}`;\n if (!output.trim()) throw error;\n }\n } finally {\n await rm(graph.tempDirectory, { recursive: true, force: true });\n }\n\n const typed = parseTypeScriptOutput(output);\n if (typed.length === 0 && output.trim()) throw new Error(`TypeScript 7 check failed: ${output.trim()}`);\n return typed.map((diagnostic) => {\n const entry = graph.entries.get(resolve(dirname(absolute), diagnostic.file));\n const offset = entry ? originalOffset(entry.mappings, generatedOffset(entry.code, diagnostic.line, diagnostic.column)) : undefined;\n const message = entry && offset !== undefined ? diagnostic.message : `Generated TypeScript: ${diagnostic.message}`;\n return { code: diagnostic.code, message, filename: entry?.original ?? absolute, location: locate(entry?.source ?? source, offset ?? 0) };\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,M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IAAI;gBACrB,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,yBAAyB,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO;gBAClG,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC;aAC5C,CAAC;QACJ,CAAC;QACD,wEAAwE;QACxE,0EAA0E;QAC1E,IAAI,QAAgB,CAAC;QACrB,IAAI,CAAC;YAAC,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAAC,CAAC;QACpD,MAAM,CAAC;YACL,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,yBAAyB,UAAU,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;QAC5I,CAAC;QACD,OAAO;YACL,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,eAAe,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;SAC1F,CAAC;IACJ,CAAC,CAAC,CAAC,CAAC;AACN,CAAC","sourcesContent":["import { execFile } from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport { mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { createRequire as createModuleRequire } from \"node:module\";\nimport { dirname, join, relative, resolve } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { fileURLToPath } from \"node:url\";\nimport { compileWithAutoImports } from \"./autoimports.js\";\nimport { originalOffset } from \"./compiler/mapping.js\";\nimport type { SourceMapping } from \"./compiler/mapping.js\";\nimport { moduleSpecifiers } from \"./compiler/import-graph.js\";\nimport { projectRoot } from \"./compiler/project-root.js\";\nimport { compileError, MeekoCompileError, locate } from \"./compiler/sfc.js\";\nimport type { CompileDiagnostic } from \"./compiler/sfc.js\";\n\nconst execFileAsync = promisify(execFile);\nconst typescriptPackage = fileURLToPath(import.meta.resolve(\"typescript/package.json\"));\nconst tscPath = join(dirname(typescriptPackage), \"bin\", \"tsc\");\n// The JS launcher spawns tsc.exe without windowsHide, which flashes a terminal in VS Code.\nconst nativeTscPath = process.platform === \"win32\"\n ? join(dirname(createModuleRequire(typescriptPackage).resolve(`@typescript/typescript-win32-${process.arch}/package.json`)), \"lib\", \"tsc.exe\")\n : undefined;\nconst tscExecutable = nativeTscPath && nativeTscPath.length >= 248 ? `\\\\\\\\?\\\\${nativeTscPath}` : nativeTscPath ?? process.execPath;\n\ninterface GeneratedEntry {\n original: string;\n generated: string;\n source: string;\n code: string;\n mappings: SourceMapping[];\n}\n\nasync function compileGraph(source: string, filename: string): Promise<{ root: GeneratedEntry; entries: Map<string, GeneratedEntry>; tempDirectory: string }> {\n const byOriginal = new Map<string, GeneratedEntry>();\n const byGenerated = new Map<string, GeneratedEntry>();\n const nonce = randomUUID();\n const rootDirectory = projectRoot(filename);\n const generatedDirectory = join(rootDirectory, \".meeko\", \"check\", nonce);\n async function add(original: string, content: string): Promise<GeneratedEntry> {\n const previous = byOriginal.get(original);\n if (previous) return previous;\n const target = relative(rootDirectory, original).split(/[\\\\/]/)[0] === \"server\" ? \"server\" : \"client\";\n const compiled = await compileWithAutoImports(content, original, {}, target);\n const entry: GeneratedEntry = {\n original, source: content, code: compiled.code,\n generated: join(generatedDirectory, relative(rootDirectory, original) + \".ts\"),\n mappings: compiled.mappings.map((mapping) => ({ ...mapping })),\n };\n byOriginal.set(original, entry);\n byGenerated.set(entry.generated, entry);\n const edits: Array<{ start: number; end: number; text: string }> = [];\n for (const specifier of moduleSpecifiers(entry.code, entry.generated)) {\n const { value, start, end } = specifier;\n if (!value.endsWith(\".meeko\") && !value.startsWith(\".\")) continue;\n if (value.endsWith(\".meeko\") && !value.startsWith(\".\")) {\n throw compileError(content, original, \"MEEK033\", \"Component imports must use relative .meeko paths\", originalOffset(entry.mappings, start) ?? 0);\n }\n let destination: string;\n if (value.endsWith(\".meeko\")) {\n const childFilename = resolve(dirname(original), value);\n let childSource: string;\n try {\n childSource = await readFile(childFilename, \"utf8\");\n } catch {\n throw compileError(content, original, \"MEEK034\", `Component import not found: ${value}`, originalOffset(entry.mappings, start) ?? 0);\n }\n const child = await add(childFilename, childSource);\n destination = child.generated.replace(/\\.ts$/, \".js\");\n } else {\n destination = resolve(dirname(original), value);\n }\n let target = relative(dirname(entry.generated), destination).replaceAll(\"\\\\\", \"/\");\n if (!target.startsWith(\"./\") && !target.startsWith(\"../\")) target = `./${target}`;\n edits.push({ start, end, text: target });\n }\n for (const edit of edits.reverse()) {\n const delta = edit.text.length - (edit.end - edit.start);\n entry.code = entry.code.slice(0, edit.start) + edit.text + entry.code.slice(edit.end);\n for (const mapping of entry.mappings) {\n if (mapping.generatedStart >= edit.end) mapping.generatedStart += delta;\n if (mapping.generatedEnd >= edit.end) mapping.generatedEnd += delta;\n }\n }\n return entry;\n }\n const root = await add(filename, source);\n return { root, entries: byGenerated, tempDirectory: generatedDirectory };\n}\n\nfunction generatedOffset(code: string, line: number, column: number): number {\n const lines = code.split(\"\\n\");\n let offset = 0;\n for (let index = 0; index < line - 1; index++) offset += (lines[index]?.length ?? 0) + 1;\n return offset + column - 1;\n}\n\nfunction parseTypeScriptOutput(output: string): Array<{ file: string; line: number; column: number; code: string; message: string }> {\n const diagnostics: Array<{ file: string; line: number; column: number; code: string; message: string }> = [];\n for (const line of output.split(/\\r?\\n/)) {\n const match = /^(.*)\\((\\d+),(\\d+)\\): error TS(\\d+): (.*)$/.exec(line);\n if (match) diagnostics.push({ file: match[1] ?? \"\", line: Number(match[2]), column: Number(match[3]), code: `TS${match[4]}`, message: match[5] ?? \"\" });\n else if (line.trim() && diagnostics.length > 0) diagnostics[diagnostics.length - 1]!.message += `\\n${line}`;\n }\n return diagnostics;\n}\n\n/** Comprueba un componente con TypeScript 7 y devuelve errores ubicados en el .meeko original. */\nexport async function checkSource(source: string, filename: string): Promise<CompileDiagnostic[]> {\n const absolute = resolve(filename);\n let graph: Awaited<ReturnType<typeof compileGraph>>;\n try {\n graph = await compileGraph(source, absolute);\n } catch (error) {\n if (error instanceof MeekoCompileError) return [error.diagnostic];\n throw error;\n }\n\n let output = \"\";\n try {\n for (const entry of graph.entries.values()) {\n await mkdir(dirname(entry.generated), { recursive: true });\n await writeFile(entry.generated, entry.code, { encoding: \"utf8\", flag: \"wx\" });\n }\n try {\n const result = await execFileAsync(tscExecutable, [\n ...(nativeTscPath ? [] : [tscPath]), \"--ignoreConfig\", \"--noEmit\", \"--pretty\", \"false\", \"--strict\", \"--skipLibCheck\",\n \"--noUncheckedIndexedAccess\", \"--exactOptionalPropertyTypes\", \"--verbatimModuleSyntax\",\n \"--module\", \"nodenext\", \"--moduleResolution\", \"nodenext\", \"--target\", \"es2022\",\n \"--lib\", \"es2022,dom\", graph.root.generated,\n ], { cwd: dirname(absolute), maxBuffer: 8 * 1024 * 1024, windowsHide: true });\n output = result.stdout + result.stderr;\n } catch (error) {\n const failure = error as Error & { stdout?: string; stderr?: string };\n output = `${failure.stdout ?? \"\"}${failure.stderr ?? \"\"}`;\n if (!output.trim()) throw error;\n }\n } finally {\n await rm(graph.tempDirectory, { recursive: true, force: true });\n }\n\n const typed = parseTypeScriptOutput(output);\n if (typed.length === 0 && output.trim()) throw new Error(`TypeScript 7 check failed: ${output.trim()}`);\n return Promise.all(typed.map(async (diagnostic) => {\n const reported = resolve(dirname(absolute), diagnostic.file);\n const entry = graph.entries.get(reported);\n if (entry) {\n const offset = originalOffset(entry.mappings, generatedOffset(entry.code, diagnostic.line, diagnostic.column));\n return {\n code: diagnostic.code,\n message: offset === undefined ? `Generated TypeScript: ${diagnostic.message}` : diagnostic.message,\n filename: entry.original,\n location: locate(entry.source, offset ?? 0),\n };\n }\n // TypeScript also checks .ts dependencies imported by the .meeko graph.\n // Their positions already refer to the original file, not generated code.\n let imported: string;\n try { imported = await readFile(reported, \"utf8\"); }\n catch {\n return { code: diagnostic.code, message: `Generated TypeScript: ${diagnostic.message}`, filename: absolute, location: locate(source, 0) };\n }\n return {\n code: diagnostic.code,\n message: diagnostic.message,\n filename: reported,\n location: locate(imported, generatedOffset(imported, diagnostic.line, diagnostic.column)),\n };\n }));\n}\n"]}
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { readFile, stat, writeFile } from "node:fs/promises";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { join, resolve } from "node:path";
|
|
5
5
|
import { checkSource } from "./check.js";
|
|
@@ -12,20 +12,47 @@ import { generateServerContracts } from "./framework/contracts-generate.js";
|
|
|
12
12
|
import { checkApp, generateAppTypes } from "./framework/check-app.js";
|
|
13
13
|
import { prerenderProject } from "./framework/prerender.js";
|
|
14
14
|
import { generateTypeScriptAutoImports } from "./autoimports-ts.js";
|
|
15
|
+
import { buildProject, startProject } from "./framework/project.js";
|
|
16
|
+
import { checkFrameworkProject, prepareFrameworkTypes } from "./framework/check-project.js";
|
|
15
17
|
const [command, input, output] = process.argv.slice(2);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
const projectCommand = command === "dev" || command === "build" || command === "start";
|
|
19
|
+
const legacyCommand = command === "compile" || command === "check-app" || command === "types" || command === "init" || command === "init-framework" || command === "routes" || command === "prerender";
|
|
20
|
+
if ((!projectCommand && !legacyCommand && command !== "check") || (!projectCommand && command !== "check" && !input) || (command === "compile" && !output) || (command === "check" && output !== undefined && output !== "--json") || (command !== "compile" && command !== "check" && output !== undefined)) {
|
|
21
|
+
process.stderr.write("Usage: meeko dev [project-directory]\n meeko check [project-directory | component.meeko] [--json]\n meeko build [project-directory]\n meeko start [project-directory]\n meeko check-app <project-directory>\n meeko compile <component.meeko> <output.ts>\n meeko types <component.meeko>\n meeko routes <project-directory>\n meeko prerender <project-directory>\n meeko init <directory>\n meeko init-framework <directory>\n");
|
|
18
22
|
process.exitCode = 1;
|
|
19
23
|
}
|
|
20
24
|
else {
|
|
21
25
|
try {
|
|
22
|
-
if (
|
|
26
|
+
if (projectCommand) {
|
|
27
|
+
const root = input ?? ".";
|
|
28
|
+
if (command === "dev") {
|
|
29
|
+
await prepareFrameworkTypes(root);
|
|
30
|
+
await startProject(root, false);
|
|
31
|
+
}
|
|
32
|
+
else if (command === "start")
|
|
33
|
+
await startProject(root, true);
|
|
34
|
+
else {
|
|
35
|
+
await checkFrameworkProject(root);
|
|
36
|
+
await buildProject(root);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else if (command === "check" && (!input || (await stat(input).catch(() => undefined))?.isDirectory())) {
|
|
40
|
+
if (output)
|
|
41
|
+
throw new Error("--json is available only for a .meeko component");
|
|
42
|
+
await checkFrameworkProject(input ?? ".");
|
|
43
|
+
process.stdout.write(`${resolve(input ?? ".")}: OK\n`);
|
|
44
|
+
}
|
|
45
|
+
else if (command === "init" || command === "init-framework") {
|
|
46
|
+
if (!input)
|
|
47
|
+
throw new Error("Missing destination directory");
|
|
23
48
|
const target = command === "init" ? await initProject(input) : await initFrameworkProject(input);
|
|
24
49
|
const manager = existsSync(join(target, "pnpm-lock.yaml")) ? "pnpm" : "npm";
|
|
25
50
|
const prefix = target === resolve(".") ? "" : `cd ${target} && `;
|
|
26
51
|
process.stdout.write(`Created ${target}\nNext: ${prefix}${manager} install && ${manager} run dev\n`);
|
|
27
52
|
}
|
|
28
53
|
else if (command === "routes") {
|
|
54
|
+
if (!input)
|
|
55
|
+
throw new Error("Missing project directory");
|
|
29
56
|
const generated = await generateRoutes(input);
|
|
30
57
|
const server = await generateServerContracts(input);
|
|
31
58
|
const components = await generateAppTypes(input);
|
|
@@ -33,10 +60,14 @@ else {
|
|
|
33
60
|
process.stdout.write(`${generated.types}\n${generated.manifest}\n${server.types}\n${server.manifest}\n${components.map((file) => `${file}\n`).join("")}${imports.client}\n${imports.server}\n${imports.shared}\n`);
|
|
34
61
|
}
|
|
35
62
|
else if (command === "prerender") {
|
|
63
|
+
if (!input)
|
|
64
|
+
throw new Error("Missing project directory");
|
|
36
65
|
for (const file of await prerenderProject(input))
|
|
37
66
|
process.stdout.write(`${file}\n`);
|
|
38
67
|
}
|
|
39
68
|
else if (command === "check-app") {
|
|
69
|
+
if (!input)
|
|
70
|
+
throw new Error("Missing project directory");
|
|
40
71
|
const diagnostics = await checkApp(input);
|
|
41
72
|
for (const diagnostic of diagnostics) {
|
|
42
73
|
const { line, column } = diagnostic.location;
|
|
@@ -48,6 +79,8 @@ else {
|
|
|
48
79
|
process.stdout.write(`${input}: OK\n`);
|
|
49
80
|
}
|
|
50
81
|
else {
|
|
82
|
+
if (!input)
|
|
83
|
+
throw new Error("Missing component path");
|
|
51
84
|
const source = await readFile(input, "utf8");
|
|
52
85
|
const diagnostics = await checkSource(source, input);
|
|
53
86
|
if (command === "check" && output === "--json") {
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,E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AC;oBAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,QAAQ,IAAI,IAAI,IAAI,MAAM,IAAI,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;gBAC/G,CAAC;YACH,CAAC;iBAAM,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBACjC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;gBACtC,MAAM,SAAS,CAAC,MAAO,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;gBAC9C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC;YACtC,CAAC;iBAAM,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;gBAC/B,KAAK,MAAM,SAAS,IAAI,MAAM,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC;oBAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC;YACrG,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC;YACzC,CAAC;YACD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { existsSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport { checkSource } from \"./check.js\";\nimport { compile } from \"./compiler.js\";\nimport { generateTypes } from \"./types.js\";\nimport { initProject } from \"./init.js\";\nimport { initFrameworkProject } from \"./framework/init.js\";\nimport { generateRoutes } from \"./framework/generate.js\";\nimport { generateServerContracts } from \"./framework/contracts-generate.js\";\nimport { checkApp, generateAppTypes } from \"./framework/check-app.js\";\nimport { prerenderProject } from \"./framework/prerender.js\";\nimport { generateTypeScriptAutoImports } from \"./autoimports-ts.js\";\n\nconst [command, input, output] = process.argv.slice(2);\nif ((command !== \"compile\" && command !== \"check\" && command !== \"check-app\" && command !== \"types\" && command !== \"init\" && command !== \"init-framework\" && command !== \"routes\" && command !== \"prerender\") || !input || (command === \"compile\" && !output) || (command === \"check\" && output !== undefined && output !== \"--json\") || ((command === \"types\" || command === \"init\" || command === \"init-framework\" || command === \"routes\" || command === \"check-app\" || command === \"prerender\") && output !== undefined)) {\n process.stderr.write(\"Usage: meeko check <component.meeko> [--json]\\n meeko check-app <project-directory>\\n meeko compile <component.meeko> <output.ts>\\n meeko types <component.meeko>\\n meeko routes <project-directory>\\n meeko prerender <project-directory>\\n meeko init <directory>\\n meeko init-framework <directory>\\n\");\n process.exitCode = 1;\n} else {\n try {\n if (command === \"init\" || command === \"init-framework\") {\n const target = command === \"init\" ? await initProject(input) : await initFrameworkProject(input);\n const manager = existsSync(join(target, \"pnpm-lock.yaml\")) ? \"pnpm\" : \"npm\";\n const prefix = target === resolve(\".\") ? \"\" : `cd ${target} && `;\n process.stdout.write(`Created ${target}\\nNext: ${prefix}${manager} install && ${manager} run dev\\n`);\n } else if (command === \"routes\") {\n const generated = await generateRoutes(input);\n const server = await generateServerContracts(input);\n const components = await generateAppTypes(input);\n const imports = await generateTypeScriptAutoImports(input);\n process.stdout.write(`${generated.types}\\n${generated.manifest}\\n${server.types}\\n${server.manifest}\\n${components.map((file) => `${file}\\n`).join(\"\")}${imports.client}\\n${imports.server}\\n${imports.shared}\\n`);\n } else if (command === \"prerender\") {\n for (const file of await prerenderProject(input)) process.stdout.write(`${file}\\n`);\n } else if (command === \"check-app\") {\n const diagnostics = await checkApp(input);\n for (const diagnostic of diagnostics) {\n const { line, column } = diagnostic.location;\n process.stderr.write(`${diagnostic.filename}:${line}:${column} ${diagnostic.code}: ${diagnostic.message}\\n`);\n }\n if (diagnostics.length > 0) process.exitCode = 1;\n else process.stdout.write(`${input}: OK\\n`);\n } else {\n const source = await readFile(input, \"utf8\");\n const diagnostics = await checkSource(source, input);\n if (command === \"check\" && output === \"--json\") {\n process.stdout.write(`${JSON.stringify(diagnostics)}\\n`);\n } else if (diagnostics.length > 0) {\n for (const diagnostic of diagnostics) {\n const { line, column } = diagnostic.location;\n process.stderr.write(`${diagnostic.filename}:${line}:${column} ${diagnostic.code}: ${diagnostic.message}\\n`);\n }\n } else if (command === \"compile\") {\n const result = compile(source, input);\n await writeFile(output!, result.code, \"utf8\");\n process.stdout.write(`${output}\\n`);\n } else if (command === \"types\") {\n for (const generated of await generateTypes(source, input)) process.stdout.write(`${generated}\\n`);\n } else {\n process.stdout.write(`${input}: OK\\n`);\n }\n if (diagnostics.length > 0) process.exitCode = 1;\n }\n } catch (error) {\n process.stderr.write(`${error instanceof Error ? error.message : String(error)}\\n`);\n process.exitCode = 1;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM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,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { readFile, stat, writeFile } from \"node:fs/promises\";\nimport { existsSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport { checkSource } from \"./check.js\";\nimport { compile } from \"./compiler.js\";\nimport { generateTypes } from \"./types.js\";\nimport { initProject } from \"./init.js\";\nimport { initFrameworkProject } from \"./framework/init.js\";\nimport { generateRoutes } from \"./framework/generate.js\";\nimport { generateServerContracts } from \"./framework/contracts-generate.js\";\nimport { checkApp, generateAppTypes } from \"./framework/check-app.js\";\nimport { prerenderProject } from \"./framework/prerender.js\";\nimport { generateTypeScriptAutoImports } from \"./autoimports-ts.js\";\nimport { buildProject, startProject } from \"./framework/project.js\";\nimport { checkFrameworkProject, prepareFrameworkTypes } from \"./framework/check-project.js\";\n\nconst [command, input, output] = process.argv.slice(2);\nconst projectCommand = command === \"dev\" || command === \"build\" || command === \"start\";\nconst legacyCommand = command === \"compile\" || command === \"check-app\" || command === \"types\" || command === \"init\" || command === \"init-framework\" || command === \"routes\" || command === \"prerender\";\nif ((!projectCommand && !legacyCommand && command !== \"check\") || (!projectCommand && command !== \"check\" && !input) || (command === \"compile\" && !output) || (command === \"check\" && output !== undefined && output !== \"--json\") || (command !== \"compile\" && command !== \"check\" && output !== undefined)) {\n process.stderr.write(\"Usage: meeko dev [project-directory]\\n meeko check [project-directory | component.meeko] [--json]\\n meeko build [project-directory]\\n meeko start [project-directory]\\n meeko check-app <project-directory>\\n meeko compile <component.meeko> <output.ts>\\n meeko types <component.meeko>\\n meeko routes <project-directory>\\n meeko prerender <project-directory>\\n meeko init <directory>\\n meeko init-framework <directory>\\n\");\n process.exitCode = 1;\n} else {\n try {\n if (projectCommand) {\n const root = input ?? \".\";\n if (command === \"dev\") {\n await prepareFrameworkTypes(root);\n await startProject(root, false);\n }\n else if (command === \"start\") await startProject(root, true);\n else {\n await checkFrameworkProject(root);\n await buildProject(root);\n }\n } else if (command === \"check\" && (!input || (await stat(input).catch(() => undefined))?.isDirectory())) {\n if (output) throw new Error(\"--json is available only for a .meeko component\");\n await checkFrameworkProject(input ?? \".\");\n process.stdout.write(`${resolve(input ?? \".\")}: OK\\n`);\n } else if (command === \"init\" || command === \"init-framework\") {\n if (!input) throw new Error(\"Missing destination directory\");\n const target = command === \"init\" ? await initProject(input) : await initFrameworkProject(input);\n const manager = existsSync(join(target, \"pnpm-lock.yaml\")) ? \"pnpm\" : \"npm\";\n const prefix = target === resolve(\".\") ? \"\" : `cd ${target} && `;\n process.stdout.write(`Created ${target}\\nNext: ${prefix}${manager} install && ${manager} run dev\\n`);\n } else if (command === \"routes\") {\n if (!input) throw new Error(\"Missing project directory\");\n const generated = await generateRoutes(input);\n const server = await generateServerContracts(input);\n const components = await generateAppTypes(input);\n const imports = await generateTypeScriptAutoImports(input);\n process.stdout.write(`${generated.types}\\n${generated.manifest}\\n${server.types}\\n${server.manifest}\\n${components.map((file) => `${file}\\n`).join(\"\")}${imports.client}\\n${imports.server}\\n${imports.shared}\\n`);\n } else if (command === \"prerender\") {\n if (!input) throw new Error(\"Missing project directory\");\n for (const file of await prerenderProject(input)) process.stdout.write(`${file}\\n`);\n } else if (command === \"check-app\") {\n if (!input) throw new Error(\"Missing project directory\");\n const diagnostics = await checkApp(input);\n for (const diagnostic of diagnostics) {\n const { line, column } = diagnostic.location;\n process.stderr.write(`${diagnostic.filename}:${line}:${column} ${diagnostic.code}: ${diagnostic.message}\\n`);\n }\n if (diagnostics.length > 0) process.exitCode = 1;\n else process.stdout.write(`${input}: OK\\n`);\n } else {\n if (!input) throw new Error(\"Missing component path\");\n const source = await readFile(input, \"utf8\");\n const diagnostics = await checkSource(source, input);\n if (command === \"check\" && output === \"--json\") {\n process.stdout.write(`${JSON.stringify(diagnostics)}\\n`);\n } else if (diagnostics.length > 0) {\n for (const diagnostic of diagnostics) {\n const { line, column } = diagnostic.location;\n process.stderr.write(`${diagnostic.filename}:${line}:${column} ${diagnostic.code}: ${diagnostic.message}\\n`);\n }\n } else if (command === \"compile\") {\n const result = compile(source, input);\n await writeFile(output!, result.code, \"utf8\");\n process.stdout.write(`${output}\\n`);\n } else if (command === \"types\") {\n for (const generated of await generateTypes(source, input)) process.stdout.write(`${generated}\\n`);\n } else {\n process.stdout.write(`${input}: OK\\n`);\n }\n if (diagnostics.length > 0) process.exitCode = 1;\n }\n } catch (error) {\n process.stderr.write(`${error instanceof Error ? error.message : String(error)}\\n`);\n process.exitCode = 1;\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const typedEvents = new Set(["click", "input", "change", "submit", "keydown", "keyup", "focus", "blur"]);
|
|
2
|
+
/** Keeps CLI and editor callback contracts aligned for template events. */
|
|
3
|
+
export function templateEventType(name) {
|
|
4
|
+
return typedEvents.has(name) ? `GlobalEventHandlersEventMap[${JSON.stringify(name)}]` : "Event";
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/compiler/events.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAEzG,2EAA2E;AAC3E,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,+BAA+B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;AAClG,CAAC","sourcesContent":["const typedEvents = new Set([\"click\", \"input\", \"change\", \"submit\", \"keydown\", \"keyup\", \"focus\", \"blur\"]);\n\n/** Keeps CLI and editor callback contracts aligned for template events. */\nexport function templateEventType(name: string): string {\n return typedEvents.has(name) ? `GlobalEventHandlersEventMap[${JSON.stringify(name)}]` : \"Event\";\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ts from "@typescript/typescript6";
|
|
2
|
+
/** AST analysis shared by the compiler and the editor for defineProps defaults. */
|
|
3
|
+
export interface PropsDefaults {
|
|
4
|
+
readonly argument: ts.ObjectLiteralExpression;
|
|
5
|
+
readonly keys: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
export declare class PropsDefaultsError extends Error {
|
|
8
|
+
readonly code: string;
|
|
9
|
+
readonly node: ts.Node;
|
|
10
|
+
constructor(code: string, message: string, node: ts.Node);
|
|
11
|
+
}
|
|
12
|
+
export declare function analyzePropsDefaults(call: ts.CallExpression): PropsDefaults | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import ts from "@typescript/typescript6";
|
|
2
|
+
export class PropsDefaultsError extends Error {
|
|
3
|
+
code;
|
|
4
|
+
node;
|
|
5
|
+
constructor(code, message, node) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.node = node;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function analyzePropsDefaults(call) {
|
|
12
|
+
if (call.arguments.length === 0)
|
|
13
|
+
return undefined;
|
|
14
|
+
if (call.arguments.length !== 1 || !ts.isObjectLiteralExpression(call.arguments[0])) {
|
|
15
|
+
throw new PropsDefaultsError("MEEK040", "defineProps defaults require one object literal", call.arguments[0] ?? call);
|
|
16
|
+
}
|
|
17
|
+
const argument = call.arguments[0];
|
|
18
|
+
const keys = [];
|
|
19
|
+
for (const property of argument.properties) {
|
|
20
|
+
if (!ts.isPropertyAssignment(property) ||
|
|
21
|
+
!(ts.isIdentifier(property.name) || ts.isStringLiteral(property.name))) {
|
|
22
|
+
throw new PropsDefaultsError("MEEK041", "defineProps defaults require named properties", property);
|
|
23
|
+
}
|
|
24
|
+
const key = property.name.text;
|
|
25
|
+
if (key === "__proto__" || keys.includes(key)) {
|
|
26
|
+
throw new PropsDefaultsError("MEEK042", `Duplicate or unsafe default prop: ${key}`, property.name);
|
|
27
|
+
}
|
|
28
|
+
keys.push(key);
|
|
29
|
+
}
|
|
30
|
+
return { argument, keys };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../src/compiler/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAQzC,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACtB,IAAI;IAAoC,IAAI;IAAjE,YAAqB,IAAY,EAAE,OAAe,EAAW,IAAa;QACxE,KAAK,CAAC,OAAO,CAAC,CAAC;oBADI,IAAI;oBAAoC,IAAI;IAEjE,CAAC;CACF;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAuB;IAC1D,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAClD,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC;QACrF,MAAM,IAAI,kBAAkB,CAAC,SAAS,EAAE,iDAAiD,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;IACxH,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC3C,IAAI,CAAC,EAAE,CAAC,oBAAoB,CAAC,QAAQ,CAAC;YACpC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YACzE,MAAM,IAAI,kBAAkB,CAAC,SAAS,EAAE,+CAA+C,EAAE,QAAQ,CAAC,CAAC;QACrG,CAAC;QACD,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAC/B,IAAI,GAAG,KAAK,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9C,MAAM,IAAI,kBAAkB,CAAC,SAAS,EAAE,qCAAqC,GAAG,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACrG,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAC","sourcesContent":["import ts from \"@typescript/typescript6\";\n\n/** AST analysis shared by the compiler and the editor for defineProps defaults. */\nexport interface PropsDefaults {\n readonly argument: ts.ObjectLiteralExpression;\n readonly keys: readonly string[];\n}\n\nexport class PropsDefaultsError extends Error {\n constructor(readonly code: string, message: string, readonly node: ts.Node) {\n super(message);\n }\n}\n\nexport function analyzePropsDefaults(call: ts.CallExpression): PropsDefaults | undefined {\n if (call.arguments.length === 0) return undefined;\n if (call.arguments.length !== 1 || !ts.isObjectLiteralExpression(call.arguments[0]!)) {\n throw new PropsDefaultsError(\"MEEK040\", \"defineProps defaults require one object literal\", call.arguments[0] ?? call);\n }\n const argument = call.arguments[0];\n const keys: string[] = [];\n for (const property of argument.properties) {\n if (!ts.isPropertyAssignment(property) ||\n !(ts.isIdentifier(property.name) || ts.isStringLiteral(property.name))) {\n throw new PropsDefaultsError(\"MEEK041\", \"defineProps defaults require named properties\", property);\n }\n const key = property.name.text;\n if (key === \"__proto__\" || keys.includes(key)) {\n throw new PropsDefaultsError(\"MEEK042\", `Duplicate or unsafe default prop: ${key}`, property.name);\n }\n keys.push(key);\n }\n return { argument, keys };\n}\n"]}
|