@open-mercato/cli 0.9.1-develop.7477.1.64ba865101 → 0.9.1-develop.7497.1.543ea44c40
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 +172 -172
- package/dist/agentic/guides/module-facts.v2.json +172 -172
- 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/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/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/active-extension-bindings.md +4 -4
- 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/di-registrations-rich.md +8 -8
- package/dist/agentic/guides/modules/data_sync/di-service-tokens.md +4 -4
- package/dist/agentic/guides/modules/data_sync/exact-override-targets.md +8 -8
- 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_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/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/BACKWARD_COMPATIBILITY.md +4 -0
- package/dist/agentic/guides/upstream/manifest.json +2 -2
- package/dist/mercato.js +71 -5
- package/dist/mercato.js.map +2 -2
- package/package.json +7 -7
- package/src/__tests__/mercato.test.ts +260 -0
- package/src/mercato.ts +87 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# resources — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/resources
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sales — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/sales
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# scheduler — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/scheduler 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/scheduler 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/scheduler/src/modules/scheduler
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# search — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/search 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/search 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/search/src/modules/search
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# security — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/enterprise 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/enterprise 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/enterprise/src/modules/security
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# seeds — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/seeds
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# shipping_carriers — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/shipping_carriers
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sso — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/enterprise 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/enterprise 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/enterprise/src/modules/sso
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# staff — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/staff
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# storage_s3 — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/storage-s3 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/storage-s3 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/storage-s3/src/modules/storage_s3
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sync_akeneo — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/sync-akeneo 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/sync-akeneo 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/sync-akeneo/src/modules/sync_akeneo
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sync_excel — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/sync_excel
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# system_status_overlays — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/enterprise 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/enterprise 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/enterprise/src/modules/system_status_overlays
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# telemetry — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/telemetry 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/telemetry 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/telemetry/src/modules/telemetry
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# tillio — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/tillio 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/tillio 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/tillio/src/modules/tillio
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# translations — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/translations
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# warranty_claims — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/warranty_claims
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# webhooks — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/webhooks 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/webhooks 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/webhooks/src/modules/webhooks
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# wms — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/wms
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# workflows — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.9.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.9.1-develop.7497.1.543ea44c40; core 0.9.1-develop.7497.1.543ea44c40 — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/workflows
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1185,7 +1185,7 @@
|
|
|
1185
1185
|
"facts": {
|
|
1186
1186
|
"title": "Example Module",
|
|
1187
1187
|
"description": "Demonstrates pages, APIs, entities and DI.",
|
|
1188
|
-
"coreVersion": "0.9.1-develop.
|
|
1188
|
+
"coreVersion": "0.9.1-develop.7497.1.543ea44c40",
|
|
1189
1189
|
"sourcePackage": null,
|
|
1190
1190
|
"sourceVersion": null,
|
|
1191
1191
|
"sourceRoot": "src/modules/example",
|
|
@@ -557,3 +557,7 @@ Spec: [`.ai/specs/2026-09-08-error-reporting-policy.md`](.ai/specs/2026-09-08-er
|
|
|
557
557
|
| Database schema, event IDs, ACL features, DI names, CLI commands | No change | ✓ n/a |
|
|
558
558
|
|
|
559
559
|
**Migration path for existing modules**: send `parentId: null` / `childIds: []` where clearing is intended. Trees flattened before the upgrade are not repaired (see UPGRADE_NOTES.md).
|
|
560
|
+
|
|
561
|
+
## Discord AI Proposals (2026-10-13)
|
|
562
|
+
|
|
563
|
+
[Waiver](UPGRADE_NOTES.md#discord-proposals)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"generator": "@open-mercato/cli@0.9.1-develop.
|
|
3
|
+
"generator": "@open-mercato/cli@0.9.1-develop.7497.1.543ea44c40",
|
|
4
4
|
"files": {
|
|
5
5
|
"AGENTS.md": "9fdaca247f55c64f5966cc103265cfb03233e0532f58f14aff538ae18aa3555d",
|
|
6
|
-
"BACKWARD_COMPATIBILITY.md": "
|
|
6
|
+
"BACKWARD_COMPATIBILITY.md": "02d20617e0a3dfd578bd1f7514eb4a15034c60423f4e24056dbe51f9330f756e"
|
|
7
7
|
}
|
|
8
8
|
}
|
package/dist/mercato.js
CHANGED
|
@@ -233,7 +233,11 @@ async function ensureEnvLoaded(options = {}) {
|
|
|
233
233
|
const examplePath = path.join(appDir, ".env.example");
|
|
234
234
|
if (fs.existsSync(examplePath)) {
|
|
235
235
|
fs.copyFileSync(examplePath, envPath);
|
|
236
|
-
console.log(
|
|
236
|
+
console.log("");
|
|
237
|
+
console.log("\u26A0\uFE0F No .env was found, so one was created from .env.example.");
|
|
238
|
+
console.log(` ${envPath}`);
|
|
239
|
+
console.log(" It carries the example placeholders \u2014 review DATABASE_URL and secrets before continuing.");
|
|
240
|
+
console.log("");
|
|
237
241
|
}
|
|
238
242
|
}
|
|
239
243
|
if (fs.existsSync(envPath)) {
|
|
@@ -656,13 +660,53 @@ async function buildAllModules() {
|
|
|
656
660
|
if (appCli.length) all.push({ id: "app", cli: appCli });
|
|
657
661
|
return all;
|
|
658
662
|
}
|
|
663
|
+
function isHelpRequest(args) {
|
|
664
|
+
return args.some((arg) => arg === "--help" || arg === "-h");
|
|
665
|
+
}
|
|
666
|
+
const TOP_LEVEL_COMMAND_HELP = {
|
|
667
|
+
init: [
|
|
668
|
+
"Usage: mercato init [--reinstall|-r] [--no-examples] [--stresstest [--lite] [--count=<n>]]",
|
|
669
|
+
"Initializes this app: installs dependencies, runs generators, applies migrations and seeds data."
|
|
670
|
+
],
|
|
671
|
+
"agentic:init": [
|
|
672
|
+
"Usage: mercato agentic:init [--force]",
|
|
673
|
+
"Scaffolds the agentic harness (AGENTS.md, .ai/ config and skills) into this app."
|
|
674
|
+
],
|
|
675
|
+
"seed:defaults": [
|
|
676
|
+
"Usage: mercato seed:defaults [--module <moduleId>]",
|
|
677
|
+
"Runs every enabled module's seedDefaults hook, or only the named module's."
|
|
678
|
+
],
|
|
679
|
+
"umes:list": [
|
|
680
|
+
"Usage: mercato umes:list",
|
|
681
|
+
"Lists the extension points every enabled module declares."
|
|
682
|
+
],
|
|
683
|
+
"umes:inspect": [
|
|
684
|
+
"Usage: mercato umes:inspect --module <moduleId>",
|
|
685
|
+
"Prints the extension surface a single module declares."
|
|
686
|
+
],
|
|
687
|
+
"umes:check": [
|
|
688
|
+
"Usage: mercato umes:check",
|
|
689
|
+
"Validates declared extension points against the modules that implement them."
|
|
690
|
+
]
|
|
691
|
+
};
|
|
692
|
+
function resolveEnvBootstrapOptions(parts) {
|
|
693
|
+
const first = parts[0];
|
|
694
|
+
const opaqueEnvCommand = first === "deploy" || first === "telemetry";
|
|
695
|
+
const helpRequested = isHelpRequest(parts);
|
|
696
|
+
return {
|
|
697
|
+
createIfMissing: !helpRequested && !opaqueEnvCommand,
|
|
698
|
+
quiet: helpRequested || opaqueEnvCommand
|
|
699
|
+
};
|
|
700
|
+
}
|
|
659
701
|
async function run(argv = process.argv) {
|
|
660
702
|
const [, , ...parts] = argv;
|
|
661
703
|
const [first, second, ...remaining] = parts;
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
});
|
|
704
|
+
const helpRequested = isHelpRequest(parts);
|
|
705
|
+
await ensureEnvLoaded(resolveEnvBootstrapOptions(parts));
|
|
706
|
+
if (helpRequested && first && Object.hasOwn(TOP_LEVEL_COMMAND_HELP, first)) {
|
|
707
|
+
for (const line of TOP_LEVEL_COMMAND_HELP[first]) console.log(` ${line}`);
|
|
708
|
+
return 0;
|
|
709
|
+
}
|
|
666
710
|
if (first === "init") {
|
|
667
711
|
const { execSync } = await import("child_process");
|
|
668
712
|
console.log("\u{1F680} Initializing Open Mercato app...\n");
|
|
@@ -1297,6 +1341,8 @@ async function run(argv = process.argv) {
|
|
|
1297
1341
|
cli: [
|
|
1298
1342
|
{
|
|
1299
1343
|
command: "railway",
|
|
1344
|
+
// Parses --help/-h itself and prints railwayDeployHelp() without deploying.
|
|
1345
|
+
handlesHelp: true,
|
|
1300
1346
|
run: async (args) => {
|
|
1301
1347
|
const { runRailwayDeploy } = await import("./lib/deploy/railway/index.js");
|
|
1302
1348
|
await runRailwayDeploy(args);
|
|
@@ -1600,6 +1646,7 @@ async function run(argv = process.argv) {
|
|
|
1600
1646
|
cli: [
|
|
1601
1647
|
{
|
|
1602
1648
|
command: "generate",
|
|
1649
|
+
help: "Generates a migration per module from the current ORM entities and refreshes each\nmodule's .snapshot-open-mercato.json. Writes files only \u2014 nothing is applied.",
|
|
1603
1650
|
run: async () => {
|
|
1604
1651
|
const { createResolver } = await import("./lib/resolver.js");
|
|
1605
1652
|
const { dbGenerate } = await import("./lib/db/index.js");
|
|
@@ -1609,6 +1656,7 @@ async function run(argv = process.argv) {
|
|
|
1609
1656
|
},
|
|
1610
1657
|
{
|
|
1611
1658
|
command: "migrate",
|
|
1659
|
+
help: "Applies every pending migration to the database DATABASE_URL points at.\nThis mutates the database \u2014 check .env before running it.",
|
|
1612
1660
|
run: async () => {
|
|
1613
1661
|
const { createResolver } = await import("./lib/resolver.js");
|
|
1614
1662
|
const { dbMigrate } = await import("./lib/db/index.js");
|
|
@@ -1618,6 +1666,7 @@ async function run(argv = process.argv) {
|
|
|
1618
1666
|
},
|
|
1619
1667
|
{
|
|
1620
1668
|
command: "greenfield",
|
|
1669
|
+
help: "Drops and recreates the schema from scratch, then re-applies every migration.\nDestroys all data. Pass --yes (-y) to skip the confirmation prompt.",
|
|
1621
1670
|
run: async (args) => {
|
|
1622
1671
|
const { createResolver } = await import("./lib/resolver.js");
|
|
1623
1672
|
const { dbGreenfield } = await import("./lib/db/index.js");
|
|
@@ -2170,11 +2219,26 @@ async function run(argv = process.argv) {
|
|
|
2170
2219
|
console.log(pad(`Commands for "${modName}": ${mod.cli.map((c) => c.command).join(", ")}`));
|
|
2171
2220
|
return 1;
|
|
2172
2221
|
}
|
|
2222
|
+
if (isHelpRequest([cmdName])) {
|
|
2223
|
+
console.log(pad(`Usage: \u2728 mercato ${modName} <command> [args]`));
|
|
2224
|
+
console.log(pad(`Commands for "${modName}": ${mod.cli.map((c) => c.command).join(", ")}`));
|
|
2225
|
+
return 0;
|
|
2226
|
+
}
|
|
2173
2227
|
const cmd = mod.cli.find((c) => c.command === cmdName);
|
|
2174
2228
|
if (!cmd) {
|
|
2175
2229
|
console.error(`\u{1F914} Unknown command "${cmdName}". Available: ${mod.cli.map((c) => c.command).join(", ")}`);
|
|
2176
2230
|
return 1;
|
|
2177
2231
|
}
|
|
2232
|
+
if (isHelpRequest(rest) && !cmd.handlesHelp) {
|
|
2233
|
+
console.log(pad(`Usage: \u2728 mercato ${modName} ${cmdName} [args]`));
|
|
2234
|
+
if (cmd.help) {
|
|
2235
|
+
console.log("");
|
|
2236
|
+
for (const line of cmd.help.split("\n")) console.log(pad(line));
|
|
2237
|
+
}
|
|
2238
|
+
console.log("");
|
|
2239
|
+
console.log(pad(`Commands for "${modName}": ${mod.cli.map((c) => c.command).join(", ")}`));
|
|
2240
|
+
return 0;
|
|
2241
|
+
}
|
|
2178
2242
|
console.log("");
|
|
2179
2243
|
const started = Date.now();
|
|
2180
2244
|
const loggedArgs = modName === "deploy" && cmdName === "railway" ? (await import("./lib/deploy/railway/options.js")).redactRailwayCliArgs(rest) : rest;
|
|
@@ -2194,8 +2258,10 @@ async function run(argv = process.argv) {
|
|
|
2194
2258
|
export {
|
|
2195
2259
|
getCliModules,
|
|
2196
2260
|
hasCliModules,
|
|
2261
|
+
isHelpRequest,
|
|
2197
2262
|
padByCodePointWidth,
|
|
2198
2263
|
registerCliModules,
|
|
2264
|
+
resolveEnvBootstrapOptions,
|
|
2199
2265
|
resolveQueueAbandonHook,
|
|
2200
2266
|
run
|
|
2201
2267
|
};
|