@plugmatica/plugin-testing 0.0.0-stage → 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Plugmatica contributors
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,95 @@
1
- # Temporary Holding Version
1
+ # @plugmatica/plugin-testing
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Official composable frontend test helpers for independently developed Plugmatica plugins.
4
+
5
+ ## Who should use it
6
+
7
+ Use this package in plugin test suites that need realistic runtime context, extension resolution/execution, scoped API mocks and module-loading fixtures without booting the complete runtime shell.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pnpm add -D @plugmatica/plugin-testing@beta @testing-library/react@^16 @tanstack/react-query@^5.90.21 @module-federation/enhanced@2.9.4
13
+ ```
14
+
15
+ ## Requirements
16
+
17
+ Peer requirements:
18
+
19
+ - `@module-federation/enhanced 2.9.4`
20
+ - `@testing-library/react ^16.0.0`
21
+ - `@tanstack/react-query ^5.90.21`
22
+ - `react ^19.0.0`
23
+ - `react-dom ^19.0.0`
24
+
25
+ Use Node.js 22.18+ (22.x) or 24+ for the supported SDK toolchain. Check the consuming
26
+ project lockfile for patched Module Federation declaration-tooling dependencies
27
+ (`adm-zip` >= 0.6.1 and `undici` >= 7.30.2 within 7.x). Repository-local pnpm
28
+ overrides are not inherited by consumers.
29
+
30
+ ## Quick start
31
+
32
+ ```tsx
33
+ import { renderPlugin, uiExtensionFixture } from "@plugmatica/plugin-testing";
34
+
35
+ const extension = uiExtensionFixture({
36
+ targetPluginIdentifier: "plugmatica.customer",
37
+ key: "customer.detail.tabs",
38
+ point: "items",
39
+ });
40
+
41
+ renderPlugin(<CustomerDetail />, {
42
+ pluginIdentifier: "plugmatica.customer",
43
+ extensions: [extension],
44
+ });
45
+ ```
46
+
47
+ The package uses the real extension index, UI resolver and execution runtime. Module Federation is replaced only at the module-loading boundary. The testing package requires the federation peer because its host SDK imports link the actual runtime module, even when the test uses an in-memory loader. This is a test-environment requirement; the ordinary `@plugmatica/plugin-sdk` plugin-author entry point does not require that optional host peer.
48
+
49
+ ## Public entry points
50
+
51
+ - `@plugmatica/plugin-testing` — all supported fixtures, mocks, assertions and runtime helpers.
52
+
53
+ Helpers are intentionally composable; consumers can use runtime fixtures, API/entity mocks, contract fixtures and assertions independently.
54
+
55
+ `createMockScopedPluginApi` forwards optional request settings to `MockApiRequest.options` and models abort rejection for a pre-aborted or in-flight request. Handlers still own their own work, while the mock API rejects the caller promise on cancellation. Requests without options retain the previous recorded shape. See the [SDK boundary recipes](https://plugmatica.com/plugmatica/sdk/plugin-runtime-boundaries).
56
+
57
+
58
+ ## What the fixtures prove
59
+
60
+ `renderPlugin` and `createFakePluginRuntime` use the real extension index,
61
+ resolver and execution runtime with an in-memory module loader. They provide a
62
+ test runtime context and, unless supplied explicitly, a retry-disabled
63
+ **test-only** QueryClient. This is not an instruction to create a QueryClient or
64
+ runtime provider inside a production federated plugin.
65
+
66
+ These fixtures can exercise typed component/hook behaviour, extension dispatch,
67
+ request options and caller-visible cancellation. `renderPlugin` defaults to a
68
+ permissive empty-object API mock; provide explicit API handlers and assert the
69
+ requests/results relevant to the test rather than treating that default as a
70
+ backend response contract. Aborting a mock request rejects its caller promise;
71
+ it does not undo a server write or automatically stop arbitrary handler work.
72
+
73
+ They do not prove backend authorization, real session/scope transitions,
74
+ persistence, network transport, published remote loading or shared-singleton
75
+ identity in the host. Keep installed-consumer/build evidence separate from an
76
+ actual host-loaded runtime check. Tests that need host-boundary proof must run
77
+ against that host, without importing another plugin's implementation.
78
+
79
+ ## Testing integration
80
+
81
+ The package's native tests exercise the supported testing helpers. An application integrating the host SDK must also verify installed package identity, production builds and actual host behavior separately. Native tests do not certify a deployed runtime or browser layout.
82
+
83
+ ## Beta stability
84
+
85
+ This package is part of the Plugmatica public beta testing API. Breaking helper changes are versioned and release-noted, and tests should target public plugin behaviour rather than runtime-shell implementation details.
86
+
87
+ ## Documentation
88
+
89
+ Plugin testing guide: https://plugmatica.com/plugmatica/plugin-development/frontend/how-to/testing
90
+
91
+ Frontend plugin guide: https://plugmatica.com/plugmatica/plugin-development/frontend/
92
+
93
+ ## License
94
+
95
+ MIT.
@@ -0,0 +1,458 @@
1
+ import { ExtensionExecutionRuntime, FederatedModuleLoader, UiExtensionResolver } from '@plugmatica/plugin-sdk/host';
2
+ import { CurrentExtensionContract, ExtensionContractRequirement, RuntimeEventHandlerExtension, RuntimeExtension, ExtensionSurface, RuntimeOperationHookExtension, RuntimeProviderExtension, RuntimeUiExtension, RuntimeSession } from '@plugmatica/core-sdk';
3
+ import { ExtensionIndexReadOnly } from '@plugmatica/plugin-sdk/extension-index';
4
+ import { ScopedI18nApi } from '@plugmatica/i18n';
5
+ import * as _plugmatica_plugin_sdk from '@plugmatica/plugin-sdk';
6
+ import { PluginApiRequestOptions, OwnerEntityClient, EntityEnvelope, PluginApiClient, PluginGuestSessionApi, PluginNavigationApi, PluginRenderContext, PluginExtensionsApi } from '@plugmatica/plugin-sdk';
7
+ import { QueryClient } from '@tanstack/react-query';
8
+ import { RenderResult, RenderOptions } from '@testing-library/react';
9
+ import * as React from 'react';
10
+
11
+ /**
12
+ * Runs an operation through the host execution runtime and asserts its execution,
13
+ * completion status, and optional result.
14
+ *
15
+ * @param runtime - Extension execution runtime under test.
16
+ * @param request - Operation request, including the owner execute callback.
17
+ * @param expected - Expected execution source, status, and/or result.
18
+ * @returns A promise that resolves when the assertion succeeds.
19
+ */
20
+ declare function expectOperationResult<TPayload, TResult>(runtime: ExtensionExecutionRuntime, request: Parameters<ExtensionExecutionRuntime["runOperation"]>[0] & {
21
+ payload: TPayload;
22
+ execute(payload: TPayload): TResult | Promise<TResult>;
23
+ }, expected: {
24
+ execution?: "owner" | "replacement" | "none";
25
+ status?: "completed" | "cancelled";
26
+ result?: TResult;
27
+ }): Promise<void>;
28
+ /**
29
+ * Creates a tiny ordered call recorder for extension execution assertions.
30
+ *
31
+ * @returns Mutable call state plus `record` and strict ordered `expect` helpers.
32
+ */
33
+ declare function createCallLog(): {
34
+ calls: string[];
35
+ record: (value: string) => void;
36
+ expect: (...expected: string[]) => void;
37
+ };
38
+
39
+ /** Identifies where a compatibility baseline fixture is intended to have originated. */
40
+ type TestBaselineKind = "repository" | "registry" | "installed" | "explicit";
41
+ /**
42
+ * Minimal compatibility baseline used by plugin tests without invoking the build tool's
43
+ * real repository, registry, or installation baseline providers.
44
+ */
45
+ type TestBaseline = Readonly<{
46
+ pluginId: string;
47
+ pluginVersion?: string;
48
+ contract: CurrentExtensionContract;
49
+ provenance: Readonly<{
50
+ kind: TestBaselineKind;
51
+ description: string;
52
+ reference?: string;
53
+ pluginVersion?: string;
54
+ }>;
55
+ }>;
56
+ /**
57
+ * Stable compatibility-report shape used by assertions and fixture-driven tests.
58
+ */
59
+ type TestCompatibilityReport = Readonly<{
60
+ status: "no-baseline" | "compatible" | "breaking";
61
+ breaking: boolean;
62
+ baseline: TestBaseline["provenance"] | null;
63
+ added: readonly {
64
+ identity: string;
65
+ }[];
66
+ removed: readonly {
67
+ identity: string;
68
+ }[];
69
+ changed: readonly {
70
+ identity: string;
71
+ }[];
72
+ preserved: readonly {
73
+ identity: string;
74
+ }[];
75
+ }>;
76
+ /**
77
+ * Creates a deterministic compatibility baseline fixture for compiler/build tests.
78
+ *
79
+ * @param kind - Provenance kind to record on the fixture.
80
+ * @param contract - Extension contract represented by the baseline.
81
+ * @param options - Optional plugin identity, version, and provenance reference overrides.
82
+ * @returns A test baseline carrying the supplied contract and deterministic provenance metadata.
83
+ */
84
+ declare function baselineFixture(kind: TestBaselineKind, contract: CurrentExtensionContract, options?: {
85
+ pluginId?: string;
86
+ pluginVersion?: string;
87
+ reference?: string;
88
+ }): TestBaseline;
89
+ /**
90
+ * Creates a repository-provenance compatibility baseline fixture.
91
+ *
92
+ * @param contract - Extension contract represented by the baseline.
93
+ * @param options - Optional baseline identity/version/reference overrides.
94
+ * @returns A repository baseline fixture.
95
+ */
96
+ declare const repositoryBaselineFixture: (contract: CurrentExtensionContract, options?: Parameters<typeof baselineFixture>[2]) => Readonly<{
97
+ pluginId: string;
98
+ pluginVersion?: string;
99
+ contract: CurrentExtensionContract;
100
+ provenance: Readonly<{
101
+ kind: TestBaselineKind;
102
+ description: string;
103
+ reference?: string;
104
+ pluginVersion?: string;
105
+ }>;
106
+ }>;
107
+ /**
108
+ * Creates a registry-provenance compatibility baseline fixture.
109
+ *
110
+ * @param contract - Extension contract represented by the baseline.
111
+ * @param options - Optional baseline identity/version/reference overrides.
112
+ * @returns A registry baseline fixture.
113
+ */
114
+ declare const registryBaselineFixture: (contract: CurrentExtensionContract, options?: Parameters<typeof baselineFixture>[2]) => Readonly<{
115
+ pluginId: string;
116
+ pluginVersion?: string;
117
+ contract: CurrentExtensionContract;
118
+ provenance: Readonly<{
119
+ kind: TestBaselineKind;
120
+ description: string;
121
+ reference?: string;
122
+ pluginVersion?: string;
123
+ }>;
124
+ }>;
125
+ /**
126
+ * Creates an installed-plugin compatibility baseline fixture.
127
+ *
128
+ * @param contract - Extension contract represented by the baseline.
129
+ * @param options - Optional baseline identity/version/reference overrides.
130
+ * @returns An installed-plugin baseline fixture.
131
+ */
132
+ declare const installedBaselineFixture: (contract: CurrentExtensionContract, options?: Parameters<typeof baselineFixture>[2]) => Readonly<{
133
+ pluginId: string;
134
+ pluginVersion?: string;
135
+ contract: CurrentExtensionContract;
136
+ provenance: Readonly<{
137
+ kind: TestBaselineKind;
138
+ description: string;
139
+ reference?: string;
140
+ pluginVersion?: string;
141
+ }>;
142
+ }>;
143
+ /**
144
+ * Creates an explicitly supplied compatibility baseline fixture.
145
+ *
146
+ * @param contract - Extension contract represented by the baseline.
147
+ * @param options - Optional baseline identity/version/reference overrides.
148
+ * @returns An explicit baseline fixture.
149
+ */
150
+ declare const explicitBaselineFixture: (contract: CurrentExtensionContract, options?: Parameters<typeof baselineFixture>[2]) => Readonly<{
151
+ pluginId: string;
152
+ pluginVersion?: string;
153
+ contract: CurrentExtensionContract;
154
+ provenance: Readonly<{
155
+ kind: TestBaselineKind;
156
+ description: string;
157
+ reference?: string;
158
+ pluginVersion?: string;
159
+ }>;
160
+ }>;
161
+ /**
162
+ * Creates the no-baseline value used to exercise first-release compatibility paths.
163
+ *
164
+ * @returns `null`, representing the absence of a compatibility baseline.
165
+ */
166
+ declare const noBaselineFixture: () => null;
167
+ /**
168
+ * Asserts that two current extension-contract snapshots are structurally identical.
169
+ *
170
+ * @param actual - Contract produced by the code under test.
171
+ * @param expected - Contract the test expects.
172
+ */
173
+ declare function expectCurrentExtensionContract(actual: CurrentExtensionContract, expected: CurrentExtensionContract): void;
174
+ /**
175
+ * Asserts the important compatibility-report fields while allowing tests to specify
176
+ * only the portions relevant to the scenario.
177
+ *
178
+ * @param report - Compatibility report produced by the code under test.
179
+ * @param expected - Expected status, baseline provenance, and/or changed identities.
180
+ */
181
+ declare function expectCompatibilityReport(report: TestCompatibilityReport, expected: Partial<{
182
+ status: TestCompatibilityReport["status"];
183
+ baselineKind: TestBaselineKind | null;
184
+ added: readonly string[];
185
+ removed: readonly string[];
186
+ changed: readonly string[];
187
+ preserved: readonly string[];
188
+ }>): void;
189
+
190
+ type Common = {
191
+ id?: string;
192
+ pluginIdentifier?: string;
193
+ pluginVersion?: string;
194
+ targetPluginIdentifier?: string;
195
+ module?: string;
196
+ order?: number;
197
+ contract?: ExtensionContractRequirement;
198
+ };
199
+ /**
200
+ * Creates a UI-extension runtime fixture with deterministic plugin and target defaults.
201
+ *
202
+ * @param input - Optional identity, module, contract, surface, key, and point overrides.
203
+ * @returns A complete runtime UI extension suitable for extension-index and host tests.
204
+ */
205
+ declare function uiExtensionFixture(input?: Common & {
206
+ surface?: ExtensionSurface;
207
+ key?: string;
208
+ point?: string;
209
+ }): RuntimeUiExtension;
210
+ /**
211
+ * Creates an operation-hook runtime fixture for before/after execution tests.
212
+ *
213
+ * @param input - Optional identity, target, operation, phase, and contract overrides.
214
+ * @returns A complete runtime operation-hook extension.
215
+ */
216
+ declare function operationHookFixture(input?: Common & {
217
+ surface?: ExtensionSurface;
218
+ key?: string;
219
+ operation?: string;
220
+ phases?: RuntimeOperationHookExtension["phases"];
221
+ }): RuntimeOperationHookExtension;
222
+ /**
223
+ * Creates an event-handler runtime fixture.
224
+ *
225
+ * @param input - Optional extension metadata and event name overrides.
226
+ * @returns A complete runtime event-handler extension.
227
+ */
228
+ declare function eventHandlerFixture(input?: Common & {
229
+ event?: string;
230
+ }): RuntimeEventHandlerExtension;
231
+ /**
232
+ * Creates a provider runtime fixture.
233
+ *
234
+ * @param input - Optional extension metadata and provider name overrides.
235
+ * @returns A complete runtime provider extension.
236
+ */
237
+ declare function providerFixture(input?: Common & {
238
+ provider?: string;
239
+ }): RuntimeProviderExtension;
240
+ /**
241
+ * Builds a read-only extension index from runtime extension fixtures.
242
+ *
243
+ * @param extensions - Runtime extensions to place in the test index.
244
+ * @returns A read-only extension index with the supplied extensions registered.
245
+ */
246
+ declare function extensionIndexFixture(extensions?: readonly RuntimeExtension[]): ExtensionIndexReadOnly;
247
+ /**
248
+ * Creates a current extension-contract fixture with empty collections by default.
249
+ *
250
+ * @param overrides - Contract fields to replace in the generated fixture.
251
+ * @returns A complete current extension contract.
252
+ */
253
+ declare function currentExtensionContractFixture(overrides?: Partial<CurrentExtensionContract>): CurrentExtensionContract;
254
+
255
+ /** Captured request passed to a mock scoped plugin API handler. */
256
+ type MockApiRequest = Readonly<{
257
+ method: string;
258
+ path: string;
259
+ body?: unknown;
260
+ /** Request settings, including the original AbortSignal when supplied. */
261
+ options?: PluginApiRequestOptions;
262
+ }>;
263
+ /**
264
+ * Handles one request made through a mock scoped plugin API client.
265
+ *
266
+ * @param request - HTTP-like method, plugin-relative path, and optional request body.
267
+ * @returns The response value or a promise resolving to it.
268
+ */
269
+ type MockApiHandler = (request: MockApiRequest) => unknown | Promise<unknown>;
270
+ /**
271
+ * Creates a plugin-scoped API client backed by deterministic in-memory handlers.
272
+ * Every request is appended to the returned `requests` array for assertions.
273
+ * When callers supply request options, handlers receive those options and abort
274
+ * signals in the request record. An abort rejects an in-flight mock call with
275
+ * the caller's original reason; handlers remain responsible for their own work.
276
+ *
277
+ * @param options - Per-method/path handlers and an optional fallback handler.
278
+ * @returns A `PluginApiClient` plus its ordered captured-request list.
279
+ *
280
+ * @example
281
+ * ```ts
282
+ * const api = createMockScopedPluginApi({
283
+ * handlers: {
284
+ * "GET /customers": () => [{ pid: "customer-1" }],
285
+ * },
286
+ * });
287
+ * const customers = await api.get("/customers");
288
+ * expect(api.requests).toHaveLength(1);
289
+ * ```
290
+ */
291
+ declare function createMockScopedPluginApi(options?: {
292
+ handlers?: Readonly<Record<string, MockApiHandler>>;
293
+ defaultHandler?: MockApiHandler;
294
+ }): PluginApiClient & {
295
+ readonly requests: MockApiRequest[];
296
+ };
297
+ /**
298
+ * Creates a synchronous, always-ready scoped i18n API for component and hook tests.
299
+ *
300
+ * @param namespace - Namespace reported by the mock and used for scoped messages.
301
+ * @param locale - Locale used by date/number/currency formatters.
302
+ * @returns A deterministic `ScopedI18nApi` implementation.
303
+ */
304
+ declare function createMockI18n(namespace?: string, locale?: string): ScopedI18nApi;
305
+ /**
306
+ * Creates an in-memory owner-entity client with revision checks and CRUD behaviour.
307
+ *
308
+ * @param initial - Initial entity values. Each item must include a stable `pid`.
309
+ * @returns Owner-entity CRUD methods plus the backing envelope map for assertions.
310
+ *
311
+ * @example
312
+ * ```ts
313
+ * const entities = createMockEntityApi([{ pid: "customer-1", name: "Acme" }]);
314
+ * const customer = await entities.get("customer-1");
315
+ * await entities.update("customer-1", {
316
+ * expectedRevision: customer.revision,
317
+ * patch: { name: "Acme Ltd" },
318
+ * });
319
+ * ```
320
+ */
321
+ declare function createMockEntityApi<T extends Record<string, unknown>>(initial?: readonly (T & {
322
+ pid: string;
323
+ })[]): Pick<OwnerEntityClient<T>, "list" | "get" | "create" | "update" | "delete"> & {
324
+ readonly values: Map<string, EntityEnvelope<T>>;
325
+ };
326
+
327
+ /** Map of canonical test module keys to their in-memory module values. */
328
+ type InMemoryFederatedModules = Readonly<Record<string, unknown>>;
329
+ /** Describes one federated-module load request captured by the test registry. */
330
+ type InMemoryModuleRequest = Readonly<{
331
+ pluginIdentifier: string;
332
+ module: string;
333
+ }>;
334
+ /** Mutable in-memory federated-module registry used by host/runtime tests. */
335
+ type InMemoryModuleRegistry = {
336
+ /** Current canonical module-key to module-value mapping. */
337
+ readonly modules: ReadonlyMap<string, unknown>;
338
+ /** Ordered module load requests observed since creation or the last clear. */
339
+ readonly requests: readonly InMemoryModuleRequest[];
340
+ /** Federated module loader backed by this registry. */
341
+ readonly loadModule: FederatedModuleLoader;
342
+ /**
343
+ * Registers or replaces a federated module value.
344
+ * @param pluginIdentifier - Plugin that owns the exposed module.
345
+ * @param module - Module exposure name, with or without the `./` prefix.
346
+ * @param value - Value returned when the module is loaded.
347
+ */
348
+ register(pluginIdentifier: string, module: string, value: unknown): void;
349
+ /**
350
+ * Removes a federated module from the registry.
351
+ * @param pluginIdentifier - Plugin that owns the exposed module.
352
+ * @param module - Module exposure name, with or without the `./` prefix.
353
+ */
354
+ remove(pluginIdentifier: string, module: string): void;
355
+ /** Removes all registered modules. */
356
+ clear(): void;
357
+ /** Clears only the captured module-load request history. */
358
+ clearRequests(): void;
359
+ };
360
+ /**
361
+ * Produces the canonical in-memory key for a plugin's federated module exposure.
362
+ *
363
+ * @param pluginIdentifier - Plugin that owns the module.
364
+ * @param module - Module exposure name, with or without the `./` prefix.
365
+ * @returns Canonical `<plugin>::./<module>` key.
366
+ */
367
+ declare function moduleKey(pluginIdentifier: string, module: string): string;
368
+ /**
369
+ * Creates an in-memory federated-module registry and request recorder.
370
+ *
371
+ * @param initial - Optional canonical module-key to value map used to seed the registry.
372
+ * @returns Registry with a host-compatible module loader and mutation helpers.
373
+ *
374
+ * @example
375
+ * ```ts
376
+ * const modules = createInMemoryModuleRegistry({
377
+ * "acme.plugin::./CustomerTab": { default: CustomerTab },
378
+ * });
379
+ * const loaded = await modules.loadModule("acme.plugin", "./CustomerTab");
380
+ * ```
381
+ */
382
+ declare function createInMemoryModuleRegistry(initial?: InMemoryFederatedModules): InMemoryModuleRegistry;
383
+
384
+ /** Runtime bundle returned by `createFakePluginRuntime`. */
385
+ type FakePluginRuntime = ReturnType<typeof createFakePluginRuntime>;
386
+ /** Testing Library render result augmented with the fake Plugmatica runtime bundle. */
387
+ type PluginRenderResult = RenderResult & FakePluginRuntime;
388
+ /** Options used to assemble a fake plugin runtime for hook/component tests. */
389
+ type FakePluginRuntimeOptions = {
390
+ /** Plugin identifier exposed through the owner render context. */
391
+ pluginIdentifier?: string;
392
+ /** Plugin version exposed through the owner render context. */
393
+ pluginVersion?: string;
394
+ /** Runtime extensions visible to the fake extension index and execution runtime. */
395
+ extensions?: readonly RuntimeExtension[];
396
+ /** Federated modules available to contributed UI/providers/hooks during tests. */
397
+ modules?: InMemoryModuleRegistry;
398
+ /** Plugin-scoped API implementation. Defaults to a permissive empty-object mock. */
399
+ api?: PluginApiClient;
400
+ /** Runtime session visible to plugin hooks. Defaults to a deterministic active user. */
401
+ session?: RuntimeSession;
402
+ /** Optional guest-session lifecycle supplied by a public/kiosk host. */
403
+ guest?: PluginGuestSessionApi;
404
+ /** Navigation implementation exposed through the plugin render context. */
405
+ navigation?: PluginNavigationApi;
406
+ /** Current route path or route-path supplier used by UI extension resolution. */
407
+ routePath?: string | (() => string);
408
+ /** React Query client. A retry-disabled client is created when omitted. */
409
+ queryClient?: QueryClient;
410
+ };
411
+ /**
412
+ * Creates a self-contained plugin frontend-facet runtime for tests without a runtime-shell host.
413
+ * The result includes render context, extension resolution/execution, federated modules,
414
+ * and a retry-disabled React Query client.
415
+ *
416
+ * @param options - Runtime identity, API, session, navigation, extension, module and query overrides.
417
+ * @returns A fake runtime bundle suitable for providers, hooks, extension execution and assertions.
418
+ *
419
+ * @example
420
+ * ```tsx
421
+ * const fake = createFakePluginRuntime({
422
+ * pluginIdentifier: "acme.customers",
423
+ * extensions: [uiExtensionFixture()],
424
+ * });
425
+ * expect(fake.context.plugin.identifier).toBe("acme.customers");
426
+ * ```
427
+ */
428
+ declare function createFakePluginRuntime(options?: FakePluginRuntimeOptions): {
429
+ context: PluginRenderContext;
430
+ queryClient: QueryClient;
431
+ runtime: _plugmatica_plugin_sdk.PluginRuntime;
432
+ extensionApi: PluginExtensionsApi;
433
+ extensionIndex: ExtensionIndexReadOnly;
434
+ resolver: UiExtensionResolver;
435
+ execution: ExtensionExecutionRuntime;
436
+ modules: InMemoryModuleRegistry;
437
+ };
438
+ /**
439
+ * Renders React UI inside Plugmatica runtime and React Query providers, returning both
440
+ * Testing Library helpers and the fake runtime used by the render.
441
+ *
442
+ * @param ui - React element to render.
443
+ * @param options - Fake runtime options plus Testing Library render options other than `wrapper`.
444
+ * @returns Testing Library render helpers augmented with the fake plugin runtime bundle.
445
+ *
446
+ * @example
447
+ * ```tsx
448
+ * const view = renderPlugin(<CustomerList />, {
449
+ * pluginIdentifier: "acme.customers",
450
+ * api: createMockScopedPluginApi({ defaultHandler: () => [] }),
451
+ * });
452
+ * expect(view.context.plugin.identifier).toBe("acme.customers");
453
+ * ```
454
+ */
455
+ declare function renderPlugin(ui: React.ReactElement, options?: FakePluginRuntimeOptions & Omit<RenderOptions, "wrapper">): PluginRenderResult;
456
+
457
+ export { baselineFixture, createCallLog, createFakePluginRuntime, createInMemoryModuleRegistry, createMockEntityApi, createMockI18n, createMockScopedPluginApi, currentExtensionContractFixture, eventHandlerFixture, expectCompatibilityReport, expectCurrentExtensionContract, expectOperationResult, explicitBaselineFixture, extensionIndexFixture, installedBaselineFixture, moduleKey, noBaselineFixture, operationHookFixture, providerFixture, registryBaselineFixture, renderPlugin, repositoryBaselineFixture, uiExtensionFixture };
458
+ export type { FakePluginRuntime, FakePluginRuntimeOptions, InMemoryFederatedModules, InMemoryModuleRegistry, InMemoryModuleRequest, MockApiHandler, MockApiRequest, PluginRenderResult, TestBaseline, TestBaselineKind, TestCompatibilityReport };
package/dist/index.js ADDED
@@ -0,0 +1,470 @@
1
+ // src/assertions.ts
2
+ async function expectOperationResult(runtime, request, expected) {
3
+ const result = await runtime.runOperation(request);
4
+ if (expected.execution && result.execution !== expected.execution)
5
+ throw new Error(
6
+ `Expected execution '${expected.execution}', got '${result.execution}'.`
7
+ );
8
+ if (expected.status && result.status !== expected.status)
9
+ throw new Error(
10
+ `Expected status '${expected.status}', got '${result.status}'.`
11
+ );
12
+ if ("result" in expected && !Object.is(result.result, expected.result))
13
+ throw new Error("Unexpected operation result.");
14
+ }
15
+ function createCallLog() {
16
+ const calls = [];
17
+ return {
18
+ calls,
19
+ record: (value) => {
20
+ calls.push(value);
21
+ },
22
+ expect: (...expected) => {
23
+ if (JSON.stringify(calls) !== JSON.stringify(expected))
24
+ throw new Error(
25
+ `Expected calls ${JSON.stringify(expected)}, got ${JSON.stringify(calls)}.`
26
+ );
27
+ }
28
+ };
29
+ }
30
+
31
+ // src/contracts.ts
32
+ function baselineFixture(kind, contract, options = {}) {
33
+ const pluginId = options.pluginId ?? "plugmatica.test";
34
+ return {
35
+ pluginId,
36
+ pluginVersion: options.pluginVersion,
37
+ contract,
38
+ provenance: {
39
+ kind,
40
+ description: `${kind} test baseline for ${pluginId}`,
41
+ reference: options.reference,
42
+ pluginVersion: options.pluginVersion
43
+ }
44
+ };
45
+ }
46
+ var repositoryBaselineFixture = (contract, options) => baselineFixture("repository", contract, options);
47
+ var registryBaselineFixture = (contract, options) => baselineFixture("registry", contract, options);
48
+ var installedBaselineFixture = (contract, options) => baselineFixture("installed", contract, options);
49
+ var explicitBaselineFixture = (contract, options) => baselineFixture("explicit", contract, options);
50
+ var noBaselineFixture = () => null;
51
+ function expectCurrentExtensionContract(actual, expected) {
52
+ const left = JSON.stringify(actual);
53
+ const right = JSON.stringify(expected);
54
+ if (left !== right)
55
+ throw new Error(
56
+ `Current Extension Contract mismatch.
57
+ Expected: ${right}
58
+ Actual: ${left}`
59
+ );
60
+ }
61
+ function expectCompatibilityReport(report, expected) {
62
+ if (expected.status && report.status !== expected.status)
63
+ throw new Error(
64
+ `Expected compatibility status '${expected.status}', got '${report.status}'.`
65
+ );
66
+ if ("baselineKind" in expected && (report.baseline?.kind ?? null) !== expected.baselineKind)
67
+ throw new Error(
68
+ `Expected baseline '${String(expected.baselineKind)}', got '${String(report.baseline?.kind ?? null)}'.`
69
+ );
70
+ for (const key of ["added", "removed", "changed", "preserved"]) {
71
+ if (!expected[key]) continue;
72
+ const actual = report[key].map((item) => item.identity).sort();
73
+ const wanted = [...expected[key]].sort();
74
+ if (JSON.stringify(actual) !== JSON.stringify(wanted))
75
+ throw new Error(`Compatibility ${key} mismatch.`);
76
+ }
77
+ }
78
+
79
+ // src/fixtures.ts
80
+ import {
81
+ createExtensionIndex
82
+ } from "@plugmatica/plugin-sdk/extension-index";
83
+ var DEFAULT_CONTRACT = {
84
+ id: "plugmatica.test",
85
+ version: "^1.0.0"
86
+ };
87
+ function common(kind, input) {
88
+ const id = input.id ?? `${kind}-fixture`;
89
+ return {
90
+ id,
91
+ pluginIdentifier: input.pluginIdentifier ?? "plugmatica.contributor",
92
+ pluginVersion: input.pluginVersion ?? "1.0.0",
93
+ targetPluginIdentifier: input.targetPluginIdentifier ?? "plugmatica.target",
94
+ extensionKey: id,
95
+ module: input.module ?? `./${id}`,
96
+ order: input.order ?? 100,
97
+ contract: input.contract ?? DEFAULT_CONTRACT
98
+ };
99
+ }
100
+ function uiExtensionFixture(input = {}) {
101
+ return {
102
+ ...common("ui", input),
103
+ kind: "ui",
104
+ target: {
105
+ surface: input.surface ?? "tabs",
106
+ key: input.key ?? "fixture.tabs",
107
+ point: input.point ?? "items"
108
+ }
109
+ };
110
+ }
111
+ function operationHookFixture(input = {}) {
112
+ return {
113
+ ...common("operation_hook", input),
114
+ kind: "operation_hook",
115
+ target: {
116
+ surface: input.surface ?? "form",
117
+ key: input.key ?? "fixture.form",
118
+ operation: input.operation ?? "submit"
119
+ },
120
+ phases: input.phases ?? ["before", "after"]
121
+ };
122
+ }
123
+ function eventHandlerFixture(input = {}) {
124
+ return {
125
+ ...common("event_handler", input),
126
+ kind: "event_handler",
127
+ target: { event: input.event ?? "fixture.saved" }
128
+ };
129
+ }
130
+ function providerFixture(input = {}) {
131
+ return {
132
+ ...common("provider", input),
133
+ kind: "provider",
134
+ target: { provider: input.provider ?? "fixture.provider" }
135
+ };
136
+ }
137
+ function extensionIndexFixture(extensions = []) {
138
+ return createExtensionIndex(extensions);
139
+ }
140
+ function currentExtensionContractFixture(overrides = {}) {
141
+ return {
142
+ surfaces: overrides.surfaces ?? [],
143
+ events: overrides.events ?? [],
144
+ providers: overrides.providers ?? []
145
+ };
146
+ }
147
+
148
+ // src/mocks.ts
149
+ import { createFallbackScopedI18n } from "@plugmatica/i18n";
150
+ function createMockScopedPluginApi(options = {}) {
151
+ const requests = [];
152
+ const invoke = async (method, path, body, requestOptions) => {
153
+ const request = requestOptions === void 0 ? { method, path, body } : { method, path, body, options: requestOptions };
154
+ requests.push(request);
155
+ const handler = options.handlers?.[`${method} ${path}`] ?? options.defaultHandler;
156
+ if (!handler)
157
+ throw new Error(`No mock plugin API handler for ${method} ${path}.`);
158
+ const signal = requestOptions?.signal;
159
+ if (signal?.aborted) throw mockAbortReason(signal);
160
+ if (!signal) return await handler(request);
161
+ return await new Promise((resolve, reject) => {
162
+ const onAbort = () => {
163
+ signal.removeEventListener("abort", onAbort);
164
+ reject(mockAbortReason(signal));
165
+ };
166
+ signal.addEventListener("abort", onAbort, { once: true });
167
+ if (signal.aborted) {
168
+ onAbort();
169
+ return;
170
+ }
171
+ try {
172
+ Promise.resolve(handler(request)).then(
173
+ (value) => {
174
+ signal.removeEventListener("abort", onAbort);
175
+ resolve(value);
176
+ },
177
+ (error) => {
178
+ signal.removeEventListener("abort", onAbort);
179
+ reject(error);
180
+ }
181
+ );
182
+ } catch (error) {
183
+ signal.removeEventListener("abort", onAbort);
184
+ reject(error);
185
+ }
186
+ });
187
+ };
188
+ const meta = async (method, path, body, requestOptions) => ({
189
+ data: await invoke(method, path, body, requestOptions),
190
+ status: 200,
191
+ statusText: "OK",
192
+ headers: {},
193
+ requestId: null,
194
+ invocationId: null
195
+ });
196
+ return {
197
+ requests,
198
+ get: (p, o) => invoke("GET", p, void 0, o),
199
+ getBlob: (p, o) => invoke("GET", p, void 0, o),
200
+ getTransferBlob: (p, o) => invoke("GET_TRANSFER", p, void 0, o),
201
+ uploadTransfer: (p, b, o) => invoke("PUT_TRANSFER", p, b, o),
202
+ getArrayBuffer: (p, o) => invoke("GET", p, void 0, o),
203
+ post: (p, b, o) => invoke("POST", p, b, o),
204
+ put: (p, b, o) => invoke("PUT", p, b, o),
205
+ patch: (p, b, o) => invoke("PATCH", p, b, o),
206
+ delete: (p, o) => invoke("DELETE", p, void 0, o),
207
+ getWithMeta: (p, o) => meta("GET", p, void 0, o),
208
+ postWithMeta: (p, b, o) => meta("POST", p, b, o),
209
+ putWithMeta: (p, b, o) => meta("PUT", p, b, o),
210
+ patchWithMeta: (p, b, o) => meta("PATCH", p, b, o),
211
+ deleteWithMeta: (p, o) => meta("DELETE", p, void 0, o)
212
+ };
213
+ }
214
+ function mockAbortReason(signal) {
215
+ return signal.reason ?? new DOMException("The request was aborted.", "AbortError");
216
+ }
217
+ function createMockI18n(namespace = "plugmatica.test", locale = "en") {
218
+ const fallback = createFallbackScopedI18n(namespace, locale);
219
+ return {
220
+ ...fallback,
221
+ t: (reference, values) => values ? `${reference}:${JSON.stringify(values)}` : reference
222
+ };
223
+ }
224
+ function createMockEntityApi(initial = []) {
225
+ let next = initial.length + 1;
226
+ const values = /* @__PURE__ */ new Map();
227
+ for (const item of initial)
228
+ values.set(item.pid, { value: item, revision: 1, schemaVersion: 1 });
229
+ return {
230
+ values,
231
+ async list(_options) {
232
+ return { items: [...values.values()], nextCursor: null };
233
+ },
234
+ async get(pid) {
235
+ const value = values.get(pid);
236
+ if (!value) throw new Error(`Entity '${pid}' not found.`);
237
+ return value;
238
+ },
239
+ async create(value) {
240
+ const pid = String(
241
+ value.pid ?? `entity-${next++}`
242
+ );
243
+ const entity = {
244
+ ...value,
245
+ pid
246
+ };
247
+ const envelope = {
248
+ value: entity,
249
+ revision: 1,
250
+ schemaVersion: 1
251
+ };
252
+ values.set(pid, envelope);
253
+ return envelope;
254
+ },
255
+ async update(pid, update) {
256
+ const current = values.get(pid);
257
+ if (!current) throw new Error(`Entity '${pid}' not found.`);
258
+ if (current.revision !== update.expectedRevision)
259
+ throw new Error(`Revision mismatch for '${pid}'.`);
260
+ const envelope = {
261
+ value: { ...current.value, ...update.patch },
262
+ revision: current.revision + 1,
263
+ schemaVersion: current.schemaVersion
264
+ };
265
+ values.set(pid, envelope);
266
+ return envelope;
267
+ },
268
+ async delete(pid, expectedRevision) {
269
+ const current = values.get(pid);
270
+ if (!current) throw new Error(`Entity '${pid}' not found.`);
271
+ if (current.revision !== expectedRevision)
272
+ throw new Error(`Revision mismatch for '${pid}'.`);
273
+ values.delete(pid);
274
+ return { deleted: true, pid };
275
+ }
276
+ };
277
+ }
278
+
279
+ // src/modules.ts
280
+ function moduleKey(pluginIdentifier, module) {
281
+ const normalized = module.startsWith("./") ? module : `./${module}`;
282
+ return `${pluginIdentifier}::${normalized}`;
283
+ }
284
+ function createInMemoryModuleRegistry(initial = {}) {
285
+ const values = new Map(Object.entries(initial));
286
+ const requests = [];
287
+ const loadModule = async (pluginIdentifier, module) => {
288
+ requests.push({ pluginIdentifier, module });
289
+ const key = moduleKey(pluginIdentifier, module);
290
+ if (!values.has(key)) {
291
+ throw new Error(`Test federated module '${key}' is not registered.`);
292
+ }
293
+ return values.get(key);
294
+ };
295
+ return {
296
+ get modules() {
297
+ return values;
298
+ },
299
+ get requests() {
300
+ return requests;
301
+ },
302
+ loadModule,
303
+ register(pluginIdentifier, module, value) {
304
+ values.set(moduleKey(pluginIdentifier, module), value);
305
+ },
306
+ remove(pluginIdentifier, module) {
307
+ values.delete(moduleKey(pluginIdentifier, module));
308
+ },
309
+ clear() {
310
+ values.clear();
311
+ },
312
+ clearRequests() {
313
+ requests.splice(0, requests.length);
314
+ }
315
+ };
316
+ }
317
+
318
+ // src/runtime.tsx
319
+ import {
320
+ createPluginRuntime,
321
+ PluginRuntimeProvider
322
+ } from "@plugmatica/plugin-sdk";
323
+ import {
324
+ createExtensionIndex as createExtensionIndex2
325
+ } from "@plugmatica/plugin-sdk/extension-index";
326
+ import {
327
+ ExtensionExecutionRuntime,
328
+ ExtensionHost,
329
+ UiExtensionResolver
330
+ } from "@plugmatica/plugin-sdk/host";
331
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
332
+ import { render } from "@testing-library/react";
333
+ import * as React from "react";
334
+ import { jsx } from "react/jsx-runtime";
335
+ var defaultSession = {
336
+ actor: { pid: "test-actor", kind: "user", displayName: "Test User" },
337
+ user: {
338
+ pid: "test-user",
339
+ email: "test@plugmatica.local",
340
+ name: "Test User",
341
+ locale: "en",
342
+ avatarPath: null,
343
+ status: "active"
344
+ },
345
+ guest: null
346
+ };
347
+ function createFakePluginRuntime(options = {}) {
348
+ const target = options.pluginIdentifier ?? "plugmatica.test";
349
+ const index = createExtensionIndex2(options.extensions ?? []);
350
+ const modules = options.modules ?? createInMemoryModuleRegistry();
351
+ const context = {
352
+ plugin: { identifier: target, version: options.pluginVersion ?? "1.0.0" },
353
+ api: options.api ?? createMockScopedPluginApi({ defaultHandler: () => ({}) }),
354
+ i18n: createMockI18n(target),
355
+ session: options.session ?? defaultSession,
356
+ guest: options.guest,
357
+ navigation: options.navigation
358
+ };
359
+ const sourceContext = (item) => ({
360
+ ...context,
361
+ plugin: { identifier: item.pluginIdentifier, version: "1.0.0" },
362
+ i18n: createMockI18n(item.pluginIdentifier)
363
+ });
364
+ const loadModule = modules.loadModule;
365
+ const resolver = new UiExtensionResolver({
366
+ targetPluginIdentifier: target,
367
+ extensionIndex: index,
368
+ ownerContext: context,
369
+ resolveRemote: () => null,
370
+ resolveContext: sourceContext,
371
+ loadModule,
372
+ routePath: options.routePath
373
+ });
374
+ const execution = new ExtensionExecutionRuntime({
375
+ targetPluginIdentifier: target,
376
+ extensionIndex: index,
377
+ ownerContext: context,
378
+ resolveRemote: () => null,
379
+ resolveContext: sourceContext,
380
+ loadModule
381
+ });
382
+ const extensionApi = {
383
+ registerSurface: () => void 0,
384
+ renderUi: (request) => {
385
+ const { surfaceDescriptor: _surfaceDescriptor, ...hostRequest } = request;
386
+ return React.createElement(ExtensionHost, { resolver, ...hostRequest });
387
+ },
388
+ resolveUi: (request) => request.active === false ? Promise.resolve([]) : resolver.resolveContributions(request),
389
+ runOperation: (request) => execution.runOperation(request),
390
+ emitEvent: (request) => execution.emitEvent(request),
391
+ resolveProviders: (request) => execution.resolveProviders(request)
392
+ };
393
+ context.extensions = extensionApi;
394
+ const queryClient = options.queryClient ?? new QueryClient({
395
+ defaultOptions: {
396
+ queries: { retry: false },
397
+ mutations: { retry: false }
398
+ }
399
+ });
400
+ return {
401
+ context,
402
+ queryClient,
403
+ runtime: createPluginRuntime(context),
404
+ extensionApi,
405
+ extensionIndex: index,
406
+ resolver,
407
+ execution,
408
+ modules
409
+ };
410
+ }
411
+ function renderPlugin(ui, options = {}) {
412
+ const {
413
+ pluginIdentifier,
414
+ pluginVersion,
415
+ extensions,
416
+ modules,
417
+ api,
418
+ session,
419
+ guest,
420
+ navigation,
421
+ routePath,
422
+ queryClient,
423
+ ...renderOptions
424
+ } = options;
425
+ const fake = createFakePluginRuntime({
426
+ pluginIdentifier,
427
+ pluginVersion,
428
+ extensions,
429
+ modules,
430
+ api,
431
+ session,
432
+ guest,
433
+ navigation,
434
+ routePath,
435
+ queryClient
436
+ });
437
+ const rendered = render(
438
+ /* @__PURE__ */ jsx(QueryClientProvider, { client: fake.queryClient, children: /* @__PURE__ */ jsx(PluginRuntimeProvider, { value: fake.runtime, children: ui }) }),
439
+ renderOptions
440
+ );
441
+ return {
442
+ ...rendered,
443
+ ...fake
444
+ };
445
+ }
446
+ export {
447
+ baselineFixture,
448
+ createCallLog,
449
+ createFakePluginRuntime,
450
+ createInMemoryModuleRegistry,
451
+ createMockEntityApi,
452
+ createMockI18n,
453
+ createMockScopedPluginApi,
454
+ currentExtensionContractFixture,
455
+ eventHandlerFixture,
456
+ expectCompatibilityReport,
457
+ expectCurrentExtensionContract,
458
+ expectOperationResult,
459
+ explicitBaselineFixture,
460
+ extensionIndexFixture,
461
+ installedBaselineFixture,
462
+ moduleKey,
463
+ noBaselineFixture,
464
+ operationHookFixture,
465
+ providerFixture,
466
+ registryBaselineFixture,
467
+ renderPlugin,
468
+ repositoryBaselineFixture,
469
+ uiExtensionFixture
470
+ };
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
2
  "name": "@plugmatica/plugin-testing",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "sideEffects": false,
21
+ "scripts": {
22
+ "build": "rimraf dist && tsup src/index.ts --format esm --dts",
23
+ "typecheck": "tsc -p tsconfig.json --noEmit",
24
+ "test": "vitest run"
25
+ },
26
+ "peerDependencies": {
27
+ "@module-federation/enhanced": "2.9.4",
28
+ "@testing-library/react": "^16.0.0",
29
+ "react": "^19.0.0",
30
+ "react-dom": "^19.0.0",
31
+ "@tanstack/react-query": "^5.90.21"
32
+ },
33
+ "devDependencies": {
34
+ "@module-federation/enhanced": "2.9.4",
35
+ "@plugmatica/core-sdk": "^0.1.0",
36
+ "@plugmatica/i18n": "^0.1.0",
37
+ "@plugmatica/plugin-sdk": "^0.1.0",
38
+ "@plugmatica/ui-kit": "^0.1.0",
39
+ "@testing-library/react": "^16.3.2",
40
+ "@types/react": "^19.2.2",
41
+ "@types/react-dom": "^19.2.2",
42
+ "jsdom": "^28.1.0",
43
+ "rimraf": "^6.0.1",
44
+ "tsup": "^9.0.0",
45
+ "typescript": "^5.9.3",
46
+ "vitest": "^4.0.18",
47
+ "@tanstack/react-query": "^5.90.21"
48
+ },
49
+ "description": "Black-box testing helpers for independently developed Plugmatica plugins.",
50
+ "license": "MIT",
51
+ "publishConfig": {
52
+ "access": "public",
53
+ "provenance": true,
54
+ "tag": "beta",
55
+ "registry": "https://registry.npmjs.org/"
56
+ },
57
+ "dependencies": {
58
+ "@plugmatica/core-sdk": "^0.1.0",
59
+ "@plugmatica/i18n": "^0.1.0",
60
+ "@plugmatica/plugin-sdk": "^0.1.0",
61
+ "@plugmatica/ui-kit": "^0.1.0"
62
+ },
63
+ "plugmatica": {
64
+ "owner": "Plugmatica OSS",
65
+ "stability": "beta",
66
+ "staticPolicy": "typecheck plus repository release gates"
67
+ },
68
+ "repository": {
69
+ "type": "git",
70
+ "url": "git+https://github.com/plugmatica/plugmatica-sdk.git",
71
+ "directory": "frontend/packages/plugin-testing"
72
+ },
73
+ "homepage": "https://plugmatica.com",
74
+ "bugs": {
75
+ "url": "https://github.com/plugmatica/plugmatica-sdk/issues"
76
+ },
77
+ "engines": {
78
+ "node": ">=22"
79
+ }
80
+ }