@immense/vue-pom-generator 1.0.114 → 1.0.115
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 +27 -26
- package/dist/index.cjs +17 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +17 -8
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/path-utils.d.ts +1 -0
- package/dist/plugin/path-utils.d.ts.map +1 -1
- package/dist/plugin/vue-plugin.d.ts.map +1 -1
- package/package.json +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
The range contains exactly one commit (#79). Let me review its diff to describe the feature
|
|
1
|
+
The picture is clear: only #81 falls in the v1.0.114..HEAD range (#79 is the tagged v1.0.114 release
|
|
2
|
+
itself; the long PR list is historical). Let me inspect the actual diff of #81 to summarize it
|
|
4
3
|
accurately.
|
|
5
4
|
|
|
5
|
+
v1.0.115
|
|
6
|
+
|
|
6
7
|
Highlights
|
|
7
8
|
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
- Fixed Windows dev-server crashes during POM generation: backslash paths handed to the Vue
|
|
10
|
+
compiler were embedded verbatim in generated useCssVars code, producing SyntaxError: Bad character
|
|
11
|
+
escape sequence for paths containing \u, \x, \8, or \9 (fixes #80).
|
|
12
|
+
- SFC ids passed to compileScript are now posix-normalized in both the build collection path and
|
|
13
|
+
the dev plugin, so binding metadata is no longer silently dropped for affected components.
|
|
14
|
+
- Component-name resolution now compares paths in posix form, restoring correct hierarchical names
|
|
15
|
+
for files under directories whose names contain a backslash.
|
|
14
16
|
|
|
15
17
|
Changes
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Plugin
|
|
18
20
|
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
- Exported the existing toPosixSlashes helper from plugin/path-utils.ts and applied it wherever
|
|
22
|
+
paths become compiler ids: collectSource in plugin/vue-plugin.ts and getScriptInfo in
|
|
23
|
+
plugin/internal/dev-plugin.ts.
|
|
24
|
+
- collectSource now canonicalizes the two collection passes (native paths from the filesystem walk,
|
|
25
|
+
posix module ids from Vite) to posix once, so naming, metadata, and generated manifests agree
|
|
26
|
+
across passes.
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
Path and scope resolution
|
|
27
29
|
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- Extended broad unit coverage for base-page.ts and updated the fake-runtime test helper to support
|
|
32
|
-
the new seam.
|
|
30
|
+
- resolveComponentNameFromPath posix-normalizes the filename and candidate roots and uses
|
|
31
|
+
path.posix.relative/parse/join for prefix matching, so a configured root on POSIX that contains a
|
|
32
|
+
backslash in a directory name still matches and no longer drops components to their basename.
|
|
33
33
|
|
|
34
34
|
Breaking Changes
|
|
35
35
|
|
|
@@ -37,11 +37,12 @@ None.
|
|
|
37
37
|
|
|
38
38
|
Pull Requests Included
|
|
39
39
|
|
|
40
|
-
- ]8;id=md-
|
|
40
|
+
- ]8;id=md-1czplt1;https://github.com/immense/vue-pom-generator/pull/81#81]8;;]8;; — fix(plugin): posix-normalize SFC ids handed to the Vue compiler (@steve-price-immybot)]8;;
|
|
41
41
|
|
|
42
42
|
Testing
|
|
43
43
|
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
- Added regression tests: supplementing v-bind() components whose paths contain backslash
|
|
45
|
+
separators, preserving hierarchical names for nested files under backslash directories, and a new
|
|
46
|
+
toPosixSlashes unit suite covering Windows-separator conversion and untouched posix paths
|
|
47
|
+
(tests/generate-vue-poms.test.ts, tests/path-utils-scope.test.ts).
|
|
47
48
|
|
package/dist/index.cjs
CHANGED
|
@@ -4168,6 +4168,14 @@ function writeGeneratedOutputs(outDir, files, sharedFiles, projectRoot = path.di
|
|
|
4168
4168
|
writeFile(manifestPath, `${JSON.stringify(next, null, 2)}
|
|
4169
4169
|
`);
|
|
4170
4170
|
}
|
|
4171
|
+
function toPosixSlashes(value) {
|
|
4172
|
+
let out = "";
|
|
4173
|
+
for (let i = 0; i < value.length; i++) {
|
|
4174
|
+
const ch = value[i];
|
|
4175
|
+
out += ch === "\\" ? "/" : ch;
|
|
4176
|
+
}
|
|
4177
|
+
return out;
|
|
4178
|
+
}
|
|
4171
4179
|
function safeRealpath(value) {
|
|
4172
4180
|
try {
|
|
4173
4181
|
if (fs.existsSync(value)) {
|
|
@@ -4203,18 +4211,18 @@ function resolveComponentNameFromPath(options) {
|
|
|
4203
4211
|
const { projectRoot, viewsDirAbs, sourceDirs, extraRoots = [] } = options;
|
|
4204
4212
|
const cleanFilename = options.filename.includes("?") ? options.filename.substring(0, options.filename.indexOf("?")) : options.filename;
|
|
4205
4213
|
const absFilename = path.isAbsolute(cleanFilename) ? cleanFilename : path.resolve(projectRoot, cleanFilename);
|
|
4206
|
-
const normalizedAbsFilename = path.normalize(safeRealpath(absFilename));
|
|
4214
|
+
const normalizedAbsFilename = toPosixSlashes(path.normalize(safeRealpath(absFilename)));
|
|
4207
4215
|
const rootBases = [projectRoot, ...extraRoots.filter((r) => r !== projectRoot)];
|
|
4208
4216
|
const roots = [
|
|
4209
4217
|
viewsDirAbs,
|
|
4210
4218
|
...sourceDirs.flatMap((dir) => path.isAbsolute(dir) ? [dir] : rootBases.map((base) => path.resolve(base, dir)))
|
|
4211
4219
|
];
|
|
4212
|
-
const potentialRoots = Array.from(new Set(roots.map((r) => path.normalize(safeRealpath(r))))).sort((a, b) => b.length - a.length);
|
|
4220
|
+
const potentialRoots = Array.from(new Set(roots.map((r) => toPosixSlashes(path.normalize(safeRealpath(r)))))).sort((a, b) => b.length - a.length);
|
|
4213
4221
|
for (const root of potentialRoots) {
|
|
4214
|
-
if (normalizedAbsFilename.startsWith(root
|
|
4215
|
-
const rel = path.relative(root, normalizedAbsFilename);
|
|
4216
|
-
const parsed = path.parse(rel);
|
|
4217
|
-
const segments = path.join(parsed.dir, parsed.name);
|
|
4222
|
+
if (normalizedAbsFilename.startsWith(`${root}/`) || normalizedAbsFilename === root) {
|
|
4223
|
+
const rel = path.posix.relative(root, normalizedAbsFilename);
|
|
4224
|
+
const parsed = path.posix.parse(rel);
|
|
4225
|
+
const segments = path.posix.join(parsed.dir, parsed.name);
|
|
4218
4226
|
return toPascalCase(segments);
|
|
4219
4227
|
}
|
|
4220
4228
|
}
|
|
@@ -10580,7 +10588,8 @@ function createVuePluginWithTestIds(options) {
|
|
|
10580
10588
|
runtimeNodeTransform
|
|
10581
10589
|
]
|
|
10582
10590
|
};
|
|
10583
|
-
const collectSource = async (code,
|
|
10591
|
+
const collectSource = async (code, rawPath) => {
|
|
10592
|
+
const cleanPath = toPosixSlashes(rawPath);
|
|
10584
10593
|
const componentName = getComponentNameFromPath(cleanPath);
|
|
10585
10594
|
loggerRef.current.debug(`Collecting metadata for ${cleanPath} (component: ${componentName})`);
|
|
10586
10595
|
const compilerSfc2 = await import("@vue/compiler-sfc");
|
|
@@ -10813,7 +10822,7 @@ function createDevProcessorPlugin(options) {
|
|
|
10813
10822
|
const { descriptor } = compilerSfc.parse(source, { filename });
|
|
10814
10823
|
if (!descriptor.script && !descriptor.scriptSetup)
|
|
10815
10824
|
return { bindings: void 0, isScriptSetup: false };
|
|
10816
|
-
const scriptBlock = compilerSfc.compileScript(descriptor, { id: filename });
|
|
10825
|
+
const scriptBlock = compilerSfc.compileScript(descriptor, { id: toPosixSlashes(filename) });
|
|
10817
10826
|
return { bindings: scriptBlock.bindings, isScriptSetup: !!descriptor.scriptSetup };
|
|
10818
10827
|
} catch {
|
|
10819
10828
|
return { bindings: void 0, isScriptSetup: false };
|