@testforgejs/vue-test-plugin-primevue 1.0.0-beta.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,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,68 @@
1
+ # @testforgejs/vue-test-plugin-primevue
2
+
3
+ Official TestForge plugin for PrimeVue integration in 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@beta
13
+ ```
14
+
15
+ ### npm
16
+
17
+ ```bash
18
+ npm install -D @testforgejs/vue-test-plugin-primevue@beta
19
+ ```
20
+
21
+ ### Yarn
22
+
23
+ ```bash
24
+ yarn add -D @testforgejs/vue-test-plugin-primevue@beta
25
+ ```
26
+
27
+ > `@testforgejs/vue-test-core` is required.
28
+
29
+ ## Usage
30
+
31
+ Register `primeVuePlugin` in the TestForge plugin manifest.
32
+
33
+ ```ts
34
+ import { createTestFramework } from "@testforgejs/vue-test-core";
35
+ import { primeVuePlugin } from "@testforgejs/vue-test-plugin-primevue";
36
+
37
+ const framework = createTestFramework({
38
+ presets: {
39
+ default: {
40
+ manifest: [
41
+ {
42
+ module: primeVuePlugin,
43
+ enabled: true,
44
+ },
45
+ ],
46
+ },
47
+ },
48
+ });
49
+
50
+ const factory = framework.testComponentFactory(MyComponent);
51
+
52
+ const wrapper = factory();
53
+ ```
54
+
55
+ The plugin provides PrimeVue integration for components mounted through TestForge.
56
+
57
+ ## Supported versions
58
+
59
+ - Vue: 3.x
60
+ - PrimeVue: 3.x and 4.x
61
+
62
+ ## Documentation
63
+
64
+ See the [TestForge documentation](https://github.com/testforgejs/testforge#readme).
65
+
66
+ ### API Reference
67
+
68
+ See the [API reference](https://github.com/testforgejs/testforge/blob/main/packages/vue-test-plugin-primevue/docs/api/README.md).
package/dist/index.cjs ADDED
@@ -0,0 +1,64 @@
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
+ primeVuePlugin: () => primeVuePlugin
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+
37
+ // src/module/createPrimeVuePlugin.ts
38
+ var import_config = __toESM(require("primevue/config"), 1);
39
+ var import_vue_test_core = require("@testforgejs/vue-test-core");
40
+ function createPrimeVuePlugin(options) {
41
+ return (0, import_vue_test_core.createVuePlugin)(import_config.default, options);
42
+ }
43
+
44
+ // src/module/primeVuePlugin.ts
45
+ var primeVuePlugin = {
46
+ /**
47
+ * Returns the plugin identifier used in TestForge configuration.
48
+ *
49
+ * @returns The plugin registration key (`"primevue"`).
50
+ */
51
+ getName: () => "primevue",
52
+ /**
53
+ * Returns the PrimeVue plugin lifecycle definition.
54
+ *
55
+ * @returns Plugin lifecycle hooks consumed by the TestForge kernel.
56
+ */
57
+ getDefinition: () => ({
58
+ create: createPrimeVuePlugin
59
+ })
60
+ };
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ primeVuePlugin
64
+ });
@@ -0,0 +1,69 @@
1
+ import PrimeVue, { PrimeVueConfiguration } from 'primevue/config';
2
+ import { PluginModule } from '@testforgejs/vue-test-core';
3
+
4
+ /**
5
+ * Vue Test Utils compatible plugin tuple for PrimeVue.
6
+ *
7
+ * PrimeVue is an install-based Vue plugin and therefore integrates
8
+ * through a standard `[plugin, options]` tuple instead of a runtime instance.
9
+ *
10
+ * @see {@link PrimeVue}
11
+ * @see {@link PrimeVueConfiguration}
12
+ */
13
+ type PrimeVueMountPlugin = [typeof PrimeVue, PrimeVueConfiguration];
14
+ /**
15
+ * Configuration options for the PrimeVue TestForge plugin.
16
+ *
17
+ * This type maps directly to the official PrimeVue configuration object
18
+ * and intentionally does not include TestForge runtime controls such as
19
+ * `expose()` or `__meta.instance`, because PrimeVue does not create
20
+ * a reusable runtime instance.
21
+ *
22
+ * @see {@link PrimeVueConfiguration}
23
+ */
24
+ type VueTestPrimeVueOptions = PrimeVueConfiguration;
25
+
26
+ /**
27
+ * Extends TestForge kernel types for PrimeVue integration.
28
+ *
29
+ * Registers the `primevue` configuration key inside the global
30
+ * plugin options map, enabling strict typing and IDE autocompletion
31
+ * when configuring PrimeVue in component tests.
32
+ *
33
+ * @module Augmentation
34
+ */
35
+ declare module "@testforgejs/vue-test-core" {
36
+ /**
37
+ * Global TestForge plugin configuration registry.
38
+ */
39
+ interface PluginOptionsMap {
40
+ /**
41
+ * Configuration for the `primevue` plugin.
42
+ *
43
+ * Accepts standard {@link VueTestPrimeVueOptions}
44
+ * which correspond directly to PrimeVue configuration options.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * factory({}, {
49
+ * plugins: {
50
+ * primevue: {
51
+ * ripple: true
52
+ * }
53
+ * }
54
+ * })
55
+ * ```
56
+ */
57
+ primevue: VueTestPrimeVueOptions;
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Official TestForge integration module for PrimeVue.
63
+ *
64
+ * Registers PrimeVue in the TestForge plugin pipeline and exposes
65
+ * the `primevue` configuration key for presets and mount options.
66
+ */
67
+ declare const primeVuePlugin: PluginModule<PrimeVueMountPlugin, VueTestPrimeVueOptions>;
68
+
69
+ export { type PrimeVueMountPlugin, type VueTestPrimeVueOptions, primeVuePlugin };
@@ -0,0 +1,69 @@
1
+ import PrimeVue, { PrimeVueConfiguration } from 'primevue/config';
2
+ import { PluginModule } from '@testforgejs/vue-test-core';
3
+
4
+ /**
5
+ * Vue Test Utils compatible plugin tuple for PrimeVue.
6
+ *
7
+ * PrimeVue is an install-based Vue plugin and therefore integrates
8
+ * through a standard `[plugin, options]` tuple instead of a runtime instance.
9
+ *
10
+ * @see {@link PrimeVue}
11
+ * @see {@link PrimeVueConfiguration}
12
+ */
13
+ type PrimeVueMountPlugin = [typeof PrimeVue, PrimeVueConfiguration];
14
+ /**
15
+ * Configuration options for the PrimeVue TestForge plugin.
16
+ *
17
+ * This type maps directly to the official PrimeVue configuration object
18
+ * and intentionally does not include TestForge runtime controls such as
19
+ * `expose()` or `__meta.instance`, because PrimeVue does not create
20
+ * a reusable runtime instance.
21
+ *
22
+ * @see {@link PrimeVueConfiguration}
23
+ */
24
+ type VueTestPrimeVueOptions = PrimeVueConfiguration;
25
+
26
+ /**
27
+ * Extends TestForge kernel types for PrimeVue integration.
28
+ *
29
+ * Registers the `primevue` configuration key inside the global
30
+ * plugin options map, enabling strict typing and IDE autocompletion
31
+ * when configuring PrimeVue in component tests.
32
+ *
33
+ * @module Augmentation
34
+ */
35
+ declare module "@testforgejs/vue-test-core" {
36
+ /**
37
+ * Global TestForge plugin configuration registry.
38
+ */
39
+ interface PluginOptionsMap {
40
+ /**
41
+ * Configuration for the `primevue` plugin.
42
+ *
43
+ * Accepts standard {@link VueTestPrimeVueOptions}
44
+ * which correspond directly to PrimeVue configuration options.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * factory({}, {
49
+ * plugins: {
50
+ * primevue: {
51
+ * ripple: true
52
+ * }
53
+ * }
54
+ * })
55
+ * ```
56
+ */
57
+ primevue: VueTestPrimeVueOptions;
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Official TestForge integration module for PrimeVue.
63
+ *
64
+ * Registers PrimeVue in the TestForge plugin pipeline and exposes
65
+ * the `primevue` configuration key for presets and mount options.
66
+ */
67
+ declare const primeVuePlugin: PluginModule<PrimeVueMountPlugin, VueTestPrimeVueOptions>;
68
+
69
+ export { type PrimeVueMountPlugin, type VueTestPrimeVueOptions, primeVuePlugin };
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
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/module/primeVuePlugin.ts
9
+ var primeVuePlugin = {
10
+ /**
11
+ * Returns the plugin identifier used in TestForge configuration.
12
+ *
13
+ * @returns The plugin registration key (`"primevue"`).
14
+ */
15
+ getName: () => "primevue",
16
+ /**
17
+ * Returns the PrimeVue plugin lifecycle definition.
18
+ *
19
+ * @returns Plugin lifecycle hooks consumed by the TestForge kernel.
20
+ */
21
+ getDefinition: () => ({
22
+ create: createPrimeVuePlugin
23
+ })
24
+ };
25
+ export {
26
+ primeVuePlugin
27
+ };
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@testforgejs/vue-test-plugin-primevue",
3
+ "version": "1.0.0-beta.0",
4
+ "type": "module",
5
+ "description": "Official TestForge plugin for PrimeVue 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"
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 || ^4.0.0",
45
+ "@testforgejs/vue-test-core": "1.0.0-beta.0"
46
+ },
47
+ "devDependencies": {
48
+ "primevue": "^4.0.0",
49
+ "@testforgejs/vue-test-core": "1.0.0-beta.0"
50
+ },
51
+ "scripts": {
52
+ "build": "tsup",
53
+ "dev": "tsup --watch",
54
+ "test:types": "tsd",
55
+ "docs:generate": "typedoc"
56
+ }
57
+ }