@shopify/cli-kit 2.0.6 → 2.0.9
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/CHANGELOG.md +21 -0
- package/dist/{index-aeb7f234.js → index-9ce018b5.js} +136 -51
- package/dist/index-9ce018b5.js.map +1 -0
- package/dist/index.d.ts +78 -14
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{multipart-parser-faf7ca10.js → multipart-parser-9b6af1e6.js} +3 -2
- package/dist/multipart-parser-9b6af1e6.js.map +1 -0
- package/package.json +3 -2
- package/dist/index-aeb7f234.js.map +0 -1
- package/dist/multipart-parser-faf7ca10.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @shopify/cli-kit
|
|
2
2
|
|
|
3
|
+
## 2.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4170ac8e: Improve copies related to `dev`
|
|
8
|
+
- 4170ac8e: Add new `completed` helper to output
|
|
9
|
+
|
|
10
|
+
## 2.0.8
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Make envfile a dependency to mitigate bundling issues
|
|
15
|
+
|
|
16
|
+
## 2.0.7
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 0d2e8e50: Allow ui.Question to accept preface string
|
|
21
|
+
- 739e8e9d: Add password type for UI Question
|
|
22
|
+
- c95660a6: Add dotenv module that provides utility functions to read and write .env files
|
|
23
|
+
|
|
3
24
|
## 2.0.6
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -38,6 +38,7 @@ import require$$0$d from 'http2';
|
|
|
38
38
|
import require$$1$4 from 'tls';
|
|
39
39
|
import require$$0$e, { createServer } from 'net';
|
|
40
40
|
import require$$0$f from 'punycode';
|
|
41
|
+
import { parse as parse$i, stringify as stringify$d } from 'envfile';
|
|
41
42
|
|
|
42
43
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
43
44
|
|
|
@@ -5174,7 +5175,7 @@ class Input extends enquirer.StringPrompt {
|
|
|
5174
5175
|
const color = this.styles.primary;
|
|
5175
5176
|
let prompt = [prefix, message].filter(Boolean).join(" ");
|
|
5176
5177
|
this.state.prompt = prompt;
|
|
5177
|
-
const output = await this.format();
|
|
5178
|
+
const output = this.type === "password" ? await this.formatPassword() : await this.format();
|
|
5178
5179
|
const help = await this.error() || await this.hint();
|
|
5179
5180
|
const underline = "\u2594".repeat(Math.max(color.unstyle(output).length - 10, 30));
|
|
5180
5181
|
if (this.state.submitted) {
|
|
@@ -5190,6 +5191,12 @@ ${color(">")} ${output}
|
|
|
5190
5191
|
this.write([prompt].filter(Boolean).join("\n"));
|
|
5191
5192
|
this.restore();
|
|
5192
5193
|
}
|
|
5194
|
+
formatPassword() {
|
|
5195
|
+
if (!this.keypressed)
|
|
5196
|
+
return "";
|
|
5197
|
+
const color = this.state.submitted ? this.styles.primary : this.styles.muted;
|
|
5198
|
+
return color(this.symbols.asterisk.repeat(this.input.length));
|
|
5199
|
+
}
|
|
5193
5200
|
}
|
|
5194
5201
|
|
|
5195
5202
|
class Select extends enquirer.Select {
|
|
@@ -10457,7 +10464,7 @@ var async$8 = {};
|
|
|
10457
10464
|
|
|
10458
10465
|
Object.defineProperty(async$8, "__esModule", { value: true });
|
|
10459
10466
|
async$8.read = void 0;
|
|
10460
|
-
function read$
|
|
10467
|
+
function read$5(path, settings, callback) {
|
|
10461
10468
|
settings.fs.lstat(path, (lstatError, lstat) => {
|
|
10462
10469
|
if (lstatError !== null) {
|
|
10463
10470
|
callFailureCallback$2(callback, lstatError);
|
|
@@ -10483,7 +10490,7 @@ function read$4(path, settings, callback) {
|
|
|
10483
10490
|
});
|
|
10484
10491
|
});
|
|
10485
10492
|
}
|
|
10486
|
-
async$8.read = read$
|
|
10493
|
+
async$8.read = read$5;
|
|
10487
10494
|
function callFailureCallback$2(callback, error) {
|
|
10488
10495
|
callback(error);
|
|
10489
10496
|
}
|
|
@@ -10495,7 +10502,7 @@ var sync$a = {};
|
|
|
10495
10502
|
|
|
10496
10503
|
Object.defineProperty(sync$a, "__esModule", { value: true });
|
|
10497
10504
|
sync$a.read = void 0;
|
|
10498
|
-
function read$
|
|
10505
|
+
function read$4(path, settings) {
|
|
10499
10506
|
const lstat = settings.fs.lstatSync(path);
|
|
10500
10507
|
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
|
10501
10508
|
return lstat;
|
|
@@ -10514,7 +10521,7 @@ function read$3(path, settings) {
|
|
|
10514
10521
|
throw error;
|
|
10515
10522
|
}
|
|
10516
10523
|
}
|
|
10517
|
-
sync$a.read = read$
|
|
10524
|
+
sync$a.read = read$4;
|
|
10518
10525
|
|
|
10519
10526
|
var settings$3 = {};
|
|
10520
10527
|
|
|
@@ -10724,14 +10731,14 @@ const rpl = runParallel_1;
|
|
|
10724
10731
|
const constants_1$1 = constants$3;
|
|
10725
10732
|
const utils$c = utils$d;
|
|
10726
10733
|
const common$7 = common$8;
|
|
10727
|
-
function read$
|
|
10734
|
+
function read$3(directory, settings, callback) {
|
|
10728
10735
|
if (!settings.stats && constants_1$1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
10729
10736
|
readdirWithFileTypes$1(directory, settings, callback);
|
|
10730
10737
|
return;
|
|
10731
10738
|
}
|
|
10732
10739
|
readdir$1(directory, settings, callback);
|
|
10733
10740
|
}
|
|
10734
|
-
async$4.read = read$
|
|
10741
|
+
async$4.read = read$3;
|
|
10735
10742
|
function readdirWithFileTypes$1(directory, settings, callback) {
|
|
10736
10743
|
settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
10737
10744
|
if (readdirError !== null) {
|
|
@@ -10829,13 +10836,13 @@ const fsStat$4 = out$3;
|
|
|
10829
10836
|
const constants_1 = constants$3;
|
|
10830
10837
|
const utils$b = utils$d;
|
|
10831
10838
|
const common$6 = common$8;
|
|
10832
|
-
function read$
|
|
10839
|
+
function read$2(directory, settings) {
|
|
10833
10840
|
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
10834
10841
|
return readdirWithFileTypes(directory, settings);
|
|
10835
10842
|
}
|
|
10836
10843
|
return readdir(directory, settings);
|
|
10837
10844
|
}
|
|
10838
|
-
sync$8.read = read$
|
|
10845
|
+
sync$8.read = read$2;
|
|
10839
10846
|
function readdirWithFileTypes(directory, settings) {
|
|
10840
10847
|
const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
|
|
10841
10848
|
return dirents.map((dirent) => {
|
|
@@ -12310,7 +12317,7 @@ var path$w = /*#__PURE__*/Object.freeze({
|
|
|
12310
12317
|
});
|
|
12311
12318
|
|
|
12312
12319
|
var name = "@shopify/cli-kit";
|
|
12313
|
-
var version$4 = "2.0.
|
|
12320
|
+
var version$4 = "2.0.9";
|
|
12314
12321
|
var description$1 = "A set of utilities, interfaces, and models that are common across all the platform features";
|
|
12315
12322
|
var keywords = [
|
|
12316
12323
|
"shopify",
|
|
@@ -12362,7 +12369,8 @@ var dependencies$1 = {
|
|
|
12362
12369
|
keytar: "^7.9.0",
|
|
12363
12370
|
open: "^8.4.0",
|
|
12364
12371
|
"source-map-support": "^0.5.21",
|
|
12365
|
-
stacktracey: "^2.1.8"
|
|
12372
|
+
stacktracey: "^2.1.8",
|
|
12373
|
+
envfile: "^6.17.0"
|
|
12366
12374
|
};
|
|
12367
12375
|
var devDependencies = {
|
|
12368
12376
|
"@iarna/toml": "^2.2.5",
|
|
@@ -12424,11 +12432,11 @@ var cliKitPackageJson = {
|
|
|
12424
12432
|
devDependencies: devDependencies
|
|
12425
12433
|
};
|
|
12426
12434
|
|
|
12427
|
-
var version$3 = "2.0.
|
|
12435
|
+
var version$3 = "2.0.9";
|
|
12428
12436
|
|
|
12429
|
-
var version$2 = "2.0.
|
|
12437
|
+
var version$2 = "2.0.9";
|
|
12430
12438
|
|
|
12431
|
-
var version$1 = "2.0.
|
|
12439
|
+
var version$1 = "2.0.9";
|
|
12432
12440
|
|
|
12433
12441
|
const homedir$1 = os$8.homedir();
|
|
12434
12442
|
const tmpdir$1 = os$8.tmpdir();
|
|
@@ -19606,14 +19614,14 @@ function stripUp(path, strip) {
|
|
|
19606
19614
|
async function inTemporaryDirectory(callback) {
|
|
19607
19615
|
return tempy.directory.task(callback);
|
|
19608
19616
|
}
|
|
19609
|
-
async function read(path) {
|
|
19617
|
+
async function read$1(path) {
|
|
19610
19618
|
const content = await fs$g.readFile(path, { encoding: "utf-8" });
|
|
19611
19619
|
return content;
|
|
19612
19620
|
}
|
|
19613
19621
|
async function copy(from, to) {
|
|
19614
19622
|
await fs$g.copy(from, to);
|
|
19615
19623
|
}
|
|
19616
|
-
async function write(path, data) {
|
|
19624
|
+
async function write$1(path, data) {
|
|
19617
19625
|
await fs$g.writeFile(path, data);
|
|
19618
19626
|
}
|
|
19619
19627
|
async function append$2(path, data) {
|
|
@@ -19662,9 +19670,9 @@ var file$1 = /*#__PURE__*/Object.freeze({
|
|
|
19662
19670
|
__proto__: null,
|
|
19663
19671
|
stripUp: stripUp,
|
|
19664
19672
|
inTemporaryDirectory: inTemporaryDirectory,
|
|
19665
|
-
read: read,
|
|
19673
|
+
read: read$1,
|
|
19666
19674
|
copy: copy,
|
|
19667
|
-
write: write,
|
|
19675
|
+
write: write$1,
|
|
19668
19676
|
append: append$2,
|
|
19669
19677
|
mkdir: mkdir,
|
|
19670
19678
|
remove: remove$4,
|
|
@@ -21102,17 +21110,26 @@ const token = {
|
|
|
21102
21110
|
link: (value, link) => {
|
|
21103
21111
|
return new ContentToken(value, { link }, 2 /* Link */);
|
|
21104
21112
|
},
|
|
21113
|
+
heading: (value) => {
|
|
21114
|
+
return new ContentToken(value, {}, 3 /* Heading */);
|
|
21115
|
+
},
|
|
21116
|
+
subheading: (value) => {
|
|
21117
|
+
return new ContentToken(value, {}, 4 /* SubHeading */);
|
|
21118
|
+
},
|
|
21119
|
+
errorText: (value) => {
|
|
21120
|
+
return new ContentToken(value, {}, 5 /* ErrorText */);
|
|
21121
|
+
},
|
|
21105
21122
|
cyan: (value) => {
|
|
21106
|
-
return new ContentToken(value, {},
|
|
21123
|
+
return new ContentToken(value, {}, 7 /* Cyan */);
|
|
21107
21124
|
},
|
|
21108
21125
|
yellow: (value) => {
|
|
21109
|
-
return new ContentToken(value, {},
|
|
21126
|
+
return new ContentToken(value, {}, 6 /* Yellow */);
|
|
21110
21127
|
},
|
|
21111
21128
|
magenta: (value) => {
|
|
21112
|
-
return new ContentToken(value, {},
|
|
21129
|
+
return new ContentToken(value, {}, 8 /* Magenta */);
|
|
21113
21130
|
},
|
|
21114
21131
|
green: (value) => {
|
|
21115
|
-
return new ContentToken(value, {},
|
|
21132
|
+
return new ContentToken(value, {}, 9 /* Green */);
|
|
21116
21133
|
}
|
|
21117
21134
|
};
|
|
21118
21135
|
class TokenizedString {
|
|
@@ -21142,16 +21159,25 @@ function content(strings, ...keys) {
|
|
|
21142
21159
|
case 2 /* Link */:
|
|
21143
21160
|
output += terminalLink(colors$9.green(enumToken.value), enumToken.metadata.link ?? "");
|
|
21144
21161
|
break;
|
|
21145
|
-
case 3 /*
|
|
21162
|
+
case 3 /* Heading */:
|
|
21163
|
+
output += colors$9.bold.underline(enumToken.value);
|
|
21164
|
+
break;
|
|
21165
|
+
case 4 /* SubHeading */:
|
|
21166
|
+
output += colors$9.underline(enumToken.value);
|
|
21167
|
+
break;
|
|
21168
|
+
case 5 /* ErrorText */:
|
|
21169
|
+
output += colors$9.bold.redBright(enumToken.value);
|
|
21170
|
+
break;
|
|
21171
|
+
case 6 /* Yellow */:
|
|
21146
21172
|
output += colors$9.yellow(enumToken.value);
|
|
21147
21173
|
break;
|
|
21148
|
-
case
|
|
21174
|
+
case 7 /* Cyan */:
|
|
21149
21175
|
output += colors$9.cyan(enumToken.value);
|
|
21150
21176
|
break;
|
|
21151
|
-
case
|
|
21177
|
+
case 8 /* Magenta */:
|
|
21152
21178
|
output += colors$9.magenta(enumToken.value);
|
|
21153
21179
|
break;
|
|
21154
|
-
case
|
|
21180
|
+
case 9 /* Green */:
|
|
21155
21181
|
output += colors$9.green(enumToken.value);
|
|
21156
21182
|
break;
|
|
21157
21183
|
}
|
|
@@ -21197,7 +21223,12 @@ const info = (content2) => {
|
|
|
21197
21223
|
};
|
|
21198
21224
|
const success = (content2) => {
|
|
21199
21225
|
if (shouldOutput("info")) {
|
|
21200
|
-
consoleLog(colors$9.bold(
|
|
21226
|
+
consoleLog(colors$9.bold(`\u2705 Success! ${stringifyMessage(content2)}.`));
|
|
21227
|
+
}
|
|
21228
|
+
};
|
|
21229
|
+
const completed = (content2) => {
|
|
21230
|
+
if (shouldOutput("info")) {
|
|
21231
|
+
consoleLog(`${colors$9.green("\u2714")} ${stringifyMessage(content2)}.`);
|
|
21201
21232
|
}
|
|
21202
21233
|
};
|
|
21203
21234
|
const debug$5 = (content2) => {
|
|
@@ -21323,9 +21354,12 @@ function withOrWithoutStyle(message2) {
|
|
|
21323
21354
|
if (shouldDisplayColors()) {
|
|
21324
21355
|
return message2;
|
|
21325
21356
|
} else {
|
|
21326
|
-
return
|
|
21357
|
+
return unstyled(message2);
|
|
21327
21358
|
}
|
|
21328
21359
|
}
|
|
21360
|
+
function unstyled(message2) {
|
|
21361
|
+
return colors$9.unstyle(message2);
|
|
21362
|
+
}
|
|
21329
21363
|
function shouldDisplayColors() {
|
|
21330
21364
|
return Boolean(process.stdout.isTTY || process.env.FORCE_COLOR);
|
|
21331
21365
|
}
|
|
@@ -21333,17 +21367,20 @@ function shouldDisplayColors() {
|
|
|
21333
21367
|
var output = /*#__PURE__*/Object.freeze({
|
|
21334
21368
|
__proto__: null,
|
|
21335
21369
|
token: token,
|
|
21370
|
+
TokenizedString: TokenizedString,
|
|
21336
21371
|
content: content,
|
|
21337
21372
|
currentLogLevel: currentLogLevel,
|
|
21338
21373
|
shouldOutput: shouldOutput,
|
|
21339
21374
|
info: info,
|
|
21340
21375
|
success: success,
|
|
21376
|
+
completed: completed,
|
|
21341
21377
|
debug: debug$5,
|
|
21342
21378
|
warn: warn,
|
|
21343
21379
|
newline: newline,
|
|
21344
21380
|
error: error$k,
|
|
21345
21381
|
stringifyMessage: stringifyMessage,
|
|
21346
21382
|
concurrent: concurrent,
|
|
21383
|
+
unstyled: unstyled,
|
|
21347
21384
|
shouldDisplayColors: shouldDisplayColors
|
|
21348
21385
|
});
|
|
21349
21386
|
|
|
@@ -26253,6 +26290,9 @@ const prompt = async (questions) => {
|
|
|
26253
26290
|
const mappedQuestions = questions.map(mapper);
|
|
26254
26291
|
const value = {};
|
|
26255
26292
|
for (const question of mappedQuestions) {
|
|
26293
|
+
if (question.preface) {
|
|
26294
|
+
info(question.preface);
|
|
26295
|
+
}
|
|
26256
26296
|
value[question.name] = await question.run();
|
|
26257
26297
|
}
|
|
26258
26298
|
return value;
|
|
@@ -26278,14 +26318,17 @@ async function nonEmptyDirectoryPrompt(directory) {
|
|
|
26278
26318
|
}
|
|
26279
26319
|
}
|
|
26280
26320
|
function mapper(question) {
|
|
26281
|
-
|
|
26282
|
-
|
|
26283
|
-
|
|
26284
|
-
|
|
26285
|
-
|
|
26286
|
-
|
|
26321
|
+
switch (question.type) {
|
|
26322
|
+
case "input":
|
|
26323
|
+
case "password":
|
|
26324
|
+
return new Input(question);
|
|
26325
|
+
case "select":
|
|
26326
|
+
return new Select(question);
|
|
26327
|
+
case "autocomplete":
|
|
26328
|
+
return new AutoComplete(question);
|
|
26329
|
+
default:
|
|
26330
|
+
return void 0;
|
|
26287
26331
|
}
|
|
26288
|
-
return void 0;
|
|
26289
26332
|
}
|
|
26290
26333
|
|
|
26291
26334
|
var ui = /*#__PURE__*/Object.freeze({
|
|
@@ -30781,12 +30824,12 @@ async function recursiveDirectoryCopy(from, to, data) {
|
|
|
30781
30824
|
await mkdir(outputPath);
|
|
30782
30825
|
} else if (templateItemPath.endsWith(".liquid")) {
|
|
30783
30826
|
await mkdir(dirname$1(outputPath));
|
|
30784
|
-
const content = await read(templateItemPath);
|
|
30827
|
+
const content = await read$1(templateItemPath);
|
|
30785
30828
|
const contentOutput = await create$1(content)(data);
|
|
30786
30829
|
const isExecutable = await hasExecutablePermissions(templateItemPath);
|
|
30787
30830
|
const outputPathWithoutLiquid = outputPath.replace(".liquid", "");
|
|
30788
30831
|
await copy(templateItemPath, outputPathWithoutLiquid);
|
|
30789
|
-
await write(outputPathWithoutLiquid, contentOutput);
|
|
30832
|
+
await write$1(outputPathWithoutLiquid, contentOutput);
|
|
30790
30833
|
if (isExecutable) {
|
|
30791
30834
|
await chmod(outputPathWithoutLiquid, 493);
|
|
30792
30835
|
}
|
|
@@ -30865,6 +30908,21 @@ function camelCase(input, options) {
|
|
|
30865
30908
|
return pascalCase(input, __assign$1({ transform: camelCaseTransform }, options));
|
|
30866
30909
|
}
|
|
30867
30910
|
|
|
30911
|
+
/**
|
|
30912
|
+
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
|
|
30913
|
+
*/
|
|
30914
|
+
/**
|
|
30915
|
+
* Upper case as a function.
|
|
30916
|
+
*/
|
|
30917
|
+
function upperCase(str) {
|
|
30918
|
+
return str.toUpperCase();
|
|
30919
|
+
}
|
|
30920
|
+
|
|
30921
|
+
function constantCase(input, options) {
|
|
30922
|
+
if (options === void 0) { options = {}; }
|
|
30923
|
+
return noCase(input, __assign$1({ delimiter: "_", transform: upperCase }, options));
|
|
30924
|
+
}
|
|
30925
|
+
|
|
30868
30926
|
function dotCase(input, options) {
|
|
30869
30927
|
if (options === void 0) { options = {}; }
|
|
30870
30928
|
return noCase(input, __assign$1({ delimiter: "." }, options));
|
|
@@ -30910,7 +30968,8 @@ var string = /*#__PURE__*/Object.freeze({
|
|
|
30910
30968
|
normalizeStoreName: normalizeStoreName,
|
|
30911
30969
|
camelize: camelCase,
|
|
30912
30970
|
hyphenize: paramCase,
|
|
30913
|
-
underscore: snakeCase
|
|
30971
|
+
underscore: snakeCase,
|
|
30972
|
+
constantize: constantCase
|
|
30914
30973
|
});
|
|
30915
30974
|
|
|
30916
30975
|
var dist$6 = {};
|
|
@@ -40572,7 +40631,7 @@ class Body$1 {
|
|
|
40572
40631
|
return formData;
|
|
40573
40632
|
}
|
|
40574
40633
|
|
|
40575
|
-
const {toFormData} = await import('./multipart-parser-
|
|
40634
|
+
const {toFormData} = await import('./multipart-parser-9b6af1e6.js');
|
|
40576
40635
|
return toFormData(this.body, ct);
|
|
40577
40636
|
}
|
|
40578
40637
|
|
|
@@ -54539,17 +54598,17 @@ async function getDependencies(packageJsonPath) {
|
|
|
54539
54598
|
if (!await exists$1(packageJsonPath)) {
|
|
54540
54599
|
throw PackageJsonNotFoundError(dirname$1(packageJsonPath));
|
|
54541
54600
|
}
|
|
54542
|
-
const packageJsonContent = JSON.parse(await read(packageJsonPath));
|
|
54601
|
+
const packageJsonContent = JSON.parse(await read$1(packageJsonPath));
|
|
54543
54602
|
const dependencies = packageJsonContent.dependencies ?? {};
|
|
54544
54603
|
const devDependencies = packageJsonContent.devDependencies ?? {};
|
|
54545
|
-
return
|
|
54604
|
+
return { ...dependencies, ...devDependencies };
|
|
54546
54605
|
}
|
|
54547
54606
|
async function addNPMDependenciesIfNeeded(dependencies, options) {
|
|
54548
54607
|
const packageJsonPath = join$3(options.directory, "package.json");
|
|
54549
54608
|
if (!await exists$1(packageJsonPath)) {
|
|
54550
54609
|
throw PackageJsonNotFoundError(options.directory);
|
|
54551
54610
|
}
|
|
54552
|
-
const existingDependencies = await getDependencies(packageJsonPath);
|
|
54611
|
+
const existingDependencies = Object.keys(await getDependencies(packageJsonPath));
|
|
54553
54612
|
const dependenciesToAdd = dependencies.filter((dep) => {
|
|
54554
54613
|
return !existingDependencies.includes(dep);
|
|
54555
54614
|
});
|
|
@@ -66551,7 +66610,7 @@ const AuthenticationError = (message) => {
|
|
|
66551
66610
|
};
|
|
66552
66611
|
const MissingCodeError = new Bug(`The authentication cannot continue because the redirect doesn't include the code.`);
|
|
66553
66612
|
const MissingStateError = new Bug(`The authentication cannot continue because the redirect doesn't include the state.`);
|
|
66554
|
-
const redirectResponseBody =
|
|
66613
|
+
const redirectResponseBody = `You're logged in on the Shopify CLI in your terminal`;
|
|
66555
66614
|
const ResponseTimeoutSeconds = 10;
|
|
66556
66615
|
class RedirectListener {
|
|
66557
66616
|
static createServer(callback) {
|
|
@@ -66612,8 +66671,8 @@ class RedirectListener {
|
|
|
66612
66671
|
async function listenRedirect(host, port, url2) {
|
|
66613
66672
|
const result = await new Promise((resolve, reject) => {
|
|
66614
66673
|
const timeout = setTimeout(() => {
|
|
66615
|
-
const message = "\nAuto-open timed out.
|
|
66616
|
-
info(content`${message}${token.link("
|
|
66674
|
+
const message = "\nAuto-open timed out. Open the login page: ";
|
|
66675
|
+
info(content`${message}${token.link("Log in to Shopify Partners", url2)}\n`);
|
|
66617
66676
|
}, ResponseTimeoutSeconds * 1e3);
|
|
66618
66677
|
const redirectListener = new RedirectListener({
|
|
66619
66678
|
host,
|
|
@@ -66656,7 +66715,7 @@ async function authorize(scopes, state = randomHex(30)) {
|
|
|
66656
66715
|
};
|
|
66657
66716
|
url = `${url}?${new URLSearchParams(params).toString()}`;
|
|
66658
66717
|
open(url);
|
|
66659
|
-
info("\nTo run this command,
|
|
66718
|
+
info("\nTo run this command, log in to Shopify Partners.");
|
|
66660
66719
|
const result = await listenRedirect(host, port, url);
|
|
66661
66720
|
if (result.state !== state) {
|
|
66662
66721
|
throw MismatchStateError;
|
|
@@ -69706,6 +69765,7 @@ async function executeCompleteFlow(applications, identityFqdn2) {
|
|
|
69706
69765
|
applications: result
|
|
69707
69766
|
}
|
|
69708
69767
|
};
|
|
69768
|
+
completed("Logged in");
|
|
69709
69769
|
return session;
|
|
69710
69770
|
}
|
|
69711
69771
|
async function refreshTokens(token, applications, fqdn) {
|
|
@@ -84708,6 +84768,7 @@ function setAppInfo(appId, data) {
|
|
|
84708
84768
|
const index = apps.findIndex((saved) => saved.appId === appId);
|
|
84709
84769
|
if (index === -1) {
|
|
84710
84770
|
apps.push({ appId, storeFqdn: data.storeFqdn, orgId: data.orgId });
|
|
84771
|
+
completed("Updated your project name to match your Shopify app name");
|
|
84711
84772
|
} else {
|
|
84712
84773
|
const app = apps[index];
|
|
84713
84774
|
apps[index] = { appId, storeFqdn: data.storeFqdn ?? app.storeFqdn, orgId: data.orgId ?? app.orgId };
|
|
@@ -172361,7 +172422,7 @@ function createWorkingDirectory() {
|
|
|
172361
172422
|
}
|
|
172362
172423
|
async function createGemfile() {
|
|
172363
172424
|
const gemPath = join$3(rubyCLIPath(), "Gemfile");
|
|
172364
|
-
await write(gemPath, `source 'https://rubygems.org'
|
|
172425
|
+
await write$1(gemPath, `source 'https://rubygems.org'
|
|
172365
172426
|
gem 'shopify-cli', '${RubyCLIVersion}'`);
|
|
172366
172427
|
}
|
|
172367
172428
|
async function bundleInstall() {
|
|
@@ -172379,12 +172440,12 @@ var ruby = /*#__PURE__*/Object.freeze({
|
|
|
172379
172440
|
|
|
172380
172441
|
async function readPackageJSON(directory) {
|
|
172381
172442
|
const packagePath = join$3(directory, "package.json");
|
|
172382
|
-
const packageJSON = JSON.parse(await read(packagePath));
|
|
172443
|
+
const packageJSON = JSON.parse(await read$1(packagePath));
|
|
172383
172444
|
return packageJSON;
|
|
172384
172445
|
}
|
|
172385
172446
|
async function writePackageJSON(directory, packageJSON) {
|
|
172386
172447
|
const packagePath = join$3(directory, "package.json");
|
|
172387
|
-
await write(packagePath, JSON.stringify(packageJSON, null, 2));
|
|
172448
|
+
await write$1(packagePath, JSON.stringify(packageJSON, null, 2));
|
|
172388
172449
|
}
|
|
172389
172450
|
async function updateAppData(packageJSON, name) {
|
|
172390
172451
|
packageJSON.name = name;
|
|
@@ -172638,6 +172699,30 @@ var temporary = /*#__PURE__*/Object.freeze({
|
|
|
172638
172699
|
directory: directory
|
|
172639
172700
|
});
|
|
172640
172701
|
|
|
172702
|
+
const DotEnvNotFoundError = (path) => {
|
|
172703
|
+
return new Abort(`The environment file at ${path} does not exist.`);
|
|
172704
|
+
};
|
|
172705
|
+
async function read(path) {
|
|
172706
|
+
if (!await exists$1(path)) {
|
|
172707
|
+
throw DotEnvNotFoundError(path);
|
|
172708
|
+
}
|
|
172709
|
+
const content = await read$1(path);
|
|
172710
|
+
return {
|
|
172711
|
+
path,
|
|
172712
|
+
variables: parse$i(content)
|
|
172713
|
+
};
|
|
172714
|
+
}
|
|
172715
|
+
async function write(file) {
|
|
172716
|
+
await write$1(file.path, stringify$d(file.variables));
|
|
172717
|
+
}
|
|
172718
|
+
|
|
172719
|
+
var dotEnv = /*#__PURE__*/Object.freeze({
|
|
172720
|
+
__proto__: null,
|
|
172721
|
+
DotEnvNotFoundError: DotEnvNotFoundError,
|
|
172722
|
+
read: read,
|
|
172723
|
+
write: write
|
|
172724
|
+
});
|
|
172725
|
+
|
|
172641
172726
|
const TUNNEL_PLUGINS = ["@shopify/plugin-ngrok"];
|
|
172642
172727
|
async function lookupTunnelPlugin(plugins) {
|
|
172643
172728
|
const tunnelPlugin = plugins.find((plugin) => TUNNEL_PLUGINS.includes(plugin.name));
|
|
@@ -172652,5 +172737,5 @@ var plugins = /*#__PURE__*/Object.freeze({
|
|
|
172652
172737
|
lookupTunnelPlugin: lookupTunnelPlugin
|
|
172653
172738
|
});
|
|
172654
172739
|
|
|
172655
|
-
export { npm as A, port as B, cli as C, id as D, temporary as E, FormData$3 as F, constants$2 as
|
|
172656
|
-
//# sourceMappingURL=index-
|
|
172740
|
+
export { npm as A, port as B, cli as C, id as D, temporary as E, FormData$3 as F, dotEnv as G, constants$2 as H, plugins as I, File$1 as a, string as b, github as c, dependency as d, error$j as e, file$1 as f, git as g, os$2 as h, environment as i, session as j, schema$2 as k, toml as l, store as m, api as n, output as o, path$w as p, http$2 as q, archiver as r, system as s, template as t, ui as u, version as v, checksum as w, ruby as x, yaml as y, semver as z };
|
|
172741
|
+
//# sourceMappingURL=index-9ce018b5.js.map
|