@shopify/cli-kit 3.20.1 → 3.22.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.
Files changed (146) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/analytics.d.ts +2 -2
  3. package/dist/analytics.js +3 -3
  4. package/dist/analytics.js.map +1 -1
  5. package/dist/api/graphql/extension_specifications.d.ts +15 -12
  6. package/dist/api/graphql/extension_specifications.js +2 -0
  7. package/dist/api/graphql/extension_specifications.js.map +1 -1
  8. package/dist/constants.d.ts +0 -2
  9. package/dist/constants.js +0 -2
  10. package/dist/constants.js.map +1 -1
  11. package/dist/content-tokens.js +1 -1
  12. package/dist/content-tokens.js.map +1 -1
  13. package/dist/environment/local.d.ts +0 -2
  14. package/dist/environment/local.js +0 -6
  15. package/dist/environment/local.js.map +1 -1
  16. package/dist/error.d.ts +9 -0
  17. package/dist/error.js +11 -0
  18. package/dist/error.js.map +1 -1
  19. package/dist/index.d.ts +0 -2
  20. package/dist/index.js +0 -2
  21. package/dist/index.js.map +1 -1
  22. package/dist/log.d.ts +11 -2
  23. package/dist/log.js +39 -16
  24. package/dist/log.js.map +1 -1
  25. package/dist/metadata.js +1 -1
  26. package/dist/metadata.js.map +1 -1
  27. package/dist/output.d.ts +1 -1
  28. package/dist/output.js +1 -1
  29. package/dist/output.js.map +1 -1
  30. package/dist/plugins.d.ts +9 -6
  31. package/dist/plugins.js +11 -6
  32. package/dist/plugins.js.map +1 -1
  33. package/dist/private/node/ui/components/Alert.d.ts +1 -1
  34. package/dist/private/node/ui/components/Alert.js.map +1 -1
  35. package/dist/private/node/ui/components/Banner.d.ts +1 -1
  36. package/dist/private/node/ui/components/Banner.js +25 -2
  37. package/dist/private/node/ui/components/Banner.js.map +1 -1
  38. package/dist/private/node/ui/components/Command.js +4 -1
  39. package/dist/private/node/ui/components/Command.js.map +1 -1
  40. package/dist/private/node/ui/components/FatalError.js +11 -2
  41. package/dist/private/node/ui/components/FatalError.js.map +1 -1
  42. package/dist/public/common/object.d.ts +10 -0
  43. package/dist/public/common/object.js +17 -0
  44. package/dist/public/common/object.js.map +1 -0
  45. package/dist/public/common/result.d.ts +88 -0
  46. package/dist/public/common/result.js +111 -0
  47. package/dist/public/common/result.js.map +1 -0
  48. package/dist/public/common/string.d.ts +4 -0
  49. package/dist/{haiku.js → public/common/string.js} +9 -18
  50. package/dist/public/common/string.js.map +1 -0
  51. package/dist/{node → public/node}/archiver.d.ts +0 -0
  52. package/dist/{node → public/node}/archiver.js +2 -2
  53. package/dist/public/node/archiver.js.map +1 -0
  54. package/dist/{node → public/node}/base-command.d.ts +0 -0
  55. package/dist/{node → public/node}/base-command.js +8 -6
  56. package/dist/public/node/base-command.js.map +1 -0
  57. package/dist/{node → public/node}/checksum.d.ts +2 -2
  58. package/dist/{node → public/node}/checksum.js +4 -4
  59. package/dist/public/node/checksum.js.map +1 -0
  60. package/dist/{node → public/node}/cli.d.ts +0 -0
  61. package/dist/{node → public/node}/cli.js +7 -7
  62. package/dist/public/node/cli.js.map +1 -0
  63. package/dist/public/node/colors.d.ts +2 -0
  64. package/dist/public/node/colors.js +3 -0
  65. package/dist/public/node/colors.js.map +1 -0
  66. package/dist/{node → public/node}/dot-env.d.ts +2 -2
  67. package/dist/{node → public/node}/dot-env.js +4 -4
  68. package/dist/public/node/dot-env.js.map +1 -0
  69. package/dist/{node → public/node}/error-handler.d.ts +0 -0
  70. package/dist/{node → public/node}/error-handler.js +7 -7
  71. package/dist/public/node/error-handler.js.map +1 -0
  72. package/dist/{node → public/node}/framework.d.ts +0 -0
  73. package/dist/{node → public/node}/framework.js +1 -1
  74. package/dist/public/node/framework.js.map +1 -0
  75. package/dist/public/node/fs.d.ts +14 -0
  76. package/dist/public/node/fs.js +21 -0
  77. package/dist/public/node/fs.js.map +1 -0
  78. package/dist/{node → public/node}/hooks/postrun.d.ts +0 -0
  79. package/dist/{node → public/node}/hooks/postrun.js +2 -2
  80. package/dist/public/node/hooks/postrun.js.map +1 -0
  81. package/dist/{node → public/node}/hooks/prerun.d.ts +0 -0
  82. package/dist/{node → public/node}/hooks/prerun.js +2 -2
  83. package/dist/public/node/hooks/prerun.js.map +1 -0
  84. package/dist/{node → public/node}/node-package-manager.d.ts +3 -3
  85. package/dist/{node → public/node}/node-package-manager.js +9 -9
  86. package/dist/public/node/node-package-manager.js.map +1 -0
  87. package/dist/{plugins → public/node/plugins}/tunnel.d.ts +11 -4
  88. package/dist/public/node/plugins/tunnel.js +19 -0
  89. package/dist/public/node/plugins/tunnel.js.map +1 -0
  90. package/dist/{node → public/node}/ruby.d.ts +1 -1
  91. package/dist/{node → public/node}/ruby.js +9 -9
  92. package/dist/public/node/ruby.js.map +1 -0
  93. package/dist/public/node/ui.d.ts +12 -12
  94. package/dist/public/node/ui.js +12 -12
  95. package/dist/public/node/ui.js.map +1 -1
  96. package/dist/session/exchange.d.ts +1 -1
  97. package/dist/session/exchange.js +4 -3
  98. package/dist/session/exchange.js.map +1 -1
  99. package/dist/system.js +2 -2
  100. package/dist/system.js.map +1 -1
  101. package/dist/testing/fixtures/render-concurrent.js +1 -1
  102. package/dist/testing/fixtures/render-concurrent.js.map +1 -1
  103. package/dist/testing/ui.js +1 -1
  104. package/dist/testing/ui.js.map +1 -1
  105. package/dist/tsconfig.tsbuildinfo +1 -1
  106. package/dist/ui/inquirer/autocomplete.js +1 -2
  107. package/dist/ui/inquirer/autocomplete.js.map +1 -1
  108. package/dist/ui/inquirer/input.js +1 -2
  109. package/dist/ui/inquirer/input.js.map +1 -1
  110. package/dist/ui/inquirer/select.js +0 -1
  111. package/dist/ui/inquirer/select.js.map +1 -1
  112. package/dist/ui.js +1 -1
  113. package/dist/ui.js.map +1 -1
  114. package/dist/version.js +1 -1
  115. package/dist/version.js.map +1 -1
  116. package/package.json +4 -26
  117. package/dist/common/object.d.ts +0 -8
  118. package/dist/common/object.js +0 -12
  119. package/dist/common/object.js.map +0 -1
  120. package/dist/common/result.d.ts +0 -17
  121. package/dist/common/result.js +0 -31
  122. package/dist/common/result.js.map +0 -1
  123. package/dist/haiku.d.ts +0 -6
  124. package/dist/haiku.js.map +0 -1
  125. package/dist/node/archiver.js.map +0 -1
  126. package/dist/node/base-command.js.map +0 -1
  127. package/dist/node/checksum.js.map +0 -1
  128. package/dist/node/cli.js.map +0 -1
  129. package/dist/node/colors.d.ts +0 -2
  130. package/dist/node/colors.js +0 -3
  131. package/dist/node/colors.js.map +0 -1
  132. package/dist/node/dot-env.js.map +0 -1
  133. package/dist/node/error-handler.js.map +0 -1
  134. package/dist/node/framework.js.map +0 -1
  135. package/dist/node/hooks/init.d.ts +0 -2
  136. package/dist/node/hooks/init.js +0 -5
  137. package/dist/node/hooks/init.js.map +0 -1
  138. package/dist/node/hooks/postrun.js.map +0 -1
  139. package/dist/node/hooks/prerun.js.map +0 -1
  140. package/dist/node/node-package-manager.js.map +0 -1
  141. package/dist/node/ruby.js.map +0 -1
  142. package/dist/plugins/tunnel.js +0 -11
  143. package/dist/plugins/tunnel.js.map +0 -1
  144. package/dist/yaml.d.ts +0 -2
  145. package/dist/yaml.js +0 -8
  146. package/dist/yaml.js.map +0 -1
package/dist/system.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { shouldDisplayColors, debug } from './output.js';
2
2
  import { platformAndArch } from './os.js';
3
- import { Abort } from './error.js';
3
+ import { ExternalError } from './error.js';
4
4
  import { renderConcurrent } from './public/node/ui.js';
5
5
  import { execa } from 'execa';
6
6
  export const open = async (url) => {
@@ -33,7 +33,7 @@ export const exec = async (command, args, options) => {
33
33
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
34
  }
35
35
  catch (processError) {
36
- const abortError = new Abort(processError.message);
36
+ const abortError = new ExternalError(processError.message, command, args);
37
37
  abortError.stack = processError.stack;
38
38
  throw abortError;
39
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"system.js","sourceRoot":"","sources":["../src/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAE,KAA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E,IAAI,GAAG,OAAO,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import {shouldDisplayColors, debug} from './output.js'\nimport {platformAndArch} from './os.js'\nimport {Abort} from './error.js'\nimport {renderConcurrent} from './public/node/ui.js'\nimport {execa, ExecaChildProcess} from 'execa'\nimport {AbortSignal} from 'abort-controller'\nimport type {Writable, Readable} from 'node:stream'\n\nexport interface ExecOptions {\n cwd?: string\n env?: {[key: string]: string | undefined}\n stdin?: Readable | 'inherit'\n stdout?: Writable | 'inherit'\n stderr?: Writable | 'inherit'\n stdio?: 'inherit'\n input?: string\n signal?: AbortSignal\n}\nexport type WritableExecOptions = Omit<ExecOptions, 'stdout'> & {stdout?: Writable}\n\nexport const open = async (url: string) => {\n const externalOpen = await import('open')\n await externalOpen.default(url)\n}\n\n/**\n * Runs a command asynchronously, aggregates the stdout data, and returns it.\n * @param command - Command to be executed.\n * @param args - Arguments to pass to the command.\n * @returns A promise that resolves with the aggregatted stdout of the command.\n */\nexport const captureOutput = async (command: string, args: string[], options?: ExecOptions): Promise<string> => {\n const result = await buildExec(command, args, options)\n return result.stdout\n}\n\nexport const exec = async (command: string, args: string[], options?: ExecOptions) => {\n const commandProcess = buildExec(command, args, options)\n if (options?.stderr && options.stderr !== 'inherit') {\n commandProcess.stderr?.pipe(options.stderr)\n }\n if (options?.stdout && options.stdout !== 'inherit') {\n commandProcess.stdout?.pipe(options.stdout)\n }\n options?.signal?.addEventListener('abort', () => {\n commandProcess.kill('SIGTERM', {forceKillAfterTimeout: 1000})\n })\n try {\n await commandProcess\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (processError: any) {\n const abortError = new Abort(processError.message)\n abortError.stack = processError.stack\n throw abortError\n }\n}\n\nconst buildExec = (command: string, args: string[], options?: ExecOptions): ExecaChildProcess<string> => {\n const env = options?.env ?? process.env\n if (shouldDisplayColors()) {\n env.FORCE_COLOR = '1'\n }\n const commandProcess = execa(command, args, {\n env,\n cwd: options?.cwd,\n input: options?.input,\n stdio: options?.stdio,\n stdin: options?.stdin,\n stdout: options?.stdout === 'inherit' ? 'inherit' : undefined,\n stderr: options?.stderr === 'inherit' ? 'inherit' : undefined,\n })\n debug(`\nRunning system process:\n · Command: ${command} ${args.join(' ')}\n · Working directory: ${options?.cwd ?? process.cwd()}\n`)\n return commandProcess\n}\n\ninterface ConcurrentExecCommand {\n prefix: string\n executable: string\n args: string[]\n cwd: string\n}\n\n/**\n * Runs commands concurrently and combines the standard output and error data\n * into a single stream. See {@link renderConcurrent} for more information about\n * the output format.\n *\n * If one of the processes fails, it aborts the running ones and exits with that error.\n * @param commands - Commands to execute.\n */\nexport const concurrentExec = async (commands: ConcurrentExecCommand[]): Promise<void> => {\n await renderConcurrent({\n processes: commands.map((command) => {\n return {\n prefix: command.prefix,\n action: async (stdout, stderr, signal) => {\n await exec(command.executable, command.args, {\n stdout,\n stderr,\n cwd: command.cwd,\n signal,\n })\n },\n }\n }),\n })\n}\n\n/**\n * Displays a large file using the terminal pager set by the user, or a\n * reasonable default for the user's OS:\n *\n * @param filename - The path to the file to be displayed.\n */\nexport async function page(filename: string) {\n let executable: string\n if (process.env.PAGER) {\n executable = process.env.PAGER\n } else if ((await platformAndArch()).platform === 'windows') {\n executable = 'more'\n } else {\n executable = 'less -NR'\n }\n const [command, ...args] = [...executable.split(' '), filename]\n await exec(command, args, {stdout: 'inherit', stdin: 'inherit'})\n}\n\nexport async function sleep(seconds: number) {\n return new Promise((resolve) => {\n setTimeout(resolve, 1000 * seconds)\n })\n}\n"]}
1
+ {"version":3,"file":"system.js","sourceRoot":"","sources":["../src/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AACtD,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AACvC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAA;AACxC,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,C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BACL,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;oBACvC,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE;wBAC3C,MAAM;wBACN,MAAM;wBACN,GAAG,EAAE,OAAO,CAAC,GAAG;wBAChB,MAAM;qBACP,CAAC,CAAA;gBACJ,CAAC;aACF,CAAA;QACH,CAAC,CAAC;KACH,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,QAAgB;IACzC,IAAI,UAAkB,CAAA;IACtB,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE;QACrB,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA;KAC/B;SAAM,IAAI,CAAC,MAAM,eAAe,EAAE,CAAC,CAAC,QAAQ,KAAK,SAAS,EAAE;QAC3D,UAAU,GAAG,MAAM,CAAA;KACpB;SAAM;QACL,UAAU,GAAG,UAAU,CAAA;KACxB;IACD,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAA;IAC/D,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,EAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,CAAA;AAClE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,OAAe;IACzC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,UAAU,CAAC,OAAO,EAAE,IAAI,GAAG,OAAO,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import {shouldDisplayColors, debug} from './output.js'\nimport {platformAndArch} from './os.js'\nimport {ExternalError} from './error.js'\nimport {renderConcurrent} from './public/node/ui.js'\nimport {execa, ExecaChildProcess} from 'execa'\nimport {AbortSignal} from 'abort-controller'\nimport type {Writable, Readable} from 'node:stream'\n\nexport interface ExecOptions {\n cwd?: string\n env?: {[key: string]: string | undefined}\n stdin?: Readable | 'inherit'\n stdout?: Writable | 'inherit'\n stderr?: Writable | 'inherit'\n stdio?: 'inherit'\n input?: string\n signal?: AbortSignal\n}\nexport type WritableExecOptions = Omit<ExecOptions, 'stdout'> & {stdout?: Writable}\n\nexport const open = async (url: string) => {\n const externalOpen = await import('open')\n await externalOpen.default(url)\n}\n\n/**\n * Runs a command asynchronously, aggregates the stdout data, and returns it.\n * @param command - Command to be executed.\n * @param args - Arguments to pass to the command.\n * @returns A promise that resolves with the aggregatted stdout of the command.\n */\nexport const captureOutput = async (command: string, args: string[], options?: ExecOptions): Promise<string> => {\n const result = await buildExec(command, args, options)\n return result.stdout\n}\n\nexport const exec = async (command: string, args: string[], options?: ExecOptions) => {\n const commandProcess = buildExec(command, args, options)\n if (options?.stderr && options.stderr !== 'inherit') {\n commandProcess.stderr?.pipe(options.stderr)\n }\n if (options?.stdout && options.stdout !== 'inherit') {\n commandProcess.stdout?.pipe(options.stdout)\n }\n options?.signal?.addEventListener('abort', () => {\n commandProcess.kill('SIGTERM', {forceKillAfterTimeout: 1000})\n })\n try {\n await commandProcess\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (processError: any) {\n const abortError = new ExternalError(processError.message, command, args)\n abortError.stack = processError.stack\n throw abortError\n }\n}\n\nconst buildExec = (command: string, args: string[], options?: ExecOptions): ExecaChildProcess<string> => {\n const env = options?.env ?? process.env\n if (shouldDisplayColors()) {\n env.FORCE_COLOR = '1'\n }\n const commandProcess = execa(command, args, {\n env,\n cwd: options?.cwd,\n input: options?.input,\n stdio: options?.stdio,\n stdin: options?.stdin,\n stdout: options?.stdout === 'inherit' ? 'inherit' : undefined,\n stderr: options?.stderr === 'inherit' ? 'inherit' : undefined,\n })\n debug(`\nRunning system process:\n · Command: ${command} ${args.join(' ')}\n · Working directory: ${options?.cwd ?? process.cwd()}\n`)\n return commandProcess\n}\n\ninterface ConcurrentExecCommand {\n prefix: string\n executable: string\n args: string[]\n cwd: string\n}\n\n/**\n * Runs commands concurrently and combines the standard output and error data\n * into a single stream. See {@link renderConcurrent} for more information about\n * the output format.\n *\n * If one of the processes fails, it aborts the running ones and exits with that error.\n * @param commands - Commands to execute.\n */\nexport const concurrentExec = async (commands: ConcurrentExecCommand[]): Promise<void> => {\n await renderConcurrent({\n processes: commands.map((command) => {\n return {\n prefix: command.prefix,\n action: async (stdout, stderr, signal) => {\n await exec(command.executable, command.args, {\n stdout,\n stderr,\n cwd: command.cwd,\n signal,\n })\n },\n }\n }),\n })\n}\n\n/**\n * Displays a large file using the terminal pager set by the user, or a\n * reasonable default for the user's OS:\n *\n * @param filename - The path to the file to be displayed.\n */\nexport async function page(filename: string) {\n let executable: string\n if (process.env.PAGER) {\n executable = process.env.PAGER\n } else if ((await platformAndArch()).platform === 'windows') {\n executable = 'more'\n } else {\n executable = 'less -NR'\n }\n const [command, ...args] = [...executable.split(' '), filename]\n await exec(command, args, {stdout: 'inherit', stdin: 'inherit'})\n}\n\nexport async function sleep(seconds: number) {\n return new Promise((resolve) => {\n setTimeout(resolve, 1000 * seconds)\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { renderConcurrent } from '@shopify/cli-kit/node/ui';
1
+ import { renderConcurrent } from '../../public/node/ui.js';
2
2
  let backendPromiseResolve;
3
3
  const backendPromise = new Promise(function (resolve, _reject) {
4
4
  backendPromiseResolve = resolve;
@@ -1 +1 @@
1
- {"version":3,"file":"render-concurrent.js","sourceRoot":"","sources":["../../../src/testing/fixtures/render-concurrent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAA;AAEzD,IAAI,qBAAiC,CAAA;AAErC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAO,UAAU,OAAO,EAAE,OAAO;IACjE,qBAAqB,GAAG,OAAO,CAAA;AACjC,CAAC,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,KAAK,EAAE,MAAgB,EAAE,OAAiB,EAAE,OAAe,EAAE,EAAE;QACrE,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;QACrC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;QACtC,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;QAErC,qBAAqB,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAED,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,KAAK,EAAE,MAAgB,EAAE,OAAiB,EAAE,OAAe,EAAE,EAAE;QACrE,MAAM,cAAc,CAAA;QAEpB,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;QACtC,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;QACvC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;IACxC,CAAC;CACF,CAAA;AAED,mEAAmE;AACnE,gBAAgB,CAAC,EAAC,SAAS,EAAE,CAAC,cAAc,EAAE,eAAe,CAAC,EAAC,CAAC,CAAA","sourcesContent":["import {Signal} from '../../abort.js'\nimport {Writable} from 'form-data'\nimport {renderConcurrent} from '@shopify/cli-kit/node/ui'\n\nlet backendPromiseResolve: () => void\n\nconst backendPromise = new Promise<void>(function (resolve, _reject) {\n backendPromiseResolve = resolve\n})\n\nconst backendProcess = {\n prefix: 'backend',\n action: async (stdout: Writable, _stderr: Writable, _signal: Signal) => {\n stdout.write('first backend message')\n stdout.write('second backend message')\n stdout.write('third backend message')\n\n backendPromiseResolve()\n },\n}\n\nconst frontendProcess = {\n prefix: 'frontend',\n action: async (stdout: Writable, _stderr: Writable, _signal: Signal) => {\n await backendPromise\n\n stdout.write('first frontend message')\n stdout.write('second frontend message')\n stdout.write('third frontend message')\n },\n}\n\n// eslint-disable-next-line @typescript-eslint/no-floating-promises\nrenderConcurrent({processes: [backendProcess, frontendProcess]})\n"]}
1
+ {"version":3,"file":"render-concurrent.js","sourceRoot":"","sources":["../../../src/testing/fixtures/render-concurrent.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAA;AAGxD,IAAI,qBAAiC,CAAA;AAErC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAO,UAAU,OAAO,EAAE,OAAO;IACjE,qBAAqB,GAAG,OAAO,CAAA;AACjC,CAAC,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,KAAK,EAAE,MAAgB,EAAE,OAAiB,EAAE,OAAe,EAAE,EAAE;QACrE,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;QACrC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;QACtC,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;QAErC,qBAAqB,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAED,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,KAAK,EAAE,MAAgB,EAAE,OAAiB,EAAE,OAAe,EAAE,EAAE;QACrE,MAAM,cAAc,CAAA;QAEpB,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;QACtC,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;QACvC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;IACxC,CAAC;CACF,CAAA;AAED,mEAAmE;AACnE,gBAAgB,CAAC,EAAC,SAAS,EAAE,CAAC,cAAc,EAAE,eAAe,CAAC,EAAC,CAAC,CAAA","sourcesContent":["import {Signal} from '../../abort.js'\nimport {renderConcurrent} from '../../public/node/ui.js'\nimport {Writable} from 'form-data'\n\nlet backendPromiseResolve: () => void\n\nconst backendPromise = new Promise<void>(function (resolve, _reject) {\n backendPromiseResolve = resolve\n})\n\nconst backendProcess = {\n prefix: 'backend',\n action: async (stdout: Writable, _stderr: Writable, _signal: Signal) => {\n stdout.write('first backend message')\n stdout.write('second backend message')\n stdout.write('third backend message')\n\n backendPromiseResolve()\n },\n}\n\nconst frontendProcess = {\n prefix: 'frontend',\n action: async (stdout: Writable, _stderr: Writable, _signal: Signal) => {\n await backendPromise\n\n stdout.write('first frontend message')\n stdout.write('second frontend message')\n stdout.write('third frontend message')\n },\n}\n\n// eslint-disable-next-line @typescript-eslint/no-floating-promises\nrenderConcurrent({processes: [backendProcess, frontendProcess]})\n"]}
@@ -1,4 +1,4 @@
1
- import * as path from '../path';
1
+ import * as path from '../path.js';
2
2
  import { execaNode } from 'execa';
3
3
  export const run = (fixture, props) => {
4
4
  const env = {
@@ -1 +1 @@
1
- {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/testing/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAoB,SAAS,EAAC,MAAM,OAAO,CAAA;AAIlD,MAAM,CAAC,MAAM,GAAG,GAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;IACzC,MAAM,GAAG,GAAG;QACV,GAAG,OAAO,CAAC,GAAG;QACd,GAAG,KAAK,EAAE,GAAG;QACb,iEAAiE;QACjE,sDAAsD;QACtD,6DAA6D;QAC7D,8CAA8C;QAC9C,EAAE,EAAE,MAAM;KACX,CAAA;IAED,oFAAoF;IACpF,OAAO,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,+BAA+B,OAAO,KAAK,CAAC,EAAE;QACrF,GAAG,EAAE,SAAS;QACd,GAAG;KACJ,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import * as path from '../path'\nimport {ExecaChildProcess, execaNode} from 'execa'\n\ntype Run = (fixture: string, props?: {env?: {[key: string]: unknown}}) => ExecaChildProcess<string>\n\nexport const run: Run = (fixture, props) => {\n const env = {\n ...process.env,\n ...props?.env,\n // we need this because ink treats the CI environment differently\n // by only writing the last frame to stdout on unmount\n // See more here https://github.com/vadimdemedes/ink/pull/266\n // this way local and CI tests behave the same\n CI: 'true',\n }\n\n // we want to load the compiled js directly in order avoid unnecessary transpilation\n return execaNode(path.resolve(__dirname, `../../dist/testing/fixtures/${fixture}.js`), {\n cwd: __dirname,\n env,\n })\n}\n"]}
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/testing/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAA;AAClC,OAAO,EAAoB,SAAS,EAAC,MAAM,OAAO,CAAA;AAIlD,MAAM,CAAC,MAAM,GAAG,GAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;IACzC,MAAM,GAAG,GAAG;QACV,GAAG,OAAO,CAAC,GAAG;QACd,GAAG,KAAK,EAAE,GAAG;QACb,iEAAiE;QACjE,sDAAsD;QACtD,6DAA6D;QAC7D,8CAA8C;QAC9C,EAAE,EAAE,MAAM;KACX,CAAA;IAED,oFAAoF;IACpF,OAAO,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,+BAA+B,OAAO,KAAK,CAAC,EAAE;QACrF,GAAG,EAAE,SAAS;QACd,GAAG;KACJ,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import * as path from '../path.js'\nimport {ExecaChildProcess, execaNode} from 'execa'\n\ntype Run = (fixture: string, props?: {env?: {[key: string]: unknown}}) => ExecaChildProcess<string>\n\nexport const run: Run = (fixture, props) => {\n const env = {\n ...process.env,\n ...props?.env,\n // we need this because ink treats the CI environment differently\n // by only writing the last frame to stdout on unmount\n // See more here https://github.com/vadimdemedes/ink/pull/266\n // this way local and CI tests behave the same\n CI: 'true',\n }\n\n // we want to load the compiled js directly in order avoid unnecessary transpilation\n return execaNode(path.resolve(__dirname, `../../dist/testing/fixtures/${fixture}.js`), {\n cwd: __dirname,\n env,\n })\n}\n"]}