@immense/vue-pom-generator 1.0.17 → 1.0.19
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/RELEASE_NOTES.md +25 -14
- package/class-generation/index.ts +18 -6
- package/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
●
|
|
1
|
+
● ```markdown
|
|
2
|
+
## Highlights
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
-
|
|
5
|
-
|
|
6
|
-
- Updated `.gitignore` to exclude generated declaration files from source control
|
|
7
|
-
- Build process now includes explicit `tsc --emitDeclarationOnly` step after Vite compilation
|
|
4
|
+
- Fixed CJS runtime file resolution issue with Rollup 4.x builds
|
|
5
|
+
- Improved compatibility when running in JSDOM-shimmed environments
|
|
6
|
+
- Added try/catch fallback pattern for robust path resolution across ESM and CJS contexts
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
## Changes
|
|
9
|
+
|
|
10
|
+
- **File Resolution:** Implemented try/catch fallback to `__dirname` for CJS runtime file
|
|
11
|
+
resolution in class generation module
|
|
12
|
+
- Addresses Rollup 4.x behavior where `import.meta.dirname` transforms to `void 0` in CJS
|
|
13
|
+
output
|
|
14
|
+
- Uses `fileURLToPath` with `import.meta.url` first (ESM), falls back to `path.resolve` with
|
|
15
|
+
`__dirname` (CJS)
|
|
16
|
+
- Handles JSDOM-shimmed document scenarios where `import.meta.url` resolves to `https://` URLs
|
|
17
|
+
|
|
18
|
+
## Breaking Changes
|
|
19
|
+
|
|
20
|
+
None
|
|
21
|
+
|
|
22
|
+
## Pull Requests Included
|
|
13
23
|
|
|
14
|
-
### Pull Requests Included
|
|
15
24
|
- [#1 Add PR release-notes preview
|
|
16
|
-
comments](https://github.com/immense/vue-pom-generator/pull/1) by @dkattan
|
|
25
|
+
comments](https://github.com/immense/vue-pom-generator/pull/1) by @dkattan
|
|
26
|
+
|
|
27
|
+
## Testing
|
|
17
28
|
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
Not explicitly mentioned in commits
|
|
30
|
+
```
|
|
20
31
|
|
|
@@ -1484,12 +1484,24 @@ async function generateAggregatedFiles(
|
|
|
1484
1484
|
|
|
1485
1485
|
// Copy runtime dependencies into the output folder so the aggregated POM file can
|
|
1486
1486
|
// import them without relying on workspace package resolution.
|
|
1487
|
-
|
|
1488
|
-
//
|
|
1489
|
-
//
|
|
1490
|
-
//
|
|
1491
|
-
|
|
1492
|
-
|
|
1487
|
+
// Resolve paths to bundled runtime files. Mirror the pattern in support-plugins.ts:
|
|
1488
|
+
// try fileURLToPath(new URL(..., import.meta.url)) (works in ESM where import.meta.url
|
|
1489
|
+
// is a proper file:// URL), then fall back to __dirname (available in the CJS bundle
|
|
1490
|
+
// via Node's module wrapper). The fallback is needed because ensureDomShim() in
|
|
1491
|
+
// router-introspection sets globalThis.document via JSDOM (url "https://example.test/"),
|
|
1492
|
+
// after which Rollup's CJS shim for import.meta.url resolves to document.baseURI
|
|
1493
|
+
// ("https://example.test/index.cjs") — not a file:// URL — causing fileURLToPath to throw.
|
|
1494
|
+
const resolvePluginAsset = (relative: string): string => {
|
|
1495
|
+
try {
|
|
1496
|
+
return fileURLToPath(new URL(relative, import.meta.url));
|
|
1497
|
+
}
|
|
1498
|
+
catch {
|
|
1499
|
+
return path.resolve(__dirname, relative);
|
|
1500
|
+
}
|
|
1501
|
+
};
|
|
1502
|
+
const clickInstrumentationAbs = resolvePluginAsset("../click-instrumentation.ts");
|
|
1503
|
+
const pointerAbs = resolvePluginAsset("../class-generation/Pointer.ts");
|
|
1504
|
+
const playwrightTypesAbs = resolvePluginAsset("../class-generation/playwright-types.ts");
|
|
1493
1505
|
|
|
1494
1506
|
const runtimeFiles: Array<{ filePath: string; content: string }> = [
|
|
1495
1507
|
{
|
package/dist/index.cjs
CHANGED
|
@@ -3700,9 +3700,16 @@ export * from "./page-object-models.g";
|
|
|
3700
3700
|
throw new Error(`Failed to read ${description} at ${absPath}`);
|
|
3701
3701
|
}
|
|
3702
3702
|
};
|
|
3703
|
-
const
|
|
3704
|
-
|
|
3705
|
-
|
|
3703
|
+
const resolvePluginAsset = (relative) => {
|
|
3704
|
+
try {
|
|
3705
|
+
return node_url.fileURLToPath(new URL(relative, typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("index.cjs", document.baseURI).href));
|
|
3706
|
+
} catch {
|
|
3707
|
+
return path.resolve(__dirname, relative);
|
|
3708
|
+
}
|
|
3709
|
+
};
|
|
3710
|
+
const clickInstrumentationAbs = resolvePluginAsset("../click-instrumentation.ts");
|
|
3711
|
+
const pointerAbs = resolvePluginAsset("../class-generation/Pointer.ts");
|
|
3712
|
+
const playwrightTypesAbs = resolvePluginAsset("../class-generation/playwright-types.ts");
|
|
3706
3713
|
const runtimeFiles = [
|
|
3707
3714
|
{
|
|
3708
3715
|
filePath: path.join(runtimeDirAbs, "click-instrumentation.ts"),
|