@shopify/create-app 1.0.2 → 1.0.6

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