@nuxt/kit-nightly 4.3.0-29436247.ecea7a86 → 4.3.0-29436286.4f0cb865
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 +46 -23
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -561,6 +561,7 @@ function tryRequireModule(id, opts) {
|
|
|
561
561
|
}
|
|
562
562
|
|
|
563
563
|
const NODE_MODULES_RE = /[/\\]node_modules[/\\]/;
|
|
564
|
+
const ignoredConfigKeys = /* @__PURE__ */ new Set(["components", "imports", "pages", "devtools", "telemetry"]);
|
|
564
565
|
async function installModules(modulesToInstall, resolvedModulePaths, nuxt = useNuxt()) {
|
|
565
566
|
const localLayerModuleDirs = [];
|
|
566
567
|
for (const l of nuxt.options._layers) {
|
|
@@ -638,8 +639,8 @@ async function installModules(modulesToInstall, resolvedModulePaths, nuxt = useN
|
|
|
638
639
|
if (error) {
|
|
639
640
|
throw error;
|
|
640
641
|
}
|
|
641
|
-
for (const { nuxtModule, meta, moduleToInstall, buildTimeModuleMeta, resolvedModulePath, inlineOptions } of resolvedModules) {
|
|
642
|
-
const configKey = meta
|
|
642
|
+
for (const { nuxtModule, meta = {}, moduleToInstall, buildTimeModuleMeta, resolvedModulePath, inlineOptions } of resolvedModules) {
|
|
643
|
+
const configKey = meta.configKey;
|
|
643
644
|
const optionsFns = [
|
|
644
645
|
...nuxt._moduleOptionsFunctions.get(moduleToInstall) || [],
|
|
645
646
|
...meta?.name ? nuxt._moduleOptionsFunctions.get(meta.name) || [] : [],
|
|
@@ -658,8 +659,17 @@ async function installModules(modulesToInstall, resolvedModulePaths, nuxt = useN
|
|
|
658
659
|
nuxt.options[configKey] = defu(...overrides, nuxt.options[configKey], ...defaults);
|
|
659
660
|
}
|
|
660
661
|
}
|
|
661
|
-
|
|
662
|
-
|
|
662
|
+
const isDisabled = configKey && !ignoredConfigKeys.has(configKey) && nuxt.options[configKey] === false;
|
|
663
|
+
if (!isDisabled) {
|
|
664
|
+
await callLifecycleHooks(nuxtModule, meta, inlineOptions, nuxt);
|
|
665
|
+
}
|
|
666
|
+
const path = typeof moduleToInstall === "string" ? moduleToInstall : void 0;
|
|
667
|
+
await callModule(nuxt, nuxtModule, inlineOptions, {
|
|
668
|
+
meta: defu({ disabled: isDisabled }, meta, buildTimeModuleMeta),
|
|
669
|
+
nameOrPath: path,
|
|
670
|
+
modulePath: resolvedModulePath || path,
|
|
671
|
+
localLayerModuleDirs
|
|
672
|
+
});
|
|
663
673
|
}
|
|
664
674
|
delete nuxt._moduleOptionsFunctions;
|
|
665
675
|
}
|
|
@@ -691,8 +701,17 @@ async function installModule(moduleToInstall, inlineOptions, nuxt = useNuxt()) {
|
|
|
691
701
|
nuxt.options[configKey] = mergedOptions;
|
|
692
702
|
}
|
|
693
703
|
}
|
|
694
|
-
|
|
695
|
-
|
|
704
|
+
const isDisabled = configKey && !ignoredConfigKeys.has(configKey) && nuxt.options[configKey] === false;
|
|
705
|
+
if (!isDisabled) {
|
|
706
|
+
await callLifecycleHooks(nuxtModule, meta, mergedOptions, nuxt);
|
|
707
|
+
}
|
|
708
|
+
const path = typeof moduleToInstall === "string" ? moduleToInstall : void 0;
|
|
709
|
+
await callModule(nuxt, nuxtModule, mergedOptions, {
|
|
710
|
+
meta: defu({ disabled: isDisabled }, meta, buildTimeModuleMeta),
|
|
711
|
+
nameOrPath: path,
|
|
712
|
+
modulePath: resolvedModulePath || path,
|
|
713
|
+
localLayerModuleDirs
|
|
714
|
+
});
|
|
696
715
|
}
|
|
697
716
|
function resolveModuleWithOptions(definition, nuxt) {
|
|
698
717
|
const [module, options = {}] = Array.isArray(definition) ? definition : [definition, {}];
|
|
@@ -802,12 +821,12 @@ async function callLifecycleHooks(nuxtModule, meta = {}, inlineOptions, nuxt = u
|
|
|
802
821
|
);
|
|
803
822
|
}
|
|
804
823
|
}
|
|
805
|
-
async function callModule(nuxtModule,
|
|
806
|
-
const
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
const
|
|
824
|
+
async function callModule(nuxt, nuxtModule, moduleOptions = {}, options) {
|
|
825
|
+
const modulePath = options.modulePath;
|
|
826
|
+
const nameOrPath = options.nameOrPath;
|
|
827
|
+
const localLayerModuleDirs = options.localLayerModuleDirs;
|
|
828
|
+
const fn = () => nuxt.options.experimental?.debugModuleMutation && nuxt._asyncLocalStorageModule ? nuxt._asyncLocalStorageModule.run(nuxtModule, () => nuxtModule(moduleOptions, nuxt)) : nuxtModule(moduleOptions, nuxt);
|
|
829
|
+
const res = options.meta.disabled ? false : await fn();
|
|
811
830
|
let entryPath;
|
|
812
831
|
if (typeof modulePath === "string") {
|
|
813
832
|
const parsed = parseNodeModulePath(modulePath);
|
|
@@ -815,22 +834,26 @@ async function callModule(nuxtModule, meta = {}, inlineOptions, resolvedModulePa
|
|
|
815
834
|
const subpath = await lookupNodeModuleSubpath(modulePath) || ".";
|
|
816
835
|
entryPath = join(parsed.name, subpath === "./" ? "." : subpath);
|
|
817
836
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
837
|
+
if (res !== false) {
|
|
838
|
+
const moduleRoot = parsed.dir ? parsed.dir + parsed.name : await resolvePackageJSON(modulePath, { try: true }).then((r) => r ? dirname(r) : modulePath);
|
|
839
|
+
nuxt.options.build.transpile.push(normalizeModuleTranspilePath(moduleRoot));
|
|
840
|
+
const directory = moduleRoot.replace(/\/?$/, "/");
|
|
841
|
+
if (moduleRoot !== nameOrPath && !localLayerModuleDirs.some((dir) => directory.startsWith(dir))) {
|
|
842
|
+
nuxt.options.modulesDir.push(join(moduleRoot, "node_modules"));
|
|
843
|
+
}
|
|
823
844
|
}
|
|
824
845
|
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
846
|
+
if (nameOrPath) {
|
|
847
|
+
entryPath ||= resolveAlias(nameOrPath, nuxt.options.alias);
|
|
848
|
+
if (entryPath !== nameOrPath) {
|
|
849
|
+
options.meta.rawPath = nameOrPath;
|
|
850
|
+
}
|
|
829
851
|
}
|
|
852
|
+
nuxt.options._installedModules ||= [];
|
|
830
853
|
nuxt.options._installedModules.push({
|
|
831
|
-
meta:
|
|
854
|
+
meta: options.meta,
|
|
832
855
|
module: nuxtModule,
|
|
833
|
-
timings: res.timings,
|
|
856
|
+
timings: (res || {}).timings,
|
|
834
857
|
entryPath
|
|
835
858
|
});
|
|
836
859
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/kit-nightly",
|
|
3
|
-
"version": "4.3.0-
|
|
3
|
+
"version": "4.3.0-29436286.4f0cb865",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"untyped": "^2.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.3.0-
|
|
48
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.3.0-29436286.4f0cb865",
|
|
49
49
|
"@rspack/core": "1.6.7",
|
|
50
50
|
"@types/semver": "7.7.1",
|
|
51
51
|
"hookable": "5.5.3",
|