@open-mercato/cli 0.10.1-develop.7758.1.fb3a60392f → 0.10.1-develop.7759.1.416727583e
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 +1 -1
- 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/module-search-args.js +97 -0
- package/dist/lib/module-search-args.js.map +7 -0
- package/dist/lib/module-search-index.js +677 -0
- package/dist/lib/module-search-index.js.map +7 -0
- package/dist/lib/module-search.js +668 -0
- package/dist/lib/module-search.js.map +7 -0
- package/dist/lib/modules-config.js +5 -0
- package/dist/lib/modules-config.js.map +2 -2
- package/dist/mercato.js +13 -3
- package/dist/mercato.js.map +2 -2
- package/package.json +8 -7
- package/src/__tests__/mercato.test.ts +57 -0
- package/src/lib/__fixtures__/module-search/README.md +97 -0
- package/src/lib/__fixtures__/module-search/built-in.json +235 -0
- package/src/lib/__fixtures__/module-search/catalog-parity.json +4076 -0
- package/src/lib/__fixtures__/module-search/modules-index.json +1980 -0
- package/src/lib/__tests__/module-search.test.ts +929 -0
- package/src/lib/module-search-args.ts +116 -0
- package/src/lib/module-search-index.ts +1033 -0
- package/src/lib/module-search.ts +952 -0
- package/src/lib/modules-config.ts +8 -0
- package/src/mercato.ts +17 -3
|
@@ -455,6 +455,14 @@ function upsertModuleSource(objectLiteral: string, from: string): string {
|
|
|
455
455
|
return objectLiteral.replace(/\}\s*$/, `, from: '${escapeSingleQuotedString(from)}' }`)
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
+
export function readEnabledModules(modulesPath: string, env: NodeJS.ProcessEnv = process.env): ModuleEntry[] {
|
|
459
|
+
const source = fs.readFileSync(modulesPath, 'utf8')
|
|
460
|
+
// keeps only registrations whose condition holds; #8116 tags the others `active: false` instead of skipping them
|
|
461
|
+
return parseModuleConfigShape(source, env)
|
|
462
|
+
.occurrences.filter((occurrence) => !('active' in occurrence) || occurrence.active !== false)
|
|
463
|
+
.map((occurrence) => normalizeModuleEntry(occurrence.entry))
|
|
464
|
+
}
|
|
465
|
+
|
|
458
466
|
export class ModuleGatedOffError extends Error {
|
|
459
467
|
readonly code = 'MODULE_GATED_OFF'
|
|
460
468
|
|
package/src/mercato.ts
CHANGED
|
@@ -950,13 +950,18 @@ const TOP_LEVEL_COMMAND_HELP: Record<string, string[]> = {
|
|
|
950
950
|
|
|
951
951
|
// A help invocation must never materialize .env from .env.example — asking what the flags are
|
|
952
952
|
// should not mutate the working tree, least of all with the example's placeholder DATABASE_URL.
|
|
953
|
+
// `module search` and `module info` only read the catalog, so they never create .env either, and
|
|
954
|
+
// their output stays clean: dotenv prints its `injected env` line on stdout, which breaks
|
|
955
|
+
// `--json | jq` and agents that parse the tools@1 contract. Any `--json` run stays quiet.
|
|
953
956
|
export function resolveEnvBootstrapOptions(parts: string[]): { createIfMissing: boolean; quiet: boolean } {
|
|
954
957
|
const first = parts[0]
|
|
955
958
|
const opaqueEnvCommand = first === 'deploy' || first === 'telemetry'
|
|
959
|
+
const readOnlyModuleCommand = first === 'module' && (parts[1] === 'search' || parts[1] === 'info')
|
|
960
|
+
const jsonOutput = parts.includes('--json')
|
|
956
961
|
const helpRequested = isHelpRequest(parts)
|
|
957
962
|
return {
|
|
958
|
-
createIfMissing: !helpRequested && !opaqueEnvCommand,
|
|
959
|
-
quiet: helpRequested || opaqueEnvCommand,
|
|
963
|
+
createIfMissing: !helpRequested && !opaqueEnvCommand && !readOnlyModuleCommand,
|
|
964
|
+
quiet: helpRequested || opaqueEnvCommand || readOnlyModuleCommand || jsonOutput,
|
|
960
965
|
}
|
|
961
966
|
}
|
|
962
967
|
|
|
@@ -1468,13 +1473,22 @@ export async function run(argv = process.argv) {
|
|
|
1468
1473
|
const commandArgs = remaining.filter(Boolean)
|
|
1469
1474
|
|
|
1470
1475
|
if (!subcommand || subcommand === 'help' || subcommand === '--help' || subcommand === '-h') {
|
|
1471
|
-
console.log('Usage: yarn mercato module <add|enable|eject> ...')
|
|
1476
|
+
console.log('Usage: yarn mercato module <add|enable|eject|search|info> ...')
|
|
1472
1477
|
console.log(' yarn mercato module add <packageSpec> [--module <moduleId>] [--eject] [--allow-third-party]')
|
|
1473
1478
|
console.log(' yarn mercato module enable <packageName> [--module <moduleId>] [--eject] [--allow-third-party]')
|
|
1474
1479
|
console.log(' yarn mercato module eject <moduleId>')
|
|
1480
|
+
console.log(' yarn mercato module search [<query>] [--category <id>] [--kind <kind>] [--all-lines] [--limit <n>] [--json]')
|
|
1481
|
+
console.log(' yarn mercato module info <package-or-module-id> [--json]')
|
|
1475
1482
|
return 0
|
|
1476
1483
|
}
|
|
1477
1484
|
|
|
1485
|
+
if (subcommand === 'search' || subcommand === 'info') {
|
|
1486
|
+
const { runModuleSearch, runModuleInfo } = await import('./lib/module-search')
|
|
1487
|
+
const { readEnabledModules } = await import('./lib/modules-config')
|
|
1488
|
+
const deps = { readEnabledModules }
|
|
1489
|
+
return subcommand === 'search' ? await runModuleSearch(commandArgs, deps) : await runModuleInfo(commandArgs, deps)
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1478
1492
|
if (subcommand === 'add') {
|
|
1479
1493
|
const { createResolver } = await import('./lib/resolver')
|
|
1480
1494
|
const { addOfficialModule } = await import('./lib/module-install')
|