@shopify/cli-hydrogen 11.0.1 → 11.1.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.
@@ -1,5 +1,11 @@
1
1
  # skeleton
2
2
 
3
+ ## 2025.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixing the skeleton's Vite Config ([#2958](https://github.com/Shopify/hydrogen/pull/2958)) by [@balazsbajorics](https://github.com/balazsbajorics)
8
+
3
9
  ## 2025.5.1
4
10
 
5
11
  ### Patch Changes
@@ -2,7 +2,7 @@
2
2
  "name": "skeleton",
3
3
  "private": true,
4
4
  "sideEffects": false,
5
- "version": "2025.5.1",
5
+ "version": "2025.5.2",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "build": "shopify hydrogen build --codegen",
@@ -23,7 +23,7 @@ export default defineConfig({
23
23
  * Include 'example-dep' in the array below.
24
24
  * @see https://vitejs.dev/config/dep-optimization-options
25
25
  */
26
- include: [],
26
+ include: ['set-cookie-parser', 'cookie', 'react-router'],
27
27
  },
28
28
  },
29
29
  });
@@ -1,6 +1,6 @@
1
1
  import { renderWarning, renderSuccess } from '@shopify/cli-kit/node/ui';
2
2
 
3
- const RESERVED_ROUTES = ["^api/[^/]+/graphql.json", "^cdn/", "^_t/"];
3
+ const RESERVED_ROUTES = ["^cdn/", "^_t/"];
4
4
  function findReservedRoutes(config) {
5
5
  const routes = /* @__PURE__ */ new Set();
6
6
  Object.values(config.routes).filter(
@@ -37,7 +37,7 @@ async function getViteConfig(root, ssrEntryFlag) {
37
37
  mode,
38
38
  mode
39
39
  );
40
- const { appDirectory, serverBuildFile, routes } = getRemixConfigFromVite(resolvedViteConfig);
40
+ const { appDirectory, serverBuildFile, routes } = getReactRouterOrRemixConfigFromVite(resolvedViteConfig);
41
41
  const serverOutDir = resolvedViteConfig.build.outDir;
42
42
  const clientOutDir = serverOutDir.replace(/server$/, "client");
43
43
  const rollupOutput = resolvedViteConfig.build.rollupOptions.output;
@@ -58,8 +58,8 @@ async function getViteConfig(root, ssrEntryFlag) {
58
58
  resolvedViteConfig,
59
59
  userViteConfig: maybeConfig.config,
60
60
  remixConfig: {
61
- routes,
62
- appDirectory,
61
+ routes: routes ?? {},
62
+ appDirectory: appDirectory ?? joinPath(resolvedViteConfig.root, "app"),
63
63
  rootDirectory: resolvedViteConfig.root,
64
64
  serverEntryPoint: (await findFileWithExtension(
65
65
  dirname(resolvedSsrEntry),
@@ -68,7 +68,16 @@ async function getViteConfig(root, ssrEntryFlag) {
68
68
  }
69
69
  };
70
70
  }
71
- function getRemixConfigFromVite(viteConfig) {
71
+ function getReactRouterOrRemixConfigFromVite(viteConfig) {
72
+ try {
73
+ const reactRouterConfig = getReactRouterConfigFromVite(viteConfig);
74
+ return reactRouterConfig;
75
+ } catch (error) {
76
+ const remixConfig = getRemixConfigFromVite(viteConfig);
77
+ return remixConfig;
78
+ }
79
+ }
80
+ function getReactRouterConfigFromVite(viteConfig) {
72
81
  if (!viteConfig.__reactRouterPluginContext) {
73
82
  throw new Error("Could not resolve React Router config");
74
83
  }
@@ -79,6 +88,14 @@ function getRemixConfigFromVite(viteConfig) {
79
88
  routes
80
89
  };
81
90
  }
91
+ function getRemixConfigFromVite(viteConfig) {
92
+ const { remixConfig } = findHydrogenPlugin(viteConfig)?.api?.getPluginOptions() ?? {};
93
+ return remixConfig ? {
94
+ appDirectory: remixConfig.appDirectory,
95
+ serverBuildFile: remixConfig.serverBuildFile,
96
+ routes: remixConfig.routes
97
+ } : {};
98
+ }
82
99
  function findPlugin(config, name) {
83
100
  return config.plugins.find((plugin) => plugin.name === name);
84
101
  }
@@ -1728,5 +1728,5 @@
1728
1728
  ]
1729
1729
  }
1730
1730
  },
1731
- "version": "11.0.1"
1731
+ "version": "11.1.0"
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.0.1",
7
+ "version": "11.1.0",
8
8
  "license": "MIT",
9
9
  "type": "module",
10
10
  "repository": {