@shopify/cli-hydrogen 4.0.7 → 4.0.9

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/README.md CHANGED
@@ -3,3 +3,12 @@
3
3
  The Hydrogen extension for the [Shopify CLI](https://shopify.dev/apps/tools/cli). Hydrogen is a set of tools, utilities, and best-in-class examples for building a commerce application with [Remix](https://wwww.remix.run).
4
4
 
5
5
  [Check out the docs](https://shopify.dev/custom-storefronts/hydrogen)
6
+
7
+ ## Contributing
8
+
9
+ The most common way to test the cli changes locally is to do the following:
10
+
11
+ - Run `npm run build` in this directory (`packages/cli` from the root of the repo).
12
+ - Run `npx shopify hydrogen` anywhere else in the monorepo, for example `npx shopify hydrogen init`.
13
+ - If you want to test a command inside of a template, run the command from within that template or use the `--path` flag to point to another template or any Hydrogen app.
14
+ - If you want to make changes to a file that is generated when running `npx shopify hydrogen generate`, make changes to that file from inside of the `templates/skeleton` directory.
@@ -7,6 +7,9 @@ declare class Build extends Command {
7
7
  path: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
8
8
  sourcemap: _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
9
9
  "disable-route-warning": _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
10
+ base: _oclif_core_lib_interfaces_parser_js.OptionFlag<unknown>;
11
+ entry: _oclif_core_lib_interfaces_parser_js.OptionFlag<unknown>;
12
+ target: _oclif_core_lib_interfaces_parser_js.OptionFlag<unknown>;
10
13
  };
11
14
  run(): Promise<void>;
12
15
  }
@@ -2,7 +2,7 @@ import path from 'path';
2
2
  import { file, output } from '@shopify/cli-kit';
3
3
  import colors from '@shopify/cli-kit/node/colors';
4
4
  import { getProjectPaths, getRemixConfig } from '../../utils/config.js';
5
- import { commonFlags, flagsToCamelObject } from '../../utils/flags.js';
5
+ import { commonFlags, deprecated, flagsToCamelObject } from '../../utils/flags.js';
6
6
  import Command from '@shopify/cli-kit/node/base-command';
7
7
  import Flags from '@oclif/core/lib/flags.js';
8
8
  import { checkLockfileStatus } from '../../utils/check-lockfile.js';
@@ -22,7 +22,10 @@ class Build extends Command {
22
22
  ["disable-route-warning"]: Flags.boolean({
23
23
  description: "Disable warning about missing standard routes.",
24
24
  env: "SHOPIFY_HYDROGEN_FLAG_DISABLE_ROUTE_WARNING"
25
- })
25
+ }),
26
+ base: deprecated("--base")(),
27
+ entry: deprecated("--entry")(),
28
+ target: deprecated("--target")()
26
29
  };
27
30
  async run() {
28
31
  const { flags } = await this.parse(Build);
@@ -7,6 +7,7 @@ declare class Dev extends Command {
7
7
  path: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
8
8
  port: _oclif_core_lib_interfaces_parser_js.OptionFlag<number>;
9
9
  "disable-virtual-routes": _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
10
+ host: _oclif_core_lib_interfaces_parser_js.OptionFlag<unknown>;
10
11
  };
11
12
  run(): Promise<void>;
12
13
  }
@@ -1,10 +1,10 @@
1
1
  import path from 'path';
2
2
  import fs from 'fs/promises';
3
- import { output } from '@shopify/cli-kit';
3
+ import { output, file } from '@shopify/cli-kit';
4
4
  import { copyPublicFiles } from './build.js';
5
5
  import { getProjectPaths, getRemixConfig } from '../../utils/config.js';
6
6
  import { muteDevLogs } from '../../utils/log.js';
7
- import { commonFlags, flagsToCamelObject } from '../../utils/flags.js';
7
+ import { commonFlags, deprecated, flagsToCamelObject } from '../../utils/flags.js';
8
8
  import Command from '@shopify/cli-kit/node/base-command';
9
9
  import Flags from '@oclif/core/lib/flags.js';
10
10
  import { startMiniOxygen } from '../../utils/mini-oxygen.js';
@@ -23,7 +23,8 @@ class Dev extends Command {
23
23
  description: "Disable rendering fallback routes when a route file doesn't exist",
24
24
  env: "SHOPIFY_HYDROGEN_FLAG_DISABLE_VIRTUAL_ROUTES",
25
25
  default: false
26
- })
26
+ }),
27
+ host: deprecated("--host")()
27
28
  };
28
29
  async run() {
29
30
  const { flags } = await this.parse(Dev);
@@ -47,30 +48,47 @@ async function runDev({
47
48
  const config = await getRemixConfig(root);
48
49
  return disableVirtualRoutes ? config : addVirtualRoutes(config);
49
50
  };
50
- const getFilePaths = (file) => {
51
- const fileRelative = path.relative(root, file);
51
+ const getFilePaths = (file2) => {
52
+ const fileRelative = path.relative(root, file2);
52
53
  return [fileRelative, path.resolve(root, fileRelative)];
53
54
  };
55
+ const serverBundleExists = () => file.exists(buildPathWorkerFile);
56
+ let miniOxygenStarted = false;
57
+ async function safeStartMiniOxygen() {
58
+ if (miniOxygenStarted)
59
+ return;
60
+ await startMiniOxygen({
61
+ root,
62
+ port,
63
+ watch: true,
64
+ buildPathWorkerFile,
65
+ buildPathClient
66
+ });
67
+ miniOxygenStarted = true;
68
+ const showUpgrade = await checkingHydrogenVersion;
69
+ if (showUpgrade)
70
+ showUpgrade();
71
+ }
54
72
  const { watch } = await import('@remix-run/dev/dist/compiler/watch.js');
55
73
  await watch(await reloadConfig(), {
56
74
  reloadConfig,
57
75
  mode: process.env.NODE_ENV,
58
76
  async onInitialBuild() {
59
77
  await copyingFiles;
78
+ if (!await serverBundleExists()) {
79
+ const { renderFatalError } = await import('@shopify/cli-kit/node/ui');
80
+ return renderFatalError({
81
+ name: "BuildError",
82
+ type: 0,
83
+ message: "MiniOxygen cannot start because the server bundle has not been generated.",
84
+ tryMessage: "This is likely due to an error in your app and Remix is unable to compile. Try fixing the app and MiniOxygen will start."
85
+ });
86
+ }
60
87
  console.timeEnd(LOG_INITIAL_BUILD);
61
- await startMiniOxygen({
62
- root,
63
- port,
64
- watch: true,
65
- buildPathWorkerFile,
66
- buildPathClient
67
- });
68
- const showUpgrade = await checkingHydrogenVersion;
69
- if (showUpgrade)
70
- showUpgrade();
88
+ await safeStartMiniOxygen();
71
89
  },
72
- async onFileCreated(file) {
73
- const [relative, absolute] = getFilePaths(file);
90
+ async onFileCreated(file2) {
91
+ const [relative, absolute] = getFilePaths(file2);
74
92
  output.info(`
75
93
  \u{1F4C4} File created: ${relative}`);
76
94
  if (absolute.startsWith(publicPath)) {
@@ -80,8 +98,8 @@ async function runDev({
80
98
  );
81
99
  }
82
100
  },
83
- async onFileChanged(file) {
84
- const [relative, absolute] = getFilePaths(file);
101
+ async onFileChanged(file2) {
102
+ const [relative, absolute] = getFilePaths(file2);
85
103
  output.info(`
86
104
  \u{1F4C4} File changed: ${relative}`);
87
105
  if (absolute.startsWith(publicPath)) {
@@ -91,8 +109,8 @@ async function runDev({
91
109
  );
92
110
  }
93
111
  },
94
- async onFileDeleted(file) {
95
- const [relative, absolute] = getFilePaths(file);
112
+ async onFileDeleted(file2) {
113
+ const [relative, absolute] = getFilePaths(file2);
96
114
  output.info(`
97
115
  \u{1F4C4} File deleted: ${relative}`);
98
116
  if (absolute.startsWith(publicPath)) {
@@ -105,6 +123,10 @@ async function runDev({
105
123
  },
106
124
  async onRebuildFinish() {
107
125
  console.timeEnd(LOG_REBUILT);
126
+ if (!miniOxygenStarted && await serverBundleExists()) {
127
+ console.log("");
128
+ await safeStartMiniOxygen();
129
+ }
108
130
  }
109
131
  });
110
132
  }
@@ -3,7 +3,7 @@ import { packageManagerUsedForCreating, installNodeModules } from '@shopify/cli-
3
3
  import { renderFatalError } from '@shopify/cli-kit/node/ui';
4
4
  import Flags from '@oclif/core/lib/flags.js';
5
5
  import { output, path } from '@shopify/cli-kit';
6
- import { commonFlags, parseProcessFlags } from '../../utils/flags.js';
6
+ import { commonFlags, flagsToCamelObject, parseProcessFlags } from '../../utils/flags.js';
7
7
  import { transpileProject } from '../../utils/transpile-ts.js';
8
8
  import { getLatestTemplates } from '../../utils/template-downloader.js';
9
9
  import { checkHydrogenVersion } from '../../utils/check-version.js';
@@ -32,13 +32,13 @@ class Init extends Command {
32
32
  }),
33
33
  "install-deps": Flags.boolean({
34
34
  description: "Auto install dependencies using the active package manager",
35
- env: "SHOPIFY_HYDROGEN_INSTALL_DEPS",
35
+ env: "SHOPIFY_HYDROGEN_FLAG_INSTALL_DEPS",
36
36
  allowNo: true
37
37
  })
38
38
  };
39
39
  async run() {
40
40
  const { flags } = await this.parse(Init);
41
- await runInit({ ...flags });
41
+ await runInit(flagsToCamelObject(flags));
42
42
  }
43
43
  }
44
44
  async function runInit(options = parseProcessFlags(process.argv, FLAG_MAP)) {
@@ -0,0 +1,79 @@
1
+ import { describe, beforeEach, vi, it, expect } from 'vitest';
2
+ import { temporaryDirectoryTask } from 'tempy';
3
+ import { runInit } from './init.js';
4
+ import { ui } from '@shopify/cli-kit';
5
+ import { installNodeModules } from '@shopify/cli-kit/node/node-package-manager';
6
+
7
+ describe("init", () => {
8
+ beforeEach(() => {
9
+ vi.resetAllMocks();
10
+ vi.mock("@shopify/cli-kit");
11
+ vi.mock("../../utils/transpile-ts.js");
12
+ vi.mock("../../utils/template-downloader.js", async () => ({
13
+ getLatestTemplates: () => Promise.resolve({})
14
+ }));
15
+ vi.mock("@shopify/cli-kit/node/node-package-manager");
16
+ vi.mocked(ui.prompt).mockImplementation(
17
+ () => Promise.resolve({ installDeps: "false" })
18
+ );
19
+ });
20
+ const defaultOptions = (stubs) => ({
21
+ template: "hello-world",
22
+ language: "js",
23
+ path: "path/to/project",
24
+ ...stubs
25
+ });
26
+ describe.each([
27
+ { flag: "template", value: "hello-world" },
28
+ { flag: "installDeps", value: true },
29
+ { flag: "language", value: "ts" },
30
+ { flag: "path", value: "./my-app" }
31
+ ])("flag $flag", ({ flag, value }) => {
32
+ it(`does not prompt the user for ${flag} when a value is passed in options`, async () => {
33
+ await temporaryDirectoryTask(async (tmpDir) => {
34
+ const options = defaultOptions({
35
+ path: tmpDir,
36
+ [flag]: value
37
+ });
38
+ await runInit(options);
39
+ expect(ui.prompt).not.toHaveBeenCalledWith(
40
+ expect.arrayContaining([
41
+ expect.objectContaining({
42
+ name: flag
43
+ })
44
+ ])
45
+ );
46
+ });
47
+ });
48
+ it(`prompts the user for ${flag} when no value is passed in options`, async () => {
49
+ await temporaryDirectoryTask(async (tmpDir) => {
50
+ const options = defaultOptions({
51
+ path: tmpDir,
52
+ [flag]: void 0
53
+ });
54
+ await runInit(options);
55
+ expect(ui.prompt).toHaveBeenCalledWith(
56
+ expect.arrayContaining([
57
+ expect.objectContaining({
58
+ name: flag
59
+ })
60
+ ])
61
+ );
62
+ });
63
+ });
64
+ });
65
+ it("installs dependencies when installDeps is true", async () => {
66
+ await temporaryDirectoryTask(async (tmpDir) => {
67
+ const options = defaultOptions({ installDeps: true, path: tmpDir });
68
+ await runInit(options);
69
+ expect(installNodeModules).toHaveBeenCalled();
70
+ });
71
+ });
72
+ it("does not install dependencies when installDeps is false", async () => {
73
+ await temporaryDirectoryTask(async (tmpDir) => {
74
+ const options = defaultOptions({ installDeps: false, path: tmpDir });
75
+ await runInit(options);
76
+ expect(installNodeModules).not.toHaveBeenCalled();
77
+ });
78
+ });
79
+ });
@@ -29,7 +29,7 @@ export async function loader({request, context: {storefront}}: LoaderArgs) {
29
29
  const data = await storefront.query<SitemapQueryData>(SITEMAP_QUERY, {
30
30
  variables: {
31
31
  urlLimits: MAX_URLS,
32
- language: storefront.i18n?.language,
32
+ language: storefront.i18n.language,
33
33
  },
34
34
  });
35
35
 
@@ -50,6 +50,10 @@ export async function loader({request, context: {storefront}}: LoaderArgs) {
50
50
  );
51
51
  }
52
52
 
53
+ function xmlEncode(string: string) {
54
+ return string.replace(/[&<>'"]/g, (char) => `&#${char.charCodeAt(0)};`);
55
+ }
56
+
53
57
  function shopSitemap({
54
58
  data,
55
59
  baseUrl,
@@ -60,25 +64,25 @@ function shopSitemap({
60
64
  const productsData = flattenConnection(data.products)
61
65
  .filter((product) => product.onlineStoreUrl)
62
66
  .map((product) => {
63
- const url = `${baseUrl}/products/${product.handle}`;
67
+ const url = `${baseUrl}/products/${xmlEncode(product.handle)}`;
64
68
 
65
69
  const finalObject: ProductEntry = {
66
70
  url,
67
- lastMod: product.updatedAt!,
71
+ lastMod: product.updatedAt,
68
72
  changeFreq: 'daily',
69
73
  };
70
74
 
71
75
  if (product.featuredImage?.url) {
72
76
  finalObject.image = {
73
- url: product.featuredImage!.url,
77
+ url: xmlEncode(product.featuredImage.url),
74
78
  };
75
79
 
76
80
  if (product.title) {
77
- finalObject.image.title = product.title;
81
+ finalObject.image.title = xmlEncode(product.title);
78
82
  }
79
83
 
80
- if (product.featuredImage!.altText) {
81
- finalObject.image.caption = product.featuredImage!.altText;
84
+ if (product.featuredImage.altText) {
85
+ finalObject.image.caption = xmlEncode(product.featuredImage.altText);
82
86
  }
83
87
  }
84
88
 
@@ -116,7 +120,7 @@ function shopSitemap({
116
120
  xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
117
121
  xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
118
122
  >
119
- ${urlsDatas.map((url) => renderUrlTag(url!)).join('')}
123
+ ${urlsDatas.map((url) => renderUrlTag(url)).join('')}
120
124
  </urlset>`;
121
125
  }
122
126
 
@@ -104,7 +104,7 @@ async function getRemixConfig(root, mode = process.env.NODE_ENV) {
104
104
  config.watchPaths ??= [];
105
105
  config.watchPaths.push(
106
106
  ...(await fs.readdir(packagesPath)).map(
107
- (pkg) => path.resolve(packagesPath, pkg, "dist", "development", "index.js")
107
+ (pkg) => pkg === "hydrogen-react" ? path.resolve(packagesPath, pkg, "dist", "browser-dev", "index.mjs") : path.resolve(packagesPath, pkg, "dist", "development", "index.js")
108
108
  )
109
109
  );
110
110
  config.watchPaths.push(
@@ -14,5 +14,11 @@ declare function flagsToCamelObject(obj: Record<string, any>): any;
14
14
  * output: { force: true, installDeps: false, language: 'js' }
15
15
  */
16
16
  declare function parseProcessFlags(processArgv: string[], flagMap?: Record<string, string>): any;
17
+ /**
18
+ * Create a deprecated flag to prevent the CLI from crashing when a deprecated flag is used.
19
+ * Displays an info message when the flag is used.
20
+ * @param name The name of the flag.
21
+ */
22
+ declare function deprecated(name: string): _oclif_core_lib_interfaces_parser_js.Definition<unknown, Record<string, unknown>>;
17
23
 
18
- export { commonFlags, flagsToCamelObject, parseProcessFlags };
24
+ export { commonFlags, deprecated, flagsToCamelObject, parseProcessFlags };
@@ -1,5 +1,7 @@
1
1
  import Flags from '@oclif/core/lib/flags.js';
2
2
  import { string } from '@shopify/cli-kit';
3
+ import { renderInfo } from '@shopify/cli-kit/node/ui';
4
+ import colors from '@shopify/cli-kit/node/colors';
3
5
 
4
6
  const commonFlags = {
5
7
  path: Flags.string({
@@ -41,5 +43,18 @@ function parseProcessFlags(processArgv, flagMap = {}) {
41
43
  }
42
44
  return flagsToCamelObject(options);
43
45
  }
46
+ function deprecated(name) {
47
+ return Flags.custom({
48
+ parse: () => {
49
+ renderInfo({
50
+ headline: `The ${colors.bold(
51
+ name
52
+ )} flag is deprecated and will be removed in a future version of Shopify CLI.`
53
+ });
54
+ return Promise.resolve(" ");
55
+ },
56
+ hidden: true
57
+ });
58
+ }
44
59
 
45
- export { commonFlags, flagsToCamelObject, parseProcessFlags };
60
+ export { commonFlags, deprecated, flagsToCamelObject, parseProcessFlags };
@@ -12,7 +12,7 @@ const REQUIRED_ROUTES = [
12
12
  "pages/:pageHandle",
13
13
  "policies/:policyHandle",
14
14
  "search",
15
- "discounts/:discountCode",
15
+ "discount/:discountCode",
16
16
  "account",
17
17
  "account/login",
18
18
  "account/register",
@@ -10,7 +10,9 @@ async function getLatestReleaseDownloadUrl() {
10
10
  const response = await http.fetch(REPO_RELEASES_URL);
11
11
  if (!response.ok || response.status >= 400) {
12
12
  throw new Error(
13
- `Failed to fetch the latest release information. Status ${response.status} ${response.statusText}`
13
+ `Failed to fetch the latest release information. Status ${response.status} ${response.statusText.replace(/\.$/, "")}.` + (response.status === 403 ? `
14
+
15
+ If you are using a VPN, WARP, or similar service, consider disabling it momentarily.` : "")
14
16
  );
15
17
  }
16
18
  const release = await response.json();
@@ -39,7 +39,7 @@ p {
39
39
  body {
40
40
  padding: 0;
41
41
  margin: 0;
42
- background: #ffffff;
42
+ background: #fff;
43
43
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
44
44
  Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
45
45
  -webkit-font-smoothing: antialiased;
@@ -0,0 +1,7 @@
1
+ const HydrogenLogoBaseBW = (props) => <svg width={81} height={82} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
2
+ <path d="M39.955 81.28 2.138 61.19l12.933-6.818 14.562 7.733 12.218-6.441L27.29 47.93l12.933-6.833L78.04 61.189l-12.934 6.817L51.35 60.7l-12.236 6.457 13.774 7.308-12.933 6.817Z" fill="#000" />
3
+ <path fillRule="evenodd" clipRule="evenodd" d="m40.225 0 39.953 21.227-15.073 7.945-13.756-7.308-10.096 5.328 13.775 7.309-15.075 7.945L0 21.22l15.073-7.945 14.562 7.732 10.078-5.313-14.56-7.731L40.225 0ZM29.426 7.967l14.564 7.734L29.63 23.27 15.07 15.537l-10.794 5.69 35.68 18.956 10.793-5.688-13.773-7.307L51.352 19.6l13.757 7.308 10.794-5.69-35.68-18.956-10.797 5.704Z" fill="#000" />
4
+ </svg>;
5
+ export {
6
+ HydrogenLogoBaseBW
7
+ };
@@ -0,0 +1,13 @@
1
+ const HydrogenLogoBaseColor = (props) => <svg width={76} height={81} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
2
+ <path d="M37.817 80.149 0 60.057l12.934-6.817 14.561 7.733 12.218-6.441-14.561-7.733 12.933-6.833 37.818 20.091-12.934 6.817-13.757-7.307-12.236 6.457 13.775 7.308-12.934 6.817Z" fill="#000" />
3
+ <path d="M37.818 40.183 0 20.092l12.934-6.818 14.562 7.733 12.218-6.441-14.562-7.733L38.086 0l37.817 20.091-12.934 6.817-13.756-7.307-12.236 6.457 13.774 7.308-12.933 6.817Z" fill="url(#a)" />
4
+ <defs><linearGradient id="a" x1={74.48} y1={21.654} x2={18.735} y2={51.694} gradientUnits="userSpaceOnUse">
5
+ <stop offset={2e-3} stopColor="#430470" />
6
+ <stop offset={0.385} stopColor="#8E01F0" />
7
+ <stop offset={0.635} stopColor="#354CF6" />
8
+ <stop offset={1} stopColor="#01FFFF" />
9
+ </linearGradient></defs>
10
+ </svg>;
11
+ export {
12
+ HydrogenLogoBaseColor
13
+ };
@@ -0,0 +1,47 @@
1
+ const IconBanner = (props) => <svg width={32} height={36} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
2
+ <path fill="#000" d="M0 9.726h1.455v1.455H0z" />
3
+ <path fill="#E172AC" d="M1.454 9.726h1.455v1.455H1.454zM13.091 3.907h1.455v1.455h-1.455zM24.727 9.726h1.455v1.455h-1.455zM24.727 24.271h1.455v1.455h-1.455zM13.091 30.09h1.455v1.455h-1.455zM1.454 24.271h1.455v1.455H1.454z" />
4
+ <path fill="#AC217D" d="M5.818 9.726h1.455v1.455H5.818zM17.454 3.907h1.455v1.455h-1.455zM29.091 9.726h1.455v1.455h-1.455zM21.818 16.998h1.455v1.455h-1.455zM21.818 18.454h1.455v1.455h-1.455zM20.363 24.271h1.455v1.455h-1.455zM20.363 11.181h1.455v1.455h-1.455zM29.091 24.271h1.455v1.455h-1.455zM17.455 30.09h1.455v1.455h-1.455zM5.818 24.271h1.455v1.455H5.818z" />
5
+ <path fill="#000" d="M7.273 9.726h1.455v1.455H7.273zM1.454 8.271h1.455v1.455H1.454zM5.818 8.271h1.455v1.455H5.818zM2.909 6.817h1.455v1.455H2.909z" />
6
+ <path fill="#D43694" d="M2.909 9.726h1.455v1.455H2.909zM14.546 3.907h1.455v1.455h-1.455zM26.182 9.726h1.455v1.455h-1.455zM18.909 11.181h1.455v1.455h-1.455z" />
7
+ <path fill="#D43694" d="M20.363 12.635h1.455v1.455h-1.455zM20.363 14.09h1.455v1.455h-1.455z" />
8
+ <path fill="#D43694" d="M20.363 15.544h1.455v1.455h-1.455zM11.636 11.181h1.455v1.455h-1.455z" />
9
+ <path fill="#D43694" d="M10.182 12.635h1.455v1.455h-1.455zM10.182 14.09h1.455v1.455h-1.455z" />
10
+ <path fill="#D43694" d="M10.182 15.544h1.455v1.455h-1.455zM10.182 19.908h1.455v1.455h-1.455z" />
11
+ <path fill="#D43694" d="M10.182 21.362h1.455v1.455h-1.455zM10.182 22.817h1.455v1.455h-1.455z" />
12
+ <path fill="#D43694" d="M11.636 24.271h1.455v1.455h-1.455zM20.363 19.908h1.455v1.455h-1.455z" />
13
+ <path fill="#D43694" d="M20.363 21.362h1.455v1.455h-1.455zM20.363 22.817h1.455v1.455h-1.455z" />
14
+ <path fill="#D43694" d="M18.909 24.271h1.455v1.455h-1.455zM26.182 24.271h1.455v1.455h-1.455zM14.545 30.09H16v1.455h-1.455zM2.909 24.271h1.455v1.455H2.909zM2.909 11.181h1.455v1.455H2.909zM14.546 5.361h1.455v1.455h-1.455zM26.182 11.181h1.455v1.455h-1.455zM26.182 25.726h1.455v1.455h-1.455z" />
15
+ <path fill="#D43694" d="M14.546 31.544h1.455v1.455h-1.455zM2.909 25.726h1.455v1.455H2.909z" />
16
+ <path fill="#000" d="M4.364 6.817h1.455v1.455H4.364z" />
17
+ <path fill="#D43694" d="M4.364 9.726h1.455v1.455H4.364zM16 3.907h1.455v1.455H16zM27.637 9.726h1.455v1.455h-1.455zM27.637 24.271h1.455v1.455h-1.455zM16 30.09h1.455v1.455H16zM4.364 24.271h1.455v1.455H4.364z" />
18
+ <path fill="#D43694" d="M4.364 11.181h1.455v1.455H4.364zM16 5.361h1.455v1.455H16zM27.637 11.181h1.455v1.455h-1.455zM27.637 25.726h1.455v1.455h-1.455zM16 31.544h1.455v1.455H16zM4.364 25.726h1.455v1.455H4.364z" />
19
+ <path fill="#E172AC" d="M2.909 8.271h1.455v1.455H2.909zM14.545 2.453H16v1.455h-1.455zM26.182 8.271h1.455v1.455h-1.455zM26.182 22.817h1.455v1.455h-1.455zM14.546 28.635h1.455v1.455h-1.455zM2.909 22.817h1.455v1.455H2.909z" />
20
+ <path fill="#AC217D" d="M2.909 12.635h1.455v1.455H2.909zM14.545 6.817H16v1.455h-1.455zM26.182 12.635h1.455v1.455h-1.455zM26.182 27.181h1.455v1.455h-1.455zM14.546 32.998h1.455v1.455h-1.455zM2.909 27.181h1.455v1.455H2.909z" />
21
+ <path fill="#E172AC" d="M4.364 8.271h1.455v1.455H4.364zM16 2.453h1.455v1.455H16zM27.637 8.271h1.455v1.455h-1.455zM27.637 22.817h1.455v1.455h-1.455zM16 28.635h1.455v1.455H16zM4.364 22.817h1.455v1.455H4.364z" />
22
+ <path fill="#AC217D" d="M4.364 12.635h1.455v1.455H4.364zM16 6.817h1.455v1.455H16zM27.637 12.635h1.455v1.455h-1.455zM27.637 27.181h1.455v1.455h-1.455zM16 32.998h1.455v1.455H16zM4.364 27.181h1.455v1.455H4.364z" />
23
+ <path fill="#000" d="M2.909 14.09h1.455v1.455H2.909zM4.364 14.09h1.455v1.455H4.364zM0 11.181h1.455v1.455H0z" />
24
+ <path fill="#000" d="M1.454 12.635h1.455v1.455H1.454z" />
25
+ <path fill="#E172AC" d="M1.454 11.181h1.455v1.455H1.454zM8.727 16.998h1.455v1.455H8.727zM10.182 11.181h1.455v1.455h-1.455zM10.182 24.271h1.455v1.455h-1.455zM8.727 18.454h1.455v1.455H8.727zM13.091 5.361h1.455v1.455h-1.455zM24.727 11.181h1.455v1.455h-1.455zM24.727 25.726h1.455v1.455h-1.455zM13.091 31.544h1.455v1.455h-1.455zM1.454 25.726h1.455v1.455H1.454z" />
26
+ <path fill="#AC217D" d="M5.818 11.181h1.455v1.455H5.818zM17.454 5.361h1.455v1.455h-1.455zM29.091 11.181h1.455v1.455h-1.455zM29.091 25.726h1.455v1.455h-1.455zM17.454 31.544h1.455v1.455h-1.455zM5.818 25.726h1.455v1.455H5.818z" />
27
+ <path fill="#000" d="M5.818 12.635h1.455v1.455H5.818zM7.273 11.181h1.455v1.455H7.273zM0 24.271h1.455v1.455H0zM23.273 9.726h1.455v1.455h-1.455zM7.273 24.271h1.455v1.455H7.273zM30.546 9.726h1.455v1.455h-1.455zM1.455 22.817H2.91v1.455H1.455zM24.727 8.271h1.455v1.455h-1.455zM5.818 22.817h1.455v1.455H5.818zM29.091 8.271h1.455v1.455h-1.455zM2.909 21.362h1.455v1.455H2.909z" />
28
+ <path fill="#000" d="M26.182 6.817h1.455v1.455h-1.455zM4.364 21.362h1.455v1.455H4.364zM27.637 6.817h1.455v1.455h-1.455zM2.909 28.635h1.455v1.455H2.909zM26.182 14.09h1.455v1.455h-1.455zM4.364 28.635h1.455v1.455H4.364zM27.637 14.09h1.455v1.455h-1.455zM1.454 27.181h1.455v1.455H1.454zM24.727 12.635h1.455v1.455h-1.455zM0 25.726h1.455v1.455H0z" />
29
+ <path fill="#000" d="M23.273 11.181h1.455v1.455h-1.455zM5.818 27.181h1.455v1.455H5.818zM29.091 12.635h1.455v1.455h-1.455zM7.273 25.726h1.455v1.455H7.273zM30.546 11.181h1.455v1.455h-1.455zM23.273 24.271h1.455v1.455h-1.455zM11.636 30.09h1.455v1.455h-1.455zM11.636 3.907h1.455v1.455h-1.455zM18.909 30.09h1.455v1.455h-1.455zM30.546 24.271h1.455v1.455h-1.455zM13.091 28.635h1.455v1.455h-1.455zM18.909 3.907h1.455v1.455h-1.455zM17.454 28.635h1.455v1.455h-1.455z" />
30
+ <path fill="#000" d="M24.727 22.817h1.455v1.455h-1.455zM14.546 27.181h1.455v1.455h-1.455zM13.091 2.453h1.455v1.455h-1.455z" />
31
+ <path fill="#000" d="M16 27.181h1.455v1.455H16zM29.091 22.817h1.455v1.455h-1.455zM14.545 34.454H16v1.455h-1.455zM17.455 2.453h1.455v1.455h-1.455zM16 34.454h1.455v1.455H16zM26.182 21.362h1.455v1.455h-1.455zM13.091 32.998h1.455v1.455h-1.455zM14.546.998h1.455v1.455h-1.455zM11.636 31.544h1.455v1.455h-1.455zM27.637 21.362h1.455v1.455h-1.455zM17.454 32.998h1.455v1.455h-1.455z" />
32
+ <path fill="#000" d="M16 .998h1.455v1.455H16zM18.909 31.544h1.455v1.455h-1.455zM26.182 28.635h1.455v1.455h-1.455zM14.546 8.271h1.455v1.455h-1.455zM27.637 28.635h1.455v1.455h-1.455z" />
33
+ <path fill="#000" d="M16 8.271h1.455v1.455H16zM24.727 27.181h1.455v1.455h-1.455zM13.091 6.817h1.455v1.455h-1.455zM23.273 25.726h1.455v1.455h-1.455zM11.636 5.361h1.455v1.455h-1.455zM29.091 27.181h1.455v1.455h-1.455zM17.455 6.817h1.455v1.455h-1.455zM30.546 25.726h1.455v1.455h-1.455zM18.909 5.361h1.455v1.455h-1.455zM8.727 11.181h1.455v1.455H8.727z" />
34
+ <path fill="#000" d="M8.727 12.635h1.455v1.455H8.727zM8.727 19.908h1.455v1.455H8.727zM21.818 19.908h1.455v1.455h-1.455zM21.818 11.181h1.455v1.455h-1.455z" />
35
+ <path fill="#000" d="M8.727 21.362h1.455v1.455H8.727zM21.818 21.362h1.455v1.455h-1.455zM8.727 14.09h1.455v1.455H8.727zM21.818 12.635h1.455v1.455h-1.455zM8.727 22.817h1.455v1.455H8.727z" />
36
+ <path fill="#000" d="M8.727 24.271h1.455v1.455H8.727zM7.273 16.998h1.455v1.455H7.273zM21.818 22.817h1.455v1.455h-1.455zM23.273 16.998h1.455v1.455h-1.455z" />
37
+ <path fill="#000" d="M21.818 24.271h1.455v1.455h-1.455zM8.727 15.544h1.455v1.455H8.727zM21.818 14.09h1.455v1.455h-1.455zM7.273 18.454h1.455v1.455H7.273z" />
38
+ <path fill="#000" d="M21.818 15.544h1.455v1.455h-1.455zM23.273 18.454h1.455v1.455h-1.455zM11.636 12.635h1.455v1.455h-1.455zM11.636 19.908h1.455v1.455h-1.455zM18.909 19.908h1.455v1.455h-1.455zM18.909 12.635h1.455v1.455h-1.455zM11.636 14.09h1.455v1.455h-1.455z" />
39
+ <path fill="#000" d="M11.636 21.362h1.455v1.455h-1.455zM18.909 21.362h1.455v1.455h-1.455zM18.909 14.09h1.455v1.455h-1.455zM10.182 16.998h1.455v1.455h-1.455zM20.363 16.998h1.455v1.455h-1.455z" />
40
+ <path fill="#000" d="M11.636 15.544h1.455v1.455h-1.455zM11.636 22.817h1.455v1.455h-1.455zM18.909 22.817h1.455v1.455h-1.455zM18.909 15.544h1.455v1.455h-1.455zM13.091 24.271h1.455v1.455h-1.455zM17.454 24.271h1.455v1.455h-1.455zM13.091 25.726h1.455v1.455h-1.455zM17.454 25.726h1.455v1.455h-1.455zM11.636 25.726h1.455v1.455h-1.455zM20.363 25.726h1.455v1.455h-1.455z" />
41
+ <path fill="#000" d="M10.182 25.726h1.455v1.455h-1.455zM18.909 25.726h1.455v1.455h-1.455zM10.182 18.454h1.455v1.455h-1.455zM20.363 18.454h1.455v1.455h-1.455zM10.182 9.726h1.455v1.455h-1.455zM18.909 9.726h1.455v1.455h-1.455z" />
42
+ <path fill="#000" d="M11.636 9.726h1.455v1.455h-1.455zM20.363 9.726h1.455v1.455h-1.455zM13.091 9.726h1.455v1.455h-1.455zM17.454 9.726h1.455v1.455h-1.455z" />
43
+ <path fill="#000" d="M13.091 11.181h1.455v1.455h-1.455zM17.454 11.181h1.455v1.455h-1.455z" />
44
+ </svg>;
45
+ export {
46
+ IconBanner
47
+ };
@@ -0,0 +1,4 @@
1
+ const IconDiscord = (props) => <svg width={26} height={20} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}><path d="M21.19 1.675A19.91 19.91 0 0 0 16.03 0c-.223.415-.482.973-.661 1.418a18.355 18.355 0 0 0-5.72 0A15.367 15.367 0 0 0 8.98 0a19.844 19.844 0 0 0-5.165 1.68C.55 6.776-.336 11.747.106 16.647c2.167 1.67 4.266 2.686 6.33 3.35.51-.724.964-1.495 1.356-2.306a13.149 13.149 0 0 1-2.135-1.073c.179-.137.354-.28.523-.428 4.116 1.989 8.588 1.989 12.655 0 .172.148.347.291.524.428a13.12 13.12 0 0 1-2.139 1.075c.392.81.844 1.582 1.356 2.306 2.066-.664 4.167-1.68 6.333-3.352.52-5.68-.887-10.606-3.718-14.973ZM8.353 13.635c-1.235 0-2.249-1.192-2.249-2.643 0-1.45.992-2.644 2.25-2.644 1.257 0 2.27 1.191 2.248 2.644.002 1.45-.991 2.642-2.249 2.642Zm8.311 0c-1.235 0-2.249-1.192-2.249-2.643 0-1.45.992-2.644 2.25-2.644 1.257 0 2.27 1.191 2.248 2.644 0 1.45-.991 2.642-2.249 2.642Z" fill="#5C5F62" /></svg>;
2
+ export {
3
+ IconDiscord
4
+ };
@@ -0,0 +1,20 @@
1
+ const IconError = (props) => <svg width={32} height={32} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
2
+ <path fill="#000" d="M6 18h20v2H6zM30 8h2v16h-2zM0 8h2v16H0z" />
3
+ <path fill="#F63310" d="M2 8h2v16H2zM4 6h2v4H4zM6 4h2v4H6zM8 2h2v4H8zM24 4h2v2h-2zM26 6h2v2h-2z" />
4
+ <path fill="#74170B" d="M26 24h2v2h-2zM28 22h2v2h-2zM24 26h2v2h-2zM22 28h2v2h-2z" />
5
+ <path fill="#971C06" d="M6 26h2v2H6zM4 24h2v2H4zM4 18h2v2H4zM26 18h2v2h-2zM26 12h2v2h-2z" />
6
+ <path fill="#D62C0D" d="M26 8h2v4h-2zM4 10h2v2H4zM8 6h18v2H8zM10 4h14v2H10zM6 8h20v2H6z" />
7
+ <path fill="#971C06" d="M28 10h2v12h-2zM8 28h14v2H8z" />
8
+ <path fill="#D62C0D" d="M26 20h2v2h-2zM4 20h2v2H4z" />
9
+ <path fill="#F63310" d="M4 12h2v2H4z" />
10
+ <path fill="#971C06" d="M6 20h20v2H6z" />
11
+ <path fill="#F63310" d="M28 8h2v2h-2zM10 2h14v2H10zM6 10h20v2H6z" />
12
+ <path fill="#D62C0D" d="M4 22h24v2H4zM6 24h20v2H6zM8 26h16v2H8z" />
13
+ <path fill="#000" d="M6 12h20v2H6z" />
14
+ <path fill="#fff" d="M6 14h20v2H6zM6 16h2v2H6z" />
15
+ <path fill="#ECEDEE" d="M8 16h18v2H8z" />
16
+ <path fill="#000" d="M4 14h2v4H4zM26 14h2v4h-2zM2 6h2v2H2zM4 4h2v2H4zM6 2h2v2H6zM24 2h2v2h-2zM26 4h2v2h-2zM26 26h2v2h-2zM24 28h2v2h-2zM6 28h2v2H6zM4 26h2v2H4zM2 24h2v2H2zM8 30h16v2H8zM28 6h2v2h-2zM28 24h2v2h-2zM8 0h16v2H8z" />
17
+ </svg>;
18
+ export {
19
+ IconError
20
+ };
@@ -0,0 +1,4 @@
1
+ const IconGithub = (props) => <svg width={20} height={20} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}><path fillRule="evenodd" clipRule="evenodd" d="M9.997 0C4.473 0 0 4.588 0 10.253c0 4.537 2.862 8.369 6.835 9.727.5.09.687-.218.687-.487 0-.243-.012-1.05-.012-1.91-2.512.475-3.161-.627-3.361-1.204-.113-.295-.6-1.205-1.025-1.448-.35-.192-.85-.667-.013-.68.788-.012 1.35.744 1.537 1.052.9 1.55 2.337 1.114 2.912.845.087-.666.35-1.115.637-1.371-2.224-.256-4.548-1.14-4.548-5.062 0-1.115.387-2.038 1.024-2.756-.1-.256-.45-1.307.1-2.717 0 0 .838-.269 2.75 1.051.8-.23 1.649-.346 2.499-.346.85 0 1.699.115 2.499.346 1.912-1.333 2.749-1.05 2.749-1.05.55 1.409.2 2.46.1 2.716.637.718 1.025 1.628 1.025 2.756 0 3.934-2.337 4.806-4.561 5.062.362.32.674.936.674 1.897 0 1.371-.012 2.473-.012 2.82 0 .268.187.589.687.486a10.036 10.036 0 0 0 4.93-3.74 10.45 10.45 0 0 0 1.88-5.987C19.993 4.588 15.52 0 9.997 0Z" fill="#5C5F62" /></svg>;
2
+ export {
3
+ IconGithub
4
+ };
@@ -0,0 +1,4 @@
1
+ const IconTwitter = (props) => <svg width={23} height={20} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}><path d="M20.53 4.979c.014.217.014.434.014.653C20.544 12.305 15.824 20 7.193 20v-.004C4.643 20 2.146 19.214 0 17.732c.37.048.743.072 1.117.073 2.113.002 4.165-.76 5.828-2.166-2.008-.04-3.77-1.45-4.384-3.506a4.356 4.356 0 0 0 2.118-.087C2.49 11.57.915 9.5.915 7.096v-.064a4.414 4.414 0 0 0 2.13.632C.983 6.18.348 3.229 1.593.92c2.382 3.155 5.897 5.073 9.67 5.276-.378-1.754.139-3.592 1.358-4.825 1.89-1.912 4.862-1.814 6.639.22A9.023 9.023 0 0 0 22.24.364c-.35 1.17-1.084 2.162-2.063 2.793a8.822 8.822 0 0 0 2.694-.795A9.97 9.97 0 0 1 20.53 4.98Z" fill="#5C5F62" /></svg>;
2
+ export {
3
+ IconTwitter
4
+ };
@@ -0,0 +1,6 @@
1
+ function Layout(props) {
2
+ return <div className="hydrogen-virtual-route">{props.children}</div>;
3
+ }
4
+ export {
5
+ Layout
6
+ };
@@ -0,0 +1,5 @@
1
+ import { graphiqlLoader } from "@shopify/hydrogen";
2
+ const loader = graphiqlLoader;
3
+ export {
4
+ loader
5
+ };
@@ -0,0 +1,163 @@
1
+ import { useLoaderData } from "@remix-run/react";
2
+ import { HydrogenLogoBaseBW } from "../components/HydrogenLogoBaseBW.jsx";
3
+ import { HydrogenLogoBaseColor } from "../components/HydrogenLogoBaseColor.jsx";
4
+ import { IconDiscord } from "../components/IconDiscord.jsx";
5
+ import { IconGithub } from "../components/IconGithub.jsx";
6
+ import { IconTwitter } from "../components/IconTwitter.jsx";
7
+ import { IconBanner } from "../components/IconBanner.jsx";
8
+ import { IconError } from "../components/IconError.jsx";
9
+ import favicon from "../assets/favicon.svg";
10
+ import interVariableFontWoff2 from "../assets/inter-variable-font.woff2";
11
+ import jetbrainsmonoVariableFontWoff2 from "../assets/jetbrainsmono-variable-font.woff2";
12
+ const meta = () => {
13
+ return {
14
+ title: "Hydrogen",
15
+ description: "A custom storefront powered by Hydrogen",
16
+ charset: "utf-8",
17
+ viewport: "width=device-width,initial-scale=1"
18
+ };
19
+ };
20
+ const links = () => [
21
+ {
22
+ rel: "icon",
23
+ type: "image/svg+xml",
24
+ href: favicon
25
+ },
26
+ {
27
+ rel: "preload",
28
+ href: interVariableFontWoff2,
29
+ as: "font",
30
+ type: "font/ttf",
31
+ crossOrigin: "anonymous"
32
+ },
33
+ {
34
+ rel: "preload",
35
+ href: jetbrainsmonoVariableFontWoff2,
36
+ as: "font",
37
+ type: "font/ttf",
38
+ crossOrigin: "anonymous"
39
+ }
40
+ ];
41
+ async function loader({ context }) {
42
+ const layout = await context.storefront.query(LAYOUT_QUERY);
43
+ return { layout };
44
+ }
45
+ const HYDROGEN_SHOP_ID = "gid://shopify/Shop/55145660472";
46
+ function CatchBoundary() {
47
+ return <ErrorPage />;
48
+ }
49
+ function ErrorBoundary() {
50
+ return <ErrorPage />;
51
+ }
52
+ function Index() {
53
+ const data = useLoaderData();
54
+ const { name: shopName, id: shopId } = data.layout.shop;
55
+ const configDone = shopId !== HYDROGEN_SHOP_ID;
56
+ return <><Layout shopName={shopName}>
57
+ {configDone ? <HydrogenLogoBaseColor /> : <HydrogenLogoBaseBW />}
58
+ <h1>
59
+ {"Hello, "}
60
+ {shopName || "Hydrogen"}
61
+ </h1>
62
+ <p>Welcome to your new custom storefront</p>
63
+ {configDone ? null : <section className="Banner">
64
+ <div>
65
+ <IconBanner />
66
+ <h2>Configure storefront token</h2>
67
+ </div>
68
+ <p>
69
+ {"You\u2019re seeing this because you have not yet configured your storefront token. "}
70
+ <br />
71
+ <br />
72
+ {" To get started, edit "}
73
+ {` `}
74
+ <code>.env</code>
75
+ {". Then, create your first route with the file"}
76
+ {` `}
77
+ <code>/app/routes/index.jsx</code>
78
+ {". Learn more about"}
79
+ {` `}
80
+ <a target="_blank" rel="norefferer noopener" href="https://shopify.dev/docs/custom-storefronts/hydrogen/environment-variables">editing environment variables</a>
81
+ {` `}
82
+ {"and"}
83
+ {` `}
84
+ <a target="_blank" rel="norefferer noopener" href="https://shopify.dev/docs/custom-storefronts/hydrogen/building/begin-development#step-4-create-a-route">creating routes</a>
85
+ {"."}
86
+ </p>
87
+ </section>}
88
+ <ResourcesLinks />
89
+ </Layout></>;
90
+ }
91
+ function ErrorPage() {
92
+ return <><Layout shopName="Hydrogen">
93
+ <HydrogenLogoBaseBW />
94
+ <h1>Hello, Hydrogen</h1>
95
+ <p>Welcome to your new custom storefront</p>
96
+ <section className="Banner ErrorBanner">
97
+ <div>
98
+ <IconError />
99
+ <h2>{"There\u2019s a problem with your storefront"}</h2>
100
+ </div>
101
+ <p>
102
+ {"Check your domain and API token in your "}
103
+ <code>.env</code>
104
+ {" file. Learn more about"}
105
+ {` `}
106
+ <a target="_blank" rel="norefferer noopener" href="https://shopify.dev/docs/custom-storefronts/hydrogen/environment-variables">editing environment variables</a>
107
+ {"."}
108
+ </p>
109
+ </section>
110
+ <ResourcesLinks />
111
+ </Layout></>;
112
+ }
113
+ function ResourcesLinks() {
114
+ return <><section className="Links">
115
+ <h2>Start building</h2>
116
+ <ul>
117
+ <li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen/building/collection-page">Collection template</a></li>
118
+ <li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen/building/product-details-page">Product template</a></li>
119
+ <li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen/building/cart">Cart</a></li>
120
+ </ul>
121
+ <h2>Resources</h2>
122
+ <ul>
123
+ <li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen">Hydrogen docs</a></li>
124
+ <li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen/project-structure">Remix and project structure</a></li>
125
+ <li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen/data-fetching/fetch-data">Data queries and fetching</a></li>
126
+ </ul>
127
+ </section></>;
128
+ }
129
+ function Layout({
130
+ shopName,
131
+ children
132
+ }) {
133
+ return <>
134
+ <header>
135
+ <h1>{shopName?.toUpperCase()}</h1>
136
+ <p>{"\xA0Dev Mode\xA0"}</p>
137
+ <nav>
138
+ <a target="_blank" rel="norefferer noopener" href="https://discord.com/invite/shopifydevs"><IconDiscord /></a>
139
+ <a target="_blank" rel="norefferer noopener" href="https://github.com/Shopify/hydrogen"><IconGithub /></a>
140
+ <a target="_blank" rel="norefferer noopener" href="https://twitter.com/shopifydevs?lang=en"><IconTwitter /></a>
141
+ </nav>
142
+ </header>
143
+ <main>{children}</main>
144
+ <footer><div><a href="https://shopify.com" target="_blank" rel="noreferrer noopener">Powered by Shopify</a></div></footer>
145
+ </>;
146
+ }
147
+ const LAYOUT_QUERY = `#graphql
148
+ query layout {
149
+ shop {
150
+ name
151
+ id
152
+ }
153
+ }
154
+ `;
155
+ export {
156
+ CatchBoundary,
157
+ ErrorBoundary,
158
+ HYDROGEN_SHOP_ID,
159
+ Index as default,
160
+ links,
161
+ loader,
162
+ meta
163
+ };
@@ -1 +1 @@
1
- {"version":"4.0.7","commands":{"hydrogen:build":{"id":"hydrogen:build","description":"Builds a Hydrogen storefront for production.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false},"sourcemap":{"name":"sourcemap","type":"boolean","description":"Generate sourcemaps for the build.","allowNo":false},"disable-route-warning":{"name":"disable-route-warning","type":"boolean","description":"Disable warning about missing standard routes.","allowNo":false}},"args":[]},"hydrogen:check":{"id":"hydrogen:check","description":"Returns diagnostic information about a Hydrogen storefront.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false}},"args":[{"name":"resource","description":"The resource to check. Currently only 'routes' is supported.","required":true,"options":["routes"]}]},"hydrogen:dev":{"id":"hydrogen:dev","description":"Runs Hydrogen storefront in an Oxygen worker for development.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false},"port":{"name":"port","type":"option","description":"Port to run the server on.","multiple":false,"default":3000},"disable-virtual-routes":{"name":"disable-virtual-routes","type":"boolean","description":"Disable rendering fallback routes when a route file doesn't exist","allowNo":false}},"args":[]},"hydrogen:init":{"id":"hydrogen:init","description":"Creates a new Hydrogen storefront.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the destination directory and files if they already exist.","allowNo":false},"path":{"name":"path","type":"option","description":"The path to the directory of the new Hydrogen storefront.","multiple":false},"language":{"name":"language","type":"option","description":"Sets the template language to use. One of `js` or `ts`.","multiple":false},"template":{"name":"template","type":"option","description":"Sets the template to use. One of `demo-store` or `hello-world`.","multiple":false},"install-deps":{"name":"install-deps","type":"boolean","description":"Auto install dependencies using the active package manager","allowNo":true}},"args":[]},"hydrogen:preview":{"id":"hydrogen:preview","description":"Runs a Hydrogen storefront in an Oxygen worker for production.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false},"port":{"name":"port","type":"option","description":"Port to run the server on.","multiple":false,"default":3000}},"args":[]},"hydrogen:generate:route":{"id":"hydrogen:generate:route","description":"Generates a standard Shopify route.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"adapter":{"name":"adapter","type":"option","description":"Remix adapter used in the route. The default is `@shopify/remix-oxygen`.","multiple":false},"typescript":{"name":"typescript","type":"boolean","description":"Generate TypeScript files","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the destination directory and files if they already exist.","allowNo":false},"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false}},"args":[{"name":"route","description":"The route to generate. One of home,page,cart,products,collections,policies,robots,sitemap,account,all.","required":true,"options":["home","page","cart","products","collections","policies","robots","sitemap","account","all"]}]},"hydrogen:generate:routes":{"id":"hydrogen:generate:routes","description":"Generates all supported standard shopify routes.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"adapter":{"name":"adapter","type":"option","description":"Remix adapter used in the route. The default is `@shopify/remix-oxygen`.","multiple":false},"typescript":{"name":"typescript","type":"boolean","description":"Generate TypeScript files","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the destination directory and files if they already exist.","allowNo":false},"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false}},"args":[]}}}
1
+ {"version":"4.0.9","commands":{"hydrogen:build":{"id":"hydrogen:build","description":"Builds a Hydrogen storefront for production.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false},"sourcemap":{"name":"sourcemap","type":"boolean","description":"Generate sourcemaps for the build.","allowNo":false},"disable-route-warning":{"name":"disable-route-warning","type":"boolean","description":"Disable warning about missing standard routes.","allowNo":false},"base":{"name":"base","type":"option","hidden":true,"multiple":false},"entry":{"name":"entry","type":"option","hidden":true,"multiple":false},"target":{"name":"target","type":"option","hidden":true,"multiple":false}},"args":[]},"hydrogen:check":{"id":"hydrogen:check","description":"Returns diagnostic information about a Hydrogen storefront.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false}},"args":[{"name":"resource","description":"The resource to check. Currently only 'routes' is supported.","required":true,"options":["routes"]}]},"hydrogen:dev":{"id":"hydrogen:dev","description":"Runs Hydrogen storefront in an Oxygen worker for development.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false},"port":{"name":"port","type":"option","description":"Port to run the server on.","multiple":false,"default":3000},"disable-virtual-routes":{"name":"disable-virtual-routes","type":"boolean","description":"Disable rendering fallback routes when a route file doesn't exist","allowNo":false},"host":{"name":"host","type":"option","hidden":true,"multiple":false}},"args":[]},"hydrogen:init":{"id":"hydrogen:init","description":"Creates a new Hydrogen storefront.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the destination directory and files if they already exist.","allowNo":false},"path":{"name":"path","type":"option","description":"The path to the directory of the new Hydrogen storefront.","multiple":false},"language":{"name":"language","type":"option","description":"Sets the template language to use. One of `js` or `ts`.","multiple":false},"template":{"name":"template","type":"option","description":"Sets the template to use. One of `demo-store` or `hello-world`.","multiple":false},"install-deps":{"name":"install-deps","type":"boolean","description":"Auto install dependencies using the active package manager","allowNo":true}},"args":[]},"hydrogen:preview":{"id":"hydrogen:preview","description":"Runs a Hydrogen storefront in an Oxygen worker for production.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false},"port":{"name":"port","type":"option","description":"Port to run the server on.","multiple":false,"default":3000}},"args":[]},"hydrogen:generate:route":{"id":"hydrogen:generate:route","description":"Generates a standard Shopify route.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"adapter":{"name":"adapter","type":"option","description":"Remix adapter used in the route. The default is `@shopify/remix-oxygen`.","multiple":false},"typescript":{"name":"typescript","type":"boolean","description":"Generate TypeScript files","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the destination directory and files if they already exist.","allowNo":false},"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false}},"args":[{"name":"route","description":"The route to generate. One of home,page,cart,products,collections,policies,robots,sitemap,account,all.","required":true,"options":["home","page","cart","products","collections","policies","robots","sitemap","account","all"]}]},"hydrogen:generate:routes":{"id":"hydrogen:generate:routes","description":"Generates all supported standard shopify routes.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"adapter":{"name":"adapter","type":"option","description":"Remix adapter used in the route. The default is `@shopify/remix-oxygen`.","multiple":false},"typescript":{"name":"typescript","type":"boolean","description":"Generate TypeScript files","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the destination directory and files if they already exist.","allowNo":false},"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false}},"args":[]}}}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "@shopify:registry": "https://registry.npmjs.org"
6
6
  },
7
- "version": "4.0.7",
7
+ "version": "4.0.9",
8
8
  "license": "SEE LICENSE IN LICENSE.md",
9
9
  "type": "module",
10
10
  "scripts": {
@@ -12,7 +12,6 @@
12
12
  "dev": "tsup --watch --config ./tsup.config.ts",
13
13
  "typecheck": "tsc --noEmit",
14
14
  "generate:manifest": "oclif manifest",
15
- "prepack": "npm run build",
16
15
  "test": "cross-env SHOPIFY_UNIT_TEST=1 vitest run",
17
16
  "test:watch": "cross-env SHOPIFY_UNIT_TEST=1 vitest"
18
17
  },
@@ -27,13 +26,13 @@
27
26
  "tempy": "^3.0.0"
28
27
  },
29
28
  "peerDependencies": {
30
- "@remix-run/react": "^1.12.0",
31
- "@shopify/hydrogen-react": "^2023.1.5",
32
- "@shopify/remix-oxygen": "^1.0.3"
29
+ "@remix-run/react": "^1.14.0",
30
+ "@shopify/hydrogen-react": "^2023.1.7",
31
+ "@shopify/remix-oxygen": "^1.0.4"
33
32
  },
34
33
  "dependencies": {
35
34
  "@oclif/core": "^1.20.4",
36
- "@remix-run/dev": "^1.12.0",
35
+ "@remix-run/dev": "^1.14.0",
37
36
  "@shopify/cli-kit": "3.29.0",
38
37
  "@shopify/mini-oxygen": "^1.3.1",
39
38
  "fast-glob": "^3.2.12",