@gtkx/cli 2.0.0-beta.2 → 2.0.0-beta.3

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 (114) hide show
  1. package/dist/cli.d.ts +1 -1
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +8 -2
  4. package/dist/cli.js.map +1 -1
  5. package/dist/codegen/reference.d.ts.map +1 -1
  6. package/dist/codegen/reference.js +1 -0
  7. package/dist/codegen/reference.js.map +1 -1
  8. package/dist/codegen/run-codegen.d.ts.map +1 -1
  9. package/dist/codegen/run-codegen.js +2 -8
  10. package/dist/codegen/run-codegen.js.map +1 -1
  11. package/dist/codegen/store-resolver.d.ts +1 -0
  12. package/dist/codegen/store-resolver.d.ts.map +1 -1
  13. package/dist/codegen/store-resolver.js +2 -1
  14. package/dist/codegen/store-resolver.js.map +1 -1
  15. package/dist/commands/dev.d.ts +1 -0
  16. package/dist/commands/dev.d.ts.map +1 -1
  17. package/dist/commands/dev.js +11 -4
  18. package/dist/commands/dev.js.map +1 -1
  19. package/dist/commands/docs.d.ts.map +1 -1
  20. package/dist/commands/docs.js +1 -0
  21. package/dist/commands/docs.js.map +1 -1
  22. package/dist/deploy/freedesktop/validate.d.ts.map +1 -1
  23. package/dist/deploy/freedesktop/validate.js +10 -4
  24. package/dist/deploy/freedesktop/validate.js.map +1 -1
  25. package/dist/deploy/nfpm/config.d.ts +3 -2
  26. package/dist/deploy/nfpm/config.d.ts.map +1 -1
  27. package/dist/deploy/nfpm/config.js +3 -3
  28. package/dist/deploy/nfpm/config.js.map +1 -1
  29. package/dist/deploy/node-runtime/index.d.ts.map +1 -1
  30. package/dist/deploy/node-runtime/index.js +2 -1
  31. package/dist/deploy/node-runtime/index.js.map +1 -1
  32. package/dist/deploy/targets/nfpm-target.d.ts.map +1 -1
  33. package/dist/deploy/targets/nfpm-target.js +12 -7
  34. package/dist/deploy/targets/nfpm-target.js.map +1 -1
  35. package/dist/dev/entry-env.d.ts +2 -1
  36. package/dist/dev/entry-env.d.ts.map +1 -1
  37. package/dist/dev/entry-env.js +2 -1
  38. package/dist/dev/entry-env.js.map +1 -1
  39. package/dist/dev/runner-deps.d.ts +1 -1
  40. package/dist/dev/runner-deps.d.ts.map +1 -1
  41. package/dist/dev/runner-deps.js +3 -3
  42. package/dist/dev/runner-deps.js.map +1 -1
  43. package/dist/dev/runner-main.d.ts.map +1 -1
  44. package/dist/dev/runner-main.js +8 -3
  45. package/dist/dev/runner-main.js.map +1 -1
  46. package/dist/dev/supervisor.d.ts +1 -0
  47. package/dist/dev/supervisor.d.ts.map +1 -1
  48. package/dist/dev/supervisor.js +4 -3
  49. package/dist/dev/supervisor.js.map +1 -1
  50. package/dist/i18n/catalogs.d.ts.map +1 -1
  51. package/dist/i18n/catalogs.js +1 -0
  52. package/dist/i18n/catalogs.js.map +1 -1
  53. package/dist/i18n/source-messages.d.ts.map +1 -1
  54. package/dist/i18n/source-messages.js +154 -36
  55. package/dist/i18n/source-messages.js.map +1 -1
  56. package/dist/internal/build-output.d.ts.map +1 -1
  57. package/dist/internal/build-output.js +12 -2
  58. package/dist/internal/build-output.js.map +1 -1
  59. package/dist/internal/docs-elements.d.ts +1 -0
  60. package/dist/internal/docs-elements.d.ts.map +1 -1
  61. package/dist/internal/docs-elements.js +5 -4
  62. package/dist/internal/docs-elements.js.map +1 -1
  63. package/dist/internal/errors.d.ts +2 -1
  64. package/dist/internal/errors.d.ts.map +1 -1
  65. package/dist/internal/errors.js +1 -1
  66. package/dist/internal/errors.js.map +1 -1
  67. package/dist/internal/parent-process.d.ts +12 -0
  68. package/dist/internal/parent-process.d.ts.map +1 -0
  69. package/dist/internal/parent-process.js +74 -0
  70. package/dist/internal/parent-process.js.map +1 -0
  71. package/dist/vite-plugins/ensure-store.d.ts +1 -1
  72. package/dist/vite-plugins/ensure-store.d.ts.map +1 -1
  73. package/dist/vite-plugins/ensure-store.js +2 -2
  74. package/dist/vite-plugins/ensure-store.js.map +1 -1
  75. package/dist/vite-plugins/i18n.d.ts.map +1 -1
  76. package/dist/vite-plugins/i18n.js +7 -7
  77. package/dist/vite-plugins/i18n.js.map +1 -1
  78. package/dist/vite-plugins/native.d.ts.map +1 -1
  79. package/dist/vite-plugins/native.js +0 -4
  80. package/dist/vite-plugins/native.js.map +1 -1
  81. package/dist/vite-plugins/settings-worker-env.d.ts +1 -1
  82. package/dist/vite-plugins/settings-worker-env.d.ts.map +1 -1
  83. package/dist/vite-plugins/settings-worker-env.js +2 -2
  84. package/dist/vite-plugins/settings-worker-env.js.map +1 -1
  85. package/dist/vitest-plugin.d.ts +2 -1
  86. package/dist/vitest-plugin.d.ts.map +1 -1
  87. package/dist/vitest-plugin.js +6 -6
  88. package/dist/vitest-plugin.js.map +1 -1
  89. package/package.json +10 -9
  90. package/src/cli.ts +8 -3
  91. package/src/codegen/reference.ts +1 -0
  92. package/src/codegen/run-codegen.ts +2 -12
  93. package/src/codegen/store-resolver.ts +3 -1
  94. package/src/commands/dev.ts +19 -4
  95. package/src/commands/docs.ts +1 -0
  96. package/src/deploy/freedesktop/validate.ts +12 -4
  97. package/src/deploy/nfpm/config.ts +9 -3
  98. package/src/deploy/node-runtime/index.ts +2 -1
  99. package/src/deploy/targets/nfpm-target.ts +13 -6
  100. package/src/dev/entry-env.ts +2 -1
  101. package/src/dev/runner-deps.ts +3 -3
  102. package/src/dev/runner-main.ts +10 -3
  103. package/src/dev/supervisor.ts +6 -3
  104. package/src/i18n/catalogs.ts +1 -0
  105. package/src/i18n/source-messages.ts +223 -40
  106. package/src/internal/build-output.ts +16 -2
  107. package/src/internal/docs-elements.ts +10 -4
  108. package/src/internal/errors.ts +1 -1
  109. package/src/internal/parent-process.ts +110 -0
  110. package/src/vite-plugins/ensure-store.ts +2 -2
  111. package/src/vite-plugins/i18n.ts +8 -11
  112. package/src/vite-plugins/native.ts +0 -5
  113. package/src/vite-plugins/settings-worker-env.ts +2 -2
  114. package/src/vitest-plugin.ts +6 -6
@@ -86,6 +86,7 @@ const codegenOptions = ({ store, libraries, girPath, elements }: CodegenOptionsI
86
86
  storeDir: store.giStoreDir,
87
87
  linkDir: store.giLinkDir,
88
88
  version: store.runtimeVersion,
89
+ owner: store.owner,
89
90
  },
90
91
  jsx:
91
92
  store.react === null
@@ -94,6 +95,7 @@ const codegenOptions = ({ store, libraries, girPath, elements }: CodegenOptionsI
94
95
  storeDir: store.jsxStoreDir,
95
96
  linkDir: store.jsxLinkDir,
96
97
  version: store.react.version,
98
+ owner: store.owner,
97
99
  },
98
100
  userComponents: resolveElementComponents(elements),
99
101
  userProps: resolveElementProps(elements),
@@ -111,14 +113,6 @@ const disabledCodegenResult = (configFile: string): RunCodegenResult => ({
111
113
  libraries: [],
112
114
  });
113
115
 
114
- const clearGeneratedStores = (store: CodegenStore): void => {
115
- removeStores(
116
- store.react === null
117
- ? [store.giStoreDir, store.giLinkDir]
118
- : [store.giStoreDir, store.giLinkDir, store.jsxStoreDir, store.jsxLinkDir],
119
- );
120
- };
121
-
122
116
  const prepareCodegen = (options: RunCodegenOptions, cwd: string, config: Config): PreparedCodegen => {
123
117
  const { girPath, libraries, store } = options.inputs ?? resolveCodegenInputs(cwd, config);
124
118
 
@@ -148,10 +142,6 @@ const runCodegen = async (options: RunCodegenOptions = {}): Promise<RunCodegenRe
148
142
 
149
143
  const { girPath, libraries, store, isForced } = prepareCodegen(options, cwd, config);
150
144
 
151
- if (options.isForced) {
152
- clearGeneratedStores(store);
153
- }
154
-
155
145
  const result = await runCodegenCore({
156
146
  ...codegenOptions({ store, libraries, girPath, elements: config.elements }),
157
147
  isForced,
@@ -1,6 +1,6 @@
1
1
  import { resolveStore } from "@gtkx/codegen";
2
2
  import { type Config, loadConfig } from "@gtkx/config";
3
- import { existsSync } from "node:fs";
3
+ import { existsSync, realpathSync } from "node:fs";
4
4
  import { createRequire } from "node:module";
5
5
  import { dirname, join } from "node:path";
6
6
  import { pathToFileURL } from "node:url";
@@ -11,6 +11,7 @@ type CodegenStore = {
11
11
  jsxStoreDir: string;
12
12
  jsxLinkDir: string;
13
13
  runtimeVersion: string;
14
+ owner: string;
14
15
  react: CodegenReactPackage | null;
15
16
  };
16
17
 
@@ -54,6 +55,7 @@ const resolveCodegenStore = (dir: string): CodegenStore => {
54
55
  jsxStoreDir: store.jsx?.storeDir ?? siblingStore(store.gi.storeDir),
55
56
  jsxLinkDir: store.jsx?.linkDir ?? siblingStore(store.gi.linkDir),
56
57
  runtimeVersion: store.gi.version,
58
+ owner: store.gi.owner ?? realpathSync(dir),
57
59
  react:
58
60
  hasReactRuntime && store.jsx !== null
59
61
  ? { version: store.jsx.version }
@@ -1,9 +1,11 @@
1
+ import { armParentDeath } from "@gtkx/native/internal";
1
2
  import { defineCommand } from "citty";
2
3
  import { resolveConfigWatch } from "../codegen/run-codegen.js";
3
4
  import { startHeadlessDevDisplay } from "../dev/headless.js";
4
5
  import { type DevWatch, runDevSupervisor } from "../dev/supervisor.js";
5
6
  import { splitApplicationArgs } from "../internal/application-args.js";
6
- import { entryArg } from "../internal/entry-arg.js";
7
+ import { configArg, entryArg } from "../internal/entry-arg.js";
8
+ import { getInitialProcessGroupOwner, initialParentId } from "../internal/parent-process.js";
7
9
  import { prepareProject } from "../internal/prepare-project.js";
8
10
 
9
11
  const DEV_MODE = "development";
@@ -15,6 +17,7 @@ const dev = defineCommand({
15
17
  },
16
18
  args: {
17
19
  ...entryArg,
20
+ ...configArg,
18
21
  headless: {
19
22
  type: "boolean",
20
23
  description: "Run on an isolated headless Wayland display",
@@ -25,17 +28,29 @@ const dev = defineCommand({
25
28
  },
26
29
  },
27
30
  async run({ args }) {
31
+ const initialProcessGroupOwner = getInitialProcessGroupOwner();
32
+
33
+ if (
34
+ !armParentDeath(
35
+ initialParentId,
36
+ initialProcessGroupOwner?.pid,
37
+ initialProcessGroupOwner?.startTime,
38
+ )
39
+ ) {
40
+ throw new Error("The process that launched gtkx dev exited during startup");
41
+ }
42
+
28
43
  if (args.size !== undefined && !args.headless) {
29
44
  throw new Error("--size requires --headless");
30
45
  }
31
46
 
32
- const { cwd, entry: entryPath } = await prepareProject(args, DEV_MODE);
33
- const watch: DevWatch | undefined = await resolveConfigWatch(cwd, DEV_MODE);
47
+ const { cwd, entry: entryPath, configFile } = await prepareProject(args, DEV_MODE);
48
+ const watch: DevWatch | undefined = await resolveConfigWatch(cwd, DEV_MODE, configFile);
34
49
  const { applicationArgs } = splitApplicationArgs(process.argv.slice(2));
35
50
  const stopHeadless = args.headless ? await startHeadlessDevDisplay(args.size) : undefined;
36
51
 
37
52
  try {
38
- await runDevSupervisor({ entryPath, cwd, args: applicationArgs, watch });
53
+ await runDevSupervisor({ entryPath, cwd, configFile, args: applicationArgs, watch });
39
54
  } finally {
40
55
  stopHeadless?.();
41
56
  }
@@ -68,6 +68,7 @@ const docs = defineCommand({
68
68
  outDir,
69
69
  basePath: args["base-path"],
70
70
  props: builtin.props,
71
+ acceptedChildTypes: builtin.acceptedChildTypes,
71
72
  omittedProps: mergeOmittedProps(builtin.omittedProps, resolveOmittedProps(config.elements)),
72
73
  isForced: args.force,
73
74
  });
@@ -12,6 +12,7 @@ type MetainfoResult = {
12
12
  status: number;
13
13
  errors: string[];
14
14
  warnings: string[];
15
+ rules: string[];
15
16
  areWarningsFatal: boolean;
16
17
  };
17
18
 
@@ -25,6 +26,7 @@ const DIAGNOSTIC = /^(?<severity>[EIPW]): \S+ (?<rule>[\w-]+)/;
25
26
  const ERROR_SEVERITY = "E";
26
27
  const WARNING_SEVERITY = "W";
27
28
  const INFO_SEVERITY = "I";
29
+ const FATAL_WARNING_RULES: Set<string> = new Set(["unknown-tag"]);
28
30
 
29
31
  const REMEDY_FOR_RULE: Record<string, string> = {
30
32
  "component-summary-missing": "set `deploy.summary`",
@@ -64,11 +66,15 @@ const remedyLines = (rules: string[]): string[] => {
64
66
  const invalid = (subject: string, output: string, rules: string[]): Error =>
65
67
  new Error([`${subject} is not valid:`, output.length > 0 ? output : "no output", ...remedyLines(rules)].join("\n"));
66
68
 
67
- const isFatalResult = ({ status, errors, warnings, areWarningsFatal }: MetainfoResult): boolean => {
69
+ const isFatalResult = ({ status, errors, warnings, rules, areWarningsFatal }: MetainfoResult): boolean => {
68
70
  if (errors.length > 0) {
69
71
  return true;
70
72
  }
71
73
 
74
+ if (rules.some((rule) => FATAL_WARNING_RULES.has(rule))) {
75
+ return true;
76
+ }
77
+
72
78
  if (areWarningsFatal && warnings.length > 0) {
73
79
  return true;
74
80
  }
@@ -78,7 +84,7 @@ const isFatalResult = ({ status, errors, warnings, areWarningsFatal }: MetainfoR
78
84
 
79
85
  const assertNotFatal = (result: MetainfoResult): void => {
80
86
  if (isFatalResult(result)) {
81
- throw invalid(result.subject, result.output, [...result.errors, ...result.warnings]);
87
+ throw invalid(result.subject, result.output, result.rules);
82
88
  }
83
89
  };
84
90
 
@@ -117,8 +123,10 @@ const validateMetainfo = (path: string, areWarningsFatal: boolean): void => {
117
123
 
118
124
  const errors = rulesIn(output, [ERROR_SEVERITY]);
119
125
  const warnings = rulesIn(output, [WARNING_SEVERITY]);
120
- assertNotFatal({ subject, output, status, errors, warnings, areWarningsFatal });
121
- reportDiagnostics(subject, [...warnings, ...rulesIn(output, [INFO_SEVERITY])]);
126
+ const infos = rulesIn(output, [INFO_SEVERITY]);
127
+ const rules = [...errors, ...warnings, ...infos];
128
+ assertNotFatal({ subject, output, status, errors, warnings, rules, areWarningsFatal });
129
+ reportDiagnostics(subject, [...warnings, ...infos]);
122
130
  };
123
131
 
124
132
  export { validateDesktopEntry, validateMetainfo };
@@ -114,6 +114,9 @@ const stagedFilesFor = (payload: DeployPayload, packager: NfpmPackager): StagedF
114
114
  ...payload.overlays[packager],
115
115
  ];
116
116
 
117
+ const glibcMinimumForPackage = (payload: DeployPayload, packager: NfpmPackager): string | null =>
118
+ glibcMinimumForFiles(stagedFilesFor(payload, packager).map((file) => file.abs));
119
+
117
120
  const packagerSettings = (settings: DeploySettings, packager: NfpmPackager): NfpmConfig =>
118
121
  packager === "rpm" ? rpmSettings(settings) : debSettings(settings);
119
122
 
@@ -123,11 +126,14 @@ const releaseFor = (settings: DeploySettings, packager: NfpmPackager): string =>
123
126
  const descriptionFor = (settings: DeploySettings, packager: NfpmPackager): string =>
124
127
  packager === "rpm" ? rpmDescription(settings) : debDescription(settings);
125
128
 
126
- const renderNfpmConfig = (payload: DeployPayload, packager: NfpmPackager): NfpmConfig => {
129
+ const renderNfpmConfig = (
130
+ payload: DeployPayload,
131
+ packager: NfpmPackager,
132
+ glibcMinimum: string | null,
133
+ ): NfpmConfig => {
127
134
  const settings = payload.settings;
128
135
  const isRpm = packager === "rpm";
129
136
  const staged = stagedFilesFor(payload, packager);
130
- const glibcMinimum = glibcMinimumForFiles(staged.map((file) => file.abs));
131
137
  const depends = resolveDepends(settings, glibcMinimum);
132
138
 
133
139
  return {
@@ -153,4 +159,4 @@ const renderNfpmConfig = (payload: DeployPayload, packager: NfpmPackager): NfpmC
153
159
  };
154
160
  };
155
161
 
156
- export { type NfpmPackager, packageNameFor, renderNfpmConfig };
162
+ export { glibcMinimumForPackage, type NfpmPackager, packageNameFor, renderNfpmConfig };
@@ -178,7 +178,8 @@ const resolveNodeRuntime = async (settings: DeploySettings): Promise<NodeRuntime
178
178
  const staged = await stageFromSource(settings, version, source);
179
179
  const isStripped = node.shouldStrip === false ? false : didStripBinary(staged.path);
180
180
  const elf = readElfInfo(staged.path);
181
- info(`Bundled Node.js v${version} (${megabytes(staged.path)} MiB, glibc >= ${elf.glibcMinimum ?? "unknown"})`);
181
+ const glibcMinimum = elf.glibcMinimum ?? "unknown";
182
+ info(`Bundled Node.js v${version} (${megabytes(staged.path)} MiB, runtime glibc >= ${glibcMinimum})`);
182
183
 
183
184
  return { ...staged, version, glibcMinimum: elf.glibcMinimum, isStripped };
184
185
  };
@@ -1,7 +1,8 @@
1
+ import { info } from "@gtkx/utils";
1
2
  import { join } from "node:path";
2
3
  import { stringify } from "yaml";
3
4
  import type { DeployArtifact, DeployManifest, DeployPayload, DeployTarget } from "../types.js";
4
- import { type NfpmPackager, renderNfpmConfig } from "../nfpm/config.js";
5
+ import { glibcMinimumForPackage, type NfpmPackager, renderNfpmConfig } from "../nfpm/config.js";
5
6
  import { packWithNfpm } from "../nfpm/pack.js";
6
7
  import { TAR } from "../tools.js";
7
8
 
@@ -11,12 +12,18 @@ const PREFIX = "/usr";
11
12
  const manifestPathFor = (payload: DeployPayload, packager: NfpmPackager): string =>
12
13
  join(payload.settings.paths.targets, packager, MANIFEST_FILENAME);
13
14
 
14
- const renderManifests = (payload: DeployPayload, packager: NfpmPackager): DeployManifest[] => [
15
- {
15
+ const renderManifests = (payload: DeployPayload, packager: NfpmPackager): DeployManifest[] => {
16
+ const glibcMinimum = glibcMinimumForPackage(payload, packager);
17
+
18
+ if (glibcMinimum !== null) {
19
+ info(`${packager} package requires glibc >= ${glibcMinimum}`);
20
+ }
21
+
22
+ return [{
16
23
  path: manifestPathFor(payload, packager),
17
- contents: stringify(renderNfpmConfig(payload, packager), { lineWidth: 0 }),
18
- },
19
- ];
24
+ contents: stringify(renderNfpmConfig(payload, packager, glibcMinimum), { lineWidth: 0 }),
25
+ }];
26
+ };
20
27
 
21
28
  const packPackage = async (payload: DeployPayload, packager: NfpmPackager): Promise<DeployArtifact[]> => [
22
29
  await packWithNfpm(payload, packager, manifestPathFor(payload, packager)),
@@ -1,3 +1,4 @@
1
1
  const DEV_ENTRY_ENV = "GTKX_DEV_ENTRY";
2
+ const DEV_CONFIG_ENV = "GTKX_DEV_CONFIG";
2
3
 
3
- export { DEV_ENTRY_ENV };
4
+ export { DEV_CONFIG_ENV, DEV_ENTRY_ENV };
@@ -43,11 +43,11 @@ const waitForApplicationId = async (timeoutMs: number, shouldKeepWaiting: () =>
43
43
 
44
44
  const readFileRevision = (path: string): Promise<string> => readFile(path, "utf8");
45
45
 
46
- const defaultDevRunnerDeps = (): DevRunnerDeps => ({
46
+ const defaultDevRunnerDeps = (configFile: string): DevRunnerDeps => ({
47
47
  createServer,
48
48
  waitForApplicationId,
49
49
  getConfiguredApplicationId: async (root: string) => {
50
- const loaded = await loadConfig(root, { mode: DEV_MODE });
50
+ const loaded = await loadConfig(root, { mode: DEV_MODE, configFile });
51
51
 
52
52
  return loaded.config.applicationId;
53
53
  },
@@ -87,7 +87,7 @@ const defaultDevRunnerDeps = (): DevRunnerDeps => ({
87
87
  staleExportName,
88
88
  readFileRevision,
89
89
  plugins: (entryPath) => [
90
- ...gtkxVitePlugins({ mode: DEV_MODE, entryPath }),
90
+ ...gtkxVitePlugins({ mode: DEV_MODE, entryPath, configFile }),
91
91
  ...gtkxFastRefresh(),
92
92
  gtkxReactDomPrebundle(),
93
93
  ],
@@ -1,7 +1,7 @@
1
1
  import { loadConfig } from "@gtkx/config";
2
2
  import { error } from "@gtkx/utils";
3
3
  import { resolve } from "node:path";
4
- import { DEV_ENTRY_ENV } from "./entry-env.js";
4
+ import { DEV_CONFIG_ENV, DEV_ENTRY_ENV } from "./entry-env.js";
5
5
  import { prepareDevIconDir } from "./icon-dir.js";
6
6
  import { prepareDevLocaleDir } from "./locale-dir.js";
7
7
  import { createDevRunner } from "./runner.js";
@@ -22,13 +22,20 @@ const main = async (): Promise<void> => {
22
22
  process.exit(1);
23
23
  }
24
24
 
25
- const { config, root } = await loadConfig(cwd, { mode: "development" });
25
+ const configFile = process.env[DEV_CONFIG_ENV];
26
+
27
+ if (!configFile) {
28
+ error(`Missing ${DEV_CONFIG_ENV}`);
29
+ process.exit(1);
30
+ }
31
+
32
+ const { config, root } = await loadConfig(cwd, { mode: "development", configFile });
26
33
  prepareDevLocaleDir(root, config.applicationId);
27
34
  prepareDevSchemaDir(root);
28
35
  prepareDevIconDir(root, config.applicationId, config.applicationIcon);
29
36
  const entryPath = resolve(cwd, entryArg);
30
37
  const { defaultDevRunnerDeps } = await import("./runner-deps.js");
31
- const runner = createDevRunner(defaultDevRunnerDeps());
38
+ const runner = createDevRunner(defaultDevRunnerDeps(configFile));
32
39
  await runner.run(entryPath);
33
40
  };
34
41
 
@@ -3,7 +3,7 @@ import { fork as nodeFork } from "node:child_process";
3
3
  import { type FSWatcher, watch as watchFs } from "node:fs";
4
4
  import { basename, dirname } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
- import { DEV_ENTRY_ENV } from "./entry-env.js";
6
+ import { DEV_CONFIG_ENV, DEV_ENTRY_ENV } from "./entry-env.js";
7
7
 
8
8
  type SupervisedChild = {
9
9
  killed: boolean;
@@ -24,6 +24,7 @@ type DevWatch = {
24
24
  type SupervisorState = {
25
25
  runnerPath: string;
26
26
  entryPath: string;
27
+ configFile: string;
27
28
  cwd: string;
28
29
  args: string[];
29
30
  watch: DevWatch | undefined;
@@ -37,6 +38,7 @@ type SupervisorState = {
37
38
 
38
39
  type DevSupervisorOptions = {
39
40
  entryPath: string;
41
+ configFile: string;
40
42
  cwd: string;
41
43
  args?: string[] | undefined;
42
44
  watch?: DevWatch | undefined;
@@ -128,7 +130,7 @@ const launch = (state: SupervisorState): void => {
128
130
  const child = state.fork(
129
131
  state.runnerPath,
130
132
  state.args,
131
- { ...process.env, [DEV_ENTRY_ENV]: state.entryPath },
133
+ { ...process.env, [DEV_CONFIG_ENV]: state.configFile, [DEV_ENTRY_ENV]: state.entryPath },
132
134
  state.cwd,
133
135
  );
134
136
 
@@ -286,11 +288,12 @@ const installShutdown = (state: SupervisorState): void => {
286
288
  };
287
289
 
288
290
  const runDevSupervisor = async (options: DevSupervisorOptions): Promise<never> => {
289
- const { entryPath, cwd, args = [], watch, fork = defaultForkRunner } = options;
291
+ const { entryPath, configFile, cwd, args = [], watch, fork = defaultForkRunner } = options;
290
292
 
291
293
  const state: SupervisorState = {
292
294
  runnerPath: fileURLToPath(DEV_RUNNER_URL),
293
295
  entryPath,
296
+ configFile,
294
297
  cwd,
295
298
  args,
296
299
  watch,
@@ -133,6 +133,7 @@ const initializeCatalog = (catalog: Catalog, template: string, output: string):
133
133
  `--input=${template}`,
134
134
  `--output-file=${output}`,
135
135
  ],
136
+ options: { stdio: "pipe" },
136
137
  target: catalog.path,
137
138
  });
138
139
  };