nitro-nightly 3.0.260522-beta → 3.0.260603-beta

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.
Binary file
@@ -6510,6 +6510,7 @@ var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6510
6510
  var import_picomatch = /* @__PURE__ */ __toESM$1(require_picomatch(), 1);
6511
6511
  const isReadonlyArray = Array.isArray;
6512
6512
  const BACKSLASHES = /\\/g;
6513
+ const DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/;
6513
6514
  const isWin = process.platform === "win32";
6514
6515
  const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
6515
6516
  function getPartialMatcher(patterns, options = {}) {
@@ -6575,6 +6576,9 @@ function buildRelative(cwd, root) {
6575
6576
  return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
6576
6577
  };
6577
6578
  }
6579
+ function ensureNonDriveRelativePath(path) {
6580
+ return path.replace(DRIVE_RELATIVE_PATH, (match) => `${match}/`);
6581
+ }
6578
6582
  const splitPatternOptions = { parts: true };
6579
6583
  function splitPattern(path) {
6580
6584
  var _result$parts;
@@ -6619,7 +6623,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
6619
6623
  }
6620
6624
  const potentialRoot = posix.join(cwd, parentDir.slice(i * 3));
6621
6625
  if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
6622
- props.root = potentialRoot;
6626
+ props.root = ensureNonDriveRelativePath(potentialRoot);
6623
6627
  props.depthOffset = -n + i;
6624
6628
  }
6625
6629
  }
@@ -6639,7 +6643,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
6639
6643
  }
6640
6644
  props.depthOffset = newCommonPath.length;
6641
6645
  props.commonPath = newCommonPath;
6642
- props.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;
6646
+ props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd);
6643
6647
  }
6644
6648
  return result;
6645
6649
  }
@@ -6728,18 +6732,15 @@ function formatPaths(paths, mapper) {
6728
6732
  }
6729
6733
  const defaultOptions$1 = {
6730
6734
  caseSensitiveMatch: true,
6731
- cwd: process.cwd(),
6732
6735
  debug: !!process.env.TINYGLOBBY_DEBUG,
6733
6736
  expandDirectories: true,
6734
6737
  followSymbolicLinks: true,
6735
6738
  onlyFiles: true
6736
6739
  };
6737
6740
  function getOptions$1(options) {
6738
- const opts = {
6739
- ...defaultOptions$1,
6740
- ...options
6741
- };
6742
- opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve$1(opts.cwd)).replace(BACKSLASHES, "/");
6741
+ const opts = Object.assign({}, options);
6742
+ for (const key in defaultOptions$1) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions$1[key] });
6743
+ opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve$1(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
6743
6744
  opts.ignore = ensureStringArray(opts.ignore);
6744
6745
  opts.fs && (opts.fs = {
6745
6746
  readdir: opts.fs.readdir || readdir$1,
@@ -17499,7 +17500,7 @@ function getBtoa() {
17499
17500
  throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
17500
17501
  };
17501
17502
  }
17502
- const btoa = /* @__PURE__ */ getBtoa();
17503
+ const btoa = /*#__PURE__*/ getBtoa();
17503
17504
  var SourceMap = class {
17504
17505
  constructor(properties) {
17505
17506
  this.version = 3;
@@ -20913,7 +20914,7 @@ async function writeTypes(nitro) {
20913
20914
  for (const alias in tsConfig.compilerOptions.paths) {
20914
20915
  const paths = await Promise.all(tsConfig.compilerOptions.paths[alias].map(async (path) => {
20915
20916
  if (!isAbsolute$2(path)) return path;
20916
- return relativeWithDot(tsconfigDir, (await promises.stat(path).catch(() => null))?.isFile() ? path.replace(/(?<=\w)\.\w+$/g, "") : path);
20917
+ return relativeWithDot(tsconfigDir, (await promises.stat(path).catch(() => null))?.isFile() ? stripPathsExt(path) : path);
20917
20918
  }));
20918
20919
  tsConfig.compilerOptions.paths[alias] = [...new Set(paths)];
20919
20920
  }
@@ -20935,6 +20936,10 @@ function relativeWithDot(from, to) {
20935
20936
  const rel = relative$2(from, to);
20936
20937
  return RELATIVE_RE.test(rel) ? rel : "./" + rel;
20937
20938
  }
20939
+ const PATHS_STRIPPABLE_EXT_RE = /\.(?:tsx?|jsx?|[cm]js)$/;
20940
+ function stripPathsExt(path) {
20941
+ return path.replace(PATHS_STRIPPABLE_EXT_RE, "");
20942
+ }
20938
20943
  const presetsWithConfig = [
20939
20944
  "awsAmplify",
20940
20945
  "awsLambda",
@@ -22035,6 +22040,7 @@ function isWellFormedString(input) {
22035
22040
  if (hasStringIsWellFormed) return input.isWellFormed();
22036
22041
  return !/\p{Surrogate}/u.test(input);
22037
22042
  }
22043
+ const identifierNameRE = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
22038
22044
  const dataToEsm = function dataToEsm(data, options = {}) {
22039
22045
  var _a, _b;
22040
22046
  const t = options.compact ? "" : "indent" in options ? options.indent : " ";
@@ -22060,10 +22066,13 @@ const dataToEsm = function dataToEsm(data, options = {}) {
22060
22066
  namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, "")};${n}`;
22061
22067
  } else {
22062
22068
  defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, "")}`);
22063
- if (options.includeArbitraryNames && isWellFormedString(key)) {
22064
- const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
22065
- namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, "")};${n}`;
22066
- arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`);
22069
+ if (key !== "default") {
22070
+ const isIdentifierName = identifierNameRE.test(key);
22071
+ if (isIdentifierName || options.includeArbitraryNames && isWellFormedString(key)) {
22072
+ const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
22073
+ namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, "")};${n}`;
22074
+ arbitraryNameExportRows.push(`${variableName} as ${isIdentifierName ? key : JSON.stringify(key)}`);
22075
+ }
22067
22076
  }
22068
22077
  }
22069
22078
  const arbitraryExportCode = arbitraryNameExportRows.length > 0 ? `export${_}{${n}${t}${arbitraryNameExportRows.join(`,${n}${t}`)}${n}};${n}` : "";
@@ -150,8 +150,12 @@ async function buildProduction(nitro, config) {
150
150
  const rewriteRelativePaths = (input) => {
151
151
  return input.replace(/([\s:])\.\/(\S*)/g, `$1${rOutput}/$2`);
152
152
  };
153
- nitro.logger.success("You can preview this build using `npx nitro preview`");
154
- if (buildInfo.commands.deploy) nitro.logger.success(rewriteRelativePaths("You can deploy this build using `npx nitro deploy --prebuilt`"));
153
+ const previewCommand = nitro.options.framework.previewCommand || "npx nitro preview";
154
+ nitro.logger.success(`You can preview this build using \`${previewCommand}\``);
155
+ if (buildInfo.commands.deploy) {
156
+ const deployCommand = nitro.options.framework.deployCommand || "npx nitro deploy --prebuilt";
157
+ nitro.logger.success(rewriteRelativePaths(`You can deploy this build using \`${deployCommand}\``));
158
+ }
155
159
  }
156
160
  async function rolldownBuild(nitro) {
157
161
  await nitro.hooks.callHook("build:before", nitro);
@@ -530,6 +530,7 @@ async function _loadUserConfig(configOverrides = {}, opts = {}) {
530
530
  let compatibilityDate = configOverrides.compatibilityDate || opts.compatibilityDate || process.env.NITRO_COMPATIBILITY_DATE || process.env.SERVER_COMPATIBILITY_DATE || process.env.COMPATIBILITY_DATE;
531
531
  const { resolvePreset } = await import("../_presets.mjs");
532
532
  let preset = configOverrides.preset || process.env.NITRO_PRESET || process.env.SERVER_PRESET;
533
+ let inlineDefaultPreset;
533
534
  const _dotenv = opts.dotenv ?? (configOverrides.dev && { fileName: [".env", ".env.local"] });
534
535
  const envName = opts.c12?.envName ?? (configOverrides.dev ? "development" : "production");
535
536
  const loadedConfig = await (opts.watch ? watchConfig : loadConfig)({
@@ -550,11 +551,17 @@ async function _loadUserConfig(configOverrides = {}, opts = {}) {
550
551
  dev: true,
551
552
  compatibilityDate: compatibilityDate || "latest"
552
553
  }).then((p) => p?._meta?.name || "nitro-dev").catch(() => "nitro-dev") : "nitro-dev";
553
- else if (!preset) preset = await resolvePreset("", {
554
- static: getConf("static"),
555
- dev: false,
556
- compatibilityDate: compatibilityDate || "latest"
557
- }).then((p) => p?._meta?.name);
554
+ else if (!preset) {
555
+ const defaultPreset = getConf("defaultPreset");
556
+ const resolved = await resolvePreset("", {
557
+ static: getConf("static"),
558
+ dev: false,
559
+ compatibilityDate: compatibilityDate || "latest",
560
+ defaultPreset
561
+ });
562
+ preset = resolved?._meta?.name;
563
+ if (resolved && defaultPreset && typeof defaultPreset !== "string") inlineDefaultPreset = resolved;
564
+ }
558
565
  return {
559
566
  ...configOverrides,
560
567
  preset,
@@ -566,6 +573,7 @@ async function _loadUserConfig(configOverrides = {}, opts = {}) {
566
573
  };
567
574
  },
568
575
  async resolve(id) {
576
+ if (inlineDefaultPreset && id === inlineDefaultPreset._meta?.name) return { config: klona(inlineDefaultPreset) };
569
577
  const preset = await resolvePreset(id, {
570
578
  static: configOverrides.static,
571
579
  compatibilityDate: compatibilityDate || "latest",
@@ -37,7 +37,7 @@ function isReference(node, parent) {
37
37
  }
38
38
  return false;
39
39
  }
40
- var version = "29.0.1";
40
+ var version = "29.0.2";
41
41
  var peerDependencies = { rollup: "^2.68.0||^3.0.0||^4.0.0" };
42
42
  function tryParse(parse, code, id) {
43
43
  try {
@@ -307,7 +307,7 @@ export function getAugmentedNamespace(n) {
307
307
  var isInstance = false;
308
308
  try {
309
309
  isInstance = this instanceof a;
310
- } catch {}
310
+ } catch (e) {}
311
311
  if (isInstance) {
312
312
  return Reflect.construct(f, arguments, this.constructor);
313
313
  }
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from "node:events";
2
2
  import * as stream from "node:stream";
3
+ import { Duplex } from "node:stream";
3
4
  import http, { IncomingMessage } from "node:http";
4
5
  import http2 from "node:http2";
5
6
  import { Socket } from "node:net";