@shopify/cli-kit 3.24.1 → 3.25.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 (77) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/api/graphql/functions/app_function_set.d.ts +1 -0
  3. package/dist/api/graphql/functions/app_function_set.js +2 -0
  4. package/dist/api/graphql/functions/app_function_set.js.map +1 -1
  5. package/dist/index.d.ts +0 -1
  6. package/dist/index.js +0 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/plugins.d.ts +1 -1
  9. package/dist/plugins.js +1 -1
  10. package/dist/plugins.js.map +1 -1
  11. package/dist/private/node/ui/components/Alert.d.ts +1 -1
  12. package/dist/private/node/ui/components/Alert.js +2 -2
  13. package/dist/private/node/ui/components/Alert.js.map +1 -1
  14. package/dist/private/node/ui/components/Alert.test.d.ts +1 -0
  15. package/dist/private/node/ui/components/Alert.test.js +95 -0
  16. package/dist/private/node/ui/components/Alert.test.js.map +1 -0
  17. package/dist/private/node/ui/components/Banner.js +8 -9
  18. package/dist/private/node/ui/components/Banner.js.map +1 -1
  19. package/dist/private/node/ui/components/Banner.test.d.ts +1 -0
  20. package/dist/private/node/ui/components/Banner.test.js +52 -0
  21. package/dist/private/node/ui/components/Banner.test.js.map +1 -0
  22. package/dist/private/node/ui/components/Command.test.d.ts +1 -0
  23. package/dist/private/node/ui/components/Command.test.js +11 -0
  24. package/dist/private/node/ui/components/Command.test.js.map +1 -0
  25. package/dist/private/node/ui/components/ConcurrentOutput.js +0 -1
  26. package/dist/private/node/ui/components/ConcurrentOutput.js.map +1 -1
  27. package/dist/private/node/ui/components/FatalError.js +1 -1
  28. package/dist/private/node/ui/components/FatalError.js.map +1 -1
  29. package/dist/private/node/ui/components/FatalError.test.d.ts +1 -0
  30. package/dist/private/node/ui/components/FatalError.test.js +119 -0
  31. package/dist/private/node/ui/components/FatalError.test.js.map +1 -0
  32. package/dist/private/node/ui/components/FilePath.d.ts +9 -0
  33. package/dist/private/node/ui/components/FilePath.js +13 -0
  34. package/dist/private/node/ui/components/FilePath.js.map +1 -0
  35. package/dist/private/node/ui/components/FilePath.test.d.ts +1 -0
  36. package/dist/private/node/ui/components/FilePath.test.js +11 -0
  37. package/dist/private/node/ui/components/FilePath.test.js.map +1 -0
  38. package/dist/private/node/ui/components/Link.js +6 -5
  39. package/dist/private/node/ui/components/Link.js.map +1 -1
  40. package/dist/private/node/ui/components/Link.test.d.ts +1 -0
  41. package/dist/private/node/ui/components/Link.test.js +22 -0
  42. package/dist/private/node/ui/components/Link.test.js.map +1 -0
  43. package/dist/private/node/ui/components/List.d.ts +1 -1
  44. package/dist/private/node/ui/components/List.js +2 -2
  45. package/dist/private/node/ui/components/List.js.map +1 -1
  46. package/dist/private/node/ui/components/List.test.d.ts +1 -0
  47. package/dist/private/node/ui/components/List.test.js +34 -0
  48. package/dist/private/node/ui/components/List.test.js.map +1 -0
  49. package/dist/private/node/ui/components/TokenizedText.d.ts +13 -1
  50. package/dist/private/node/ui/components/TokenizedText.js +47 -6
  51. package/dist/private/node/ui/components/TokenizedText.js.map +1 -1
  52. package/dist/private/node/ui/components/TokenizedText.test.d.ts +1 -0
  53. package/dist/private/node/ui/components/TokenizedText.test.js +44 -0
  54. package/dist/private/node/ui/components/TokenizedText.test.js.map +1 -0
  55. package/dist/private/node/ui/components/UserInput.d.ts +10 -0
  56. package/dist/private/node/ui/components/UserInput.js +11 -0
  57. package/dist/private/node/ui/components/UserInput.js.map +1 -0
  58. package/dist/private/node/ui/components/UserInput.test.d.ts +1 -0
  59. package/dist/private/node/ui/components/UserInput.test.js +11 -0
  60. package/dist/private/node/ui/components/UserInput.test.js.map +1 -0
  61. package/dist/public/node/github.d.ts +50 -0
  62. package/dist/{github.js → public/node/github.js} +29 -14
  63. package/dist/public/node/github.js.map +1 -0
  64. package/dist/public/node/plugins/tunnel.d.ts +1 -1
  65. package/dist/public/node/plugins/tunnel.js +1 -1
  66. package/dist/public/node/plugins/tunnel.js.map +1 -1
  67. package/dist/public/{common → node}/result.d.ts +12 -6
  68. package/dist/public/{common → node}/result.js +28 -5
  69. package/dist/public/node/result.js.map +1 -0
  70. package/dist/session/exchange.d.ts +1 -1
  71. package/dist/session/exchange.js +4 -4
  72. package/dist/session/exchange.js.map +1 -1
  73. package/dist/tsconfig.tsbuildinfo +1 -1
  74. package/package.json +1 -1
  75. package/dist/github.d.ts +0 -33
  76. package/dist/github.js.map +0 -1
  77. package/dist/public/common/result.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/cli-kit",
3
- "version": "3.24.1",
3
+ "version": "3.25.0",
4
4
  "private": false,
5
5
  "description": "A set of utilities, interfaces, and models that are common across all the platform features",
6
6
  "keywords": [
package/dist/github.d.ts DELETED
@@ -1,33 +0,0 @@
1
- export interface GithubRelease {
2
- id: number;
3
- url: string;
4
- tag_name: string;
5
- name: string;
6
- body: string;
7
- draft: boolean;
8
- prerelease: boolean;
9
- created_at: string;
10
- published_at: string;
11
- tarball_url: string;
12
- }
13
- interface Options {
14
- filter: (release: GithubRelease) => boolean;
15
- }
16
- export declare function getLatestRelease(user: string, repo: string, { filter }?: Options): Promise<GithubRelease>;
17
- export declare function parseRepoUrl(src: string): {
18
- full: string;
19
- site: string;
20
- user: string;
21
- name: string;
22
- ref: string;
23
- subDirectory: string;
24
- ssh: string;
25
- http: string;
26
- };
27
- export interface GithubRepoReference {
28
- repoBaseUrl: string;
29
- branch?: string;
30
- filePath?: string;
31
- }
32
- export declare function parseGithubRepoReference(src: string): GithubRepoReference;
33
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"github.js","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAChC,OAAO,EAAC,OAAO,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AA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CAAA;IACvD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC5D,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAErE,OAAO;QACL,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,IAAI,IAAI,IAAI,IAAI,EAAE;QAC5C,MAAM;QACN,QAAQ;KACT,CAAA;AACH,CAAC","sourcesContent":["import {fetch} from './http.js'\nimport {Abort} from './error.js'\nimport {content, debug} from './output.js'\n\nclass GitHubClientError extends Error {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(url: string, statusCode: number, bodyJson: any) {\n super(\n `The request to GitHub API URL ${url} failed with status code ${statusCode} and the following error message: ${bodyJson.message}`,\n )\n }\n}\n\nexport interface GithubRelease {\n id: number\n url: string\n tag_name: string\n name: string\n body: string\n draft: boolean\n prerelease: boolean\n created_at: string\n published_at: string\n tarball_url: string\n}\n\ninterface Options {\n filter: (release: GithubRelease) => boolean\n}\n\nexport async function getLatestRelease(\n user: string,\n repo: string,\n {filter}: Options = {filter: () => true},\n): Promise<GithubRelease> {\n debug(content`Getting the latest release of GitHub repository ${user}/${repo}...`)\n const url = `https://api.github.com/repos/${user}/${repo}/releases`\n const fetchResult = await fetch(url)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const jsonBody: any = await fetchResult.json()\n\n if (fetchResult.status !== 200) {\n throw new GitHubClientError(url, fetchResult.status, jsonBody)\n }\n\n return jsonBody.find(filter)\n}\n\nexport function parseRepoUrl(src: string) {\n const match =\n /^(?:(?:https:\\/\\/)?([^:/]+\\.[^:/]+)\\/|git@([^:/]+)[:/]|([^/]+):)?([^/\\s]+)\\/([^/\\s#]+)(?:((?:\\/[^/\\s#]+)+))?(?:\\/)?(?:#(.+))?/.exec(\n src,\n )\n\n if (!match) {\n const exampleFormats = [\n 'github:user/repo',\n 'user/repo/subdirectory',\n 'git@github.com:user/repo',\n 'user/repo#dev',\n 'https://github.com/user/repo',\n ]\n\n throw new Abort(`Parsing the url ${src} failed. Supported formats are ${exampleFormats.join(', ')}.`)\n }\n\n const site = match[1] || match[2] || match[3] || 'github.com'\n const normalizedSite = site === 'github' ? 'github.com' : site\n const user = match[4]!\n const name = match[5]!.replace(/\\.git$/, '')\n const subDirectory = match[6]?.slice(1)!\n const ref = match[7]!\n const branch = ref ? `#${ref}` : ''\n const ssh = `git@${normalizedSite}:${user}/${name}`\n const http = `https://${normalizedSite}/${user}/${name}`\n const full = ['https:/', normalizedSite, user, name, subDirectory].join('/').concat(branch)\n\n return {full, site: normalizedSite, user, name, ref, subDirectory, ssh, http}\n}\n\nexport interface GithubRepoReference {\n repoBaseUrl: string\n branch?: string\n filePath?: string\n}\n\nexport function parseGithubRepoReference(src: string): GithubRepoReference {\n const url = new URL(src)\n const branch = url.hash ? url.hash.slice(1) : undefined\n const [_, user, repo, ...repoPath] = url.pathname.split('/')\n const filePath = repoPath.length > 0 ? repoPath.join('/') : undefined\n\n return {\n repoBaseUrl: `${url.origin}/${user}/${repo}`,\n branch,\n filePath,\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/public/common/result.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAyB,KAAa,EAAsB,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAA;AAE9F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAmC,GAAW,EAAuB,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;AAEvG,MAAM,OAAO,EAAE;IACb,YAAqB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAEtC;;;;OAIG;IACH,KAAK;QACH,OAAO,KAAK,CAAA;IACd,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,OAAgC;QACrC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACnB,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;IAED;;;;OAIG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAe,MAAuC;QACvD,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAC/B,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAe,OAAwC;QAC7D,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;CACF;AAED,MAAM,OAAO,GAAG;IACd,YAAqB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAEtC;;;;OAIG;IACH,KAAK;QACH,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,QAAiC;QACtC,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACxB,CAAC;IAED;;OAEG;IACH,YAAY;QACV,MAAM,IAAI,CAAC,KAAK,CAAA;IAClB,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAe,OAA+C;QAC/D,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACxB,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAe,MAAuC;QAC5D,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAChC,CAAC;CACF","sourcesContent":["/* eslint-disable node/handle-callback-err */\nexport type Result<TValue, TError> = Ok<TValue, TError> | Err<TValue, TError>\n\n/**\n * Utility metho to create an `Ok` result from a `value`\n *\n * @param value - `value` used to crete the `Result`\n * @returns an instance of a `Ok` `Result` inferring its type\n */\nexport const ok = <TValue, TError = never>(value: TValue): Ok<TValue, TError> => new Ok(value)\n\n/**\n * Utility method to create an `Error` result from an `error`\n *\n * @param err - `error` used to crete the `Result`\n * @returns an instance of an `Error` `Result` inferring its type\n */\nexport const err = <TValue = never, TError = unknown>(err: TError): Err<TValue, TError> => new Err(err)\n\nexport class Ok<TValue, TError> {\n constructor(readonly value: TValue) {}\n\n /**\n * Check if a `Result` is an `Err` inferring its type. `!isErr()` should be used before accessing the `value`\n *\n * @returns `false` as the `Resul` is `OK`\n */\n isErr(): this is Err<TValue, TError> {\n return false\n }\n\n /**\n * Runs the `handler` method an return the same an unaltered copy of the `Result`. It could be used to log an\n * output when the result is `Ok` without breaking the flow\n *\n * @param handler - method to be run when the result is `Ok`\n * @returns a copy of the same `Result`\n */\n doOnOk(handler: (value: TValue) => void): Result<TValue, TError> {\n handler(this.value)\n return ok(this.value)\n }\n\n /**\n * A safe mode to get the `value` of the `Result`\n *\n * @returns the `value` of the `Result`\n */\n valueOrThrow(): TValue {\n return this.value\n }\n\n /**\n * Maps the value to another one with a different type. It leaves the `Error` type unaltered\n *\n * @param mapper - The mapper method to apply an `OK` value\n * @returns a new result with the new mapped value\n */\n map<TMappedValue>(mapper: (value: TValue) => TMappedValue): Result<TMappedValue, TError> {\n return ok(mapper(this.value))\n }\n\n /**\n * Maps the error type to another one. It leaves the `Ok` type and value unaltered\n *\n * @param _mapper - This mapper method is not used for an `Ok` value\n * @returns a new result with the new mapped error type and an value\n */\n mapError<TMappedError>(_mapper: (error: TError) => TMappedError): Result<TValue, TMappedError> {\n return ok(this.value)\n }\n}\n\nexport class Err<TValue, TError> {\n constructor(readonly error: TError) {}\n\n /**\n * Check if a `Result` is an `Err` inferring its type. `!isErr()` should be used before accessing the `value`\n *\n * @returns `false` as the `Resul` is `OK`\n */\n isErr(): this is Err<TValue, TError> {\n return true\n }\n\n /**\n * Return an unaltered copy of the `Error` without doing anything.\n *\n * @param _handler - This handler method is not used for an `Error`\n * @returns a copy of the same `Error`\n */\n doOnOk(_handler: (value: TValue) => void): Result<TValue, TError> {\n return err(this.error)\n }\n\n /**\n * A safe mode to throw the `error` of the `Result`\n */\n valueOrThrow(): TValue {\n throw this.error\n }\n\n /**\n * Maps the value type to another one. It leaves the `Error` unaltered\n *\n * @param _mapper - This mapper method is not used for an `Error` value\n * @returns a new result with the new value type and an unaltered error\n */\n map<TMappedValue>(_mapper: (valueOrThrow: TValue) => TMappedValue): Result<TMappedValue, TError> {\n return err(this.error)\n }\n\n /**\n * Maps the error to another one with a different type. It leaves the value type unaltered\n *\n * @param mapper - The mapper method to apply an `Error` value\n * @returns a new result with the new mapped error\n */\n mapError<TMappedError>(mapper: (error: TError) => TMappedError): Result<TValue, TMappedError> {\n return err(mapper(this.error))\n }\n}\n"]}