@gigadrive/network-config 2.0.0 → 2.0.1

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
@@ -3408,8 +3408,8 @@
3408
3408
  wsComponents.secure = void 0;
3409
3409
  }
3410
3410
  if (wsComponents.resourceName) {
3411
- const [path5, query] = wsComponents.resourceName.split("?");
3412
- wsComponents.path = path5 && path5 !== "/" ? path5 : void 0;
3411
+ const [path6, query] = wsComponents.resourceName.split("?");
3412
+ wsComponents.path = path6 && path6 !== "/" ? path6 : void 0;
3413
3413
  wsComponents.query = query;
3414
3414
  wsComponents.resourceName = void 0;
3415
3415
  }
@@ -6725,12 +6725,12 @@
6725
6725
  throw new Error(`Unknown format "${name}"`);
6726
6726
  return f;
6727
6727
  };
6728
- function addFormats2(ajv, list, fs5, exportName) {
6728
+ function addFormats2(ajv, list, fs6, exportName) {
6729
6729
  var _a;
6730
6730
  var _b;
6731
6731
  (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
6732
6732
  for (const f of list)
6733
- ajv.addFormat(f, fs5[f]);
6733
+ ajv.addFormat(f, fs6[f]);
6734
6734
  }
6735
6735
  module.exports = exports = formatsPlugin;
6736
6736
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -7024,17 +7024,17 @@
7024
7024
  visit.BREAK = BREAK;
7025
7025
  visit.SKIP = SKIP;
7026
7026
  visit.REMOVE = REMOVE;
7027
- function visit_(key, node, visitor, path5) {
7028
- const ctrl = callVisitor(key, node, visitor, path5);
7027
+ function visit_(key, node, visitor, path6) {
7028
+ const ctrl = callVisitor(key, node, visitor, path6);
7029
7029
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
7030
- replaceNode(key, path5, ctrl);
7031
- return visit_(key, ctrl, visitor, path5);
7030
+ replaceNode(key, path6, ctrl);
7031
+ return visit_(key, ctrl, visitor, path6);
7032
7032
  }
7033
7033
  if (typeof ctrl !== "symbol") {
7034
7034
  if (identity.isCollection(node)) {
7035
- path5 = Object.freeze(path5.concat(node));
7035
+ path6 = Object.freeze(path6.concat(node));
7036
7036
  for (let i = 0; i < node.items.length; ++i) {
7037
- const ci = visit_(i, node.items[i], visitor, path5);
7037
+ const ci = visit_(i, node.items[i], visitor, path6);
7038
7038
  if (typeof ci === "number")
7039
7039
  i = ci - 1;
7040
7040
  else if (ci === BREAK)
@@ -7045,13 +7045,13 @@
7045
7045
  }
7046
7046
  }
7047
7047
  } else if (identity.isPair(node)) {
7048
- path5 = Object.freeze(path5.concat(node));
7049
- const ck = visit_("key", node.key, visitor, path5);
7048
+ path6 = Object.freeze(path6.concat(node));
7049
+ const ck = visit_("key", node.key, visitor, path6);
7050
7050
  if (ck === BREAK)
7051
7051
  return BREAK;
7052
7052
  else if (ck === REMOVE)
7053
7053
  node.key = null;
7054
- const cv = visit_("value", node.value, visitor, path5);
7054
+ const cv = visit_("value", node.value, visitor, path6);
7055
7055
  if (cv === BREAK)
7056
7056
  return BREAK;
7057
7057
  else if (cv === REMOVE)
@@ -7072,17 +7072,17 @@
7072
7072
  visitAsync.BREAK = BREAK;
7073
7073
  visitAsync.SKIP = SKIP;
7074
7074
  visitAsync.REMOVE = REMOVE;
7075
- async function visitAsync_(key, node, visitor, path5) {
7076
- const ctrl = await callVisitor(key, node, visitor, path5);
7075
+ async function visitAsync_(key, node, visitor, path6) {
7076
+ const ctrl = await callVisitor(key, node, visitor, path6);
7077
7077
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
7078
- replaceNode(key, path5, ctrl);
7079
- return visitAsync_(key, ctrl, visitor, path5);
7078
+ replaceNode(key, path6, ctrl);
7079
+ return visitAsync_(key, ctrl, visitor, path6);
7080
7080
  }
7081
7081
  if (typeof ctrl !== "symbol") {
7082
7082
  if (identity.isCollection(node)) {
7083
- path5 = Object.freeze(path5.concat(node));
7083
+ path6 = Object.freeze(path6.concat(node));
7084
7084
  for (let i = 0; i < node.items.length; ++i) {
7085
- const ci = await visitAsync_(i, node.items[i], visitor, path5);
7085
+ const ci = await visitAsync_(i, node.items[i], visitor, path6);
7086
7086
  if (typeof ci === "number")
7087
7087
  i = ci - 1;
7088
7088
  else if (ci === BREAK)
@@ -7093,13 +7093,13 @@
7093
7093
  }
7094
7094
  }
7095
7095
  } else if (identity.isPair(node)) {
7096
- path5 = Object.freeze(path5.concat(node));
7097
- const ck = await visitAsync_("key", node.key, visitor, path5);
7096
+ path6 = Object.freeze(path6.concat(node));
7097
+ const ck = await visitAsync_("key", node.key, visitor, path6);
7098
7098
  if (ck === BREAK)
7099
7099
  return BREAK;
7100
7100
  else if (ck === REMOVE)
7101
7101
  node.key = null;
7102
- const cv = await visitAsync_("value", node.value, visitor, path5);
7102
+ const cv = await visitAsync_("value", node.value, visitor, path6);
7103
7103
  if (cv === BREAK)
7104
7104
  return BREAK;
7105
7105
  else if (cv === REMOVE)
@@ -7126,23 +7126,23 @@
7126
7126
  }
7127
7127
  return visitor;
7128
7128
  }
7129
- function callVisitor(key, node, visitor, path5) {
7129
+ function callVisitor(key, node, visitor, path6) {
7130
7130
  if (typeof visitor === "function")
7131
- return visitor(key, node, path5);
7131
+ return visitor(key, node, path6);
7132
7132
  if (identity.isMap(node))
7133
- return visitor.Map?.(key, node, path5);
7133
+ return visitor.Map?.(key, node, path6);
7134
7134
  if (identity.isSeq(node))
7135
- return visitor.Seq?.(key, node, path5);
7135
+ return visitor.Seq?.(key, node, path6);
7136
7136
  if (identity.isPair(node))
7137
- return visitor.Pair?.(key, node, path5);
7137
+ return visitor.Pair?.(key, node, path6);
7138
7138
  if (identity.isScalar(node))
7139
- return visitor.Scalar?.(key, node, path5);
7139
+ return visitor.Scalar?.(key, node, path6);
7140
7140
  if (identity.isAlias(node))
7141
- return visitor.Alias?.(key, node, path5);
7141
+ return visitor.Alias?.(key, node, path6);
7142
7142
  return void 0;
7143
7143
  }
7144
- function replaceNode(key, path5, node) {
7145
- const parent = path5[path5.length - 1];
7144
+ function replaceNode(key, path6, node) {
7145
+ const parent = path6[path6.length - 1];
7146
7146
  if (identity.isCollection(parent)) {
7147
7147
  parent.items[key] = node;
7148
7148
  } else if (identity.isPair(parent)) {
@@ -7740,10 +7740,10 @@
7740
7740
  var createNode = require_createNode();
7741
7741
  var identity = require_identity();
7742
7742
  var Node = require_Node();
7743
- function collectionFromPath(schema, path5, value) {
7743
+ function collectionFromPath(schema, path6, value) {
7744
7744
  let v = value;
7745
- for (let i = path5.length - 1; i >= 0; --i) {
7746
- const k = path5[i];
7745
+ for (let i = path6.length - 1; i >= 0; --i) {
7746
+ const k = path6[i];
7747
7747
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
7748
7748
  const a = [];
7749
7749
  a[k] = v;
@@ -7762,7 +7762,7 @@
7762
7762
  sourceObjects: /* @__PURE__ */ new Map()
7763
7763
  });
7764
7764
  }
7765
- var isEmptyPath = (path5) => path5 == null || typeof path5 === "object" && !!path5[Symbol.iterator]().next().done;
7765
+ var isEmptyPath = (path6) => path6 == null || typeof path6 === "object" && !!path6[Symbol.iterator]().next().done;
7766
7766
  var Collection = class extends Node.NodeBase {
7767
7767
  constructor(type, schema) {
7768
7768
  super(type);
@@ -7792,11 +7792,11 @@
7792
7792
  * be a Pair instance or a `{ key, value }` object, which may not have a key
7793
7793
  * that already exists in the map.
7794
7794
  */
7795
- addIn(path5, value) {
7796
- if (isEmptyPath(path5))
7795
+ addIn(path6, value) {
7796
+ if (isEmptyPath(path6))
7797
7797
  this.add(value);
7798
7798
  else {
7799
- const [key, ...rest] = path5;
7799
+ const [key, ...rest] = path6;
7800
7800
  const node = this.get(key, true);
7801
7801
  if (identity.isCollection(node))
7802
7802
  node.addIn(rest, value);
@@ -7810,8 +7810,8 @@
7810
7810
  * Removes a value from the collection.
7811
7811
  * @returns `true` if the item was found and removed.
7812
7812
  */
7813
- deleteIn(path5) {
7814
- const [key, ...rest] = path5;
7813
+ deleteIn(path6) {
7814
+ const [key, ...rest] = path6;
7815
7815
  if (rest.length === 0)
7816
7816
  return this.delete(key);
7817
7817
  const node = this.get(key, true);
@@ -7825,8 +7825,8 @@
7825
7825
  * scalar values from their surrounding node; to disable set `keepScalar` to
7826
7826
  * `true` (collections are always returned intact).
7827
7827
  */
7828
- getIn(path5, keepScalar) {
7829
- const [key, ...rest] = path5;
7828
+ getIn(path6, keepScalar) {
7829
+ const [key, ...rest] = path6;
7830
7830
  const node = this.get(key, true);
7831
7831
  if (rest.length === 0)
7832
7832
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -7844,8 +7844,8 @@
7844
7844
  /**
7845
7845
  * Checks if the collection includes a value with the key `key`.
7846
7846
  */
7847
- hasIn(path5) {
7848
- const [key, ...rest] = path5;
7847
+ hasIn(path6) {
7848
+ const [key, ...rest] = path6;
7849
7849
  if (rest.length === 0)
7850
7850
  return this.has(key);
7851
7851
  const node = this.get(key, true);
@@ -7855,8 +7855,8 @@
7855
7855
  * Sets a value in this collection. For `!!set`, `value` needs to be a
7856
7856
  * boolean to add/remove the item from the set.
7857
7857
  */
7858
- setIn(path5, value) {
7859
- const [key, ...rest] = path5;
7858
+ setIn(path6, value) {
7859
+ const [key, ...rest] = path6;
7860
7860
  if (rest.length === 0) {
7861
7861
  this.set(key, value);
7862
7862
  } else {
@@ -10360,9 +10360,9 @@ ${cn.comment}` : item.comment;
10360
10360
  this.contents.add(value);
10361
10361
  }
10362
10362
  /** Adds a value to the document. */
10363
- addIn(path5, value) {
10363
+ addIn(path6, value) {
10364
10364
  if (assertCollection(this.contents))
10365
- this.contents.addIn(path5, value);
10365
+ this.contents.addIn(path6, value);
10366
10366
  }
10367
10367
  /**
10368
10368
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -10437,14 +10437,14 @@ ${cn.comment}` : item.comment;
10437
10437
  * Removes a value from the document.
10438
10438
  * @returns `true` if the item was found and removed.
10439
10439
  */
10440
- deleteIn(path5) {
10441
- if (Collection.isEmptyPath(path5)) {
10440
+ deleteIn(path6) {
10441
+ if (Collection.isEmptyPath(path6)) {
10442
10442
  if (this.contents == null)
10443
10443
  return false;
10444
10444
  this.contents = null;
10445
10445
  return true;
10446
10446
  }
10447
- return assertCollection(this.contents) ? this.contents.deleteIn(path5) : false;
10447
+ return assertCollection(this.contents) ? this.contents.deleteIn(path6) : false;
10448
10448
  }
10449
10449
  /**
10450
10450
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -10459,10 +10459,10 @@ ${cn.comment}` : item.comment;
10459
10459
  * scalar values from their surrounding node; to disable set `keepScalar` to
10460
10460
  * `true` (collections are always returned intact).
10461
10461
  */
10462
- getIn(path5, keepScalar) {
10463
- if (Collection.isEmptyPath(path5))
10462
+ getIn(path6, keepScalar) {
10463
+ if (Collection.isEmptyPath(path6))
10464
10464
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
10465
- return identity.isCollection(this.contents) ? this.contents.getIn(path5, keepScalar) : void 0;
10465
+ return identity.isCollection(this.contents) ? this.contents.getIn(path6, keepScalar) : void 0;
10466
10466
  }
10467
10467
  /**
10468
10468
  * Checks if the document includes a value with the key `key`.
@@ -10473,10 +10473,10 @@ ${cn.comment}` : item.comment;
10473
10473
  /**
10474
10474
  * Checks if the document includes a value at `path`.
10475
10475
  */
10476
- hasIn(path5) {
10477
- if (Collection.isEmptyPath(path5))
10476
+ hasIn(path6) {
10477
+ if (Collection.isEmptyPath(path6))
10478
10478
  return this.contents !== void 0;
10479
- return identity.isCollection(this.contents) ? this.contents.hasIn(path5) : false;
10479
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path6) : false;
10480
10480
  }
10481
10481
  /**
10482
10482
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -10493,13 +10493,13 @@ ${cn.comment}` : item.comment;
10493
10493
  * Sets a value in this document. For `!!set`, `value` needs to be a
10494
10494
  * boolean to add/remove the item from the set.
10495
10495
  */
10496
- setIn(path5, value) {
10497
- if (Collection.isEmptyPath(path5)) {
10496
+ setIn(path6, value) {
10497
+ if (Collection.isEmptyPath(path6)) {
10498
10498
  this.contents = value;
10499
10499
  } else if (this.contents == null) {
10500
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path5), value);
10500
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path6), value);
10501
10501
  } else if (assertCollection(this.contents)) {
10502
- this.contents.setIn(path5, value);
10502
+ this.contents.setIn(path6, value);
10503
10503
  }
10504
10504
  }
10505
10505
  /**
@@ -12454,9 +12454,9 @@ ${end.comment}` : end.comment;
12454
12454
  visit.BREAK = BREAK;
12455
12455
  visit.SKIP = SKIP;
12456
12456
  visit.REMOVE = REMOVE;
12457
- visit.itemAtPath = (cst, path5) => {
12457
+ visit.itemAtPath = (cst, path6) => {
12458
12458
  let item = cst;
12459
- for (const [field, index] of path5) {
12459
+ for (const [field, index] of path6) {
12460
12460
  const tok = item?.[field];
12461
12461
  if (tok && "items" in tok) {
12462
12462
  item = tok.items[index];
@@ -12465,23 +12465,23 @@ ${end.comment}` : end.comment;
12465
12465
  }
12466
12466
  return item;
12467
12467
  };
12468
- visit.parentCollection = (cst, path5) => {
12469
- const parent = visit.itemAtPath(cst, path5.slice(0, -1));
12470
- const field = path5[path5.length - 1][0];
12468
+ visit.parentCollection = (cst, path6) => {
12469
+ const parent = visit.itemAtPath(cst, path6.slice(0, -1));
12470
+ const field = path6[path6.length - 1][0];
12471
12471
  const coll = parent?.[field];
12472
12472
  if (coll && "items" in coll)
12473
12473
  return coll;
12474
12474
  throw new Error("Parent collection not found");
12475
12475
  };
12476
- function _visit(path5, item, visitor) {
12477
- let ctrl = visitor(item, path5);
12476
+ function _visit(path6, item, visitor) {
12477
+ let ctrl = visitor(item, path6);
12478
12478
  if (typeof ctrl === "symbol")
12479
12479
  return ctrl;
12480
12480
  for (const field of ["key", "value"]) {
12481
12481
  const token = item[field];
12482
12482
  if (token && "items" in token) {
12483
12483
  for (let i = 0; i < token.items.length; ++i) {
12484
- const ci = _visit(Object.freeze(path5.concat([[field, i]])), token.items[i], visitor);
12484
+ const ci = _visit(Object.freeze(path6.concat([[field, i]])), token.items[i], visitor);
12485
12485
  if (typeof ci === "number")
12486
12486
  i = ci - 1;
12487
12487
  else if (ci === BREAK)
@@ -12492,10 +12492,10 @@ ${end.comment}` : end.comment;
12492
12492
  }
12493
12493
  }
12494
12494
  if (typeof ctrl === "function" && field === "key")
12495
- ctrl = ctrl(item, path5);
12495
+ ctrl = ctrl(item, path6);
12496
12496
  }
12497
12497
  }
12498
- return typeof ctrl === "function" ? ctrl(item, path5) : ctrl;
12498
+ return typeof ctrl === "function" ? ctrl(item, path6) : ctrl;
12499
12499
  }
12500
12500
  exports.visit = visit;
12501
12501
  }
@@ -13780,14 +13780,14 @@ ${end.comment}` : end.comment;
13780
13780
  case "scalar":
13781
13781
  case "single-quoted-scalar":
13782
13782
  case "double-quoted-scalar": {
13783
- const fs5 = this.flowScalar(this.type);
13783
+ const fs6 = this.flowScalar(this.type);
13784
13784
  if (atNextItem || it.value) {
13785
- map.items.push({ start, key: fs5, sep: [] });
13785
+ map.items.push({ start, key: fs6, sep: [] });
13786
13786
  this.onKeyLine = true;
13787
13787
  } else if (it.sep) {
13788
- this.stack.push(fs5);
13788
+ this.stack.push(fs6);
13789
13789
  } else {
13790
- Object.assign(it, { key: fs5, sep: [] });
13790
+ Object.assign(it, { key: fs6, sep: [] });
13791
13791
  this.onKeyLine = true;
13792
13792
  }
13793
13793
  return;
@@ -13905,13 +13905,13 @@ ${end.comment}` : end.comment;
13905
13905
  case "scalar":
13906
13906
  case "single-quoted-scalar":
13907
13907
  case "double-quoted-scalar": {
13908
- const fs5 = this.flowScalar(this.type);
13908
+ const fs6 = this.flowScalar(this.type);
13909
13909
  if (!it || it.value)
13910
- fc.items.push({ start: [], key: fs5, sep: [] });
13910
+ fc.items.push({ start: [], key: fs6, sep: [] });
13911
13911
  else if (it.sep)
13912
- this.stack.push(fs5);
13912
+ this.stack.push(fs6);
13913
13913
  else
13914
- Object.assign(it, { key: fs5, sep: [] });
13914
+ Object.assign(it, { key: fs6, sep: [] });
13915
13915
  return;
13916
13916
  }
13917
13917
  case "flow-map-end":
@@ -14219,11 +14219,25 @@ ${end.comment}` : end.comment;
14219
14219
  }
14220
14220
  });
14221
14221
 
14222
- // src/index.ts
14222
+ // src/find-config.ts
14223
+ var import_fs = __toESM(__require("fs"));
14224
+ var import_path = __toESM(__require("path"));
14225
+ var ALLOWED_CONFIG_NAMES = ["gigadrive.yaml", "gigadrive.yml", "nebula.yaml", "nebula.yml", "nebula.json"];
14226
+ var findConfig = (projectFolder) => {
14227
+ for (const name of ALLOWED_CONFIG_NAMES) {
14228
+ const filePath = import_path.default.join(projectFolder, name);
14229
+ if (import_fs.default.existsSync(filePath)) {
14230
+ return filePath;
14231
+ }
14232
+ }
14233
+ return null;
14234
+ };
14235
+
14236
+ // src/parse-config.ts
14223
14237
  var import_ajv = __toESM(require_ajv());
14224
14238
  var import_ajv_formats = __toESM(require_dist());
14225
- var import_fs4 = __toESM(__require("fs"));
14226
- var import_path3 = __toESM(__require("path"));
14239
+ var import_fs5 = __toESM(__require("fs"));
14240
+ var import_path4 = __toESM(__require("path"));
14227
14241
 
14228
14242
  // ../../node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.js
14229
14243
  var import_brace_expansion = __toESM(require_brace_expansion(), 1);
@@ -14896,11 +14910,11 @@ ${end.comment}` : end.comment;
14896
14910
  return (f) => f.length === len && f !== "." && f !== "..";
14897
14911
  };
14898
14912
  var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
14899
- var path = {
14913
+ var path2 = {
14900
14914
  win32: { sep: "\\" },
14901
14915
  posix: { sep: "/" }
14902
14916
  };
14903
- var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
14917
+ var sep = defaultPlatform === "win32" ? path2.win32.sep : path2.posix.sep;
14904
14918
  minimatch.sep = sep;
14905
14919
  var GLOBSTAR = Symbol("globstar **");
14906
14920
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -15590,22 +15604,22 @@ ${end.comment}` : end.comment;
15590
15604
  };
15591
15605
 
15592
15606
  // src/build-output-v3/parse.ts
15593
- var import_fs2 = __toESM(__require("fs"));
15594
- var import_path2 = __toESM(__require("path"));
15607
+ var import_fs3 = __toESM(__require("fs"));
15608
+ var import_path3 = __toESM(__require("path"));
15595
15609
 
15596
15610
  // src/parse-raw-config.ts
15597
- var import_fs = __toESM(__require("fs"));
15598
- var import_path = __toESM(__require("path"));
15611
+ var import_fs2 = __toESM(__require("fs"));
15612
+ var import_path2 = __toESM(__require("path"));
15599
15613
  var import_yaml = __toESM(require_dist2());
15600
15614
  var parseRawConfig = async (filePath) => {
15601
- if (!import_fs.default.existsSync(filePath)) {
15615
+ if (!import_fs2.default.existsSync(filePath)) {
15602
15616
  throw new Error(`Config file not found at ${filePath}`);
15603
15617
  }
15604
- const fileContents = import_fs.default.readFileSync(filePath, "utf8");
15618
+ const fileContents = import_fs2.default.readFileSync(filePath, "utf8");
15605
15619
  if (fileContents.length === 0) {
15606
15620
  throw new Error(`Config file is empty at ${filePath}`);
15607
15621
  }
15608
- const fileExtension = import_path.default.extname(filePath).toLowerCase();
15622
+ const fileExtension = import_path2.default.extname(filePath).toLowerCase();
15609
15623
  let parsed;
15610
15624
  try {
15611
15625
  if (fileExtension === ".json") {
@@ -15633,7 +15647,7 @@ ${end.comment}` : end.comment;
15633
15647
  var configPath = ".vercel/output/config.json";
15634
15648
  var functionConfigsPattern = ".vercel/output/functions/*.func/.vc-config.json";
15635
15649
  var parseVercelBuildOutputV3 = async (parseResult, projectFolder) => {
15636
- const config = await readConfigFile(import_path2.default.join(projectFolder, configPath));
15650
+ const config = await readConfigFile(import_path3.default.join(projectFolder, configPath));
15637
15651
  if (!config || config.version < 3) {
15638
15652
  return parseResult;
15639
15653
  }
@@ -15656,12 +15670,12 @@ ${end.comment}` : end.comment;
15656
15670
  var loadFunctions = async (config, parseResult, projectFolder) => {
15657
15671
  const functionConfigs = await getFilesForPattern(functionConfigsPattern, projectFolder);
15658
15672
  for (const functionConfigPath of functionConfigs) {
15659
- const functionConfig = await readConfigFile(import_path2.default.join(projectFolder, functionConfigPath));
15673
+ const functionConfig = await readConfigFile(import_path3.default.join(projectFolder, functionConfigPath));
15660
15674
  if (!functionConfig) {
15661
15675
  parseResult.errors.push(`Failed to read function config at ${functionConfigPath}`);
15662
15676
  continue;
15663
15677
  }
15664
- const functionName = import_path2.default.basename(import_path2.default.dirname(functionConfigPath)).replace(/\.func$/, "");
15678
+ const functionName = import_path3.default.basename(import_path3.default.dirname(functionConfigPath)).replace(/\.func$/, "");
15665
15679
  const runtime = translateVercelRuntime(functionConfig.runtime);
15666
15680
  if (!runtime) {
15667
15681
  parseResult.errors.push(`Unsupported runtime for function ${functionName}: ${functionConfig.runtime}`);
@@ -15689,7 +15703,7 @@ ${end.comment}` : end.comment;
15689
15703
  const streaming = runtime == null || runtime.startsWith("node-") || runtime.startsWith("bun-");
15690
15704
  const filePathMap = {};
15691
15705
  for (const [key, value] of Object.entries(functionConfig.filePathMap ?? {})) {
15692
- filePathMap[import_path2.default.join(projectFolder, key)] = value;
15706
+ filePathMap[import_path3.default.join(projectFolder, key)] = value;
15693
15707
  }
15694
15708
  parseResult.entrypoints.push({
15695
15709
  displayName: functionName,
@@ -15700,7 +15714,7 @@ ${end.comment}` : end.comment;
15700
15714
  environmentVariables,
15701
15715
  streaming,
15702
15716
  package: {
15703
- rootOverwrite: import_path2.default.join(projectFolder, functionDirectory),
15717
+ rootOverwrite: import_path3.default.join(projectFolder, functionDirectory),
15704
15718
  filePathMap
15705
15719
  }
15706
15720
  });
@@ -15726,7 +15740,7 @@ ${end.comment}` : end.comment;
15726
15740
  }
15727
15741
  };
15728
15742
  var readConfigFile = async (configFilePath) => {
15729
- if (!import_fs2.default.existsSync(configFilePath)) {
15743
+ if (!import_fs3.default.existsSync(configFilePath)) {
15730
15744
  return null;
15731
15745
  }
15732
15746
  const parsed = await parseRawConfig(configFilePath);
@@ -15771,7 +15785,7 @@ ${end.comment}` : end.comment;
15771
15785
  };
15772
15786
 
15773
15787
  // src/v4/parse.ts
15774
- var import_fs3 = __toESM(__require("fs"));
15788
+ var import_fs4 = __toESM(__require("fs"));
15775
15789
 
15776
15790
  // src/regions.ts
15777
15791
  var REGION_DEFINITIONS = [
@@ -15805,16 +15819,16 @@ ${end.comment}` : end.comment;
15805
15819
  const errors = [];
15806
15820
  const warnings = [];
15807
15821
  if (config.functions != null) {
15808
- for (const [path5, func] of Object.entries(config.functions)) {
15809
- const settings = getFunctionSettings(path5, config);
15822
+ for (const [path6, func] of Object.entries(config.functions)) {
15823
+ const settings = getFunctionSettings(path6, config);
15810
15824
  if (settings == null) {
15811
- throw new Error(`Settings invalid for function at path '${path5}'`);
15825
+ throw new Error(`Settings invalid for function at path '${path6}'`);
15812
15826
  }
15813
- (await getFilesForPattern(path5, projectFolder, func.excludeFiles)).forEach((file) => {
15827
+ (await getFilesForPattern(path6, projectFolder, func.excludeFiles)).forEach((file) => {
15814
15828
  if (entrypoints.find((entrypoint) => entrypoint.path === file)) {
15815
15829
  return;
15816
15830
  }
15817
- if (config.functions != null && Object.keys(config.functions).find((func2) => func2 === file && func2 !== path5)) {
15831
+ if (config.functions != null && Object.keys(config.functions).find((func2) => func2 === file && func2 !== path6)) {
15818
15832
  return;
15819
15833
  }
15820
15834
  entrypoints.push({
@@ -15832,11 +15846,11 @@ ${end.comment}` : end.comment;
15832
15846
  const assets = [];
15833
15847
  if (config.assets != null) {
15834
15848
  const assetsPath = `${projectFolder}/${config.assets}`;
15835
- if (import_fs3.default.existsSync(assetsPath) && import_fs3.default.statSync(assetsPath).isDirectory()) {
15836
- for (const asset of import_fs3.default.readdirSync(`${projectFolder}/${config.assets}`, {
15849
+ if (import_fs4.default.existsSync(assetsPath) && import_fs4.default.statSync(assetsPath).isDirectory()) {
15850
+ for (const asset of import_fs4.default.readdirSync(`${projectFolder}/${config.assets}`, {
15837
15851
  recursive: true
15838
15852
  })) {
15839
- if (import_fs3.default.statSync(`${projectFolder}/${config.assets}/${asset}`).isDirectory()) {
15853
+ if (import_fs4.default.statSync(`${projectFolder}/${config.assets}/${asset}`).isDirectory()) {
15840
15854
  continue;
15841
15855
  }
15842
15856
  const disallowedExtensions = [".htaccess", ".htpasswd"];
@@ -15877,10 +15891,10 @@ ${end.comment}` : end.comment;
15877
15891
  })
15878
15892
  };
15879
15893
  };
15880
- var getFunctionSettings = (path5, config) => {
15894
+ var getFunctionSettings = (path6, config) => {
15881
15895
  let functionSettings;
15882
15896
  for (const [key, value] of Object.entries(config.functions ?? {})) {
15883
- if (minimatch(path5, key) || new RegExp(key).test(path5)) {
15897
+ if (minimatch(path6, key) || new RegExp(key).test(path6)) {
15884
15898
  if (functionSettings == null) {
15885
15899
  functionSettings = {
15886
15900
  memory: 128,
@@ -15917,18 +15931,8 @@ ${end.comment}` : end.comment;
15917
15931
  return functionSettings;
15918
15932
  };
15919
15933
 
15920
- // src/index.ts
15921
- var schemaV4 = JSON.parse(import_fs4.default.readFileSync(import_path3.default.join(__dirname, "./v4/schema.json"), "utf8"));
15922
- var ALLOWED_CONFIG_NAMES = ["gigadrive.yaml", "gigadrive.yml", "nebula.yaml", "nebula.yml", "nebula.json"];
15923
- var findConfig = (projectFolder) => {
15924
- for (const name of ALLOWED_CONFIG_NAMES) {
15925
- const filePath = import_path3.default.join(projectFolder, name);
15926
- if (import_fs4.default.existsSync(filePath)) {
15927
- return filePath;
15928
- }
15929
- }
15930
- return null;
15931
- };
15934
+ // src/parse-config.ts
15935
+ var schemaV4 = JSON.parse(import_fs5.default.readFileSync(import_path4.default.join(__dirname, "./v4/schema.json"), "utf8"));
15932
15936
  var parseConfig = async (filePath, projectFolder) => {
15933
15937
  const parsed = await parseRawConfig(filePath);
15934
15938
  const version = parsed.version;
@@ -15967,5 +15971,18 @@ ${end.comment}` : end.comment;
15967
15971
  }
15968
15972
  return parseResult;
15969
15973
  };
15974
+
15975
+ // src/runtime.ts
15976
+ var RUNTIME_DEFINITIONS = [
15977
+ "php-84",
15978
+ "php-83",
15979
+ "php-81",
15980
+ "node-22",
15981
+ "node-20",
15982
+ "node-18",
15983
+ "node-16",
15984
+ "bun-1"
15985
+ ];
15986
+ var AVAILABLE_RUNTIMES = [...RUNTIME_DEFINITIONS];
15970
15987
  })();
15971
15988
  //# sourceMappingURL=index.js.map