@nasti-toolchain/nasti 1.5.1 → 1.6.0
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/cli.cjs +31 -14
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +31 -14
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +31 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +31 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -793,7 +793,7 @@ import pc from "picocolors";
|
|
|
793
793
|
async function build(inlineConfig = {}) {
|
|
794
794
|
const config = await resolveConfig(inlineConfig, "build");
|
|
795
795
|
const startTime = performance.now();
|
|
796
|
-
console.log(pc.cyan("\n\u{1F528} nasti build") + pc.dim(` v${"1.
|
|
796
|
+
console.log(pc.cyan("\n\u{1F528} nasti build") + pc.dim(` v${"1.6.0"}`));
|
|
797
797
|
console.log(pc.dim(` root: ${config.root}`));
|
|
798
798
|
console.log(pc.dim(` mode: ${config.mode}`));
|
|
799
799
|
const outDir = path7.resolve(config.root, config.build.outDir);
|
|
@@ -1109,9 +1109,17 @@ function getReactRefreshRuntimeEsm() {
|
|
|
1109
1109
|
if (__refreshRuntimeCache) return __refreshRuntimeCache;
|
|
1110
1110
|
let cjsPath;
|
|
1111
1111
|
try {
|
|
1112
|
-
|
|
1113
|
-
|
|
1112
|
+
const pkgPath = __require.resolve("react-refresh/package.json");
|
|
1113
|
+
cjsPath = path9.join(path9.dirname(pkgPath), "cjs", "react-refresh-runtime.development.js");
|
|
1114
|
+
} catch (err) {
|
|
1114
1115
|
cjsPath = path9.resolve(__dirname_esm, "../../node_modules/react-refresh/cjs/react-refresh-runtime.development.js");
|
|
1116
|
+
if (!fs8.existsSync(cjsPath)) {
|
|
1117
|
+
const origMsg = err instanceof Error ? err.message : String(err);
|
|
1118
|
+
throw new Error(
|
|
1119
|
+
`[nasti] Missing dependency "react-refresh". Install it with: npm install react-refresh
|
|
1120
|
+
Original resolve error: ${origMsg}`
|
|
1121
|
+
);
|
|
1122
|
+
}
|
|
1115
1123
|
}
|
|
1116
1124
|
const cjsSource = fs8.readFileSync(cjsPath, "utf-8");
|
|
1117
1125
|
__refreshRuntimeCache = `// Wrapped react-refresh runtime -> ESM
|
|
@@ -1756,12 +1764,19 @@ async function createServer(inlineConfig = {}) {
|
|
|
1756
1764
|
app.use(sirv(config.root, { dev: true, etag: true }));
|
|
1757
1765
|
const httpServer = http.createServer(app);
|
|
1758
1766
|
const ws = createWebSocketServer(httpServer);
|
|
1767
|
+
const ignoredSegments = /* @__PURE__ */ new Set(["node_modules", ".git", ".nasti"]);
|
|
1768
|
+
const outDirAbs = path11.resolve(config.root, config.build.outDir);
|
|
1759
1769
|
const watcher = watch(config.root, {
|
|
1760
|
-
ignored:
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1770
|
+
ignored: (filePath) => {
|
|
1771
|
+
if (filePath === config.root) return false;
|
|
1772
|
+
if (filePath === outDirAbs || filePath.startsWith(outDirAbs + path11.sep)) return true;
|
|
1773
|
+
const rel = path11.relative(config.root, filePath);
|
|
1774
|
+
if (!rel || rel.startsWith("..") || path11.isAbsolute(rel)) return false;
|
|
1775
|
+
for (const seg of rel.split(path11.sep)) {
|
|
1776
|
+
if (ignoredSegments.has(seg)) return true;
|
|
1777
|
+
}
|
|
1778
|
+
return false;
|
|
1779
|
+
},
|
|
1765
1780
|
ignoreInitial: true
|
|
1766
1781
|
});
|
|
1767
1782
|
let server;
|
|
@@ -1789,7 +1804,7 @@ async function createServer(inlineConfig = {}) {
|
|
|
1789
1804
|
const localUrl = `http://localhost:${actualPort}`;
|
|
1790
1805
|
const networkUrl = host === "0.0.0.0" ? `http://${getNetworkAddress()}:${actualPort}` : null;
|
|
1791
1806
|
console.log();
|
|
1792
|
-
console.log(pc3.cyan(" nasti dev server") + pc3.dim(` v${"1.
|
|
1807
|
+
console.log(pc3.cyan(" nasti dev server") + pc3.dim(` v${"1.6.0"}`));
|
|
1793
1808
|
console.log();
|
|
1794
1809
|
console.log(` ${pc3.green(">")} Local: ${pc3.cyan(localUrl)}`);
|
|
1795
1810
|
if (networkUrl) {
|
|
@@ -1913,7 +1928,7 @@ async function buildElectron(inlineConfig = {}) {
|
|
|
1913
1928
|
const config = await resolveConfig({ ...inlineConfig, target: "electron" }, "build");
|
|
1914
1929
|
const startTime = performance.now();
|
|
1915
1930
|
assertElectronVersion(config);
|
|
1916
|
-
console.log(pc2.cyan("\n\u26A1 nasti build (electron)") + pc2.dim(` v${"1.
|
|
1931
|
+
console.log(pc2.cyan("\n\u26A1 nasti build (electron)") + pc2.dim(` v${"1.6.0"}`));
|
|
1917
1932
|
console.log(pc2.dim(` root: ${config.root}`));
|
|
1918
1933
|
console.log(pc2.dim(` mode: ${config.mode}`));
|
|
1919
1934
|
console.log(pc2.dim(` target: electron (\u2265 ${config.electron.minVersion})`));
|
|
@@ -2004,7 +2019,7 @@ async function bundleNode(config, entry, opts) {
|
|
|
2004
2019
|
format: opts.format === "cjs" ? "cjs" : "esm",
|
|
2005
2020
|
sourcemap: !!config.build.sourcemap,
|
|
2006
2021
|
minify: !!config.build.minify,
|
|
2007
|
-
|
|
2022
|
+
codeSplitting: false
|
|
2008
2023
|
});
|
|
2009
2024
|
await bundle.close();
|
|
2010
2025
|
console.log(pc2.dim(` \u2713 ${opts.label} \u2192 ${path8.relative(config.root, opts.outFile)}`));
|
|
@@ -2060,7 +2075,7 @@ async function startElectronDev(inlineConfig = {}) {
|
|
|
2060
2075
|
const { noSpawn, ...rest } = inlineConfig;
|
|
2061
2076
|
const config = await resolveConfig({ ...rest, target: "electron" }, "serve");
|
|
2062
2077
|
warnElectronVersion(config);
|
|
2063
|
-
console.log(pc4.cyan("\n\u26A1 nasti electron dev") + pc4.dim(` v${"1.
|
|
2078
|
+
console.log(pc4.cyan("\n\u26A1 nasti electron dev") + pc4.dim(` v${"1.6.0"}`));
|
|
2064
2079
|
const { createServer: createServer2 } = await Promise.resolve().then(() => (init_server(), server_exports));
|
|
2065
2080
|
const server = await createServer2({ ...rest, target: "electron" });
|
|
2066
2081
|
await server.listen();
|
|
@@ -2203,7 +2218,9 @@ async function compileNode(config, entry, opts) {
|
|
|
2203
2218
|
format: opts.format === "cjs" ? "cjs" : "esm",
|
|
2204
2219
|
sourcemap: false,
|
|
2205
2220
|
minify: false,
|
|
2206
|
-
inlineDynamicImports:
|
|
2221
|
+
// rolldown 已弃用 inlineDynamicImports,改用 codeSplitting:false 表达
|
|
2222
|
+
// 同样语义(单 chunk、内联 dynamic import)
|
|
2223
|
+
codeSplitting: false
|
|
2207
2224
|
});
|
|
2208
2225
|
await bundle.close();
|
|
2209
2226
|
}
|
|
@@ -2309,7 +2326,7 @@ function monacoEditorPlugin(options = {}) {
|
|
|
2309
2326
|
format: "iife",
|
|
2310
2327
|
sourcemap: false,
|
|
2311
2328
|
minify: true,
|
|
2312
|
-
|
|
2329
|
+
codeSplitting: false
|
|
2313
2330
|
});
|
|
2314
2331
|
await bundle.close();
|
|
2315
2332
|
return cacheFile;
|