create-mercato-app 0.6.4-develop.3938.1.c97dbde799 → 0.6.4-develop.3944.1.4100aa7fbe
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/package.json
CHANGED
|
@@ -50,6 +50,12 @@ function parseEnvBooleanToken(value) {
|
|
|
50
50
|
return null
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
function parsePositiveIntegerEnv(value) {
|
|
54
|
+
if (typeof value !== 'string') return null
|
|
55
|
+
const parsed = Number.parseInt(value.trim(), 10)
|
|
56
|
+
return Number.isFinite(parsed) && parsed >= 0 ? parsed : null
|
|
57
|
+
}
|
|
58
|
+
|
|
53
59
|
function resolveAutoSpawnEnabled(env, legacyName, aliasedName) {
|
|
54
60
|
const legacy = parseEnvBooleanToken(env[legacyName])
|
|
55
61
|
if (legacy !== null) return legacy
|
|
@@ -87,9 +93,11 @@ const splashChildStateFile = process.env.OM_DEV_SPLASH_CHILD_STATE_FILE?.trim()
|
|
|
87
93
|
const splashMode = process.env.OM_DEV_SPLASH_MODE?.trim() || 'dev'
|
|
88
94
|
const setupSplashMode = splashMode === 'setup'
|
|
89
95
|
const startupSplashPhase = setupSplashMode ? 'Project setup is in progress...' : 'Installation and first compilation is in progress...'
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const
|
|
96
|
+
const configuredRuntimeProgressTotal = parsePositiveIntegerEnv(process.env.OM_DEV_SPLASH_STAGE_TOTAL)
|
|
97
|
+
const configuredRuntimeProgressCurrent = parsePositiveIntegerEnv(process.env.OM_DEV_SPLASH_STAGE_CURRENT)
|
|
98
|
+
const runtimeProgressTotal = configuredRuntimeProgressTotal ?? (setupSplashMode ? 5 : 4)
|
|
99
|
+
const runtimeProgressCurrent = configuredRuntimeProgressCurrent ?? (setupSplashMode ? 4 : 0)
|
|
100
|
+
const runtimeReadyProgressCurrent = Math.max(runtimeProgressCurrent, runtimeProgressTotal)
|
|
93
101
|
const children = new Set()
|
|
94
102
|
let shuttingDown = false
|
|
95
103
|
let logsVisible = false
|
|
@@ -489,6 +497,7 @@ function spawnMercato(args) {
|
|
|
489
497
|
...process.env,
|
|
490
498
|
OM_CLI_QUIET: rawPassthrough ? process.env.OM_CLI_QUIET : '1',
|
|
491
499
|
DOTENV_CONFIG_QUIET: rawPassthrough ? process.env.DOTENV_CONFIG_QUIET : 'true',
|
|
500
|
+
...(!rawPassthrough ? { OM_DEV_SPLASH_RUNTIME_WRAPPER: '1' } : {}),
|
|
492
501
|
},
|
|
493
502
|
...resolvedSpawn.spawnOptions,
|
|
494
503
|
})
|
|
@@ -1582,6 +1591,35 @@ function classifyServerLine(line) {
|
|
|
1582
1591
|
}
|
|
1583
1592
|
}
|
|
1584
1593
|
|
|
1594
|
+
const runtimeRestartMatch = line.match(/^\[server\] Detected (.+?)\. Restarting app runtime\.\.\.$/)
|
|
1595
|
+
if (runtimeRestartMatch) {
|
|
1596
|
+
const reason = runtimeRestartMatch[1]
|
|
1597
|
+
return {
|
|
1598
|
+
type: 'status',
|
|
1599
|
+
message: `🔄 Restarting app runtime: ${reason}`,
|
|
1600
|
+
splashPhase: 'App runtime is restarting',
|
|
1601
|
+
splashDetail: `Reason: ${reason}`,
|
|
1602
|
+
ready: false,
|
|
1603
|
+
activity: `App runtime restart: ${reason}`,
|
|
1604
|
+
progressCurrent: runtimeProgressCurrent,
|
|
1605
|
+
progressLabel: 'Restarting app runtime',
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
if (line === '[server] Detected corrupted Turbopack dev cache. Clearing .mercato/next/dev and restarting Next.js once...') {
|
|
1610
|
+
const reason = 'corrupted Turbopack dev cache'
|
|
1611
|
+
return {
|
|
1612
|
+
type: 'status',
|
|
1613
|
+
message: `🔄 Restarting Next.js dev server: ${reason}`,
|
|
1614
|
+
splashPhase: 'App runtime is restarting',
|
|
1615
|
+
splashDetail: `Reason: ${reason}`,
|
|
1616
|
+
ready: false,
|
|
1617
|
+
activity: `Next.js restart: ${reason}`,
|
|
1618
|
+
progressCurrent: runtimeProgressCurrent,
|
|
1619
|
+
progressLabel: 'Restarting app runtime',
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1585
1623
|
const localMatch = line.match(/^- Local:\s*(.+)$/)
|
|
1586
1624
|
if (localMatch) {
|
|
1587
1625
|
return {
|
|
@@ -1721,9 +1759,10 @@ async function runClassicRuntime() {
|
|
|
1721
1759
|
shutdown(initialGenerateExitCode)
|
|
1722
1760
|
}
|
|
1723
1761
|
|
|
1724
|
-
// Default ('in-process'): `mercato server dev`
|
|
1725
|
-
// regeneration watcher in-process
|
|
1726
|
-
//
|
|
1762
|
+
// Default ('in-process'): `mercato server dev` owns the structural
|
|
1763
|
+
// regeneration watcher in-process, so we no longer spawn the dedicated
|
|
1764
|
+
// sidecar. Saves ~190 MB of resident RSS by collapsing one Node process.
|
|
1765
|
+
// Opt back into the sidecar with OM_DEV_GENERATE_WATCH_MODE=legacy.
|
|
1727
1766
|
const watchers = []
|
|
1728
1767
|
if (generateWatchMode === 'legacy') {
|
|
1729
1768
|
watchers.push(['Generator watch (legacy sidecar)', spawnMercato(['generate', 'watch', '--skip-initial'])])
|
|
@@ -1751,6 +1790,11 @@ installLogToggle()
|
|
|
1751
1790
|
initializeRuntimeSummary()
|
|
1752
1791
|
printRuntimePackagesSummary()
|
|
1753
1792
|
|
|
1793
|
+
// Default ('in-process'): `mercato server dev` runs the structural
|
|
1794
|
+
// regeneration watcher in-process — see packages/cli/src/lib/in-process-generate-watcher.ts
|
|
1795
|
+
// — so the orchestrator no longer spawns a dedicated `mercato generate watch`
|
|
1796
|
+
// sidecar. Saves ~190 MB of resident RSS by eliminating one Node process.
|
|
1797
|
+
// Set OM_DEV_GENERATE_WATCH_MODE=legacy to opt back into the sidecar.
|
|
1754
1798
|
const sidecarWatch = generateWatchMode === 'legacy'
|
|
1755
1799
|
? startFilteredChild(['generate', 'watch', '--skip-initial'], 'Generator watch (legacy sidecar)', classifyWatchLine)
|
|
1756
1800
|
: null
|
package/template/scripts/dev.mjs
CHANGED
|
@@ -492,7 +492,7 @@ function resolveSplashLocaleConfig() {
|
|
|
492
492
|
return splashLocaleConfig
|
|
493
493
|
}
|
|
494
494
|
|
|
495
|
-
function buildSplashChildEnv() {
|
|
495
|
+
function buildSplashChildEnv(options = {}) {
|
|
496
496
|
const childEnv = devLogTeeDisabled
|
|
497
497
|
? {}
|
|
498
498
|
: {
|
|
@@ -508,6 +508,8 @@ function buildSplashChildEnv() {
|
|
|
508
508
|
...childEnv,
|
|
509
509
|
OM_DEV_SPLASH_CHILD_STATE_FILE: splashChildStateFile,
|
|
510
510
|
OM_DEV_SPLASH_MODE: splashMode,
|
|
511
|
+
...(Number.isFinite(options.stageCurrent) ? { OM_DEV_SPLASH_STAGE_CURRENT: String(options.stageCurrent) } : {}),
|
|
512
|
+
...(Number.isFinite(options.stageTotal) ? { OM_DEV_SPLASH_STAGE_TOTAL: String(options.stageTotal) } : {}),
|
|
511
513
|
}
|
|
512
514
|
}
|
|
513
515
|
|
|
@@ -528,8 +530,8 @@ function applyLocalDevBackgroundServiceDefaults(childEnv) {
|
|
|
528
530
|
return env
|
|
529
531
|
}
|
|
530
532
|
|
|
531
|
-
function buildAppDevEnv() {
|
|
532
|
-
return applyLocalDevBackgroundServiceDefaults(buildSplashChildEnv() ?? {})
|
|
533
|
+
function buildAppDevEnv(options = {}) {
|
|
534
|
+
return applyLocalDevBackgroundServiceDefaults(buildSplashChildEnv(options) ?? {})
|
|
533
535
|
}
|
|
534
536
|
|
|
535
537
|
function launchStandaloneDev(options = {}) {
|
|
@@ -566,7 +568,7 @@ function launchStandaloneDev(options = {}) {
|
|
|
566
568
|
|
|
567
569
|
const app = spawnCommand(process.execPath, runtimeArgs, {
|
|
568
570
|
stdio: 'inherit',
|
|
569
|
-
env: buildAppDevEnv(),
|
|
571
|
+
env: buildAppDevEnv({ stageCurrent, stageTotal }),
|
|
570
572
|
})
|
|
571
573
|
|
|
572
574
|
app.on('close', (code) => {
|
|
@@ -1615,7 +1617,7 @@ function launchMonorepoAppDev() {
|
|
|
1615
1617
|
})
|
|
1616
1618
|
const app = spawnCommand(yarnCommand, appArgs, {
|
|
1617
1619
|
stdio: 'inherit',
|
|
1618
|
-
env: buildAppDevEnv(),
|
|
1620
|
+
env: buildAppDevEnv({ stageCurrent, stageTotal }),
|
|
1619
1621
|
})
|
|
1620
1622
|
|
|
1621
1623
|
app.on('close', (code, signal) => {
|