@shopify/cli-kit 3.20.1 → 3.21.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/cli-kit",
3
- "version": "3.20.1",
3
+ "version": "3.21.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": [
@@ -21,6 +21,10 @@
21
21
  "import": "./dist/public/common/array.js",
22
22
  "types": "./dist/public/common/array.d.ts"
23
23
  },
24
+ "./common/result": {
25
+ "import": "./dist/public/common/result.js",
26
+ "types": "./dist/public/common/result.d.ts"
27
+ },
24
28
  "./node/ui": {
25
29
  "import": "./dist/public/node/ui.js",
26
30
  "types": "./dist/public/node/ui.d.ts"
@@ -29,6 +33,10 @@
29
33
  "import": "./dist/public/node/presets.js",
30
34
  "types": "./dist/public/node/presets.d.ts"
31
35
  },
36
+ "./node/error": {
37
+ "import": "./dist/public/node/error.js",
38
+ "types": "./dist/public/node/error.d.ts"
39
+ },
32
40
  "./node/*": {
33
41
  "node": "./dist/node/*.js",
34
42
  "types": "./dist/node/*.d.ts"
@@ -1,17 +0,0 @@
1
- export declare type Result<T, TError> = Ok<T, TError> | Err<T, TError>;
2
- export declare const ok: <T, TError = never>(value: T) => Ok<T, TError>;
3
- export declare const err: <T = never, TError = unknown>(err: TError) => Err<T, TError>;
4
- export declare class Ok<T, TError> {
5
- readonly value: T;
6
- constructor(value: T);
7
- isErr(): this is Err<T, TError>;
8
- valueOrThrow(): T;
9
- mapError<TMappedError>(mapper: (error: TError) => TMappedError): Result<T, TError>;
10
- }
11
- export declare class Err<T, TError> {
12
- readonly error: TError;
13
- constructor(error: TError);
14
- isErr(): this is Err<T, TError>;
15
- valueOrThrow(): T;
16
- mapError<TMappedError>(mapper: (error: TError) => TMappedError): Result<T, TMappedError>;
17
- }
@@ -1,31 +0,0 @@
1
- export const ok = (value) => new Ok(value);
2
- export const err = (err) => new Err(err);
3
- export class Ok {
4
- constructor(value) {
5
- this.value = value;
6
- }
7
- isErr() {
8
- return false;
9
- }
10
- valueOrThrow() {
11
- return this.value;
12
- }
13
- mapError(mapper) {
14
- return ok(this.value);
15
- }
16
- }
17
- export class Err {
18
- constructor(error) {
19
- this.error = error;
20
- }
21
- isErr() {
22
- return true;
23
- }
24
- valueOrThrow() {
25
- throw this.error;
26
- }
27
- mapError(mapper) {
28
- return err(mapper(this.error));
29
- }
30
- }
31
- //# sourceMappingURL=result.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/common/result.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,EAAE,GAAG,CAAoB,KAAQ,EAAiB,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAA;AAE/E,MAAM,CAAC,MAAM,GAAG,GAAG,CAA8B,GAAW,EAAkB,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;AAE7F,MAAM,OAAO,EAAE;IACb,YAAqB,KAAQ;QAAR,UAAK,GAAL,KAAK,CAAG;IAAG,CAAC;IAEjC,KAAK;QACH,OAAO,KAAK,CAAA;IACd,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAED,QAAQ,CAAe,MAAuC;QAC5D,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,KAAK;QACH,OAAO,IAAI,CAAA;IACb,CAAC;IAED,YAAY;QACV,MAAM,IAAI,CAAC,KAAK,CAAA;IAClB,CAAC;IAED,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<T, TError> = Ok<T, TError> | Err<T, TError>\n\nexport const ok = <T, TError = never>(value: T): Ok<T, TError> => new Ok(value)\n\nexport const err = <T = never, TError = unknown>(err: TError): Err<T, TError> => new Err(err)\n\nexport class Ok<T, TError> {\n constructor(readonly value: T) {}\n\n isErr(): this is Err<T, TError> {\n return false\n }\n\n valueOrThrow(): T {\n return this.value\n }\n\n mapError<TMappedError>(mapper: (error: TError) => TMappedError): Result<T, TError> {\n return ok(this.value)\n }\n}\n\nexport class Err<T, TError> {\n constructor(readonly error: TError) {}\n\n isErr(): this is Err<T, TError> {\n return true\n }\n\n valueOrThrow(): T {\n throw this.error\n }\n\n mapError<TMappedError>(mapper: (error: TError) => TMappedError): Result<T, TMappedError> {\n return err(mapper(this.error))\n }\n}\n"]}