@shopify/cli-hydrogen 4.0.6 → 4.0.7
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/dist/commands/hydrogen/init.js +12 -0
- package/dist/utils/check-version.d.ts +14 -1
- package/dist/utils/check-version.js +29 -24
- package/dist/utils/check-version.test.d.ts +1 -0
- package/dist/utils/check-version.test.js +60 -0
- package/dist/virtual-routes/assets/inter-variable-font.woff2 +0 -0
- package/dist/virtual-routes/assets/jetbrainsmono-variable-font.woff2 +0 -0
- package/dist/virtual-routes/assets/styles.css +4 -4
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/dist/virtual-routes/assets/inter-variable-font.ttf +0 -0
- package/dist/virtual-routes/assets/jetbrainsmono-variable-font.ttf +0 -0
- package/dist/virtual-routes/components/HydrogenLogoBaseBW.jsx +0 -7
- package/dist/virtual-routes/components/HydrogenLogoBaseColor.jsx +0 -13
- package/dist/virtual-routes/components/IconBanner.jsx +0 -47
- package/dist/virtual-routes/components/IconDiscord.jsx +0 -4
- package/dist/virtual-routes/components/IconError.jsx +0 -20
- package/dist/virtual-routes/components/IconGithub.jsx +0 -4
- package/dist/virtual-routes/components/IconTwitter.jsx +0 -4
- package/dist/virtual-routes/components/Layout.jsx +0 -6
- package/dist/virtual-routes/routes/graphiql.jsx +0 -5
- package/dist/virtual-routes/routes/index.jsx +0 -162
|
@@ -6,7 +6,9 @@ import { output, path } from '@shopify/cli-kit';
|
|
|
6
6
|
import { commonFlags, parseProcessFlags } from '../../utils/flags.js';
|
|
7
7
|
import { transpileProject } from '../../utils/transpile-ts.js';
|
|
8
8
|
import { getLatestTemplates } from '../../utils/template-downloader.js';
|
|
9
|
+
import { checkHydrogenVersion } from '../../utils/check-version.js';
|
|
9
10
|
import { readdir } from 'fs/promises';
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
10
12
|
|
|
11
13
|
const STARTER_TEMPLATES = ["hello-world", "demo-store"];
|
|
12
14
|
const FLAG_MAP = { f: "force" };
|
|
@@ -41,6 +43,16 @@ class Init extends Command {
|
|
|
41
43
|
}
|
|
42
44
|
async function runInit(options = parseProcessFlags(process.argv, FLAG_MAP)) {
|
|
43
45
|
supressNodeExperimentalWarnings();
|
|
46
|
+
const showUpgrade = await checkHydrogenVersion(
|
|
47
|
+
fileURLToPath(new URL("../../../package.json", import.meta.url)),
|
|
48
|
+
"cli"
|
|
49
|
+
);
|
|
50
|
+
if (showUpgrade) {
|
|
51
|
+
const packageManager2 = await packageManagerUsedForCreating();
|
|
52
|
+
showUpgrade(
|
|
53
|
+
packageManager2 === "unknown" ? "" : `Please use the latest version with \`${packageManager2} create @shopify/hydrogen@latest\``
|
|
54
|
+
);
|
|
55
|
+
}
|
|
44
56
|
const templatesPromise = getLatestTemplates().catch((error) => {
|
|
45
57
|
output.info("\n\n\n");
|
|
46
58
|
renderFatalError(error);
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const PACKAGE_NAMES: {
|
|
2
|
+
readonly main: "@shopify/hydrogen";
|
|
3
|
+
readonly cli: "@shopify/cli-hydrogen";
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param resolveFrom Path to a directory to resolve from, or directly the path to a package.json file.
|
|
8
|
+
* @param pkgKey Package to check for updates.
|
|
9
|
+
* @returns A function to show the update information if any update is available.
|
|
10
|
+
*/
|
|
11
|
+
declare function checkHydrogenVersion(resolveFrom: string, pkgKey?: keyof typeof PACKAGE_NAMES): Promise<((extraMessage?: string) => {
|
|
12
|
+
currentVersion: string;
|
|
13
|
+
newVersion: string;
|
|
14
|
+
}) | undefined>;
|
|
2
15
|
|
|
3
16
|
export { checkHydrogenVersion };
|
|
@@ -3,45 +3,50 @@ import { createRequire } from 'module';
|
|
|
3
3
|
import { checkForNewVersion } from '@shopify/cli-kit/node/node-package-manager';
|
|
4
4
|
import { renderInfo } from '@shopify/cli-kit/node/ui';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const PACKAGE_NAMES = {
|
|
7
|
+
main: "@shopify/hydrogen",
|
|
8
|
+
cli: "@shopify/cli-hydrogen"
|
|
9
|
+
};
|
|
10
|
+
async function checkHydrogenVersion(resolveFrom, pkgKey = "main") {
|
|
8
11
|
if (process.env.LOCAL_DEV)
|
|
9
12
|
return;
|
|
13
|
+
const pkgName = PACKAGE_NAMES[pkgKey];
|
|
10
14
|
const require2 = createRequire(import.meta.url);
|
|
11
|
-
const pkgJsonPath = locateDependency(
|
|
15
|
+
const pkgJsonPath = resolveFrom.endsWith("package.json") ? locateDependency(require2, resolveFrom) : locateDependency(
|
|
12
16
|
require2,
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
path.join(pkgName, "package.json"),
|
|
18
|
+
resolveFrom
|
|
15
19
|
);
|
|
16
20
|
if (!pkgJsonPath)
|
|
17
21
|
return;
|
|
18
22
|
const currentVersion = require2(pkgJsonPath).version;
|
|
19
23
|
if (!currentVersion)
|
|
20
24
|
return;
|
|
21
|
-
const newVersionAvailable = await checkForNewVersion(
|
|
22
|
-
PACKAGE_NAME,
|
|
23
|
-
currentVersion
|
|
24
|
-
);
|
|
25
|
+
const newVersionAvailable = await checkForNewVersion(pkgName, currentVersion);
|
|
25
26
|
if (!newVersionAvailable)
|
|
26
27
|
return;
|
|
27
|
-
return () =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
You are currently running v${currentVersion}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
return (extraMessage = "") => {
|
|
29
|
+
renderInfo({
|
|
30
|
+
headline: "Upgrade available",
|
|
31
|
+
body: `Version ${newVersionAvailable} of ${pkgName} is now available.
|
|
32
|
+
You are currently running v${currentVersion}.` + (extraMessage ? "\n\n" : "") + extraMessage,
|
|
33
|
+
reference: [
|
|
34
|
+
{
|
|
35
|
+
link: {
|
|
36
|
+
label: "Hydrogen releases",
|
|
37
|
+
url: "https://github.com/Shopify/hydrogen/releases"
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
return { currentVersion, newVersion: newVersionAvailable };
|
|
43
|
+
};
|
|
41
44
|
}
|
|
42
|
-
function locateDependency(require2,
|
|
45
|
+
function locateDependency(require2, nameToResolve, resolveFrom) {
|
|
43
46
|
try {
|
|
44
|
-
return require2.resolve(
|
|
47
|
+
return require2.resolve(nameToResolve, {
|
|
48
|
+
paths: [resolveFrom ?? process.cwd()]
|
|
49
|
+
});
|
|
45
50
|
} catch {
|
|
46
51
|
return;
|
|
47
52
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { checkHydrogenVersion } from './check-version.js';
|
|
2
|
+
import { vi, describe, afterEach, it, expect, beforeEach } from 'vitest';
|
|
3
|
+
import { outputMocker } from '@shopify/cli-kit';
|
|
4
|
+
import { checkForNewVersion } from '@shopify/cli-kit/node/node-package-manager';
|
|
5
|
+
|
|
6
|
+
vi.mock("@shopify/cli-kit/node/node-package-manager", () => {
|
|
7
|
+
return {
|
|
8
|
+
checkForNewVersion: vi.fn()
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
describe("checkHydrogenVersion()", () => {
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
vi.restoreAllMocks();
|
|
14
|
+
});
|
|
15
|
+
describe("when a current version is available", () => {
|
|
16
|
+
it("calls checkForNewVersion", async () => {
|
|
17
|
+
await checkHydrogenVersion("dir");
|
|
18
|
+
expect(checkForNewVersion).toHaveBeenCalledWith(
|
|
19
|
+
"@shopify/hydrogen",
|
|
20
|
+
expect.stringMatching(/20\d{2}\.\d{1,2}\.\d{1,3}/)
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
describe("and it is up to date", () => {
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
vi.mocked(checkForNewVersion).mockResolvedValue(void 0);
|
|
26
|
+
});
|
|
27
|
+
it("returns undefined", async () => {
|
|
28
|
+
expect(await checkHydrogenVersion("dir")).toBe(void 0);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
describe("and a new version is available", () => {
|
|
32
|
+
beforeEach(() => {
|
|
33
|
+
vi.mocked(checkForNewVersion).mockResolvedValue("2023.1.5");
|
|
34
|
+
});
|
|
35
|
+
it("returns a function", async () => {
|
|
36
|
+
expect(await checkHydrogenVersion("dir")).toBeInstanceOf(Function);
|
|
37
|
+
});
|
|
38
|
+
it("outputs a message to the user with the new version", async () => {
|
|
39
|
+
const outputMock = outputMocker.mockAndCaptureOutput();
|
|
40
|
+
const showUpgrade = await checkHydrogenVersion("dir");
|
|
41
|
+
const { currentVersion, newVersion } = showUpgrade();
|
|
42
|
+
expect(outputMock.info()).toMatch(
|
|
43
|
+
new RegExp(
|
|
44
|
+
` info .+ Upgrade available .+ Version ${newVersion.replaceAll(
|
|
45
|
+
".",
|
|
46
|
+
"\\."
|
|
47
|
+
)}.+ running v${currentVersion.replaceAll(".", "\\.")}`,
|
|
48
|
+
"is"
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
describe("when no current version can be found", () => {
|
|
55
|
+
it("returns undefined and does not call checkForNewVersion", async () => {
|
|
56
|
+
expect(await checkHydrogenVersion("/fake-absolute-dir")).toBe(void 0);
|
|
57
|
+
expect(checkForNewVersion).not.toHaveBeenCalled();
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
});
|
|
Binary file
|
|
Binary file
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: 'Inter';
|
|
3
|
-
src: url('../assets/inter-variable-font.
|
|
3
|
+
src: url('../assets/inter-variable-font.woff2') format('woff2-variations');
|
|
4
4
|
}
|
|
5
5
|
@font-face {
|
|
6
6
|
font-family: 'JetBrains Mono';
|
|
7
|
-
src: url('../assets/jetbrainsmono-variable-font.
|
|
8
|
-
format('
|
|
7
|
+
src: url('../assets/jetbrainsmono-variable-font.woff2')
|
|
8
|
+
format('woff2-variations');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
* {
|
|
@@ -214,7 +214,7 @@ main {
|
|
|
214
214
|
background: #fee9e8;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
.Banner.ErrorBanner
|
|
217
|
+
.Banner.ErrorBanner code {
|
|
218
218
|
background: #fef4f4;
|
|
219
219
|
border: 1px solid #fda9a5;
|
|
220
220
|
border-radius: 4px;
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"4.0.
|
|
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":[]}}}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,162 +0,0 @@
|
|
|
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 interVariableFont from "../assets/inter-variable-font.ttf";
|
|
11
|
-
import jetbrainsmonoVariableFont from "../assets/jetbrainsmono-variable-font.ttf";
|
|
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: interVariableFont,
|
|
29
|
-
as: "font",
|
|
30
|
-
type: "font/ttf",
|
|
31
|
-
crossOrigin: "anonymous"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
rel: "preload",
|
|
35
|
-
href: jetbrainsmonoVariableFont,
|
|
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
|
-
<a target="_blank" rel="norefferer noopener" href="https://shopify.dev/docs/custom-storefronts/hydrogen/environment-variables">editing environment variables</a>
|
|
106
|
-
{"."}
|
|
107
|
-
</p>
|
|
108
|
-
</section>
|
|
109
|
-
<ResourcesLinks />
|
|
110
|
-
</Layout></>;
|
|
111
|
-
}
|
|
112
|
-
function ResourcesLinks() {
|
|
113
|
-
return <><section className="Links">
|
|
114
|
-
<h2>Start building</h2>
|
|
115
|
-
<ul>
|
|
116
|
-
<li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen/building/collection-page">Collection template</a></li>
|
|
117
|
-
<li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen/building/product-details-page">Product template</a></li>
|
|
118
|
-
<li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen/building/cart">Cart</a></li>
|
|
119
|
-
</ul>
|
|
120
|
-
<h2>Resources</h2>
|
|
121
|
-
<ul>
|
|
122
|
-
<li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen">Hydrogen docs</a></li>
|
|
123
|
-
<li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen/project-structure">Remix and project structure</a></li>
|
|
124
|
-
<li><a target="_blank" rel="norefferer noopener" href="https://shopify.dev/custom-storefronts/hydrogen/data-fetching/fetch-data">Data queries and fetching</a></li>
|
|
125
|
-
</ul>
|
|
126
|
-
</section></>;
|
|
127
|
-
}
|
|
128
|
-
function Layout({
|
|
129
|
-
shopName,
|
|
130
|
-
children
|
|
131
|
-
}) {
|
|
132
|
-
return <>
|
|
133
|
-
<header>
|
|
134
|
-
<h1>{shopName?.toUpperCase()}</h1>
|
|
135
|
-
<p>{"\xA0Dev Mode\xA0"}</p>
|
|
136
|
-
<nav>
|
|
137
|
-
<a target="_blank" rel="norefferer noopener" href="https://discord.com/invite/shopifydevs"><IconDiscord /></a>
|
|
138
|
-
<a target="_blank" rel="norefferer noopener" href="https://github.com/Shopify/hydrogen"><IconGithub /></a>
|
|
139
|
-
<a target="_blank" rel="norefferer noopener" href="https://twitter.com/shopifydevs?lang=en"><IconTwitter /></a>
|
|
140
|
-
</nav>
|
|
141
|
-
</header>
|
|
142
|
-
<main>{children}</main>
|
|
143
|
-
<footer><div><a href="https://shopify.com" target="_blank" rel="noreferrer noopener">Powered by Shopify</a></div></footer>
|
|
144
|
-
</>;
|
|
145
|
-
}
|
|
146
|
-
const LAYOUT_QUERY = `#graphql
|
|
147
|
-
query layout {
|
|
148
|
-
shop {
|
|
149
|
-
name
|
|
150
|
-
id
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
`;
|
|
154
|
-
export {
|
|
155
|
-
CatchBoundary,
|
|
156
|
-
ErrorBoundary,
|
|
157
|
-
HYDROGEN_SHOP_ID,
|
|
158
|
-
Index as default,
|
|
159
|
-
links,
|
|
160
|
-
loader,
|
|
161
|
-
meta
|
|
162
|
-
};
|