@page-component-object/react 0.1.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/dist/index.d.ts +82 -0
- package/dist/index.js +173 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 David Vega
|
|
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/dist/index.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as _page_component_object_core from '@page-component-object/core';
|
|
2
|
+
import { AppManager, RouterHistory, ShallowRenderOptions, RenderResult, FullAppRenderOptions } from '@page-component-object/core';
|
|
3
|
+
import { ReactNode, ReactElement } from 'react';
|
|
4
|
+
import { HttpHandler, MockSession } from '@page-component-object/msw';
|
|
5
|
+
import { ComponentTestObject } from '@page-component-object/queries';
|
|
6
|
+
|
|
7
|
+
type ProviderWrapperProps = {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
type BaseAppManagerOptions = {
|
|
11
|
+
wrapProviders: (children: ReactNode) => ReactNode;
|
|
12
|
+
wrapLayout?: (children: ReactNode) => ReactNode;
|
|
13
|
+
waitForIdle?: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Extend in consumer apps. Constructor registers singleton: `App.get()`.
|
|
17
|
+
*/
|
|
18
|
+
declare class BaseAppManager implements AppManager {
|
|
19
|
+
protected readonly options: BaseAppManagerOptions;
|
|
20
|
+
private renderResult;
|
|
21
|
+
private history;
|
|
22
|
+
constructor(options: BaseAppManagerOptions);
|
|
23
|
+
isRendered(): boolean;
|
|
24
|
+
getHistory(): RouterHistory;
|
|
25
|
+
renderView(element: ReactElement, opts: ShallowRenderOptions): Promise<RenderResult>;
|
|
26
|
+
renderApp(element: ReactElement, opts?: FullAppRenderOptions): Promise<RenderResult>;
|
|
27
|
+
cleanup(): void;
|
|
28
|
+
private ensureMsw;
|
|
29
|
+
private toRenderResult;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Behavioral view test object: routed view under `App.get()` with HTTP mocked via `setupMockData()`.
|
|
33
|
+
*
|
|
34
|
+
* - In tests: call `configureViewTestObjects({ createAppManager })` in setup, then
|
|
35
|
+
* implement `setupMockData()` + getters (no per-view constructor boilerplate).
|
|
36
|
+
* - In Storybook: `storyParameters` / `mockSession` call `setupMockData()` after field
|
|
37
|
+
* initializers — no AppManager needed.
|
|
38
|
+
*/
|
|
39
|
+
declare class BaseViewTestObject extends ComponentTestObject {
|
|
40
|
+
private mockDataInitialized;
|
|
41
|
+
constructor();
|
|
42
|
+
/** Override when the view fetches HTTP APIs. Default: no handlers. */
|
|
43
|
+
setupMockData(): unknown;
|
|
44
|
+
/** Runs once after subclass field initializers (before first render or handler read). */
|
|
45
|
+
protected ensureMockDataInitialized(): void;
|
|
46
|
+
/** Registered `AppManager` from `configureViewTestObjects`. Mock data is ensured on first access. */
|
|
47
|
+
get app(): AppManager;
|
|
48
|
+
/** Router history after `render()` / `renderApp()`. Use in specs instead of reaching through `App.get()`. */
|
|
49
|
+
getHistory(): RouterHistory;
|
|
50
|
+
/** Handlers registered by this view's APIs (after `setupMockData`). */
|
|
51
|
+
getMswHandlers(): HttpHandler[];
|
|
52
|
+
getUser(): _page_component_object_core.UserAgent;
|
|
53
|
+
/**
|
|
54
|
+
* Storybook `parameters.msw` from a fresh mock session (no AppManager render).
|
|
55
|
+
* `setupMocks` runs after `setupMockData()` — override `view` fields or API handlers.
|
|
56
|
+
*/
|
|
57
|
+
static storyParameters<T extends BaseViewTestObject>(this: new () => T, setupMocks?: (view: T, mocks: ReturnType<T['setupMockData']>) => void): {
|
|
58
|
+
msw: {
|
|
59
|
+
handlers: HttpHandler[];
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Isolated mock registration — reuse `handlers` in Storybook and `mocks` in optional `play`.
|
|
64
|
+
* `setupMocks` runs after `setupMockData()`.
|
|
65
|
+
*/
|
|
66
|
+
static mockSession<T extends BaseViewTestObject>(this: new () => T, setupMocks?: (view: T, mocks: ReturnType<T['setupMockData']>) => void): MockSession<T> & {
|
|
67
|
+
view: T;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
type ViewTestConfig = {
|
|
72
|
+
createAppManager: () => AppManager;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Call once in Vitest/Jest setup so `BaseViewTestObject` subclasses
|
|
76
|
+
* do not repeat `createAppManager()` in every constructor.
|
|
77
|
+
*/
|
|
78
|
+
declare function configureViewTestObjects(config: ViewTestConfig): void;
|
|
79
|
+
declare function getViewTestConfig(): ViewTestConfig | null;
|
|
80
|
+
declare function resetViewTestConfig(): void;
|
|
81
|
+
|
|
82
|
+
export { BaseAppManager, type BaseAppManagerOptions, BaseViewTestObject, type ProviderWrapperProps, type ViewTestConfig, configureViewTestObjects, getViewTestConfig, resetViewTestConfig };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// src/BaseAppManager.tsx
|
|
2
|
+
import { render } from "@testing-library/react";
|
|
3
|
+
import {
|
|
4
|
+
App,
|
|
5
|
+
getSharedUserAgent
|
|
6
|
+
} from "@page-component-object/core";
|
|
7
|
+
import {
|
|
8
|
+
buildMswParameters,
|
|
9
|
+
createMockSession,
|
|
10
|
+
snapshotHandlers,
|
|
11
|
+
ApiTestObject
|
|
12
|
+
} from "@page-component-object/msw";
|
|
13
|
+
import { ComponentTestObject } from "@page-component-object/queries";
|
|
14
|
+
import { buildShallowRouteTree, RoutedShell } from "@page-component-object/router-react";
|
|
15
|
+
|
|
16
|
+
// src/viewTestConfig.ts
|
|
17
|
+
var viewTestConfig = null;
|
|
18
|
+
function configureViewTestObjects(config) {
|
|
19
|
+
viewTestConfig = config;
|
|
20
|
+
}
|
|
21
|
+
function getViewTestConfig() {
|
|
22
|
+
return viewTestConfig;
|
|
23
|
+
}
|
|
24
|
+
function resetViewTestConfig() {
|
|
25
|
+
viewTestConfig = null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/BaseAppManager.tsx
|
|
29
|
+
import { jsx } from "react/jsx-runtime";
|
|
30
|
+
var BaseAppManager = class {
|
|
31
|
+
constructor(options) {
|
|
32
|
+
this.options = options;
|
|
33
|
+
App.register(this);
|
|
34
|
+
}
|
|
35
|
+
options;
|
|
36
|
+
renderResult = null;
|
|
37
|
+
history = null;
|
|
38
|
+
isRendered() {
|
|
39
|
+
return this.renderResult !== null;
|
|
40
|
+
}
|
|
41
|
+
getHistory() {
|
|
42
|
+
if (!this.history) {
|
|
43
|
+
throw new Error("App not rendered yet. Call renderView() or renderApp() first.");
|
|
44
|
+
}
|
|
45
|
+
return this.history;
|
|
46
|
+
}
|
|
47
|
+
async renderView(element, opts) {
|
|
48
|
+
this.ensureMsw();
|
|
49
|
+
const initialEntries = opts.initialEntries ?? [opts.route];
|
|
50
|
+
const view = buildShallowRouteTree(element, {
|
|
51
|
+
routePath: opts.routePath,
|
|
52
|
+
wrapLayout: this.options.wrapLayout ? (child) => this.options.wrapLayout(child) : void 0
|
|
53
|
+
});
|
|
54
|
+
this.renderResult = render(
|
|
55
|
+
this.options.wrapProviders(
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
RoutedShell,
|
|
58
|
+
{
|
|
59
|
+
initialEntries,
|
|
60
|
+
initialIndex: opts.initialIndex,
|
|
61
|
+
onHistoryReady: (h) => {
|
|
62
|
+
this.history = h;
|
|
63
|
+
},
|
|
64
|
+
children: view
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
);
|
|
69
|
+
if (opts.waitForIdle !== false && this.options.waitForIdle) {
|
|
70
|
+
await this.options.waitForIdle();
|
|
71
|
+
}
|
|
72
|
+
return this.toRenderResult(this.renderResult);
|
|
73
|
+
}
|
|
74
|
+
async renderApp(element, opts = {}) {
|
|
75
|
+
this.ensureMsw();
|
|
76
|
+
const initialEntries = opts.initialEntries ?? [opts.initialRoute ?? "/"];
|
|
77
|
+
this.renderResult = render(
|
|
78
|
+
this.options.wrapProviders(
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
RoutedShell,
|
|
81
|
+
{
|
|
82
|
+
initialEntries,
|
|
83
|
+
onHistoryReady: (h) => {
|
|
84
|
+
this.history = h;
|
|
85
|
+
},
|
|
86
|
+
children: element
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
);
|
|
91
|
+
if (opts.waitForIdle !== false && this.options.waitForIdle) {
|
|
92
|
+
await this.options.waitForIdle();
|
|
93
|
+
}
|
|
94
|
+
return this.toRenderResult(this.renderResult);
|
|
95
|
+
}
|
|
96
|
+
cleanup() {
|
|
97
|
+
this.renderResult?.unmount();
|
|
98
|
+
this.renderResult = null;
|
|
99
|
+
this.history = null;
|
|
100
|
+
}
|
|
101
|
+
ensureMsw() {
|
|
102
|
+
if (!ApiTestObject.server) {
|
|
103
|
+
ApiTestObject.setupServer();
|
|
104
|
+
ApiTestObject.startServer();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
toRenderResult(result) {
|
|
108
|
+
return {
|
|
109
|
+
container: result.container,
|
|
110
|
+
rerender: (ui) => result.rerender(ui),
|
|
111
|
+
unmount: () => result.unmount()
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
var BaseViewTestObject = class extends ComponentTestObject {
|
|
116
|
+
mockDataInitialized = false;
|
|
117
|
+
constructor() {
|
|
118
|
+
super();
|
|
119
|
+
getViewTestConfig()?.createAppManager();
|
|
120
|
+
}
|
|
121
|
+
/** Override when the view fetches HTTP APIs. Default: no handlers. */
|
|
122
|
+
setupMockData() {
|
|
123
|
+
return {};
|
|
124
|
+
}
|
|
125
|
+
/** Runs once after subclass field initializers (before first render or handler read). */
|
|
126
|
+
ensureMockDataInitialized() {
|
|
127
|
+
if (!this.mockDataInitialized) {
|
|
128
|
+
this.setupMockData();
|
|
129
|
+
this.mockDataInitialized = true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/** Registered `AppManager` from `configureViewTestObjects`. Mock data is ensured on first access. */
|
|
133
|
+
get app() {
|
|
134
|
+
this.ensureMockDataInitialized();
|
|
135
|
+
return App.get();
|
|
136
|
+
}
|
|
137
|
+
/** Router history after `render()` / `renderApp()`. Use in specs instead of reaching through `App.get()`. */
|
|
138
|
+
getHistory() {
|
|
139
|
+
return this.app.getHistory();
|
|
140
|
+
}
|
|
141
|
+
/** Handlers registered by this view's APIs (after `setupMockData`). */
|
|
142
|
+
getMswHandlers() {
|
|
143
|
+
this.ensureMockDataInitialized();
|
|
144
|
+
return snapshotHandlers();
|
|
145
|
+
}
|
|
146
|
+
getUser() {
|
|
147
|
+
return getSharedUserAgent();
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Storybook `parameters.msw` from a fresh mock session (no AppManager render).
|
|
151
|
+
* `setupMocks` runs after `setupMockData()` — override `view` fields or API handlers.
|
|
152
|
+
*/
|
|
153
|
+
static storyParameters(setupMocks) {
|
|
154
|
+
const session = createMockSession(() => new this(), setupMocks);
|
|
155
|
+
return buildMswParameters(session.handlers);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Isolated mock registration — reuse `handlers` in Storybook and `mocks` in optional `play`.
|
|
159
|
+
* `setupMocks` runs after `setupMockData()`.
|
|
160
|
+
*/
|
|
161
|
+
static mockSession(setupMocks) {
|
|
162
|
+
const session = createMockSession(() => new this(), setupMocks);
|
|
163
|
+
return { ...session, view: session.instance };
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
export {
|
|
167
|
+
BaseAppManager,
|
|
168
|
+
BaseViewTestObject,
|
|
169
|
+
configureViewTestObjects,
|
|
170
|
+
getViewTestConfig,
|
|
171
|
+
resetViewTestConfig
|
|
172
|
+
};
|
|
173
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/BaseAppManager.tsx","../src/viewTestConfig.ts"],"sourcesContent":["import { type ReactElement, type ReactNode } from 'react';\n\nimport { render, type RenderResult as RtlRenderResult } from '@testing-library/react';\n\nimport {\n App,\n getSharedUserAgent,\n type AppManager,\n type FullAppRenderOptions,\n type RenderResult,\n type RouterHistory,\n type ShallowRenderOptions,\n} from '@page-component-object/core';\nimport {\n buildMswParameters,\n createMockSession,\n snapshotHandlers,\n ApiTestObject,\n type HttpHandler,\n type MockSession,\n} from '@page-component-object/msw';\nimport { ComponentTestObject } from '@page-component-object/queries';\nimport { buildShallowRouteTree, RoutedShell } from '@page-component-object/router-react';\n\nimport { getViewTestConfig } from './viewTestConfig';\n\nexport type ProviderWrapperProps = { children: ReactNode };\n\nexport type BaseAppManagerOptions = {\n wrapProviders: (children: ReactNode) => ReactNode;\n wrapLayout?: (children: ReactNode) => ReactNode;\n waitForIdle?: () => Promise<void>;\n};\n\n/**\n * Extend in consumer apps. Constructor registers singleton: `App.get()`.\n */\nexport class BaseAppManager implements AppManager {\n private renderResult: RtlRenderResult | null = null;\n private history: RouterHistory | null = null;\n\n constructor(protected readonly options: BaseAppManagerOptions) {\n App.register(this);\n }\n\n isRendered(): boolean {\n return this.renderResult !== null;\n }\n\n getHistory(): RouterHistory {\n if (!this.history) {\n throw new Error('App not rendered yet. Call renderView() or renderApp() first.');\n }\n return this.history;\n }\n\n async renderView(element: ReactElement, opts: ShallowRenderOptions): Promise<RenderResult> {\n this.ensureMsw();\n const initialEntries = opts.initialEntries ?? [opts.route];\n const view = buildShallowRouteTree(element, {\n routePath: opts.routePath,\n wrapLayout: this.options.wrapLayout\n ? (child) => this.options.wrapLayout!(child) as ReactElement\n : undefined,\n });\n\n this.renderResult = render(\n this.options.wrapProviders(\n <RoutedShell\n initialEntries={initialEntries}\n initialIndex={opts.initialIndex}\n onHistoryReady={(h) => {\n this.history = h;\n }}\n >\n {view}\n </RoutedShell>,\n ),\n );\n\n if (opts.waitForIdle !== false && this.options.waitForIdle) {\n await this.options.waitForIdle();\n }\n\n return this.toRenderResult(this.renderResult);\n }\n\n async renderApp(element: ReactElement, opts: FullAppRenderOptions = {}): Promise<RenderResult> {\n this.ensureMsw();\n const initialEntries = opts.initialEntries ?? [opts.initialRoute ?? '/'];\n\n this.renderResult = render(\n this.options.wrapProviders(\n <RoutedShell\n initialEntries={initialEntries}\n onHistoryReady={(h) => {\n this.history = h;\n }}\n >\n {element}\n </RoutedShell>,\n ),\n );\n\n if (opts.waitForIdle !== false && this.options.waitForIdle) {\n await this.options.waitForIdle();\n }\n\n return this.toRenderResult(this.renderResult);\n }\n\n cleanup(): void {\n this.renderResult?.unmount();\n this.renderResult = null;\n this.history = null;\n }\n\n private ensureMsw(): void {\n if (!ApiTestObject.server) {\n ApiTestObject.setupServer();\n ApiTestObject.startServer();\n }\n }\n\n private toRenderResult(result: RtlRenderResult): RenderResult {\n return {\n container: result.container,\n rerender: (ui: unknown) => result.rerender(ui as ReactElement),\n unmount: () => result.unmount(),\n };\n }\n}\n\n/**\n * Behavioral view test object: routed view under `App.get()` with HTTP mocked via `setupMockData()`.\n *\n * - In tests: call `configureViewTestObjects({ createAppManager })` in setup, then\n * implement `setupMockData()` + getters (no per-view constructor boilerplate).\n * - In Storybook: `storyParameters` / `mockSession` call `setupMockData()` after field\n * initializers — no AppManager needed.\n */\nexport class BaseViewTestObject extends ComponentTestObject {\n private mockDataInitialized = false;\n\n constructor() {\n super();\n getViewTestConfig()?.createAppManager();\n }\n\n /** Override when the view fetches HTTP APIs. Default: no handlers. */\n setupMockData(): unknown {\n return {};\n }\n\n /** Runs once after subclass field initializers (before first render or handler read). */\n protected ensureMockDataInitialized(): void {\n if (!this.mockDataInitialized) {\n this.setupMockData();\n this.mockDataInitialized = true;\n }\n }\n\n /** Registered `AppManager` from `configureViewTestObjects`. Mock data is ensured on first access. */\n get app(): AppManager {\n this.ensureMockDataInitialized();\n return App.get();\n }\n\n /** Router history after `render()` / `renderApp()`. Use in specs instead of reaching through `App.get()`. */\n getHistory(): RouterHistory {\n return this.app.getHistory();\n }\n\n /** Handlers registered by this view's APIs (after `setupMockData`). */\n getMswHandlers(): HttpHandler[] {\n this.ensureMockDataInitialized();\n return snapshotHandlers();\n }\n\n getUser() {\n return getSharedUserAgent();\n }\n\n /**\n * Storybook `parameters.msw` from a fresh mock session (no AppManager render).\n * `setupMocks` runs after `setupMockData()` — override `view` fields or API handlers.\n */\n static storyParameters<T extends BaseViewTestObject>(\n this: new () => T,\n setupMocks?: (view: T, mocks: ReturnType<T['setupMockData']>) => void,\n ): { msw: { handlers: HttpHandler[] } } {\n const session = createMockSession(() => new this(), setupMocks);\n return buildMswParameters(session.handlers);\n }\n\n /**\n * Isolated mock registration — reuse `handlers` in Storybook and `mocks` in optional `play`.\n * `setupMocks` runs after `setupMockData()`.\n */\n static mockSession<T extends BaseViewTestObject>(\n this: new () => T,\n setupMocks?: (view: T, mocks: ReturnType<T['setupMockData']>) => void,\n ): MockSession<T> & { view: T } {\n const session = createMockSession(() => new this(), setupMocks);\n return { ...session, view: session.instance };\n }\n}\n","import type { AppManager } from '@page-component-object/core';\n\nexport type ViewTestConfig = {\n createAppManager: () => AppManager;\n};\n\nlet viewTestConfig: ViewTestConfig | null = null;\n\n/**\n * Call once in Vitest/Jest setup so `BaseViewTestObject` subclasses\n * do not repeat `createAppManager()` in every constructor.\n */\nexport function configureViewTestObjects(config: ViewTestConfig): void {\n viewTestConfig = config;\n}\n\nexport function getViewTestConfig(): ViewTestConfig | null {\n return viewTestConfig;\n}\n\nexport function resetViewTestConfig(): void {\n viewTestConfig = null;\n}\n"],"mappings":";AAEA,SAAS,cAAoD;AAE7D;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,2BAA2B;AACpC,SAAS,uBAAuB,mBAAmB;;;AChBnD,IAAI,iBAAwC;AAMrC,SAAS,yBAAyB,QAA8B;AACrE,mBAAiB;AACnB;AAEO,SAAS,oBAA2C;AACzD,SAAO;AACT;AAEO,SAAS,sBAA4B;AAC1C,mBAAiB;AACnB;;;AD8CQ;AA/BD,IAAM,iBAAN,MAA2C;AAAA,EAIhD,YAA+B,SAAgC;AAAhC;AAC7B,QAAI,SAAS,IAAI;AAAA,EACnB;AAAA,EAF+B;AAAA,EAHvB,eAAuC;AAAA,EACvC,UAAgC;AAAA,EAMxC,aAAsB;AACpB,WAAO,KAAK,iBAAiB;AAAA,EAC/B;AAAA,EAEA,aAA4B;AAC1B,QAAI,CAAC,KAAK,SAAS;AACjB,YAAM,IA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SAAS;AAAA,EAC9C;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@page-component-object/react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@page-component-object/core": "0.1.0",
|
|
18
|
+
"@page-component-object/msw": "0.1.0",
|
|
19
|
+
"@page-component-object/router-react": "0.1.0",
|
|
20
|
+
"@page-component-object/queries": "0.1.0"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"@testing-library/react": "^16.0.0",
|
|
24
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
25
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
26
|
+
"react-router-dom": "^6.4.0 || ^7.0.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@testing-library/react": "^16.1.0",
|
|
30
|
+
"@types/react": "^18.3.18",
|
|
31
|
+
"react": "^18.3.1",
|
|
32
|
+
"react-dom": "^18.3.1",
|
|
33
|
+
"react-router-dom": "^7.6.2",
|
|
34
|
+
"rimraf": "^6.0.1",
|
|
35
|
+
"tsup": "^8.3.5",
|
|
36
|
+
"typescript": "^5.7.2"
|
|
37
|
+
},
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/dvegap95/page-component-test-object.git",
|
|
42
|
+
"directory": "packages/react"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/dvegap95/page-component-test-object#readme",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/dvegap95/page-component-test-object/issues"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsup",
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
54
|
+
"clean": "rimraf dist"
|
|
55
|
+
}
|
|
56
|
+
}
|