@immense/vue-pom-generator 1.0.113 → 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/dist/index.mjs CHANGED
@@ -4127,6 +4127,14 @@ function writeGeneratedOutputs(outDir, files, sharedFiles, projectRoot = path.di
4127
4127
  writeFile(manifestPath, `${JSON.stringify(next, null, 2)}
4128
4128
  `);
4129
4129
  }
4130
+ function toPosixSlashes(value) {
4131
+ let out = "";
4132
+ for (let i = 0; i < value.length; i++) {
4133
+ const ch = value[i];
4134
+ out += ch === "\\" ? "/" : ch;
4135
+ }
4136
+ return out;
4137
+ }
4130
4138
  function safeRealpath(value) {
4131
4139
  try {
4132
4140
  if (fs.existsSync(value)) {
@@ -4162,18 +4170,18 @@ function resolveComponentNameFromPath(options) {
4162
4170
  const { projectRoot, viewsDirAbs, sourceDirs, extraRoots = [] } = options;
4163
4171
  const cleanFilename = options.filename.includes("?") ? options.filename.substring(0, options.filename.indexOf("?")) : options.filename;
4164
4172
  const absFilename = path.isAbsolute(cleanFilename) ? cleanFilename : path.resolve(projectRoot, cleanFilename);
4165
- const normalizedAbsFilename = path.normalize(safeRealpath(absFilename));
4173
+ const normalizedAbsFilename = toPosixSlashes(path.normalize(safeRealpath(absFilename)));
4166
4174
  const rootBases = [projectRoot, ...extraRoots.filter((r) => r !== projectRoot)];
4167
4175
  const roots = [
4168
4176
  viewsDirAbs,
4169
4177
  ...sourceDirs.flatMap((dir) => path.isAbsolute(dir) ? [dir] : rootBases.map((base) => path.resolve(base, dir)))
4170
4178
  ];
4171
- const potentialRoots = Array.from(new Set(roots.map((r) => path.normalize(safeRealpath(r))))).sort((a, b) => b.length - a.length);
4179
+ const potentialRoots = Array.from(new Set(roots.map((r) => toPosixSlashes(path.normalize(safeRealpath(r)))))).sort((a, b) => b.length - a.length);
4172
4180
  for (const root of potentialRoots) {
4173
- if (normalizedAbsFilename.startsWith(root + path.sep) || normalizedAbsFilename === root) {
4174
- const rel = path.relative(root, normalizedAbsFilename);
4175
- const parsed = path.parse(rel);
4176
- const segments = path.join(parsed.dir, parsed.name);
4181
+ if (normalizedAbsFilename.startsWith(`${root}/`) || normalizedAbsFilename === root) {
4182
+ const rel = path.posix.relative(root, normalizedAbsFilename);
4183
+ const parsed = path.posix.parse(rel);
4184
+ const segments = path.posix.join(parsed.dir, parsed.name);
4177
4185
  return toPascalCase(segments);
4178
4186
  }
4179
4187
  }
@@ -10539,7 +10547,8 @@ function createVuePluginWithTestIds(options) {
10539
10547
  runtimeNodeTransform
10540
10548
  ]
10541
10549
  };
10542
- const collectSource = async (code, cleanPath) => {
10550
+ const collectSource = async (code, rawPath) => {
10551
+ const cleanPath = toPosixSlashes(rawPath);
10543
10552
  const componentName = getComponentNameFromPath(cleanPath);
10544
10553
  loggerRef.current.debug(`Collecting metadata for ${cleanPath} (component: ${componentName})`);
10545
10554
  const compilerSfc = await import("@vue/compiler-sfc");
@@ -10772,7 +10781,7 @@ function createDevProcessorPlugin(options) {
10772
10781
  const { descriptor } = parse$1(source, { filename });
10773
10782
  if (!descriptor.script && !descriptor.scriptSetup)
10774
10783
  return { bindings: void 0, isScriptSetup: false };
10775
- const scriptBlock = compileScript(descriptor, { id: filename });
10784
+ const scriptBlock = compileScript(descriptor, { id: toPosixSlashes(filename) });
10776
10785
  return { bindings: scriptBlock.bindings, isScriptSetup: !!descriptor.scriptSetup };
10777
10786
  } catch {
10778
10787
  return { bindings: void 0, isScriptSetup: false };