nitro-nightly 3.0.1-20251217-124302-0d9f782c → 3.0.1-20251217-221413-0e6f159e
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/_build/vite.plugin.mjs +2 -47
- package/dist/_nitro.mjs +4 -4
- package/dist/types/index.d.mts +16 -47
- package/dist/vite.d.mts +1 -5
- package/dist/vite.mjs +1 -0
- package/lib/vite.d.mts +26 -0
- package/package.json +4 -3
- /package/lib/{deps/h3.d.mts → h3.d.mts} +0 -0
- /package/lib/{deps/h3.mjs → h3.mjs} +0 -0
|
@@ -30,7 +30,6 @@ const getViteRollupConfig = (ctx) => {
|
|
|
30
30
|
input: nitro$1.options.entry,
|
|
31
31
|
external: [...base.env.external],
|
|
32
32
|
plugins: [
|
|
33
|
-
ctx.pluginConfig.experimental?.vite?.virtualBundle && virtualBundlePlugin(ctx._serviceBundles),
|
|
34
33
|
...baseBuildPlugins(nitro$1, base),
|
|
35
34
|
alias({ entries: base.aliases }),
|
|
36
35
|
!ctx._isRolldown && inject(base.env.inject)
|
|
@@ -65,41 +64,6 @@ const getViteRollupConfig = (ctx) => {
|
|
|
65
64
|
base
|
|
66
65
|
};
|
|
67
66
|
};
|
|
68
|
-
function virtualBundlePlugin(bundles) {
|
|
69
|
-
let _modules = null;
|
|
70
|
-
const getModules = () => {
|
|
71
|
-
if (_modules) return _modules;
|
|
72
|
-
_modules = /* @__PURE__ */ new Map();
|
|
73
|
-
for (const bundle of Object.values(bundles)) for (const [fileName, content] of Object.entries(bundle)) if (content.type === "chunk") {
|
|
74
|
-
const virtualModule = {
|
|
75
|
-
code: content.code,
|
|
76
|
-
map: null
|
|
77
|
-
};
|
|
78
|
-
const maybeMap = bundle[`${fileName}.map`];
|
|
79
|
-
if (maybeMap && maybeMap.type === "asset") virtualModule.map = maybeMap.source;
|
|
80
|
-
_modules.set(fileName, virtualModule);
|
|
81
|
-
_modules.set(resolve$1(fileName), virtualModule);
|
|
82
|
-
}
|
|
83
|
-
return _modules;
|
|
84
|
-
};
|
|
85
|
-
return {
|
|
86
|
-
name: "virtual-bundle",
|
|
87
|
-
resolveId(id, importer) {
|
|
88
|
-
const modules = getModules();
|
|
89
|
-
if (modules.has(id)) return resolve$1(id);
|
|
90
|
-
if (importer) {
|
|
91
|
-
const resolved = resolve$1(dirname$1(importer), id);
|
|
92
|
-
if (modules.has(resolved)) return resolved;
|
|
93
|
-
}
|
|
94
|
-
return null;
|
|
95
|
-
},
|
|
96
|
-
load(id) {
|
|
97
|
-
const m = getModules().get(id);
|
|
98
|
-
if (!m) return null;
|
|
99
|
-
return m;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
67
|
|
|
104
68
|
//#endregion
|
|
105
69
|
//#region src/build/vite/prod.ts
|
|
@@ -181,10 +145,7 @@ function lazyService(loader) {
|
|
|
181
145
|
|
|
182
146
|
const services = {
|
|
183
147
|
${Object.keys(ctx.services).map((name) => {
|
|
184
|
-
|
|
185
|
-
if (ctx.pluginConfig.experimental?.vite?.virtualBundle) entry = ctx._entryPoints[name];
|
|
186
|
-
else entry = resolve$1(ctx.nitro.options.buildDir, "vite/services", name, ctx._entryPoints[name]);
|
|
187
|
-
return [name, entry];
|
|
148
|
+
return [name, resolve$1(ctx.nitro.options.buildDir, "vite/services", name, ctx._entryPoints[name])];
|
|
188
149
|
}).map(([name, entry]) => `[${JSON.stringify(name)}]: lazyService(() => import(${JSON.stringify(entry)}))`).join(",\n")}
|
|
189
150
|
};
|
|
190
151
|
|
|
@@ -552,10 +513,6 @@ function nitroEnv(ctx) {
|
|
|
552
513
|
debug("[env] Configuring client environment", name === "client" ? "" : ` (${name})`);
|
|
553
514
|
config.build.emptyOutDir = false;
|
|
554
515
|
config.build.outDir = useNitro(ctx).options.output.publicDir;
|
|
555
|
-
} else if (ctx.pluginConfig.experimental?.vite?.virtualBundle && name in (ctx.services || {})) {
|
|
556
|
-
debug("[env] Configuring service environment for virtual:", name);
|
|
557
|
-
config.build ??= {};
|
|
558
|
-
config.build.write = config.build.write ?? false;
|
|
559
516
|
}
|
|
560
517
|
}
|
|
561
518
|
};
|
|
@@ -595,7 +552,6 @@ function nitroMain(ctx) {
|
|
|
595
552
|
if (isRegisteredService) {
|
|
596
553
|
if (entryFile === void 0) this.error(`No entry point found for service "${this.environment.name}".`);
|
|
597
554
|
ctx._entryPoints[this.environment.name] = entryFile;
|
|
598
|
-
ctx._serviceBundles[this.environment.name] = bundle;
|
|
599
555
|
}
|
|
600
556
|
} },
|
|
601
557
|
configureServer: (server) => {
|
|
@@ -662,8 +618,7 @@ function createContext(pluginConfig) {
|
|
|
662
618
|
return {
|
|
663
619
|
pluginConfig,
|
|
664
620
|
services: {},
|
|
665
|
-
_entryPoints: {}
|
|
666
|
-
_serviceBundles: {}
|
|
621
|
+
_entryPoints: {}
|
|
667
622
|
};
|
|
668
623
|
}
|
|
669
624
|
function useNitro(ctx) {
|
package/dist/_nitro.mjs
CHANGED
|
@@ -1017,7 +1017,7 @@ async function scanUnprefixedPublicAssets(nitro) {
|
|
|
1017
1017
|
for (const asset of nitro.options.publicAssets) {
|
|
1018
1018
|
if (asset.baseURL && asset.baseURL !== "/" && !asset.fallthrough) continue;
|
|
1019
1019
|
if (!await isDirectory(asset.dir)) continue;
|
|
1020
|
-
const publicAssets = await glob(getIncludePatterns(nitro, asset.dir), {
|
|
1020
|
+
const publicAssets = await glob(getIncludePatterns(nitro, asset.dir, asset.ignore), {
|
|
1021
1021
|
cwd: asset.dir,
|
|
1022
1022
|
absolute: false,
|
|
1023
1023
|
dot: true
|
|
@@ -1032,7 +1032,7 @@ async function copyPublicAssets(nitro) {
|
|
|
1032
1032
|
const assetDir = asset.dir;
|
|
1033
1033
|
const dstDir = join(nitro.options.output.publicDir, asset.baseURL);
|
|
1034
1034
|
if (await isDirectory(assetDir)) {
|
|
1035
|
-
const publicAssets = await glob(getIncludePatterns(nitro, assetDir), {
|
|
1035
|
+
const publicAssets = await glob(getIncludePatterns(nitro, assetDir, asset.ignore), {
|
|
1036
1036
|
cwd: assetDir,
|
|
1037
1037
|
absolute: false,
|
|
1038
1038
|
dot: true
|
|
@@ -1047,8 +1047,8 @@ async function copyPublicAssets(nitro) {
|
|
|
1047
1047
|
if (nitro.options.compressPublicAssets) await compressPublicAssets(nitro);
|
|
1048
1048
|
nitro.logger.success("Generated public " + prettyPath(nitro.options.output.publicDir));
|
|
1049
1049
|
}
|
|
1050
|
-
function getIncludePatterns(nitro, assetDir) {
|
|
1051
|
-
return ["**", ...
|
|
1050
|
+
function getIncludePatterns(nitro, assetDir, ignorePatterns = nitro.options.ignore) {
|
|
1051
|
+
return ["**", ...(ignorePatterns || []).map((p) => {
|
|
1052
1052
|
const [_, negation, pattern] = p.match(NEGATION_RE) || [];
|
|
1053
1053
|
return (negation ? "" : "!") + (pattern.startsWith("*") ? pattern : relative(assetDir, resolve(nitro.options.rootDir, pattern)));
|
|
1054
1054
|
})].filter((p) => !PARENT_DIR_GLOB_RE.test(p));
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
import "nitro";
|
|
2
|
-
import "nitro/app";
|
|
3
|
-
import "nitro/builder";
|
|
4
|
-
import "nitro/cache";
|
|
5
|
-
import "nitro/config";
|
|
6
|
-
import "nitro/context";
|
|
7
|
-
import "nitro/database";
|
|
8
|
-
import "nitro/h3";
|
|
9
|
-
import "nitro/meta";
|
|
10
|
-
import "nitro/package.json";
|
|
11
|
-
import "nitro/runtime-config";
|
|
12
|
-
import "nitro/storage";
|
|
13
|
-
import "nitro/task";
|
|
14
|
-
import "nitro/tsconfig";
|
|
15
|
-
import "nitro/types";
|
|
16
|
-
import "nitro/vite";
|
|
17
|
-
import "nitro/vite/runtime";
|
|
18
1
|
import { ConsolaInstance, LogLevel } from "consola";
|
|
19
2
|
import { Hookable, HookableCore, NestedHooks } from "hookable";
|
|
20
3
|
import { version } from "nitro/meta";
|
|
@@ -26,6 +9,15 @@ import { Preset } from "unenv";
|
|
|
26
9
|
import { ConnectorName } from "db0";
|
|
27
10
|
import { BuiltinDriverName } from "unstorage";
|
|
28
11
|
import { JsxOptions, TransformOptions } from "oxc-transform";
|
|
12
|
+
import "nitro";
|
|
13
|
+
import "nitro/app";
|
|
14
|
+
import "nitro/cache";
|
|
15
|
+
import "nitro/context";
|
|
16
|
+
import "nitro/database";
|
|
17
|
+
import "nitro/h3";
|
|
18
|
+
import "nitro/runtime-config";
|
|
19
|
+
import "nitro/storage";
|
|
20
|
+
import "nitro/task";
|
|
29
21
|
import { MinifyOptions } from "oxc-minify";
|
|
30
22
|
import { InputOptions, OutputOptions } from "rollup";
|
|
31
23
|
import { Nitro as Nitro$1, RunnerMessageListener as RunnerMessageListener$1 } from "nitro/types";
|
|
@@ -235,35 +227,6 @@ interface TaskRunnerOptions {
|
|
|
235
227
|
buildDir?: string;
|
|
236
228
|
}
|
|
237
229
|
//#endregion
|
|
238
|
-
//#region src/types/runtime/client/assets.d.ts
|
|
239
|
-
// Based on https://github.com/hi-ogawa/vite-plugins/blob/main/packages/fullstack/types/query.d.ts
|
|
240
|
-
|
|
241
|
-
type ImportAssetsResult = ImportAssetsResultRaw & {
|
|
242
|
-
merge(...args: ImportAssetsResultRaw[]): ImportAssetsResult;
|
|
243
|
-
};
|
|
244
|
-
type ImportAssetsResultRaw = {
|
|
245
|
-
entry?: string;
|
|
246
|
-
js: {
|
|
247
|
-
href: string;
|
|
248
|
-
}[];
|
|
249
|
-
css: {
|
|
250
|
-
href: string;
|
|
251
|
-
"data-vite-dev-id"?: string;
|
|
252
|
-
}[];
|
|
253
|
-
};
|
|
254
|
-
declare module "*?assets" {
|
|
255
|
-
const assets: ImportAssetsResult;
|
|
256
|
-
export default assets;
|
|
257
|
-
}
|
|
258
|
-
declare module "*?assets=client" {
|
|
259
|
-
const assets: ImportAssetsResult;
|
|
260
|
-
export default assets;
|
|
261
|
-
}
|
|
262
|
-
declare module "*?assets=ssr" {
|
|
263
|
-
const assets: ImportAssetsResult;
|
|
264
|
-
export default assets;
|
|
265
|
-
}
|
|
266
|
-
//#endregion
|
|
267
230
|
//#region src/presets/aws-amplify/types.d.ts
|
|
268
231
|
type AmplifyImageSettings = {
|
|
269
232
|
/** Array of supported image widths */
|
|
@@ -3122,6 +3085,12 @@ interface PublicAssetDir {
|
|
|
3122
3085
|
fallthrough?: boolean;
|
|
3123
3086
|
maxAge: number;
|
|
3124
3087
|
dir: string;
|
|
3088
|
+
/**
|
|
3089
|
+
* Pass false to disable ignore patterns when scanning the directory, or
|
|
3090
|
+
* pass an array of glob patterns to ignore (which will override global
|
|
3091
|
+
* nitro.ignore patterns).
|
|
3092
|
+
*/
|
|
3093
|
+
ignore?: false | string[];
|
|
3125
3094
|
}
|
|
3126
3095
|
interface CompressOptions {
|
|
3127
3096
|
gzip?: boolean;
|
|
@@ -3228,4 +3197,4 @@ declare module "srvx" {
|
|
|
3228
3197
|
}
|
|
3229
3198
|
}
|
|
3230
3199
|
//#endregion
|
|
3231
|
-
export { $Fetch, AssetMeta, AvailableRouterMethod, Base$Fetch, CacheEntry, CacheOptions, CachedEventHandlerOptions, CaptureError, CapturedErrorContext, CompressOptions, DatabaseConnectionConfig, DatabaseConnectionConfigs, DatabaseConnectionName, EnvRunner, EventHandlerFormat, ExtractedRouteMethod, FetchHandler, H3Event$Fetch, H3EventFetch, HTTPstatus,
|
|
3200
|
+
export { $Fetch, AssetMeta, AvailableRouterMethod, Base$Fetch, CacheEntry, CacheOptions, CachedEventHandlerOptions, CaptureError, CapturedErrorContext, CompressOptions, DatabaseConnectionConfig, DatabaseConnectionConfigs, DatabaseConnectionName, EnvRunner, EventHandlerFormat, ExtractedRouteMethod, FetchHandler, H3Event$Fetch, H3EventFetch, HTTPstatus, InternalApi, LoadConfigOptions, MatchedRouteRule, MatchedRouteRules, MatchedRoutes, MiddlewareOf, Nitro, NitroApp, NitroAppPlugin, NitroAsyncContext, NitroBuildInfo, NitroConfig, NitroDevEventHandler, NitroDynamicConfig, NitroErrorHandler, NitroEventHandler, NitroFetchOptions, NitroFetchRequest, NitroFrameworkInfo, NitroHooks, NitroImportMeta, NitroModule, NitroModuleInput, type NitroOpenAPIConfig, NitroOptions, NitroPreset, NitroPresetMeta, NitroRouteConfig, NitroRouteMeta, NitroRouteRules, NitroRuntimeConfig, NitroRuntimeConfigApp, NitroRuntimeHooks, NitroTypes, OXCOptions, PrerenderGenerateRoute, PrerenderRoute, PublicAsset, PublicAssetDir, RenderContext, RenderHandler, RenderResponse, ResponseCacheEntry, RollupConfig, RollupVirtualOptions, RunnerMessageListener, RunnerRPCHooks, Serialize, SerializeObject, SerializeTuple, ServerAssetDir, ServerAssetOptions, type ServerRequest, Simplify, StorageMounts, Task, TaskContext, TaskEvent, TaskMeta, TaskPayload, TaskResult, TaskRunnerOptions, TypedInternalResponse, UpgradeHandler, VirtualModule, WorkerAddress, WorkerHooks };
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "./_dev.mjs";
|
|
2
|
+
import "nitro/vite/types";
|
|
2
3
|
import "unenv";
|
|
3
4
|
import { Plugin } from "vite";
|
|
4
5
|
import { Nitro, NitroConfig, NitroModule } from "nitro/types";
|
|
@@ -22,11 +23,6 @@ interface NitroPluginConfig extends NitroConfig {
|
|
|
22
23
|
_nitro?: Nitro;
|
|
23
24
|
experimental?: NitroConfig["experimental"] & {
|
|
24
25
|
vite: {
|
|
25
|
-
/**
|
|
26
|
-
* @experimental Use the virtual filesystem for intermediate environment build output files.
|
|
27
|
-
* @note This is unsafe if plugins rely on temporary files on the filesystem.
|
|
28
|
-
*/
|
|
29
|
-
virtualBundle?: boolean;
|
|
30
26
|
/**
|
|
31
27
|
* @experimental Enable `?assets` import proposed by https://github.com/vitejs/vite/discussions/20913
|
|
32
28
|
* @default true
|
package/dist/vite.mjs
CHANGED
package/lib/vite.d.mts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Based on https://github.com/hi-ogawa/vite-plugins/blob/main/packages/fullstack/types/query.d.ts
|
|
2
|
+
|
|
3
|
+
export type ImportAssetsResult = ImportAssetsResultRaw & {
|
|
4
|
+
merge(...args: ImportAssetsResultRaw[]): ImportAssetsResult;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type ImportAssetsResultRaw = {
|
|
8
|
+
entry?: string;
|
|
9
|
+
js: { href: string }[];
|
|
10
|
+
css: { href: string; "data-vite-dev-id"?: string }[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare module "*?assets" {
|
|
14
|
+
const assets: ImportAssetsResult;
|
|
15
|
+
export default assets;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare module "*?assets=client" {
|
|
19
|
+
const assets: ImportAssetsResult;
|
|
20
|
+
export default assets;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare module "*?assets=ssr" {
|
|
24
|
+
const assets: ImportAssetsResult;
|
|
25
|
+
export default assets;
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-nightly",
|
|
3
|
-
"version": "3.0.1-20251217-
|
|
3
|
+
"version": "3.0.1-20251217-221413-0e6f159e",
|
|
4
4
|
"description": "Build and Deploy Universal JavaScript Servers",
|
|
5
5
|
"homepage": "https://nitro.build",
|
|
6
6
|
"repository": "nitrojs/nitro",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"./config": "./dist/runtime/config.mjs",
|
|
19
19
|
"./context": "./dist/runtime/context.mjs",
|
|
20
20
|
"./database": "./dist/runtime/database.mjs",
|
|
21
|
-
"./h3": "./lib/
|
|
21
|
+
"./h3": "./lib/h3.mjs",
|
|
22
22
|
"./meta": "./dist/runtime/meta.mjs",
|
|
23
23
|
"./package.json": "./package.json",
|
|
24
24
|
"./runtime-config": "./dist/runtime/runtime-config.mjs",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"./tsconfig": "./lib/tsconfig.json",
|
|
28
28
|
"./types": "./dist/types/index.mjs",
|
|
29
29
|
"./vite": "./dist/vite.mjs",
|
|
30
|
-
"./vite/runtime": "./dist/runtime/vite.mjs"
|
|
30
|
+
"./vite/runtime": "./dist/runtime/vite.mjs",
|
|
31
|
+
"./vite/types": "./lib/vite.d.mts"
|
|
31
32
|
},
|
|
32
33
|
"types": "./lib/index.d.mts",
|
|
33
34
|
"bin": {
|
|
File without changes
|
|
File without changes
|