nuxt-nightly 4.2.3-29430329.ec16da17 → 4.2.3-29430410.6b7fc747

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.
Files changed (2) hide show
  1. package/dist/index.mjs +57 -40
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -3837,7 +3837,7 @@ function addDeclarationTemplates(ctx, options) {
3837
3837
  });
3838
3838
  }
3839
3839
 
3840
- const version = "4.2.3-29430329.ec16da17";
3840
+ const version = "4.2.3-29430410.6b7fc747";
3841
3841
 
3842
3842
  function createImportProtectionPatterns(nuxt, options) {
3843
3843
  const patterns = [];
@@ -4013,6 +4013,7 @@ const DevOnlyPlugin = (options) => createUnplugin(() => {
4013
4013
 
4014
4014
  const ALIAS_RE = /(?<=['"])[~@]{1,2}(?=\/)/g;
4015
4015
  const ALIAS_RE_SINGLE = /(?<=['"])[~@]{1,2}(?=\/)/;
4016
+ const ALIAS_ID_RE = /^[~@]{1,2}\//;
4016
4017
  const LayerAliasingPlugin = (options) => createUnplugin((_options, meta) => {
4017
4018
  const aliases = {};
4018
4019
  for (const layer of options.layers) {
@@ -4056,6 +4057,9 @@ const LayerAliasingPlugin = (options) => createUnplugin((_options, meta) => {
4056
4057
  vite: {
4057
4058
  resolveId: {
4058
4059
  order: "pre",
4060
+ filter: {
4061
+ id: ALIAS_ID_RE
4062
+ },
4059
4063
  async handler(id, importer) {
4060
4064
  if (!importer) {
4061
4065
  return;
@@ -4595,39 +4599,50 @@ function ResolveDeepImportsPlugin(nuxt) {
4595
4599
  return {
4596
4600
  name: "nuxt:resolve-bare-imports",
4597
4601
  enforce: "post",
4598
- async resolveId(id, importer) {
4599
- if (!importer || isAbsolute(id) || !isAbsolute(importer) && !VIRTUAL_RE.test(importer) || exclude.some((e) => id.startsWith(e))) {
4600
- return;
4601
- }
4602
- const normalisedId = resolveAlias$1(normalize(id), nuxt.options.alias);
4603
- const isNuxtTemplate = importer.startsWith("virtual:nuxt");
4604
- const normalisedImporter = (isNuxtTemplate ? decodeURIComponent(importer) : importer).replace(VIRTUAL_RE, "");
4605
- if (nuxt.options.experimental.templateImportResolution !== false && isNuxtTemplate) {
4606
- const template = nuxt.options.build.templates.find((t) => resolve(nuxt.options.buildDir, t.filename) === normalisedImporter);
4607
- if (template?._path) {
4608
- const res2 = await this.resolve?.(normalisedId, template._path, { skipSelf: true });
4609
- if (res2 !== void 0 && res2 !== null) {
4610
- return res2;
4602
+ resolveId: {
4603
+ filter: {
4604
+ id: {
4605
+ exclude: [
4606
+ // absolute path
4607
+ /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,
4608
+ ...exclude.map((e) => new RegExp("^" + escapeRE(e)))
4609
+ ]
4610
+ }
4611
+ },
4612
+ async handler(id, importer) {
4613
+ if (!importer || !isAbsolute(importer) && !VIRTUAL_RE.test(importer)) {
4614
+ return;
4615
+ }
4616
+ const normalisedId = resolveAlias$1(normalize(id), nuxt.options.alias);
4617
+ const isNuxtTemplate = importer.startsWith("virtual:nuxt");
4618
+ const normalisedImporter = (isNuxtTemplate ? decodeURIComponent(importer) : importer).replace(VIRTUAL_RE, "");
4619
+ if (nuxt.options.experimental.templateImportResolution !== false && isNuxtTemplate) {
4620
+ const template = nuxt.options.build.templates.find((t) => resolve(nuxt.options.buildDir, t.filename) === normalisedImporter);
4621
+ if (template?._path) {
4622
+ const res2 = await this.resolve?.(normalisedId, template._path, { skipSelf: true });
4623
+ if (res2 !== void 0 && res2 !== null) {
4624
+ return res2;
4625
+ }
4611
4626
  }
4612
4627
  }
4628
+ const dir = parseNodeModulePath(normalisedImporter).dir || pkgDir;
4629
+ const res = await this.resolve?.(normalisedId, dir, { skipSelf: true });
4630
+ if (res !== void 0 && res !== null) {
4631
+ return res;
4632
+ }
4633
+ const environmentConditions = conditions[this.environment.name] ||= resolveConditions(this.environment);
4634
+ const path = resolveModulePath(id, {
4635
+ from: [dir, ...nuxt.options.modulesDir].map((d) => directoryToURL(d)),
4636
+ suffixes: ["", "index"],
4637
+ conditions: environmentConditions,
4638
+ try: true
4639
+ });
4640
+ if (!path) {
4641
+ logger.debug("Could not resolve id", id, importer);
4642
+ return null;
4643
+ }
4644
+ return normalize(path);
4613
4645
  }
4614
- const dir = parseNodeModulePath(normalisedImporter).dir || pkgDir;
4615
- const res = await this.resolve?.(normalisedId, dir, { skipSelf: true });
4616
- if (res !== void 0 && res !== null) {
4617
- return res;
4618
- }
4619
- const environmentConditions = conditions[this.environment.name] ||= resolveConditions(this.environment);
4620
- const path = resolveModulePath(id, {
4621
- from: [dir, ...nuxt.options.modulesDir].map((d) => directoryToURL(d)),
4622
- suffixes: ["", "index"],
4623
- conditions: environmentConditions,
4624
- try: true
4625
- });
4626
- if (!path) {
4627
- logger.debug("Could not resolve id", id, importer);
4628
- return null;
4629
- }
4630
- return normalize(path);
4631
4646
  }
4632
4647
  };
4633
4648
  }
@@ -4955,15 +4970,17 @@ const VirtualFSPlugin = (nuxt, options) => createUnplugin((_, meta) => {
4955
4970
  }
4956
4971
  }
4957
4972
  },
4958
- loadInclude(id) {
4959
- return PREFIX_RE.test(id) && withoutQuery(withoutPrefix(decodeURIComponent(id))) in nuxt.vfs;
4960
- },
4961
- load(id) {
4962
- const key = withoutQuery(withoutPrefix(decodeURIComponent(id)));
4963
- return {
4964
- code: nuxt.vfs[key] || "",
4965
- map: null
4966
- };
4973
+ load: {
4974
+ filter: {
4975
+ id: PREFIX_RE
4976
+ },
4977
+ handler(id) {
4978
+ const key = withoutQuery(withoutPrefix(decodeURIComponent(id)));
4979
+ return {
4980
+ code: nuxt.vfs[key] || "",
4981
+ map: null
4982
+ };
4983
+ }
4967
4984
  }
4968
4985
  };
4969
4986
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-nightly",
3
- "version": "4.2.3-29430329.ec16da17",
3
+ "version": "4.2.3-29430410.6b7fc747",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -67,11 +67,11 @@
67
67
  "@dxup/nuxt": "^0.2.2",
68
68
  "@nuxt/cli": "npm:@nuxt/cli-nightly@latest",
69
69
  "@nuxt/devtools": "^3.1.1",
70
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.3-29430329.ec16da17",
71
- "@nuxt/nitro-server": "npm:@nuxt/nitro-server-nightly@4.2.3-29430329.ec16da17",
72
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.3-29430329.ec16da17",
70
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.3-29430410.6b7fc747",
71
+ "@nuxt/nitro-server": "npm:@nuxt/nitro-server-nightly@4.2.3-29430410.6b7fc747",
72
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.3-29430410.6b7fc747",
73
73
  "@nuxt/telemetry": "^2.6.6",
74
- "@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.2.3-29430329.ec16da17",
74
+ "@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.2.3-29430410.6b7fc747",
75
75
  "@unhead/vue": "^2.0.19",
76
76
  "@vue/shared": "^3.5.25",
77
77
  "c12": "^3.3.2",