@scenetest/vite-plugin 0.1.0 → 0.1.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/dist/config.d.ts +2 -2
- package/dist/config.js +3 -3
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/dist/config.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import type { ScenetestConfig } from '@scenetest/checks';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function clearConfigCache(): void;
|
|
6
6
|
/**
|
|
7
|
-
* Find the scenetest config file path
|
|
7
|
+
* Find the scenetest config file path (scenetest/config.{ts,js,mjs})
|
|
8
8
|
*/
|
|
9
9
|
export declare function findConfigPath(root: string): string | null;
|
|
10
10
|
/**
|
|
11
11
|
* Load the scenetest config using Vite's SSR module loader.
|
|
12
12
|
* This must be called from the server context with access to ViteDevServer.
|
|
13
13
|
*
|
|
14
|
-
* Reads
|
|
14
|
+
* Reads scenetest/config.ts and extracts fields the plugin needs
|
|
15
15
|
* (currently just `serverFunctions`). All other config fields are ignored.
|
|
16
16
|
*/
|
|
17
17
|
export declare function loadConfig(root: string, ssrLoadModule: (id: string) => Promise<Record<string, unknown>>): Promise<ScenetestConfig>;
|
package/dist/config.js
CHANGED
|
@@ -13,12 +13,12 @@ export function clearConfigCache() {
|
|
|
13
13
|
cachedConfigPath = null;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Find the scenetest config file path
|
|
16
|
+
* Find the scenetest config file path (scenetest/config.{ts,js,mjs})
|
|
17
17
|
*/
|
|
18
18
|
export function findConfigPath(root) {
|
|
19
19
|
const extensions = ['ts', 'js', 'mjs'];
|
|
20
20
|
for (const ext of extensions) {
|
|
21
|
-
const configPath = resolve(root, `scenetest
|
|
21
|
+
const configPath = resolve(root, `scenetest/config.${ext}`);
|
|
22
22
|
if (existsSync(configPath)) {
|
|
23
23
|
return configPath;
|
|
24
24
|
}
|
|
@@ -29,7 +29,7 @@ export function findConfigPath(root) {
|
|
|
29
29
|
* Load the scenetest config using Vite's SSR module loader.
|
|
30
30
|
* This must be called from the server context with access to ViteDevServer.
|
|
31
31
|
*
|
|
32
|
-
* Reads
|
|
32
|
+
* Reads scenetest/config.ts and extracts fields the plugin needs
|
|
33
33
|
* (currently just `serverFunctions`). All other config fields are ignored.
|
|
34
34
|
*/
|
|
35
35
|
export async function loadConfig(root, ssrLoadModule) {
|
package/dist/index.js
CHANGED
|
@@ -238,7 +238,7 @@ import '/__scenetest/recorder.js';
|
|
|
238
238
|
}
|
|
239
239
|
// Re-export strip function for testing
|
|
240
240
|
export { stripScenetest } from './strip.js';
|
|
241
|
-
// Re-export server-side should/failed for use in scenetest
|
|
241
|
+
// Re-export server-side should/failed for use in scenetest/config.ts
|
|
242
242
|
export { should, failed } from './middleware.js';
|
|
243
243
|
export default scenetest;
|
|
244
244
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scenetest/vite-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Vite plugin for scenetest - strips assertions in production, injects dev panel",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@babel/traverse": "^7.24.0",
|
|
41
41
|
"@babel/types": "^7.24.0",
|
|
42
42
|
"magic-string": "^0.30.10",
|
|
43
|
-
"@scenetest/checks": "0.1.
|
|
44
|
-
"@scenetest/
|
|
45
|
-
"@scenetest/
|
|
43
|
+
"@scenetest/checks": "0.1.1",
|
|
44
|
+
"@scenetest/scenes-panel": "0.1.1",
|
|
45
|
+
"@scenetest/checks-panel": "0.1.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"vite": "^5.0.0 || ^6.0.0"
|