@open-mercato/cli 0.6.7-develop.6552.1.5208a19369 → 0.6.7-develop.6565.1.1026d85fff
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 +3 -3
- package/AGENTS.md +1 -0
- package/dist/agentic/guides/module-facts.json +53 -53
- package/dist/agentic/guides/modules/ai_assistant.md +1 -1
- package/dist/agentic/guides/modules/api_docs.md +1 -1
- package/dist/agentic/guides/modules/api_keys.md +1 -1
- package/dist/agentic/guides/modules/attachments.md +1 -1
- package/dist/agentic/guides/modules/audit_logs.md +1 -1
- package/dist/agentic/guides/modules/auth.md +1 -1
- package/dist/agentic/guides/modules/business_rules.md +1 -1
- package/dist/agentic/guides/modules/catalog.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail.md +1 -1
- package/dist/agentic/guides/modules/channel_imap.md +1 -1
- package/dist/agentic/guides/modules/checkout.md +1 -1
- package/dist/agentic/guides/modules/communication_channels.md +1 -1
- package/dist/agentic/guides/modules/configs.md +1 -1
- package/dist/agentic/guides/modules/content.md +1 -1
- package/dist/agentic/guides/modules/currencies.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts.md +1 -1
- package/dist/agentic/guides/modules/customers.md +1 -1
- package/dist/agentic/guides/modules/dashboards.md +1 -1
- package/dist/agentic/guides/modules/data_sync.md +1 -1
- package/dist/agentic/guides/modules/dictionaries.md +1 -1
- package/dist/agentic/guides/modules/directory.md +1 -1
- package/dist/agentic/guides/modules/entities.md +1 -1
- package/dist/agentic/guides/modules/events.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe.md +1 -1
- package/dist/agentic/guides/modules/generators.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops.md +1 -1
- package/dist/agentic/guides/modules/integrations.md +1 -1
- package/dist/agentic/guides/modules/messages.md +1 -1
- package/dist/agentic/guides/modules/notifications.md +1 -1
- package/dist/agentic/guides/modules/onboarding.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways.md +1 -1
- package/dist/agentic/guides/modules/perspectives.md +1 -1
- package/dist/agentic/guides/modules/planner.md +1 -1
- package/dist/agentic/guides/modules/portal.md +1 -1
- package/dist/agentic/guides/modules/progress.md +1 -1
- package/dist/agentic/guides/modules/query_index.md +1 -1
- package/dist/agentic/guides/modules/record_locks.md +1 -1
- package/dist/agentic/guides/modules/resources.md +1 -1
- package/dist/agentic/guides/modules/sales.md +1 -1
- package/dist/agentic/guides/modules/scheduler.md +1 -1
- package/dist/agentic/guides/modules/search.md +1 -1
- package/dist/agentic/guides/modules/security.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers.md +1 -1
- package/dist/agentic/guides/modules/sso.md +1 -1
- package/dist/agentic/guides/modules/staff.md +1 -1
- package/dist/agentic/guides/modules/storage_s3.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo.md +1 -1
- package/dist/agentic/guides/modules/sync_excel.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays.md +1 -1
- package/dist/agentic/guides/modules/translations.md +1 -1
- package/dist/agentic/guides/modules/webhooks.md +1 -1
- package/dist/agentic/guides/modules/workflows.md +1 -1
- package/dist/agentic/shared/AGENTS.md.template +1 -1
- package/dist/agentic/shared/ai/skills/tiers.schema.json +15 -0
- package/dist/agentic/shared/scripts/install-skills.sh +244 -37
- package/dist/lib/__integration__/TC-INT-008.spec.js +9 -11
- package/dist/lib/__integration__/TC-INT-008.spec.js.map +2 -2
- package/dist/lib/agentic-setup.js +14 -2
- package/dist/lib/agentic-setup.js.map +2 -2
- package/dist/lib/generate-watch-events.js +106 -0
- package/dist/lib/generate-watch-events.js.map +7 -0
- package/dist/lib/generators/entity-ids.js +20 -13
- package/dist/lib/generators/entity-ids.js.map +2 -2
- package/dist/lib/generators/openapi.js +114 -12
- package/dist/lib/generators/openapi.js.map +2 -2
- package/dist/lib/in-process-generate-watcher.js +13 -2
- package/dist/lib/in-process-generate-watcher.js.map +2 -2
- package/dist/mercato.js +68 -23
- package/dist/mercato.js.map +2 -2
- package/package.json +5 -5
- package/src/__tests__/mercato.test.ts +53 -2
- package/src/lib/__integration__/TC-INT-008.spec.ts +15 -15
- package/src/lib/__tests__/generate-watch-events.test.ts +112 -0
- package/src/lib/__tests__/generate-watch-structure.test.ts +20 -0
- package/src/lib/__tests__/in-process-generate-watcher.test.ts +193 -2
- package/src/lib/agentic-setup.ts +23 -4
- package/src/lib/generate-watch-events.ts +125 -0
- package/src/lib/generators/__tests__/entity-ids.test.ts +98 -1
- package/src/lib/generators/__tests__/openapi.test.ts +174 -0
- package/src/lib/generators/entity-ids.ts +33 -13
- package/src/lib/generators/openapi.ts +167 -14
- package/src/lib/in-process-generate-watcher.ts +35 -6
- package/src/mercato.ts +75 -27
package/dist/mercato.js
CHANGED
|
@@ -565,29 +565,75 @@ async function runGeneratorSuite(quiet) {
|
|
|
565
565
|
generateOpenApi
|
|
566
566
|
} = await import("./lib/generators/index.js");
|
|
567
567
|
const resolver = createResolver();
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
568
|
+
const results = [
|
|
569
|
+
await generateEntityIds({ resolver, quiet }),
|
|
570
|
+
await generateModuleRegistry({ resolver, quiet }),
|
|
571
|
+
await generateModuleRegistryApp({ resolver, quiet }),
|
|
572
|
+
await generateModuleRegistryCli({ resolver, quiet }),
|
|
573
|
+
await generateModuleEntities({ resolver, quiet }),
|
|
574
|
+
await generateModuleDi({ resolver, quiet }),
|
|
575
|
+
await generateModulePackageSources({ resolver, quiet }),
|
|
576
|
+
await generateOpenApi({ resolver, quiet })
|
|
577
|
+
];
|
|
578
|
+
return results.some((result) => (result?.filesWritten.length ?? 0) > 0);
|
|
576
579
|
}
|
|
577
|
-
function
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
580
|
+
async function runGeneratorSuiteWithStructuralInvalidation(quiet) {
|
|
581
|
+
const generatedFilesChanged = await runGeneratorSuite(quiet);
|
|
582
|
+
if (!generatedFilesChanged) {
|
|
583
|
+
if (!quiet) {
|
|
584
|
+
console.log("[generate] Generated outputs unchanged; skipping structural cache purge.");
|
|
585
|
+
}
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
await runPostGenerateStructuralCachePurge(quiet);
|
|
589
|
+
}
|
|
590
|
+
async function createGenerateWatchRuntime() {
|
|
591
|
+
const [
|
|
592
|
+
{ createResolver },
|
|
593
|
+
{ calculateGenerateWatchStructureChecksum },
|
|
594
|
+
{ createGenerateWatchChangeSignal },
|
|
595
|
+
{ resolveStandaloneSourceMirrorBase }
|
|
596
|
+
] = await Promise.all([
|
|
597
|
+
import("./lib/resolver.js"),
|
|
598
|
+
import("./lib/generate-watch-structure.js"),
|
|
599
|
+
import("./lib/generate-watch-events.js"),
|
|
600
|
+
import("./lib/generators/scanner.js")
|
|
601
|
+
]);
|
|
602
|
+
const collectWatchState = () => {
|
|
581
603
|
const resolver = createResolver();
|
|
582
604
|
const moduleRoots = [];
|
|
583
605
|
for (const entry of resolver.loadEnabledModules()) {
|
|
584
606
|
const roots = resolver.getModulePaths(entry);
|
|
585
607
|
moduleRoots.push({ appBase: roots.appBase, pkgBase: roots.pkgBase });
|
|
586
608
|
}
|
|
587
|
-
return
|
|
588
|
-
modulesFile:
|
|
609
|
+
return {
|
|
610
|
+
modulesFile: resolver.getModulesConfigPath(),
|
|
589
611
|
moduleRoots
|
|
590
|
-
}
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
return {
|
|
615
|
+
computeStructureChecksum: async () => {
|
|
616
|
+
return calculateGenerateWatchStructureChecksum(collectWatchState());
|
|
617
|
+
},
|
|
618
|
+
changeSignal: createGenerateWatchChangeSignal({
|
|
619
|
+
getWatchTargets: () => {
|
|
620
|
+
const state = collectWatchState();
|
|
621
|
+
const targets = [{
|
|
622
|
+
directory: path.dirname(state.modulesFile),
|
|
623
|
+
recursive: false,
|
|
624
|
+
fileName: path.basename(state.modulesFile)
|
|
625
|
+
}];
|
|
626
|
+
for (const roots of state.moduleRoots) {
|
|
627
|
+
targets.push({ directory: path.dirname(roots.appBase), recursive: true });
|
|
628
|
+
targets.push({ directory: path.dirname(roots.pkgBase), recursive: true });
|
|
629
|
+
const sourceMirror = resolveStandaloneSourceMirrorBase(roots.pkgBase);
|
|
630
|
+
if (sourceMirror) {
|
|
631
|
+
targets.push({ directory: path.dirname(sourceMirror), recursive: true });
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
return targets;
|
|
635
|
+
}
|
|
636
|
+
})
|
|
591
637
|
};
|
|
592
638
|
}
|
|
593
639
|
async function buildAllModules() {
|
|
@@ -1425,8 +1471,7 @@ async function run(argv = process.argv) {
|
|
|
1425
1471
|
run: async (args) => {
|
|
1426
1472
|
const quiet = args.includes("--quiet") || args.includes("-q");
|
|
1427
1473
|
console.log("Running all generators...");
|
|
1428
|
-
await
|
|
1429
|
-
await runPostGenerateStructuralCachePurge(quiet);
|
|
1474
|
+
await runGeneratorSuiteWithStructuralInvalidation(quiet);
|
|
1430
1475
|
console.log("All generators completed.");
|
|
1431
1476
|
}
|
|
1432
1477
|
},
|
|
@@ -1438,14 +1483,14 @@ async function run(argv = process.argv) {
|
|
|
1438
1483
|
const intervalArg = args.find((arg) => arg.startsWith("--interval="));
|
|
1439
1484
|
const parsedInterval = intervalArg ? Number.parseInt(intervalArg.split("=")[1] ?? "", 10) : NaN;
|
|
1440
1485
|
const intervalMs = Number.isFinite(parsedInterval) && parsedInterval >= 250 ? parsedInterval : 1e3;
|
|
1486
|
+
const generateWatchRuntime = await createGenerateWatchRuntime();
|
|
1441
1487
|
const watcher = startInProcessGenerateWatcher({
|
|
1442
1488
|
pollMs: intervalMs,
|
|
1443
1489
|
skipInitial,
|
|
1444
1490
|
quiet,
|
|
1445
|
-
|
|
1491
|
+
...generateWatchRuntime,
|
|
1446
1492
|
runGenerators: async () => {
|
|
1447
|
-
await
|
|
1448
|
-
await runPostGenerateStructuralCachePurge(true);
|
|
1493
|
+
await runGeneratorSuiteWithStructuralInvalidation(true);
|
|
1449
1494
|
}
|
|
1450
1495
|
});
|
|
1451
1496
|
const shutdownSignals = ["SIGINT", "SIGTERM"];
|
|
@@ -1813,6 +1858,7 @@ async function run(argv = process.argv) {
|
|
|
1813
1858
|
});
|
|
1814
1859
|
if (generateWatcherMode === "in-process") {
|
|
1815
1860
|
console.log("[server] In-process generate watcher enabled \u2014 structural changes will regenerate without a sidecar process.");
|
|
1861
|
+
const generateWatchRuntime = await createGenerateWatchRuntime();
|
|
1816
1862
|
activeGenerateWatcher = startInProcessGenerateWatcher({
|
|
1817
1863
|
// `--skip-initial` equivalent: `yarn dev` always runs an
|
|
1818
1864
|
// initial `mercato generate` before reaching the server
|
|
@@ -1821,10 +1867,9 @@ async function run(argv = process.argv) {
|
|
|
1821
1867
|
// twice in a row.
|
|
1822
1868
|
skipInitial: true,
|
|
1823
1869
|
quiet: false,
|
|
1824
|
-
|
|
1870
|
+
...generateWatchRuntime,
|
|
1825
1871
|
runGenerators: async () => {
|
|
1826
|
-
await
|
|
1827
|
-
await runPostGenerateStructuralCachePurge(true);
|
|
1872
|
+
await runGeneratorSuiteWithStructuralInvalidation(true);
|
|
1828
1873
|
}
|
|
1829
1874
|
});
|
|
1830
1875
|
} else {
|