@open-mercato/cli 0.6.6-develop.6377.1.d26fed7324 → 0.6.6-develop.6382.1.4b9b9091ab
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/.turbo/turbo-build.log +2 -2
- package/dist/agentic/guides/core.md +3 -38
- package/dist/agentic/guides/module-system.md +130 -0
- package/dist/agentic/shared/AGENTS.md.template +4 -12
- package/dist/lib/generators/index.js +2 -0
- package/dist/lib/generators/index.js.map +2 -2
- package/dist/lib/generators/module-facts-generate.js +52 -0
- package/dist/lib/generators/module-facts-generate.js.map +7 -0
- package/dist/lib/generators/module-facts.js +734 -0
- package/dist/lib/generators/module-facts.js.map +7 -0
- package/dist/mercato.js +3 -1
- package/dist/mercato.js.map +2 -2
- package/package.json +5 -5
- package/src/__tests__/mercato.test.ts +5 -0
- package/src/lib/generators/__tests__/module-facts.auth-source.test.ts +83 -0
- package/src/lib/generators/__tests__/module-facts.bc-guard.test.ts +56 -0
- package/src/lib/generators/__tests__/module-facts.customers.fixture.test.ts +69 -0
- package/src/lib/generators/__tests__/module-facts.malformed.test.ts +76 -0
- package/src/lib/generators/index.ts +1 -0
- package/src/lib/generators/module-facts-generate.ts +68 -0
- package/src/lib/generators/module-facts.ts +958 -0
- package/src/mercato.ts +2 -0
- package/dist/agentic/guides/core.auth.md +0 -101
- package/dist/agentic/guides/core.catalog.md +0 -79
- package/dist/agentic/guides/core.currencies.md +0 -43
- package/dist/agentic/guides/core.customer_accounts.md +0 -129
- package/dist/agentic/guides/core.customers.md +0 -138
- package/dist/agentic/guides/core.data_sync.md +0 -107
- package/dist/agentic/guides/core.integrations.md +0 -113
- package/dist/agentic/guides/core.sales.md +0 -104
- package/dist/agentic/guides/core.workflows.md +0 -152
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/generators/module-facts.ts"],
|
|
4
|
+
"sourcesContent": ["import fs from 'node:fs'\nimport path from 'node:path'\nimport ts from 'typescript'\nimport { toSnake } from '../utils'\n\nexport interface ModuleEntityFact {\n id: string\n class: string\n table: string\n editable: boolean\n customFields: boolean\n}\n\nexport interface ApiRouteAuthRule {\n requireAuth?: boolean\n requireFeatures?: string[]\n requireRoles?: string[]\n}\n\nexport interface ModuleApiRouteFact {\n path: string\n methods: string[]\n auth: Record<string, ApiRouteAuthRule>\n}\n\nexport interface ModuleEventFact {\n id: string\n label?: string\n category: string | null\n entity: string | null\n}\n\nexport interface ModuleHostTokens {\n entityIds: string[]\n tableIds: string[]\n}\n\nexport interface ModuleFacts {\n module: string\n title: string | null\n description: string | null\n coreVersion: string | null\n entities: ModuleEntityFact[]\n events: ModuleEventFact[]\n aclFeatures: string[]\n apiRoutes: ModuleApiRouteFact[]\n diTokens: string[]\n searchEntities: string[]\n hostTokens: ModuleHostTokens\n notifications: string[]\n cli: string[]\n warnings: string[]\n}\n\nexport interface ExtractModuleFactsOptions {\n moduleId: string\n coreSrcRoot: string\n coreVersion?: string | null\n registryPath?: string | null\n registrySource?: string | null\n}\n\nexport const MODULE_FACTS_ALLOWLIST = [\n 'auth',\n 'catalog',\n 'currencies',\n 'customer_accounts',\n 'customers',\n 'data_sync',\n 'integrations',\n 'sales',\n 'workflows',\n] as const\n\nexport type ModuleFactsModuleId = (typeof MODULE_FACTS_ALLOWLIST)[number]\n\nfunction readSourceFile(filePath: string): ts.SourceFile | null {\n if (!fs.existsSync(filePath)) return null\n const source = fs.readFileSync(filePath, 'utf8')\n const scriptKind = filePath.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS\n return ts.createSourceFile(filePath, source, ts.ScriptTarget.ES2020, true, scriptKind)\n}\n\nfunction resolveConventionFile(baseDir: string, basename: string): string | null {\n for (const extension of ['.ts', '.tsx']) {\n const candidate = path.join(baseDir, `${basename}${extension}`)\n if (fs.existsSync(candidate)) return candidate\n }\n return null\n}\n\nfunction readStringPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): string | undefined {\n for (const property of objectLiteral.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const name = ts.isIdentifier(property.name)\n ? property.name.text\n : ts.isStringLiteralLike(property.name)\n ? property.name.text\n : undefined\n if (name !== propertyName) continue\n if (ts.isStringLiteralLike(property.initializer)) return property.initializer.text\n return undefined\n }\n return undefined\n}\n\nfunction getClassDecoratorCall(node: ts.ClassDeclaration, decoratorName: string): ts.CallExpression | undefined {\n const decorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) ?? [] : []\n for (const decorator of decorators) {\n const expression = decorator.expression\n if (!ts.isCallExpression(expression)) continue\n if (ts.isIdentifier(expression.expression) && expression.expression.text === decoratorName) {\n return expression\n }\n }\n return undefined\n}\n\nfunction readDecoratorTableName(decoratorCall: ts.CallExpression): string | undefined {\n const firstArgument = decoratorCall.arguments[0]\n if (!firstArgument || !ts.isObjectLiteralExpression(firstArgument)) return undefined\n return readStringPropertyInitializer(firstArgument, 'tableName')\n}\n\nfunction getPropertyDecoratorName(member: ts.PropertyDeclaration): string | undefined {\n const decorators = ts.canHaveDecorators(member) ? ts.getDecorators(member) ?? [] : []\n for (const decorator of decorators) {\n const expression = decorator.expression\n if (!ts.isCallExpression(expression)) continue\n const firstArgument = expression.arguments[0]\n if (!firstArgument || !ts.isObjectLiteralExpression(firstArgument)) continue\n const columnName = readStringPropertyInitializer(firstArgument, 'name')\n if (columnName) return columnName\n }\n return undefined\n}\n\nfunction classHasUpdatedAtColumn(node: ts.ClassDeclaration): boolean {\n for (const member of node.members) {\n if (!ts.isPropertyDeclaration(member) || !member.name) continue\n const propertyName = ts.isIdentifier(member.name)\n ? member.name.text\n : ts.isStringLiteralLike(member.name)\n ? member.name.text\n : undefined\n if (propertyName === 'updatedAt') return true\n if (getPropertyDecoratorName(member) === 'updated_at') return true\n }\n return false\n}\n\nfunction collectCustomFieldEntityIds(ceFilePath: string | null): Set<string> {\n const result = new Set<string>()\n if (!ceFilePath) return result\n const sourceFile = readSourceFile(ceFilePath)\n if (!sourceFile) return result\n\n const visit = (node: ts.Node): void => {\n if (ts.isObjectLiteralExpression(node)) {\n const id = readStringPropertyInitializer(node, 'id')\n if (id && id.includes(':')) result.add(id)\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return result\n}\n\nfunction extractEntities(\n moduleId: string,\n entitiesFilePath: string | null,\n customFieldEntityIds: Set<string>,\n): ModuleEntityFact[] {\n const sourceFile = entitiesFilePath ? readSourceFile(entitiesFilePath) : null\n if (!sourceFile) return []\n\n const facts: ModuleEntityFact[] = []\n sourceFile.forEachChild((node) => {\n if (!ts.isClassDeclaration(node) || !node.name) return\n const isExported = node.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword)\n if (!isExported) return\n const entityDecorator = getClassDecoratorCall(node, 'Entity')\n if (!entityDecorator) return\n\n const className = node.name.text\n const table = readDecoratorTableName(entityDecorator)\n if (!table) return\n\n const entityId = `${moduleId}:${toSnake(className)}`\n facts.push({\n id: entityId,\n class: className,\n table,\n editable: classHasUpdatedAtColumn(node),\n customFields: customFieldEntityIds.has(entityId),\n })\n })\n\n return facts\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression\n while (ts.isAsExpression(current) || ts.isParenthesizedExpression(current) || ts.isTypeAssertionExpression(current)) {\n current = current.expression\n }\n return current\n}\n\nfunction unwrapArrayLiteral(expression: ts.Expression): ts.ArrayLiteralExpression | null {\n const current = unwrapExpression(expression)\n return ts.isArrayLiteralExpression(current) ? current : null\n}\n\nfunction getPropertyName(property: ts.ObjectLiteralElementLike): string | undefined {\n if (!ts.isPropertyAssignment(property) && !ts.isShorthandPropertyAssignment(property)) return undefined\n const name = property.name\n if (!name) return undefined\n if (ts.isIdentifier(name)) return name.text\n if (ts.isStringLiteralLike(name)) return name.text\n return undefined\n}\n\nfunction getObjectPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): ts.Expression | undefined {\n for (const property of objectLiteral.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n if (getPropertyName(property) === propertyName) return property.initializer\n }\n return undefined\n}\n\nfunction findObjectLiteralDeclaration(\n sourceFile: ts.SourceFile,\n variableName: string,\n): ts.ObjectLiteralExpression | null {\n let result: ts.ObjectLiteralExpression | null = null\n const visit = (node: ts.Node): void => {\n if (result) return\n if (\n ts.isVariableDeclaration(node) &&\n ts.isIdentifier(node.name) &&\n node.name.text === variableName &&\n node.initializer\n ) {\n const unwrapped = unwrapExpression(node.initializer)\n if (ts.isObjectLiteralExpression(unwrapped)) {\n result = unwrapped\n return\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return result\n}\n\nfunction buildVariableInitializerMap(sourceFile: ts.SourceFile): Map<string, ts.Expression> {\n const initializers = new Map<string, ts.Expression>()\n const visit = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n if (!initializers.has(node.name.text)) initializers.set(node.name.text, node.initializer)\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return initializers\n}\n\nfunction resolveToObjectLiteral(\n expression: ts.Expression,\n initializers: Map<string, ts.Expression>,\n): ts.ObjectLiteralExpression | null {\n const unwrapped = unwrapExpression(expression)\n if (ts.isObjectLiteralExpression(unwrapped)) return unwrapped\n if (ts.isIdentifier(unwrapped)) {\n const referenced = initializers.get(unwrapped.text)\n if (referenced) return resolveToObjectLiteral(referenced, initializers)\n }\n return null\n}\n\nfunction resolveToArrayLiteral(\n expression: ts.Expression,\n initializers: Map<string, ts.Expression>,\n): ts.ArrayLiteralExpression | null {\n const unwrapped = unwrapExpression(expression)\n if (ts.isArrayLiteralExpression(unwrapped)) return unwrapped\n if (ts.isIdentifier(unwrapped)) {\n const referenced = initializers.get(unwrapped.text)\n if (referenced) return resolveToArrayLiteral(referenced, initializers)\n }\n return null\n}\n\nfunction findDefaultExportExpression(sourceFile: ts.SourceFile): ts.Expression | null {\n for (const statement of sourceFile.statements) {\n if (ts.isExportAssignment(statement) && !statement.isExportEquals) return statement.expression\n }\n return null\n}\n\nfunction findArrayLiteralDeclaration(\n sourceFile: ts.SourceFile,\n variableName: string,\n): ts.ArrayLiteralExpression | null {\n let result: ts.ArrayLiteralExpression | null = null\n const visit = (node: ts.Node): void => {\n if (result) return\n if (\n ts.isVariableDeclaration(node) &&\n ts.isIdentifier(node.name) &&\n node.name.text === variableName &&\n node.initializer\n ) {\n const arrayLiteral = unwrapArrayLiteral(node.initializer)\n if (arrayLiteral) {\n result = arrayLiteral\n return\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return result\n}\n\nfunction extractEvents(eventsFilePath: string | null): ModuleEventFact[] {\n const sourceFile = eventsFilePath ? readSourceFile(eventsFilePath) : null\n if (!sourceFile) return []\n\n const eventsArray = findArrayLiteralDeclaration(sourceFile, 'events')\n if (!eventsArray) return []\n\n const facts: ModuleEventFact[] = []\n for (const element of eventsArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const id = readStringPropertyInitializer(element, 'id')\n if (!id) continue\n const label = readStringPropertyInitializer(element, 'label')\n const category = readStringPropertyInitializer(element, 'category')\n const entity = readStringPropertyInitializer(element, 'entity')\n const fact: ModuleEventFact = {\n id,\n category: category ?? null,\n entity: entity ?? null,\n }\n if (label !== undefined) fact.label = label\n facts.push(fact)\n }\n\n return facts\n}\n\nfunction extractAclFeatures(aclFilePath: string | null): string[] {\n const sourceFile = aclFilePath ? readSourceFile(aclFilePath) : null\n if (!sourceFile) return []\n\n const featuresArray = findArrayLiteralDeclaration(sourceFile, 'features')\n if (!featuresArray) return []\n\n const featureIds: string[] = []\n const seen = new Set<string>()\n for (const element of featuresArray.elements) {\n let featureId: string | undefined\n if (ts.isObjectLiteralExpression(element)) {\n featureId = readStringPropertyInitializer(element, 'id')\n } else if (ts.isStringLiteralLike(element)) {\n featureId = element.text\n }\n if (!featureId || seen.has(featureId)) continue\n seen.add(featureId)\n featureIds.push(featureId)\n }\n\n return featureIds\n}\n\nfunction readBooleanPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): boolean | undefined {\n const initializer = getObjectPropertyInitializer(objectLiteral, propertyName)\n if (!initializer) return undefined\n if (initializer.kind === ts.SyntaxKind.TrueKeyword) return true\n if (initializer.kind === ts.SyntaxKind.FalseKeyword) return false\n return undefined\n}\n\nfunction readStringArrayPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): string[] | undefined {\n const initializer = getObjectPropertyInitializer(objectLiteral, propertyName)\n if (!initializer) return undefined\n const arrayLiteral = unwrapArrayLiteral(initializer)\n if (!arrayLiteral) return undefined\n const values: string[] = []\n for (const element of arrayLiteral.elements) {\n if (ts.isStringLiteralLike(element)) values.push(element.text)\n }\n return values\n}\n\nfunction parseApiRouteAuthRule(metadataLiteral: ts.ObjectLiteralExpression): ApiRouteAuthRule {\n const rule: ApiRouteAuthRule = {}\n const requireAuth = readBooleanPropertyInitializer(metadataLiteral, 'requireAuth')\n if (requireAuth !== undefined) rule.requireAuth = requireAuth\n const requireFeatures = readStringArrayPropertyInitializer(metadataLiteral, 'requireFeatures')\n if (requireFeatures && requireFeatures.length > 0) rule.requireFeatures = requireFeatures\n const requireRoles = readStringArrayPropertyInitializer(metadataLiteral, 'requireRoles')\n if (requireRoles && requireRoles.length > 0) rule.requireRoles = requireRoles\n return rule\n}\n\nfunction parseApiRouteEntry(entryLiteral: ts.ObjectLiteralExpression): ModuleApiRouteFact | null {\n const routePath = readStringPropertyInitializer(entryLiteral, 'path')\n if (!routePath) return null\n\n const methods: string[] = []\n const seenMethods = new Set<string>()\n const handlersInitializer = getObjectPropertyInitializer(entryLiteral, 'handlers')\n if (handlersInitializer && ts.isObjectLiteralExpression(handlersInitializer)) {\n for (const property of handlersInitializer.properties) {\n const methodName = getPropertyName(property)\n if (methodName && !seenMethods.has(methodName)) {\n seenMethods.add(methodName)\n methods.push(methodName)\n }\n }\n } else {\n const singleMethod = readStringPropertyInitializer(entryLiteral, 'method')\n if (singleMethod && !seenMethods.has(singleMethod)) {\n seenMethods.add(singleMethod)\n methods.push(singleMethod)\n }\n }\n\n const auth: Record<string, ApiRouteAuthRule> = {}\n const metadataInitializer = getObjectPropertyInitializer(entryLiteral, 'metadata')\n if (metadataInitializer && ts.isObjectLiteralExpression(metadataInitializer)) {\n for (const property of metadataInitializer.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const methodName = getPropertyName(property)\n if (!methodName) continue\n const methodMetadata = unwrapExpression(property.initializer)\n if (!ts.isObjectLiteralExpression(methodMetadata)) continue\n auth[methodName] = parseApiRouteAuthRule(methodMetadata)\n if (!seenMethods.has(methodName)) {\n seenMethods.add(methodName)\n methods.push(methodName)\n }\n }\n }\n\n return { path: routePath, methods, auth }\n}\n\nfunction extractApiRoutes(\n moduleId: string,\n registrySource: string | null,\n registryDescription: string,\n warnings: string[],\n): ModuleApiRouteFact[] {\n if (registrySource == null) {\n warnings.push(`[module-facts] module registry unavailable (${registryDescription}); API route auth omitted for ${moduleId}`)\n return []\n }\n\n const sourceFile = ts.createSourceFile(\n 'module-registry.generated.ts',\n registrySource,\n ts.ScriptTarget.ES2020,\n true,\n ts.ScriptKind.TS,\n )\n\n const routes: ModuleApiRouteFact[] = []\n const seenPaths = new Set<string>()\n const visit = (node: ts.Node): void => {\n if (ts.isObjectLiteralExpression(node) && readStringPropertyInitializer(node, 'id') === moduleId) {\n const apisInitializer = getObjectPropertyInitializer(node, 'apis')\n const apisArray = apisInitializer ? unwrapArrayLiteral(apisInitializer) : null\n if (apisArray) {\n for (const element of apisArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const route = parseApiRouteEntry(element)\n if (route && !seenPaths.has(route.path)) {\n seenPaths.add(route.path)\n routes.push(route)\n }\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return routes\n}\n\nfunction resolveRegistrySource(options: ExtractModuleFactsOptions): { source: string | null; description: string } {\n if (typeof options.registrySource === 'string') {\n return { source: options.registrySource, description: 'registrySource' }\n }\n if (options.registryPath) {\n if (!fs.existsSync(options.registryPath)) {\n return { source: null, description: options.registryPath }\n }\n return { source: fs.readFileSync(options.registryPath, 'utf8'), description: options.registryPath }\n }\n return { source: null, description: 'registryPath not provided' }\n}\n\nfunction detectAwilixRegistrationKind(expression: ts.Expression): string | null {\n let current: ts.Expression = unwrapExpression(expression)\n while (ts.isCallExpression(current)) {\n const callee = current.expression\n if (ts.isIdentifier(callee)) return callee.text\n if (ts.isPropertyAccessExpression(callee)) {\n current = callee.expression\n continue\n }\n break\n }\n return null\n}\n\nfunction extractDiTokens(diFilePath: string | null): string[] {\n if (!diFilePath) return []\n const sourceFile = readSourceFile(diFilePath)\n if (!sourceFile) return []\n\n const tokens: string[] = []\n const seen = new Set<string>()\n const visit = (node: ts.Node): void => {\n if (\n ts.isCallExpression(node) &&\n ts.isPropertyAccessExpression(node.expression) &&\n node.expression.name.text === 'register'\n ) {\n const argument = node.arguments[0]\n if (argument && ts.isObjectLiteralExpression(argument)) {\n for (const property of argument.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const kind = detectAwilixRegistrationKind(property.initializer)\n if (kind !== 'asFunction' && kind !== 'asClass') continue\n const tokenName = getPropertyName(property)\n if (tokenName && !seen.has(tokenName)) {\n seen.add(tokenName)\n tokens.push(tokenName)\n }\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return tokens\n}\n\nfunction extractSearchEntities(searchFilePath: string | null, warnings: string[]): string[] {\n if (!searchFilePath) return []\n const sourceFile = readSourceFile(searchFilePath)\n if (!sourceFile) return []\n\n const searchConfig = findObjectLiteralDeclaration(sourceFile, 'searchConfig')\n if (!searchConfig) {\n warnings.push(`[module-facts] search.ts present but no searchConfig object literal: ${searchFilePath}`)\n return []\n }\n const entitiesInitializer = getObjectPropertyInitializer(searchConfig, 'entities')\n const entitiesArray = entitiesInitializer ? unwrapArrayLiteral(entitiesInitializer) : null\n if (!entitiesArray) {\n warnings.push(`[module-facts] searchConfig.entities is not an array literal: ${searchFilePath}`)\n return []\n }\n\n const entityIds: string[] = []\n const seen = new Set<string>()\n for (const element of entitiesArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const entityId = readStringPropertyInitializer(element, 'entityId')\n if (entityId && !seen.has(entityId)) {\n seen.add(entityId)\n entityIds.push(entityId)\n }\n }\n return entityIds\n}\n\nfunction extractNotifications(notificationsFilePath: string | null, warnings: string[]): string[] {\n if (!notificationsFilePath) return []\n const sourceFile = readSourceFile(notificationsFilePath)\n if (!sourceFile) return []\n\n const notificationsArray =\n findArrayLiteralDeclaration(sourceFile, 'notificationTypes') ??\n findArrayLiteralDeclaration(sourceFile, 'notifications')\n if (!notificationsArray) {\n warnings.push(`[module-facts] notifications.ts present but no notificationTypes array literal: ${notificationsFilePath}`)\n return []\n }\n\n const notificationIds: string[] = []\n const seen = new Set<string>()\n for (const element of notificationsArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const notificationId = readStringPropertyInitializer(element, 'type')\n if (notificationId && !seen.has(notificationId)) {\n seen.add(notificationId)\n notificationIds.push(notificationId)\n }\n }\n return notificationIds\n}\n\nfunction extractCli(cliFilePath: string | null, warnings: string[]): string[] {\n if (!cliFilePath) return []\n const sourceFile = readSourceFile(cliFilePath)\n if (!sourceFile) return []\n\n const defaultExport = findDefaultExportExpression(sourceFile)\n if (!defaultExport) {\n warnings.push(`[module-facts] cli.ts present but no default export: ${cliFilePath}`)\n return []\n }\n\n const initializers = buildVariableInitializerMap(sourceFile)\n const collectCommand = (objectLiteral: ts.ObjectLiteralExpression): string | undefined =>\n readStringPropertyInitializer(objectLiteral, 'command')\n\n const commands: string[] = []\n const seen = new Set<string>()\n const pushCommand = (command: string | undefined): void => {\n if (command && !seen.has(command)) {\n seen.add(command)\n commands.push(command)\n }\n }\n\n const arrayLiteral = resolveToArrayLiteral(defaultExport, initializers)\n if (arrayLiteral) {\n for (const element of arrayLiteral.elements) {\n const objectLiteral = resolveToObjectLiteral(element, initializers)\n if (objectLiteral) pushCommand(collectCommand(objectLiteral))\n }\n return commands\n }\n\n const singleObject = resolveToObjectLiteral(defaultExport, initializers)\n if (singleObject) {\n pushCommand(collectCommand(singleObject))\n return commands\n }\n\n warnings.push(`[module-facts] cli.ts default export is neither an array nor an object literal: ${cliFilePath}`)\n return commands\n}\n\nfunction listSourceFilesRecursive(directory: string): string[] {\n const files: string[] = []\n for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {\n if (entry.name === '__tests__' || entry.name === 'node_modules') continue\n const fullPath = path.join(directory, entry.name)\n if (entry.isDirectory()) {\n files.push(...listSourceFilesRecursive(fullPath))\n } else if (/\\.tsx?$/.test(entry.name) && !entry.name.endsWith('.d.ts')) {\n files.push(fullPath)\n }\n }\n return files\n}\n\nfunction extractTableIds(backendDir: string): string[] {\n if (!fs.existsSync(backendDir)) return []\n\n const tableIds: string[] = []\n const seen = new Set<string>()\n for (const filePath of listSourceFilesRecursive(backendDir)) {\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node)) {\n const propertyName = getPropertyName(node)\n if (\n (propertyName === 'tableId' || propertyName === 'extensionTableId') &&\n ts.isStringLiteralLike(node.initializer)\n ) {\n const value = node.initializer.text\n if (value && !seen.has(value)) {\n seen.add(value)\n tableIds.push(value)\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n }\n tableIds.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))\n return tableIds\n}\n\nfunction extractHostEntityIds(entities: ModuleEntityFact[]): string[] {\n return entities.filter((entity) => entity.id.endsWith('_entity')).map((entity) => entity.id)\n}\n\nfunction extractModuleMeta(indexFilePath: string | null): { title: string | null; description: string | null } {\n if (!indexFilePath) return { title: null, description: null }\n const sourceFile = readSourceFile(indexFilePath)\n if (!sourceFile) return { title: null, description: null }\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n if (!metadata) return { title: null, description: null }\n return {\n title: readStringPropertyInitializer(metadata, 'title') ?? null,\n description: readStringPropertyInitializer(metadata, 'description') ?? null,\n }\n}\n\nexport function extractModuleFacts(options: ExtractModuleFactsOptions): ModuleFacts {\n const { moduleId, coreSrcRoot, coreVersion = null } = options\n const moduleRoot = path.join(coreSrcRoot, moduleId)\n\n const entitiesFilePath =\n resolveConventionFile(path.join(moduleRoot, 'data'), 'entities') ??\n resolveConventionFile(path.join(moduleRoot, 'db'), 'entities') ??\n resolveConventionFile(path.join(moduleRoot, 'data'), 'schema')\n const ceFilePath = resolveConventionFile(moduleRoot, 'ce')\n const eventsFilePath = resolveConventionFile(moduleRoot, 'events')\n const aclFilePath = resolveConventionFile(moduleRoot, 'acl')\n const diFilePath = resolveConventionFile(moduleRoot, 'di')\n const searchFilePath = resolveConventionFile(moduleRoot, 'search')\n const notificationsFilePath = resolveConventionFile(moduleRoot, 'notifications')\n const cliFilePath = resolveConventionFile(moduleRoot, 'cli')\n const indexFilePath = resolveConventionFile(moduleRoot, 'index')\n const backendDir = path.join(moduleRoot, 'backend')\n\n const warnings: string[] = []\n const { title, description } = extractModuleMeta(indexFilePath)\n const customFieldEntityIds = collectCustomFieldEntityIds(ceFilePath)\n const entities = extractEntities(moduleId, entitiesFilePath, customFieldEntityIds)\n const events = extractEvents(eventsFilePath)\n const aclFeatures = extractAclFeatures(aclFilePath)\n\n const { source: registrySource, description: registryDescription } = resolveRegistrySource(options)\n const apiRoutes = extractApiRoutes(moduleId, registrySource, registryDescription, warnings)\n const diTokens = extractDiTokens(diFilePath)\n const searchEntities = extractSearchEntities(searchFilePath, warnings)\n const notifications = extractNotifications(notificationsFilePath, warnings)\n const cli = extractCli(cliFilePath, warnings)\n const hostTokens: ModuleHostTokens = {\n entityIds: extractHostEntityIds(entities),\n tableIds: extractTableIds(backendDir),\n }\n\n return {\n module: moduleId,\n title,\n description,\n coreVersion,\n entities,\n events,\n aclFeatures,\n apiRoutes,\n diTokens,\n searchEntities,\n hostTokens,\n notifications,\n cli,\n warnings,\n }\n}\n\nexport interface ModuleFactsJsonEvent {\n id: string\n category: string | null\n entity: string | null\n}\n\nexport interface ModuleFactsJsonEntry {\n title: string | null\n description: string | null\n coreVersion: string | null\n entities: ModuleEntityFact[]\n events: ModuleFactsJsonEvent[]\n aclFeatures: string[]\n apiRoutes: ModuleApiRouteFact[]\n diTokens: string[]\n searchEntities: string[]\n hostTokens: ModuleHostTokens\n notifications: string[]\n cli: string[]\n}\n\nconst EMPTY_SECTION_MARKER = '_none_'\n\nfunction renderVersionStamp(coreVersion: string | null): string {\n const version = coreVersion && coreVersion.length > 0 ? coreVersion : '<unknown>'\n return `<!-- generated from @open-mercato/core ${version} \u2014 R1 staleness stamp -->`\n}\n\nfunction renderEntitiesSection(entities: ModuleEntityFact[]): string {\n if (entities.length === 0) return `## Entities\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| Entity ID | Class | Table | Editable | CustomFields |'\n const divider = '|---|---|---|---|---|'\n const rows = entities.map(\n (entity) =>\n `| ${entity.id} | ${entity.class} | ${entity.table} | ${entity.editable ? 'yes' : 'no'} | ${entity.customFields ? 'yes' : 'no'} |`,\n )\n return ['## Entities', '', header, divider, ...rows].join('\\n')\n}\n\nfunction renderEventsSection(events: ModuleEventFact[]): string {\n const heading = `## Events (${events.length})`\n if (events.length === 0) return `${heading}\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| ID | Category | Entity |'\n const divider = '|---|---|---|'\n const rows = events.map((event) => `| ${event.id} | ${event.category ?? '\u2014'} | ${event.entity ?? '\u2014'} |`)\n return [heading, '', header, divider, ...rows].join('\\n')\n}\n\nfunction renderInlineListSection(heading: string, values: string[]): string {\n if (values.length === 0) return `${heading}\\n\\n${EMPTY_SECTION_MARKER}`\n return `${heading}\\n\\n${values.join(' \u00B7 ')}`\n}\n\nfunction describeAuthRule(rule: ApiRouteAuthRule | undefined): string {\n if (!rule) return 'public'\n if (rule.requireFeatures && rule.requireFeatures.length > 0) return rule.requireFeatures.join(', ')\n if (rule.requireRoles && rule.requireRoles.length > 0) return rule.requireRoles.join(', ')\n if (rule.requireAuth) return 'auth'\n return 'public'\n}\n\nfunction renderApiRouteAuthCell(route: ModuleApiRouteFact): string {\n if (route.methods.length === 0) return '\u2014'\n const groups: Array<{ label: string; methods: string[] }> = []\n for (const method of route.methods) {\n const label = describeAuthRule(route.auth[method])\n const existing = groups.find((group) => group.label === label)\n if (existing) existing.methods.push(method)\n else groups.push({ label, methods: [method] })\n }\n return groups.map((group) => `${group.methods.join('/')} \u2192 ${group.label}`).join(' \u00B7 ')\n}\n\nfunction renderApiRoutesSection(routes: ModuleApiRouteFact[]): string {\n if (routes.length === 0) return `## API routes\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| Path | Methods | Auth (per-method requireFeatures) |'\n const divider = '|---|---|---|'\n const rows = routes.map(\n (route) => `| ${route.path} | ${route.methods.join(' ')} | ${renderApiRouteAuthCell(route)} |`,\n )\n return ['## API routes', '', header, divider, ...rows].join('\\n')\n}\n\nfunction renderHostTokensSection(hostTokens: ModuleHostTokens): string {\n const entityIdsLine = hostTokens.entityIds.length > 0 ? hostTokens.entityIds.join(' \u00B7 ') : EMPTY_SECTION_MARKER\n const tableIdsLine = hostTokens.tableIds.length > 0 ? hostTokens.tableIds.join(' \u00B7 ') : EMPTY_SECTION_MARKER\n return ['## Host extension points', '', `- Entity IDs: ${entityIdsLine}`, `- Table IDs: ${tableIdsLine}`].join('\\n')\n}\n\nexport function renderModuleFactsMarkdown(facts: ModuleFacts): string {\n const sections = [\n `# ${facts.module} \u2014 module facts (generated, do not edit)`,\n renderVersionStamp(facts.coreVersion),\n '',\n renderEntitiesSection(facts.entities),\n '',\n renderEventsSection(facts.events),\n '',\n renderInlineListSection(`## ACL features (${facts.aclFeatures.length})`, facts.aclFeatures),\n '',\n renderApiRoutesSection(facts.apiRoutes),\n '',\n renderInlineListSection('## DI service tokens', facts.diTokens),\n '',\n renderInlineListSection('## Search entities', facts.searchEntities),\n '',\n renderHostTokensSection(facts.hostTokens),\n '',\n renderInlineListSection('## Notifications', facts.notifications),\n '',\n renderInlineListSection('## CLI', facts.cli),\n '',\n ]\n return sections.join('\\n')\n}\n\nexport function toModuleFactsJsonEntry(facts: ModuleFacts): ModuleFactsJsonEntry {\n return {\n title: facts.title,\n description: facts.description,\n coreVersion: facts.coreVersion,\n entities: facts.entities,\n events: facts.events.map((event) => ({ id: event.id, category: event.category, entity: event.entity })),\n aclFeatures: facts.aclFeatures,\n apiRoutes: facts.apiRoutes,\n diTokens: facts.diTokens,\n searchEntities: facts.searchEntities,\n hostTokens: facts.hostTokens,\n notifications: facts.notifications,\n cli: facts.cli,\n }\n}\n\nexport function buildModuleFactsJsonObject(\n factsByModule: Record<string, ModuleFacts>,\n): Record<string, ModuleFactsJsonEntry> {\n const result: Record<string, ModuleFactsJsonEntry> = {}\n for (const moduleId of Object.keys(factsByModule).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))) {\n result[moduleId] = toModuleFactsJsonEntry(factsByModule[moduleId])\n }\n return result\n}\n\nexport function renderModuleFactsJson(factsByModule: Record<string, ModuleFacts>): string {\n return `${JSON.stringify(buildModuleFactsJsonObject(factsByModule), null, 2)}\\n`\n}\n\nexport interface ExtractAllModuleFactsOptions {\n coreSrcRoot: string\n registryPath?: string | null\n registrySource?: string | null\n coreVersion?: string | null\n moduleIds?: readonly string[]\n}\n\nexport interface ExtractAllModuleFactsResult {\n factsByModule: Record<string, ModuleFacts>\n markdownByModule: Record<string, string>\n warnings: string[]\n}\n\nexport function extractAllModuleFacts(options: ExtractAllModuleFactsOptions): ExtractAllModuleFactsResult {\n const moduleIds = options.moduleIds ?? MODULE_FACTS_ALLOWLIST\n const factsByModule: Record<string, ModuleFacts> = {}\n const markdownByModule: Record<string, string> = {}\n const warnings: string[] = []\n for (const moduleId of moduleIds) {\n const facts = extractModuleFacts({\n moduleId,\n coreSrcRoot: options.coreSrcRoot,\n coreVersion: options.coreVersion ?? null,\n registryPath: options.registryPath ?? null,\n registrySource: options.registrySource ?? null,\n })\n factsByModule[moduleId] = facts\n markdownByModule[moduleId] = renderModuleFactsMarkdown(facts)\n warnings.push(...facts.warnings)\n }\n return { factsByModule, markdownByModule, warnings }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,SAAS,eAAe;AA2DjB,MAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIA,SAAS,eAAe,UAAwC;AAC9D,MAAI,CAAC,GAAG,WAAW,QAAQ,EAAG,QAAO;AACrC,QAAM,SAAS,GAAG,aAAa,UAAU,MAAM;AAC/C,QAAM,aAAa,SAAS,SAAS,MAAM,IAAI,GAAG,WAAW,MAAM,GAAG,WAAW;AACjF,SAAO,GAAG,iBAAiB,UAAU,QAAQ,GAAG,aAAa,QAAQ,MAAM,UAAU;AACvF;AAEA,SAAS,sBAAsB,SAAiB,UAAiC;AAC/E,aAAW,aAAa,CAAC,OAAO,MAAM,GAAG;AACvC,UAAM,YAAY,KAAK,KAAK,SAAS,GAAG,QAAQ,GAAG,SAAS,EAAE;AAC9D,QAAI,GAAG,WAAW,SAAS,EAAG,QAAO;AAAA,EACvC;AACA,SAAO;AACT;AAEA,SAAS,8BACP,eACA,cACoB;AACpB,aAAW,YAAY,cAAc,YAAY;AAC/C,QAAI,CAAC,GAAG,qBAAqB,QAAQ,EAAG;AACxC,UAAM,OAAO,GAAG,aAAa,SAAS,IAAI,IACtC,SAAS,KAAK,OACd,GAAG,oBAAoB,SAAS,IAAI,IAClC,SAAS,KAAK,OACd;AACN,QAAI,SAAS,aAAc;AAC3B,QAAI,GAAG,oBAAoB,SAAS,WAAW,EAAG,QAAO,SAAS,YAAY;AAC9E,WAAO;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sC;AACtC,QAAM,SAA+C,CAAC;AACtD,aAAW,YAAY,OAAO,KAAK,aAAa,EAAE,KAAK,CAAC,GAAG,MAAO,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAE,GAAG;AAC9F,WAAO,QAAQ,IAAI,uBAAuB,cAAc,QAAQ,CAAC;AAAA,EACnE;AACA,SAAO;AACT;AAEO,SAAS,sBAAsB,eAAoD;AACxF,SAAO,GAAG,KAAK,UAAU,2BAA2B,aAAa,GAAG,MAAM,CAAC,CAAC;AAAA;AAC9E;AAgBO,SAAS,sBAAsB,SAAoE;AACxG,QAAM,YAAY,QAAQ,aAAa;AACvC,QAAM,gBAA6C,CAAC;AACpD,QAAM,mBAA2C,CAAC;AAClD,QAAM,WAAqB,CAAC;AAC5B,aAAW,YAAY,WAAW;AAChC,UAAM,QAAQ,mBAAmB;AAAA,MAC/B;AAAA,MACA,aAAa,QAAQ;AAAA,MACrB,aAAa,QAAQ,eAAe;AAAA,MACpC,cAAc,QAAQ,gBAAgB;AAAA,MACtC,gBAAgB,QAAQ,kBAAkB;AAAA,IAC5C,CAAC;AACD,kBAAc,QAAQ,IAAI;AAC1B,qBAAiB,QAAQ,IAAI,0BAA0B,KAAK;AAC5D,aAAS,KAAK,GAAG,MAAM,QAAQ;AAAA,EACjC;AACA,SAAO,EAAE,eAAe,kBAAkB,SAAS;AACrD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/mercato.js
CHANGED
|
@@ -554,7 +554,8 @@ async function runGeneratorSuite(quiet) {
|
|
|
554
554
|
generateModuleEntities,
|
|
555
555
|
generateModuleDi,
|
|
556
556
|
generateModulePackageSources,
|
|
557
|
-
generateOpenApi
|
|
557
|
+
generateOpenApi,
|
|
558
|
+
generateModuleFacts
|
|
558
559
|
} = await import("./lib/generators/index.js");
|
|
559
560
|
const resolver = createResolver();
|
|
560
561
|
await generateEntityIds({ resolver, quiet });
|
|
@@ -565,6 +566,7 @@ async function runGeneratorSuite(quiet) {
|
|
|
565
566
|
await generateModuleDi({ resolver, quiet });
|
|
566
567
|
await generateModulePackageSources({ resolver, quiet });
|
|
567
568
|
await generateOpenApi({ resolver, quiet });
|
|
569
|
+
await generateModuleFacts({ resolver, quiet });
|
|
568
570
|
}
|
|
569
571
|
function createGenerateWatchChecksumFn() {
|
|
570
572
|
return async () => {
|