@shopify/create-app 3.58.2 → 3.59.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/dist/chunk-3JLUTHGR.js +114 -0
- package/dist/chunk-3JNB3A7C.js +14080 -0
- package/dist/chunk-4DXNY52K.js +104 -0
- package/dist/chunk-4SXWHRL5.js +62 -0
- package/dist/chunk-5RH4B5Q7.js +30996 -0
- package/dist/chunk-7XQTD3L4.js +213522 -0
- package/dist/chunk-ADG25CKO.js +2468 -0
- package/dist/chunk-ASLSMEKR.js +18914 -0
- package/dist/chunk-BOIUUJSH.js +99 -0
- package/dist/chunk-CKY5L2DS.js +37 -0
- package/dist/chunk-CPDHSAO5.js +3179 -0
- package/dist/chunk-FBB6KUZG.js +821 -0
- package/dist/chunk-G6FN5VUE.js +102 -0
- package/dist/chunk-GXPKATXW.js +194 -0
- package/dist/chunk-H7CRO63U.js +11 -0
- package/dist/chunk-JP7Y3CTL.js +72 -0
- package/dist/chunk-LKGDG6WW.js +87 -0
- package/dist/chunk-M63RTPGR.js +63 -0
- package/dist/chunk-ND5WSAZY.js +7817 -0
- package/dist/chunk-P4TVG45N.js +900 -0
- package/dist/chunk-TMGCRPEZ.js +4283 -0
- package/dist/chunk-UVY6LL5H.js +145 -0
- package/dist/chunk-VMPTLMJN.js +144 -0
- package/dist/chunk-WCNR75S2.js +73 -0
- package/dist/chunk-WLJ2CNLG.js +45349 -0
- package/dist/chunk-YLEF4RUH.js +144 -0
- package/dist/chunk-ZDCQCTOO.js +13764 -0
- package/dist/chunk-ZPB26OWQ.js +5605 -0
- package/dist/commands/init.d.ts +2 -1
- package/dist/commands/init.js +31 -123
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/init.test.js +123 -0
- package/dist/constants-K3R4N3N3.js +19 -0
- package/dist/custom-oclif-loader-GA6B7DEF.js +83 -0
- package/dist/del-A5YM6R3Y.js +2846 -0
- package/dist/devtools-KQM4GF6J.js +3685 -0
- package/dist/error-handler-U53E7YKG.js +34 -0
- package/dist/hooks/postrun.js +108 -2
- package/dist/hooks/prerun.js +77 -2
- package/dist/index.js +22 -7
- package/dist/lib-76JUGQYQ.js +8 -0
- package/dist/local-XVLEGQFE.js +59 -0
- package/dist/magic-string.es-6WMSFIAX.js +1291 -0
- package/dist/multipart-parser-O2BQODS2.js +359 -0
- package/dist/node-package-manager-76YAD3UB.js +68 -0
- package/dist/open-B7XFJJCK.js +290 -0
- package/dist/out-JZ52TJE3.js +5 -0
- package/dist/path-HO4HBKK5.js +28 -0
- package/dist/prompts/init.d.ts +4 -3
- package/dist/prompts/init.js +23 -118
- package/dist/prompts/init.js.map +1 -1
- package/dist/prompts/init.test.js +115 -0
- package/dist/services/init.d.ts +3 -1
- package/dist/services/init.js +25 -139
- package/dist/services/init.js.map +1 -1
- package/dist/services/init.test.js +18 -0
- package/dist/system-XBDENYNR.js +25 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-ZVCYWXG6.js +49 -0
- package/dist/utils/template/cleanup.js +18 -19
- package/dist/utils/template/cleanup.test.js +74 -0
- package/dist/utils/template/npm.d.ts +2 -1
- package/dist/utils/template/npm.js +22 -58
- package/dist/utils/template/npm.js.map +1 -1
- package/dist/utils/template/npm.test.js +153 -0
- package/dist/yoga.wasm +0 -0
- package/oclif.manifest.json +1 -1
- package/package.json +5 -6
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -2
- package/dist/constants.js.map +0 -1
- package/dist/utils/versions.d.ts +0 -1
- package/dist/utils/versions.js +0 -21
- package/dist/utils/versions.js.map +0 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_cjs_shims
|
|
3
|
+
} from "./chunk-M63RTPGR.js";
|
|
4
|
+
|
|
5
|
+
// ../cli-kit/src/public/node/context/utilities.ts
|
|
6
|
+
init_cjs_shims();
|
|
7
|
+
function isTruthy(variable) {
|
|
8
|
+
if (!variable) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return ["1", "true", "TRUE", "yes", "YES"].includes(variable);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// ../cli-kit/src/private/node/demo-recorder.ts
|
|
15
|
+
init_cjs_shims();
|
|
16
|
+
var DemoRecorder = class {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.recorded = [];
|
|
19
|
+
this.sleepStart = Date.now();
|
|
20
|
+
this.command = ["shopify", ...process.argv.slice(2)].join(" ");
|
|
21
|
+
}
|
|
22
|
+
addEvent({ type, properties }) {
|
|
23
|
+
if (type === "taskbar") {
|
|
24
|
+
this.resetSleep();
|
|
25
|
+
} else {
|
|
26
|
+
this.addSleep();
|
|
27
|
+
}
|
|
28
|
+
this.recorded.push({ type, properties: JSON.parse(JSON.stringify(properties)) });
|
|
29
|
+
this.sleepStart = Date.now();
|
|
30
|
+
}
|
|
31
|
+
recordedEventsJson() {
|
|
32
|
+
return JSON.stringify(
|
|
33
|
+
{
|
|
34
|
+
command: this.command,
|
|
35
|
+
steps: this.withFormattedConcurrent(this.recorded)
|
|
36
|
+
},
|
|
37
|
+
null,
|
|
38
|
+
2
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
addSleep() {
|
|
42
|
+
const duration = (Date.now() - this.sleepStart) / 1e3;
|
|
43
|
+
this.sleepStart = Date.now();
|
|
44
|
+
if (duration > 0.1) {
|
|
45
|
+
this.recorded.push({ type: "sleep", properties: { duration } });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
resetSleep() {
|
|
49
|
+
this.sleepStart = Date.now();
|
|
50
|
+
}
|
|
51
|
+
addOrUpdateConcurrentOutput({ prefix, index, output }) {
|
|
52
|
+
let last = this.recorded[this.recorded.length - 1];
|
|
53
|
+
if (last?.type === "concurrent") {
|
|
54
|
+
this.resetSleep();
|
|
55
|
+
} else {
|
|
56
|
+
const eventProperties = {
|
|
57
|
+
type: "concurrent",
|
|
58
|
+
properties: { processes: [], concurrencyStart: Date.now() }
|
|
59
|
+
};
|
|
60
|
+
this.addEvent(eventProperties);
|
|
61
|
+
last = this.recorded[this.recorded.length - 1];
|
|
62
|
+
}
|
|
63
|
+
const { processes } = last.properties;
|
|
64
|
+
while (processes.length <= index) {
|
|
65
|
+
processes.push({ prefix: "", steps: [] });
|
|
66
|
+
}
|
|
67
|
+
processes[index].prefix = prefix;
|
|
68
|
+
processes[index].steps.push({ timestamp: Date.now(), endMessage: output });
|
|
69
|
+
}
|
|
70
|
+
withFormattedConcurrent(recorded) {
|
|
71
|
+
return recorded.map((event) => {
|
|
72
|
+
if (event.type === "concurrent") {
|
|
73
|
+
const { processes, footer, concurrencyStart } = event.properties;
|
|
74
|
+
const formatted = processes.map(({ prefix, steps }) => {
|
|
75
|
+
let mostRecentTimestamp = concurrencyStart;
|
|
76
|
+
const formattedSteps = steps.map(({ timestamp, endMessage }) => {
|
|
77
|
+
const duration = (timestamp - mostRecentTimestamp) / 1e3;
|
|
78
|
+
mostRecentTimestamp = timestamp;
|
|
79
|
+
return { duration, endMessage };
|
|
80
|
+
});
|
|
81
|
+
return { prefix, steps: formattedSteps };
|
|
82
|
+
});
|
|
83
|
+
return { type: "concurrent", properties: { footer, processes: formatted } };
|
|
84
|
+
}
|
|
85
|
+
return event;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
var NoopDemoRecorder = class {
|
|
90
|
+
addEvent(_event) {
|
|
91
|
+
}
|
|
92
|
+
recordedEventsJson() {
|
|
93
|
+
return JSON.stringify({ steps: [] }, null, 2);
|
|
94
|
+
}
|
|
95
|
+
addSleep() {
|
|
96
|
+
}
|
|
97
|
+
resetSleep() {
|
|
98
|
+
}
|
|
99
|
+
addOrUpdateConcurrentOutput(..._args) {
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var _instance;
|
|
103
|
+
function ensureInstance() {
|
|
104
|
+
if (!_instance) {
|
|
105
|
+
if (isRecording()) {
|
|
106
|
+
_instance = new DemoRecorder();
|
|
107
|
+
} else {
|
|
108
|
+
_instance = new NoopDemoRecorder();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function initDemoRecorder() {
|
|
113
|
+
ensureInstance();
|
|
114
|
+
}
|
|
115
|
+
function recordUIEvent(event) {
|
|
116
|
+
ensureInstance();
|
|
117
|
+
_instance.addEvent(event);
|
|
118
|
+
}
|
|
119
|
+
function resetRecordedSleep() {
|
|
120
|
+
ensureInstance();
|
|
121
|
+
_instance.resetSleep();
|
|
122
|
+
}
|
|
123
|
+
function printEventsJson() {
|
|
124
|
+
if (isRecording()) {
|
|
125
|
+
ensureInstance();
|
|
126
|
+
_instance.addSleep();
|
|
127
|
+
console.log(_instance.recordedEventsJson());
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function addOrUpdateConcurrentUIEventOutput(data) {
|
|
131
|
+
ensureInstance();
|
|
132
|
+
_instance.addOrUpdateConcurrentOutput(data);
|
|
133
|
+
}
|
|
134
|
+
function isRecording() {
|
|
135
|
+
return isTruthy(process.env.RECORD_DEMO);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export {
|
|
139
|
+
isTruthy,
|
|
140
|
+
initDemoRecorder,
|
|
141
|
+
recordUIEvent,
|
|
142
|
+
resetRecordedSleep,
|
|
143
|
+
printEventsJson,
|
|
144
|
+
addOrUpdateConcurrentUIEventOutput
|
|
145
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {
|
|
2
|
+
generateRandomNameForSubdirectory,
|
|
3
|
+
installGlobalCLIPrompt,
|
|
4
|
+
renderSelectPrompt,
|
|
5
|
+
renderText,
|
|
6
|
+
renderTextPrompt
|
|
7
|
+
} from "./chunk-WLJ2CNLG.js";
|
|
8
|
+
import {
|
|
9
|
+
__export,
|
|
10
|
+
init_cjs_shims
|
|
11
|
+
} from "./chunk-M63RTPGR.js";
|
|
12
|
+
|
|
13
|
+
// src/prompts/init.ts
|
|
14
|
+
var init_exports = {};
|
|
15
|
+
__export(init_exports, {
|
|
16
|
+
default: () => init_default,
|
|
17
|
+
isPredefinedTemplate: () => isPredefinedTemplate,
|
|
18
|
+
templates: () => templates,
|
|
19
|
+
visibleTemplates: () => visibleTemplates
|
|
20
|
+
});
|
|
21
|
+
init_cjs_shims();
|
|
22
|
+
var templates = {
|
|
23
|
+
remix: {
|
|
24
|
+
url: "https://github.com/Shopify/shopify-app-template-remix",
|
|
25
|
+
label: "Start with Remix (recommended)",
|
|
26
|
+
visible: true,
|
|
27
|
+
branches: {
|
|
28
|
+
prompt: "For your Remix template, which language do you want?",
|
|
29
|
+
options: {
|
|
30
|
+
javascript: { branch: "javascript", label: "JavaScript" },
|
|
31
|
+
typescript: { branch: "main", label: "TypeScript" }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
none: {
|
|
36
|
+
url: "https://github.com/Shopify/shopify-app-template-none",
|
|
37
|
+
label: "Start by adding your first extension",
|
|
38
|
+
visible: true
|
|
39
|
+
},
|
|
40
|
+
node: {
|
|
41
|
+
url: "https://github.com/Shopify/shopify-app-template-node",
|
|
42
|
+
visible: false
|
|
43
|
+
},
|
|
44
|
+
php: {
|
|
45
|
+
url: "https://github.com/Shopify/shopify-app-template-php",
|
|
46
|
+
visible: false
|
|
47
|
+
},
|
|
48
|
+
ruby: {
|
|
49
|
+
url: "https://github.com/Shopify/shopify-app-template-ruby",
|
|
50
|
+
visible: false
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var allTemplates = Object.keys(templates);
|
|
54
|
+
var visibleTemplates = allTemplates.filter((key) => templates[key].visible);
|
|
55
|
+
var templateOptionsInOrder = ["remix", "none"];
|
|
56
|
+
var init = async (options) => {
|
|
57
|
+
let name = options.name;
|
|
58
|
+
let template = options.template;
|
|
59
|
+
const flavor = options.flavor;
|
|
60
|
+
const defaults = {
|
|
61
|
+
name: await generateRandomNameForSubdirectory({ suffix: "app", directory: options.directory }),
|
|
62
|
+
template: templates.remix.url
|
|
63
|
+
};
|
|
64
|
+
let welcomed = false;
|
|
65
|
+
if (!name) {
|
|
66
|
+
renderText({ text: "\nWelcome. Let\u2019s get started by naming your app project. You can change it later." });
|
|
67
|
+
welcomed = true;
|
|
68
|
+
name = await renderTextPrompt({
|
|
69
|
+
message: "Your project name?",
|
|
70
|
+
defaultValue: defaults.name,
|
|
71
|
+
validate: (value) => {
|
|
72
|
+
if (value.length === 0) {
|
|
73
|
+
return "App name can't be empty";
|
|
74
|
+
}
|
|
75
|
+
if (value.length > 30) {
|
|
76
|
+
return "Enter a shorter name (30 character max.)";
|
|
77
|
+
}
|
|
78
|
+
if (value.toLowerCase().includes("shopify")) {
|
|
79
|
+
return "App name can't include the word 'shopify'";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (!template) {
|
|
85
|
+
if (!welcomed) {
|
|
86
|
+
renderText({ text: "\nWelcome. Let\u2019s get started by choosing a template for your app project." });
|
|
87
|
+
welcomed = true;
|
|
88
|
+
}
|
|
89
|
+
template = await renderSelectPrompt({
|
|
90
|
+
choices: templateOptionsInOrder.map((key) => {
|
|
91
|
+
return {
|
|
92
|
+
label: templates[key].label || key,
|
|
93
|
+
value: key
|
|
94
|
+
};
|
|
95
|
+
}),
|
|
96
|
+
message: "Get started building your app:",
|
|
97
|
+
defaultValue: allTemplates.find((key) => templates[key].url === defaults.template)
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
const answers = {
|
|
101
|
+
...options,
|
|
102
|
+
name,
|
|
103
|
+
template,
|
|
104
|
+
templateType: isPredefinedTemplate(template) ? template : "custom",
|
|
105
|
+
globalCLIResult: { install: false, alreadyInstalled: false }
|
|
106
|
+
};
|
|
107
|
+
let selectedUrl;
|
|
108
|
+
let branch;
|
|
109
|
+
if (answers.templateType !== "custom") {
|
|
110
|
+
const selectedTemplate = templates[answers.templateType];
|
|
111
|
+
selectedUrl = selectedTemplate.url;
|
|
112
|
+
if (selectedTemplate.branches) {
|
|
113
|
+
if (flavor) {
|
|
114
|
+
branch = selectedTemplate.branches.options[flavor]?.branch;
|
|
115
|
+
} else {
|
|
116
|
+
branch = await renderSelectPrompt({
|
|
117
|
+
message: selectedTemplate.branches.prompt || "Choose a flavor:",
|
|
118
|
+
choices: Object.entries(selectedTemplate.branches.options).map(([_key, branch2]) => ({
|
|
119
|
+
value: branch2.branch,
|
|
120
|
+
label: branch2.label
|
|
121
|
+
}))
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (branch) {
|
|
127
|
+
selectedUrl += `#${branch}`;
|
|
128
|
+
}
|
|
129
|
+
answers.template = selectedUrl || answers.template || defaults.template;
|
|
130
|
+
answers.globalCLIResult = await installGlobalCLIPrompt();
|
|
131
|
+
return answers;
|
|
132
|
+
};
|
|
133
|
+
var init_default = init;
|
|
134
|
+
function isPredefinedTemplate(template) {
|
|
135
|
+
return allTemplates.includes(template);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export {
|
|
139
|
+
templates,
|
|
140
|
+
visibleTemplates,
|
|
141
|
+
init_default,
|
|
142
|
+
isPredefinedTemplate,
|
|
143
|
+
init_exports
|
|
144
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
__require,
|
|
4
|
+
init_cjs_shims
|
|
5
|
+
} from "./chunk-M63RTPGR.js";
|
|
6
|
+
|
|
7
|
+
// ../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js
|
|
8
|
+
var require_is_docker = __commonJS({
|
|
9
|
+
"../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js"(exports, module) {
|
|
10
|
+
"use strict";
|
|
11
|
+
init_cjs_shims();
|
|
12
|
+
var fs = __require("fs");
|
|
13
|
+
var isDocker;
|
|
14
|
+
function hasDockerEnv() {
|
|
15
|
+
try {
|
|
16
|
+
fs.statSync("/.dockerenv");
|
|
17
|
+
return true;
|
|
18
|
+
} catch (_) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function hasDockerCGroup() {
|
|
23
|
+
try {
|
|
24
|
+
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
25
|
+
} catch (_) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
module.exports = () => {
|
|
30
|
+
if (isDocker === void 0) {
|
|
31
|
+
isDocker = hasDockerEnv() || hasDockerCGroup();
|
|
32
|
+
}
|
|
33
|
+
return isDocker;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// ../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js
|
|
39
|
+
var require_is_wsl = __commonJS({
|
|
40
|
+
"../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports, module) {
|
|
41
|
+
"use strict";
|
|
42
|
+
init_cjs_shims();
|
|
43
|
+
var os = __require("os");
|
|
44
|
+
var fs = __require("fs");
|
|
45
|
+
var isDocker = require_is_docker();
|
|
46
|
+
var isWsl = () => {
|
|
47
|
+
if (process.platform !== "linux") {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (os.release().toLowerCase().includes("microsoft")) {
|
|
51
|
+
if (isDocker()) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
|
|
58
|
+
} catch (_) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
if (process.env.__IS_WSL_TEST__) {
|
|
63
|
+
module.exports = isWsl;
|
|
64
|
+
} else {
|
|
65
|
+
module.exports = isWsl();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
require_is_docker,
|
|
72
|
+
require_is_wsl
|
|
73
|
+
};
|