@nasti-toolchain/nasti 1.5.1 → 1.5.2

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.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.5.1"}`));
796
+ console.log(pc.cyan("\n\u{1F528} nasti build") + pc.dim(` v${"1.5.2"}`));
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
- cjsPath = __require.resolve("react-refresh/cjs/react-refresh-runtime.development.js");
1113
- } catch {
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
@@ -1789,7 +1797,7 @@ async function createServer(inlineConfig = {}) {
1789
1797
  const localUrl = `http://localhost:${actualPort}`;
1790
1798
  const networkUrl = host === "0.0.0.0" ? `http://${getNetworkAddress()}:${actualPort}` : null;
1791
1799
  console.log();
1792
- console.log(pc3.cyan(" nasti dev server") + pc3.dim(` v${"1.5.1"}`));
1800
+ console.log(pc3.cyan(" nasti dev server") + pc3.dim(` v${"1.5.2"}`));
1793
1801
  console.log();
1794
1802
  console.log(` ${pc3.green(">")} Local: ${pc3.cyan(localUrl)}`);
1795
1803
  if (networkUrl) {
@@ -1913,7 +1921,7 @@ async function buildElectron(inlineConfig = {}) {
1913
1921
  const config = await resolveConfig({ ...inlineConfig, target: "electron" }, "build");
1914
1922
  const startTime = performance.now();
1915
1923
  assertElectronVersion(config);
1916
- console.log(pc2.cyan("\n\u26A1 nasti build (electron)") + pc2.dim(` v${"1.5.1"}`));
1924
+ console.log(pc2.cyan("\n\u26A1 nasti build (electron)") + pc2.dim(` v${"1.5.2"}`));
1917
1925
  console.log(pc2.dim(` root: ${config.root}`));
1918
1926
  console.log(pc2.dim(` mode: ${config.mode}`));
1919
1927
  console.log(pc2.dim(` target: electron (\u2265 ${config.electron.minVersion})`));
@@ -2060,7 +2068,7 @@ async function startElectronDev(inlineConfig = {}) {
2060
2068
  const { noSpawn, ...rest } = inlineConfig;
2061
2069
  const config = await resolveConfig({ ...rest, target: "electron" }, "serve");
2062
2070
  warnElectronVersion(config);
2063
- console.log(pc4.cyan("\n\u26A1 nasti electron dev") + pc4.dim(` v${"1.5.1"}`));
2071
+ console.log(pc4.cyan("\n\u26A1 nasti electron dev") + pc4.dim(` v${"1.5.2"}`));
2064
2072
  const { createServer: createServer2 } = await Promise.resolve().then(() => (init_server(), server_exports));
2065
2073
  const server = await createServer2({ ...rest, target: "electron" });
2066
2074
  await server.listen();