create-mercato-app 0.6.6-develop.6429.1.2fba7258d1 → 0.6.6-develop.6450.1.b493fb430c
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 +9 -9
- package/dist/agentic/guides/modules/auth.md +1 -1
- package/dist/agentic/guides/modules/catalog.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/data_sync.md +1 -1
- package/dist/agentic/guides/modules/integrations.md +1 -1
- package/dist/agentic/guides/modules/sales.md +1 -1
- package/dist/agentic/guides/modules/workflows.md +1 -1
- package/package.json +3 -3
- package/template/.env.example +22 -2
- package/template/scripts/dev-runtime.mjs +80 -11
- package/template/scripts/dev.mjs +17 -5
- package/template/scripts/watch-scope.mjs +18 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"auth": {
|
|
3
3
|
"title": "Authentication & Accounts",
|
|
4
4
|
"description": "User accounts, sessions, roles and password resets.",
|
|
5
|
-
"coreVersion": "0.6.6-develop.
|
|
5
|
+
"coreVersion": "0.6.6-develop.6450.1.b493fb430c",
|
|
6
6
|
"entities": [
|
|
7
7
|
{
|
|
8
8
|
"id": "auth:user",
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"catalog": {
|
|
192
192
|
"title": "Product Catalog",
|
|
193
193
|
"description": "Configurable catalog for products, variants, and pricing used by the sales module.",
|
|
194
|
-
"coreVersion": "0.6.6-develop.
|
|
194
|
+
"coreVersion": "0.6.6-develop.6450.1.b493fb430c",
|
|
195
195
|
"entities": [
|
|
196
196
|
{
|
|
197
197
|
"id": "catalog:catalog_option_schema_template",
|
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
"currencies": {
|
|
406
406
|
"title": "Currencies",
|
|
407
407
|
"description": "Currencies and Exchange rate management",
|
|
408
|
-
"coreVersion": "0.6.6-develop.
|
|
408
|
+
"coreVersion": "0.6.6-develop.6450.1.b493fb430c",
|
|
409
409
|
"entities": [
|
|
410
410
|
{
|
|
411
411
|
"id": "currencies:currency",
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
"customer_accounts": {
|
|
490
490
|
"title": "Customer Identity & Portal Authentication",
|
|
491
491
|
"description": "Customer-facing authentication with two-tier identity model and full RBAC.",
|
|
492
|
-
"coreVersion": "0.6.6-develop.
|
|
492
|
+
"coreVersion": "0.6.6-develop.6450.1.b493fb430c",
|
|
493
493
|
"entities": [
|
|
494
494
|
{
|
|
495
495
|
"id": "customer_accounts:customer_user",
|
|
@@ -729,7 +729,7 @@
|
|
|
729
729
|
"customers": {
|
|
730
730
|
"title": "Customer Relationship Management",
|
|
731
731
|
"description": "Core CRM capabilities for people, companies, deals, and activities.",
|
|
732
|
-
"coreVersion": "0.6.6-develop.
|
|
732
|
+
"coreVersion": "0.6.6-develop.6450.1.b493fb430c",
|
|
733
733
|
"entities": [
|
|
734
734
|
{
|
|
735
735
|
"id": "customers:customer_entity",
|
|
@@ -1211,7 +1211,7 @@
|
|
|
1211
1211
|
"data_sync": {
|
|
1212
1212
|
"title": "Data Sync",
|
|
1213
1213
|
"description": "Streaming data sync hub for import/export integrations.",
|
|
1214
|
-
"coreVersion": "0.6.6-develop.
|
|
1214
|
+
"coreVersion": "0.6.6-develop.6450.1.b493fb430c",
|
|
1215
1215
|
"entities": [
|
|
1216
1216
|
{
|
|
1217
1217
|
"id": "data_sync:sync_run",
|
|
@@ -1289,7 +1289,7 @@
|
|
|
1289
1289
|
"integrations": {
|
|
1290
1290
|
"title": "Integrations",
|
|
1291
1291
|
"description": "Core integration framework — external ID mapping, status badges, and integration registry.",
|
|
1292
|
-
"coreVersion": "0.6.6-develop.
|
|
1292
|
+
"coreVersion": "0.6.6-develop.6450.1.b493fb430c",
|
|
1293
1293
|
"entities": [
|
|
1294
1294
|
{
|
|
1295
1295
|
"id": "integrations:sync_external_id_mapping",
|
|
@@ -1365,7 +1365,7 @@
|
|
|
1365
1365
|
"sales": {
|
|
1366
1366
|
"title": "Sales Management",
|
|
1367
1367
|
"description": "Quoting, ordering, fulfillment, and billing capabilities built on modular pricing and tax pipelines.",
|
|
1368
|
-
"coreVersion": "0.6.6-develop.
|
|
1368
|
+
"coreVersion": "0.6.6-develop.6450.1.b493fb430c",
|
|
1369
1369
|
"entities": [
|
|
1370
1370
|
{
|
|
1371
1371
|
"id": "sales:sales_channel",
|
|
@@ -1839,7 +1839,7 @@
|
|
|
1839
1839
|
"workflows": {
|
|
1840
1840
|
"title": "Workflow Engine",
|
|
1841
1841
|
"description": "Orchestrate business processes with state machines, transitions, and activities",
|
|
1842
|
-
"coreVersion": "0.6.6-develop.
|
|
1842
|
+
"coreVersion": "0.6.6-develop.6450.1.b493fb430c",
|
|
1843
1843
|
"entities": [
|
|
1844
1844
|
{
|
|
1845
1845
|
"id": "workflows:workflow_definition",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# customer_accounts — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.6-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.6-develop.6450.1.b493fb430c — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mercato-app",
|
|
3
|
-
"version": "0.6.6-develop.
|
|
3
|
+
"version": "0.6.6-develop.6450.1.b493fb430c",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Create a new Open Mercato application",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"ts-morph": "^28.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@open-mercato/cli": "0.6.6-develop.
|
|
26
|
-
"@open-mercato/shared": "0.6.6-develop.
|
|
25
|
+
"@open-mercato/cli": "0.6.6-develop.6450.1.b493fb430c",
|
|
26
|
+
"@open-mercato/shared": "0.6.6-develop.6450.1.b493fb430c",
|
|
27
27
|
"@types/node": "^26.0.1",
|
|
28
28
|
"esbuild": "^0.28.1",
|
|
29
29
|
"tsx": "^4.22.4",
|
package/template/.env.example
CHANGED
|
@@ -141,6 +141,21 @@ NEXT_PUBLIC_OM_EXAMPLE_CHECKOUT_TEST_INJECTIONS_ENABLED=false
|
|
|
141
141
|
# Set to false to run workers separately in production
|
|
142
142
|
AUTO_SPAWN_WORKERS=true
|
|
143
143
|
|
|
144
|
+
# Dev-mode memory optimization: which workspace packages the `yarn dev`
|
|
145
|
+
# package watcher tracks. The watcher's memory footprint scales with the
|
|
146
|
+
# number of watched packages, so narrowing the scope is the main lever for
|
|
147
|
+
# reducing dev-mode RAM usage. Modes (CLI flag `--watch=<mode>` wins over env):
|
|
148
|
+
# all watch every package (default, unchanged)
|
|
149
|
+
# auto-optimized watch only packages touched recently (git working tree +
|
|
150
|
+
# current-branch diff), re-checking every 2 minutes
|
|
151
|
+
# popular watch only the most frequently changed packages (ranked
|
|
152
|
+
# from recent git history; capped by OM_WATCH_POPULAR_LIMIT)
|
|
153
|
+
# env watch exactly the packages listed in OM_WATCH_PACKAGES
|
|
154
|
+
# The active mode is printed with an emoji at dev startup.
|
|
155
|
+
# OM_WATCH_SCOPE=all
|
|
156
|
+
# OM_WATCH_PACKAGES=core,ui,shared # used when OM_WATCH_SCOPE=env
|
|
157
|
+
# OM_WATCH_POPULAR_LIMIT=6 # cap for OM_WATCH_SCOPE=popular
|
|
158
|
+
|
|
144
159
|
# Base directory for local file-backed queues (default: ./.mercato/queue)
|
|
145
160
|
QUEUE_BASE_DIR=./.mercato/queue
|
|
146
161
|
|
|
@@ -471,10 +486,14 @@ OCR_MODEL=gpt-4o
|
|
|
471
486
|
# Security:
|
|
472
487
|
# The Akeneo client validates API URLs server-side to prevent SSRF and credential
|
|
473
488
|
# exfiltration. By default only *.cloud.akeneo.com and *.akeneo.cloud hosts are
|
|
474
|
-
# allowed. Override the allowlist for self-hosted
|
|
475
|
-
# OM_INTEGRATION_AKENEO_ALLOWED_HOSTS=pim.example.
|
|
489
|
+
# allowed. Override the allowlist for self-hosted public custom domains:
|
|
490
|
+
# OM_INTEGRATION_AKENEO_ALLOWED_HOSTS=pim.example.com,akeneo.staging.example.com
|
|
476
491
|
# Aliases (checked in priority order): OM_INTEGRATION_AKENEO_ALLOWED_HOSTS,
|
|
477
492
|
# OPENMERCATO_AKENEO_ALLOWED_HOSTS, AKENEO_ALLOWED_HOSTS
|
|
493
|
+
# Hostnames that resolve to private, loopback, link-local, or reserved IPs are
|
|
494
|
+
# rejected before authenticated requests are sent. For trusted internal Akeneo
|
|
495
|
+
# deployments only, combine an exact host allowlist with:
|
|
496
|
+
# OM_INTEGRATION_AKENEO_ALLOW_PRIVATE_URLS=true
|
|
478
497
|
#
|
|
479
498
|
# Notes:
|
|
480
499
|
# - Only one product locale is imported into base Open Mercato fields at a time.
|
|
@@ -487,6 +506,7 @@ OCR_MODEL=gpt-4o
|
|
|
487
506
|
# OM_INTEGRATION_AKENEO_USERNAME=
|
|
488
507
|
# OM_INTEGRATION_AKENEO_PASSWORD=
|
|
489
508
|
# OM_INTEGRATION_AKENEO_ALLOWED_HOSTS=
|
|
509
|
+
# OM_INTEGRATION_AKENEO_ALLOW_PRIVATE_URLS=false
|
|
490
510
|
# OM_INTEGRATION_AKENEO_FORCE_PRECONFIGURE=false
|
|
491
511
|
# OM_INTEGRATION_AKENEO_PRODUCT_LOCALE=
|
|
492
512
|
# OM_INTEGRATION_AKENEO_CATEGORY_LOCALE=
|
|
@@ -69,6 +69,13 @@ function resolveAutoSpawnMode(env, legacyName, aliasedName, lazyName) {
|
|
|
69
69
|
return parseEnvBooleanToken(env[lazyName]) === true ? 'lazy' : 'eager'
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
function resolveLazyWorkerSpawnMode(env) {
|
|
73
|
+
const raw = env.OM_AUTO_SPAWN_WORKERS_LAZY_MODE?.trim().toLowerCase()
|
|
74
|
+
if (raw === 'shared') return 'shared'
|
|
75
|
+
if (raw === 'per-queue') return 'per-queue'
|
|
76
|
+
return 'per-queue'
|
|
77
|
+
}
|
|
78
|
+
|
|
72
79
|
const {
|
|
73
80
|
clampPercent,
|
|
74
81
|
connectLineStream,
|
|
@@ -118,8 +125,10 @@ const CYAN_BORDER = '\u001B[46m\u001B[30m'
|
|
|
118
125
|
const ERROR_BANNER = '\u001B[41m\u001B[97m'
|
|
119
126
|
const warmupRequestTimeoutsMs = [45000, 120000]
|
|
120
127
|
const maxWarmupRetryAttempts = 3
|
|
128
|
+
const backgroundWorkerMode = resolveAutoSpawnMode(process.env, 'AUTO_SPAWN_WORKERS', 'OM_AUTO_SPAWN_WORKERS', 'OM_AUTO_SPAWN_WORKERS_LAZY')
|
|
121
129
|
const backgroundServiceModes = {
|
|
122
|
-
workers:
|
|
130
|
+
workers: backgroundWorkerMode,
|
|
131
|
+
workerSpawnMode: backgroundWorkerMode === 'lazy' ? resolveLazyWorkerSpawnMode(process.env) : null,
|
|
123
132
|
scheduler: resolveAutoSpawnMode(process.env, 'AUTO_SPAWN_SCHEDULER', 'OM_AUTO_SPAWN_SCHEDULER', 'OM_AUTO_SPAWN_SCHEDULER_LAZY'),
|
|
124
133
|
}
|
|
125
134
|
const shutdownNoticeOwnedByParent = process.env.OM_DEV_SHUTDOWN_NOTICE_OWNER === 'parent'
|
|
@@ -139,6 +148,7 @@ const splashState = {
|
|
|
139
148
|
workerQueues: [],
|
|
140
149
|
schedulerActive: false,
|
|
141
150
|
workerMode: backgroundServiceModes.workers,
|
|
151
|
+
workerSpawnMode: backgroundServiceModes.workerSpawnMode,
|
|
142
152
|
schedulerMode: backgroundServiceModes.scheduler,
|
|
143
153
|
progressCurrent: runtimeProgressCurrent,
|
|
144
154
|
progressTotal: runtimeProgressTotal,
|
|
@@ -163,6 +173,7 @@ const runtimeSummaryState = {
|
|
|
163
173
|
workerQueues: [],
|
|
164
174
|
schedulerActive: false,
|
|
165
175
|
workerMode: backgroundServiceModes.workers,
|
|
176
|
+
workerSpawnMode: backgroundServiceModes.workerSpawnMode,
|
|
166
177
|
schedulerMode: backgroundServiceModes.scheduler,
|
|
167
178
|
packagesPrinted: false,
|
|
168
179
|
workersPrinted: false,
|
|
@@ -218,7 +229,12 @@ function printCompactSummary(icon, title, lines) {
|
|
|
218
229
|
|
|
219
230
|
function formatBackgroundServiceMode(modes = runtimeSummaryState) {
|
|
220
231
|
const activeModes = []
|
|
221
|
-
if (modes.workerMode !== 'off')
|
|
232
|
+
if (modes.workerMode !== 'off') {
|
|
233
|
+
const workerMode = modes.workerMode === 'lazy' && modes.workerSpawnMode
|
|
234
|
+
? `${modes.workerMode} ${modes.workerSpawnMode}`
|
|
235
|
+
: modes.workerMode
|
|
236
|
+
activeModes.push(['workers', workerMode])
|
|
237
|
+
}
|
|
222
238
|
if (modes.schedulerMode !== 'off') activeModes.push(['scheduler', modes.schedulerMode])
|
|
223
239
|
if (activeModes.length === 0) return 'off'
|
|
224
240
|
|
|
@@ -232,6 +248,27 @@ function formatBackgroundServiceStatus(action = 'Starting background services',
|
|
|
232
248
|
return `${action} (${formatBackgroundServiceMode(modes)})`
|
|
233
249
|
}
|
|
234
250
|
|
|
251
|
+
function formatLazyWorkerArmedStatus(line) {
|
|
252
|
+
const queueMatch = line.match(/\((\d+) queue\(s\) watched,/)
|
|
253
|
+
const watchedCount = queueMatch ? Number.parseInt(queueMatch[1], 10) : null
|
|
254
|
+
const spawnMode = line.includes('shared worker mode')
|
|
255
|
+
? 'shared'
|
|
256
|
+
: line.includes('per-queue worker mode')
|
|
257
|
+
? 'per-queue'
|
|
258
|
+
: runtimeSummaryState.workerSpawnMode
|
|
259
|
+
const modeLabel = spawnMode ? `lazy ${spawnMode}` : 'lazy'
|
|
260
|
+
const watchedLabel = Number.isFinite(watchedCount)
|
|
261
|
+
? `, ${watchedCount} queue${watchedCount === 1 ? '' : 's'} watched`
|
|
262
|
+
: ''
|
|
263
|
+
const behaviorLabel = spawnMode === 'shared'
|
|
264
|
+
? '; first job starts one shared worker'
|
|
265
|
+
: spawnMode === 'per-queue'
|
|
266
|
+
? '; first job starts that queue worker'
|
|
267
|
+
: ''
|
|
268
|
+
|
|
269
|
+
return `Background workers armed (${modeLabel}${watchedLabel}${behaviorLabel})`
|
|
270
|
+
}
|
|
271
|
+
|
|
235
272
|
function loadRuntimePackageNames() {
|
|
236
273
|
const pkg = readJsonFile(path.join(process.cwd(), 'package.json'))
|
|
237
274
|
if (!pkg || typeof pkg !== 'object') return []
|
|
@@ -256,6 +293,7 @@ function updateRuntimeSummaryState() {
|
|
|
256
293
|
workerQueues: runtimeSummaryState.workerQueues,
|
|
257
294
|
schedulerActive: runtimeSummaryState.schedulerActive,
|
|
258
295
|
workerMode: runtimeSummaryState.workerMode,
|
|
296
|
+
workerSpawnMode: runtimeSummaryState.workerSpawnMode,
|
|
259
297
|
schedulerMode: runtimeSummaryState.schedulerMode,
|
|
260
298
|
})
|
|
261
299
|
}
|
|
@@ -283,6 +321,7 @@ function printBackgroundServicesSummary() {
|
|
|
283
321
|
const signature = JSON.stringify({
|
|
284
322
|
schedulerActive: runtimeSummaryState.schedulerActive,
|
|
285
323
|
workerMode: runtimeSummaryState.workerMode,
|
|
324
|
+
workerSpawnMode: runtimeSummaryState.workerSpawnMode,
|
|
286
325
|
schedulerMode: runtimeSummaryState.schedulerMode,
|
|
287
326
|
workerQueues: runtimeSummaryState.workerQueues,
|
|
288
327
|
})
|
|
@@ -293,9 +332,12 @@ function printBackgroundServicesSummary() {
|
|
|
293
332
|
|
|
294
333
|
runtimeSummaryState.lastWorkersSignature = signature
|
|
295
334
|
runtimeSummaryState.workersPrinted = true
|
|
335
|
+
const activeLabel = runtimeSummaryState.workerMode === 'lazy' && runtimeSummaryState.workerSpawnMode === 'shared'
|
|
336
|
+
? `${detailItems.length} active queue/scheduler runtimes`
|
|
337
|
+
: `${detailItems.length} active`
|
|
296
338
|
printCompactSummary(
|
|
297
339
|
'⚙️',
|
|
298
|
-
`Background services (${formatBackgroundServiceMode()}, ${
|
|
340
|
+
`Background services (${formatBackgroundServiceMode()}, ${activeLabel})`,
|
|
299
341
|
detailItems.map((item, index) => `${index === 0 ? '🕒' : '🧵'} ${item}`),
|
|
300
342
|
)
|
|
301
343
|
}
|
|
@@ -312,6 +354,11 @@ function captureBackgroundServiceLine(line) {
|
|
|
312
354
|
|| line.startsWith('[lazy-supervisor] Pending job detected')
|
|
313
355
|
) {
|
|
314
356
|
runtimeSummaryState.workerMode = 'lazy'
|
|
357
|
+
if (line.includes('shared worker mode') || line.includes('starting shared worker for all queues')) {
|
|
358
|
+
runtimeSummaryState.workerSpawnMode = 'shared'
|
|
359
|
+
} else if (line.includes('per-queue worker mode') || line.includes('starting worker for queue')) {
|
|
360
|
+
runtimeSummaryState.workerSpawnMode = 'per-queue'
|
|
361
|
+
}
|
|
315
362
|
updateRuntimeSummaryState()
|
|
316
363
|
return true
|
|
317
364
|
}
|
|
@@ -321,7 +368,10 @@ function captureBackgroundServiceLine(line) {
|
|
|
321
368
|
|| line === '[server] Eager worker auto-spawn enabled - starting workers for all queues...'
|
|
322
369
|
|| line.startsWith('🚀 Running queue:worker')
|
|
323
370
|
) {
|
|
324
|
-
runtimeSummaryState.workerMode
|
|
371
|
+
if (runtimeSummaryState.workerMode !== 'lazy') {
|
|
372
|
+
runtimeSummaryState.workerMode = 'eager'
|
|
373
|
+
runtimeSummaryState.workerSpawnMode = null
|
|
374
|
+
}
|
|
325
375
|
updateRuntimeSummaryState()
|
|
326
376
|
return true
|
|
327
377
|
}
|
|
@@ -363,7 +413,9 @@ function captureBackgroundServiceLine(line) {
|
|
|
363
413
|
|| line === '[server] Eager scheduler auto-spawn enabled - starting scheduler polling engine...'
|
|
364
414
|
|| line.startsWith('🚀 Running scheduler:start')
|
|
365
415
|
) {
|
|
366
|
-
runtimeSummaryState.schedulerMode
|
|
416
|
+
if (runtimeSummaryState.schedulerMode !== 'lazy') {
|
|
417
|
+
runtimeSummaryState.schedulerMode = 'eager'
|
|
418
|
+
}
|
|
367
419
|
runtimeSummaryState.schedulerActive = true
|
|
368
420
|
updateRuntimeSummaryState()
|
|
369
421
|
return true
|
|
@@ -450,6 +502,7 @@ function updateSplashState(patch) {
|
|
|
450
502
|
if (Array.isArray(patch.workerQueues)) splashState.workerQueues = patch.workerQueues
|
|
451
503
|
if (typeof patch.schedulerActive === 'boolean') splashState.schedulerActive = patch.schedulerActive
|
|
452
504
|
if (typeof patch.workerMode === 'string') splashState.workerMode = patch.workerMode
|
|
505
|
+
if (typeof patch.workerSpawnMode === 'string' || patch.workerSpawnMode === null) splashState.workerSpawnMode = patch.workerSpawnMode
|
|
453
506
|
if (typeof patch.schedulerMode === 'string') splashState.schedulerMode = patch.schedulerMode
|
|
454
507
|
if (typeof patch.progressCurrent === 'number') splashState.progressCurrent = patch.progressCurrent
|
|
455
508
|
if (typeof patch.progressTotal === 'number') splashState.progressTotal = patch.progressTotal
|
|
@@ -1623,14 +1676,18 @@ function classifyServerLine(line) {
|
|
|
1623
1676
|
|| line === '[server] Starting scheduler polling engine...'
|
|
1624
1677
|
|| line === '[server] Eager scheduler auto-spawn enabled - starting scheduler polling engine...'
|
|
1625
1678
|
|| line === '[lazy-scheduler] Enabled schedule detected - starting scheduler polling engine.'
|
|
1626
|
-
|| line.startsWith('🚀 Running queue:worker')
|
|
1627
|
-
|| line.startsWith('🚀 Running scheduler:start')
|
|
1628
1679
|
) {
|
|
1629
1680
|
const isLazyTrigger = line === '[lazy-scheduler] Enabled schedule detected - starting scheduler polling engine.'
|
|
1630
1681
|
const modes = isLazyTrigger
|
|
1631
|
-
? {
|
|
1682
|
+
? {
|
|
1683
|
+
workerMode: runtimeSummaryState.workerMode,
|
|
1684
|
+
workerSpawnMode: runtimeSummaryState.workerSpawnMode,
|
|
1685
|
+
schedulerMode: 'lazy',
|
|
1686
|
+
}
|
|
1632
1687
|
: runtimeSummaryState
|
|
1633
|
-
const status =
|
|
1688
|
+
const status = isLazyTrigger
|
|
1689
|
+
? 'Starting scheduler (lazy)'
|
|
1690
|
+
: formatBackgroundServiceStatus('Starting background services', modes)
|
|
1634
1691
|
return {
|
|
1635
1692
|
type: 'status',
|
|
1636
1693
|
message: `⚙️ ${status}`,
|
|
@@ -1642,7 +1699,7 @@ function classifyServerLine(line) {
|
|
|
1642
1699
|
}
|
|
1643
1700
|
}
|
|
1644
1701
|
if (line.startsWith('[server] Lazy worker auto-spawn enabled')) {
|
|
1645
|
-
const status =
|
|
1702
|
+
const status = formatLazyWorkerArmedStatus(line)
|
|
1646
1703
|
return {
|
|
1647
1704
|
type: 'status',
|
|
1648
1705
|
message: `⚙️ ${status}`,
|
|
@@ -1665,9 +1722,21 @@ function classifyServerLine(line) {
|
|
|
1665
1722
|
progressLabel: 'Background services (lazy)',
|
|
1666
1723
|
}
|
|
1667
1724
|
}
|
|
1725
|
+
if (line.match(/^\[lazy-supervisor\] Pending job detected(?: .*)? — starting shared worker for all queues$/)) {
|
|
1726
|
+
const status = 'Starting shared worker (lazy shared)'
|
|
1727
|
+
return {
|
|
1728
|
+
type: 'status',
|
|
1729
|
+
message: `⚙️ ${status}`,
|
|
1730
|
+
splashPhase: startupSplashPhase,
|
|
1731
|
+
splashDetail: status,
|
|
1732
|
+
activity: status,
|
|
1733
|
+
progressCurrent: 3,
|
|
1734
|
+
progressLabel: 'Background services (lazy shared)',
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1668
1737
|
const lazyWorkerStartMatch = line.match(/^\[lazy-supervisor\] Pending job detected .+ starting worker for queue "(.+)"$/)
|
|
1669
1738
|
if (lazyWorkerStartMatch) {
|
|
1670
|
-
const status = `Starting worker "${lazyWorkerStartMatch[1]}" (lazy)`
|
|
1739
|
+
const status = `Starting worker "${lazyWorkerStartMatch[1]}" (lazy per-queue)`
|
|
1671
1740
|
return {
|
|
1672
1741
|
type: 'status',
|
|
1673
1742
|
message: `⚙️ ${status}`,
|
package/template/scripts/dev.mjs
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
resolveSplashUrl as resolveSplashAccessUrl,
|
|
36
36
|
} from './dev-splash-url.mjs'
|
|
37
37
|
import { resolveDatabaseNameOverride } from './dev-database-url.mjs'
|
|
38
|
-
import { parseWatchScopeArgs, resolveWatchScope } from './watch-scope.mjs'
|
|
38
|
+
import { describeWatchMode, parseWatchScopeArgs, resolveWatchScope } from './watch-scope.mjs'
|
|
39
39
|
|
|
40
40
|
function detectDevRuntimeMode() {
|
|
41
41
|
const cwd = process.cwd()
|
|
@@ -213,6 +213,7 @@ const devLogTeeDisabled = process.env.OM_DEV_LOG_TEE === '0' || process.env.OM_D
|
|
|
213
213
|
|
|
214
214
|
let devLogSessionInstance = null
|
|
215
215
|
let devRunnerLogInstance = null
|
|
216
|
+
let localDevLazyWorkerModeDefaultLogged = false
|
|
216
217
|
|
|
217
218
|
function getDevLogSession() {
|
|
218
219
|
if (devLogSessionInstance) return devLogSessionInstance
|
|
@@ -570,6 +571,15 @@ function applyLocalDevBackgroundServiceDefaults(childEnv) {
|
|
|
570
571
|
|| process.env.OM_AUTO_SPAWN_WORKERS_LAZY_MODE.trim() === ''
|
|
571
572
|
) {
|
|
572
573
|
env.OM_AUTO_SPAWN_WORKERS_LAZY_MODE = 'shared'
|
|
574
|
+
const lazyWorkersRaw = process.env.OM_AUTO_SPAWN_WORKERS_LAZY
|
|
575
|
+
const lazyWorkersCanRun =
|
|
576
|
+
typeof lazyWorkersRaw !== 'string'
|
|
577
|
+
|| lazyWorkersRaw.trim() === ''
|
|
578
|
+
|| isEnabledEnvFlag(lazyWorkersRaw)
|
|
579
|
+
if (lazyWorkersCanRun && !localDevLazyWorkerModeDefaultLogged) {
|
|
580
|
+
localDevLazyWorkerModeDefaultLogged = true
|
|
581
|
+
console.warn('⚠️ OM_AUTO_SPAWN_WORKERS_LAZY_MODE is not set; defaulting to "shared" for local dev.')
|
|
582
|
+
}
|
|
573
583
|
}
|
|
574
584
|
if (
|
|
575
585
|
typeof process.env.OM_AUTO_SPAWN_SCHEDULER_LAZY !== 'string'
|
|
@@ -1612,14 +1622,16 @@ function startPackageWatch() {
|
|
|
1612
1622
|
const stageCurrent = greenfield ? 5 : 2
|
|
1613
1623
|
const stageTotal = greenfield ? 5 : 3
|
|
1614
1624
|
console.log(`👀 ${formatProgressLine('Watching workspace packages', stageCurrent, stageTotal, resolveProgressPercent(stageCurrent, stageTotal))}`)
|
|
1615
|
-
|
|
1616
|
-
|
|
1625
|
+
const watchMode = describeWatchMode(activeScope)
|
|
1626
|
+
console.log(` ↳ watch scope: ${watchMode.text}`)
|
|
1627
|
+
if (watchMode.mode !== 'all') {
|
|
1628
|
+
console.log(' tip: set OM_WATCH_SCOPE=all or pass --watch=all to watch every package')
|
|
1617
1629
|
}
|
|
1618
1630
|
updateSplashState({
|
|
1619
1631
|
phase: 'Watching workspace packages',
|
|
1620
|
-
detail:
|
|
1632
|
+
detail: watchMode.mode === 'all'
|
|
1621
1633
|
? 'Package watchers are running in the background'
|
|
1622
|
-
: `Package watchers are running (watch scope: ${
|
|
1634
|
+
: `Package watchers are running (watch scope: ${watchMode.text})`,
|
|
1623
1635
|
progressCurrent: stageCurrent,
|
|
1624
1636
|
progressTotal: stageTotal,
|
|
1625
1637
|
progressPercent: resolveProgressPercent(stageCurrent, stageTotal),
|
|
@@ -36,6 +36,24 @@ export const WATCH_SCOPES = [
|
|
|
36
36
|
WATCH_SCOPE_ENV,
|
|
37
37
|
]
|
|
38
38
|
|
|
39
|
+
// Friendly emoji + short description for each watch scope, used when the dev
|
|
40
|
+
// runtime announces the active mode in the log.
|
|
41
|
+
export const WATCH_SCOPE_DESCRIPTIONS = {
|
|
42
|
+
[WATCH_SCOPE_ALL]: { emoji: '🌐', label: 'all packages' },
|
|
43
|
+
[WATCH_SCOPE_AUTO]: { emoji: '⚡', label: 'auto-optimized (recently touched)' },
|
|
44
|
+
[WATCH_SCOPE_POPULAR]: { emoji: '🔥', label: 'popular (most frequently changed)' },
|
|
45
|
+
[WATCH_SCOPE_ENV]: { emoji: '🎯', label: 'explicit selection' },
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Resolve an emoji-decorated description of a watch mode for log output.
|
|
49
|
+
// Unknown modes fall back to the `all` description so callers always get a
|
|
50
|
+
// stable `{ mode, emoji, label, text }` shape.
|
|
51
|
+
export function describeWatchMode(mode) {
|
|
52
|
+
const normalized = WATCH_SCOPES.includes(mode) ? mode : WATCH_SCOPE_ALL
|
|
53
|
+
const { emoji, label } = WATCH_SCOPE_DESCRIPTIONS[normalized]
|
|
54
|
+
return { mode: normalized, emoji, label, text: `${emoji} ${normalized} — ${label}` }
|
|
55
|
+
}
|
|
56
|
+
|
|
39
57
|
// Re-check + expand interval for `auto-optimized`.
|
|
40
58
|
export const AUTO_EXPAND_INTERVAL_MS = 120000
|
|
41
59
|
|