@open-mercato/cli 0.10.1-develop.7990.1.82d0a183c5 → 0.10.1-develop.8004.1.a8a79ee43f

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.
Files changed (182) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/build.mjs +1 -0
  3. package/dist/agentic/guides/module-facts.json +162 -162
  4. package/dist/agentic/guides/module-facts.v2.json +162 -162
  5. package/dist/agentic/guides/module-tool.md +21 -0
  6. package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
  7. package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
  8. package/dist/agentic/guides/modules/api_docs/index.md +1 -1
  9. package/dist/agentic/guides/modules/api_keys/index.md +1 -1
  10. package/dist/agentic/guides/modules/attachments/index.md +1 -1
  11. package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
  12. package/dist/agentic/guides/modules/auth/index.md +1 -1
  13. package/dist/agentic/guides/modules/availability/index.md +1 -1
  14. package/dist/agentic/guides/modules/business_rules/index.md +1 -1
  15. package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
  16. package/dist/agentic/guides/modules/cart/index.md +1 -1
  17. package/dist/agentic/guides/modules/catalog/index.md +1 -1
  18. package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
  19. package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
  20. package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
  21. package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
  22. package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
  23. package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
  24. package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
  25. package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
  26. package/dist/agentic/guides/modules/channel_smtp/index.md +1 -1
  27. package/dist/agentic/guides/modules/checkout/index.md +1 -1
  28. package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
  29. package/dist/agentic/guides/modules/configs/index.md +1 -1
  30. package/dist/agentic/guides/modules/content/index.md +1 -1
  31. package/dist/agentic/guides/modules/currencies/index.md +1 -1
  32. package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
  33. package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
  34. package/dist/agentic/guides/modules/customers/index.md +1 -1
  35. package/dist/agentic/guides/modules/dashboards/index.md +1 -1
  36. package/dist/agentic/guides/modules/data_sync/index.md +1 -1
  37. package/dist/agentic/guides/modules/design_system/index.md +1 -1
  38. package/dist/agentic/guides/modules/devices/index.md +1 -1
  39. package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
  40. package/dist/agentic/guides/modules/directory/index.md +1 -1
  41. package/dist/agentic/guides/modules/documents/index.md +1 -1
  42. package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
  43. package/dist/agentic/guides/modules/entities/index.md +1 -1
  44. package/dist/agentic/guides/modules/eudr/index.md +1 -1
  45. package/dist/agentic/guides/modules/events/index.md +1 -1
  46. package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
  47. package/dist/agentic/guides/modules/forms/index.md +1 -1
  48. package/dist/agentic/guides/modules/gateway_autopay/index.md +1 -1
  49. package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
  50. package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
  51. package/dist/agentic/guides/modules/generators/index.md +1 -1
  52. package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
  53. package/dist/agentic/guides/modules/integrations/index.md +1 -1
  54. package/dist/agentic/guides/modules/messages/index.md +1 -1
  55. package/dist/agentic/guides/modules/notifications/index.md +1 -1
  56. package/dist/agentic/guides/modules/onboarding/index.md +1 -1
  57. package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
  58. package/dist/agentic/guides/modules/perspectives/index.md +1 -1
  59. package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
  60. package/dist/agentic/guides/modules/planner/index.md +1 -1
  61. package/dist/agentic/guides/modules/portal/index.md +1 -1
  62. package/dist/agentic/guides/modules/progress/index.md +1 -1
  63. package/dist/agentic/guides/modules/promotions/index.md +1 -1
  64. package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
  65. package/dist/agentic/guides/modules/query_index/index.md +1 -1
  66. package/dist/agentic/guides/modules/record_locks/index.md +1 -1
  67. package/dist/agentic/guides/modules/resources/index.md +1 -1
  68. package/dist/agentic/guides/modules/sales/index.md +1 -1
  69. package/dist/agentic/guides/modules/scheduler/index.md +1 -1
  70. package/dist/agentic/guides/modules/search/index.md +1 -1
  71. package/dist/agentic/guides/modules/security/index.md +1 -1
  72. package/dist/agentic/guides/modules/seeds/index.md +1 -1
  73. package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
  74. package/dist/agentic/guides/modules/sso/index.md +1 -1
  75. package/dist/agentic/guides/modules/staff/index.md +1 -1
  76. package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
  77. package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
  78. package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
  79. package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
  80. package/dist/agentic/guides/modules/telemetry/index.md +1 -1
  81. package/dist/agentic/guides/modules/tillio/index.md +1 -1
  82. package/dist/agentic/guides/modules/translations/index.md +1 -1
  83. package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
  84. package/dist/agentic/guides/modules/webhooks/index.md +1 -1
  85. package/dist/agentic/guides/modules/wms/index.md +1 -1
  86. package/dist/agentic/guides/modules/workflows/index.md +1 -1
  87. package/dist/agentic/guides/reference-module-facts.json +1 -1
  88. package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +4 -0
  89. package/dist/agentic/guides/upstream/manifest.json +2 -2
  90. package/dist/agentic/shared/ai/harness/cases.json +23 -9
  91. package/dist/agentic/shared/ai/harness/source-link-inventory.json +90 -4
  92. package/dist/i18n/de.json +4 -0
  93. package/dist/i18n/en.json +4 -0
  94. package/dist/i18n/es.json +4 -0
  95. package/dist/i18n/ko.json +4 -0
  96. package/dist/i18n/pl.json +4 -0
  97. package/dist/lib/__fixtures__/module-search/built-in.json +235 -0
  98. package/dist/lib/__fixtures__/module-search/catalog-parity.json +4076 -0
  99. package/dist/lib/__fixtures__/module-search/modules-index.json +1980 -0
  100. package/dist/lib/__fixtures__/official-module-package/package.json +33 -0
  101. package/dist/lib/__integration__/TC-INT-007.spec.js +207 -19
  102. package/dist/lib/__integration__/TC-INT-007.spec.js.map +2 -2
  103. package/dist/lib/__integration__/TC-INT-009.spec.js +267 -0
  104. package/dist/lib/__integration__/TC-INT-009.spec.js.map +7 -0
  105. package/dist/lib/eject.js +25 -9
  106. package/dist/lib/eject.js.map +2 -2
  107. package/dist/lib/generators/entity-ids.js +2 -0
  108. package/dist/lib/generators/entity-ids.js.map +2 -2
  109. package/dist/lib/generators/module-di.js +2 -0
  110. package/dist/lib/generators/module-di.js.map +2 -2
  111. package/dist/lib/generators/module-entities.js +2 -0
  112. package/dist/lib/generators/module-entities.js.map +2 -2
  113. package/dist/lib/generators/module-package-sources.js +6 -4
  114. package/dist/lib/generators/module-package-sources.js.map +2 -2
  115. package/dist/lib/generators/module-registry.js +32 -86
  116. package/dist/lib/generators/module-registry.js.map +2 -2
  117. package/dist/lib/generators/openapi.js +2 -0
  118. package/dist/lib/generators/openapi.js.map +2 -2
  119. package/dist/lib/generators/source-exports.js +73 -0
  120. package/dist/lib/generators/source-exports.js.map +7 -0
  121. package/dist/lib/init-secrets.js +33 -1
  122. package/dist/lib/init-secrets.js.map +2 -2
  123. package/dist/lib/init-summary.js +44 -0
  124. package/dist/lib/init-summary.js.map +7 -0
  125. package/dist/lib/module-github.js +98 -0
  126. package/dist/lib/module-github.js.map +7 -0
  127. package/dist/lib/module-identity.js +131 -0
  128. package/dist/lib/module-identity.js.map +7 -0
  129. package/dist/lib/module-inspection.js +124 -0
  130. package/dist/lib/module-inspection.js.map +7 -0
  131. package/dist/lib/module-install.js +150 -21
  132. package/dist/lib/module-install.js.map +3 -3
  133. package/dist/lib/module-package.js +205 -15
  134. package/dist/lib/module-package.js.map +2 -2
  135. package/dist/lib/modules-config.js +69 -30
  136. package/dist/lib/modules-config.js.map +2 -2
  137. package/dist/lib/resolver.js +33 -34
  138. package/dist/lib/resolver.js.map +2 -2
  139. package/dist/mercato.js +17 -37
  140. package/dist/mercato.js.map +2 -2
  141. package/package.json +7 -7
  142. package/src/__tests__/mercato.test.ts +71 -4
  143. package/src/i18n/de.json +4 -0
  144. package/src/i18n/en.json +4 -0
  145. package/src/i18n/es.json +4 -0
  146. package/src/i18n/ko.json +4 -0
  147. package/src/i18n/pl.json +4 -0
  148. package/src/lib/__fixtures__/official-module-package/dist/modules/test_package/widgets/injection/test/widget.js +1 -0
  149. package/src/lib/__integration__/TC-INT-007.spec.ts +219 -19
  150. package/src/lib/__integration__/TC-INT-009.spec.ts +279 -0
  151. package/src/lib/__tests__/eject.test.ts +98 -4
  152. package/src/lib/__tests__/init-secrets.test.ts +85 -1
  153. package/src/lib/__tests__/init-summary.test.ts +50 -0
  154. package/src/lib/__tests__/module-github.test.ts +108 -0
  155. package/src/lib/__tests__/module-identity.test.ts +144 -0
  156. package/src/lib/__tests__/module-inspection.test.ts +195 -0
  157. package/src/lib/__tests__/module-install.test.ts +399 -10
  158. package/src/lib/__tests__/module-package.test.ts +154 -0
  159. package/src/lib/__tests__/modules-config.test.ts +55 -0
  160. package/src/lib/__tests__/resolver.packages.test.ts +29 -0
  161. package/src/lib/eject.ts +28 -10
  162. package/src/lib/generators/__tests__/module-id-collisions.test.ts +146 -0
  163. package/src/lib/generators/__tests__/module-package-sources.test.ts +19 -2
  164. package/src/lib/generators/__tests__/module-requirements.test.ts +56 -0
  165. package/src/lib/generators/entity-ids.ts +2 -0
  166. package/src/lib/generators/module-di.ts +2 -0
  167. package/src/lib/generators/module-entities.ts +2 -0
  168. package/src/lib/generators/module-package-sources.ts +7 -5
  169. package/src/lib/generators/module-registry.ts +33 -115
  170. package/src/lib/generators/openapi.ts +3 -0
  171. package/src/lib/generators/source-exports.ts +93 -0
  172. package/src/lib/init-secrets.ts +37 -0
  173. package/src/lib/init-summary.ts +54 -0
  174. package/src/lib/module-github.ts +109 -0
  175. package/src/lib/module-identity.ts +145 -0
  176. package/src/lib/module-inspection.ts +133 -0
  177. package/src/lib/module-install.ts +170 -22
  178. package/src/lib/module-package.ts +243 -16
  179. package/src/lib/modules-config.ts +80 -32
  180. package/src/lib/resolver.ts +35 -39
  181. package/src/mercato.ts +18 -44
  182. package/src/types/cross-spawn.d.ts +2 -2
@@ -2,6 +2,7 @@ import path from 'node:path'
2
2
  import fs from 'node:fs'
3
3
  import ts from 'typescript-js'
4
4
  import { parseBooleanWithDefault } from '@open-mercato/shared/lib/boolean'
5
+ import { resolveInstalledPackageRootWithRequire } from './module-package'
5
6
 
6
7
  /**
7
8
  * Resolved execution environment for the CLI.
@@ -25,6 +26,8 @@ export type CliEnvironment = {
25
26
  export type ModuleEntry = {
26
27
  id: string
27
28
  from?: '@open-mercato/core' | '@app' | string
29
+ locator?: string
30
+ packageName?: string
28
31
  devSupervisorRequiresFullBootstrap?: boolean
29
32
  }
30
33
 
@@ -49,47 +52,33 @@ export interface PackageResolver {
49
52
  getPackageRoot(from?: string): string
50
53
  }
51
54
 
52
- function pkgDirFor(rootDir: string, from?: string, isMonorepo = true): string {
53
- if (!isMonorepo) {
54
- const pkgName = from || '@open-mercato/core'
55
- const pkgRoot = path.join(rootDir, 'node_modules', pkgName)
56
- const distModules = path.join(pkgRoot, 'dist', 'modules')
57
- if (fs.existsSync(distModules)) return distModules
58
- return path.join(pkgRoot, 'src', 'modules')
59
- }
60
-
61
- // Monorepo mode - read from src/modules (TypeScript source)
62
- if (!from || from === '@open-mercato/core') {
63
- return path.resolve(rootDir, 'packages/core/src/modules')
64
- }
65
- // Support other local packages like '@open-mercato/onboarding' => packages/onboarding/src/modules
66
- const m = from.match(/^@open-mercato\/(.+)$/)
67
- if (m) {
68
- return path.resolve(rootDir, `packages/${m[1]}/src/modules`)
69
- }
70
- // Fallback to core modules path
71
- return path.resolve(rootDir, 'packages/core/src/modules')
55
+ function pkgDirFor(rootDir: string, from?: string, isMonorepo = true, appDir = rootDir): string {
56
+ const packageRoot = pkgRootFor(rootDir, from, isMonorepo, appDir)
57
+ const sourceModules = path.join(packageRoot, 'src', 'modules')
58
+ const distModules = path.join(packageRoot, 'dist', 'modules')
59
+ const workspacePackage = isMonorepo && packageRoot.startsWith(path.join(rootDir, 'packages') + path.sep)
60
+ if (workspacePackage && fs.existsSync(sourceModules)) return sourceModules
61
+ if (fs.existsSync(distModules)) return distModules
62
+ return sourceModules
72
63
  }
73
64
 
74
- function pkgRootFor(rootDir: string, from?: string, isMonorepo = true): string {
75
- if (!isMonorepo) {
76
- const pkgName = from || '@open-mercato/core'
77
- return path.join(rootDir, 'node_modules', pkgName)
78
- }
79
-
80
- if (!from || from === '@open-mercato/core') {
81
- return path.resolve(rootDir, 'packages/core')
82
- }
83
- const m = from.match(/^@open-mercato\/(.+)$/)
84
- if (m) {
85
- return path.resolve(rootDir, `packages/${m[1]}`)
65
+ function pkgRootFor(rootDir: string, from?: string, isMonorepo = true, appDir = rootDir): string {
66
+ const packageName = from || '@open-mercato/core'
67
+ if (isMonorepo) {
68
+ const workspaceMatch = packageName.match(/^@open-mercato\/(.+)$/)
69
+ if (workspaceMatch) {
70
+ const workspaceRoot = path.join(rootDir, 'packages', workspaceMatch[1])
71
+ if (fs.existsSync(workspaceRoot)) return workspaceRoot
72
+ }
86
73
  }
87
- return path.resolve(rootDir, 'packages/core')
74
+ return resolveInstalledPackageRootWithRequire(packageName, appDir) ?? path.join(rootDir, 'node_modules', packageName)
88
75
  }
89
76
 
90
77
  function parseModuleEntryFromObjectLiteral(node: ts.ObjectLiteralExpression): ModuleEntry | null {
91
78
  let id: string | null = null
92
79
  let from: string | null = null
80
+ let locator: string | undefined
81
+ let packageName: string | undefined
93
82
  let devSupervisorRequiresFullBootstrap = false
94
83
  for (const property of node.properties) {
95
84
  if (!ts.isPropertyAssignment(property)) continue
@@ -102,6 +91,12 @@ function parseModuleEntryFromObjectLiteral(node: ts.ObjectLiteralExpression): Mo
102
91
  if (key === 'from' && ts.isStringLiteralLike(property.initializer)) {
103
92
  from = property.initializer.text
104
93
  }
94
+ if (key === 'packageName' && ts.isStringLiteralLike(property.initializer)) {
95
+ packageName = property.initializer.text
96
+ }
97
+ if (key === 'locator' && ts.isStringLiteralLike(property.initializer)) {
98
+ locator = property.initializer.text
99
+ }
105
100
  if (key === 'overrides') {
106
101
  if (!ts.isObjectLiteralExpression(property.initializer)) {
107
102
  devSupervisorRequiresFullBootstrap = true
@@ -127,6 +122,8 @@ function parseModuleEntryFromObjectLiteral(node: ts.ObjectLiteralExpression): Mo
127
122
  return {
128
123
  id,
129
124
  from: from ?? '@open-mercato/core',
125
+ ...(locator ? { locator } : {}),
126
+ ...(packageName ? { packageName } : {}),
130
127
  ...(devSupervisorRequiresFullBootstrap ? { devSupervisorRequiresFullBootstrap: true } : {}),
131
128
  }
132
129
  }
@@ -365,8 +362,7 @@ function loadEnabledModulesFromConfig(appDir: string): ModuleEntry[] {
365
362
  const cfgPath = path.resolve(appDir, 'src/modules.ts')
366
363
  if (fs.existsSync(cfgPath)) {
367
364
  try {
368
- const loadedModules = readEnabledModulesFromConfig(cfgPath)
369
- if (loadedModules.length > 0) return loadedModules
365
+ return readEnabledModulesFromConfig(cfgPath)
370
366
  } catch (error) {
371
367
  console.warn(
372
368
  '[resolver] Failed to read enabled modules from src/modules.ts, falling back to src/modules scan:',
@@ -582,7 +578,7 @@ export function createResolver(cwd: string = process.cwd()): PackageResolver {
582
578
 
583
579
  getModulePaths: (entry: ModuleEntry) => {
584
580
  const appBase = path.resolve(appDir, 'src/modules', entry.id)
585
- const pkgModulesRoot = pkgDirFor(rootDir, entry.from, _isMonorepo)
581
+ const pkgModulesRoot = pkgDirFor(rootDir, entry.from, _isMonorepo, appDir)
586
582
  const pkgBase = path.join(pkgModulesRoot, entry.id)
587
583
  return { appBase, pkgBase }
588
584
  },
@@ -601,12 +597,12 @@ export function createResolver(cwd: string = process.cwd()): PackageResolver {
601
597
  // App output goes to .mercato/generated
602
598
  return path.join(appDir, '.mercato', 'generated')
603
599
  }
604
- const pkgRoot = pkgRootFor(rootDir, packageName, _isMonorepo)
600
+ const pkgRoot = pkgRootFor(rootDir, packageName, _isMonorepo, appDir)
605
601
  return path.join(pkgRoot, 'generated')
606
602
  },
607
603
 
608
604
  getPackageRoot: (from?: string) => {
609
- return pkgRootFor(rootDir, from, _isMonorepo)
605
+ return pkgRootFor(rootDir, from, _isMonorepo, appDir)
610
606
  },
611
607
  }
612
608
  }
@@ -624,6 +620,6 @@ export function resolveEnvironment(cwd: string = process.cwd()): CliEnvironment
624
620
  mode: _isMonorepo ? 'monorepo' : 'standalone',
625
621
  rootDir,
626
622
  appDir,
627
- packageRoot: (packageName: string) => pkgRootFor(rootDir, packageName, _isMonorepo),
623
+ packageRoot: (packageName: string) => pkgRootFor(rootDir, packageName, _isMonorepo, appDir),
628
624
  }
629
625
  }
package/src/mercato.ts CHANGED
@@ -9,7 +9,8 @@ export { getCliModules, hasCliModules, registerCliModules }
9
9
  import { parseBooleanToken } from '@open-mercato/shared/lib/boolean'
10
10
  import { getSslConfig } from '@open-mercato/shared/lib/db/ssl'
11
11
  import { getRedisUrl, getRedisUrlOrThrow, parseRedisUrl } from '@open-mercato/shared/lib/redis/connection'
12
- import { resolveInitDerivedSecrets } from './lib/init-secrets'
12
+ import { formatInitSummary } from './lib/init-summary'
13
+ import { resolveInitDerivedSecrets, resolveInitSuperadminCredentials } from './lib/init-secrets'
13
14
  import { decideExistingDatabase, formatSkipIfInitializedMessage } from './lib/init-existing-database'
14
15
  import {
15
16
  resolveAutoSpawnWorkersMode,
@@ -1031,6 +1032,7 @@ export async function run(argv = process.argv) {
1031
1032
  delete process.env.OM_INIT_REINSTALL
1032
1033
  }
1033
1034
  const skipIfInitialized = initArgs.includes('--skip-if-initialized')
1035
+ const credentials = skipIfInitialized && !reinstall ? undefined : resolveInitSuperadminCredentials(initArgs)
1034
1036
  const skipExamples = initArgs.includes('--no-examples')
1035
1037
  const skipDemoUsers = initArgs.includes('--no-demo-users')
1036
1038
  const stressTestEnabled =
@@ -1208,6 +1210,8 @@ export async function run(argv = process.argv) {
1208
1210
  }
1209
1211
  }
1210
1212
 
1213
+ const { email, password, skipPasswordPolicy } = credentials ?? resolveInitSuperadminCredentials(initArgs)
1214
+
1211
1215
  // Step 1: Run generators directly (no process spawn)
1212
1216
  console.log('🔧 Preparing modules (registry, entities, DI)...')
1213
1217
  const { createResolver } = await import('./lib/resolver')
@@ -1256,16 +1260,7 @@ export async function run(argv = process.argv) {
1256
1260
  }
1257
1261
  return fallback
1258
1262
  }
1259
- const readEnvDefault = (key: string) => {
1260
- const value = process.env[key]
1261
- if (typeof value === 'string' && value.trim().length > 0) return value.trim()
1262
- return undefined
1263
- }
1264
- const defaultEmail = readEnvDefault('OM_INIT_SUPERADMIN_EMAIL') ?? 'superadmin@acme.com'
1265
- const defaultPassword = readEnvDefault('OM_INIT_SUPERADMIN_PASSWORD') ?? 'secret'
1266
1263
  const orgName = findArgValue(['--org=', '--orgName='], 'Acme Corp')
1267
- const email = findArgValue(['--email='], defaultEmail)
1268
- const password = findArgValue(['--password='], defaultPassword)
1269
1264
  const derivedSecrets = resolveInitDerivedSecrets({ email, env: process.env })
1270
1265
  const adminEmailDerived = derivedSecrets.adminEmail
1271
1266
  const employeeEmailDerived = derivedSecrets.employeeEmail
@@ -1299,16 +1294,6 @@ export async function run(argv = process.argv) {
1299
1294
  process.env.OM_INIT_EMPLOYEE_EMAIL = employeeEmailDerived
1300
1295
  }
1301
1296
  const roles = findArgValue(['--roles='], 'superadmin,admin,employee')
1302
- const skipPasswordPolicyRaw = initArgs.find((arg) =>
1303
- arg === '--skip-password-policy' ||
1304
- arg.startsWith('--skip-password-policy=') ||
1305
- arg === '--allow-weak-password' ||
1306
- arg.startsWith('--allow-weak-password=')
1307
- )
1308
- const skipPasswordPolicy = skipPasswordPolicyRaw
1309
- ? parseBooleanToken(skipPasswordPolicyRaw.split('=')[1] ?? 'true') ?? true
1310
- : true
1311
-
1312
1297
  console.log('🔐 Setting up RBAC and users...')
1313
1298
  // Run auth setup command via CLI
1314
1299
  const setupArgs = [
@@ -1482,29 +1467,18 @@ export async function run(argv = process.argv) {
1482
1467
  pushUser('Admin', '🧰', adminEmailDerived, adminPasswordOverride ?? password)
1483
1468
  pushUser('Employee', '👷', employeeEmailDerived, employeePasswordOverride ?? password)
1484
1469
  }
1485
- // Simplified success message: we know which users were created
1486
- console.log('🎉 App initialization complete!\n')
1487
- console.log('╔══════════════════════════════════════════════════════════════╗')
1488
- console.log('║ 🚀 You\'re now ready to start development! ║')
1489
- console.log('║ ║')
1490
- if (parseBooleanToken(process.env.OM_INIT_DEV_AUTOSTART) === true) {
1491
- console.log('║ The dev server is starting now (next time run: yarn dev). ║')
1492
- } else {
1493
- console.log('║ Start the dev server: ║')
1494
- console.log('║ yarn dev ║')
1495
- }
1496
- console.log('║ ║')
1497
- console.log('║ Users created: ║')
1498
- for (const entry of createdUsers) {
1499
- const label = `${entry.icon} ${entry.label}:`
1500
- const labelPad = padByCodePointWidth(label, 13)
1501
- const entryPassword = createdPasswords.get(entry.email.toLowerCase()) ?? password
1502
- console.log(`║ ${labelPad}${entry.email.padEnd(42)} ║`)
1503
- console.log(`║ Password: ${entryPassword.padEnd(44)} ║`)
1504
- }
1505
- console.log('║ ║')
1506
- console.log('║ Happy coding! ║')
1507
- console.log('╚══════════════════════════════════════════════════════════════╝')
1470
+ const summaryColor = parseBooleanToken(process.env.OM_INIT_SUMMARY_COLOR)
1471
+ const summaryColumns = Number(process.env.OM_INIT_SUMMARY_COLUMNS ?? process.stdout.columns)
1472
+ const summary = formatInitSummary({
1473
+ users: createdUsers.map((entry) => ({
1474
+ ...entry,
1475
+ password: createdPasswords.get(entry.email.toLowerCase()) ?? password,
1476
+ })),
1477
+ autoStart: parseBooleanToken(process.env.OM_INIT_DEV_AUTOSTART) === true,
1478
+ columns: summaryColumns,
1479
+ color: process.env.NO_COLOR === undefined && (summaryColor ?? (Boolean(process.stdout.isTTY) || parseBooleanToken(process.env.FORCE_COLOR) === true)),
1480
+ })
1481
+ for (const line of summary) console.log(line)
1508
1482
 
1509
1483
  return 0
1510
1484
  } catch (error: unknown) {
@@ -2333,7 +2307,7 @@ export async function run(argv = process.argv) {
2333
2307
  )
2334
2308
  const nextProcess = spawn('node', nextDevCommand.args, {
2335
2309
  stdio: ['inherit', 'pipe', 'pipe'],
2336
- env: runtimeEnv,
2310
+ env: { ...runtimeEnv, NODE_ENV: 'development' },
2337
2311
  cwd: appDir,
2338
2312
  })
2339
2313
  processes.push(nextProcess)
@@ -1,7 +1,7 @@
1
1
  declare module 'cross-spawn' {
2
- import type { spawn as spawnFunction } from 'node:child_process'
2
+ import type { spawn as spawnFunction, spawnSync } from 'node:child_process'
3
3
 
4
- const spawn: typeof spawnFunction
4
+ const spawn: typeof spawnFunction & { sync: typeof spawnSync }
5
5
 
6
6
  export default spawn
7
7
  }