@vue/compiler-sfc 3.3.0-alpha.10 → 3.3.0-alpha.11

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.
@@ -15534,6 +15534,10 @@ function toFileNameLowerCase(x) {
15534
15534
  function createGetCanonicalFileName(useCaseSensitiveFileNames) {
15535
15535
  return useCaseSensitiveFileNames ? identity : toFileNameLowerCase;
15536
15536
  }
15537
+ const windowsSlashRE = /\\/g;
15538
+ function normalizePath(p) {
15539
+ return (path$2.posix || path$2).normalize(p.replace(windowsSlashRE, "/"));
15540
+ }
15537
15541
 
15538
15542
  function analyzeScriptBindings(ast) {
15539
15543
  for (const node of ast) {
@@ -16247,10 +16251,7 @@ function resolveGlobalScope(ctx) {
16247
16251
  throw new Error("[vue/compiler-sfc] globalTypeFiles requires fs access.");
16248
16252
  }
16249
16253
  return ctx.options.globalTypeFiles.map(
16250
- (file) => (
16251
- // TODO: differentiate ambient vs non-ambient module
16252
- fileToScope(file, fs, ctx.options.babelParserPlugins, true)
16253
- )
16254
+ (file) => fileToScope(normalizePath(file), fs, ctx.options.babelParserPlugins, true)
16254
16255
  );
16255
16256
  }
16256
16257
  }
@@ -16285,6 +16286,7 @@ function resolveTypeFromImport(ctx, node, name, scope) {
16285
16286
  resolved = resolveWithTS(containingFile, source, fs);
16286
16287
  }
16287
16288
  if (resolved) {
16289
+ resolved = normalizePath(resolved);
16288
16290
  (ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(resolved);
16289
16291
  return resolveTypeReference(
16290
16292
  ctx,
@@ -16316,7 +16318,8 @@ function resolveWithTS(containingFile, source, fs) {
16316
16318
  let options;
16317
16319
  let cache;
16318
16320
  if (configPath) {
16319
- const cached = tsConfigCache.get(configPath);
16321
+ const normalizedConfigPath = normalizePath(configPath);
16322
+ const cached = tsConfigCache.get(normalizedConfigPath);
16320
16323
  if (!cached) {
16321
16324
  const parseConfigHost = ts.sys;
16322
16325
  const parsed = ts.parseJsonConfigFileContent(
@@ -16332,7 +16335,7 @@ function resolveWithTS(containingFile, source, fs) {
16332
16335
  createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames),
16333
16336
  options
16334
16337
  );
16335
- tsConfigCache.set(configPath, { options, cache });
16338
+ tsConfigCache.set(normalizedConfigPath, { options, cache });
16336
16339
  } else {
16337
16340
  ({ options, cache } = cached);
16338
16341
  }
@@ -18190,7 +18193,7 @@ function isStaticNode(node) {
18190
18193
  }
18191
18194
  }
18192
18195
 
18193
- const version = "3.3.0-alpha.10";
18196
+ const version = "3.3.0-alpha.11";
18194
18197
  const walk = estreeWalker.walk;
18195
18198
 
18196
18199
  exports.babelParse = parser$2.parse;
@@ -47243,6 +47243,10 @@ function getImportedName(specifier) {
47243
47243
  function getId(node) {
47244
47244
  return node.type === "Identifier" ? node.name : node.type === "StringLiteral" ? node.value : null;
47245
47245
  }
47246
+ const windowsSlashRE = /\\/g;
47247
+ function normalizePath(p) {
47248
+ return (path.posix || path).normalize(p.replace(windowsSlashRE, "/"));
47249
+ }
47246
47250
 
47247
47251
  function analyzeScriptBindings(ast) {
47248
47252
  for (const node of ast) {
@@ -47992,10 +47996,7 @@ function resolveGlobalScope(ctx) {
47992
47996
  throw new Error("[vue/compiler-sfc] globalTypeFiles requires fs access.");
47993
47997
  }
47994
47998
  return ctx.options.globalTypeFiles.map(
47995
- (file) => (
47996
- // TODO: differentiate ambient vs non-ambient module
47997
- fileToScope(file, fs, ctx.options.babelParserPlugins, true)
47998
- )
47999
+ (file) => fileToScope(normalizePath(file), fs, ctx.options.babelParserPlugins, true)
47999
48000
  );
48000
48001
  }
48001
48002
  }
@@ -48015,7 +48016,7 @@ function resolveTypeFromImport(ctx, node, name, scope) {
48015
48016
  const { source, imported } = scope.imports[name];
48016
48017
  let resolved;
48017
48018
  if (source.startsWith(".")) {
48018
- const filename = join$1(containingFile, "..", source);
48019
+ const filename = path.join(containingFile, "..", source);
48019
48020
  resolved = resolveExt(filename, fs);
48020
48021
  } else {
48021
48022
  {
@@ -48037,6 +48038,7 @@ function resolveTypeFromImport(ctx, node, name, scope) {
48037
48038
  resolved = resolveWithTS();
48038
48039
  }
48039
48040
  if (resolved) {
48041
+ resolved = normalizePath(resolved);
48040
48042
  (ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(resolved);
48041
48043
  return resolveTypeReference(
48042
48044
  ctx,
@@ -48091,7 +48093,7 @@ function fileToScope(filename, fs, parserPlugins, asGlobal = false) {
48091
48093
  return scope;
48092
48094
  }
48093
48095
  function parseFile(filename, content, parserPlugins) {
48094
- const ext = extname(filename);
48096
+ const ext = path.extname(filename);
48095
48097
  if (ext === ".ts" || ext === ".tsx") {
48096
48098
  return parse_1$1(content, {
48097
48099
  plugins: resolveParserPlugins(ext.slice(1), parserPlugins),
@@ -49925,7 +49927,7 @@ function isStaticNode(node) {
49925
49927
  }
49926
49928
  }
49927
49929
 
49928
- const version = "3.3.0-alpha.10";
49930
+ const version = "3.3.0-alpha.11";
49929
49931
  const walk = walk$1;
49930
49932
 
49931
49933
  export { MagicString, parse_1$1 as babelParse, compileScript, compileStyle, compileStyleAsync, compileTemplate, extractIdentifiers, generateCodeFrame, inferRuntimeType, invalidateTypeCache, isInDestructureAssignment, isStaticProperty, parse$7 as parse, registerTS, resolveTypeElements, rewriteDefault, rewriteDefaultAST, shouldTransform as shouldTransformRef, transform as transformRef, transformAST as transformRefAST, version, walk, walkIdentifiers };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-sfc",
3
- "version": "3.3.0-alpha.10",
3
+ "version": "3.3.0-alpha.11",
4
4
  "description": "@vue/compiler-sfc",
5
5
  "main": "dist/compiler-sfc.cjs.js",
6
6
  "module": "dist/compiler-sfc.esm-browser.js",
@@ -33,11 +33,11 @@
33
33
  "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-sfc#readme",
34
34
  "dependencies": {
35
35
  "@babel/parser": "^7.20.15",
36
- "@vue/compiler-core": "3.3.0-alpha.10",
37
- "@vue/compiler-dom": "3.3.0-alpha.10",
38
- "@vue/compiler-ssr": "3.3.0-alpha.10",
39
- "@vue/reactivity-transform": "3.3.0-alpha.10",
40
- "@vue/shared": "3.3.0-alpha.10",
36
+ "@vue/compiler-core": "3.3.0-alpha.11",
37
+ "@vue/compiler-dom": "3.3.0-alpha.11",
38
+ "@vue/compiler-ssr": "3.3.0-alpha.11",
39
+ "@vue/reactivity-transform": "3.3.0-alpha.11",
40
+ "@vue/shared": "3.3.0-alpha.11",
41
41
  "estree-walker": "^2.0.2",
42
42
  "magic-string": "^0.30.0",
43
43
  "postcss": "^8.1.10",