@shopify/create-app 3.94.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/analytics-RYQKQ4DG.js +39 -0
- package/dist/analytics-ZSO2XN53.js +33 -0
- package/dist/chunk-32DG2OXV.js +110 -0
- package/dist/chunk-6OOTYTVB.js +1133 -0
- package/dist/chunk-7OFS6B2C.js +12 -0
- package/dist/chunk-A6TJPMVH.js +661 -0
- package/dist/{chunk-NIYBO6HO.js → chunk-ACS6S42W.js} +3 -3
- package/dist/{chunk-BRNDLYPU.js → chunk-BMI6QCMV.js} +3617 -10143
- package/dist/chunk-C5OLLQWI.js +5620 -0
- package/dist/chunk-CEGG2EWP.js +104 -0
- package/dist/chunk-DJW2W7VA.js +21 -0
- package/dist/{chunk-LI75HRH4.js → chunk-DWGHKWV5.js} +1 -1
- package/dist/chunk-JCETIRLI.js +30 -0
- package/dist/chunk-JT5MT2JE.js +371 -0
- package/dist/chunk-MIECGF3H.js +264 -0
- package/dist/{chunk-IFG7N3S2.js → chunk-OO33NRTL.js} +8 -12671
- package/dist/chunk-PES3XMQM.js +70 -0
- package/dist/chunk-PVHOBK32.js +1771 -0
- package/dist/chunk-RB7BXTZQ.js +6106 -0
- package/dist/{chunk-HUNONZYG.js → chunk-S4YEA2XG.js} +43774 -43785
- package/dist/chunk-SWITKWBS.js +78 -0
- package/dist/{chunk-KKIDWI27.js → chunk-TS6LOJXS.js} +47 -12
- package/dist/chunk-TVUF42MB.js +55 -0
- package/dist/chunk-UX6FRPFM.js +11555 -0
- package/dist/{chunk-CXPWSYGC.js → chunk-X2WZCKNE.js} +4 -14
- package/dist/conf-store-R26LOTXD.js +54 -0
- package/dist/custom-oclif-loader-354VAVF4.js +54 -0
- package/dist/deprecations-JWETMJFF.js +55 -0
- package/dist/environments-VKYG7DMX.js +26 -0
- package/dist/error-handler-YXGIUGKI.js +37 -0
- package/dist/fs-HPLMOQQD.js +109 -0
- package/dist/hooks/postrun.js +6 -9
- package/dist/hooks/prerun.js +12 -25
- package/dist/{http-proxy-node16-U5VBDLS3.js → http-proxy-node16-XB2DSBCB.js} +3 -2
- package/dist/index.js +9175 -10612
- package/dist/is-global-OXCPPXM7.js +21 -0
- package/dist/latest-version-3PFKLJZM.js +7713 -0
- package/dist/lib-HWIFANCM.js +11 -0
- package/dist/{local-6XZDLEBK.js → local-6ARTMTVE.js} +3 -10
- package/dist/metadata-Z65VJ53L.js +20 -0
- package/dist/{node-package-manager-JVAQNYVX.js → node-package-manager-Q3Y2FSRM.js} +17 -7
- package/dist/notifications-system-2HPAOE4P.js +40 -0
- package/dist/output-MCH67S5U.js +51 -0
- package/dist/{path-NQ6GZ2WO.js → path-EOPO7QNL.js} +2 -2
- package/dist/{prettier-67WYXU6J.js → prettier-UAG5TKE4.js} +2 -2
- package/dist/system-YW6RJ2KQ.js +47 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typescript-TKTDYKKG.js +6 -0
- package/dist/{ui-7HBWZC7M.js → ui-AYUE37Z3.js} +15 -6
- package/dist/{chunk-PWU6XFUQ.js → upgrade-DNAT5W4B.js} +77 -125
- package/dist/version-2J64V5CP.js +8 -0
- package/dist/version-V77ZX5N2.js +30 -0
- package/oclif.manifest.json +63 -66
- package/package.json +5 -5
- package/dist/chunk-HYOIEQ5O.js +0 -14117
- package/dist/error-handler-WFIT65SZ.js +0 -25
- package/dist/lib-PPI2FZOR.js +0 -8
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isUnitTest
|
|
3
|
+
} from "./chunk-A6TJPMVH.js";
|
|
4
|
+
import {
|
|
5
|
+
init_cjs_shims
|
|
6
|
+
} from "./chunk-PKR7KJ6P.js";
|
|
7
|
+
|
|
8
|
+
// ../cli-kit/dist/public/node/metadata.js
|
|
9
|
+
init_cjs_shims();
|
|
10
|
+
import { performance } from "node:perf_hooks";
|
|
11
|
+
function getMetadataErrorHandlingStrategy() {
|
|
12
|
+
return isUnitTest() ? "bubble" : "mute-and-report";
|
|
13
|
+
}
|
|
14
|
+
function createRuntimeMetadataContainer(defaultPublicMetadata = {}) {
|
|
15
|
+
let raw = {
|
|
16
|
+
sensitive: {},
|
|
17
|
+
public: {
|
|
18
|
+
...defaultPublicMetadata
|
|
19
|
+
}
|
|
20
|
+
}, addPublic = (data) => {
|
|
21
|
+
Object.assign(raw.public, data);
|
|
22
|
+
}, addSensitive = (data) => {
|
|
23
|
+
Object.assign(raw.sensitive, data);
|
|
24
|
+
}, addMetadata = async (addFn, getFn, onError) => {
|
|
25
|
+
let errorHandling = onError === "auto" ? getMetadataErrorHandlingStrategy() : onError, getAndSet = async () => {
|
|
26
|
+
let data = await getFn();
|
|
27
|
+
addFn(data);
|
|
28
|
+
};
|
|
29
|
+
if (errorHandling === "bubble")
|
|
30
|
+
await getAndSet();
|
|
31
|
+
else
|
|
32
|
+
try {
|
|
33
|
+
await getAndSet();
|
|
34
|
+
} catch (error) {
|
|
35
|
+
let { sendErrorToBugsnag } = await import("./error-handler-YXGIUGKI.js");
|
|
36
|
+
await sendErrorToBugsnag(error, "unexpected_error");
|
|
37
|
+
}
|
|
38
|
+
}, durationStack = [];
|
|
39
|
+
return {
|
|
40
|
+
getAllPublicMetadata: () => ({ ...raw.public }),
|
|
41
|
+
getAllSensitiveMetadata: () => ({ ...raw.sensitive }),
|
|
42
|
+
addPublicMetadata: async (getData, onError = "auto") => addMetadata(addPublic, getData, onError),
|
|
43
|
+
addSensitiveMetadata: async (getData, onError = "auto") => addMetadata(addSensitive, getData, onError),
|
|
44
|
+
runWithTimer: (field) => async (fn) => {
|
|
45
|
+
durationStack.push(0);
|
|
46
|
+
let start = performance.now();
|
|
47
|
+
try {
|
|
48
|
+
return await fn();
|
|
49
|
+
} finally {
|
|
50
|
+
let end = performance.now();
|
|
51
|
+
end = Math.max(start, end);
|
|
52
|
+
let wallClockDuration = Math.max(end - start, 0), childDurations = durationStack.pop(), duration = Math.max(wallClockDuration - childDurations, 0);
|
|
53
|
+
durationStack.length > 0 && (durationStack[durationStack.length - 1] = (durationStack[durationStack.length - 1] ?? 0) + wallClockDuration), performance.measure(`${field}#measurable`, {
|
|
54
|
+
start,
|
|
55
|
+
duration
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
}), performance.measure(`${field}#wall`, {
|
|
58
|
+
start,
|
|
59
|
+
end
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
61
|
+
});
|
|
62
|
+
let currentValue = raw.public[field] || 0;
|
|
63
|
+
currentValue += duration, raw.public[field] = currentValue;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
var coreData = createRuntimeMetadataContainer({ cmd_all_timing_network_ms: 0, cmd_all_timing_prompts_ms: 0 }), { getAllPublicMetadata, getAllSensitiveMetadata, addPublicMetadata, addSensitiveMetadata, runWithTimer } = coreData;
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
createRuntimeMetadataContainer,
|
|
72
|
+
getAllPublicMetadata,
|
|
73
|
+
getAllSensitiveMetadata,
|
|
74
|
+
addPublicMetadata,
|
|
75
|
+
addSensitiveMetadata,
|
|
76
|
+
runWithTimer
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=chunk-SWITKWBS.js.map
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
fetch,
|
|
3
3
|
jsonOutputEnabled,
|
|
4
4
|
z
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-S4YEA2XG.js";
|
|
6
6
|
import {
|
|
7
|
-
cacheRetrieve,
|
|
8
|
-
cacheStore,
|
|
9
7
|
versionSatisfies
|
|
10
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JT5MT2JE.js";
|
|
9
|
+
import {
|
|
10
|
+
CLI_KIT_VERSION
|
|
11
|
+
} from "./chunk-7OFS6B2C.js";
|
|
12
|
+
import {
|
|
13
|
+
cacheRetrieve,
|
|
14
|
+
cacheStore
|
|
15
|
+
} from "./chunk-RB7BXTZQ.js";
|
|
11
16
|
import {
|
|
12
|
-
AbortSilentError,
|
|
13
17
|
exec,
|
|
14
|
-
isTruthy,
|
|
15
|
-
outputDebug,
|
|
16
18
|
renderError,
|
|
17
19
|
renderInfo,
|
|
18
20
|
renderWarning
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-C5OLLQWI.js";
|
|
22
|
+
import {
|
|
23
|
+
AbortSilentError
|
|
24
|
+
} from "./chunk-MIECGF3H.js";
|
|
25
|
+
import {
|
|
26
|
+
outputDebug
|
|
27
|
+
} from "./chunk-BMI6QCMV.js";
|
|
28
|
+
import {
|
|
29
|
+
isTruthy
|
|
30
|
+
} from "./chunk-A6TJPMVH.js";
|
|
20
31
|
import {
|
|
21
32
|
init_cjs_shims
|
|
22
33
|
} from "./chunk-PKR7KJ6P.js";
|
|
@@ -84,7 +95,7 @@ async function showNotificationsIfNeeded(currentSurfaces, environment = process.
|
|
|
84
95
|
throw new AbortSilentError();
|
|
85
96
|
let errorMessage = `Error showing notifications: ${error.message}`;
|
|
86
97
|
outputDebug(errorMessage);
|
|
87
|
-
let { sendErrorToBugsnag } = await import("./error-handler-
|
|
98
|
+
let { sendErrorToBugsnag } = await import("./error-handler-YXGIUGKI.js");
|
|
88
99
|
await sendErrorToBugsnag(errorMessage, "unexpected_error");
|
|
89
100
|
}
|
|
90
101
|
}
|
|
@@ -121,6 +132,21 @@ async function getNotifications() {
|
|
|
121
132
|
let notifications = JSON.parse(rawNotifications);
|
|
122
133
|
return NotificationsSchema.parse(notifications);
|
|
123
134
|
}
|
|
135
|
+
async function fetchNotifications() {
|
|
136
|
+
outputDebug("Fetching notifications...");
|
|
137
|
+
let response = await fetch(url(), void 0, {
|
|
138
|
+
useNetworkLevelRetry: !1,
|
|
139
|
+
useAbortSignal: !0,
|
|
140
|
+
timeoutMs: 3 * 1e3
|
|
141
|
+
});
|
|
142
|
+
if (response.status !== 200)
|
|
143
|
+
throw new Error(`Failed to fetch notifications: ${response.statusText}`);
|
|
144
|
+
let rawNotifications = await response.text(), notifications = JSON.parse(rawNotifications), result = NotificationsSchema.parse(notifications);
|
|
145
|
+
return await cacheNotifications(rawNotifications), result;
|
|
146
|
+
}
|
|
147
|
+
async function cacheNotifications(notifications) {
|
|
148
|
+
cacheStore(`notifications-${url()}`, notifications), outputDebug(`Notifications from ${url()} stored in the cache`);
|
|
149
|
+
}
|
|
124
150
|
function fetchNotificationsInBackground(currentCommand, argv = process.argv, environment = process.env) {
|
|
125
151
|
if (skipNotifications(currentCommand, environment) || !argv[0] || !argv[1])
|
|
126
152
|
return;
|
|
@@ -168,10 +194,19 @@ function filterByFrequency(notification) {
|
|
|
168
194
|
return (/* @__PURE__ */ new Date()).getTime() - Number(lastShown) > 168 * 3600 * 1e3;
|
|
169
195
|
}
|
|
170
196
|
}
|
|
197
|
+
function stringifyFilters(notification) {
|
|
198
|
+
let filters = [];
|
|
199
|
+
return notification.minDate && filters.push(`from ${notification.minDate}`), notification.maxDate && filters.push(`to ${notification.maxDate}`), notification.minVersion && filters.push(`from v${notification.minVersion}`), notification.maxVersion && filters.push(`to v${notification.maxVersion}`), notification.frequency === "once" && filters.push("show only once"), notification.frequency === "once_a_day" && filters.push("show once a day"), notification.frequency === "once_a_week" && filters.push("show once a week"), notification.surface && filters.push(`surface = ${notification.surface}`), notification.commands && filters.push(`commands = ${notification.commands.join(", ")}`), filters.join(`
|
|
200
|
+
`);
|
|
201
|
+
}
|
|
171
202
|
|
|
172
203
|
export {
|
|
173
204
|
setCurrentCommandId,
|
|
174
205
|
showNotificationsIfNeeded,
|
|
175
|
-
|
|
206
|
+
getNotifications,
|
|
207
|
+
fetchNotifications,
|
|
208
|
+
fetchNotificationsInBackground,
|
|
209
|
+
filterNotifications,
|
|
210
|
+
stringifyFilters
|
|
176
211
|
};
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
212
|
+
//# sourceMappingURL=chunk-TS6LOJXS.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
captureOutput,
|
|
3
|
+
require_lib
|
|
4
|
+
} from "./chunk-C5OLLQWI.js";
|
|
5
|
+
import {
|
|
6
|
+
require_semver
|
|
7
|
+
} from "./chunk-6OOTYTVB.js";
|
|
8
|
+
import {
|
|
9
|
+
__toESM,
|
|
10
|
+
init_cjs_shims
|
|
11
|
+
} from "./chunk-PKR7KJ6P.js";
|
|
12
|
+
|
|
13
|
+
// ../cli-kit/dist/public/node/version.js
|
|
14
|
+
init_cjs_shims();
|
|
15
|
+
var import_which = __toESM(require_lib(), 1), import_semver = __toESM(require_semver(), 1);
|
|
16
|
+
async function localCLIVersion(directory) {
|
|
17
|
+
try {
|
|
18
|
+
return (await captureOutput("npm", ["list", "@shopify/cli"], { cwd: directory })).match(/@shopify\/cli@([\w.-]*)/)?.[1];
|
|
19
|
+
} catch {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function globalCLIVersion() {
|
|
24
|
+
try {
|
|
25
|
+
let env = { ...process.env, SHOPIFY_CLI_NO_ANALYTICS: "1" }, shopifyBinaries = import_which.default.sync("shopify", { all: !0 }).filter((path) => !path.includes("node_modules"));
|
|
26
|
+
if (!shopifyBinaries[0])
|
|
27
|
+
return;
|
|
28
|
+
let versionMatch = (await captureOutput(shopifyBinaries[0], [], { env })).match(/@shopify\/cli\/([^\s]+)/);
|
|
29
|
+
if (versionMatch && versionMatch[1]) {
|
|
30
|
+
let version = versionMatch[1];
|
|
31
|
+
if ((0, import_semver.satisfies)(version, ">=3.59.0") || isPreReleaseVersion(version))
|
|
32
|
+
return version;
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
} catch {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function isPreReleaseVersion(version) {
|
|
40
|
+
return version.startsWith("0.0.0");
|
|
41
|
+
}
|
|
42
|
+
function isMajorVersionChange(currentVersion, newerVersion) {
|
|
43
|
+
if (isPreReleaseVersion(currentVersion) || isPreReleaseVersion(newerVersion))
|
|
44
|
+
return !1;
|
|
45
|
+
let currentSemVer = new import_semver.SemVer(currentVersion), newerSemVer = new import_semver.SemVer(newerVersion);
|
|
46
|
+
return currentSemVer.major !== newerSemVer.major;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
localCLIVersion,
|
|
51
|
+
globalCLIVersion,
|
|
52
|
+
isPreReleaseVersion,
|
|
53
|
+
isMajorVersionChange
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=chunk-TVUF42MB.js.map
|