@shopify/cli-hydrogen 11.1.2 → 11.1.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.
@@ -60,7 +60,7 @@ declare class Init extends Command {
60
60
  declare function runInit({ markets, ...options }?: InitOptions & {
61
61
  markets?: InitOptions['i18n'];
62
62
  }): Promise<{
63
- language?: "ts" | "js";
63
+ language?: "js" | "ts";
64
64
  packageManager: "npm" | "pnpm" | "yarn" | "bun" | "unknown";
65
65
  cssStrategy?: CssStrategy;
66
66
  cliCommand: CliCommand;
@@ -1,7 +1,7 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import { fileURLToPath } from 'node:url';
3
3
  import { getCodeFormatOptions, formatCode } from './format-code.js';
4
- import { renderWarning } from '@shopify/cli-kit/node/ui';
4
+ import { renderInfo, renderWarning } from '@shopify/cli-kit/node/ui';
5
5
  import { relativePath, resolvePath, joinPath, basename } from '@shopify/cli-kit/node/path';
6
6
  import { AbortError } from '@shopify/cli-kit/node/error';
7
7
  import { importLocal } from './import-utils.js';
@@ -71,7 +71,7 @@ function spawnCodegenProcess({
71
71
  if (/\.body\[\d\]/.test(message)) return;
72
72
  if (/console\.time(End)?\(\)/.test(message)) return;
73
73
  if (/─ (warning|info|success) ───/.test(message)) return;
74
- console.log("");
74
+ renderInfo({ body: "" });
75
75
  renderWarning({ headline: message, body: details });
76
76
  });
77
77
  child.on("close", (code) => {
@@ -97,6 +97,15 @@ async function codegen(options) {
97
97
  }
98
98
  async function executeReactRouterCodegen(options) {
99
99
  const { execSync, exec } = await import('child_process');
100
+ try {
101
+ execSync("npx react-router --version", {
102
+ cwd: options.rootDirectory,
103
+ stdio: "ignore"
104
+ });
105
+ } catch {
106
+ renderInfo({ body: "React Router not found, skipping typegen" });
107
+ return;
108
+ }
100
109
  if (options.watch) {
101
110
  exec("npx react-router typegen --watch", {
102
111
  cwd: options.rootDirectory
@@ -301,4 +310,4 @@ async function addHooksToHydrogenOptions(codegenConfig, { rootDirectory }) {
301
310
  }
302
311
  }
303
312
 
304
- export { codegen, generateDefaultConfig, spawnCodegenProcess };
313
+ export { codegen, executeReactRouterCodegen, generateDefaultConfig, spawnCodegenProcess };
@@ -1728,5 +1728,5 @@
1728
1728
  ]
1729
1729
  }
1730
1730
  },
1731
- "version": "11.1.2"
1731
+ "version": "11.1.3"
1732
1732
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "@shopify:registry": "https://registry.npmjs.org"
6
6
  },
7
- "version": "11.1.2",
7
+ "version": "11.1.3",
8
8
  "license": "MIT",
9
9
  "type": "module",
10
10
  "repository": {