@shopify/cli-hydrogen 5.0.0 → 5.0.2
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/build.d.ts +1 -1
- package/dist/commands/hydrogen/build.js +37 -20
- package/dist/commands/hydrogen/dev.d.ts +2 -1
- package/dist/commands/hydrogen/dev.js +97 -63
- package/dist/commands/hydrogen/link.js +61 -4
- package/dist/commands/hydrogen/link.test.js +92 -23
- package/dist/commands/hydrogen/preview.js +2 -1
- package/dist/lib/config.d.ts +2 -0
- package/dist/lib/flags.d.ts +1 -0
- package/dist/lib/flags.js +6 -0
- package/dist/lib/graphql/admin/create-storefront.d.ts +17 -0
- package/dist/lib/graphql/admin/create-storefront.js +38 -0
- package/dist/lib/graphql/admin/fetch-job.d.ts +23 -0
- package/dist/lib/graphql/admin/fetch-job.js +48 -0
- package/dist/lib/log.d.ts +2 -1
- package/dist/lib/log.js +8 -1
- package/dist/lib/mini-oxygen.d.ts +9 -1
- package/dist/lib/mini-oxygen.js +15 -7
- package/dist/lib/string.d.ts +3 -0
- package/dist/lib/string.js +7 -0
- package/dist/lib/string.test.d.ts +1 -0
- package/dist/lib/string.test.js +16 -0
- package/dist/lib/user-errors.d.ts +9 -0
- package/dist/lib/user-errors.js +11 -0
- package/oclif.manifest.json +1 -1
- package/package.json +5 -5
|
@@ -6,7 +6,7 @@ declare class Build extends Command {
|
|
|
6
6
|
static flags: {
|
|
7
7
|
path: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined, _oclif_core_lib_interfaces_parser_js.CustomOptions>;
|
|
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
10
|
base: _oclif_core_lib_interfaces_parser_js.OptionFlag<unknown, _oclif_core_lib_interfaces_parser_js.CustomOptions>;
|
|
11
11
|
entry: _oclif_core_lib_interfaces_parser_js.OptionFlag<unknown, _oclif_core_lib_interfaces_parser_js.CustomOptions>;
|
|
12
12
|
target: _oclif_core_lib_interfaces_parser_js.OptionFlag<unknown, _oclif_core_lib_interfaces_parser_js.CustomOptions>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
1
|
import { Flags } from '@oclif/core';
|
|
3
2
|
import Command from '@shopify/cli-kit/node/base-command';
|
|
4
3
|
import { outputInfo, outputContent, outputToken, outputWarn } from '@shopify/cli-kit/node/output';
|
|
5
|
-
import { rmdir, fileSize, copyFile } from '@shopify/cli-kit/node/fs';
|
|
4
|
+
import { rmdir, fileSize, glob, removeFile, copyFile } from '@shopify/cli-kit/node/fs';
|
|
5
|
+
import { resolvePath, relativePath, joinPath } from '@shopify/cli-kit/node/path';
|
|
6
6
|
import { getPackageManager } from '@shopify/cli-kit/node/node-package-manager';
|
|
7
7
|
import colors from '@shopify/cli-kit/node/colors';
|
|
8
8
|
import { getProjectPaths, getRemixConfig } from '../../lib/config.js';
|
|
9
9
|
import { commonFlags, deprecated, flagsToCamelObject } from '../../lib/flags.js';
|
|
10
10
|
import { checkLockfileStatus } from '../../lib/check-lockfile.js';
|
|
11
11
|
import { findMissingRoutes } from '../../lib/missing-routes.js';
|
|
12
|
+
import { warnOnce } from '../../lib/log.js';
|
|
12
13
|
|
|
13
14
|
const LOG_WORKER_BUILT = "\u{1F4E6} Worker built";
|
|
14
15
|
class Build extends Command {
|
|
@@ -18,10 +19,9 @@ class Build extends Command {
|
|
|
18
19
|
sourcemap: Flags.boolean({
|
|
19
20
|
description: "Generate sourcemaps for the build.",
|
|
20
21
|
env: "SHOPIFY_HYDROGEN_FLAG_SOURCEMAP",
|
|
21
|
-
default:
|
|
22
|
-
allowNo: true
|
|
22
|
+
default: false
|
|
23
23
|
}),
|
|
24
|
-
|
|
24
|
+
"disable-route-warning": Flags.boolean({
|
|
25
25
|
description: "Disable warning about missing standard routes.",
|
|
26
26
|
env: "SHOPIFY_HYDROGEN_FLAG_DISABLE_ROUTE_WARNING"
|
|
27
27
|
}),
|
|
@@ -31,13 +31,13 @@ class Build extends Command {
|
|
|
31
31
|
};
|
|
32
32
|
async run() {
|
|
33
33
|
const { flags } = await this.parse(Build);
|
|
34
|
-
const directory = flags.path ?
|
|
34
|
+
const directory = flags.path ? resolvePath(flags.path) : process.cwd();
|
|
35
35
|
await runBuild({ ...flagsToCamelObject(flags), path: directory });
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
async function runBuild({
|
|
39
39
|
path: appPath,
|
|
40
|
-
sourcemap =
|
|
40
|
+
sourcemap = false,
|
|
41
41
|
disableRouteWarning = false
|
|
42
42
|
}) {
|
|
43
43
|
if (!process.env.NODE_ENV) {
|
|
@@ -46,23 +46,28 @@ async function runBuild({
|
|
|
46
46
|
const { root, buildPath, buildPathClient, buildPathWorkerFile, publicPath } = getProjectPaths(appPath);
|
|
47
47
|
await checkLockfileStatus(root);
|
|
48
48
|
console.time(LOG_WORKER_BUILT);
|
|
49
|
-
|
|
49
|
+
outputInfo(`
|
|
50
|
+
\u{1F3D7}\uFE0F Building in ${process.env.NODE_ENV} mode...`);
|
|
51
|
+
const [remixConfig, { build }, { logThrown }, { createFileWatchCache }] = await Promise.all([
|
|
50
52
|
getRemixConfig(root),
|
|
53
|
+
import('@remix-run/dev/dist/compiler/build.js'),
|
|
54
|
+
import('@remix-run/dev/dist/compiler/utils/log.js'),
|
|
55
|
+
import('@remix-run/dev/dist/compiler/fileWatchCache.js'),
|
|
51
56
|
rmdir(buildPath, { force: true })
|
|
52
57
|
]);
|
|
53
|
-
outputInfo(`
|
|
54
|
-
\u{1F3D7}\uFE0F Building in ${process.env.NODE_ENV} mode...`);
|
|
55
|
-
const { build } = await import('@remix-run/dev/dist/compiler/build.js');
|
|
56
|
-
const { logCompileFailure } = await import('@remix-run/dev/dist/compiler/onCompileFailure.js');
|
|
57
58
|
await Promise.all([
|
|
58
59
|
copyPublicFiles(publicPath, buildPathClient),
|
|
59
|
-
build(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
60
|
+
build({
|
|
61
|
+
config: remixConfig,
|
|
62
|
+
options: {
|
|
63
|
+
mode: process.env.NODE_ENV,
|
|
64
|
+
onWarning: warnOnce,
|
|
65
|
+
sourcemap
|
|
66
|
+
},
|
|
67
|
+
fileWatchCache: createFileWatchCache()
|
|
68
|
+
}).catch((thrown) => {
|
|
69
|
+
logThrown(thrown);
|
|
70
|
+
process.exit(1);
|
|
66
71
|
})
|
|
67
72
|
]);
|
|
68
73
|
if (process.env.NODE_ENV !== "development") {
|
|
@@ -70,7 +75,7 @@ async function runBuild({
|
|
|
70
75
|
const sizeMB = await fileSize(buildPathWorkerFile) / (1024 * 1024);
|
|
71
76
|
outputInfo(
|
|
72
77
|
outputContent` ${colors.dim(
|
|
73
|
-
|
|
78
|
+
relativePath(root, buildPathWorkerFile)
|
|
74
79
|
)} ${outputToken.yellow(sizeMB.toFixed(2))} MB\n`
|
|
75
80
|
);
|
|
76
81
|
if (sizeMB >= 1) {
|
|
@@ -79,6 +84,18 @@ async function runBuild({
|
|
|
79
84
|
`
|
|
80
85
|
);
|
|
81
86
|
}
|
|
87
|
+
if (sourcemap) {
|
|
88
|
+
if (process.env.HYDROGEN_ASSET_BASE_URL) {
|
|
89
|
+
const filepaths = await glob(joinPath(buildPathClient, "**/*.js.map"));
|
|
90
|
+
for (const filepath of filepaths) {
|
|
91
|
+
await removeFile(filepath);
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
outputWarn(
|
|
95
|
+
"\u{1F6A8} Sourcemaps are enabled in production! Use this only for testing.\n"
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
82
99
|
}
|
|
83
100
|
if (!disableRouteWarning) {
|
|
84
101
|
const missingRoutes = findMissingRoutes(remixConfig);
|
|
@@ -8,7 +8,8 @@ declare class Dev extends Command {
|
|
|
8
8
|
port: _oclif_core_lib_interfaces_parser_js.OptionFlag<number, _oclif_core_lib_interfaces_parser_js.CustomOptions>;
|
|
9
9
|
"codegen-unstable": _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
|
|
10
10
|
"codegen-config-path": _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined, _oclif_core_lib_interfaces_parser_js.CustomOptions>;
|
|
11
|
-
|
|
11
|
+
sourcemap: _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
|
|
12
|
+
'disable-virtual-routes': _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
|
|
12
13
|
shop: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined, _oclif_core_lib_interfaces_parser_js.CustomOptions>;
|
|
13
14
|
debug: _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
|
|
14
15
|
host: _oclif_core_lib_interfaces_parser_js.OptionFlag<unknown, _oclif_core_lib_interfaces_parser_js.CustomOptions>;
|
|
@@ -2,9 +2,11 @@ import path from 'path';
|
|
|
2
2
|
import fs from 'fs/promises';
|
|
3
3
|
import { outputInfo } from '@shopify/cli-kit/node/output';
|
|
4
4
|
import { fileExists } from '@shopify/cli-kit/node/fs';
|
|
5
|
+
import { renderFatalError } from '@shopify/cli-kit/node/ui';
|
|
6
|
+
import colors from '@shopify/cli-kit/node/colors';
|
|
5
7
|
import { copyPublicFiles } from './build.js';
|
|
6
8
|
import { getProjectPaths, getRemixConfig } from '../../lib/config.js';
|
|
7
|
-
import { muteDevLogs } from '../../lib/log.js';
|
|
9
|
+
import { muteDevLogs, warnOnce } from '../../lib/log.js';
|
|
8
10
|
import { commonFlags, deprecated, flagsToCamelObject } from '../../lib/flags.js';
|
|
9
11
|
import Command from '@shopify/cli-kit/node/base-command';
|
|
10
12
|
import { Flags } from '@oclif/core';
|
|
@@ -15,7 +17,6 @@ import { spawnCodegenProcess } from '../../lib/codegen.js';
|
|
|
15
17
|
import { combinedEnvironmentVariables } from '../../lib/combined-environment-variables.js';
|
|
16
18
|
import { getConfig } from '../../lib/shopify-config.js';
|
|
17
19
|
|
|
18
|
-
const LOG_INITIAL_BUILD = "\n\u{1F3C1} Initial build";
|
|
19
20
|
const LOG_REBUILDING = "\u{1F9F1} Rebuilding...";
|
|
20
21
|
const LOG_REBUILT = "\u{1F680} Rebuilt";
|
|
21
22
|
class Dev extends Command {
|
|
@@ -33,7 +34,8 @@ class Dev extends Command {
|
|
|
33
34
|
required: false,
|
|
34
35
|
dependsOn: ["codegen-unstable"]
|
|
35
36
|
}),
|
|
36
|
-
|
|
37
|
+
sourcemap: commonFlags.sourcemap,
|
|
38
|
+
"disable-virtual-routes": Flags.boolean({
|
|
37
39
|
description: "Disable rendering fallback routes when a route file doesn't exist.",
|
|
38
40
|
env: "SHOPIFY_HYDROGEN_FLAG_DISABLE_VIRTUAL_ROUTES",
|
|
39
41
|
default: false
|
|
@@ -65,14 +67,14 @@ async function runDev({
|
|
|
65
67
|
disableVirtualRoutes,
|
|
66
68
|
shop,
|
|
67
69
|
envBranch,
|
|
68
|
-
debug = false
|
|
70
|
+
debug = false,
|
|
71
|
+
sourcemap = true
|
|
69
72
|
}) {
|
|
70
73
|
if (!process.env.NODE_ENV)
|
|
71
74
|
process.env.NODE_ENV = "development";
|
|
72
75
|
muteDevLogs();
|
|
73
76
|
if (debug)
|
|
74
77
|
(await import('node:inspector')).open();
|
|
75
|
-
console.time(LOG_INITIAL_BUILD);
|
|
76
78
|
const { root, publicPath, buildPathClient, buildPathWorkerFile } = getProjectPaths(appPath);
|
|
77
79
|
const checkingHydrogenVersion = checkHydrogenVersion(root);
|
|
78
80
|
const copyingFiles = copyPublicFiles(publicPath, buildPathClient);
|
|
@@ -91,11 +93,18 @@ async function runDev({
|
|
|
91
93
|
shop,
|
|
92
94
|
envBranch
|
|
93
95
|
}) : void 0;
|
|
94
|
-
|
|
96
|
+
const [{ watch }, { createFileWatchCache }] = await Promise.all([
|
|
97
|
+
import('@remix-run/dev/dist/compiler/watch.js'),
|
|
98
|
+
import('@remix-run/dev/dist/compiler/fileWatchCache.js')
|
|
99
|
+
]);
|
|
100
|
+
let isInitialBuild = true;
|
|
101
|
+
let initialBuildDurationMs = 0;
|
|
102
|
+
let initialBuildStartTimeMs = Date.now();
|
|
103
|
+
let isMiniOxygenStarted = false;
|
|
95
104
|
async function safeStartMiniOxygen() {
|
|
96
|
-
if (
|
|
105
|
+
if (isMiniOxygenStarted)
|
|
97
106
|
return;
|
|
98
|
-
await startMiniOxygen({
|
|
107
|
+
const miniOxygen = await startMiniOxygen({
|
|
99
108
|
root,
|
|
100
109
|
port,
|
|
101
110
|
watch: true,
|
|
@@ -103,75 +112,100 @@ async function runDev({
|
|
|
103
112
|
buildPathClient,
|
|
104
113
|
environmentVariables
|
|
105
114
|
});
|
|
106
|
-
|
|
115
|
+
isMiniOxygenStarted = true;
|
|
116
|
+
miniOxygen.showBanner({
|
|
117
|
+
headlinePrefix: initialBuildDurationMs > 0 ? `Initial build: ${initialBuildDurationMs}ms
|
|
118
|
+
` : "",
|
|
119
|
+
extraLines: [
|
|
120
|
+
colors.dim(
|
|
121
|
+
`
|
|
122
|
+
View GraphiQL API browser: ${miniOxygen.listeningAt}/graphiql`
|
|
123
|
+
)
|
|
124
|
+
]
|
|
125
|
+
});
|
|
107
126
|
const showUpgrade = await checkingHydrogenVersion;
|
|
108
127
|
if (showUpgrade)
|
|
109
128
|
showUpgrade();
|
|
110
129
|
}
|
|
111
|
-
const { watch } = await import('@remix-run/dev/dist/compiler/watch.js');
|
|
112
130
|
const remixConfig = await reloadConfig();
|
|
113
131
|
if (codegen) {
|
|
114
132
|
spawnCodegenProcess({ ...remixConfig, configFilePath: codegenConfigPath });
|
|
115
133
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
message: "MiniOxygen cannot start because the server bundle has not been generated.",
|
|
127
|
-
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."
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
console.timeEnd(LOG_INITIAL_BUILD);
|
|
131
|
-
await safeStartMiniOxygen();
|
|
134
|
+
const fileWatchCache = createFileWatchCache();
|
|
135
|
+
await watch(
|
|
136
|
+
{
|
|
137
|
+
config: remixConfig,
|
|
138
|
+
options: {
|
|
139
|
+
mode: process.env.NODE_ENV,
|
|
140
|
+
onWarning: warnOnce,
|
|
141
|
+
sourcemap
|
|
142
|
+
},
|
|
143
|
+
fileWatchCache
|
|
132
144
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
145
|
+
{
|
|
146
|
+
reloadConfig,
|
|
147
|
+
onBuildStart() {
|
|
148
|
+
if (!isInitialBuild) {
|
|
149
|
+
console.time(LOG_REBUILT);
|
|
150
|
+
outputInfo(LOG_REBUILDING);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
async onBuildFinish() {
|
|
154
|
+
if (isInitialBuild) {
|
|
155
|
+
await copyingFiles;
|
|
156
|
+
initialBuildDurationMs = Date.now() - initialBuildStartTimeMs;
|
|
157
|
+
isInitialBuild = false;
|
|
158
|
+
} else {
|
|
159
|
+
console.timeEnd(LOG_REBUILT);
|
|
160
|
+
if (!isMiniOxygenStarted)
|
|
161
|
+
console.log("");
|
|
162
|
+
}
|
|
163
|
+
if (!isMiniOxygenStarted) {
|
|
164
|
+
if (!await serverBundleExists()) {
|
|
165
|
+
return renderFatalError({
|
|
166
|
+
name: "BuildError",
|
|
167
|
+
type: 0,
|
|
168
|
+
message: "MiniOxygen cannot start because the server bundle has not been generated.",
|
|
169
|
+
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."
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
await safeStartMiniOxygen();
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
async onFileCreated(file) {
|
|
176
|
+
const [relative, absolute] = getFilePaths(file);
|
|
177
|
+
outputInfo(`
|
|
136
178
|
\u{1F4C4} File created: ${relative}`);
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
179
|
+
if (absolute.startsWith(publicPath)) {
|
|
180
|
+
await copyPublicFiles(
|
|
181
|
+
absolute,
|
|
182
|
+
absolute.replace(publicPath, buildPathClient)
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
async onFileChanged(file) {
|
|
187
|
+
fileWatchCache.invalidateFile(file);
|
|
188
|
+
const [relative, absolute] = getFilePaths(file);
|
|
189
|
+
outputInfo(`
|
|
147
190
|
\u{1F4C4} File changed: ${relative}`);
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
191
|
+
if (absolute.startsWith(publicPath)) {
|
|
192
|
+
await copyPublicFiles(
|
|
193
|
+
absolute,
|
|
194
|
+
absolute.replace(publicPath, buildPathClient)
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
async onFileDeleted(file) {
|
|
199
|
+
fileWatchCache.invalidateFile(file);
|
|
200
|
+
const [relative, absolute] = getFilePaths(file);
|
|
201
|
+
outputInfo(`
|
|
158
202
|
\u{1F4C4} File deleted: ${relative}`);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
onRebuildStart() {
|
|
164
|
-
outputInfo(LOG_REBUILDING);
|
|
165
|
-
console.time(LOG_REBUILT);
|
|
166
|
-
},
|
|
167
|
-
async onRebuildFinish() {
|
|
168
|
-
console.timeEnd(LOG_REBUILT);
|
|
169
|
-
if (!miniOxygenStarted && await serverBundleExists()) {
|
|
170
|
-
console.log("");
|
|
171
|
-
await safeStartMiniOxygen();
|
|
203
|
+
if (absolute.startsWith(publicPath)) {
|
|
204
|
+
await fs.unlink(absolute.replace(publicPath, buildPathClient));
|
|
205
|
+
}
|
|
172
206
|
}
|
|
173
207
|
}
|
|
174
|
-
|
|
208
|
+
);
|
|
175
209
|
}
|
|
176
210
|
|
|
177
211
|
export { Dev as default };
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import Command from '@shopify/cli-kit/node/base-command';
|
|
3
|
-
import {
|
|
3
|
+
import { basename } from '@shopify/cli-kit/node/path';
|
|
4
|
+
import { renderConfirmationPrompt, renderWarning, renderSelectPrompt, renderTextPrompt, renderTasks, renderSuccess } from '@shopify/cli-kit/node/ui';
|
|
4
5
|
import { commonFlags } from '../../lib/flags.js';
|
|
5
6
|
import { getHydrogenShop } from '../../lib/shop.js';
|
|
6
7
|
import { getStorefronts } from '../../lib/graphql/admin/link-storefront.js';
|
|
8
|
+
import { createStorefront } from '../../lib/graphql/admin/create-storefront.js';
|
|
9
|
+
import { waitForJob } from '../../lib/graphql/admin/fetch-job.js';
|
|
7
10
|
import { getConfig, setStorefront } from '../../lib/shopify-config.js';
|
|
8
11
|
import { logMissingStorefronts } from '../../lib/missing-storefronts.js';
|
|
12
|
+
import { titleize } from '../../lib/string.js';
|
|
9
13
|
import { getCliCommand } from '../../lib/shell.js';
|
|
14
|
+
import { renderUserErrors, renderError } from '../../lib/user-errors.js';
|
|
10
15
|
|
|
11
16
|
class Link extends Command {
|
|
12
17
|
static description = "Link a local project to one of your shop's Hydrogen storefronts.";
|
|
@@ -24,6 +29,7 @@ class Link extends Command {
|
|
|
24
29
|
await linkStorefront(flags);
|
|
25
30
|
}
|
|
26
31
|
}
|
|
32
|
+
const CREATE_NEW_STOREFRONT_ID = "NEW_STOREFRONT";
|
|
27
33
|
async function linkStorefront({
|
|
28
34
|
force,
|
|
29
35
|
path,
|
|
@@ -47,6 +53,7 @@ async function linkStorefront({
|
|
|
47
53
|
return;
|
|
48
54
|
}
|
|
49
55
|
let selectedStorefront;
|
|
56
|
+
let selectCreateNewStorefront = false;
|
|
50
57
|
const cliCommand = await getCliCommand();
|
|
51
58
|
if (flagStorefront) {
|
|
52
59
|
selectedStorefront = storefronts.find(
|
|
@@ -77,11 +84,61 @@ async function linkStorefront({
|
|
|
77
84
|
message: "Choose a Hydrogen storefront to link",
|
|
78
85
|
choices
|
|
79
86
|
});
|
|
80
|
-
|
|
87
|
+
if (storefrontId === CREATE_NEW_STOREFRONT_ID) {
|
|
88
|
+
selectCreateNewStorefront = true;
|
|
89
|
+
} else {
|
|
90
|
+
selectedStorefront = storefronts.find(({ id }) => id === storefrontId);
|
|
91
|
+
}
|
|
81
92
|
}
|
|
82
|
-
if (
|
|
83
|
-
|
|
93
|
+
if (selectCreateNewStorefront) {
|
|
94
|
+
const storefront = await createNewStorefront(path, shop);
|
|
95
|
+
if (!storefront) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
selectedStorefront = storefront;
|
|
84
99
|
}
|
|
100
|
+
if (selectedStorefront) {
|
|
101
|
+
await linkExistingStorefront(path, selectedStorefront, silent, cliCommand);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function createNewStorefront(path, shop) {
|
|
105
|
+
const projectDirectory = path && basename(path);
|
|
106
|
+
const projectName = await renderTextPrompt({
|
|
107
|
+
message: "What do you want to name the Hydrogen storefront on Shopify?",
|
|
108
|
+
defaultValue: titleize(projectDirectory) || "Hydrogen Storefront"
|
|
109
|
+
});
|
|
110
|
+
let storefront;
|
|
111
|
+
let jobId;
|
|
112
|
+
await renderTasks([
|
|
113
|
+
{
|
|
114
|
+
title: "Creating storefront",
|
|
115
|
+
task: async () => {
|
|
116
|
+
const result = await createStorefront(shop, projectName);
|
|
117
|
+
storefront = result.storefront;
|
|
118
|
+
jobId = result.jobId;
|
|
119
|
+
if (result.userErrors.length > 0) {
|
|
120
|
+
renderUserErrors(result.userErrors);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
title: "Creating API tokens",
|
|
126
|
+
task: async () => {
|
|
127
|
+
try {
|
|
128
|
+
await waitForJob(shop, jobId);
|
|
129
|
+
} catch (_err) {
|
|
130
|
+
storefront = void 0;
|
|
131
|
+
renderError(
|
|
132
|
+
"Please try again or contact support if the error persists."
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
skip: () => !jobId
|
|
137
|
+
}
|
|
138
|
+
]);
|
|
139
|
+
return storefront;
|
|
140
|
+
}
|
|
141
|
+
async function linkExistingStorefront(path, selectedStorefront, silent, cliCommand) {
|
|
85
142
|
await setStorefront(path ?? process.cwd(), selectedStorefront);
|
|
86
143
|
if (!silent) {
|
|
87
144
|
renderSuccess({
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { vi, describe, beforeEach, afterEach, it, expect } from 'vitest';
|
|
2
2
|
import { mockAndCaptureOutput } from '@shopify/cli-kit/node/testing/output';
|
|
3
|
-
import { renderSelectPrompt, renderConfirmationPrompt } from '@shopify/cli-kit/node/ui';
|
|
3
|
+
import { renderSelectPrompt, renderTextPrompt, renderConfirmationPrompt } from '@shopify/cli-kit/node/ui';
|
|
4
4
|
import { adminRequest } from '../../lib/graphql.js';
|
|
5
5
|
import { getStorefronts } from '../../lib/graphql/admin/link-storefront.js';
|
|
6
|
+
import { createStorefront } from '../../lib/graphql/admin/create-storefront.js';
|
|
7
|
+
import { waitForJob } from '../../lib/graphql/admin/fetch-job.js';
|
|
6
8
|
import { getConfig, setStorefront } from '../../lib/shopify-config.js';
|
|
9
|
+
import { renderUserErrors, renderError } from '../../lib/user-errors.js';
|
|
7
10
|
import { linkStorefront } from './link.js';
|
|
8
11
|
|
|
9
12
|
const SHOP = "my-shop";
|
|
@@ -16,12 +19,16 @@ vi.mock("@shopify/cli-kit/node/ui", async () => {
|
|
|
16
19
|
return {
|
|
17
20
|
...original,
|
|
18
21
|
renderConfirmationPrompt: vi.fn(),
|
|
19
|
-
renderSelectPrompt: vi.fn()
|
|
22
|
+
renderSelectPrompt: vi.fn(),
|
|
23
|
+
renderTextPrompt: vi.fn()
|
|
20
24
|
};
|
|
21
25
|
});
|
|
22
26
|
vi.mock("../../lib/graphql.js");
|
|
23
27
|
vi.mock("../../lib/shopify-config.js");
|
|
24
28
|
vi.mock("../../lib/graphql/admin/link-storefront.js");
|
|
29
|
+
vi.mock("../../lib/graphql/admin/create-storefront.js");
|
|
30
|
+
vi.mock("../../lib/graphql/admin/fetch-job.js");
|
|
31
|
+
vi.mock("../../lib/user-errors.js");
|
|
25
32
|
vi.mock("../../lib/shop.js", () => ({
|
|
26
33
|
getHydrogenShop: () => SHOP
|
|
27
34
|
}));
|
|
@@ -52,28 +59,90 @@ describe("link", () => {
|
|
|
52
59
|
await linkStorefront({});
|
|
53
60
|
expect(getStorefronts).toHaveBeenCalledWith(SHOP);
|
|
54
61
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
describe("when you want to link an existing Hydrogen storefront", () => {
|
|
63
|
+
beforeEach(async () => {
|
|
64
|
+
vi.mocked(renderSelectPrompt).mockResolvedValue(
|
|
65
|
+
"gid://shopify/HydrogenStorefront/1"
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
it("renders a list of choices and forwards the selection to setStorefront", async () => {
|
|
69
|
+
await linkStorefront({ path: "my-path" });
|
|
70
|
+
expect(setStorefront).toHaveBeenCalledWith(
|
|
71
|
+
"my-path",
|
|
72
|
+
expect.objectContaining({
|
|
73
|
+
id: "gid://shopify/HydrogenStorefront/1",
|
|
74
|
+
title: "Hydrogen"
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
it("renders a success message", async () => {
|
|
79
|
+
await linkStorefront({ path: "my-path" });
|
|
80
|
+
expect(outputMock.info()).toMatch(/Hydrogen is now linked/g);
|
|
81
|
+
expect(outputMock.info()).toMatch(
|
|
82
|
+
/Run `h2 dev` to start your local development server and start building/g
|
|
83
|
+
);
|
|
84
|
+
});
|
|
67
85
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
86
|
+
describe("when you want to link a new Hydrogen storefront", () => {
|
|
87
|
+
const expectedStorefrontName = "New Storefront";
|
|
88
|
+
const expectedJobId = "gid://shopify/Job/1";
|
|
89
|
+
beforeEach(async () => {
|
|
90
|
+
vi.mocked(renderSelectPrompt).mockResolvedValue("NEW_STOREFRONT");
|
|
91
|
+
vi.mocked(createStorefront).mockResolvedValue({
|
|
92
|
+
adminSession: ADMIN_SESSION,
|
|
93
|
+
storefront: {
|
|
94
|
+
id: "gid://shopify/HydrogenStorefront/1",
|
|
95
|
+
title: expectedStorefrontName,
|
|
96
|
+
productionUrl: "https://example.com"
|
|
97
|
+
},
|
|
98
|
+
userErrors: [],
|
|
99
|
+
jobId: expectedJobId
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
it("chooses to create a new storefront given the directory path", async () => {
|
|
103
|
+
await linkStorefront({ path: "my-path" });
|
|
104
|
+
expect(renderTextPrompt).toHaveBeenCalledWith({
|
|
105
|
+
message: expect.stringMatching(/name/i),
|
|
106
|
+
defaultValue: "My Path"
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
it("chooses to create a new storefront without directory path", async () => {
|
|
110
|
+
await linkStorefront({});
|
|
111
|
+
expect(renderTextPrompt).toHaveBeenCalledWith({
|
|
112
|
+
message: expect.stringMatching(/name/i),
|
|
113
|
+
defaultValue: "Hydrogen Storefront"
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
it("handles the successful creation of the storefront on Admin", async () => {
|
|
117
|
+
await linkStorefront({});
|
|
118
|
+
expect(waitForJob).toHaveBeenCalledWith(SHOP, expectedJobId);
|
|
119
|
+
expect(outputMock.info()).toContain(
|
|
120
|
+
`${expectedStorefrontName} is now linked`
|
|
121
|
+
);
|
|
122
|
+
});
|
|
123
|
+
it("handles the user-errors when creating the storefront on Admin", async () => {
|
|
124
|
+
const expectedUserErrors = [
|
|
125
|
+
{
|
|
126
|
+
code: "INVALID",
|
|
127
|
+
field: [],
|
|
128
|
+
message: "Bad thing happend."
|
|
129
|
+
}
|
|
130
|
+
];
|
|
131
|
+
vi.mocked(createStorefront).mockResolvedValue({
|
|
132
|
+
adminSession: ADMIN_SESSION,
|
|
133
|
+
storefront: void 0,
|
|
134
|
+
userErrors: expectedUserErrors,
|
|
135
|
+
jobId: void 0
|
|
136
|
+
});
|
|
137
|
+
await linkStorefront({});
|
|
138
|
+
expect(waitForJob).not.toHaveBeenCalled();
|
|
139
|
+
expect(renderUserErrors).toHaveBeenCalledWith(expectedUserErrors);
|
|
140
|
+
});
|
|
141
|
+
it("handles the job errors when creating the storefront on Admin", async () => {
|
|
142
|
+
vi.mocked(waitForJob).mockRejectedValue(void 0);
|
|
143
|
+
await linkStorefront({});
|
|
144
|
+
expect(renderError).toHaveBeenCalled();
|
|
145
|
+
});
|
|
77
146
|
});
|
|
78
147
|
describe("when there are no Hydrogen storefronts", () => {
|
|
79
148
|
it("renders a message and returns early", async () => {
|
|
@@ -23,12 +23,13 @@ async function runPreview({
|
|
|
23
23
|
process.env.NODE_ENV = "production";
|
|
24
24
|
muteDevLogs({ workerReload: false });
|
|
25
25
|
const { root, buildPathWorkerFile, buildPathClient } = getProjectPaths(appPath);
|
|
26
|
-
await startMiniOxygen({
|
|
26
|
+
const miniOxygen = await startMiniOxygen({
|
|
27
27
|
root,
|
|
28
28
|
port,
|
|
29
29
|
buildPathClient,
|
|
30
30
|
buildPathWorkerFile
|
|
31
31
|
});
|
|
32
|
+
miniOxygen.showBanner({ mode: "preview" });
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export { Preview as default, runPreview };
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ServerMode } from '@remix-run/dev/dist/config/serverModes.js';
|
|
2
|
+
export { ServerMode } from '@remix-run/dev/dist/config/serverModes.js';
|
|
2
3
|
import { RemixConfig } from '@remix-run/dev/dist/config.js';
|
|
4
|
+
export { RemixConfig } from '@remix-run/dev/dist/config.js';
|
|
3
5
|
|
|
4
6
|
declare function getProjectPaths(appPath?: string, entry?: string): {
|
|
5
7
|
root: string;
|
package/dist/lib/flags.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare const commonFlags: {
|
|
|
6
6
|
force: _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
|
|
7
7
|
shop: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined, _oclif_core_lib_interfaces_parser_js.CustomOptions>;
|
|
8
8
|
"env-branch": _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined, _oclif_core_lib_interfaces_parser_js.CustomOptions>;
|
|
9
|
+
sourcemap: _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
|
|
9
10
|
};
|
|
10
11
|
declare function flagsToCamelObject(obj: Record<string, any>): any;
|
|
11
12
|
/**
|
package/dist/lib/flags.js
CHANGED
|
@@ -29,6 +29,12 @@ const commonFlags = {
|
|
|
29
29
|
description: "Specify an environment's branch name when using remote environment variables.",
|
|
30
30
|
env: "SHOPIFY_HYDROGEN_ENVIRONMENT_BRANCH",
|
|
31
31
|
char: "e"
|
|
32
|
+
}),
|
|
33
|
+
sourcemap: Flags.boolean({
|
|
34
|
+
description: "Generate sourcemaps for the build.",
|
|
35
|
+
env: "SHOPIFY_HYDROGEN_FLAG_SOURCEMAP",
|
|
36
|
+
default: true,
|
|
37
|
+
allowNo: true
|
|
32
38
|
})
|
|
33
39
|
};
|
|
34
40
|
function flagsToCamelObject(obj) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AdminSession } from '@shopify/cli-kit/node/session';
|
|
2
|
+
import { UserError } from '../../user-errors.js';
|
|
3
|
+
|
|
4
|
+
declare const CreateStorefrontMutation = "#graphql\n mutation CreateStorefront($title: String!) {\n hydrogenStorefrontCreate(title: $title) {\n hydrogenStorefront {\n id\n title\n productionUrl\n }\n userErrors {\n code\n field\n message\n }\n jobId\n }\n }\n";
|
|
5
|
+
interface HydrogenStorefront {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
productionUrl: string;
|
|
9
|
+
}
|
|
10
|
+
declare function createStorefront(shop: string, title: string): Promise<{
|
|
11
|
+
adminSession: AdminSession;
|
|
12
|
+
storefront: HydrogenStorefront | undefined;
|
|
13
|
+
userErrors: UserError[];
|
|
14
|
+
jobId: string | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
|
|
17
|
+
export { CreateStorefrontMutation, createStorefront };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { adminRequest } from '../../graphql.js';
|
|
2
|
+
import { getAdminSession } from '../../admin-session.js';
|
|
3
|
+
|
|
4
|
+
const CreateStorefrontMutation = `#graphql
|
|
5
|
+
mutation CreateStorefront($title: String!) {
|
|
6
|
+
hydrogenStorefrontCreate(title: $title) {
|
|
7
|
+
hydrogenStorefront {
|
|
8
|
+
id
|
|
9
|
+
title
|
|
10
|
+
productionUrl
|
|
11
|
+
}
|
|
12
|
+
userErrors {
|
|
13
|
+
code
|
|
14
|
+
field
|
|
15
|
+
message
|
|
16
|
+
}
|
|
17
|
+
jobId
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
async function createStorefront(shop, title) {
|
|
22
|
+
const adminSession = await getAdminSession(shop);
|
|
23
|
+
const { hydrogenStorefrontCreate } = await adminRequest(
|
|
24
|
+
CreateStorefrontMutation,
|
|
25
|
+
adminSession,
|
|
26
|
+
{
|
|
27
|
+
title
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
return {
|
|
31
|
+
adminSession,
|
|
32
|
+
storefront: hydrogenStorefrontCreate.hydrogenStorefront,
|
|
33
|
+
userErrors: hydrogenStorefrontCreate.userErrors,
|
|
34
|
+
jobId: hydrogenStorefrontCreate.jobId
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { CreateStorefrontMutation, createStorefront };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AdminSession } from '@shopify/cli-kit/node/session';
|
|
2
|
+
|
|
3
|
+
declare const FetchJobQuery = "#graphql\n query FetchJob($id: ID!) {\n hydrogenStorefrontJob(id: $id) {\n id\n done\n errors {\n code\n message\n }\n }\n }\n";
|
|
4
|
+
interface JobError {
|
|
5
|
+
code: string;
|
|
6
|
+
message: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
interface JobSchema {
|
|
9
|
+
hydrogenStorefrontJob: {
|
|
10
|
+
id: string;
|
|
11
|
+
done: boolean;
|
|
12
|
+
errors: JobError[];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
declare function fetchJob(shop: string, jobId: string): Promise<{
|
|
16
|
+
adminSession: AdminSession;
|
|
17
|
+
id: string;
|
|
18
|
+
done: boolean;
|
|
19
|
+
errors: JobError[];
|
|
20
|
+
}>;
|
|
21
|
+
declare function waitForJob(shop: string, jobId: string): Promise<void>;
|
|
22
|
+
|
|
23
|
+
export { FetchJobQuery, JobSchema, fetchJob, waitForJob };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { adminRequest } from '../../graphql.js';
|
|
2
|
+
import { getAdminSession } from '../../admin-session.js';
|
|
3
|
+
|
|
4
|
+
const FetchJobQuery = `#graphql
|
|
5
|
+
query FetchJob($id: ID!) {
|
|
6
|
+
hydrogenStorefrontJob(id: $id) {
|
|
7
|
+
id
|
|
8
|
+
done
|
|
9
|
+
errors {
|
|
10
|
+
code
|
|
11
|
+
message
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
async function fetchJob(shop, jobId) {
|
|
17
|
+
const adminSession = await getAdminSession(shop);
|
|
18
|
+
const { hydrogenStorefrontJob } = await adminRequest(
|
|
19
|
+
FetchJobQuery,
|
|
20
|
+
adminSession,
|
|
21
|
+
{
|
|
22
|
+
id: jobId
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
return {
|
|
26
|
+
adminSession,
|
|
27
|
+
id: hydrogenStorefrontJob.id,
|
|
28
|
+
done: hydrogenStorefrontJob.done,
|
|
29
|
+
errors: hydrogenStorefrontJob.errors
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function waitForJob(shop, jobId) {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
const interval = setInterval(async () => {
|
|
35
|
+
const job = await fetchJob(shop, jobId);
|
|
36
|
+
if (job.errors.length > 0) {
|
|
37
|
+
clearInterval(interval);
|
|
38
|
+
return reject();
|
|
39
|
+
}
|
|
40
|
+
if (job.done) {
|
|
41
|
+
clearInterval(interval);
|
|
42
|
+
return resolve();
|
|
43
|
+
}
|
|
44
|
+
}, 500);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { FetchJobQuery, fetchJob, waitForJob };
|
package/dist/lib/log.d.ts
CHANGED
package/dist/lib/log.js
CHANGED
|
@@ -16,5 +16,12 @@ function muteDevLogs({ workerReload } = {}) {
|
|
|
16
16
|
return log(first, ...rest);
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
+
const warnings = /* @__PURE__ */ new Set();
|
|
20
|
+
const warnOnce = (string) => {
|
|
21
|
+
if (!warnings.has(string)) {
|
|
22
|
+
console.warn(string);
|
|
23
|
+
warnings.add(string);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
19
26
|
|
|
20
|
-
export { muteDevLogs };
|
|
27
|
+
export { muteDevLogs, warnOnce };
|
|
@@ -8,7 +8,15 @@ type MiniOxygenOptions = {
|
|
|
8
8
|
[key: string]: string;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
declare function startMiniOxygen({ root, port, watch, buildPathWorkerFile, buildPathClient, environmentVariables, }: MiniOxygenOptions): Promise<
|
|
11
|
+
declare function startMiniOxygen({ root, port, watch, buildPathWorkerFile, buildPathClient, environmentVariables, }: MiniOxygenOptions): Promise<{
|
|
12
|
+
listeningAt: string;
|
|
13
|
+
port: number;
|
|
14
|
+
showBanner(options?: {
|
|
15
|
+
mode?: string;
|
|
16
|
+
headlinePrefix?: string;
|
|
17
|
+
extraLines?: string[];
|
|
18
|
+
}): void;
|
|
19
|
+
}>;
|
|
12
20
|
declare function logResponse(request: Request, response: Response): void;
|
|
13
21
|
|
|
14
22
|
export { logResponse, startMiniOxygen };
|
package/dist/lib/mini-oxygen.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { outputInfo, outputContent
|
|
1
|
+
import { outputToken, outputInfo, outputContent } from '@shopify/cli-kit/node/output';
|
|
2
2
|
import { resolvePath } from '@shopify/cli-kit/node/path';
|
|
3
3
|
import { fileExists } from '@shopify/cli-kit/node/fs';
|
|
4
4
|
import colors from '@shopify/cli-kit/node/colors';
|
|
5
|
+
import { renderSuccess } from '@shopify/cli-kit/node/ui';
|
|
5
6
|
|
|
6
7
|
async function startMiniOxygen({
|
|
7
8
|
root,
|
|
@@ -36,12 +37,19 @@ async function startMiniOxygen({
|
|
|
36
37
|
)
|
|
37
38
|
});
|
|
38
39
|
const listeningAt = `http://localhost:${actualPort}`;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
return {
|
|
41
|
+
listeningAt,
|
|
42
|
+
port: actualPort,
|
|
43
|
+
showBanner(options) {
|
|
44
|
+
renderSuccess({
|
|
45
|
+
headline: `${options?.headlinePrefix ?? ""}MiniOxygen ${options?.mode ?? "development"} server running.`,
|
|
46
|
+
body: [
|
|
47
|
+
`View Hydrogen app: ${listeningAt}`,
|
|
48
|
+
...options?.extraLines ?? []
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
45
53
|
}
|
|
46
54
|
function logResponse(request, response) {
|
|
47
55
|
try {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { titleize } from './string.js';
|
|
3
|
+
|
|
4
|
+
describe("titleize", () => {
|
|
5
|
+
const TEST_DIRECTORY_NAMES = {
|
|
6
|
+
"demo-storefront": "Demo Storefront",
|
|
7
|
+
"nifty \u{1F602} project ": "Nifty Project",
|
|
8
|
+
"Hello \u{1F602}": "Hello",
|
|
9
|
+
_____: ""
|
|
10
|
+
};
|
|
11
|
+
it("replaces non-alpha-numeric characters with spaces and capitalizes the first letter of every word", () => {
|
|
12
|
+
for (const [input, expected] of Object.entries(TEST_DIRECTORY_NAMES)) {
|
|
13
|
+
expect(titleize(input)).toBe(expected);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface UserError {
|
|
2
|
+
code: string | undefined;
|
|
3
|
+
field: string[];
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
declare function renderUserErrors(userErrors: UserError[]): void;
|
|
7
|
+
declare function renderError(message: string): void;
|
|
8
|
+
|
|
9
|
+
export { UserError, renderError, renderUserErrors };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbortError } from '@shopify/cli-kit/node/error';
|
|
2
|
+
|
|
3
|
+
function renderUserErrors(userErrors) {
|
|
4
|
+
const errorMessages = userErrors.map(({ message }) => message).join(", ");
|
|
5
|
+
renderError(errorMessages);
|
|
6
|
+
}
|
|
7
|
+
function renderError(message) {
|
|
8
|
+
throw new AbortError(message);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { renderError, renderUserErrors };
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.0.0","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":true},"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:codegen-unstable":{"id":"hydrogen:codegen-unstable","description":"Generate types for the Storefront API queries found in your project.","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},"codegen-config-path":{"name":"codegen-config-path","type":"option","description":"Specify a path to a codegen configuration file. Defaults to `<root>/codegen.ts` if it exists.","required":false,"multiple":false},"force-sfapi-version":{"name":"force-sfapi-version","type":"option","description":"Force generating Storefront API types for a specific version instead of using the one provided in Hydrogen. A token can also be provided with this format: `<version>:<token>`.","hidden":true,"multiple":false},"watch":{"name":"watch","type":"boolean","description":"Watch the project for changes to update types on file save.","required":false,"allowNo":false}},"args":[]},"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},"codegen-unstable":{"name":"codegen-unstable","type":"boolean","description":"Generate types for the Storefront API queries found in your project. It updates the types on file save.","required":false,"allowNo":false},"codegen-config-path":{"name":"codegen-config-path","type":"option","description":"Specify a path to a codegen configuration file. Defaults to `<root>/codegen.ts` if it exists.","required":false,"multiple":false,"dependsOn":["codegen-unstable"]},"disable-virtual-routes":{"name":"disable-virtual-routes","type":"boolean","description":"Disable rendering fallback routes when a route file doesn't exist.","allowNo":false},"shop":{"name":"shop","type":"option","char":"s","description":"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).","multiple":false},"debug":{"name":"debug","type":"boolean","description":"Attaches a Node inspector","allowNo":false},"host":{"name":"host","type":"option","hidden":true,"multiple":false},"env-branch":{"name":"env-branch","type":"option","char":"e","description":"Specify an environment's branch name when using remote environment variables.","multiple":false}},"args":[]},"hydrogen:g":{"id":"hydrogen:g","description":"Shortcut for `hydrogen generate`. See `hydrogen generate --help` for more information.","strict":false,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","hidden":true,"aliases":[],"flags":{},"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:link":{"id":"hydrogen:link","description":"Link a local project to one of your shop's Hydrogen storefronts.","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 Hydrogen storefront. The default is the current directory.","multiple":false},"shop":{"name":"shop","type":"option","char":"s","description":"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).","multiple":false},"storefront":{"name":"storefront","type":"option","description":"The name of a Hydrogen Storefront (e.g. \"Jane's Apparel\")","multiple":false}},"args":[]},"hydrogen:list":{"id":"hydrogen:list","description":"Returns a list of Hydrogen storefronts available on a given shop.","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},"shop":{"name":"shop","type":"option","char":"s","description":"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).","multiple":false}},"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:shortcut":{"id":"hydrogen:shortcut","description":"Creates a global `h2` shortcut for the Hydrogen CLI","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{},"args":[]},"hydrogen:unlink":{"id":"hydrogen:unlink","description":"Unlink a local project from 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":[]},"hydrogen:env:list":{"id":"hydrogen:env:list","description":"List the environments on your linked 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},"shop":{"name":"shop","type":"option","char":"s","description":"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).","multiple":false}},"args":[]},"hydrogen:env:pull":{"id":"hydrogen:env:pull","description":"Populate your .env with variables from your Hydrogen storefront.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"env-branch":{"name":"env-branch","type":"option","char":"e","description":"Specify an environment's branch name when using remote environment variables.","multiple":false},"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false},"shop":{"name":"shop","type":"option","char":"s","description":"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).","multiple":false},"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the destination directory and files if they already exist.","allowNo":false}},"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":"5.0.2","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:codegen-unstable":{"id":"hydrogen:codegen-unstable","description":"Generate types for the Storefront API queries found in your project.","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},"codegen-config-path":{"name":"codegen-config-path","type":"option","description":"Specify a path to a codegen configuration file. Defaults to `<root>/codegen.ts` if it exists.","required":false,"multiple":false},"force-sfapi-version":{"name":"force-sfapi-version","type":"option","description":"Force generating Storefront API types for a specific version instead of using the one provided in Hydrogen. A token can also be provided with this format: `<version>:<token>`.","hidden":true,"multiple":false},"watch":{"name":"watch","type":"boolean","description":"Watch the project for changes to update types on file save.","required":false,"allowNo":false}},"args":[]},"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},"codegen-unstable":{"name":"codegen-unstable","type":"boolean","description":"Generate types for the Storefront API queries found in your project. It updates the types on file save.","required":false,"allowNo":false},"codegen-config-path":{"name":"codegen-config-path","type":"option","description":"Specify a path to a codegen configuration file. Defaults to `<root>/codegen.ts` if it exists.","required":false,"multiple":false,"dependsOn":["codegen-unstable"]},"sourcemap":{"name":"sourcemap","type":"boolean","description":"Generate sourcemaps for the build.","allowNo":true},"disable-virtual-routes":{"name":"disable-virtual-routes","type":"boolean","description":"Disable rendering fallback routes when a route file doesn't exist.","allowNo":false},"shop":{"name":"shop","type":"option","char":"s","description":"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).","multiple":false},"debug":{"name":"debug","type":"boolean","description":"Attaches a Node inspector","allowNo":false},"host":{"name":"host","type":"option","hidden":true,"multiple":false},"env-branch":{"name":"env-branch","type":"option","char":"e","description":"Specify an environment's branch name when using remote environment variables.","multiple":false}},"args":[]},"hydrogen:g":{"id":"hydrogen:g","description":"Shortcut for `hydrogen generate`. See `hydrogen generate --help` for more information.","strict":false,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","hidden":true,"aliases":[],"flags":{},"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:link":{"id":"hydrogen:link","description":"Link a local project to one of your shop's Hydrogen storefronts.","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 Hydrogen storefront. The default is the current directory.","multiple":false},"shop":{"name":"shop","type":"option","char":"s","description":"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).","multiple":false},"storefront":{"name":"storefront","type":"option","description":"The name of a Hydrogen Storefront (e.g. \"Jane's Apparel\")","multiple":false}},"args":[]},"hydrogen:list":{"id":"hydrogen:list","description":"Returns a list of Hydrogen storefronts available on a given shop.","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},"shop":{"name":"shop","type":"option","char":"s","description":"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).","multiple":false}},"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:shortcut":{"id":"hydrogen:shortcut","description":"Creates a global `h2` shortcut for the Hydrogen CLI","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{},"args":[]},"hydrogen:unlink":{"id":"hydrogen:unlink","description":"Unlink a local project from 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":[]},"hydrogen:env:list":{"id":"hydrogen:env:list","description":"List the environments on your linked 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},"shop":{"name":"shop","type":"option","char":"s","description":"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).","multiple":false}},"args":[]},"hydrogen:env:pull":{"id":"hydrogen:env:pull","description":"Populate your .env with variables from your Hydrogen storefront.","strict":true,"pluginName":"@shopify/cli-hydrogen","pluginAlias":"@shopify/cli-hydrogen","pluginType":"core","aliases":[],"flags":{"env-branch":{"name":"env-branch","type":"option","char":"e","description":"Specify an environment's branch name when using remote environment variables.","multiple":false},"path":{"name":"path","type":"option","description":"The path to the directory of the Hydrogen storefront. The default is the current directory.","multiple":false},"shop":{"name":"shop","type":"option","char":"s","description":"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).","multiple":false},"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the destination directory and files if they already exist.","allowNo":false}},"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": "5.0.
|
|
7
|
+
"version": "5.0.2",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"vitest": "^0.28.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@remix-run/react": "^1.
|
|
31
|
-
"@shopify/hydrogen-react": "^2023.4.
|
|
32
|
-
"@shopify/remix-oxygen": "^1.1.
|
|
30
|
+
"@remix-run/react": "^1.17.1",
|
|
31
|
+
"@shopify/hydrogen-react": "^2023.4.5",
|
|
32
|
+
"@shopify/remix-oxygen": "^1.1.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@graphql-codegen/cli": "3.3.1",
|
|
36
36
|
"@oclif/core": "2.1.4",
|
|
37
|
-
"@remix-run/dev": "1.
|
|
37
|
+
"@remix-run/dev": "1.17.1",
|
|
38
38
|
"@shopify/cli-kit": "3.46.3",
|
|
39
39
|
"@shopify/hydrogen-codegen": "^0.0.2",
|
|
40
40
|
"@shopify/mini-oxygen": "^1.6.0",
|