@shopify/create-app 3.60.0 → 3.61.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-2EVDXDJS.js → chunk-5NBS5LAW.js} +1 -1
- package/dist/{chunk-P6YJ2CQU.js → chunk-7F4FS2WD.js} +7 -7
- package/dist/{chunk-P3DMHVBI.js → chunk-GQNJWQKC.js} +22 -17
- package/dist/{chunk-P6N3DVYZ.js → chunk-H3UBEY47.js} +3 -3
- package/dist/{chunk-ZDU6ZNVH.js → chunk-H4N7DG5X.js} +23 -19
- package/dist/{chunk-TMGCRPEZ.js → chunk-HTYJDJRZ.js} +685 -215
- package/dist/{chunk-3L6KY7Q3.js → chunk-I3IYXB26.js} +23 -6
- package/dist/{chunk-OYLUVGUB.js → chunk-J3QAMMY2.js} +1 -1
- package/dist/{chunk-ZPB26OWQ.js → chunk-K5EEGEVV.js} +34 -14
- package/dist/{chunk-BMMDEPWI.js → chunk-LLFZPH5K.js} +12 -9
- package/dist/{chunk-GKVC3752.js → chunk-LR725A3N.js} +3 -3
- package/dist/{chunk-P4TVG45N.js → chunk-LUP5VDI4.js} +10 -3
- package/dist/{chunk-L5LPMIFP.js → chunk-PGYGWMK7.js} +5 -5
- package/dist/{chunk-2YPXES4K.js → chunk-PKFDUXG6.js} +1 -1
- package/dist/{chunk-JOQ4LR3M.js → chunk-R5KQZMEG.js} +1 -1
- package/dist/{chunk-YLEF4RUH.js → chunk-RAFFEFML.js} +4 -0
- package/dist/{chunk-3JNB3A7C.js → chunk-U4YACXEW.js} +567 -357
- package/dist/{chunk-Q737A7ZQ.js → chunk-X2I3FAVD.js} +3 -3
- package/dist/{chunk-JA2XDFAC.js → chunk-XKDB3ST7.js} +3603 -4080
- package/dist/{chunk-ZWN4YW5O.js → chunk-YI3MHBSD.js} +1 -1
- package/dist/commands/init.js +19 -19
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/init.test.js +20 -20
- package/dist/{constants-K3R4N3N3.js → constants-NNLQHFRJ.js} +3 -1
- package/dist/{custom-oclif-loader-3GZ6YYAB.js → custom-oclif-loader-KLTAWG4B.js} +7 -6
- package/dist/{del-A5YM6R3Y.js → del-ICEHOC6W.js} +2 -2
- package/dist/{devtools-KQM4GF6J.js → devtools-6HZ2IPFU.js} +154 -252
- package/dist/{error-handler-SPIUKOES.js → error-handler-ND7WBMC3.js} +13 -13
- package/dist/hooks/postrun.js +12 -12
- package/dist/hooks/prerun.js +8 -8
- package/dist/index.js +4 -4
- package/dist/{lib-TQDGEQFC.js → lib-76RCE6WZ.js} +3 -3
- package/dist/{local-7KWUTHJN.js → local-3LWDOA7J.js} +5 -5
- package/dist/{magic-string.es-6WMSFIAX.js → magic-string.es-6DE547FE.js} +79 -18
- package/dist/{multipart-parser-O2BQODS2.js → multipart-parser-ENLY4BKU.js} +1 -1
- package/dist/{node-package-manager-MI2KGR6B.js → node-package-manager-TFY2ROCP.js} +6 -6
- package/dist/{out-JZ52TJE3.js → out-M5MRQZP5.js} +1 -1
- package/dist/prompts/init.js +6 -6
- package/dist/prompts/init.test.js +7 -7
- package/dist/services/init.d.ts +3 -0
- package/dist/services/init.js +13 -13
- package/dist/services/init.js.map +1 -1
- package/dist/services/init.test.js +1 -1
- package/dist/{system-KQGQETIF.js → system-FTT76GKS.js} +5 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-HO5KGT27.js → ui-MUGCNPLG.js} +5 -5
- package/dist/utils/template/cleanup.js +6 -6
- package/dist/utils/template/cleanup.test.js +7 -7
- package/dist/utils/template/npm.js +8 -8
- package/dist/utils/template/npm.test.js +9 -9
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -4,23 +4,23 @@ import {
|
|
|
4
4
|
errorHandler,
|
|
5
5
|
registerCleanBugsnagErrorsFromWithinPlugins,
|
|
6
6
|
sendErrorToBugsnag
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GQNJWQKC.js";
|
|
8
8
|
import "./chunk-LKGDG6WW.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-PGYGWMK7.js";
|
|
10
|
+
import "./chunk-X2I3FAVD.js";
|
|
11
|
+
import "./chunk-5NBS5LAW.js";
|
|
12
|
+
import "./chunk-HTYJDJRZ.js";
|
|
13
|
+
import "./chunk-LR725A3N.js";
|
|
14
|
+
import "./chunk-J3QAMMY2.js";
|
|
15
|
+
import "./chunk-H4N7DG5X.js";
|
|
16
|
+
import "./chunk-XKDB3ST7.js";
|
|
17
17
|
import "./chunk-FBB6KUZG.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-RAFFEFML.js";
|
|
19
19
|
import "./chunk-G6FN5VUE.js";
|
|
20
20
|
import "./chunk-UVY6LL5H.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-R5KQZMEG.js";
|
|
22
|
+
import "./chunk-LUP5VDI4.js";
|
|
23
|
+
import "./chunk-K5EEGEVV.js";
|
|
24
24
|
import "./chunk-WCNR75S2.js";
|
|
25
25
|
import "./chunk-3JLUTHGR.js";
|
|
26
26
|
import "./chunk-GXPKATXW.js";
|
package/dist/hooks/postrun.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
reportAnalyticsEvent
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-PGYGWMK7.js";
|
|
4
|
+
import "../chunk-X2I3FAVD.js";
|
|
5
|
+
import "../chunk-5NBS5LAW.js";
|
|
6
|
+
import "../chunk-HTYJDJRZ.js";
|
|
7
|
+
import "../chunk-LR725A3N.js";
|
|
8
|
+
import "../chunk-J3QAMMY2.js";
|
|
9
|
+
import "../chunk-H4N7DG5X.js";
|
|
10
10
|
import {
|
|
11
11
|
addSensitiveMetadata,
|
|
12
12
|
getAllSensitiveMetadata,
|
|
13
13
|
outputDebug,
|
|
14
14
|
renderWarning
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-XKDB3ST7.js";
|
|
16
16
|
import "../chunk-FBB6KUZG.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-RAFFEFML.js";
|
|
18
18
|
import "../chunk-G6FN5VUE.js";
|
|
19
19
|
import "../chunk-UVY6LL5H.js";
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-R5KQZMEG.js";
|
|
21
|
+
import "../chunk-LUP5VDI4.js";
|
|
22
|
+
import "../chunk-K5EEGEVV.js";
|
|
23
23
|
import "../chunk-WCNR75S2.js";
|
|
24
24
|
import "../chunk-3JLUTHGR.js";
|
|
25
25
|
import "../chunk-GXPKATXW.js";
|
package/dist/hooks/prerun.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
startAnalytics
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-LR725A3N.js";
|
|
4
|
+
import "../chunk-J3QAMMY2.js";
|
|
5
|
+
import "../chunk-H4N7DG5X.js";
|
|
6
6
|
import {
|
|
7
7
|
outputDebug
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-XKDB3ST7.js";
|
|
9
9
|
import "../chunk-FBB6KUZG.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-RAFFEFML.js";
|
|
11
11
|
import "../chunk-G6FN5VUE.js";
|
|
12
12
|
import {
|
|
13
13
|
initDemoRecorder
|
|
14
14
|
} from "../chunk-UVY6LL5H.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-R5KQZMEG.js";
|
|
16
|
+
import "../chunk-LUP5VDI4.js";
|
|
17
|
+
import "../chunk-K5EEGEVV.js";
|
|
18
18
|
import "../chunk-WCNR75S2.js";
|
|
19
19
|
import "../chunk-3JLUTHGR.js";
|
|
20
20
|
import "../chunk-GXPKATXW.js";
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runCreateCLI
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7F4FS2WD.js";
|
|
4
4
|
import "./chunk-UVY6LL5H.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-R5KQZMEG.js";
|
|
6
|
+
import "./chunk-LUP5VDI4.js";
|
|
7
|
+
import "./chunk-K5EEGEVV.js";
|
|
8
8
|
import "./chunk-WCNR75S2.js";
|
|
9
9
|
import {
|
|
10
10
|
init_cjs_shims
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_lib
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-R5KQZMEG.js";
|
|
4
|
+
import "./chunk-LUP5VDI4.js";
|
|
5
|
+
import "./chunk-K5EEGEVV.js";
|
|
6
6
|
import "./chunk-WCNR75S2.js";
|
|
7
7
|
import "./chunk-M63RTPGR.js";
|
|
8
8
|
export default require_lib();
|
|
@@ -21,14 +21,14 @@ import {
|
|
|
21
21
|
useDeviceAuth,
|
|
22
22
|
useEmbeddedThemeCLI,
|
|
23
23
|
useThemebundling
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XKDB3ST7.js";
|
|
25
25
|
import "./chunk-FBB6KUZG.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-RAFFEFML.js";
|
|
27
27
|
import "./chunk-G6FN5VUE.js";
|
|
28
28
|
import "./chunk-UVY6LL5H.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-R5KQZMEG.js";
|
|
30
|
+
import "./chunk-LUP5VDI4.js";
|
|
31
|
+
import "./chunk-K5EEGEVV.js";
|
|
32
32
|
import "./chunk-WCNR75S2.js";
|
|
33
33
|
import "./chunk-3JLUTHGR.js";
|
|
34
34
|
import "./chunk-GXPKATXW.js";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
init_cjs_shims
|
|
3
3
|
} from "./chunk-M63RTPGR.js";
|
|
4
4
|
|
|
5
|
-
// ../../node_modules/.pnpm/magic-string@0.30.
|
|
5
|
+
// ../../node_modules/.pnpm/magic-string@0.30.10/node_modules/magic-string/dist/magic-string.es.mjs
|
|
6
6
|
init_cjs_shims();
|
|
7
7
|
|
|
8
8
|
// ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.15/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
@@ -88,7 +88,7 @@ function encodeInteger(buf, pos, state, segment, j) {
|
|
|
88
88
|
return pos;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
// ../../node_modules/.pnpm/magic-string@0.30.
|
|
91
|
+
// ../../node_modules/.pnpm/magic-string@0.30.10/node_modules/magic-string/dist/magic-string.es.mjs
|
|
92
92
|
var BitSet = class _BitSet {
|
|
93
93
|
constructor(arg) {
|
|
94
94
|
this.bits = arg instanceof _BitSet ? arg.bits.slice() : [];
|
|
@@ -163,6 +163,15 @@ var Chunk = class _Chunk {
|
|
|
163
163
|
prependRight(content) {
|
|
164
164
|
this.intro = content + this.intro;
|
|
165
165
|
}
|
|
166
|
+
reset() {
|
|
167
|
+
this.intro = "";
|
|
168
|
+
this.outro = "";
|
|
169
|
+
if (this.edited) {
|
|
170
|
+
this.content = this.original;
|
|
171
|
+
this.storeName = false;
|
|
172
|
+
this.edited = false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
166
175
|
split(index) {
|
|
167
176
|
const sliceIndex = index - this.start;
|
|
168
177
|
const originalBefore = this.original.slice(0, sliceIndex);
|
|
@@ -196,6 +205,9 @@ var Chunk = class _Chunk {
|
|
|
196
205
|
if (trimmed.length) {
|
|
197
206
|
if (trimmed !== this.content) {
|
|
198
207
|
this.split(this.start + trimmed.length).edit("", void 0, true);
|
|
208
|
+
if (this.edited) {
|
|
209
|
+
this.edit(trimmed, this.storeName, true);
|
|
210
|
+
}
|
|
199
211
|
}
|
|
200
212
|
return true;
|
|
201
213
|
} else {
|
|
@@ -212,7 +224,10 @@ var Chunk = class _Chunk {
|
|
|
212
224
|
const trimmed = this.content.replace(rx, "");
|
|
213
225
|
if (trimmed.length) {
|
|
214
226
|
if (trimmed !== this.content) {
|
|
215
|
-
this.split(this.end - trimmed.length);
|
|
227
|
+
const newChunk = this.split(this.end - trimmed.length);
|
|
228
|
+
if (this.edited) {
|
|
229
|
+
newChunk.edit(trimmed, this.storeName, true);
|
|
230
|
+
}
|
|
216
231
|
this.edit("", void 0, true);
|
|
217
232
|
}
|
|
218
233
|
return true;
|
|
@@ -225,8 +240,8 @@ var Chunk = class _Chunk {
|
|
|
225
240
|
}
|
|
226
241
|
};
|
|
227
242
|
function getBtoa() {
|
|
228
|
-
if (typeof
|
|
229
|
-
return (str) =>
|
|
243
|
+
if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") {
|
|
244
|
+
return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
|
|
230
245
|
} else if (typeof Buffer === "function") {
|
|
231
246
|
return (str) => Buffer.from(str, "utf-8").toString("base64");
|
|
232
247
|
} else {
|
|
@@ -325,15 +340,31 @@ var Mappings = class {
|
|
|
325
340
|
}
|
|
326
341
|
addEdit(sourceIndex, content, loc, nameIndex) {
|
|
327
342
|
if (content.length) {
|
|
343
|
+
const contentLengthMinusOne = content.length - 1;
|
|
344
|
+
let contentLineEnd = content.indexOf("\n", 0);
|
|
345
|
+
let previousContentLineEnd = -1;
|
|
346
|
+
while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
|
|
347
|
+
const segment2 = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
348
|
+
if (nameIndex >= 0) {
|
|
349
|
+
segment2.push(nameIndex);
|
|
350
|
+
}
|
|
351
|
+
this.rawSegments.push(segment2);
|
|
352
|
+
this.generatedCodeLine += 1;
|
|
353
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
354
|
+
this.generatedCodeColumn = 0;
|
|
355
|
+
previousContentLineEnd = contentLineEnd;
|
|
356
|
+
contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
|
|
357
|
+
}
|
|
328
358
|
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
329
359
|
if (nameIndex >= 0) {
|
|
330
360
|
segment.push(nameIndex);
|
|
331
361
|
}
|
|
332
362
|
this.rawSegments.push(segment);
|
|
363
|
+
this.advance(content.slice(previousContentLineEnd + 1));
|
|
333
364
|
} else if (this.pending) {
|
|
334
365
|
this.rawSegments.push(this.pending);
|
|
366
|
+
this.advance(content);
|
|
335
367
|
}
|
|
336
|
-
this.advance(content);
|
|
337
368
|
this.pending = null;
|
|
338
369
|
}
|
|
339
370
|
addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
|
|
@@ -762,6 +793,26 @@ var MagicString = class _MagicString {
|
|
|
762
793
|
}
|
|
763
794
|
return this;
|
|
764
795
|
}
|
|
796
|
+
reset(start, end) {
|
|
797
|
+
while (start < 0)
|
|
798
|
+
start += this.original.length;
|
|
799
|
+
while (end < 0)
|
|
800
|
+
end += this.original.length;
|
|
801
|
+
if (start === end)
|
|
802
|
+
return this;
|
|
803
|
+
if (start < 0 || end > this.original.length)
|
|
804
|
+
throw new Error("Character is out of bounds");
|
|
805
|
+
if (start > end)
|
|
806
|
+
throw new Error("end must be greater than start");
|
|
807
|
+
this._split(start);
|
|
808
|
+
this._split(end);
|
|
809
|
+
let chunk = this.byStart[start];
|
|
810
|
+
while (chunk) {
|
|
811
|
+
chunk.reset();
|
|
812
|
+
chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
813
|
+
}
|
|
814
|
+
return this;
|
|
815
|
+
}
|
|
765
816
|
lastChar() {
|
|
766
817
|
if (this.outro.length)
|
|
767
818
|
return this.outro[this.outro.length - 1];
|
|
@@ -994,21 +1045,29 @@ var MagicString = class _MagicString {
|
|
|
994
1045
|
if (searchValue.global) {
|
|
995
1046
|
const matches = matchAll(searchValue, this.original);
|
|
996
1047
|
matches.forEach((match) => {
|
|
997
|
-
if (match.index != null)
|
|
1048
|
+
if (match.index != null) {
|
|
1049
|
+
const replacement2 = getReplacement(match, this.original);
|
|
1050
|
+
if (replacement2 !== match[0]) {
|
|
1051
|
+
this.overwrite(
|
|
1052
|
+
match.index,
|
|
1053
|
+
match.index + match[0].length,
|
|
1054
|
+
replacement2
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1059
|
+
} else {
|
|
1060
|
+
const match = this.original.match(searchValue);
|
|
1061
|
+
if (match && match.index != null) {
|
|
1062
|
+
const replacement2 = getReplacement(match, this.original);
|
|
1063
|
+
if (replacement2 !== match[0]) {
|
|
998
1064
|
this.overwrite(
|
|
999
1065
|
match.index,
|
|
1000
1066
|
match.index + match[0].length,
|
|
1001
|
-
|
|
1067
|
+
replacement2
|
|
1002
1068
|
);
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
const match = this.original.match(searchValue);
|
|
1006
|
-
if (match && match.index != null)
|
|
1007
|
-
this.overwrite(
|
|
1008
|
-
match.index,
|
|
1009
|
-
match.index + match[0].length,
|
|
1010
|
-
getReplacement(match, this.original)
|
|
1011
|
-
);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1012
1071
|
}
|
|
1013
1072
|
return this;
|
|
1014
1073
|
}
|
|
@@ -1030,7 +1089,9 @@ var MagicString = class _MagicString {
|
|
|
1030
1089
|
const { original } = this;
|
|
1031
1090
|
const stringLength = string.length;
|
|
1032
1091
|
for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
|
|
1033
|
-
|
|
1092
|
+
const previous = original.slice(index, index + stringLength);
|
|
1093
|
+
if (previous !== replacement)
|
|
1094
|
+
this.overwrite(index, index + stringLength, replacement);
|
|
1034
1095
|
}
|
|
1035
1096
|
return this;
|
|
1036
1097
|
}
|
|
@@ -25,15 +25,15 @@ import {
|
|
|
25
25
|
usesWorkspaces,
|
|
26
26
|
writePackageJSON,
|
|
27
27
|
yarnLockfile
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-H4N7DG5X.js";
|
|
29
|
+
import "./chunk-XKDB3ST7.js";
|
|
30
30
|
import "./chunk-FBB6KUZG.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-RAFFEFML.js";
|
|
32
32
|
import "./chunk-G6FN5VUE.js";
|
|
33
33
|
import "./chunk-UVY6LL5H.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-R5KQZMEG.js";
|
|
35
|
+
import "./chunk-LUP5VDI4.js";
|
|
36
|
+
import "./chunk-K5EEGEVV.js";
|
|
37
37
|
import "./chunk-WCNR75S2.js";
|
|
38
38
|
import "./chunk-3JLUTHGR.js";
|
|
39
39
|
import "./chunk-GXPKATXW.js";
|
package/dist/prompts/init.js
CHANGED
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
isPredefinedTemplate,
|
|
4
4
|
templates,
|
|
5
5
|
visibleTemplates
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-PKFDUXG6.js";
|
|
7
|
+
import "../chunk-XKDB3ST7.js";
|
|
8
8
|
import "../chunk-FBB6KUZG.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-RAFFEFML.js";
|
|
10
10
|
import "../chunk-G6FN5VUE.js";
|
|
11
11
|
import "../chunk-UVY6LL5H.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-R5KQZMEG.js";
|
|
13
|
+
import "../chunk-LUP5VDI4.js";
|
|
14
|
+
import "../chunk-K5EEGEVV.js";
|
|
15
15
|
import "../chunk-WCNR75S2.js";
|
|
16
16
|
import "../chunk-3JLUTHGR.js";
|
|
17
17
|
import "../chunk-GXPKATXW.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_default
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-PKFDUXG6.js";
|
|
4
4
|
import {
|
|
5
5
|
installGlobalCLIPrompt,
|
|
6
6
|
renderSelectPrompt,
|
|
7
7
|
renderText,
|
|
8
8
|
renderTextPrompt
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-XKDB3ST7.js";
|
|
10
10
|
import "../chunk-FBB6KUZG.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-RAFFEFML.js";
|
|
12
12
|
import "../chunk-G6FN5VUE.js";
|
|
13
13
|
import "../chunk-UVY6LL5H.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-R5KQZMEG.js";
|
|
15
|
+
import "../chunk-LUP5VDI4.js";
|
|
16
|
+
import "../chunk-K5EEGEVV.js";
|
|
17
17
|
import "../chunk-WCNR75S2.js";
|
|
18
18
|
import {
|
|
19
19
|
beforeEach,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
globalExpect,
|
|
22
22
|
test,
|
|
23
23
|
vi
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-U4YACXEW.js";
|
|
25
25
|
import "../chunk-3JLUTHGR.js";
|
|
26
26
|
import "../chunk-GXPKATXW.js";
|
|
27
27
|
import {
|
package/dist/services/init.d.ts
CHANGED
package/dist/services/init.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-I3IYXB26.js";
|
|
4
|
+
import "../chunk-YI3MHBSD.js";
|
|
5
|
+
import "../chunk-H3UBEY47.js";
|
|
6
|
+
import "../chunk-X2I3FAVD.js";
|
|
7
|
+
import "../chunk-5NBS5LAW.js";
|
|
8
|
+
import "../chunk-HTYJDJRZ.js";
|
|
9
|
+
import "../chunk-J3QAMMY2.js";
|
|
10
|
+
import "../chunk-H4N7DG5X.js";
|
|
11
|
+
import "../chunk-XKDB3ST7.js";
|
|
12
12
|
import "../chunk-FBB6KUZG.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-RAFFEFML.js";
|
|
14
14
|
import "../chunk-G6FN5VUE.js";
|
|
15
15
|
import "../chunk-UVY6LL5H.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-R5KQZMEG.js";
|
|
17
|
+
import "../chunk-LUP5VDI4.js";
|
|
18
|
+
import "../chunk-K5EEGEVV.js";
|
|
19
19
|
import "../chunk-WCNR75S2.js";
|
|
20
20
|
import "../chunk-3JLUTHGR.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E;YACT,CAAC,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,cAAc,EAAE,EAAC,CAAC;YAC1C,CAAC,qBAAqB,EAAE,EAAC,OAAO,EAAE,2BAA2B,CAAC,cAAc,EAAE,gCAAgC,CAAC,EAAC,CAAC;YACjH,CAAC,sBAAsB,EAAE,EAAC,OAAO,EAAE,2BAA2B,CAAC,cAAc,EAAE,iBAAiB,CAAC,EAAC,CAAC;SACpG;QACD,SAAS,EAAE;YACT,EAAC,IAAI,EAAE,EAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,qBAAqB,EAAC,EAAC;YAC3D;gBACE,kCAAkC;gBAClC,EAAC,OAAO,EAAE,GAAG,2BAA2B,CAAC,cAAc,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,EAAC;aACrF;SACF;KACF,CAAC,CAAA;AACJ,CAAC;AAED,KAAK,UAAU,6BAA6B,CAAC,SAAiB,EAAE,IAAY;IAC1E,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,CAAA;IAC1C,IAAI,MAAM;QACR,MAAM,IAAI,UAAU,CAAC,iCAAiC,IAAI,oDAAoD,CAAC,CAAA;AACnH,CAAC;AAED,SAAS,iCAAiC,CAAC,SAAiB;IAC1D,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AAChG,CAAC;AAED,eAAe,IAAI,CAAA","sourcesContent":["import {getDeepInstallNPMTasks, updateCLIDependencies} from '../utils/template/npm.js'\nimport cleanup from '../utils/template/cleanup.js'\nimport {\n findUpAndReadPackageJson,\n PackageManager,\n UnknownPackageManagerError,\n writePackageJSON,\n} from '@shopify/cli-kit/node/node-package-manager'\nimport {renderInfo, renderSuccess, renderTasks, Task} from '@shopify/cli-kit/node/ui'\nimport {parseGitHubRepositoryReference} from '@shopify/cli-kit/node/github'\nimport {hyphenate} from '@shopify/cli-kit/common/string'\nimport {recursiveLiquidTemplateCopy} from '@shopify/cli-kit/node/liquid'\nimport {isShopify} from '@shopify/cli-kit/node/context/local'\nimport {downloadGitRepository, initializeGitRepository} from '@shopify/cli-kit/node/git'\nimport {\n appendFile,\n fileExists,\n fileExistsSync,\n inTemporaryDirectory,\n mkdir,\n moveFile,\n writeFile,\n} from '@shopify/cli-kit/node/fs'\nimport {joinPath} from '@shopify/cli-kit/node/path'\nimport {username} from '@shopify/cli-kit/node/os'\nimport {AbortError} from '@shopify/cli-kit/node/error'\nimport {formatPackageManagerCommand} from '@shopify/cli-kit/node/output'\n\ninterface InitOptions {\n name: string\n directory: string\n template: string\n packageManager: PackageManager\n local: boolean\n useGlobalCLI: boolean\n}\n\nasync function init(options: InitOptions) {\n const packageManager: PackageManager = options.packageManager\n const hyphenizedName = hyphenate(options.name)\n const outputDirectory = joinPath(options.directory, hyphenizedName)\n const githubRepo = parseGitHubRepositoryReference(options.template)\n\n await ensureAppDirectoryIsAvailable(outputDirectory, hyphenizedName)\n\n renderInfo({\n body: [\n `Initializing project with`,\n {command: packageManager},\n `\\nUse the`,\n {command: `--package-manager`},\n `flag to select a different package manager.`,\n ],\n })\n\n await inTemporaryDirectory(async (tmpDir) => {\n const templateDownloadDir = joinPath(tmpDir, 'download')\n const templatePathDir = githubRepo.filePath\n ? joinPath(templateDownloadDir, githubRepo.filePath)\n : templateDownloadDir\n const templateScaffoldDir = joinPath(tmpDir, 'app')\n const repoUrl = githubRepo.branch ? `${githubRepo.baseURL}#${githubRepo.branch}` : githubRepo.baseURL\n\n await mkdir(templateDownloadDir)\n const tasks: Task<unknown>[] = [\n {\n title: `Downloading template from ${repoUrl}`,\n task: async () => {\n await downloadGitRepository({\n repoUrl,\n destination: templateDownloadDir,\n shallow: true,\n })\n },\n },\n ]\n\n tasks.push(\n {\n title: 'Parsing liquid',\n task: async () => {\n await recursiveLiquidTemplateCopy(templatePathDir, templateScaffoldDir, {\n dependency_manager: packageManager,\n app_name: options.name,\n })\n },\n },\n {\n title: 'Updating package.json',\n task: async () => {\n const packageJSON = (await findUpAndReadPackageJson(templateScaffoldDir)).content\n packageJSON.name = hyphenizedName\n packageJSON.author = (await username()) ?? ''\n packageJSON.private = true\n const workspacesFolders = ['extensions/*'].concat(detectAdditionalWorkspacesFolders(templateScaffoldDir))\n\n switch (packageManager) {\n case 'npm':\n case 'yarn':\n case 'bun':\n packageJSON.workspaces = workspacesFolders\n break\n case 'pnpm': {\n const workspacesContent = workspacesFolders.map((folder) => ` - '${folder}'`).join(`\\n`)\n await writeFile(joinPath(templateScaffoldDir, 'pnpm-workspace.yaml'), `packages:\\n${workspacesContent}`)\n // Ensure that the installation of dependencies doesn't fail when using\n // pnpm due to missing peerDependencies.\n await appendFile(joinPath(templateScaffoldDir, '.npmrc'), `auto-install-peers=true\\n`)\n break\n }\n case 'unknown':\n throw new UnknownPackageManagerError()\n }\n\n await updateCLIDependencies({\n packageJSON,\n local: options.local,\n directory: templateScaffoldDir,\n useGlobalCLI: options.useGlobalCLI,\n })\n await writePackageJSON(templateScaffoldDir, packageJSON)\n },\n },\n )\n\n if (await isShopify()) {\n tasks.push({\n title: \"[Shopifolks-only] Configuring the project's NPM registry\",\n task: async () => {\n const npmrcPath = joinPath(templateScaffoldDir, '.npmrc')\n const npmrcContent = `@shopify:registry=https://registry.npmjs.org\\n`\n await appendFile(npmrcPath, npmrcContent)\n },\n })\n }\n\n tasks.push(\n {\n title: `Installing dependencies with ${packageManager}`,\n task: async () => {\n await getDeepInstallNPMTasks({from: templateScaffoldDir, packageManager})\n },\n },\n {\n title: 'Cleaning up',\n task: async () => {\n await cleanup(templateScaffoldDir)\n },\n },\n {\n title: 'Initializing a Git repository...',\n task: async () => {\n await initializeGitRepository(templateScaffoldDir)\n },\n },\n )\n\n await renderTasks(tasks)\n\n await moveFile(templateScaffoldDir, outputDirectory)\n })\n\n renderSuccess({\n headline: [{userInput: hyphenizedName}, 'is ready for you to build!'],\n nextSteps: [\n ['Run', {command: `cd ${hyphenizedName}`}],\n ['For extensions, run', {command: formatPackageManagerCommand(packageManager, 'shopify app generate extension')}],\n ['To see your app, run', {command: formatPackageManagerCommand(packageManager, 'shopify app dev')}],\n ],\n reference: [\n {link: {label: 'Shopify docs', url: 'https://shopify.dev'}},\n [\n 'For an overview of commands, run',\n {command: `${formatPackageManagerCommand(packageManager, 'shopify app', '--help')}`},\n ],\n ],\n })\n}\n\nasync function ensureAppDirectoryIsAvailable(directory: string, name: string): Promise<void> {\n const exists = await fileExists(directory)\n if (exists)\n throw new AbortError(`\\nA directory with this name (${name}) already exists.\\nChoose a new name for your app.`)\n}\n\nfunction detectAdditionalWorkspacesFolders(directory: string) {\n return ['web', 'web/frontend'].filter((folder) => fileExistsSync(joinPath(directory, folder)))\n}\n\nexport default init\n"]}
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/services/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAE,qBAAqB,EAAC,MAAM,0BAA0B,CAAA;AACtF,OAAO,OAAO,MAAM,8BAA8B,CAAA;AAClD,OAAO,EACL,wBAAwB,EACxB,SAAS,EAET,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,4CAA4C,CAAA;AACnD,OAAO,EAAC,UAAU,EAAE,aAAa,EAAE,WAAW,EAAO,MAAM,0BAA0B,CAAA;AACrF,OAAO,EAAC,8BAA8B,EAAC,MAAM,8BAA8B,CAAA;AAC3E,OAAO,EAAC,SAAS,EAAC,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAC,2BAA2B,EAAC,MAAM,8BAA8B,CAAA;AACxE,OAAO,EAAC,SAAS,EAAC,MAAM,qCAAqC,CAAA;AAC7D,OAAO,EAAC,qBAAqB,EAAE,uBAAuB,EAAC,MAAM,2BAA2B,CAAA;AACxF,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,KAAK,EACL,QAAQ,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,SAAS,EAAE;YACT,CAAC,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,cAAc,EAAE,EAAC,CAAC;YAC1C,CAAC,qBAAqB,EAAE,EAAC,OAAO,EAAE,2BAA2B,CAAC,cAAc,EAAE,gCAAgC,CAAC,EAAC,CAAC;YACjH,CAAC,sBAAsB,EAAE,EAAC,OAAO,EAAE,2BAA2B,CAAC,cAAc,EAAE,iBAAiB,CAAC,EAAC,CAAC;SACpG;QACD,SAAS,EAAE;YACT,EAAC,IAAI,EAAE,EAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,qBAAqB,EAAC,EAAC;YAC3D;gBACE,kCAAkC;gBAClC,EAAC,OAAO,EAAE,GAAG,2BAA2B,CAAC,cAAc,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,EAAC;aACrF;SACF;KACF,CAAC,CAAA;AACJ,CAAC;AAED,KAAK,UAAU,6BAA6B,CAAC,SAAiB,EAAE,IAAY;IAC1E,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,CAAA;IAC1C,IAAI,MAAM;QACR,MAAM,IAAI,UAAU,CAAC,iCAAiC,IAAI,oDAAoD,CAAC,CAAA;AACnH,CAAC;AAED,SAAS,iCAAiC,CAAC,SAAiB;IAC1D,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AAChG,CAAC;AAED,eAAe,IAAI,CAAA","sourcesContent":["import {getDeepInstallNPMTasks, updateCLIDependencies} from '../utils/template/npm.js'\nimport cleanup from '../utils/template/cleanup.js'\nimport {\n findUpAndReadPackageJson,\n lockfiles,\n PackageManager,\n UnknownPackageManagerError,\n writePackageJSON,\n} from '@shopify/cli-kit/node/node-package-manager'\nimport {renderInfo, renderSuccess, renderTasks, Task} from '@shopify/cli-kit/node/ui'\nimport {parseGitHubRepositoryReference} from '@shopify/cli-kit/node/github'\nimport {hyphenate} from '@shopify/cli-kit/common/string'\nimport {recursiveLiquidTemplateCopy} from '@shopify/cli-kit/node/liquid'\nimport {isShopify} from '@shopify/cli-kit/node/context/local'\nimport {downloadGitRepository, initializeGitRepository} from '@shopify/cli-kit/node/git'\nimport {\n appendFile,\n fileExists,\n fileExistsSync,\n inTemporaryDirectory,\n mkdir,\n moveFile,\n readFile,\n writeFile,\n} from '@shopify/cli-kit/node/fs'\nimport {joinPath} from '@shopify/cli-kit/node/path'\nimport {username} from '@shopify/cli-kit/node/os'\nimport {AbortError} from '@shopify/cli-kit/node/error'\nimport {formatPackageManagerCommand} from '@shopify/cli-kit/node/output'\n\ninterface InitOptions {\n name: string\n directory: string\n template: string\n packageManager: PackageManager\n local: boolean\n useGlobalCLI: boolean\n postCloneActions: {\n removeLockfilesFromGitignore: boolean\n }\n}\n\nasync function init(options: InitOptions) {\n const packageManager: PackageManager = options.packageManager\n const hyphenizedName = hyphenate(options.name)\n const outputDirectory = joinPath(options.directory, hyphenizedName)\n const githubRepo = parseGitHubRepositoryReference(options.template)\n\n await ensureAppDirectoryIsAvailable(outputDirectory, hyphenizedName)\n\n renderInfo({\n body: [\n `Initializing project with`,\n {command: packageManager},\n `\\nUse the`,\n {command: `--package-manager`},\n `flag to select a different package manager.`,\n ],\n })\n\n await inTemporaryDirectory(async (tmpDir) => {\n const templateDownloadDir = joinPath(tmpDir, 'download')\n const templatePathDir = githubRepo.filePath\n ? joinPath(templateDownloadDir, githubRepo.filePath)\n : templateDownloadDir\n const templateScaffoldDir = joinPath(tmpDir, 'app')\n const repoUrl = githubRepo.branch ? `${githubRepo.baseURL}#${githubRepo.branch}` : githubRepo.baseURL\n\n await mkdir(templateDownloadDir)\n const tasks: Task<unknown>[] = [\n {\n title: `Downloading template from ${repoUrl}`,\n task: async () => {\n await downloadGitRepository({\n repoUrl,\n destination: templateDownloadDir,\n shallow: true,\n })\n },\n },\n ]\n\n tasks.push(\n {\n title: 'Parsing liquid',\n task: async () => {\n await recursiveLiquidTemplateCopy(templatePathDir, templateScaffoldDir, {\n dependency_manager: packageManager,\n app_name: options.name,\n })\n },\n },\n {\n title: 'Updating package.json',\n task: async () => {\n const packageJSON = (await findUpAndReadPackageJson(templateScaffoldDir)).content\n packageJSON.name = hyphenizedName\n packageJSON.author = (await username()) ?? ''\n packageJSON.private = true\n const workspacesFolders = ['extensions/*'].concat(detectAdditionalWorkspacesFolders(templateScaffoldDir))\n\n switch (packageManager) {\n case 'npm':\n case 'yarn':\n case 'bun':\n packageJSON.workspaces = workspacesFolders\n break\n case 'pnpm': {\n const workspacesContent = workspacesFolders.map((folder) => ` - '${folder}'`).join(`\\n`)\n await writeFile(joinPath(templateScaffoldDir, 'pnpm-workspace.yaml'), `packages:\\n${workspacesContent}`)\n // Ensure that the installation of dependencies doesn't fail when using\n // pnpm due to missing peerDependencies.\n await appendFile(joinPath(templateScaffoldDir, '.npmrc'), `auto-install-peers=true\\n`)\n break\n }\n case 'unknown':\n throw new UnknownPackageManagerError()\n }\n\n await updateCLIDependencies({\n packageJSON,\n local: options.local,\n directory: templateScaffoldDir,\n useGlobalCLI: options.useGlobalCLI,\n })\n await writePackageJSON(templateScaffoldDir, packageJSON)\n },\n },\n )\n\n if (options.postCloneActions.removeLockfilesFromGitignore) {\n tasks.push({\n title: 'Removing lockfiles from .gitignore',\n task: async () => {\n const gitignorePath = joinPath(templateScaffoldDir, '.gitignore')\n if (await fileExists(gitignorePath)) {\n let existingContent = await readFile(gitignorePath)\n\n lockfiles.forEach((lockfile) => {\n // convert to a regex matching a whole line, escaping any special characters\n const lockfileRegex = new RegExp(`^${lockfile.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}$`, 'gm')\n existingContent = existingContent.replace(lockfileRegex, '')\n })\n\n await writeFile(gitignorePath, existingContent.trim())\n }\n },\n })\n }\n\n if (await isShopify()) {\n tasks.push({\n title: \"[Shopifolks-only] Configuring the project's NPM registry\",\n task: async () => {\n const npmrcPath = joinPath(templateScaffoldDir, '.npmrc')\n const npmrcContent = `@shopify:registry=https://registry.npmjs.org\\n`\n await appendFile(npmrcPath, npmrcContent)\n },\n })\n }\n\n tasks.push(\n {\n title: `Installing dependencies with ${packageManager}`,\n task: async () => {\n await getDeepInstallNPMTasks({from: templateScaffoldDir, packageManager})\n },\n },\n {\n title: 'Cleaning up',\n task: async () => {\n await cleanup(templateScaffoldDir)\n },\n },\n {\n title: 'Initializing a Git repository...',\n task: async () => {\n await initializeGitRepository(templateScaffoldDir)\n },\n },\n )\n\n await renderTasks(tasks)\n\n await moveFile(templateScaffoldDir, outputDirectory)\n })\n\n renderSuccess({\n headline: [{userInput: hyphenizedName}, 'is ready for you to build!'],\n nextSteps: [\n ['Run', {command: `cd ${hyphenizedName}`}],\n ['For extensions, run', {command: formatPackageManagerCommand(packageManager, 'shopify app generate extension')}],\n ['To see your app, run', {command: formatPackageManagerCommand(packageManager, 'shopify app dev')}],\n ],\n reference: [\n {link: {label: 'Shopify docs', url: 'https://shopify.dev'}},\n [\n 'For an overview of commands, run',\n {command: `${formatPackageManagerCommand(packageManager, 'shopify app', '--help')}`},\n ],\n ],\n })\n}\n\nasync function ensureAppDirectoryIsAvailable(directory: string, name: string): Promise<void> {\n const exists = await fileExists(directory)\n if (exists)\n throw new AbortError(`\\nA directory with this name (${name}) already exists.\\nChoose a new name for your app.`)\n}\n\nfunction detectAdditionalWorkspacesFolders(directory: string) {\n return ['web', 'web/frontend'].filter((folder) => fileExistsSync(joinPath(directory, folder)))\n}\n\nexport default init\n"]}
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
openURL,
|
|
5
5
|
sleep,
|
|
6
6
|
terminalSupportsRawMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XKDB3ST7.js";
|
|
8
8
|
import "./chunk-FBB6KUZG.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-RAFFEFML.js";
|
|
10
10
|
import "./chunk-G6FN5VUE.js";
|
|
11
11
|
import "./chunk-UVY6LL5H.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-R5KQZMEG.js";
|
|
13
|
+
import "./chunk-LUP5VDI4.js";
|
|
14
|
+
import "./chunk-K5EEGEVV.js";
|
|
15
15
|
import "./chunk-WCNR75S2.js";
|
|
16
16
|
import "./chunk-3JLUTHGR.js";
|
|
17
17
|
import "./chunk-GXPKATXW.js";
|