@shopify/create-app 3.87.3 → 3.88.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.
@@ -20,7 +20,7 @@ import {
20
20
  runWithTimer,
21
21
  unixFileIsOwnedByCurrentUser,
22
22
  writeFile
23
- } from "./chunk-2SWESFU5.js";
23
+ } from "./chunk-A7JDI77V.js";
24
24
  import {
25
25
  require_semver
26
26
  } from "./chunk-V7OWCSFT.js";
@@ -13996,4 +13996,4 @@ deep-extend/lib/deep-extend.js:
13996
13996
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13997
13997
  *)
13998
13998
  */
13999
- //# sourceMappingURL=chunk-OXYDAOM4.js.map
13999
+ //# sourceMappingURL=chunk-A2L5D2KD.js.map
@@ -23316,6 +23316,7 @@ var environmentVariables = {
23316
23316
  themeKitAccessDomain: "SHOPIFY_CLI_THEME_KIT_ACCESS_DOMAIN",
23317
23317
  json: "SHOPIFY_FLAG_JSON",
23318
23318
  neverUsePartnersApi: "SHOPIFY_CLI_NEVER_USE_PARTNERS_API",
23319
+ usePartnersApi: "SHOPIFY_CLI_USE_PARTNERS_API",
23319
23320
  skipNetworkLevelRetry: "SHOPIFY_CLI_SKIP_NETWORK_LEVEL_RETRY",
23320
23321
  maxRequestTimeForNetworkCalls: "SHOPIFY_CLI_MAX_REQUEST_TIME_FOR_NETWORK_CALLS"
23321
23322
  }, defaultThemeKitAccessDomain = "theme-kit-access.shopifyapps.com", systemEnvironmentVariables = {
@@ -23388,7 +23389,7 @@ function createRuntimeMetadataContainer(defaultPublicMetadata = {}) {
23388
23389
  try {
23389
23390
  await getAndSet();
23390
23391
  } catch (error) {
23391
- let { sendErrorToBugsnag } = await import("./error-handler-SBUDIQRB.js");
23392
+ let { sendErrorToBugsnag } = await import("./error-handler-43X263AM.js");
23392
23393
  await sendErrorToBugsnag(error, "unexpected_error");
23393
23394
  }
23394
23395
  }, durationStack = [];
@@ -28222,6 +28223,22 @@ function normalizeDelimitedString(delimitedString, delimiter2 = ",") {
28222
28223
  let sortedItems = delimitedString.split(delimiter2).map((value) => value.trim()).filter((value) => value !== "").sort();
28223
28224
  return [...new Set(sortedItems)].join(delimiter2);
28224
28225
  }
28226
+ function timeAgo(from, to) {
28227
+ let seconds = Math.floor((to.getTime() - from.getTime()) / 1e3);
28228
+ if (seconds < 60)
28229
+ return `${formatTimeUnit(seconds, "second")} ago`;
28230
+ let minutes = Math.floor(seconds / 60);
28231
+ if (minutes < 60)
28232
+ return `${formatTimeUnit(minutes, "minute")} ago`;
28233
+ let hours = Math.floor(minutes / 60);
28234
+ if (hours < 24)
28235
+ return `${formatTimeUnit(hours, "hour")} ago`;
28236
+ let days = Math.floor(hours / 24);
28237
+ return `${formatTimeUnit(days, "day")} ago`;
28238
+ }
28239
+ function formatTimeUnit(count, unit) {
28240
+ return `${count} ${unit}${count === 1 ? "" : "s"}`;
28241
+ }
28225
28242
 
28226
28243
  // ../cli-kit/dist/private/node/ui/components/Prompts/InfoTable.js
28227
28244
  var import_react40 = __toESM(require_react(), 1), InfoTable = ({ table }) => {
@@ -28912,7 +28929,10 @@ function Tasks({ tasks, silent = isUnitTest(), onComplete = noop3, abortSignal,
28912
28929
  }
28913
28930
  }), useExitOnCtrlC();
28914
28931
  let { isAborted } = useAbortSignal(abortSignal);
28915
- return silent ? null : state === TasksState.Loading && !isAborted ? import_react53.default.createElement(LoadingBar, { title: currentTask.title, noColor, noProgressBar }) : null;
28932
+ if (silent)
28933
+ return null;
28934
+ let title = typeof currentTask.title == "string" ? currentTask.title : currentTask.title.value;
28935
+ return state === TasksState.Loading && !isAborted ? import_react53.default.createElement(LoadingBar, { title, noColor, noProgressBar }) : null;
28916
28936
  }
28917
28937
 
28918
28938
  // ../cli-kit/dist/private/node/ui/components/TextPrompt.js
@@ -29054,15 +29074,15 @@ function AutocompletePrompt({ message, choices, infoTable, onSubmit, search, has
29054
29074
  // ../cli-kit/dist/private/node/ui/components/SingleTask.js
29055
29075
  init_cjs_shims();
29056
29076
  var import_react56 = __toESM(require_react(), 1);
29057
- var SingleTask = ({ taskPromise, title, noColor }) => {
29058
- let [isDone, setIsDone] = (0, import_react56.useState)(!1), { exit: unmountInk } = use_app_default();
29077
+ var SingleTask = ({ task, title, onComplete, noColor }) => {
29078
+ let [status, setStatus] = (0, import_react56.useState)(title), [isDone, setIsDone] = (0, import_react56.useState)(!1), { exit: unmountInk } = use_app_default();
29059
29079
  return useExitOnCtrlC(), (0, import_react56.useEffect)(() => {
29060
- taskPromise.then(() => {
29061
- setIsDone(!0), unmountInk();
29080
+ task(setStatus).then((result) => {
29081
+ setIsDone(!0), onComplete?.(result), unmountInk();
29062
29082
  }).catch((error) => {
29063
29083
  setIsDone(!0), unmountInk(error);
29064
29084
  });
29065
- }, [taskPromise, unmountInk]), isDone ? null : import_react56.default.createElement(LoadingBar, { title, noColor });
29085
+ }, [task, unmountInk, onComplete]), isDone ? null : import_react56.default.createElement(LoadingBar, { title: status.value, noColor });
29066
29086
  };
29067
29087
 
29068
29088
  // ../cli-kit/dist/public/node/ui.js
@@ -29155,15 +29175,13 @@ async function renderTasks(tasks, { renderOptions, noProgressBar } = {}) {
29155
29175
  }).catch(reject);
29156
29176
  });
29157
29177
  }
29158
- async function renderSingleTask({ title, taskPromise }, { renderOptions } = {}) {
29159
- let promise = typeof taskPromise == "function" ? taskPromise() : taskPromise, [_renderResult, taskResult] = await Promise.all([
29160
- render2(import_react57.default.createElement(SingleTask, { title, taskPromise: promise }), {
29178
+ async function renderSingleTask({ title, task, renderOptions }) {
29179
+ return new Promise((resolve, reject) => {
29180
+ render2(import_react57.default.createElement(SingleTask, { title, task, onComplete: resolve }), {
29161
29181
  ...renderOptions,
29162
29182
  exitOnCtrlC: !1
29163
- }),
29164
- promise
29165
- ]);
29166
- return taskResult;
29183
+ }).catch(reject);
29184
+ });
29167
29185
  }
29168
29186
  async function renderTextPrompt({ renderOptions, ...props }, uiDebugOptions = defaultUIDebugOptions) {
29169
29187
  return throwInNonTTY({ message: props.message, stdin: renderOptions?.stdin }, uiDebugOptions), runWithTimer("cmd_all_timing_prompts_ms")(async () => {
@@ -30208,6 +30226,7 @@ function makeUsernameFromId(userId) {
30208
30226
 
30209
30227
  // ../cli-kit/dist/public/node/system.js
30210
30228
  var import_which = __toESM(require_lib2(), 1);
30229
+ import { fstatSync } from "fs";
30211
30230
  async function openURL(url) {
30212
30231
  let externalOpen = await import("./open-BHIF7E3E.js");
30213
30232
  try {
@@ -30292,6 +30311,23 @@ function isCI() {
30292
30311
  async function isWsl() {
30293
30312
  return (await import("./is-wsl-YAJ3DFN7.js")).default;
30294
30313
  }
30314
+ function isStdinPiped() {
30315
+ try {
30316
+ let stats = fstatSync(0);
30317
+ return stats.isFIFO() || stats.isFile();
30318
+ } catch {
30319
+ return !1;
30320
+ }
30321
+ }
30322
+ async function readStdinString() {
30323
+ if (!isStdinPiped())
30324
+ return;
30325
+ let data = "";
30326
+ process.stdin.setEncoding("utf8");
30327
+ for await (let chunk of process.stdin)
30328
+ data += String(chunk);
30329
+ return data.trim();
30330
+ }
30295
30331
 
30296
30332
  // ../cli-kit/dist/public/node/version.js
30297
30333
  init_cjs_shims();
@@ -31876,7 +31912,7 @@ minimatch.unescape = unescape2;
31876
31912
  // ../cli-kit/dist/public/node/fs.js
31877
31913
  var import_fast_glob = __toESM(require_out(), 1);
31878
31914
  import { mkdirSync as fsMkdirSync, readFileSync as fsReadFileSync, writeFileSync as fsWriteFileSync, appendFileSync as fsAppendFileSync, statSync as fsStatSync, createReadStream as fsCreateReadStream, createWriteStream as fsCreateWriteStream, constants as fsConstants, existsSync as fsFileExistsSync, unlinkSync as fsUnlinkSync, accessSync, statSync } from "fs";
31879
- import { mkdir as fsMkdir, writeFile as fsWriteFile, readFile as fsReadFile, realpath as fsRealPath, appendFile as fsAppendFile, mkdtemp as fsMkdtemp, stat as fsStat, lstat as fsLstat, chmod as fsChmod, access as fsAccess, rename as fsRename, unlink as fsUnlink, readdir as fsReaddir } from "fs/promises";
31915
+ import { mkdir as fsMkdir, writeFile as fsWriteFile, readFile as fsReadFile, realpath as fsRealPath, appendFile as fsAppendFile, mkdtemp as fsMkdtemp, stat as fsStat, lstat as fsLstat, chmod as fsChmod, access as fsAccess, rename as fsRename, unlink as fsUnlink, readdir as fsReaddir, symlink as fsSymlink } from "fs/promises";
31880
31916
  async function inTemporaryDirectory(callback) {
31881
31917
  return temporaryDirectoryTask(callback);
31882
31918
  }
@@ -31917,6 +31953,15 @@ async function mkdir(path8) {
31917
31953
  async function removeFile(path8) {
31918
31954
  outputDebug(outputContent`Removing file at ${outputToken.path(path8)}...`), await remove(path8);
31919
31955
  }
31956
+ async function symlink(target, path8) {
31957
+ outputDebug(outputContent`Creating symbolic link from ${outputToken.path(path8)} to ${outputToken.path(target)}...`);
31958
+ let type = "file";
31959
+ try {
31960
+ (await fsLstat(target)).isDirectory() && (type = "junction");
31961
+ } catch {
31962
+ }
31963
+ await fsSymlink(target, path8, type);
31964
+ }
31920
31965
  function removeFileSync(path8) {
31921
31966
  outputDebug(outputContent`Sync-removing file at ${outputToken.path(path8)}...`), removeSync(path8);
31922
31967
  }
@@ -32016,17 +32061,6 @@ function matchGlob(key, pattern, options) {
32016
32061
  function readdir(path8) {
32017
32062
  return fsReaddir(path8);
32018
32063
  }
32019
- async function copyDirectoryContents(srcDir, destDir) {
32020
- if (!await fileExists(srcDir))
32021
- throw new Error(`Source directory ${srcDir} does not exist`);
32022
- await fileExists(destDir) || await mkdir(destDir);
32023
- let items = await glob(joinPath(srcDir, "**/*")), filesToCopy = [];
32024
- for (let item of items) {
32025
- let relativePath = item.replace(srcDir, "").replace(/^[/\\]/, ""), destPath = joinPath(destDir, relativePath);
32026
- filesToCopy.push(copyFile(item, destPath));
32027
- }
32028
- await Promise.all(filesToCopy);
32029
- }
32030
32064
 
32031
32065
  // ../../node_modules/.pnpm/is-interactive@2.0.0/node_modules/is-interactive/index.js
32032
32066
  init_cjs_shims();
@@ -32192,6 +32226,7 @@ export {
32192
32226
  joinWithAnd,
32193
32227
  pascalize,
32194
32228
  normalizeDelimitedString,
32229
+ timeAgo,
32195
32230
  inTemporaryDirectory,
32196
32231
  tempDirectory,
32197
32232
  readFile,
@@ -32204,6 +32239,7 @@ export {
32204
32239
  writeFileSync,
32205
32240
  mkdir,
32206
32241
  removeFile,
32242
+ symlink,
32207
32243
  removeFileSync,
32208
32244
  rmdir,
32209
32245
  isDirectory,
@@ -32226,7 +32262,6 @@ export {
32226
32262
  findPathUp,
32227
32263
  matchGlob,
32228
32264
  readdir,
32229
- copyDirectoryContents,
32230
32265
  treeKill,
32231
32266
  mimicFunction,
32232
32267
  require_signal_exit,
@@ -32242,6 +32277,7 @@ export {
32242
32277
  terminalSupportsPrompting,
32243
32278
  isCI,
32244
32279
  isWsl,
32280
+ readStdinString,
32245
32281
  isTerminalInteractive,
32246
32282
  homeDirectory,
32247
32283
  isDevelopment,
@@ -32433,4 +32469,4 @@ react-reconciler/cjs/react-reconciler-constants.development.js:
32433
32469
  * LICENSE file in the root directory of this source tree.
32434
32470
  *)
32435
32471
  */
32436
- //# sourceMappingURL=chunk-2SWESFU5.js.map
32472
+ //# sourceMappingURL=chunk-A7JDI77V.js.map
@@ -1,15 +1,13 @@
1
1
  import {
2
+ getNextDeprecationDate,
2
3
  reportAnalyticsEvent
3
- } from "./chunk-3VUX6VKH.js";
4
- import {
5
- getNextDeprecationDate
6
- } from "./chunk-C3EWWAOH.js";
4
+ } from "./chunk-H6G7CAS4.js";
7
5
  import {
8
6
  addSensitiveMetadata,
9
7
  getAllSensitiveMetadata,
10
8
  outputDebug,
11
9
  renderWarning
12
- } from "./chunk-2SWESFU5.js";
10
+ } from "./chunk-A7JDI77V.js";
13
11
  import {
14
12
  init_cjs_shims
15
13
  } from "./chunk-PKR7KJ6P.js";
@@ -77,4 +75,4 @@ export {
77
75
  postRunHookHasCompleted,
78
76
  hook
79
77
  };
80
- //# sourceMappingURL=chunk-UFFIEAAT.js.map
78
+ //# sourceMappingURL=chunk-CSQ7GXTB.js.map