@shopify/create-app 1.0.2 → 1.0.4
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 +6 -0
- package/dist/commands/init.js +96 -45
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +27 -11
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/commands/init.js
CHANGED
|
@@ -5,6 +5,7 @@ import require$$1$2, { EOL, constants as constants$8 } from 'os';
|
|
|
5
5
|
import require$$0$5, { Readable as Readable$3, Writable as Writable$1 } from 'stream';
|
|
6
6
|
import * as tty$1 from 'tty';
|
|
7
7
|
import tty__default from 'tty';
|
|
8
|
+
import Stream$4 from 'node:stream';
|
|
8
9
|
import { Buffer as Buffer$1 } from 'node:buffer';
|
|
9
10
|
import path$D from 'node:path';
|
|
10
11
|
import childProcess from 'node:child_process';
|
|
@@ -18,7 +19,6 @@ import require$$0$a from 'buffer';
|
|
|
18
19
|
import require$$0$9, { promisify as promisify$6 } from 'util';
|
|
19
20
|
import fs$H, { promises } from 'node:fs';
|
|
20
21
|
import require$$0$b from 'constants';
|
|
21
|
-
import Stream$4 from 'node:stream';
|
|
22
22
|
import { promisify as promisify$7 } from 'node:util';
|
|
23
23
|
import crypto$1 from 'crypto';
|
|
24
24
|
import http$2 from 'http';
|
|
@@ -29,6 +29,7 @@ import zlib$1 from 'zlib';
|
|
|
29
29
|
import require$$0$d from 'http2';
|
|
30
30
|
import require$$1$3 from 'tls';
|
|
31
31
|
import require$$0$e from 'net';
|
|
32
|
+
import 'ngrok';
|
|
32
33
|
import require$$0$f from 'punycode';
|
|
33
34
|
import { Flags, Command } from '@oclif/core';
|
|
34
35
|
|
|
@@ -12880,7 +12881,8 @@ function execa(file, args, options) {
|
|
|
12880
12881
|
|
|
12881
12882
|
const exec = (command, args, options) => {
|
|
12882
12883
|
const commandProcess = execa(command, args, {
|
|
12883
|
-
cwd: options?.cwd
|
|
12884
|
+
cwd: options?.cwd,
|
|
12885
|
+
env: options?.env ?? process.env
|
|
12884
12886
|
});
|
|
12885
12887
|
if (options?.stderr) {
|
|
12886
12888
|
commandProcess.stderr?.pipe(options.stderr);
|
|
@@ -24561,6 +24563,17 @@ async function isDirectory(path) {
|
|
|
24561
24563
|
async function move(src, dest, options = {}) {
|
|
24562
24564
|
await lib$2.move(src, dest, options);
|
|
24563
24565
|
}
|
|
24566
|
+
async function chmod(path, mode) {
|
|
24567
|
+
await lib$2.promises.chmod(path, mode);
|
|
24568
|
+
}
|
|
24569
|
+
async function hasExecutablePermissions(path) {
|
|
24570
|
+
try {
|
|
24571
|
+
await lib$2.promises.access(path, lib$2.constants.X_OK);
|
|
24572
|
+
return true;
|
|
24573
|
+
} catch {
|
|
24574
|
+
return false;
|
|
24575
|
+
}
|
|
24576
|
+
}
|
|
24564
24577
|
|
|
24565
24578
|
/*
|
|
24566
24579
|
* liquidjs@9.36.0, https://github.com/harttle/liquidjs
|
|
@@ -29011,8 +29024,13 @@ async function recursiveDirectoryCopy(from, to, data) {
|
|
|
29011
29024
|
await mkdir(dirname$1(outputPath));
|
|
29012
29025
|
const content = await read(templateItemPath);
|
|
29013
29026
|
const contentOutput = await create$1(content)(data);
|
|
29014
|
-
await
|
|
29015
|
-
|
|
29027
|
+
const isExecutable = await hasExecutablePermissions(templateItemPath);
|
|
29028
|
+
const outputPathWithoutLiquid = outputPath.replace(".liquid", "");
|
|
29029
|
+
await copy(templateItemPath, outputPathWithoutLiquid);
|
|
29030
|
+
await write(outputPathWithoutLiquid, contentOutput);
|
|
29031
|
+
if (isExecutable) {
|
|
29032
|
+
await chmod(outputPathWithoutLiquid, 493);
|
|
29033
|
+
}
|
|
29016
29034
|
} else {
|
|
29017
29035
|
await copy(templateItemPath, outputPath);
|
|
29018
29036
|
}
|
|
@@ -29420,7 +29438,7 @@ function setup(env) {
|
|
|
29420
29438
|
namespaces = split[i].replace(/\*/g, '.*?');
|
|
29421
29439
|
|
|
29422
29440
|
if (namespaces[0] === '-') {
|
|
29423
|
-
createDebug.skips.push(new RegExp('^' + namespaces.
|
|
29441
|
+
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
|
29424
29442
|
} else {
|
|
29425
29443
|
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
29426
29444
|
}
|
|
@@ -33842,8 +33860,8 @@ function dependencyManagerUsedForCreating(env = process.env) {
|
|
|
33842
33860
|
return "npm" /* Npm */;
|
|
33843
33861
|
}
|
|
33844
33862
|
}
|
|
33845
|
-
async function install(directory, dependencyManager2, stdout) {
|
|
33846
|
-
const options = { cwd: directory, stdout };
|
|
33863
|
+
async function install(directory, dependencyManager2, stdout, stderr) {
|
|
33864
|
+
const options = { cwd: directory, stdout, stderr };
|
|
33847
33865
|
await exec(dependencyManager2, ["install"], options);
|
|
33848
33866
|
}
|
|
33849
33867
|
|
|
@@ -45160,7 +45178,7 @@ const username = async (platform = platform$1) => {
|
|
|
45160
45178
|
};
|
|
45161
45179
|
|
|
45162
45180
|
var name = "@shopify/cli-kit";
|
|
45163
|
-
var version$2 = "1.0.
|
|
45181
|
+
var version$2 = "1.0.4";
|
|
45164
45182
|
var description$1 = "A set of utilities, interfaces, and models that are common across all the platform features";
|
|
45165
45183
|
var keywords = [
|
|
45166
45184
|
"shopify",
|
|
@@ -45208,14 +45226,15 @@ var os$1 = [
|
|
|
45208
45226
|
"win32"
|
|
45209
45227
|
];
|
|
45210
45228
|
var dependencies$1 = {
|
|
45211
|
-
|
|
45212
|
-
|
|
45229
|
+
open: "^8.4.0",
|
|
45230
|
+
ngrok: "^4.3.1",
|
|
45231
|
+
keytar: "^7.9.0"
|
|
45213
45232
|
};
|
|
45214
45233
|
var devDependencies = {
|
|
45215
45234
|
"@iarna/toml": "^2.2.5",
|
|
45216
45235
|
"ansi-colors": "^4.1.1",
|
|
45217
45236
|
"change-case": "^4.1.2",
|
|
45218
|
-
conf: "^10.1.
|
|
45237
|
+
conf: "^10.1.2",
|
|
45219
45238
|
del: "^6.0.0",
|
|
45220
45239
|
enquirer: "^2.3.6",
|
|
45221
45240
|
execa: "^6.0.0",
|
|
@@ -45227,7 +45246,7 @@ var devDependencies = {
|
|
|
45227
45246
|
"graphql-request": "^4.2.0",
|
|
45228
45247
|
"latest-version": "^6.0.0",
|
|
45229
45248
|
liquidjs: "^9.36.0",
|
|
45230
|
-
listr2: "^4.0.
|
|
45249
|
+
listr2: "^4.0.5",
|
|
45231
45250
|
"md5-file": "^5.0.0",
|
|
45232
45251
|
"node-fetch": "^3.2.3",
|
|
45233
45252
|
pathe: "^0.2.0",
|
|
@@ -45235,7 +45254,7 @@ var devDependencies = {
|
|
|
45235
45254
|
tempy: "^2.0.0",
|
|
45236
45255
|
"term-size": "^3.0.1",
|
|
45237
45256
|
"terminal-link": "^3.0.0",
|
|
45238
|
-
vitest: "0.
|
|
45257
|
+
vitest: "0.8.1",
|
|
45239
45258
|
zod: "^3.14.3"
|
|
45240
45259
|
};
|
|
45241
45260
|
var cliKitPackageJson = {
|
|
@@ -45260,9 +45279,9 @@ var cliKitPackageJson = {
|
|
|
45260
45279
|
devDependencies: devDependencies
|
|
45261
45280
|
};
|
|
45262
45281
|
|
|
45263
|
-
var version$1 = "1.0.
|
|
45282
|
+
var version$1 = "1.0.4";
|
|
45264
45283
|
|
|
45265
|
-
var version = "1.0.
|
|
45284
|
+
var version = "1.0.4";
|
|
45266
45285
|
|
|
45267
45286
|
const constants = {
|
|
45268
45287
|
environmentVariables: {
|
|
@@ -157956,6 +157975,17 @@ dist.gql`
|
|
|
157956
157975
|
}
|
|
157957
157976
|
`;
|
|
157958
157977
|
|
|
157978
|
+
dist.gql`
|
|
157979
|
+
mutation appUpdate($apiKey: String!, $appUrl: Url!, $redir: [Url]!) {
|
|
157980
|
+
appUpdate(input: {apiKey: $apiKey, applicationUrl: $appUrl, redirectUrlWhitelist: $redir}) {
|
|
157981
|
+
userErrors {
|
|
157982
|
+
message
|
|
157983
|
+
field
|
|
157984
|
+
}
|
|
157985
|
+
}
|
|
157986
|
+
}
|
|
157987
|
+
`;
|
|
157988
|
+
|
|
157959
157989
|
var md5File$1 = {exports: {}};
|
|
157960
157990
|
|
|
157961
157991
|
const crypto = crypto$1;
|
|
@@ -158027,11 +158057,11 @@ const init$1 = async (options, prompt$1 = prompt) => {
|
|
|
158027
158057
|
name: "template",
|
|
158028
158058
|
choices: ["php", "node", "rails"],
|
|
158029
158059
|
message: "Which template would you like to use?",
|
|
158030
|
-
default: "https://github.com/Shopify/shopify-app-
|
|
158060
|
+
default: "https://github.com/Shopify/shopify-app-node#cli-next"
|
|
158031
158061
|
});
|
|
158032
158062
|
}
|
|
158033
158063
|
const promptOutput = await prompt$1(questions);
|
|
158034
|
-
return { ...options, ...promptOutput, template: "https://github.com/Shopify/shopify-app-
|
|
158064
|
+
return { ...options, ...promptOutput, template: "https://github.com/Shopify/shopify-app-node#cli-next" };
|
|
158035
158065
|
};
|
|
158036
158066
|
|
|
158037
158067
|
async function template(name) {
|
|
@@ -158047,7 +158077,17 @@ async function template(name) {
|
|
|
158047
158077
|
}
|
|
158048
158078
|
|
|
158049
158079
|
async function downloadTemplate({ templateUrl, into }) {
|
|
158050
|
-
|
|
158080
|
+
const components = templateUrl.split("#");
|
|
158081
|
+
let branch;
|
|
158082
|
+
const repository = components[0];
|
|
158083
|
+
if (components.length === 2) {
|
|
158084
|
+
branch = components[1];
|
|
158085
|
+
}
|
|
158086
|
+
const options = { "--recurse-submodules": null };
|
|
158087
|
+
if (branch) {
|
|
158088
|
+
options["--branch"] = branch;
|
|
158089
|
+
}
|
|
158090
|
+
await factory().clone(repository, into, options, (err) => {
|
|
158051
158091
|
if (err) {
|
|
158052
158092
|
throw new Error(err.message);
|
|
158053
158093
|
}
|
|
@@ -158105,7 +158145,6 @@ async function init(options) {
|
|
|
158105
158145
|
const dependencyManager = inferDependencyManager(options.dependencyManager);
|
|
158106
158146
|
const hyphenizedName = paramCase(options.name);
|
|
158107
158147
|
const outputDirectory = join$3(options.directory, hyphenizedName);
|
|
158108
|
-
const homeOutputDirectory = join$3(options.directory, hyphenizedName, "home");
|
|
158109
158148
|
await inTemporaryDirectory(async (tmpDir) => {
|
|
158110
158149
|
const tmpDirApp = join$3(tmpDir, "app");
|
|
158111
158150
|
const tmpDirHome = join$3(tmpDirApp, blocks.home.directoryName);
|
|
@@ -158141,23 +158180,9 @@ async function init(options) {
|
|
|
158141
158180
|
{
|
|
158142
158181
|
title: `Creating home`,
|
|
158143
158182
|
task: async (_, task) => {
|
|
158144
|
-
const hooksPreFilePaths = await out(join$3(
|
|
158145
|
-
const hooksPostFilePaths =
|
|
158183
|
+
const hooksPreFilePaths = await out(join$3(tmpDirDownload, "hooks/pre/*"));
|
|
158184
|
+
const hooksPostFilePaths = await out(join$3(tmpDirDownload, "hooks/post/*"));
|
|
158146
158185
|
return task.newListr([
|
|
158147
|
-
...hooksPreFilePaths.map((hookPath) => {
|
|
158148
|
-
return {
|
|
158149
|
-
title: basename(hookPath),
|
|
158150
|
-
task: async () => {
|
|
158151
|
-
const stdout = new Writable$1({
|
|
158152
|
-
write(chunk, encoding, next) {
|
|
158153
|
-
task.output = chunk.toString();
|
|
158154
|
-
next();
|
|
158155
|
-
}
|
|
158156
|
-
});
|
|
158157
|
-
await exec(hookPath, [], { stdout });
|
|
158158
|
-
}
|
|
158159
|
-
};
|
|
158160
|
-
}),
|
|
158161
158186
|
{
|
|
158162
158187
|
title: "Scaffolding home",
|
|
158163
158188
|
task: async () => {
|
|
@@ -158174,19 +158199,45 @@ async function init(options) {
|
|
|
158174
158199
|
});
|
|
158175
158200
|
}
|
|
158176
158201
|
},
|
|
158177
|
-
...
|
|
158178
|
-
const
|
|
158179
|
-
const hookPath = join$3(tmpDirHome, relativeFilePath);
|
|
158202
|
+
...hooksPreFilePaths.map((sourcePath) => {
|
|
158203
|
+
const hookPath = join$3(tmpDirHome, relative(tmpDirDownload, sourcePath)).replace(".liquid", "");
|
|
158180
158204
|
return {
|
|
158181
158205
|
title: basename(hookPath),
|
|
158182
|
-
task: async () => {
|
|
158183
|
-
new Writable$1({
|
|
158206
|
+
task: async (_2, task2) => {
|
|
158207
|
+
const stdout = new Writable$1({
|
|
158208
|
+
write(chunk, encoding, next) {
|
|
158209
|
+
task2.output = chunk.toString();
|
|
158210
|
+
next();
|
|
158211
|
+
}
|
|
158212
|
+
});
|
|
158213
|
+
const stderr = new Writable$1({
|
|
158214
|
+
write(chunk, encoding, next) {
|
|
158215
|
+
task2.output = chunk.toString();
|
|
158216
|
+
next();
|
|
158217
|
+
}
|
|
158218
|
+
});
|
|
158219
|
+
await exec(hookPath, [], { cwd: tmpDirHome, stdout, stderr });
|
|
158220
|
+
}
|
|
158221
|
+
};
|
|
158222
|
+
}),
|
|
158223
|
+
...hooksPostFilePaths.map((sourcePath) => {
|
|
158224
|
+
const hookPath = join$3(tmpDirHome, relative(tmpDirDownload, sourcePath)).replace(".liquid", "");
|
|
158225
|
+
return {
|
|
158226
|
+
title: basename(hookPath),
|
|
158227
|
+
task: async (_2, task2) => {
|
|
158228
|
+
const stdout = new Writable$1({
|
|
158229
|
+
write(chunk, encoding, next) {
|
|
158230
|
+
task2.output = chunk.toString();
|
|
158231
|
+
next();
|
|
158232
|
+
}
|
|
158233
|
+
});
|
|
158234
|
+
const stderr = new Writable$1({
|
|
158184
158235
|
write(chunk, encoding, next) {
|
|
158185
|
-
|
|
158236
|
+
task2.output = chunk.toString();
|
|
158186
158237
|
next();
|
|
158187
158238
|
}
|
|
158188
158239
|
});
|
|
158189
|
-
await exec(hookPath, []);
|
|
158240
|
+
await exec(hookPath, [], { cwd: tmpDirHome, stdout, stderr });
|
|
158190
158241
|
}
|
|
158191
158242
|
};
|
|
158192
158243
|
}),
|
|
@@ -158202,13 +158253,13 @@ async function init(options) {
|
|
|
158202
158253
|
{
|
|
158203
158254
|
title: `Installing app dependencies with ${dependencyManager}`,
|
|
158204
158255
|
task: async (_, task) => {
|
|
158205
|
-
const
|
|
158256
|
+
const output2 = new Writable$1({
|
|
158206
158257
|
write(chunk, encoding, next) {
|
|
158207
158258
|
task.output = chunk.toString();
|
|
158208
158259
|
next();
|
|
158209
158260
|
}
|
|
158210
158261
|
});
|
|
158211
|
-
await install(tmpDirApp, dependencyManager,
|
|
158262
|
+
await install(tmpDirApp, dependencyManager, output2, output2);
|
|
158212
158263
|
}
|
|
158213
158264
|
}
|
|
158214
158265
|
], { concurrent: false });
|
|
@@ -158271,7 +158322,7 @@ Init.flags = {
|
|
|
158271
158322
|
hidden: false
|
|
158272
158323
|
}),
|
|
158273
158324
|
template: Flags.string({
|
|
158274
|
-
description: "The template for app home. Eg, --template https://github.com/Shopify/shopify-app-
|
|
158325
|
+
description: "The template for app home. Eg, --template https://github.com/Shopify/shopify-app-node",
|
|
158275
158326
|
env: "SHOPIFY_FLAG_TEMPLATE"
|
|
158276
158327
|
}),
|
|
158277
158328
|
"dependency-manager": Flags.string({
|