@bakery-framework/cli 1.1.0 → 1.2.0

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakery-framework/cli",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Bakery entry point and process supervision: mode dispatch, dev watcher, cluster.",
5
5
  "keywords": [
6
6
  "bakery",
package/src/dev.ts CHANGED
@@ -16,7 +16,7 @@ try {
16
16
  '@bakery-framework/core/utils/http'
17
17
  )
18
18
  const { setupPlugins } = await import('@bakery-framework/core/startup')
19
- const { syncTSConfigPaths } = await import(
19
+ const { syncTSConfigPaths, syncTSConfigProjects } = await import(
20
20
  '@bakery-framework/core/compiler/tsconfig-sync'
21
21
  )
22
22
 
@@ -27,6 +27,9 @@ try {
27
27
  await initImportMap()
28
28
  initHostImportMaps()
29
29
  await syncTSConfigPaths()
30
+ // After setupPlugins(), so the plugin list is populated and each plugin
31
+ // contributing a project has been loaded.
32
+ await syncTSConfigProjects()
30
33
  } catch (error: any) {
31
34
  // errorMsg() already yields the stack, so the structured line below carries
32
35
  // everything the raw console.error used to duplicate.
package/src/index.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
3
  import '@bakery-framework/core/core/init'
4
+ // Safe as a static import: `core/port` reads `process.env` and imports nothing,
5
+ // so it cannot be the edge that closes core's barrel cycle.
6
+ import { applyPortFlag } from '@bakery-framework/core/core/port'
4
7
 
5
8
  const isDev = import.meta.env.DEV
6
9
  const isDevWorker = import.meta.env.DEV_WORKER
@@ -30,6 +33,13 @@ function getThreadsOption(): number | null {
30
33
 
31
34
  const threadsOption = getThreadsOption()
32
35
 
36
+ // Before any mode takes over, and before the config is read: `applyPortFlag`
37
+ // writes `process.env.PORT`, which is what the worker, the startup banner and
38
+ // the dev master's advertised URL all resolve from — and what the spawned dev
39
+ // worker and the cluster Workers inherit. Doing it here means none of them
40
+ // needed changing.
41
+ applyPortFlag()
42
+
33
43
  if (
34
44
  (process.argv.includes('--sync') || process.argv.includes('-s')) &&
35
45
  !isDevWorker &&