@immense/vue-pom-generator 1.0.67 → 1.0.68
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 +17 -77
- package/dist/index.cjs +52 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +52 -19
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/path-utils.d.ts +12 -0
- package/dist/plugin/path-utils.d.ts.map +1 -1
- package/dist/plugin/vue-plugin.d.ts.map +1 -1
- package/dist/tests/path-utils-scope.test.d.ts +2 -0
- package/dist/tests/path-utils-scope.test.d.ts.map +1 -0
- package/package.json +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,94 +1,34 @@
|
|
|
1
1
|
● ## Highlights
|
|
2
2
|
|
|
3
|
-
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
in Vue components
|
|
7
|
-
- **Manifest and locator descriptions** – Human-readable descriptions for generated test
|
|
8
|
-
locators and manifests
|
|
9
|
-
- **Zero runtime dependencies** – All runtime dependencies eliminated for smaller bundle size
|
|
10
|
-
and fewer supply-chain risks
|
|
11
|
-
- **Build–serve parity** – Dev mode POM generation now matches build mode behavior with
|
|
12
|
-
comprehensive regression tests
|
|
3
|
+
- Fixed file scope path checks to properly normalize paths before comparison
|
|
4
|
+
- Extracted path normalization logic into dedicated utility functions
|
|
5
|
+
- Added comprehensive test coverage for path scope validation
|
|
13
6
|
|
|
14
7
|
## Changes
|
|
15
8
|
|
|
16
|
-
**
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
- Add split Playwright POM output for improved discoverability (#12)
|
|
21
|
-
- Fail fast on unnameable wrapper handlers (#11)
|
|
9
|
+
**Bug Fixes**
|
|
10
|
+
- Normalized file scope path checks to handle platform-specific path separators and inconsistent
|
|
11
|
+
path formats (#29)
|
|
12
|
+
- Refactored path comparison logic in Vue plugin to use centralized utility functions
|
|
22
13
|
|
|
23
|
-
**
|
|
24
|
-
-
|
|
25
|
-
- Avoid reparsing generated test IDs (#21)
|
|
26
|
-
- Harden local app integration (#19)
|
|
27
|
-
- Restore router DOM globals after introspection (#18)
|
|
28
|
-
- Support awaited handler wrappers (#17)
|
|
29
|
-
- Resolve Nuxt app-root dev POM clobber (#15)
|
|
30
|
-
- Guard manual releases (#16)
|
|
31
|
-
- Fail fast on dev snapshot generation errors (#6)
|
|
32
|
-
- Dev-mode POM generation parity with build mode (#5)
|
|
33
|
-
- Fix keyed POM dedupe and C# navigation returns (#4)
|
|
14
|
+
**Testing**
|
|
15
|
+
- Added `tests/path-utils-scope.test.ts` with 29 test cases for path scope validation
|
|
34
16
|
|
|
35
|
-
**
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
**Dependencies**
|
|
40
|
-
- Relax Vite peer dependency range (#13)
|
|
41
|
-
|
|
42
|
-
**Developer Experience**
|
|
43
|
-
- Add PR release-notes preview comments (#1)
|
|
17
|
+
**Code Quality**
|
|
18
|
+
- Extracted 68 lines of path utility logic from `vue-plugin.ts` to `plugin/path-utils.ts`
|
|
19
|
+
- Reduced code duplication in plugin path handling (net -29 lines in vue-plugin.ts)
|
|
44
20
|
|
|
45
21
|
## Breaking Changes
|
|
46
22
|
|
|
47
|
-
|
|
48
|
-
`plugin/internal-plugins.ts` and `plugin/support/*` → `plugin/internal/*`. This should not
|
|
49
|
-
affect public API users.
|
|
23
|
+
None.
|
|
50
24
|
|
|
51
25
|
## Pull Requests Included
|
|
52
26
|
|
|
53
|
-
- #
|
|
54
|
-
(https://github.com/immense/vue-pom-generator/pull/
|
|
55
|
-
- #25 feat: add accessibility audit metadata and warnings
|
|
56
|
-
(https://github.com/immense/vue-pom-generator/pull/25)
|
|
57
|
-
- #24 feat: add manifest and locator descriptions
|
|
58
|
-
(https://github.com/immense/vue-pom-generator/pull/24)
|
|
59
|
-
- #21 fix: avoid reparsing generated test ids
|
|
60
|
-
(https://github.com/immense/vue-pom-generator/pull/21)
|
|
61
|
-
- #20 fix: parse TypeScript template expressions + allow submit-button fallback
|
|
62
|
-
(https://github.com/immense/vue-pom-generator/pull/20)
|
|
63
|
-
- #19 fix: harden local app integration (https://github.com/immense/vue-pom-generator/pull/19)
|
|
64
|
-
- #18 fix: restore router DOM globals after introspection
|
|
65
|
-
(https://github.com/immense/vue-pom-generator/pull/18)
|
|
66
|
-
- #17 fix: support awaited handler wrappers
|
|
67
|
-
(https://github.com/immense/vue-pom-generator/pull/17)
|
|
68
|
-
- #16 fix: guard manual releases (https://github.com/immense/vue-pom-generator/pull/16)
|
|
69
|
-
- #15 fix: resolve Nuxt app-root dev POM clobber
|
|
70
|
-
(https://github.com/immense/vue-pom-generator/pull/15)
|
|
71
|
-
- #13 Relax Vite peer dependency range (https://github.com/immense/vue-pom-generator/pull/13)
|
|
72
|
-
- #12 feat: add split Playwright POM output for discoverability
|
|
73
|
-
(https://github.com/immense/vue-pom-generator/pull/12)
|
|
74
|
-
- #11 feat: fail fast on unnameable wrapper handlers
|
|
75
|
-
(https://github.com/immense/vue-pom-generator/pull/11)
|
|
76
|
-
- #9 refactor(deps): eliminate all runtime dependencies
|
|
77
|
-
(https://github.com/immense/vue-pom-generator/pull/9)
|
|
78
|
-
- #8 chore: bump version to 1.0.43 (https://github.com/immense/vue-pom-generator/pull/8)
|
|
79
|
-
- #7 test: add build–serve parity regression tests
|
|
80
|
-
(https://github.com/immense/vue-pom-generator/pull/7)
|
|
81
|
-
- #6 fix: fail fast on dev snapshot generation errors
|
|
82
|
-
(https://github.com/immense/vue-pom-generator/pull/6)
|
|
83
|
-
- #5 fix: dev-mode POM generation parity with build mode
|
|
84
|
-
(https://github.com/immense/vue-pom-generator/pull/5)
|
|
85
|
-
- #4 Fix keyed POM dedupe and C# navigation returns
|
|
86
|
-
(https://github.com/immense/vue-pom-generator/pull/4)
|
|
87
|
-
- #1 Add PR release-notes preview comments (https://github.com/immense/vue-pom-generator/pull/1)
|
|
27
|
+
- #29 fix: normalize file scope path checks
|
|
28
|
+
(https://github.com/immense/vue-pom-generator/pull/29) by @dkattan
|
|
88
29
|
|
|
89
30
|
## Testing
|
|
90
31
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
All new features and fixes include corresponding test coverage.
|
|
32
|
+
New test suite added (`path-utils-scope.test.ts`) covering path normalization and scope
|
|
33
|
+
validation edge cases.
|
|
94
34
|
|
package/dist/index.cjs
CHANGED
|
@@ -3563,6 +3563,14 @@ function safeRealpath(value) {
|
|
|
3563
3563
|
const resolvedParent = safeRealpath(parent);
|
|
3564
3564
|
return resolvedParent === parent ? value : path.join(resolvedParent, path.basename(value));
|
|
3565
3565
|
}
|
|
3566
|
+
function normalizeScopePath(value, pathImpl = path) {
|
|
3567
|
+
return pathImpl.normalize(value);
|
|
3568
|
+
}
|
|
3569
|
+
function isNormalizedPathWithinDir(filePathAbs, dirPathAbs, pathImpl = path) {
|
|
3570
|
+
const normalizedFileAbs = normalizeScopePath(filePathAbs, pathImpl);
|
|
3571
|
+
const normalizedDirAbs = normalizeScopePath(dirPathAbs, pathImpl);
|
|
3572
|
+
return normalizedFileAbs === normalizedDirAbs || normalizedFileAbs.startsWith(`${normalizedDirAbs}${pathImpl.sep}`);
|
|
3573
|
+
}
|
|
3566
3574
|
function isPathWithinDir(filePathAbs, dirPathAbs) {
|
|
3567
3575
|
const fileAbs = path.resolve(filePathAbs);
|
|
3568
3576
|
const dirAbs = path.resolve(dirPathAbs);
|
|
@@ -3592,6 +3600,43 @@ function resolveComponentNameFromPath(options) {
|
|
|
3592
3600
|
}
|
|
3593
3601
|
return toPascalCase(path.parse(normalizedAbsFilename).name);
|
|
3594
3602
|
}
|
|
3603
|
+
function isFileInConfiguredSourceScope(options) {
|
|
3604
|
+
const { filename, projectRoot, viewsDirAbs, sourceDirs, extraRoots = [], pathImpl = path } = options;
|
|
3605
|
+
if (!filename) {
|
|
3606
|
+
return false;
|
|
3607
|
+
}
|
|
3608
|
+
const cleanFilename = filename.includes("?") ? filename.substring(0, filename.indexOf("?")) : filename;
|
|
3609
|
+
const normalizedProjectRoot = normalizeScopePath(projectRoot, pathImpl);
|
|
3610
|
+
const normalizedAbsFilename = normalizeScopePath(
|
|
3611
|
+
pathImpl.isAbsolute(cleanFilename) ? cleanFilename : pathImpl.resolve(normalizedProjectRoot, cleanFilename),
|
|
3612
|
+
pathImpl
|
|
3613
|
+
);
|
|
3614
|
+
if (normalizedAbsFilename.includes(`${pathImpl.sep}node_modules${pathImpl.sep}`) || normalizedAbsFilename.includes("/node_modules/")) {
|
|
3615
|
+
return false;
|
|
3616
|
+
}
|
|
3617
|
+
const normalizedViewsDirAbs = normalizeScopePath(viewsDirAbs, pathImpl);
|
|
3618
|
+
if (isNormalizedPathWithinDir(normalizedAbsFilename, normalizedViewsDirAbs, pathImpl)) {
|
|
3619
|
+
return true;
|
|
3620
|
+
}
|
|
3621
|
+
const rootsToTry = Array.from(/* @__PURE__ */ new Set([
|
|
3622
|
+
normalizedProjectRoot,
|
|
3623
|
+
...extraRoots.map((root) => normalizeScopePath(root, pathImpl))
|
|
3624
|
+
]));
|
|
3625
|
+
return sourceDirs.some((dir) => {
|
|
3626
|
+
return rootsToTry.some((root) => {
|
|
3627
|
+
const normalizedAbsDir = normalizeScopePath(pathImpl.resolve(root, dir), pathImpl);
|
|
3628
|
+
if (isNormalizedPathWithinDir(normalizedAbsFilename, normalizedAbsDir, pathImpl)) {
|
|
3629
|
+
return true;
|
|
3630
|
+
}
|
|
3631
|
+
if (dir.startsWith("app/") && pathImpl.basename(root) === "app") {
|
|
3632
|
+
const relativeDir = dir.substring(4);
|
|
3633
|
+
const normalizedAbsDirAlt = normalizeScopePath(pathImpl.resolve(root, relativeDir), pathImpl);
|
|
3634
|
+
return isNormalizedPathWithinDir(normalizedAbsFilename, normalizedAbsDirAlt, pathImpl);
|
|
3635
|
+
}
|
|
3636
|
+
return false;
|
|
3637
|
+
});
|
|
3638
|
+
});
|
|
3639
|
+
}
|
|
3595
3640
|
let routerIntrospectionQueue = Promise.resolve();
|
|
3596
3641
|
async function runRouterIntrospectionExclusive(fn) {
|
|
3597
3642
|
const prev = routerIntrospectionQueue.catch(() => void 0);
|
|
@@ -9007,27 +9052,15 @@ function createVuePluginWithTestIds(options) {
|
|
|
9007
9052
|
return false;
|
|
9008
9053
|
const cleanPath = filename.includes("?") ? filename.substring(0, filename.indexOf("?")) : filename;
|
|
9009
9054
|
const projectRoot = getProjectRoot();
|
|
9010
|
-
const
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
const rootsToTry = [projectRoot, process.cwd()];
|
|
9017
|
-
const matched = getSourceDirs().some((dir) => {
|
|
9018
|
-
return rootsToTry.some((root) => {
|
|
9019
|
-
const absDir = path.resolve(root, dir);
|
|
9020
|
-
if (absFilename.startsWith(absDir + path.sep) || absFilename === absDir)
|
|
9021
|
-
return true;
|
|
9022
|
-
if (dir.startsWith("app/") && root.endsWith("/app")) {
|
|
9023
|
-
const relativeDir = dir.substring(4);
|
|
9024
|
-
const absDirAlt = path.resolve(root, relativeDir);
|
|
9025
|
-
return absFilename.startsWith(absDirAlt + path.sep) || absFilename === absDirAlt;
|
|
9026
|
-
}
|
|
9027
|
-
return false;
|
|
9028
|
-
});
|
|
9055
|
+
const matched = isFileInConfiguredSourceScope({
|
|
9056
|
+
filename,
|
|
9057
|
+
projectRoot,
|
|
9058
|
+
viewsDirAbs: getViewsDirAbs(),
|
|
9059
|
+
sourceDirs: getSourceDirs(),
|
|
9060
|
+
extraRoots: [process.cwd()]
|
|
9029
9061
|
});
|
|
9030
9062
|
if (cleanPath.endsWith(".vue") && !matched) {
|
|
9063
|
+
const absFilename = path.normalize(path.isAbsolute(cleanPath) ? cleanPath : path.resolve(projectRoot, cleanPath));
|
|
9031
9064
|
loggerRef.current.debug(`[isFileInScope] REJECTED: ${absFilename} (Clean: ${cleanPath})`);
|
|
9032
9065
|
}
|
|
9033
9066
|
return matched;
|