@open-mercato/cli 0.10.1-develop.7808.1.8128cefd28 → 0.10.1-develop.7811.1.66050c1838
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agentic/guides/module-facts.json +162 -162
- package/dist/agentic/guides/module-facts.v2.json +162 -162
- package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
- package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
- package/dist/agentic/guides/modules/api_docs/index.md +1 -1
- package/dist/agentic/guides/modules/api_keys/index.md +1 -1
- package/dist/agentic/guides/modules/attachments/index.md +1 -1
- package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
- package/dist/agentic/guides/modules/auth/index.md +1 -1
- package/dist/agentic/guides/modules/availability/index.md +1 -1
- package/dist/agentic/guides/modules/business_rules/index.md +1 -1
- package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
- package/dist/agentic/guides/modules/cart/index.md +1 -1
- package/dist/agentic/guides/modules/catalog/index.md +1 -1
- package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
- package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
- package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
- package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
- package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
- package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
- package/dist/agentic/guides/modules/channel_smtp/index.md +1 -1
- package/dist/agentic/guides/modules/checkout/index.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
- package/dist/agentic/guides/modules/configs/index.md +1 -1
- package/dist/agentic/guides/modules/content/index.md +1 -1
- package/dist/agentic/guides/modules/currencies/index.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
- package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
- package/dist/agentic/guides/modules/customers/index.md +1 -1
- package/dist/agentic/guides/modules/dashboards/index.md +1 -1
- package/dist/agentic/guides/modules/data_sync/index.md +1 -1
- package/dist/agentic/guides/modules/design_system/index.md +1 -1
- package/dist/agentic/guides/modules/devices/index.md +1 -1
- package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
- package/dist/agentic/guides/modules/directory/index.md +1 -1
- package/dist/agentic/guides/modules/documents/index.md +1 -1
- package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
- package/dist/agentic/guides/modules/entities/index.md +1 -1
- package/dist/agentic/guides/modules/eudr/index.md +1 -1
- package/dist/agentic/guides/modules/events/index.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
- package/dist/agentic/guides/modules/forms/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_autopay/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
- package/dist/agentic/guides/modules/generators/index.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
- package/dist/agentic/guides/modules/integrations/index.md +1 -1
- package/dist/agentic/guides/modules/messages/index.md +1 -1
- package/dist/agentic/guides/modules/notifications/index.md +1 -1
- package/dist/agentic/guides/modules/onboarding/index.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
- package/dist/agentic/guides/modules/perspectives/index.md +1 -1
- package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
- package/dist/agentic/guides/modules/planner/index.md +1 -1
- package/dist/agentic/guides/modules/portal/index.md +1 -1
- package/dist/agentic/guides/modules/progress/index.md +1 -1
- package/dist/agentic/guides/modules/promotions/index.md +1 -1
- package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
- package/dist/agentic/guides/modules/query_index/index.md +1 -1
- package/dist/agentic/guides/modules/record_locks/index.md +1 -1
- package/dist/agentic/guides/modules/resources/index.md +1 -1
- package/dist/agentic/guides/modules/sales/index.md +1 -1
- package/dist/agentic/guides/modules/scheduler/index.md +1 -1
- package/dist/agentic/guides/modules/search/index.md +1 -1
- package/dist/agentic/guides/modules/security/index.md +1 -1
- package/dist/agentic/guides/modules/seeds/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
- package/dist/agentic/guides/modules/sso/index.md +1 -1
- package/dist/agentic/guides/modules/staff/index.md +1 -1
- package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
- package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
- package/dist/agentic/guides/modules/telemetry/index.md +1 -1
- package/dist/agentic/guides/modules/tillio/index.md +1 -1
- package/dist/agentic/guides/modules/translations/index.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
- package/dist/agentic/guides/modules/webhooks/index.md +1 -1
- package/dist/agentic/guides/modules/wms/index.md +1 -1
- package/dist/agentic/guides/modules/workflows/index.md +1 -1
- package/dist/agentic/guides/reference-module-facts.json +1 -1
- package/dist/agentic/guides/upstream/manifest.json +1 -1
- package/dist/lib/generators/ast/imports.js +9 -4
- package/dist/lib/generators/ast/imports.js.map +2 -2
- package/dist/lib/generators/entity-ids.js +10 -12
- package/dist/lib/generators/entity-ids.js.map +2 -2
- package/dist/lib/generators/module-di.js +6 -9
- package/dist/lib/generators/module-di.js.map +2 -2
- package/dist/lib/generators/module-entities.js +6 -9
- package/dist/lib/generators/module-entities.js.map +2 -2
- package/package.json +7 -7
- package/src/lib/generators/ast/imports.ts +14 -4
- package/src/lib/generators/entity-ids.ts +10 -12
- package/src/lib/generators/module-di.ts +6 -9
- package/src/lib/generators/module-entities.ts +6 -9
|
@@ -60,10 +60,17 @@ export function addImportSpec(sourceFile: SourceFile, spec: GeneratedImportSpec)
|
|
|
60
60
|
})
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Inserts every import in one ts-morph manipulation. Each `addImportDeclaration` call
|
|
65
|
+
* re-prints and re-parses the whole source file, so adding registry imports one by one is
|
|
66
|
+
* quadratic in the import count and dominated `mercato generate` peak memory.
|
|
67
|
+
*/
|
|
63
68
|
export function addImportSpecs(sourceFile: SourceFile, specs: GeneratedImportSpec[]): void {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
if (specs.length === 0) return
|
|
70
|
+
sourceFile.addImportDeclarations(specs.map((spec) => ({
|
|
71
|
+
kind: StructureKind.ImportDeclaration,
|
|
72
|
+
...spec,
|
|
73
|
+
})))
|
|
67
74
|
}
|
|
68
75
|
|
|
69
76
|
export function addImportStatement(sourceFile: SourceFile, statement: string): void {
|
|
@@ -73,7 +80,10 @@ export function addImportStatement(sourceFile: SourceFile, statement: string): v
|
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
export function addImportStatements(sourceFile: SourceFile, statements: string[]): void {
|
|
83
|
+
const specs: GeneratedImportSpec[] = []
|
|
76
84
|
for (const statement of statements) {
|
|
77
|
-
|
|
85
|
+
const trimmed = statement.trim()
|
|
86
|
+
if (trimmed) specs.push(toImportSpec(trimmed))
|
|
78
87
|
}
|
|
88
|
+
addImportSpecs(sourceFile, specs)
|
|
79
89
|
}
|
|
@@ -260,18 +260,16 @@ function writePerEntityFieldFiles(
|
|
|
260
260
|
const entDir = path.join(outRoot, entity)
|
|
261
261
|
fs.mkdirSync(entDir, { recursive: true })
|
|
262
262
|
const sourceFile = createGeneratedSourceFile(`${entity}/index.ts`)
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
})
|
|
274
|
-
}
|
|
263
|
+
sourceFile.addVariableStatements(fields.map((field) => ({
|
|
264
|
+
declarationKind: VariableDeclarationKind.Const,
|
|
265
|
+
isExported: true,
|
|
266
|
+
declarations: [
|
|
267
|
+
{
|
|
268
|
+
name: toVar(field),
|
|
269
|
+
initializer: JSON.stringify(field),
|
|
270
|
+
},
|
|
271
|
+
],
|
|
272
|
+
})))
|
|
275
273
|
writeTrackedFile(path.join(entDir, 'index.ts'), getSourceText(sourceFile), result)
|
|
276
274
|
}
|
|
277
275
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
|
-
import {
|
|
3
|
+
import { VariableDeclarationKind } from 'ts-morph'
|
|
4
4
|
import type { PackageResolver } from '../resolver'
|
|
5
5
|
import { MODULE_CODE_EXTENSIONS } from './scanner'
|
|
6
6
|
import {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from '../utils'
|
|
12
12
|
import {
|
|
13
13
|
addAutoGeneratedComment,
|
|
14
|
-
|
|
14
|
+
addImportSpecs,
|
|
15
15
|
arrayLiteral,
|
|
16
16
|
createGeneratedSourceFile,
|
|
17
17
|
getSourceText,
|
|
@@ -64,13 +64,10 @@ export async function generateModuleDi(options: ModuleDiOptions): Promise<Genera
|
|
|
64
64
|
|
|
65
65
|
const sourceFile = createGeneratedSourceFile('di.generated.ts')
|
|
66
66
|
addAutoGeneratedComment(sourceFile, 'di')
|
|
67
|
-
imports.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
moduleSpecifier: entry.moduleSpecifier,
|
|
72
|
-
})
|
|
73
|
-
})
|
|
67
|
+
addImportSpecs(sourceFile, imports.map((entry) => ({
|
|
68
|
+
namespaceImport: entry.name,
|
|
69
|
+
moduleSpecifier: entry.moduleSpecifier,
|
|
70
|
+
})))
|
|
74
71
|
sourceFile.addVariableStatement({
|
|
75
72
|
declarationKind: VariableDeclarationKind.Const,
|
|
76
73
|
declarations: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
|
-
import {
|
|
3
|
+
import { VariableDeclarationKind } from 'ts-morph'
|
|
4
4
|
import {
|
|
5
5
|
findDuplicateEntityClassNames,
|
|
6
6
|
formatDuplicateEntityClassNamesWarning,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '../utils'
|
|
18
18
|
import {
|
|
19
19
|
addAutoGeneratedComment,
|
|
20
|
-
|
|
20
|
+
addImportSpecs,
|
|
21
21
|
asExpression,
|
|
22
22
|
arrayLiteral,
|
|
23
23
|
arrowFunction,
|
|
@@ -110,13 +110,10 @@ export async function generateModuleEntities(options: ModuleEntitiesOptions): Pr
|
|
|
110
110
|
|
|
111
111
|
const sourceFile = createGeneratedSourceFile('entities.generated.ts')
|
|
112
112
|
addAutoGeneratedComment(sourceFile, 'entities')
|
|
113
|
-
imports.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
moduleSpecifier: entry.moduleSpecifier,
|
|
118
|
-
})
|
|
119
|
-
})
|
|
113
|
+
addImportSpecs(sourceFile, imports.map((entry) => ({
|
|
114
|
+
namespaceImport: entry.name,
|
|
115
|
+
moduleSpecifier: entry.moduleSpecifier,
|
|
116
|
+
})))
|
|
120
117
|
sourceFile.addFunction({
|
|
121
118
|
name: 'enhanceEntities',
|
|
122
119
|
parameters: [
|