nitro-nightly 3.0.1-20260106-111729-02aef37b → 3.0.1-20260106-122532-056cfafb
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/rolldown.mjs +5 -5
- package/dist/_build/rollup.mjs +5 -5
- package/dist/_build/shared.mjs +52 -33
- package/dist/_build/shared2.mjs +33 -61
- package/dist/_build/shared3.mjs +55 -1115
- package/dist/_build/shared4.mjs +1108 -55
- package/dist/_build/vite.build.mjs +3 -3
- package/dist/_build/vite.plugin.mjs +4 -4
- package/dist/_dev.mjs +2 -2
- package/dist/_libs/c12.mjs +1 -11
- package/dist/_libs/confbox.mjs +1 -1
- package/dist/_libs/giget.mjs +1 -1
- package/dist/_libs/local-pkg.mjs +1 -1
- package/dist/_libs/pathe.mjs +1 -1
- package/dist/_libs/unimport.mjs +1 -1
- package/dist/_libs/unwasm.mjs +2 -2
- package/dist/_nitro.mjs +2 -2
- package/dist/_nitro2.mjs +2 -2
- package/dist/_presets.mjs +2 -2
- package/dist/builder.mjs +2 -2
- package/dist/cli/_chunks/build.mjs +1 -1
- package/dist/cli/_chunks/dev.mjs +3 -3
- package/dist/cli/_chunks/list.mjs +1 -1
- package/dist/cli/_chunks/prepare.mjs +1 -1
- package/dist/cli/_chunks/run.mjs +1 -1
- package/dist/node_modules/ufo/dist/index.mjs +8 -8
- package/dist/node_modules/ufo/package.json +15 -14
- package/dist/vite.mjs +3 -3
- package/package.json +7 -7
package/dist/_build/rolldown.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import "../_rolldown.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { T as join, k as relative, s as debounce } from "../_libs/c12.mjs";
|
|
3
3
|
import "../_libs/@hiogawa/vite-plugin-fullstack.mjs";
|
|
4
4
|
import "../_libs/acorn.mjs";
|
|
5
5
|
import "../_libs/unimport.mjs";
|
|
6
6
|
import "../_libs/@rollup/plugin-commonjs.mjs";
|
|
7
|
+
import { t as generateFSTree } from "./shared.mjs";
|
|
7
8
|
import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
|
|
8
|
-
import "./
|
|
9
|
+
import "./shared2.mjs";
|
|
9
10
|
import { i as scanHandlers, n as writeTypes } from "../_nitro2.mjs";
|
|
10
11
|
import "../_libs/mime.mjs";
|
|
11
|
-
import { n as writeBuildInfo } from "./
|
|
12
|
+
import { n as writeBuildInfo } from "./shared3.mjs";
|
|
12
13
|
import { a as watch$1 } from "../_libs/chokidar.mjs";
|
|
13
|
-
import { a as baseBuildConfig, i as libChunkName, n as NODE_MODULES_RE, r as getChunkName, t as baseBuildPlugins } from "./
|
|
14
|
+
import { a as baseBuildConfig, i as libChunkName, n as NODE_MODULES_RE, r as getChunkName, t as baseBuildPlugins } from "./shared4.mjs";
|
|
14
15
|
import "../_libs/etag.mjs";
|
|
15
16
|
import "../_libs/@jridgewell/gen-mapping.mjs";
|
|
16
17
|
import "../_libs/@jridgewell/remapping.mjs";
|
|
17
18
|
import "../_libs/@rollup/plugin-replace.mjs";
|
|
18
19
|
import "../_libs/duplexer.mjs";
|
|
19
20
|
import "../_libs/gzip-size.mjs";
|
|
20
|
-
import { t as generateFSTree } from "./shared4.mjs";
|
|
21
21
|
import { builtinModules } from "node:module";
|
|
22
22
|
import { watch } from "node:fs";
|
|
23
23
|
import { defu } from "defu";
|
package/dist/_build/rollup.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import "../_rolldown.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { T as join, k as relative, s as debounce, w as isAbsolute } from "../_libs/c12.mjs";
|
|
3
3
|
import "../_libs/@hiogawa/vite-plugin-fullstack.mjs";
|
|
4
4
|
import "../_libs/acorn.mjs";
|
|
5
5
|
import "../_libs/unimport.mjs";
|
|
6
6
|
import { t as commonjs } from "../_libs/@rollup/plugin-commonjs.mjs";
|
|
7
|
+
import { t as generateFSTree } from "./shared.mjs";
|
|
7
8
|
import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
|
|
8
|
-
import "./
|
|
9
|
+
import "./shared2.mjs";
|
|
9
10
|
import { i as scanHandlers, n as writeTypes } from "../_nitro2.mjs";
|
|
10
11
|
import "../_libs/mime.mjs";
|
|
11
|
-
import { n as writeBuildInfo } from "./
|
|
12
|
+
import { n as writeBuildInfo } from "./shared3.mjs";
|
|
12
13
|
import { a as watch$1 } from "../_libs/chokidar.mjs";
|
|
13
14
|
import { t as alias } from "../_libs/@rollup/plugin-alias.mjs";
|
|
14
15
|
import { t as inject } from "../_libs/@rollup/plugin-inject.mjs";
|
|
15
|
-
import { a as baseBuildConfig, i as libChunkName, n as NODE_MODULES_RE, r as getChunkName, t as baseBuildPlugins } from "./
|
|
16
|
+
import { a as baseBuildConfig, i as libChunkName, n as NODE_MODULES_RE, r as getChunkName, t as baseBuildPlugins } from "./shared4.mjs";
|
|
16
17
|
import "../_libs/etag.mjs";
|
|
17
18
|
import "../_libs/@jridgewell/gen-mapping.mjs";
|
|
18
19
|
import "../_libs/@jridgewell/remapping.mjs";
|
|
19
20
|
import "../_libs/@rollup/plugin-replace.mjs";
|
|
20
21
|
import "../_libs/duplexer.mjs";
|
|
21
22
|
import "../_libs/gzip-size.mjs";
|
|
22
|
-
import { t as generateFSTree } from "./shared4.mjs";
|
|
23
23
|
import { t as json } from "../_libs/@rollup/plugin-json.mjs";
|
|
24
24
|
import { t as nodeResolve } from "../_libs/@rollup/plugin-node-resolve.mjs";
|
|
25
25
|
import { watch } from "node:fs";
|
package/dist/_build/shared.mjs
CHANGED
|
@@ -1,40 +1,59 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { t as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { A as resolve, S as dirname, c as findFile, d as parseGitConfig, f as readGitConfig, h as resolvePackageJSON, k as relative, l as findNearestFile, m as resolveGitConfig, p as readPackageJSON, u as findWorkspaceDir } from "../_libs/c12.mjs";
|
|
2
|
+
import { t as glob } from "../_libs/tinyglobby.mjs";
|
|
3
|
+
import { i as a } from "../_libs/std-env.mjs";
|
|
4
|
+
import { t as runParallel } from "../_nitro2.mjs";
|
|
5
|
+
import { t as gzipSize } from "../_libs/gzip-size.mjs";
|
|
6
|
+
import { t as prettyBytes } from "../_libs/pretty-bytes.mjs";
|
|
7
|
+
import { promises } from "node:fs";
|
|
5
8
|
import { colors } from "consola/utils";
|
|
6
9
|
|
|
7
|
-
//#region src/utils/fs.ts
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (typeof path !== "string") throw new TypeError("Invalid path: " + path);
|
|
14
|
-
path = _compilePathTemplate(path)(nitroOptions);
|
|
15
|
-
for (const base$1 in nitroOptions.alias) if (path.startsWith(base$1)) path = nitroOptions.alias[base$1] + path.slice(base$1.length);
|
|
16
|
-
if (/^[#\u0000]/.test(path)) return path;
|
|
17
|
-
return resolve(base || nitroOptions.rootDir, path);
|
|
18
|
-
}
|
|
19
|
-
function _compilePathTemplate(contents) {
|
|
20
|
-
return (params) => contents.replace(/{{ ?([\w.]+) ?}}/g, (_, match) => {
|
|
21
|
-
const val = getProperty(params, match);
|
|
22
|
-
if (!val) consola$1.warn(`cannot resolve template param '${match}' in ${contents.slice(0, 20)}`);
|
|
23
|
-
return val || `${match}`;
|
|
10
|
+
//#region src/utils/fs-tree.ts
|
|
11
|
+
async function generateFSTree(dir, options = {}) {
|
|
12
|
+
if (a) return;
|
|
13
|
+
const files = await glob("**/*.*", {
|
|
14
|
+
cwd: dir,
|
|
15
|
+
ignore: ["*.map"]
|
|
24
16
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
17
|
+
const items = [];
|
|
18
|
+
await runParallel(new Set(files), async (file) => {
|
|
19
|
+
const path = resolve(dir, file);
|
|
20
|
+
const src = await promises.readFile(path);
|
|
21
|
+
const size = src.byteLength;
|
|
22
|
+
const gzip = options.compressedSizes ? await gzipSize(src) : 0;
|
|
23
|
+
items.push({
|
|
24
|
+
file,
|
|
25
|
+
path,
|
|
26
|
+
size,
|
|
27
|
+
gzip
|
|
28
|
+
});
|
|
29
|
+
}, { concurrency: 10 });
|
|
30
|
+
items.sort((a$1, b) => a$1.path.localeCompare(b.path));
|
|
31
|
+
let totalSize = 0;
|
|
32
|
+
let totalGzip = 0;
|
|
33
|
+
let totalNodeModulesSize = 0;
|
|
34
|
+
let totalNodeModulesGzip = 0;
|
|
35
|
+
let treeText = "";
|
|
36
|
+
for (const [index, item] of items.entries()) {
|
|
37
|
+
let dir$1 = dirname(item.file);
|
|
38
|
+
if (dir$1 === ".") dir$1 = "";
|
|
39
|
+
const rpath = relative(process.cwd(), item.path);
|
|
40
|
+
const treeChar = index === items.length - 1 ? "└─" : "├─";
|
|
41
|
+
if (item.file.includes("node_modules")) {
|
|
42
|
+
totalNodeModulesSize += item.size;
|
|
43
|
+
totalNodeModulesGzip += item.gzip;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
treeText += colors.gray(` ${treeChar} ${rpath} (${prettyBytes(item.size)})`);
|
|
47
|
+
if (options.compressedSizes) treeText += colors.gray(` (${prettyBytes(item.gzip)} gzip)`);
|
|
48
|
+
treeText += "\n";
|
|
49
|
+
totalSize += item.size;
|
|
50
|
+
totalGzip += item.gzip;
|
|
36
51
|
}
|
|
52
|
+
treeText += `${colors.cyan("Σ Total size:")} ${prettyBytes(totalSize + totalNodeModulesSize)}`;
|
|
53
|
+
if (options.compressedSizes) treeText += ` (${prettyBytes(totalGzip + totalNodeModulesGzip)} gzip)`;
|
|
54
|
+
treeText += "\n";
|
|
55
|
+
return treeText;
|
|
37
56
|
}
|
|
38
57
|
|
|
39
58
|
//#endregion
|
|
40
|
-
export {
|
|
59
|
+
export { readPackageJSON, generateFSTree as t };
|
package/dist/_build/shared2.mjs
CHANGED
|
@@ -1,68 +1,40 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { mkdir,
|
|
5
|
-
import {
|
|
1
|
+
import { A as resolve, S as dirname, k as relative } from "../_libs/c12.mjs";
|
|
2
|
+
import { t as getProperty } from "../_libs/dot-prop.mjs";
|
|
3
|
+
import consola$1 from "consola";
|
|
4
|
+
import { mkdir, stat, writeFile } from "node:fs/promises";
|
|
5
|
+
import { colors } from "consola/utils";
|
|
6
6
|
|
|
7
|
-
//#region src/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/build/info.ts
|
|
20
|
-
const NITRO_WELLKNOWN_DIR = "node_modules/.nitro";
|
|
21
|
-
async function getBuildInfo(root) {
|
|
22
|
-
const outputDir = await findLastBuildDir(root);
|
|
23
|
-
if (!await stat(outputDir).then((s) => s.isDirectory()).catch(() => false)) return {};
|
|
24
|
-
return {
|
|
25
|
-
outputDir,
|
|
26
|
-
buildInfo: await readFile(resolve$1(outputDir, "nitro.json"), "utf8").then(JSON.parse).catch(() => void 0)
|
|
27
|
-
};
|
|
7
|
+
//#region src/utils/fs.ts
|
|
8
|
+
function prettyPath(p, highlight = true) {
|
|
9
|
+
p = relative(process.cwd(), p);
|
|
10
|
+
return highlight ? colors.cyan(p) : p;
|
|
11
|
+
}
|
|
12
|
+
function resolveNitroPath(path, nitroOptions, base) {
|
|
13
|
+
if (typeof path !== "string") throw new TypeError("Invalid path: " + path);
|
|
14
|
+
path = _compilePathTemplate(path)(nitroOptions);
|
|
15
|
+
for (const base$1 in nitroOptions.alias) if (path.startsWith(base$1)) path = nitroOptions.alias[base$1] + path.slice(base$1.length);
|
|
16
|
+
if (/^[#\u0000]/.test(path)) return path;
|
|
17
|
+
return resolve(base || nitroOptions.rootDir, path);
|
|
28
18
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
function _compilePathTemplate(contents) {
|
|
20
|
+
return (params) => contents.replace(/{{ ?([\w.]+) ?}}/g, (_, match) => {
|
|
21
|
+
const val = getProperty(params, match);
|
|
22
|
+
if (!val) consola$1.warn(`cannot resolve template param '${match}' in ${contents.slice(0, 20)}`);
|
|
23
|
+
return val || `${match}`;
|
|
24
|
+
});
|
|
32
25
|
}
|
|
33
|
-
async function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
preset: nitro.options.preset,
|
|
38
|
-
framework: nitro.options.framework,
|
|
39
|
-
versions: { nitro: version },
|
|
40
|
-
commands: {
|
|
41
|
-
preview: nitro.options.commands.preview,
|
|
42
|
-
deploy: nitro.options.commands.deploy
|
|
43
|
-
},
|
|
44
|
-
config: { ...Object.fromEntries(presetsWithConfig.map((key) => [key, nitro.options[key]])) }
|
|
45
|
-
};
|
|
46
|
-
await writeFile$1(buildInfoPath, JSON.stringify(buildInfo, null, 2), true);
|
|
47
|
-
const lastBuild = join$1(nitro.options.rootDir, NITRO_WELLKNOWN_DIR, "last-build.json");
|
|
48
|
-
await mkdir(dirname(lastBuild), { recursive: true });
|
|
49
|
-
await writeFile$1(lastBuild, JSON.stringify({ outputDir: relative$1(lastBuild, nitro.options.output.dir) }));
|
|
50
|
-
return buildInfo;
|
|
26
|
+
async function writeFile$1(file, contents, log = false) {
|
|
27
|
+
await mkdir(dirname(file), { recursive: true });
|
|
28
|
+
await writeFile(file, contents, typeof contents === "string" ? "utf8" : void 0);
|
|
29
|
+
if (log) consola$1.info("Generated", prettyPath(file));
|
|
51
30
|
}
|
|
52
|
-
async function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
versions: { nitro: version },
|
|
59
|
-
dev: {
|
|
60
|
-
pid: process.pid,
|
|
61
|
-
workerAddress: addr
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
await writeFile$1(buildInfoPath, JSON.stringify(buildInfo, null, 2));
|
|
31
|
+
async function isDirectory(path) {
|
|
32
|
+
try {
|
|
33
|
+
return (await stat(path)).isDirectory();
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
65
37
|
}
|
|
66
38
|
|
|
67
39
|
//#endregion
|
|
68
|
-
export {
|
|
40
|
+
export { writeFile$1 as i, prettyPath as n, resolveNitroPath as r, isDirectory as t };
|