@shopify/cli-kit 3.20.0 → 3.20.1

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/dist/version.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  /// <reference types="node" />
2
- import { Bug } from './error.js';
3
- export declare const PackageJsonVersionNotFoundError: (packageJsonPath: string) => Bug;
4
2
  /**
5
3
  * Returns the latest available version of an NPM package.
6
4
  * @param name - The name of the NPM package.
package/dist/version.js CHANGED
@@ -3,9 +3,6 @@ import { moduleDirectory } from './path.js';
3
3
  import { Bug } from './error.js';
4
4
  import { findUpAndReadPackageJson } from './node/node-package-manager.js';
5
5
  import latestVersion from 'latest-version';
6
- export const PackageJsonVersionNotFoundError = (packageJsonPath) => {
7
- return new Bug(content `The package.json at path ${token.path(packageJsonPath)} doesn't contain a version`);
8
- };
9
6
  /**
10
7
  * Returns the latest available version of an NPM package.
11
8
  * @param name - The name of the NPM package.
@@ -27,7 +24,7 @@ export async function findPackageVersionUp(options) {
27
24
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
25
  const version = packageJson.content.version;
29
26
  if (!version) {
30
- throw PackageJsonVersionNotFoundError(packageJson.path);
27
+ throw new Bug(content `The package.json at path ${token.path(packageJson.path)} doesn't contain a version`);
31
28
  }
32
29
  return version;
33
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AACjD,OAAO,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;AACzC,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAA;AAC9B,OAAO,EAAC,wBAAwB,EAAC,MAAM,gCAAgC,CAAA;AACvE,OAAO,aAAa,MAAM,gBAAgB,CAAA;AAE1C,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,eAAuB,EAAE,EAAE;IACzE,OAAO,IAAI,GAAG,CAAC,OAAO,CAAA,4BAA4B,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,4BAA4B,CAAC,CAAA;AAC5G,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,IAAY;IACxD,KAAK,CAAC,OAAO,CAAA,8CAA8C,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC7E,OAAO,aAAa,CAAC,IAAI,CAAC,CAAA;AAC5B,CAAC;AAMD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAAoC;IAC7E,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;IAC5D,MAAM,WAAW,GAAG,MAAM,wBAAwB,CAAC,aAAa,CAAC,CAAA;IACjE,8DAA8D;IAC9D,MAAM,OAAO,GAAI,WAAW,CAAC,OAAe,CAAC,OAAO,CAAA;IACpD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,+BAA+B,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;KACxD;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import {content, token, debug} from './output.js'\nimport {moduleDirectory} from './path.js'\nimport {Bug} from './error.js'\nimport {findUpAndReadPackageJson} from './node/node-package-manager.js'\nimport latestVersion from 'latest-version'\n\nexport const PackageJsonVersionNotFoundError = (packageJsonPath: string) => {\n return new Bug(content`The package.json at path ${token.path(packageJsonPath)} doesn't contain a version`)\n}\n\n/**\n * Returns the latest available version of an NPM package.\n * @param name - The name of the NPM package.\n * @returns A promise to get the latest available version of a package.\n */\nexport async function latestNpmPackageVersion(name: string) {\n debug(content`Getting the latest version of NPM package: ${token.raw(name)}`)\n return latestVersion(name)\n}\n\ninterface FindPackageVersionUpOptions {\n fromModuleURL: URL | string\n}\n\n/**\n * Given a module URL, it traverses the directory hierarchy up until it finds a package.json\n * and then it returns the version in it.\n * @param options - Options\n * @returns The version if it can find the package.json and it exists. An error otherwise.\n */\nexport async function findPackageVersionUp(options: FindPackageVersionUpOptions): Promise<string> {\n const fromDirectory = moduleDirectory(options.fromModuleURL)\n const packageJson = await findUpAndReadPackageJson(fromDirectory)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const version = (packageJson.content as any).version\n if (!version) {\n throw PackageJsonVersionNotFoundError(packageJson.path)\n }\n return version\n}\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AACjD,OAAO,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;AACzC,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAA;AAC9B,OAAO,EAAC,wBAAwB,EAAC,MAAM,gCAAgC,CAAA;AACvE,OAAO,aAAa,MAAM,gBAAgB,CAAA;AAE1C;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,IAAY;IACxD,KAAK,CAAC,OAAO,CAAA,8CAA8C,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC7E,OAAO,aAAa,CAAC,IAAI,CAAC,CAAA;AAC5B,CAAC;AAMD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAAoC;IAC7E,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;IAC5D,MAAM,WAAW,GAAG,MAAM,wBAAwB,CAAC,aAAa,CAAC,CAAA;IACjE,8DAA8D;IAC9D,MAAM,OAAO,GAAI,WAAW,CAAC,OAAe,CAAC,OAAO,CAAA;IACpD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,GAAG,CAAC,OAAO,CAAA,4BAA4B,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAA;KAC3G;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import {content, token, debug} from './output.js'\nimport {moduleDirectory} from './path.js'\nimport {Bug} from './error.js'\nimport {findUpAndReadPackageJson} from './node/node-package-manager.js'\nimport latestVersion from 'latest-version'\n\n/**\n * Returns the latest available version of an NPM package.\n * @param name - The name of the NPM package.\n * @returns A promise to get the latest available version of a package.\n */\nexport async function latestNpmPackageVersion(name: string) {\n debug(content`Getting the latest version of NPM package: ${token.raw(name)}`)\n return latestVersion(name)\n}\n\ninterface FindPackageVersionUpOptions {\n fromModuleURL: URL | string\n}\n\n/**\n * Given a module URL, it traverses the directory hierarchy up until it finds a package.json\n * and then it returns the version in it.\n * @param options - Options\n * @returns The version if it can find the package.json and it exists. An error otherwise.\n */\nexport async function findPackageVersionUp(options: FindPackageVersionUpOptions): Promise<string> {\n const fromDirectory = moduleDirectory(options.fromModuleURL)\n const packageJson = await findUpAndReadPackageJson(fromDirectory)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const version = (packageJson.content as any).version\n if (!version) {\n throw new Bug(content`The package.json at path ${token.path(packageJson.path)} doesn't contain a version`)\n }\n return version\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/cli-kit",
3
- "version": "3.20.0",
3
+ "version": "3.20.1",
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": [