@astro-spec/mock 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +62 -2
- package/dist/index.d.mts +84 -0
- package/dist/index.mjs +166 -0
- package/package.json +51 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 otoneko.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @astro-spec/mock
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Mock astro-spec actions and endpoints with MSW, using data generated from the OpenAPI document
|
|
4
|
+
|
|
5
|
+
Creates [MSW](https://mswjs.io) handlers for every action and endpoint in the document that [`@astro-spec/openapi`](../openapi#readme) writes. Use them to build a frontend before the backend is ready, or to test code that calls your actions without running Astro.
|
|
6
|
+
|
|
7
|
+
Each handler answers with data generated from the operation's success schema. The data is the same on every run, so it works in snapshots. Responses are encoded the way Astro encodes them: devalue for actions, so a `date-time` arrives as a `Date`, and JSON for endpoints.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install --save-dev @astro-spec/mock msw
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Works with MSW 2 and 3.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Write the document with `outputFile: 'openapi.json'` in `@astro-spec/openapi`, then pass it to `createMockHandlers`:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// test/setup.ts
|
|
23
|
+
import { createMockHandlers } from '@astro-spec/mock'
|
|
24
|
+
import { setupServer } from 'msw/node'
|
|
25
|
+
import document from '../openapi.json'
|
|
26
|
+
|
|
27
|
+
export const server = setupServer(...createMockHandlers(document))
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
In the browser, use `setupWorker` from `msw/browser` the same way.
|
|
31
|
+
|
|
32
|
+
To answer an operation yourself, pass `overrides`, keyed by operation id: the action name, such as `user.get`, or the method and path of an endpoint, such as `GET /api/users/{id}`.
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { HttpResponse } from 'msw'
|
|
36
|
+
|
|
37
|
+
createMockHandlers(document, {
|
|
38
|
+
overrides: {
|
|
39
|
+
'user.get': ({ input }) => ({ id: (input as { id: string }).id, name: 'Ada', createdAt: new Date() }),
|
|
40
|
+
'GET /api/users/{id}': ({ params }) =>
|
|
41
|
+
params.id === 'missing' ? new HttpResponse(null, { status: 404 }) : { id: params.id, name: 'Ada' },
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
An override receives the `request`, the path `params` and the parsed JSON or form body as `input`. It returns the value to send, which is encoded like the real response, or a `Response` to send as it is.
|
|
47
|
+
|
|
48
|
+
## Options
|
|
49
|
+
|
|
50
|
+
| Option | Default | Description |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| `baseUrl` | `'*'` | Put in front of each path. The default matches any origin; set it, such as `https://example.com`, to mock one origin only. |
|
|
53
|
+
| `overrides` | `{}` | Responses to use instead of generated data, by operation id. |
|
|
54
|
+
|
|
55
|
+
## Generated data
|
|
56
|
+
|
|
57
|
+
Every property of an object is filled in, arrays get two items or `minItems`, and numbers stay within `minimum` and `maximum`. `const`, `enum` and `default` values are used when present, and strings follow their `format`: `date-time`, `date`, `email`, `uri` and `uuid`. An action whose output schema allows anything answers 204 with no body, like an action that returns nothing.
|
|
58
|
+
|
|
59
|
+
`fakeValue(schema, options)` makes a single value from a JSON Schema, for use outside MSW.
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
[MIT](https://github.com/betterlib/astro-spec/blob/main/LICENSE)
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/** An OpenAPI 3.1 document, as far as the mocks read it, such as the parsed `openapi.json`. */
|
|
2
|
+
type MockDocument = {
|
|
3
|
+
paths?: Record<string, Record<string, unknown>>;
|
|
4
|
+
};
|
|
5
|
+
/** What an override receives: the request, the path parameters and the parsed body. */
|
|
6
|
+
type MockRequest = {
|
|
7
|
+
request: Request;
|
|
8
|
+
params: Record<string, string | readonly string[] | undefined>;
|
|
9
|
+
/** The JSON or form body as an object, or `undefined` without a body. */
|
|
10
|
+
input: unknown;
|
|
11
|
+
};
|
|
12
|
+
/** Returns the value to send, which is encoded like the real response, or a `Response`. */
|
|
13
|
+
type MockOverride = (request: MockRequest) => unknown;
|
|
14
|
+
type MockOptions = {
|
|
15
|
+
/**
|
|
16
|
+
* Put in front of each path, such as `https://example.com`. Defaults to `*`, which matches
|
|
17
|
+
* any origin.
|
|
18
|
+
*/
|
|
19
|
+
baseUrl?: string;
|
|
20
|
+
/** Responses to use instead of generated data, by operation id: the action name, such as `user.get`, or the method and path of an endpoint, such as `GET /api/users/{id}`. */
|
|
21
|
+
overrides?: Record<string, MockOverride>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Creates [MSW](https://mswjs.io) handlers for every action and endpoint in an OpenAPI document
|
|
25
|
+
* written by `@astro-spec/openapi`. Each answers with data generated from its success schema,
|
|
26
|
+
* the same on every run, encoded the way Astro encodes it: devalue for actions, JSON for
|
|
27
|
+
* endpoints. Pass `overrides` to answer an operation yourself.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { setupServer } from 'msw/node'
|
|
32
|
+
* import document from '../openapi.json'
|
|
33
|
+
*
|
|
34
|
+
* const server = setupServer(
|
|
35
|
+
* ...createMockHandlers(document, {
|
|
36
|
+
* overrides: {
|
|
37
|
+
* 'user.get': ({ input }) => ({ id: (input as { id: string }).id, name: 'Ada', createdAt: new Date() }),
|
|
38
|
+
* },
|
|
39
|
+
* }),
|
|
40
|
+
* )
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const createMockHandlers: (document: MockDocument, { baseUrl, overrides }?: MockOptions) => import("msw").HttpHandler[];
|
|
44
|
+
type Schema = {
|
|
45
|
+
$ref?: string;
|
|
46
|
+
type?: string | string[];
|
|
47
|
+
format?: string;
|
|
48
|
+
enum?: unknown[];
|
|
49
|
+
const?: unknown;
|
|
50
|
+
default?: unknown;
|
|
51
|
+
properties?: Record<string, Schema>;
|
|
52
|
+
items?: Schema;
|
|
53
|
+
minItems?: number;
|
|
54
|
+
maxItems?: number;
|
|
55
|
+
minLength?: number;
|
|
56
|
+
maxLength?: number;
|
|
57
|
+
minimum?: number;
|
|
58
|
+
maximum?: number;
|
|
59
|
+
exclusiveMinimum?: number;
|
|
60
|
+
exclusiveMaximum?: number;
|
|
61
|
+
anyOf?: Schema[];
|
|
62
|
+
oneOf?: Schema[];
|
|
63
|
+
allOf?: Schema[];
|
|
64
|
+
};
|
|
65
|
+
type FakeOptions = {
|
|
66
|
+
/** Makes the values differ between schemas while staying the same between runs. */
|
|
67
|
+
seed?: string;
|
|
68
|
+
/** Returns a `Date` for `date-time` strings, as devalue decodes them in action results. */
|
|
69
|
+
dates?: 'date' | 'string';
|
|
70
|
+
/** Looks up a local `$ref` such as `#/components/schemas/User`. */
|
|
71
|
+
resolveRef?: (ref: string) => Schema | undefined;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Makes a value that matches a JSON Schema, for mock responses. The same schema and seed always
|
|
75
|
+
* give the same value. A schema that allows anything, `{}`, gives `undefined`.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* fakeValue({ type: 'object', properties: { id: { type: 'string', format: 'uuid' } } })
|
|
80
|
+
* // => { id: '3f1c…' }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare const fakeValue: (schema: Schema, { seed, dates, resolveRef }?: FakeOptions) => unknown;
|
|
84
|
+
export type { FakeOptions, MockDocument, MockOptions, MockOverride, MockRequest, Schema };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { stringify } from "devalue";
|
|
2
|
+
import { HttpResponse, http } from "msw";
|
|
3
|
+
// src/fake-value.ts
|
|
4
|
+
const createRandom = (seed) => {
|
|
5
|
+
let state = [...seed].reduce((hash, char) => Math.imul(hash ^ char.charCodeAt(0), 16777619), 0x811c9dc5);
|
|
6
|
+
return () => {
|
|
7
|
+
state = state + 0x6d2b79f5 | 0;
|
|
8
|
+
const a = Math.imul(state ^ state >>> 15, 1 | state);
|
|
9
|
+
const b = a + Math.imul(a ^ a >>> 7, 61 | a) ^ a;
|
|
10
|
+
return ((b ^ b >>> 14) >>> 0) / 4294967296;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
const pick = (values, random) => values[Math.floor(random() * values.length)];
|
|
14
|
+
const integerBetween = (low, high, random) => low + Math.floor(random() * (high - low + 1));
|
|
15
|
+
const firstType = (schema) => {
|
|
16
|
+
const types = Array.isArray(schema.type) ? schema.type : schema.type ? [schema.type] : [];
|
|
17
|
+
return types.find((type) => type !== "null") ?? types[0];
|
|
18
|
+
};
|
|
19
|
+
const fakeString = (schema, key, context) => {
|
|
20
|
+
const n = integerBetween(1, 999, context.random);
|
|
21
|
+
const day = new Date(Date.UTC(2026, 0, 1) + integerBetween(0, 364, context.random) * 864e5);
|
|
22
|
+
switch (schema.format) {
|
|
23
|
+
case "date-time": return context.dates === "date" ? day : day.toISOString();
|
|
24
|
+
case "date": return day.toISOString().slice(0, 10);
|
|
25
|
+
case "email": return `user${n}@example.com`;
|
|
26
|
+
case "uri":
|
|
27
|
+
case "url": return `https://example.com/${key || "item"}/${n}`;
|
|
28
|
+
case "uuid": return Array.from({ length: 30 }, () => integerBetween(0, 15, context.random).toString(16)).join("").replace(/^(.{8})(.{4})(.{3})(.{3})(.{12})$/, "$1-$2-4$3-a$4-$5");
|
|
29
|
+
}
|
|
30
|
+
const text = `${key || "text"} ${n}`;
|
|
31
|
+
const minLength = schema.minLength ?? 0;
|
|
32
|
+
const padded = text.length < minLength ? text.padEnd(minLength, "x") : text;
|
|
33
|
+
return padded.slice(0, schema.maxLength ?? padded.length);
|
|
34
|
+
};
|
|
35
|
+
const fakeNumber = (schema, integer, context) => {
|
|
36
|
+
const low = schema.minimum ?? (schema.exclusiveMinimum ?? 0) + (integer ? 1 : .01);
|
|
37
|
+
const high = schema.maximum ?? (schema.exclusiveMaximum ?? low + 100) - (integer ? 1 : .01);
|
|
38
|
+
if (integer) return integerBetween(Math.ceil(low), Math.floor(high), context.random);
|
|
39
|
+
return Math.round((low + context.random() * (high - low)) * 100) / 100;
|
|
40
|
+
};
|
|
41
|
+
const fake = (schema, key, context) => {
|
|
42
|
+
if (schema.$ref) {
|
|
43
|
+
if (context.refs.includes(schema.$ref)) return void 0;
|
|
44
|
+
const target = context.resolveRef(schema.$ref) ?? {};
|
|
45
|
+
return fake(target, key, {
|
|
46
|
+
...context,
|
|
47
|
+
refs: [...context.refs, schema.$ref]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (schema.const !== void 0) return schema.const;
|
|
51
|
+
if (schema.enum) return pick(schema.enum, context.random);
|
|
52
|
+
if (schema.default !== void 0) return schema.default;
|
|
53
|
+
if (schema.allOf) {
|
|
54
|
+
const merged = schema.allOf.map((member) => fake(member, key, context));
|
|
55
|
+
return merged.every((value) => typeof value === "object" && value !== null && !Array.isArray(value)) ? Object.assign({}, ...merged) : merged[0];
|
|
56
|
+
}
|
|
57
|
+
const members = schema.anyOf ?? schema.oneOf;
|
|
58
|
+
if (members) {
|
|
59
|
+
const member = members.find((option) => firstType(option) !== "null") ?? members[0];
|
|
60
|
+
return member ? fake(member, key, context) : null;
|
|
61
|
+
}
|
|
62
|
+
switch (firstType(schema) ?? (schema.properties ? "object" : void 0)) {
|
|
63
|
+
case "object": return Object.fromEntries(Object.entries(schema.properties ?? {}).flatMap(([name, property]) => {
|
|
64
|
+
const value = fake(property, name, context);
|
|
65
|
+
return value === void 0 ? [] : [[name, value]];
|
|
66
|
+
}));
|
|
67
|
+
case "array": {
|
|
68
|
+
const length = Math.min(Math.max(schema.minItems ?? 2, 0), schema.maxItems ?? 1e400);
|
|
69
|
+
return Array.from({ length }, () => fake(schema.items ?? {}, key, context));
|
|
70
|
+
}
|
|
71
|
+
case "string": return fakeString(schema, key, context);
|
|
72
|
+
case "integer": return fakeNumber(schema, true, context);
|
|
73
|
+
case "number": return fakeNumber(schema, false, context);
|
|
74
|
+
case "boolean": return context.random() < .5;
|
|
75
|
+
case "null": return null;
|
|
76
|
+
default: return;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Makes a value that matches a JSON Schema, for mock responses. The same schema and seed always
|
|
81
|
+
* give the same value. A schema that allows anything, `{}`, gives `undefined`.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* fakeValue({ type: 'object', properties: { id: { type: 'string', format: 'uuid' } } })
|
|
86
|
+
* // => { id: '3f1c…' }
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
const fakeValue = (schema, { seed = "", dates = "string", resolveRef = () => void 0 } = {}) => fake(schema, "", {
|
|
90
|
+
random: createRandom(seed),
|
|
91
|
+
dates,
|
|
92
|
+
resolveRef,
|
|
93
|
+
refs: []
|
|
94
|
+
});
|
|
95
|
+
// src/create-mock-handlers.ts
|
|
96
|
+
const DEVALUE = "application/json+devalue";
|
|
97
|
+
const METHODS = [
|
|
98
|
+
"get",
|
|
99
|
+
"put",
|
|
100
|
+
"post",
|
|
101
|
+
"delete",
|
|
102
|
+
"options",
|
|
103
|
+
"head",
|
|
104
|
+
"patch"
|
|
105
|
+
];
|
|
106
|
+
const readInput = async (request) => {
|
|
107
|
+
const type = request.headers.get("Content-Type") ?? "";
|
|
108
|
+
if (type.includes("application/json")) {
|
|
109
|
+
const text = await request.text();
|
|
110
|
+
return text === "" ? void 0 : JSON.parse(text);
|
|
111
|
+
}
|
|
112
|
+
if (type.includes("multipart/form-data") || type.includes("application/x-www-form-urlencoded")) return Object.fromEntries(await request.formData());
|
|
113
|
+
};
|
|
114
|
+
const resolveRef = (document) => (ref) => ref.slice(2).split("/").map((segment) => segment.replaceAll("~1", "/").replaceAll("~0", "~")).reduce((node, key) => node?.[key], document);
|
|
115
|
+
const respond = (value, devalue) => {
|
|
116
|
+
if (value instanceof Response) return value;
|
|
117
|
+
if (devalue) {
|
|
118
|
+
if (value === void 0) return new HttpResponse(null, { status: 204 });
|
|
119
|
+
return new HttpResponse(stringify(value), { headers: { "Content-Type": DEVALUE } });
|
|
120
|
+
}
|
|
121
|
+
return value === void 0 ? new HttpResponse(null, { status: 200 }) : HttpResponse.json(value);
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Creates [MSW](https://mswjs.io) handlers for every action and endpoint in an OpenAPI document
|
|
125
|
+
* written by `@astro-spec/openapi`. Each answers with data generated from its success schema,
|
|
126
|
+
* the same on every run, encoded the way Astro encodes it: devalue for actions, JSON for
|
|
127
|
+
* endpoints. Pass `overrides` to answer an operation yourself.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* import { setupServer } from 'msw/node'
|
|
132
|
+
* import document from '../openapi.json'
|
|
133
|
+
*
|
|
134
|
+
* const server = setupServer(
|
|
135
|
+
* ...createMockHandlers(document, {
|
|
136
|
+
* overrides: {
|
|
137
|
+
* 'user.get': ({ input }) => ({ id: (input as { id: string }).id, name: 'Ada', createdAt: new Date() }),
|
|
138
|
+
* },
|
|
139
|
+
* }),
|
|
140
|
+
* )
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
const createMockHandlers = (document, { baseUrl = "*", overrides = {} } = {}) => Object.entries(document.paths ?? {}).flatMap(([path, item]) => METHODS.flatMap((method) => {
|
|
144
|
+
const operation = item[method];
|
|
145
|
+
if (!operation) return [];
|
|
146
|
+
const operationId = operation.operationId ?? `${method.toUpperCase()} ${path}`;
|
|
147
|
+
const content = operation.responses?.["200"]?.content;
|
|
148
|
+
const devalue = content?.[DEVALUE] !== void 0;
|
|
149
|
+
const schema = (devalue ? content?.[DEVALUE] : content?.["application/json"])?.schema;
|
|
150
|
+
const override = overrides[operationId];
|
|
151
|
+
const url = `${baseUrl.replace(/\/$/, "")}${path.replace(/\{([^}]+)\}/g, ":$1")}`;
|
|
152
|
+
return [http[method](url, async ({ request, params }) => {
|
|
153
|
+
if (override) return respond(await override({
|
|
154
|
+
request,
|
|
155
|
+
params,
|
|
156
|
+
input: await readInput(request)
|
|
157
|
+
}), devalue);
|
|
158
|
+
const value = schema && fakeValue(schema, {
|
|
159
|
+
seed: operationId,
|
|
160
|
+
dates: devalue ? "date" : "string",
|
|
161
|
+
resolveRef: resolveRef(document)
|
|
162
|
+
});
|
|
163
|
+
return respond(value, devalue);
|
|
164
|
+
})];
|
|
165
|
+
}));
|
|
166
|
+
export { createMockHandlers, fakeValue };
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astro-spec/mock",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Mock astro-spec actions and endpoints with MSW, using data generated from the OpenAPI document",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"astro",
|
|
7
|
+
"openapi",
|
|
8
|
+
"astro-actions",
|
|
9
|
+
"msw",
|
|
10
|
+
"mock"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/betterlib/astro-spec/tree/main/packages/mock#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/betterlib/astro-spec/issues"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/betterlib/astro-spec.git",
|
|
19
|
+
"directory": "packages/mock"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "otoneko.",
|
|
23
|
+
"type": "module",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.mts",
|
|
27
|
+
"default": "./dist/index.mjs"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=22.12.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"devalue": "^6.0.4"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public",
|
|
42
|
+
"provenance": true
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"msw": "^2.0.0 || ^3.0.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"msw": "^3.0.8"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsdown",
|
|
52
|
+
"typecheck": "tsc --noEmit"
|
|
53
|
+
}
|
|
6
54
|
}
|