@scenarist/nextjs-adapter 0.5.1 → 0.5.3
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/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/package.json +8 -8
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Next.js adapter for Scenarist.
|
|
3
|
+
*
|
|
4
|
+
* Provides MSW-based scenario management for Next.js applications (App Router and Pages Router).
|
|
5
|
+
*
|
|
6
|
+
* For App Router setup, helpers, and loggers, import from `@scenarist/nextjs-adapter/app`.
|
|
7
|
+
* For Pages Router setup, helpers, and loggers, import from `@scenarist/nextjs-adapter/pages`.
|
|
8
|
+
*
|
|
9
|
+
* Shared, router-agnostic Scenarist types are re-exported from the root entry point
|
|
10
|
+
* with zero runtime imports so production bundles remain unaffected.
|
|
11
|
+
*
|
|
12
|
+
* @module @scenarist/nextjs-adapter
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Defining scenarios (router-agnostic)
|
|
17
|
+
* import type { ScenaristScenario, ScenaristScenarios } from '@scenarist/nextjs-adapter';
|
|
18
|
+
*
|
|
19
|
+
* export const defaultScenario: ScenaristScenario = {
|
|
20
|
+
* id: 'default',
|
|
21
|
+
* name: 'Default Scenario',
|
|
22
|
+
* description: 'Baseline mocks',
|
|
23
|
+
* mocks: [
|
|
24
|
+
* {
|
|
25
|
+
* method: 'GET',
|
|
26
|
+
* url: 'https://api.example.com/user',
|
|
27
|
+
* response: { status: 200, body: { name: 'Default User' } },
|
|
28
|
+
* },
|
|
29
|
+
* ],
|
|
30
|
+
* };
|
|
31
|
+
*
|
|
32
|
+
* export const scenarios = {
|
|
33
|
+
* default: defaultScenario,
|
|
34
|
+
* } as const satisfies ScenaristScenarios;
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export type { ScenaristScenario, ScenaristMock, ScenaristResponse, ScenaristSequence, ScenaristMatch, ScenaristCaptureConfig, ScenaristScenarios, ScenaristConfig, ScenaristResult, Logger, LogLevel, LogCategory, LogContext, ConsoleLoggerConfig, LogFormat, } from "@scenarist/core";
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,MAAM,EACN,QAAQ,EACR,WAAW,EACX,UAAU,EACV,mBAAmB,EACnB,SAAS,GACV,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Next.js adapter for Scenarist.
|
|
3
|
+
*
|
|
4
|
+
* Provides MSW-based scenario management for Next.js applications (App Router and Pages Router).
|
|
5
|
+
*
|
|
6
|
+
* For App Router setup, helpers, and loggers, import from `@scenarist/nextjs-adapter/app`.
|
|
7
|
+
* For Pages Router setup, helpers, and loggers, import from `@scenarist/nextjs-adapter/pages`.
|
|
8
|
+
*
|
|
9
|
+
* Shared, router-agnostic Scenarist types are re-exported from the root entry point
|
|
10
|
+
* with zero runtime imports so production bundles remain unaffected.
|
|
11
|
+
*
|
|
12
|
+
* @module @scenarist/nextjs-adapter
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Defining scenarios (router-agnostic)
|
|
17
|
+
* import type { ScenaristScenario, ScenaristScenarios } from '@scenarist/nextjs-adapter';
|
|
18
|
+
*
|
|
19
|
+
* export const defaultScenario: ScenaristScenario = {
|
|
20
|
+
* id: 'default',
|
|
21
|
+
* name: 'Default Scenario',
|
|
22
|
+
* description: 'Baseline mocks',
|
|
23
|
+
* mocks: [
|
|
24
|
+
* {
|
|
25
|
+
* method: 'GET',
|
|
26
|
+
* url: 'https://api.example.com/user',
|
|
27
|
+
* response: { status: 200, body: { name: 'Default User' } },
|
|
28
|
+
* },
|
|
29
|
+
* ],
|
|
30
|
+
* };
|
|
31
|
+
*
|
|
32
|
+
* export const scenarios = {
|
|
33
|
+
* default: defaultScenario,
|
|
34
|
+
* } as const satisfies ScenaristScenarios;
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scenarist/nextjs-adapter",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Next.js adapter for Scenarist (Pages Router and App Router)",
|
|
5
5
|
"author": "Paul Hammond (citypaul) <paul@packsoftware.co.uk>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"LICENSE"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@scenarist/core": "0.5.
|
|
62
|
-
"@scenarist/msw-adapter": "0.5.
|
|
63
|
-
"zod": "^4.6.
|
|
61
|
+
"@scenarist/core": "0.5.3",
|
|
62
|
+
"@scenarist/msw-adapter": "0.5.3",
|
|
63
|
+
"zod": "^4.6.7"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"msw": "^2.0.0",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@scenarist/eslint-config": "^0.0.0",
|
|
71
71
|
"@scenarist/typescript-config": "0.0.0",
|
|
72
|
-
"@types/node": "^25.9.
|
|
73
|
-
"@vitest/coverage-v8": "^5.
|
|
72
|
+
"@types/node": "^25.9.9",
|
|
73
|
+
"@vitest/coverage-v8": "^5.1.1",
|
|
74
74
|
"eslint": "^9.39.5",
|
|
75
75
|
"msw": "^2.15.0",
|
|
76
|
-
"next": "^16.
|
|
76
|
+
"next": "^16.4.6",
|
|
77
77
|
"typescript": "^6.0.3",
|
|
78
|
-
"vitest": "^5.
|
|
78
|
+
"vitest": "^5.1.1"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsc",
|