@testforgejs/vue-test-plugin-primevue-v3 1.0.0-beta.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/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ The MIT License (MIT)
2
+ Copyright © 2026 Roman Levchenko
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,203 @@
1
+ # @testforgejs/vue-test-plugin-primevue-v3
2
+
3
+ PrimeVue 3 integration for TestForge component tests.
4
+
5
+ ## Installation
6
+
7
+ Choose your preferred package manager.
8
+
9
+ ### pnpm
10
+
11
+ ```bash
12
+ pnpm add -D @testforgejs/vue-test-plugin-primevue-v3@beta
13
+ ```
14
+
15
+ ### npm
16
+
17
+ ```bash
18
+ npm install -D @testforgejs/vue-test-plugin-primevue-v3@beta
19
+ ```
20
+
21
+ ### Yarn
22
+
23
+ ```bash
24
+ yarn add -D @testforgejs/vue-test-plugin-primevue-v3@beta
25
+ ```
26
+
27
+ > `@testforgejs/vue-test-core` is required.
28
+
29
+ ## Usage
30
+
31
+ ### Using plugin defaults
32
+
33
+ The plugin provides a project-independent default configuration through `getDefaultOptions()`:
34
+
35
+ ```typescript
36
+ import { createTestFramework } from "@testforgejs/vue-test-core";
37
+ import { primeVuePlugin } from "@testforgejs/vue-test-plugin-primevue-v3";
38
+
39
+ const framework = createTestFramework({
40
+ presets: {
41
+ default: {
42
+ manifest: [
43
+ {
44
+ module: primeVuePlugin,
45
+ enabled: true,
46
+ },
47
+ ],
48
+ defaults: {
49
+ primevueV3: primeVuePlugin.getDefaultOptions(),
50
+ },
51
+ },
52
+ },
53
+ });
54
+
55
+ const factory = framework.testComponentFactory(MyComponent);
56
+
57
+ const wrapper = factory();
58
+ ```
59
+
60
+ `getDefaultOptions()` returns an options factory suitable for use in a preset.
61
+
62
+ The plugin-provided defaults use an empty PrimeVue configuration:
63
+
64
+ ```typescript
65
+ {
66
+ }
67
+ ```
68
+
69
+ This preserves PrimeVue 3's standard configuration without introducing project-specific behavior or forcing unstyled mode.
70
+
71
+ Plugin defaults are **not applied automatically**. Adding the plugin to a preset manifest declares that the plugin is available and whether it is enabled; the preset explicitly decides whether to use the plugin-provided defaults or provide its own configuration.
72
+
73
+ ### Providing custom options
74
+
75
+ You can define the PrimeVue configuration directly in the preset instead:
76
+
77
+ ```typescript
78
+ import { createTestFramework } from "@testforgejs/vue-test-core";
79
+ import { primeVuePlugin } from "@testforgejs/vue-test-plugin-primevue-v3";
80
+
81
+ const framework = createTestFramework({
82
+ presets: {
83
+ default: {
84
+ manifest: [
85
+ {
86
+ module: primeVuePlugin,
87
+ enabled: true,
88
+ },
89
+ ],
90
+ defaults: {
91
+ primevueV3: () => ({
92
+ ripple: true,
93
+ inputStyle: "filled",
94
+ }),
95
+ },
96
+ },
97
+ },
98
+ });
99
+ ```
100
+
101
+ Using `getDefaultOptions()` is optional. Define custom defaults when tests require application-specific PrimeVue configuration such as ripple effects, input styling, locale settings, pass-through configuration, unstyled mode, or other PrimeVue behavior.
102
+
103
+ ## Configuration
104
+
105
+ ### PrimeVue options
106
+
107
+ The plugin integrates TestForge with PrimeVue 3 by registering the PrimeVue Vue plugin with the provided configuration.
108
+
109
+ Configuration fields such as `ripple`, `inputStyle`, `locale`, `pt`, `unstyled`, and other PrimeVue options belong to PrimeVue.
110
+
111
+ TestForge does not define an alternative configuration format for PrimeVue. The integration passes the provided configuration to the PrimeVue plugin during installation.
112
+
113
+ Refer to the PrimeVue 3 documentation for the complete set of supported configuration options and their behavior.
114
+
115
+ ### Styled and unstyled modes
116
+
117
+ The plugin-provided defaults do not select a styling mode explicitly:
118
+
119
+ ```typescript
120
+ {
121
+ }
122
+ ```
123
+
124
+ PrimeVue 3 uses styled mode by default. Application themes in styled mode are configured separately by loading the corresponding PrimeVue theme CSS.
125
+
126
+ For example, theme setup belongs to the application's test environment or project configuration rather than the TestForge plugin options.
127
+
128
+ PrimeVue 3 also supports unstyled mode when explicitly enabled:
129
+
130
+ ```typescript
131
+ defaults: {
132
+ primevueV3: () => ({
133
+ unstyled: true,
134
+ }),
135
+ },
136
+ ```
137
+
138
+ Use a project-specific preset when component tests need to reproduce application-specific PrimeVue configuration.
139
+
140
+ ### Options factories
141
+
142
+ Preset defaults are defined as factories:
143
+
144
+ ```typescript
145
+ defaults: {
146
+ primevueV3: () => ({
147
+ ripple: true,
148
+ inputStyle: "filled",
149
+ }),
150
+ },
151
+ ```
152
+
153
+ Each invocation of the factory produces a fresh options object for the current TestForge pipeline execution.
154
+
155
+ `primeVuePlugin.getDefaultOptions()` follows the same contract: it returns an options factory rather than a shared options object.
156
+
157
+ This allows presets to choose explicitly between:
158
+
159
+ - the project-independent defaults provided by the plugin; and
160
+ - a custom PrimeVue configuration defined by the preset.
161
+
162
+ ## Package exports
163
+
164
+ The package provides both descriptive and standardized plugin exports:
165
+
166
+ ```typescript
167
+ import { primeVuePlugin, plugin, PLUGIN_NAME } from "@testforgejs/vue-test-plugin-primevue-v3";
168
+ ```
169
+
170
+ ### `primeVuePlugin`
171
+
172
+ The descriptive PrimeVue 3 plugin module export.
173
+
174
+ ### `plugin`
175
+
176
+ The standardized plugin module export.
177
+
178
+ It references the same plugin module as `primeVuePlugin` and provides a consistent package-level API across TestForge plugin packages.
179
+
180
+ ### `PLUGIN_NAME`
181
+
182
+ The standardized plugin identifier export.
183
+
184
+ For this package:
185
+
186
+ ```typescript
187
+ PLUGIN_NAME === "primevueV3";
188
+ ```
189
+
190
+ The standardized `plugin` and `PLUGIN_NAME` exports are useful for tooling and other code that works with TestForge plugin packages generically.
191
+
192
+ ## Supported versions
193
+
194
+ - Vue: 3.3.0 or higher
195
+ - PrimeVue: 3.x
196
+
197
+ ## Documentation
198
+
199
+ See the [TestForge documentation](https://github.com/testforgejs/testforge#readme).
200
+
201
+ ### API Reference
202
+
203
+ See the [API reference](https://github.com/testforgejs/testforge/blob/main/packages/vue-test-plugin-primevue-v3/docs/api/README.md).
package/dist/index.cjs ADDED
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ PLUGIN_NAME: () => PRIMEVUE_V3_PLUGIN_NAME,
34
+ plugin: () => primeVuePlugin,
35
+ primeVuePlugin: () => primeVuePlugin
36
+ });
37
+ module.exports = __toCommonJS(index_exports);
38
+
39
+ // src/module/createPrimeVuePlugin.ts
40
+ var import_config = __toESM(require("primevue/config"), 1);
41
+ var import_vue_test_core = require("@testforgejs/vue-test-core");
42
+ function createPrimeVuePlugin(options) {
43
+ return (0, import_vue_test_core.createVuePlugin)(import_config.default, options);
44
+ }
45
+
46
+ // src/defaults.ts
47
+ var defaultOptions = () => () => ({});
48
+
49
+ // src/constants/constants.ts
50
+ var PRIMEVUE_V3_PLUGIN_NAME = "primevueV3";
51
+
52
+ // src/module/primeVuePlugin.ts
53
+ var primeVuePlugin = {
54
+ /**
55
+ * Returns the plugin identifier used in TestForge configuration.
56
+ *
57
+ * @returns The plugin registration key (`"primevueV3"`).
58
+ */
59
+ getName: () => PRIMEVUE_V3_PLUGIN_NAME,
60
+ /**
61
+ * Returns the PrimeVue 3 plugin lifecycle definition.
62
+ *
63
+ * @returns Plugin lifecycle hooks consumed by the TestForge kernel.
64
+ */
65
+ getDefinition: () => ({
66
+ create: createPrimeVuePlugin
67
+ }),
68
+ /**
69
+ * Creates the default PrimeVue 3 options used by TestForge.
70
+ *
71
+ * @returns A factory that creates the default PrimeVue 3 options.
72
+ */
73
+ getDefaultOptions: defaultOptions
74
+ };
75
+ // Annotate the CommonJS export names for ESM import in node:
76
+ 0 && (module.exports = {
77
+ PLUGIN_NAME,
78
+ plugin,
79
+ primeVuePlugin
80
+ });
@@ -0,0 +1,71 @@
1
+ import PrimeVue, { PrimeVueConfiguration } from 'primevue/config';
2
+ import { PluginModuleWithDefaults } from '@testforgejs/vue-test-core';
3
+
4
+ declare const PRIMEVUE_V3_PLUGIN_NAME: "primevueV3";
5
+
6
+ /**
7
+ * Vue Test Utils compatible plugin tuple for PrimeVue 3.
8
+ *
9
+ * PrimeVue 3 is an install-based Vue plugin and therefore integrates
10
+ * through a standard `[plugin, options]` tuple instead of a runtime instance.
11
+ *
12
+ * @see {@link PrimeVue}
13
+ * @see {@link PrimeVueConfiguration}
14
+ */
15
+ type PrimeVueMountPlugin = [typeof PrimeVue, PrimeVueConfiguration];
16
+ /**
17
+ * Configuration options for the PrimeVue 3 TestForge plugin.
18
+ *
19
+ * This type maps directly to the official PrimeVue 3 configuration object
20
+ * and intentionally does not include TestForge runtime controls such as
21
+ * `expose()` or `__meta.instance`, because PrimeVue does not create
22
+ * a reusable runtime instance.
23
+ *
24
+ * @see {@link PrimeVueConfiguration}
25
+ */
26
+ type VueTestPrimeVueOptions = PrimeVueConfiguration;
27
+
28
+ /**
29
+ * Extends TestForge kernel types for PrimeVue 3 integration.
30
+ *
31
+ * Registers the `primevueV3` configuration key inside the global
32
+ * plugin options map, enabling strict typing and IDE autocompletion
33
+ * when configuring PrimeVue 3 in component tests.
34
+ *
35
+ * @module Augmentation
36
+ */
37
+ declare module "@testforgejs/vue-test-core" {
38
+ /**
39
+ * Global TestForge plugin configuration registry.
40
+ */
41
+ interface PluginOptionsMap {
42
+ /**
43
+ * Configuration for the `primevueV3` plugin.
44
+ *
45
+ * Accepts standard {@link VueTestPrimeVueOptions},
46
+ * which correspond directly to PrimeVue 3 configuration options.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * factory({}, {
51
+ * plugins: {
52
+ * primevueV3: {
53
+ * ripple: true
54
+ * }
55
+ * }
56
+ * })
57
+ * ```
58
+ */
59
+ [PRIMEVUE_V3_PLUGIN_NAME]: VueTestPrimeVueOptions;
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Official TestForge integration module for PrimeVue 3.
65
+ *
66
+ * Registers PrimeVue 3 in the TestForge plugin pipeline and exposes
67
+ * the `primevueV3` configuration key for presets and mount options.
68
+ */
69
+ declare const primeVuePlugin: PluginModuleWithDefaults<PrimeVueMountPlugin, VueTestPrimeVueOptions>;
70
+
71
+ export { PRIMEVUE_V3_PLUGIN_NAME as PLUGIN_NAME, type PrimeVueMountPlugin, type VueTestPrimeVueOptions, primeVuePlugin as plugin, primeVuePlugin };
@@ -0,0 +1,71 @@
1
+ import PrimeVue, { PrimeVueConfiguration } from 'primevue/config';
2
+ import { PluginModuleWithDefaults } from '@testforgejs/vue-test-core';
3
+
4
+ declare const PRIMEVUE_V3_PLUGIN_NAME: "primevueV3";
5
+
6
+ /**
7
+ * Vue Test Utils compatible plugin tuple for PrimeVue 3.
8
+ *
9
+ * PrimeVue 3 is an install-based Vue plugin and therefore integrates
10
+ * through a standard `[plugin, options]` tuple instead of a runtime instance.
11
+ *
12
+ * @see {@link PrimeVue}
13
+ * @see {@link PrimeVueConfiguration}
14
+ */
15
+ type PrimeVueMountPlugin = [typeof PrimeVue, PrimeVueConfiguration];
16
+ /**
17
+ * Configuration options for the PrimeVue 3 TestForge plugin.
18
+ *
19
+ * This type maps directly to the official PrimeVue 3 configuration object
20
+ * and intentionally does not include TestForge runtime controls such as
21
+ * `expose()` or `__meta.instance`, because PrimeVue does not create
22
+ * a reusable runtime instance.
23
+ *
24
+ * @see {@link PrimeVueConfiguration}
25
+ */
26
+ type VueTestPrimeVueOptions = PrimeVueConfiguration;
27
+
28
+ /**
29
+ * Extends TestForge kernel types for PrimeVue 3 integration.
30
+ *
31
+ * Registers the `primevueV3` configuration key inside the global
32
+ * plugin options map, enabling strict typing and IDE autocompletion
33
+ * when configuring PrimeVue 3 in component tests.
34
+ *
35
+ * @module Augmentation
36
+ */
37
+ declare module "@testforgejs/vue-test-core" {
38
+ /**
39
+ * Global TestForge plugin configuration registry.
40
+ */
41
+ interface PluginOptionsMap {
42
+ /**
43
+ * Configuration for the `primevueV3` plugin.
44
+ *
45
+ * Accepts standard {@link VueTestPrimeVueOptions},
46
+ * which correspond directly to PrimeVue 3 configuration options.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * factory({}, {
51
+ * plugins: {
52
+ * primevueV3: {
53
+ * ripple: true
54
+ * }
55
+ * }
56
+ * })
57
+ * ```
58
+ */
59
+ [PRIMEVUE_V3_PLUGIN_NAME]: VueTestPrimeVueOptions;
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Official TestForge integration module for PrimeVue 3.
65
+ *
66
+ * Registers PrimeVue 3 in the TestForge plugin pipeline and exposes
67
+ * the `primevueV3` configuration key for presets and mount options.
68
+ */
69
+ declare const primeVuePlugin: PluginModuleWithDefaults<PrimeVueMountPlugin, VueTestPrimeVueOptions>;
70
+
71
+ export { PRIMEVUE_V3_PLUGIN_NAME as PLUGIN_NAME, type PrimeVueMountPlugin, type VueTestPrimeVueOptions, primeVuePlugin as plugin, primeVuePlugin };
package/dist/index.js ADDED
@@ -0,0 +1,41 @@
1
+ // src/module/createPrimeVuePlugin.ts
2
+ import PrimeVue from "primevue/config";
3
+ import { createVuePlugin } from "@testforgejs/vue-test-core";
4
+ function createPrimeVuePlugin(options) {
5
+ return createVuePlugin(PrimeVue, options);
6
+ }
7
+
8
+ // src/defaults.ts
9
+ var defaultOptions = () => () => ({});
10
+
11
+ // src/constants/constants.ts
12
+ var PRIMEVUE_V3_PLUGIN_NAME = "primevueV3";
13
+
14
+ // src/module/primeVuePlugin.ts
15
+ var primeVuePlugin = {
16
+ /**
17
+ * Returns the plugin identifier used in TestForge configuration.
18
+ *
19
+ * @returns The plugin registration key (`"primevueV3"`).
20
+ */
21
+ getName: () => PRIMEVUE_V3_PLUGIN_NAME,
22
+ /**
23
+ * Returns the PrimeVue 3 plugin lifecycle definition.
24
+ *
25
+ * @returns Plugin lifecycle hooks consumed by the TestForge kernel.
26
+ */
27
+ getDefinition: () => ({
28
+ create: createPrimeVuePlugin
29
+ }),
30
+ /**
31
+ * Creates the default PrimeVue 3 options used by TestForge.
32
+ *
33
+ * @returns A factory that creates the default PrimeVue 3 options.
34
+ */
35
+ getDefaultOptions: defaultOptions
36
+ };
37
+ export {
38
+ PRIMEVUE_V3_PLUGIN_NAME as PLUGIN_NAME,
39
+ primeVuePlugin as plugin,
40
+ primeVuePlugin
41
+ };
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@testforgejs/vue-test-plugin-primevue-v3",
3
+ "version": "1.0.0-beta.3",
4
+ "type": "module",
5
+ "description": "Official TestForge plugin for PrimeVue 3 integration in component tests",
6
+ "homepage": "https://github.com/testforgejs/testforge#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/testforgejs/testforge.git",
10
+ "directory": "packages/vue-test-plugin-primevue-v3"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/testforgejs/testforge/issues"
14
+ },
15
+ "main": "./dist/index.cjs",
16
+ "module": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js",
22
+ "require": "./dist/index.cjs"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "keywords": [
32
+ "vue",
33
+ "vue3",
34
+ "testing",
35
+ "component-testing",
36
+ "vue-test-utils",
37
+ "primevue",
38
+ "testforge",
39
+ "testforge-plugin"
40
+ ],
41
+ "license": "MIT",
42
+ "author": "Roman Levchenko",
43
+ "peerDependencies": {
44
+ "primevue": "^3.0.0",
45
+ "@testforgejs/vue-test-core": "1.0.0-beta.3"
46
+ },
47
+ "devDependencies": {
48
+ "primevue": "^3.0.0",
49
+ "@testforgejs/vue-test-core": "1.0.0-beta.3"
50
+ },
51
+ "testforge": {
52
+ "plugin": {
53
+ "schemaVersion": 1,
54
+ "displayName": "PrimeVue 3"
55
+ }
56
+ },
57
+ "scripts": {
58
+ "build": "tsup",
59
+ "dev": "tsup --watch",
60
+ "test:types": "tsd",
61
+ "docs:generate": "typedoc"
62
+ }
63
+ }