@wp-tester/config 0.0.1
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/README.md +18 -0
- package/dist/auto-mount.d.ts +11 -0
- package/dist/auto-mount.d.ts.map +1 -0
- package/dist/auto-mount.js +31 -0
- package/dist/auto-mount.js.map +1 -0
- package/dist/config.d.ts +41 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +213 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/options/index.d.ts +38 -0
- package/dist/options/index.d.ts.map +1 -0
- package/dist/options/index.js +23 -0
- package/dist/options/index.js.map +1 -0
- package/dist/options/phpunit-detect.d.ts +43 -0
- package/dist/options/phpunit-detect.d.ts.map +1 -0
- package/dist/options/phpunit-detect.js +94 -0
- package/dist/options/phpunit-detect.js.map +1 -0
- package/dist/options/phpunit.d.ts +12 -0
- package/dist/options/phpunit.d.ts.map +1 -0
- package/dist/options/phpunit.js +307 -0
- package/dist/options/phpunit.js.map +1 -0
- package/dist/options/project-root.d.ts +4 -0
- package/dist/options/project-root.d.ts.map +1 -0
- package/dist/options/project-root.js +38 -0
- package/dist/options/project-root.js.map +1 -0
- package/dist/options/project-type-detect.d.ts +27 -0
- package/dist/options/project-type-detect.d.ts.map +1 -0
- package/dist/options/project-type-detect.js +71 -0
- package/dist/options/project-type-detect.js.map +1 -0
- package/dist/options/project-type.d.ts +7 -0
- package/dist/options/project-type.d.ts.map +1 -0
- package/dist/options/project-type.js +50 -0
- package/dist/options/project-type.js.map +1 -0
- package/dist/options/smoke-tests.d.ts +4 -0
- package/dist/options/smoke-tests.d.ts.map +1 -0
- package/dist/options/smoke-tests.js +80 -0
- package/dist/options/smoke-tests.js.map +1 -0
- package/dist/path-mappers.d.ts +26 -0
- package/dist/path-mappers.d.ts.map +1 -0
- package/dist/path-mappers.js +32 -0
- package/dist/path-mappers.js.map +1 -0
- package/dist/resolved-types.d.ts +69 -0
- package/dist/resolved-types.d.ts.map +1 -0
- package/dist/resolved-types.js +2 -0
- package/dist/resolved-types.js.map +1 -0
- package/dist/schema.json +3443 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/wp-tester-config.d.ts +171 -0
- package/dist/wp-tester-config.d.ts.map +1 -0
- package/dist/wp-tester-config.js +2 -0
- package/dist/wp-tester-config.js.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ResolvedWPTesterConfig } from "./resolved-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Maps a host filesystem path to its corresponding VFS path in the playground
|
|
4
|
+
*
|
|
5
|
+
* @param hostPath - Absolute path on the host filesystem
|
|
6
|
+
* @param config - Resolved config with projectHostPath and projectVFSPath
|
|
7
|
+
* @returns Corresponding VFS path in the playground
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* hostToVfs('/project/tests/bootstrap.php', resolvedConfig)
|
|
11
|
+
* // Returns: '/wordpress/wp-content/plugins/my-plugin/tests/bootstrap.php'
|
|
12
|
+
*/
|
|
13
|
+
export declare function hostToVfs(hostPath: string, config: ResolvedWPTesterConfig): string;
|
|
14
|
+
/**
|
|
15
|
+
* Maps a VFS path in the playground to its corresponding host filesystem path
|
|
16
|
+
*
|
|
17
|
+
* @param vfsPath - Path in the playground VFS
|
|
18
|
+
* @param config - Resolved config with projectHostPath and projectVFSPath
|
|
19
|
+
* @returns Corresponding absolute path on the host filesystem
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* vfsToHost('/wordpress/wp-content/plugins/my-plugin/tests/bootstrap.php', resolvedConfig)
|
|
23
|
+
* // Returns: '/project/tests/bootstrap.php'
|
|
24
|
+
*/
|
|
25
|
+
export declare function vfsToHost(vfsPath: string, config: ResolvedWPTesterConfig): string;
|
|
26
|
+
//# sourceMappingURL=path-mappers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-mappers.d.ts","sourceRoot":"","sources":["../src/path-mappers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE/D;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,sBAAsB,GAC7B,MAAM,CAGR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,sBAAsB,GAC7B,MAAM,CAGR"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { relative, join } from "path";
|
|
2
|
+
/**
|
|
3
|
+
* Maps a host filesystem path to its corresponding VFS path in the playground
|
|
4
|
+
*
|
|
5
|
+
* @param hostPath - Absolute path on the host filesystem
|
|
6
|
+
* @param config - Resolved config with projectHostPath and projectVFSPath
|
|
7
|
+
* @returns Corresponding VFS path in the playground
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* hostToVfs('/project/tests/bootstrap.php', resolvedConfig)
|
|
11
|
+
* // Returns: '/wordpress/wp-content/plugins/my-plugin/tests/bootstrap.php'
|
|
12
|
+
*/
|
|
13
|
+
export function hostToVfs(hostPath, config) {
|
|
14
|
+
const relativePath = relative(config.projectHostPath, hostPath);
|
|
15
|
+
return join(config.projectVFSPath, relativePath);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Maps a VFS path in the playground to its corresponding host filesystem path
|
|
19
|
+
*
|
|
20
|
+
* @param vfsPath - Path in the playground VFS
|
|
21
|
+
* @param config - Resolved config with projectHostPath and projectVFSPath
|
|
22
|
+
* @returns Corresponding absolute path on the host filesystem
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* vfsToHost('/wordpress/wp-content/plugins/my-plugin/tests/bootstrap.php', resolvedConfig)
|
|
26
|
+
* // Returns: '/project/tests/bootstrap.php'
|
|
27
|
+
*/
|
|
28
|
+
export function vfsToHost(vfsPath, config) {
|
|
29
|
+
const relativePath = relative(config.projectVFSPath, vfsPath);
|
|
30
|
+
return join(config.projectHostPath, relativePath);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=path-mappers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-mappers.js","sourceRoot":"","sources":["../src/path-mappers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGtC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,SAAS,CACvB,QAAgB,EAChB,MAA8B;IAE9B,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IAChE,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,SAAS,CACvB,OAAe,EACf,MAA8B;IAE9B,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { BlueprintV1Declaration } from "@wp-playground/blueprints";
|
|
2
|
+
import type { Mount, Tests, Reporter } from "./wp-tester-config.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolved test environment configuration.
|
|
5
|
+
* After resolveConfig() runs, all blueprints are loaded and all paths are absolute.
|
|
6
|
+
*/
|
|
7
|
+
export interface ResolvedEnvironment {
|
|
8
|
+
/**
|
|
9
|
+
* Optional descriptive name for this environment
|
|
10
|
+
* @example "PHP 8.1 + WP 6.7"
|
|
11
|
+
* @example "WooCommerce Environment"
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* WordPress Playground Blueprint configuration.
|
|
16
|
+
* Always a BlueprintV1Declaration object after resolution.
|
|
17
|
+
*/
|
|
18
|
+
blueprint: BlueprintV1Declaration;
|
|
19
|
+
/**
|
|
20
|
+
* Filesystem mounts to apply to this environment.
|
|
21
|
+
* All paths are absolute after resolution.
|
|
22
|
+
* Always defined (may be empty array if no mounts).
|
|
23
|
+
*/
|
|
24
|
+
mounts: Mount[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Resolved wp-tester configuration.
|
|
28
|
+
* After resolveConfig() runs, all blueprints are loaded and all paths are absolute.
|
|
29
|
+
* All optional fields from WPTesterConfig are guaranteed to have values.
|
|
30
|
+
*/
|
|
31
|
+
export interface ResolvedWPTesterConfig {
|
|
32
|
+
/**
|
|
33
|
+
* JSON Schema reference for IDE validation and autocomplete
|
|
34
|
+
*/
|
|
35
|
+
$schema?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Absolute path to the project on the host filesystem.
|
|
38
|
+
* All relative paths in the config are resolved from this directory.
|
|
39
|
+
*/
|
|
40
|
+
projectHostPath: string;
|
|
41
|
+
/**
|
|
42
|
+
* Path to the project in the VFS (Virtual File System).
|
|
43
|
+
* Determined by projectType (e.g., /wordpress/wp-content/plugins/my-plugin).
|
|
44
|
+
*/
|
|
45
|
+
projectVFSPath: string;
|
|
46
|
+
/**
|
|
47
|
+
* Detected WordPress project type (always set after resolution).
|
|
48
|
+
* Automatically detected during setup based on project structure.
|
|
49
|
+
*/
|
|
50
|
+
projectType: 'plugin' | 'theme' | 'wp-content' | 'wordpress-install' | 'unknown';
|
|
51
|
+
/**
|
|
52
|
+
* Test environments to run.
|
|
53
|
+
* Each environment can have different PHP/WordPress versions and setup.
|
|
54
|
+
* Tests will run against all defined environments (matrix testing).
|
|
55
|
+
* All blueprints are loaded and all paths are absolute.
|
|
56
|
+
* @minItems 1
|
|
57
|
+
*/
|
|
58
|
+
environments: ResolvedEnvironment[];
|
|
59
|
+
/**
|
|
60
|
+
* Test suites to execute
|
|
61
|
+
*/
|
|
62
|
+
tests: Tests;
|
|
63
|
+
/**
|
|
64
|
+
* Output reporters for test results (always set after resolution).
|
|
65
|
+
* @default ["default"]
|
|
66
|
+
*/
|
|
67
|
+
reporters: Reporter[];
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=resolved-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolved-types.d.ts","sourceRoot":"","sources":["../src/resolved-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,EAAE,sBAAsB,CAAC;IAElC;;;;OAIG;IACH,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,WAAW,EAAE,QAAQ,GAAG,OAAO,GAAG,YAAY,GAAG,mBAAmB,GAAG,SAAS,CAAC;IAEjF;;;;;;OAMG;IACH,YAAY,EAAE,mBAAmB,EAAE,CAAC;IAEpC;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;;OAGG;IACH,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolved-types.js","sourceRoot":"","sources":["../src/resolved-types.ts"],"names":[],"mappings":""}
|