@gigadrive/network-config 4.6.1 → 5.0.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/index.js CHANGED
@@ -68,6 +68,7 @@ __export(src_exports, {
68
68
  StaticAssetManifestV1Schema: () => StaticAssetManifestV1Schema,
69
69
  V4ConfigParser: () => V4ConfigParser,
70
70
  VercelBuildOutputParser: () => VercelBuildOutputParser,
71
+ collectAssetFiles: () => collectAssetFiles,
71
72
  defineConfig: () => defineConfig,
72
73
  detectFramework: () => detectFramework,
73
74
  detectPackageManager: () => detectPackageManager,
@@ -142,16 +143,54 @@ var StaticAssetManifestV1Schema = import_effect2.Schema.mutable(
142
143
  ).pipe(import_effect2.Schema.filter(({ assets }) => new Set(assets.map(({ path: path2 }) => path2)).size === assets.length));
143
144
  var parseStaticAssetManifest = (content) => decodeJson(StaticAssetManifestV1Schema, content);
144
145
 
146
+ // src/collect-asset-files.ts
147
+ var import_platform = require("@effect/platform");
148
+ var import_effect3 = require("effect");
149
+ var MAX_ASSET_DEPTH = 100;
150
+ var DISALLOWED_ASSET_EXTENSIONS = [".htaccess", ".htpasswd"];
151
+ var collectFilesRecursively = import_effect3.Effect.fn("collectFilesRecursively")(
152
+ function* (basePath, relativePath = "", depth = 0) {
153
+ if (depth > MAX_ASSET_DEPTH) return [];
154
+ const fs = yield* import_platform.FileSystem.FileSystem;
155
+ const pathSvc = yield* import_platform.Path.Path;
156
+ const currentPath = relativePath ? pathSvc.join(basePath, relativePath) : basePath;
157
+ const entries = yield* fs.readDirectory(currentPath).pipe(import_effect3.Effect.catchAll(() => import_effect3.Effect.succeed([])));
158
+ const result = [];
159
+ for (const name of entries) {
160
+ const fullPath = pathSvc.join(currentPath, name);
161
+ const entryRelative = relativePath ? pathSvc.join(relativePath, name) : name;
162
+ const stat = yield* fs.stat(fullPath).pipe(import_effect3.Effect.catchAll(() => import_effect3.Effect.succeed(null)));
163
+ if (!stat) continue;
164
+ if (stat.type === "Directory") {
165
+ const nested = yield* collectFilesRecursively(basePath, entryRelative, depth + 1);
166
+ result.push(...nested);
167
+ } else {
168
+ result.push(entryRelative);
169
+ }
170
+ }
171
+ return result;
172
+ }
173
+ );
174
+ var collectAssetFiles = import_effect3.Effect.fn("collectAssetFiles")(function* (projectFolder, assetsDir) {
175
+ const fs = yield* import_platform.FileSystem.FileSystem;
176
+ const pathService = yield* import_platform.Path.Path;
177
+ const assetsPath = pathService.join(projectFolder, assetsDir);
178
+ const stat = yield* fs.stat(assetsPath).pipe(import_effect3.Effect.catchAll(() => import_effect3.Effect.succeed(null)));
179
+ if (!stat || stat.type !== "Directory") return [];
180
+ const files = yield* collectFilesRecursively(assetsPath);
181
+ return files.map((file) => file.replaceAll("\\", "/")).filter((file) => !DISALLOWED_ASSET_EXTENSIONS.some((extension) => file.toLowerCase().endsWith(extension))).sort();
182
+ });
183
+
145
184
  // src/define-config.ts
146
185
  var defineConfig = (config) => config;
147
186
 
148
187
  // src/detection/detect-framework.ts
149
- var import_platform8 = require("@effect/platform");
150
- var import_effect13 = require("effect");
188
+ var import_platform9 = require("@effect/platform");
189
+ var import_effect14 = require("effect");
151
190
 
152
191
  // src/detection/detect-package-manager.ts
153
- var import_platform = require("@effect/platform");
154
- var import_effect3 = require("effect");
192
+ var import_platform2 = require("@effect/platform");
193
+ var import_effect4 = require("effect");
155
194
  var LOCKFILE_MAP = [
156
195
  { files: ["bun.lockb", "bun.lock"], pm: "bun" },
157
196
  { files: ["pnpm-lock.yaml"], pm: "pnpm" },
@@ -159,19 +198,19 @@ var LOCKFILE_MAP = [
159
198
  { files: ["package-lock.json"], pm: "npm" },
160
199
  { files: ["composer.lock"], pm: "composer" }
161
200
  ];
162
- var detectPackageManager = import_effect3.Effect.fn("detectPackageManager")(function* (projectFolder) {
163
- const fs = yield* import_platform.FileSystem.FileSystem;
164
- const pathService = yield* import_platform.Path.Path;
201
+ var detectPackageManager = import_effect4.Effect.fn("detectPackageManager")(function* (projectFolder) {
202
+ const fs = yield* import_platform2.FileSystem.FileSystem;
203
+ const pathService = yield* import_platform2.Path.Path;
165
204
  for (const { files, pm } of LOCKFILE_MAP) {
166
205
  for (const file of files) {
167
- const exists = yield* fs.exists(pathService.join(projectFolder, file)).pipe(import_effect3.Effect.catchAll(() => import_effect3.Effect.succeed(false)));
206
+ const exists = yield* fs.exists(pathService.join(projectFolder, file)).pipe(import_effect4.Effect.catchAll(() => import_effect4.Effect.succeed(false)));
168
207
  if (exists) {
169
- yield* import_effect3.Effect.logDebug(`Detected package manager: ${pm} (via ${file})`);
208
+ yield* import_effect4.Effect.logDebug(`Detected package manager: ${pm} (via ${file})`);
170
209
  return pm;
171
210
  }
172
211
  }
173
212
  }
174
- yield* import_effect3.Effect.logDebug("No lockfile found, defaulting to npm");
213
+ yield* import_effect4.Effect.logDebug("No lockfile found, defaulting to npm");
175
214
  return "npm";
176
215
  });
177
216
 
@@ -197,8 +236,8 @@ var astro = {
197
236
  };
198
237
 
199
238
  // src/detection/frameworks/resolve-node-entrypoint.ts
200
- var import_platform2 = require("@effect/platform");
201
- var import_effect4 = require("effect");
239
+ var import_platform3 = require("@effect/platform");
240
+ var import_effect5 = require("effect");
202
241
  var SCRIPT_RUNNERS = /* @__PURE__ */ new Set(["node", "bun", "tsx", "ts-node"]);
203
242
  var COMMON_ENTRYPOINT_CANDIDATES = [
204
243
  "index.js",
@@ -246,14 +285,14 @@ var applyEntrypoint = (defaults, entrypoint) => ({
246
285
  (route) => route.destination === defaults.entrypoint ? { ...route, destination: entrypoint } : route
247
286
  )
248
287
  });
249
- var resolveNodeServerEntrypoint = (defaults, projectFolder) => import_effect4.Effect.gen(function* () {
250
- const fs = yield* import_platform2.FileSystem.FileSystem;
251
- const pathService = yield* import_platform2.Path.Path;
288
+ var resolveNodeServerEntrypoint = (defaults, projectFolder) => import_effect5.Effect.gen(function* () {
289
+ const fs = yield* import_platform3.FileSystem.FileSystem;
290
+ const pathService = yield* import_platform3.Path.Path;
252
291
  const isFile = (relativePath) => fs.stat(pathService.join(projectFolder, relativePath)).pipe(
253
- import_effect4.Effect.map((info) => info.type === "File"),
254
- import_effect4.Effect.catchAll(() => import_effect4.Effect.succeed(false))
292
+ import_effect5.Effect.map((info) => info.type === "File"),
293
+ import_effect5.Effect.catchAll(() => import_effect5.Effect.succeed(false))
255
294
  );
256
- const content = yield* fs.readFileString(pathService.join(projectFolder, "package.json")).pipe(import_effect4.Effect.catchAll(() => import_effect4.Effect.succeed(void 0)));
295
+ const content = yield* fs.readFileString(pathService.join(projectFolder, "package.json")).pipe(import_effect5.Effect.catchAll(() => import_effect5.Effect.succeed(void 0)));
257
296
  const manifest = content ? parsePackageJson(content) : void 0;
258
297
  const startScript = typeof manifest?.scripts?.start === "string" ? manifest.scripts.start : void 0;
259
298
  const candidates = [
@@ -385,8 +424,8 @@ var laravel = {
385
424
  };
386
425
 
387
426
  // src/detection/frameworks/nestjs.ts
388
- var import_platform3 = require("@effect/platform");
389
- var import_effect5 = require("effect");
427
+ var import_platform4 = require("@effect/platform");
428
+ var import_effect6 = require("effect");
390
429
  var isRecord2 = (value) => typeof value === "object" && value !== null;
391
430
  var parseNestCliJson = (content) => {
392
431
  try {
@@ -437,9 +476,9 @@ var nestjs = {
437
476
  detectors: [{ matchPackage: "@nestjs/core" }],
438
477
  priority: 90,
439
478
  getDefaultConfig: () => createNestConfig("dist"),
440
- refineDefaultConfig: (defaults, projectFolder) => import_effect5.Effect.gen(function* () {
441
- const fs = yield* import_platform3.FileSystem.FileSystem;
442
- const content = yield* fs.readFileString(`${projectFolder}/nest-cli.json`).pipe(import_effect5.Effect.catchAll(() => import_effect5.Effect.succeed(void 0)));
479
+ refineDefaultConfig: (defaults, projectFolder) => import_effect6.Effect.gen(function* () {
480
+ const fs = yield* import_platform4.FileSystem.FileSystem;
481
+ const content = yield* fs.readFileString(`${projectFolder}/nest-cli.json`).pipe(import_effect6.Effect.catchAll(() => import_effect6.Effect.succeed(void 0)));
443
482
  if (!content) return defaults;
444
483
  const nestConfig = parseNestCliJson(content);
445
484
  const outputPath = nestConfig ? getProjectOutputPath(nestConfig) : void 0;
@@ -448,28 +487,28 @@ var nestjs = {
448
487
  };
449
488
 
450
489
  // src/detection/frameworks/nextjs.ts
451
- var import_platform5 = require("@effect/platform");
452
- var import_effect8 = require("effect");
490
+ var import_platform6 = require("@effect/platform");
491
+ var import_effect9 = require("effect");
453
492
 
454
493
  // src/build-output-v3/get-default-path-map.ts
455
- var import_platform4 = require("@effect/platform");
456
- var import_effect6 = require("effect");
457
- var getDefaultPathMap = import_effect6.Effect.fn("getDefaultPathMap")(function* (directory) {
458
- const fs = yield* import_platform4.FileSystem.FileSystem;
459
- const pathService = yield* import_platform4.Path.Path;
494
+ var import_platform5 = require("@effect/platform");
495
+ var import_effect7 = require("effect");
496
+ var getDefaultPathMap = import_effect7.Effect.fn("getDefaultPathMap")(function* (directory) {
497
+ const fs = yield* import_platform5.FileSystem.FileSystem;
498
+ const pathService = yield* import_platform5.Path.Path;
460
499
  const result = {};
461
- const exists = yield* fs.exists(directory).pipe(import_effect6.Effect.catchAll(() => import_effect6.Effect.succeed(false)));
500
+ const exists = yield* fs.exists(directory).pipe(import_effect7.Effect.catchAll(() => import_effect7.Effect.succeed(false)));
462
501
  if (!exists) {
463
502
  return result;
464
503
  }
465
504
  const MAX_DEPTH = 100;
466
- const processDirectory = (currentPath, basePath = "", depth = 0) => import_effect6.Effect.gen(function* () {
505
+ const processDirectory = (currentPath, basePath = "", depth = 0) => import_effect7.Effect.gen(function* () {
467
506
  if (depth > MAX_DEPTH) return;
468
- const entries = yield* fs.readDirectory(currentPath).pipe(import_effect6.Effect.catchAll(() => import_effect6.Effect.succeed([])));
507
+ const entries = yield* fs.readDirectory(currentPath).pipe(import_effect7.Effect.catchAll(() => import_effect7.Effect.succeed([])));
469
508
  for (const name of entries) {
470
509
  const fullPath = pathService.join(currentPath, name);
471
510
  const relativePath = basePath ? pathService.join(basePath, name) : name;
472
- const stat = yield* fs.stat(fullPath).pipe(import_effect6.Effect.catchAll(() => import_effect6.Effect.succeed(null)));
511
+ const stat = yield* fs.stat(fullPath).pipe(import_effect7.Effect.catchAll(() => import_effect7.Effect.succeed(null)));
473
512
  if (!stat) continue;
474
513
  if (stat.type === "Directory") {
475
514
  yield* processDirectory(fullPath, relativePath, depth + 1);
@@ -486,244 +525,244 @@ var getDefaultPathMap = import_effect6.Effect.fn("getDefaultPathMap")(function*
486
525
  var MAXIMUM_ENTRY_PAGE_PATHS = 50;
487
526
 
488
527
  // src/nextjs-manifest.ts
489
- var import_effect7 = require("effect");
490
- var StringArraySchema = import_effect7.Schema.mutable(import_effect7.Schema.Array(import_effect7.Schema.String));
491
- var StringRecordSchema = import_effect7.Schema.mutable(import_effect7.Schema.Record({ key: import_effect7.Schema.String, value: import_effect7.Schema.String }));
492
- var JsonValueSchema = import_effect7.Schema.suspend(
493
- () => import_effect7.Schema.Union(
494
- import_effect7.Schema.Null,
495
- import_effect7.Schema.Boolean,
496
- import_effect7.Schema.Number,
497
- import_effect7.Schema.String,
498
- import_effect7.Schema.mutable(import_effect7.Schema.Array(JsonValueSchema)),
499
- import_effect7.Schema.mutable(import_effect7.Schema.Record({ key: import_effect7.Schema.String, value: JsonValueSchema }))
528
+ var import_effect8 = require("effect");
529
+ var StringArraySchema = import_effect8.Schema.mutable(import_effect8.Schema.Array(import_effect8.Schema.String));
530
+ var StringRecordSchema = import_effect8.Schema.mutable(import_effect8.Schema.Record({ key: import_effect8.Schema.String, value: import_effect8.Schema.String }));
531
+ var JsonValueSchema = import_effect8.Schema.suspend(
532
+ () => import_effect8.Schema.Union(
533
+ import_effect8.Schema.Null,
534
+ import_effect8.Schema.Boolean,
535
+ import_effect8.Schema.Number,
536
+ import_effect8.Schema.String,
537
+ import_effect8.Schema.mutable(import_effect8.Schema.Array(JsonValueSchema)),
538
+ import_effect8.Schema.mutable(import_effect8.Schema.Record({ key: import_effect8.Schema.String, value: JsonValueSchema }))
500
539
  )
501
540
  );
502
- var ImageLocalPatternSchema = import_effect7.Schema.mutable(
503
- import_effect7.Schema.Struct({
504
- pathname: import_effect7.Schema.optional(import_effect7.Schema.String),
505
- search: import_effect7.Schema.optional(import_effect7.Schema.String)
541
+ var ImageLocalPatternSchema = import_effect8.Schema.mutable(
542
+ import_effect8.Schema.Struct({
543
+ pathname: import_effect8.Schema.optional(import_effect8.Schema.String),
544
+ search: import_effect8.Schema.optional(import_effect8.Schema.String)
506
545
  })
507
546
  );
508
- var ImageRemotePatternSchema = import_effect7.Schema.mutable(
509
- import_effect7.Schema.Struct({
510
- protocol: import_effect7.Schema.optional(import_effect7.Schema.Literal("http", "https")),
511
- hostname: import_effect7.Schema.String,
512
- port: import_effect7.Schema.optional(import_effect7.Schema.String),
513
- pathname: import_effect7.Schema.optional(import_effect7.Schema.String),
514
- search: import_effect7.Schema.optional(import_effect7.Schema.String)
547
+ var ImageRemotePatternSchema = import_effect8.Schema.mutable(
548
+ import_effect8.Schema.Struct({
549
+ protocol: import_effect8.Schema.optional(import_effect8.Schema.Literal("http", "https")),
550
+ hostname: import_effect8.Schema.String,
551
+ port: import_effect8.Schema.optional(import_effect8.Schema.String),
552
+ pathname: import_effect8.Schema.optional(import_effect8.Schema.String),
553
+ search: import_effect8.Schema.optional(import_effect8.Schema.String)
515
554
  })
516
555
  );
517
- var ImageVariantSchema = import_effect7.Schema.mutable(
518
- import_effect7.Schema.Struct({
519
- width: import_effect7.Schema.optional(import_effect7.Schema.Number),
520
- height: import_effect7.Schema.optional(import_effect7.Schema.Number),
521
- quality: import_effect7.Schema.optional(import_effect7.Schema.Number),
522
- format: import_effect7.Schema.optional(import_effect7.Schema.Literal("image/avif", "image/webp", "image/jpeg", "image/png")),
523
- fit: import_effect7.Schema.optional(import_effect7.Schema.Literal("contain", "cover", "fill", "inside", "outside"))
556
+ var ImageVariantSchema = import_effect8.Schema.mutable(
557
+ import_effect8.Schema.Struct({
558
+ width: import_effect8.Schema.optional(import_effect8.Schema.Number),
559
+ height: import_effect8.Schema.optional(import_effect8.Schema.Number),
560
+ quality: import_effect8.Schema.optional(import_effect8.Schema.Number),
561
+ format: import_effect8.Schema.optional(import_effect8.Schema.Literal("image/avif", "image/webp", "image/jpeg", "image/png")),
562
+ fit: import_effect8.Schema.optional(import_effect8.Schema.Literal("contain", "cover", "fill", "inside", "outside"))
524
563
  })
525
564
  );
526
- var PositiveIntSchema = import_effect7.Schema.Int.pipe(import_effect7.Schema.greaterThan(0));
527
- var ImagePolicySchema = import_effect7.Schema.mutable(
528
- import_effect7.Schema.Struct({
529
- localPatterns: import_effect7.Schema.mutable(import_effect7.Schema.Array(ImageLocalPatternSchema)),
530
- remotePatterns: import_effect7.Schema.mutable(import_effect7.Schema.Array(ImageRemotePatternSchema)),
531
- widths: import_effect7.Schema.mutable(import_effect7.Schema.Array(PositiveIntSchema)),
532
- heights: import_effect7.Schema.mutable(import_effect7.Schema.Array(PositiveIntSchema)),
533
- qualities: import_effect7.Schema.mutable(import_effect7.Schema.Array(import_effect7.Schema.Number.pipe(import_effect7.Schema.between(1, 100)))),
534
- formats: import_effect7.Schema.mutable(import_effect7.Schema.Array(import_effect7.Schema.Literal("image/avif", "image/webp", "image/jpeg", "image/png"))),
535
- minimumCacheTTL: import_effect7.Schema.Number,
536
- dangerouslyAllowSVG: import_effect7.Schema.Boolean,
537
- contentSecurityPolicy: import_effect7.Schema.String,
538
- contentDispositionType: import_effect7.Schema.Literal("inline", "attachment"),
539
- maximumRedirects: import_effect7.Schema.Number,
540
- maximumResponseBody: import_effect7.Schema.Number,
541
- variants: import_effect7.Schema.mutable(import_effect7.Schema.Record({ key: import_effect7.Schema.String, value: ImageVariantSchema }))
565
+ var PositiveIntSchema = import_effect8.Schema.Int.pipe(import_effect8.Schema.greaterThan(0));
566
+ var ImagePolicySchema = import_effect8.Schema.mutable(
567
+ import_effect8.Schema.Struct({
568
+ localPatterns: import_effect8.Schema.mutable(import_effect8.Schema.Array(ImageLocalPatternSchema)),
569
+ remotePatterns: import_effect8.Schema.mutable(import_effect8.Schema.Array(ImageRemotePatternSchema)),
570
+ widths: import_effect8.Schema.mutable(import_effect8.Schema.Array(PositiveIntSchema)),
571
+ heights: import_effect8.Schema.mutable(import_effect8.Schema.Array(PositiveIntSchema)),
572
+ qualities: import_effect8.Schema.mutable(import_effect8.Schema.Array(import_effect8.Schema.Number.pipe(import_effect8.Schema.between(1, 100)))),
573
+ formats: import_effect8.Schema.mutable(import_effect8.Schema.Array(import_effect8.Schema.Literal("image/avif", "image/webp", "image/jpeg", "image/png"))),
574
+ minimumCacheTTL: import_effect8.Schema.Number,
575
+ dangerouslyAllowSVG: import_effect8.Schema.Boolean,
576
+ contentSecurityPolicy: import_effect8.Schema.String,
577
+ contentDispositionType: import_effect8.Schema.Literal("inline", "attachment"),
578
+ maximumRedirects: import_effect8.Schema.Number,
579
+ maximumResponseBody: import_effect8.Schema.Number,
580
+ variants: import_effect8.Schema.mutable(import_effect8.Schema.Record({ key: import_effect8.Schema.String, value: ImageVariantSchema }))
542
581
  })
543
582
  );
544
583
  var GigadriveNextPrerenderOutputFields = {
545
- id: import_effect7.Schema.String,
546
- type: import_effect7.Schema.Literal("PRERENDER"),
584
+ id: import_effect8.Schema.String,
585
+ type: import_effect8.Schema.Literal("PRERENDER"),
547
586
  pathname: UrlPathnameSchema,
548
- route: import_effect7.Schema.optional(UrlPathnameSchema),
549
- parentOutputId: import_effect7.Schema.String,
550
- groupId: import_effect7.Schema.Number,
551
- pprChain: import_effect7.Schema.optional(import_effect7.Schema.mutable(import_effect7.Schema.Struct({ headers: HttpSingleValueHeadersSchema }))),
552
- parentFallbackMode: import_effect7.Schema.optional(JsonValueSchema),
553
- fallback: import_effect7.Schema.optional(
554
- import_effect7.Schema.mutable(
555
- import_effect7.Schema.Struct({
556
- filePath: import_effect7.Schema.optional(PortableRelativePathSchema),
557
- initialStatus: import_effect7.Schema.optional(import_effect7.Schema.Int.pipe(import_effect7.Schema.between(100, 599))),
558
- initialHeaders: import_effect7.Schema.optional(HttpHeadersSchema),
559
- initialExpiration: import_effect7.Schema.optional(import_effect7.Schema.Number),
560
- initialRevalidate: import_effect7.Schema.optional(import_effect7.Schema.Union(import_effect7.Schema.Number, import_effect7.Schema.Literal(false))),
561
- postponedState: import_effect7.Schema.optional(import_effect7.Schema.String)
587
+ route: import_effect8.Schema.optional(UrlPathnameSchema),
588
+ parentOutputId: import_effect8.Schema.String,
589
+ groupId: import_effect8.Schema.Number,
590
+ pprChain: import_effect8.Schema.optional(import_effect8.Schema.mutable(import_effect8.Schema.Struct({ headers: HttpSingleValueHeadersSchema }))),
591
+ parentFallbackMode: import_effect8.Schema.optional(JsonValueSchema),
592
+ fallback: import_effect8.Schema.optional(
593
+ import_effect8.Schema.mutable(
594
+ import_effect8.Schema.Struct({
595
+ filePath: import_effect8.Schema.optional(PortableRelativePathSchema),
596
+ initialStatus: import_effect8.Schema.optional(import_effect8.Schema.Int.pipe(import_effect8.Schema.between(100, 599))),
597
+ initialHeaders: import_effect8.Schema.optional(HttpHeadersSchema),
598
+ initialExpiration: import_effect8.Schema.optional(import_effect8.Schema.Number),
599
+ initialRevalidate: import_effect8.Schema.optional(import_effect8.Schema.Union(import_effect8.Schema.Number, import_effect8.Schema.Literal(false))),
600
+ postponedState: import_effect8.Schema.optional(import_effect8.Schema.String)
562
601
  })
563
602
  )
564
603
  ),
565
- config: import_effect7.Schema.mutable(
566
- import_effect7.Schema.Struct({
567
- allowQuery: import_effect7.Schema.optional(StringArraySchema),
568
- allowHeader: import_effect7.Schema.optional(StringArraySchema),
569
- bypassFor: import_effect7.Schema.optional(import_effect7.Schema.mutable(import_effect7.Schema.Array(JsonValueSchema))),
570
- renderingMode: import_effect7.Schema.optional(import_effect7.Schema.String),
571
- partialFallback: import_effect7.Schema.optional(import_effect7.Schema.Boolean),
572
- bypassToken: import_effect7.Schema.optional(import_effect7.Schema.String)
604
+ config: import_effect8.Schema.mutable(
605
+ import_effect8.Schema.Struct({
606
+ allowQuery: import_effect8.Schema.optional(StringArraySchema),
607
+ allowHeader: import_effect8.Schema.optional(StringArraySchema),
608
+ bypassFor: import_effect8.Schema.optional(import_effect8.Schema.mutable(import_effect8.Schema.Array(JsonValueSchema))),
609
+ renderingMode: import_effect8.Schema.optional(import_effect8.Schema.String),
610
+ partialFallback: import_effect8.Schema.optional(import_effect8.Schema.Boolean),
611
+ bypassToken: import_effect8.Schema.optional(import_effect8.Schema.String)
573
612
  })
574
613
  )
575
614
  };
576
- var GigadriveNextPrerenderClassificationSchema = import_effect7.Schema.Struct({
577
- routeType: import_effect7.Schema.Literal("route", "fallback", "shell", "page"),
578
- response: import_effect7.Schema.Literal("empty", "initial", "complete"),
579
- compute: import_effect7.Schema.Literal("blocking", "resuming", "static"),
580
- htmlSize: import_effect7.Schema.optional(import_effect7.Schema.Number)
615
+ var GigadriveNextPrerenderClassificationSchema = import_effect8.Schema.Struct({
616
+ routeType: import_effect8.Schema.Literal("route", "fallback", "shell", "page"),
617
+ response: import_effect8.Schema.Literal("empty", "initial", "complete"),
618
+ compute: import_effect8.Schema.Literal("blocking", "resuming", "static"),
619
+ htmlSize: import_effect8.Schema.optional(import_effect8.Schema.Number)
581
620
  });
582
- var GigadriveNextPrerenderWithoutClassificationSchema = import_effect7.Schema.Struct({
583
- routeType: import_effect7.Schema.optional(import_effect7.Schema.Never),
584
- response: import_effect7.Schema.optional(import_effect7.Schema.Never),
585
- compute: import_effect7.Schema.optional(import_effect7.Schema.Never),
586
- htmlSize: import_effect7.Schema.optional(import_effect7.Schema.Never)
621
+ var GigadriveNextPrerenderWithoutClassificationSchema = import_effect8.Schema.Struct({
622
+ routeType: import_effect8.Schema.optional(import_effect8.Schema.Never),
623
+ response: import_effect8.Schema.optional(import_effect8.Schema.Never),
624
+ compute: import_effect8.Schema.optional(import_effect8.Schema.Never),
625
+ htmlSize: import_effect8.Schema.optional(import_effect8.Schema.Never)
587
626
  });
588
- var GigadriveNextPrerenderOutputSchema = import_effect7.Schema.Union(
589
- import_effect7.Schema.mutable(
590
- import_effect7.Schema.Struct({ ...GigadriveNextPrerenderOutputFields, ...GigadriveNextPrerenderClassificationSchema.fields })
627
+ var GigadriveNextPrerenderOutputSchema = import_effect8.Schema.Union(
628
+ import_effect8.Schema.mutable(
629
+ import_effect8.Schema.Struct({ ...GigadriveNextPrerenderOutputFields, ...GigadriveNextPrerenderClassificationSchema.fields })
591
630
  ),
592
- import_effect7.Schema.mutable(
593
- import_effect7.Schema.Struct({
631
+ import_effect8.Schema.mutable(
632
+ import_effect8.Schema.Struct({
594
633
  ...GigadriveNextPrerenderOutputFields,
595
634
  ...GigadriveNextPrerenderWithoutClassificationSchema.fields
596
635
  })
597
636
  )
598
637
  );
599
- var GigadriveNextStaticAssetPrefixSchema = import_effect7.Schema.mutable(
600
- import_effect7.Schema.Struct({
638
+ var GigadriveNextStaticAssetPrefixSchema = import_effect8.Schema.mutable(
639
+ import_effect8.Schema.Struct({
601
640
  sourceDir: PortableRelativePathSchema,
602
641
  urlPrefix: PortableRelativePathSchema,
603
- immutable: import_effect7.Schema.Boolean
642
+ immutable: import_effect8.Schema.Boolean
604
643
  })
605
644
  );
606
- var GigadriveNextRouteConditionSchema = import_effect7.Schema.Union(
607
- import_effect7.Schema.mutable(
608
- import_effect7.Schema.Struct({
609
- type: import_effect7.Schema.Literal("header", "cookie", "query"),
610
- key: import_effect7.Schema.String,
611
- value: import_effect7.Schema.optional(import_effect7.Schema.String)
645
+ var GigadriveNextRouteConditionSchema = import_effect8.Schema.Union(
646
+ import_effect8.Schema.mutable(
647
+ import_effect8.Schema.Struct({
648
+ type: import_effect8.Schema.Literal("header", "cookie", "query"),
649
+ key: import_effect8.Schema.String,
650
+ value: import_effect8.Schema.optional(import_effect8.Schema.String)
612
651
  })
613
652
  ),
614
- import_effect7.Schema.mutable(
615
- import_effect7.Schema.Struct({
616
- type: import_effect7.Schema.Literal("host"),
617
- value: import_effect7.Schema.String
653
+ import_effect8.Schema.mutable(
654
+ import_effect8.Schema.Struct({
655
+ type: import_effect8.Schema.Literal("host"),
656
+ value: import_effect8.Schema.String
618
657
  })
619
658
  )
620
659
  );
621
- var GigadriveNextMiddlewareMatcherSchema = import_effect7.Schema.mutable(
622
- import_effect7.Schema.Struct({
623
- source: import_effect7.Schema.String,
624
- sourceRegex: import_effect7.Schema.String,
625
- has: import_effect7.Schema.optional(import_effect7.Schema.mutable(import_effect7.Schema.Array(GigadriveNextRouteConditionSchema))),
626
- missing: import_effect7.Schema.optional(import_effect7.Schema.mutable(import_effect7.Schema.Array(GigadriveNextRouteConditionSchema)))
660
+ var GigadriveNextMiddlewareMatcherSchema = import_effect8.Schema.mutable(
661
+ import_effect8.Schema.Struct({
662
+ source: import_effect8.Schema.String,
663
+ sourceRegex: import_effect8.Schema.String,
664
+ has: import_effect8.Schema.optional(import_effect8.Schema.mutable(import_effect8.Schema.Array(GigadriveNextRouteConditionSchema))),
665
+ missing: import_effect8.Schema.optional(import_effect8.Schema.mutable(import_effect8.Schema.Array(GigadriveNextRouteConditionSchema)))
627
666
  })
628
667
  );
629
- var GigadriveNextMiddlewareDescriptorSchema = import_effect7.Schema.Union(
630
- import_effect7.Schema.mutable(
631
- import_effect7.Schema.Struct({
632
- present: import_effect7.Schema.Literal(true),
633
- matchers: import_effect7.Schema.mutable(import_effect7.Schema.Array(GigadriveNextMiddlewareMatcherSchema))
668
+ var GigadriveNextMiddlewareDescriptorSchema = import_effect8.Schema.Union(
669
+ import_effect8.Schema.mutable(
670
+ import_effect8.Schema.Struct({
671
+ present: import_effect8.Schema.Literal(true),
672
+ matchers: import_effect8.Schema.mutable(import_effect8.Schema.Array(GigadriveNextMiddlewareMatcherSchema))
634
673
  })
635
674
  ),
636
- import_effect7.Schema.mutable(
637
- import_effect7.Schema.Struct({
638
- present: import_effect7.Schema.Literal(false),
639
- matchers: import_effect7.Schema.mutable(import_effect7.Schema.Tuple())
675
+ import_effect8.Schema.mutable(
676
+ import_effect8.Schema.Struct({
677
+ present: import_effect8.Schema.Literal(false),
678
+ matchers: import_effect8.Schema.mutable(import_effect8.Schema.Tuple())
640
679
  })
641
680
  )
642
681
  );
643
- var GigadriveNextServerDescriptorSchema = import_effect7.Schema.mutable(
644
- import_effect7.Schema.Struct({
645
- maxDuration: import_effect7.Schema.optional(import_effect7.Schema.Number),
646
- preferredRegion: import_effect7.Schema.optional(import_effect7.Schema.Union(import_effect7.Schema.String, StringArraySchema)),
647
- env: import_effect7.Schema.optional(StringRecordSchema)
682
+ var GigadriveNextServerDescriptorSchema = import_effect8.Schema.mutable(
683
+ import_effect8.Schema.Struct({
684
+ maxDuration: import_effect8.Schema.optional(import_effect8.Schema.Number),
685
+ preferredRegion: import_effect8.Schema.optional(import_effect8.Schema.Union(import_effect8.Schema.String, StringArraySchema)),
686
+ env: import_effect8.Schema.optional(StringRecordSchema)
648
687
  })
649
688
  );
650
- var PrerenderArraySchema = import_effect7.Schema.mutable(import_effect7.Schema.Array(GigadriveNextPrerenderOutputSchema));
651
- var StaticAssetArraySchema = import_effect7.Schema.mutable(import_effect7.Schema.Array(GigadriveNextStaticAssetPrefixSchema));
652
- var JsonValueArraySchema = import_effect7.Schema.mutable(import_effect7.Schema.Array(JsonValueSchema));
653
- var GigadriveNextPrerenderSeedMethodsSchema = import_effect7.Schema.mutable(
654
- import_effect7.Schema.Tuple(import_effect7.Schema.Literal("GET"), import_effect7.Schema.Literal("HEAD"))
689
+ var PrerenderArraySchema = import_effect8.Schema.mutable(import_effect8.Schema.Array(GigadriveNextPrerenderOutputSchema));
690
+ var StaticAssetArraySchema = import_effect8.Schema.mutable(import_effect8.Schema.Array(GigadriveNextStaticAssetPrefixSchema));
691
+ var JsonValueArraySchema = import_effect8.Schema.mutable(import_effect8.Schema.Array(JsonValueSchema));
692
+ var GigadriveNextPrerenderSeedMethodsSchema = import_effect8.Schema.mutable(
693
+ import_effect8.Schema.Tuple(import_effect8.Schema.Literal("GET"), import_effect8.Schema.Literal("HEAD"))
655
694
  );
656
- var GigadriveNextBuildManifestV1Schema = import_effect7.Schema.mutable(
657
- import_effect7.Schema.Struct({
658
- version: import_effect7.Schema.Literal(1),
659
- output: import_effect7.Schema.Literal("standalone", "export"),
695
+ var GigadriveNextBuildManifestV1Schema = import_effect8.Schema.mutable(
696
+ import_effect8.Schema.Struct({
697
+ version: import_effect8.Schema.Literal(1),
698
+ output: import_effect8.Schema.Literal("standalone", "export"),
660
699
  distDir: PortableRelativePathSchema,
661
700
  repoRootToProject: RepositoryRelativePathSchema,
662
- nextVersion: import_effect7.Schema.String,
663
- buildId: import_effect7.Schema.String
701
+ nextVersion: import_effect8.Schema.String,
702
+ buildId: import_effect8.Schema.String
664
703
  })
665
704
  );
666
- var GigadriveNextBuildManifestV2ExportSchema = import_effect7.Schema.mutable(
667
- import_effect7.Schema.Struct({
668
- version: import_effect7.Schema.Literal(2),
669
- mode: import_effect7.Schema.Literal("export"),
705
+ var GigadriveNextBuildManifestV2ExportSchema = import_effect8.Schema.mutable(
706
+ import_effect8.Schema.Struct({
707
+ version: import_effect8.Schema.Literal(2),
708
+ mode: import_effect8.Schema.Literal("export"),
670
709
  distDir: PortableRelativePathSchema,
671
710
  repoRootToProject: RepositoryRelativePathSchema,
672
- nextVersion: import_effect7.Schema.String,
673
- buildId: import_effect7.Schema.String
711
+ nextVersion: import_effect8.Schema.String,
712
+ buildId: import_effect8.Schema.String
674
713
  })
675
714
  );
676
- var GigadriveNextBuildManifestV2StandaloneSchema = import_effect7.Schema.mutable(
677
- import_effect7.Schema.Struct({
678
- version: import_effect7.Schema.Literal(2),
679
- mode: import_effect7.Schema.Literal("standalone-v2"),
715
+ var GigadriveNextBuildManifestV2StandaloneSchema = import_effect8.Schema.mutable(
716
+ import_effect8.Schema.Struct({
717
+ version: import_effect8.Schema.Literal(2),
718
+ mode: import_effect8.Schema.Literal("standalone-v2"),
680
719
  distDir: PortableRelativePathSchema,
681
720
  repoRootToProject: RepositoryRelativePathSchema,
682
- nextVersion: import_effect7.Schema.String,
683
- buildId: import_effect7.Schema.String,
721
+ nextVersion: import_effect8.Schema.String,
722
+ buildId: import_effect8.Schema.String,
684
723
  server: GigadriveNextServerDescriptorSchema,
685
- config: import_effect7.Schema.mutable(
686
- import_effect7.Schema.Struct({
687
- basePath: import_effect7.Schema.String,
688
- trailingSlash: import_effect7.Schema.Boolean,
689
- cacheComponents: import_effect7.Schema.Boolean,
690
- i18n: import_effect7.Schema.optional(JsonValueSchema),
691
- images: import_effect7.Schema.optional(ImagePolicySchema)
724
+ config: import_effect8.Schema.mutable(
725
+ import_effect8.Schema.Struct({
726
+ basePath: import_effect8.Schema.String,
727
+ trailingSlash: import_effect8.Schema.Boolean,
728
+ cacheComponents: import_effect8.Schema.Boolean,
729
+ i18n: import_effect8.Schema.optional(JsonValueSchema),
730
+ images: import_effect8.Schema.optional(ImagePolicySchema)
692
731
  })
693
732
  ),
694
- routing: import_effect7.Schema.mutable(
695
- import_effect7.Schema.Struct({
733
+ routing: import_effect8.Schema.mutable(
734
+ import_effect8.Schema.Struct({
696
735
  beforeMiddleware: JsonValueArraySchema,
697
736
  beforeFiles: JsonValueArraySchema,
698
737
  afterFiles: JsonValueArraySchema,
699
738
  dynamicRoutes: JsonValueArraySchema,
700
739
  onMatch: JsonValueArraySchema,
701
740
  fallback: JsonValueArraySchema,
702
- shouldNormalizeNextData: import_effect7.Schema.Boolean,
741
+ shouldNormalizeNextData: import_effect8.Schema.Boolean,
703
742
  rsc: JsonValueSchema
704
743
  })
705
744
  ),
706
- outputs: import_effect7.Schema.mutable(
707
- import_effect7.Schema.Struct({
745
+ outputs: import_effect8.Schema.mutable(
746
+ import_effect8.Schema.Struct({
708
747
  prerenders: PrerenderArraySchema,
709
- prerenderManifest: import_effect7.Schema.optional(PortableRelativePathSchema),
710
- assetManifest: import_effect7.Schema.optional(PortableRelativePathSchema),
711
- entryPagePaths: import_effect7.Schema.optional(import_effect7.Schema.mutable(import_effect7.Schema.Array(UrlPathnameSchema))),
748
+ prerenderManifest: import_effect8.Schema.optional(PortableRelativePathSchema),
749
+ assetManifest: import_effect8.Schema.optional(PortableRelativePathSchema),
750
+ entryPagePaths: import_effect8.Schema.optional(import_effect8.Schema.mutable(import_effect8.Schema.Array(UrlPathnameSchema))),
712
751
  staticAssets: StaticAssetArraySchema,
713
- middleware: import_effect7.Schema.optional(GigadriveNextMiddlewareDescriptorSchema)
752
+ middleware: import_effect8.Schema.optional(GigadriveNextMiddlewareDescriptorSchema)
714
753
  })
715
754
  )
716
755
  })
717
756
  );
718
- var GigadriveNextBuildManifestSchema = import_effect7.Schema.Union(
757
+ var GigadriveNextBuildManifestSchema = import_effect8.Schema.Union(
719
758
  GigadriveNextBuildManifestV1Schema,
720
759
  GigadriveNextBuildManifestV2ExportSchema,
721
760
  GigadriveNextBuildManifestV2StandaloneSchema
722
761
  );
723
- var GigadriveNextPrerenderManifestV1Schema = import_effect7.Schema.mutable(
724
- import_effect7.Schema.Struct({
725
- version: import_effect7.Schema.Literal(1),
726
- seedMethods: import_effect7.Schema.optional(GigadriveNextPrerenderSeedMethodsSchema),
762
+ var GigadriveNextPrerenderManifestV1Schema = import_effect8.Schema.mutable(
763
+ import_effect8.Schema.Struct({
764
+ version: import_effect8.Schema.Literal(1),
765
+ seedMethods: import_effect8.Schema.optional(GigadriveNextPrerenderSeedMethodsSchema),
727
766
  prerenders: PrerenderArraySchema
728
767
  })
729
768
  );
@@ -755,22 +794,22 @@ var AVAILABLE_REGIONS = [...REGION_DEFINITIONS];
755
794
  // src/detection/frameworks/nextjs.ts
756
795
  var toPortablePath = (value) => value.replaceAll("\\", "/");
757
796
  var STANDALONE_SERVER_MEMORY_MB = 1024;
758
- var resolveStandaloneServer = import_effect8.Effect.fn("nextjs.resolveStandaloneServer")(function* (projectFolder, distDir, repoRootToProject) {
759
- const fs = yield* import_platform5.FileSystem.FileSystem;
760
- const pathService = yield* import_platform5.Path.Path;
797
+ var resolveStandaloneServer = import_effect9.Effect.fn("nextjs.resolveStandaloneServer")(function* (projectFolder, distDir, repoRootToProject) {
798
+ const fs = yield* import_platform6.FileSystem.FileSystem;
799
+ const pathService = yield* import_platform6.Path.Path;
761
800
  const standaloneRoot = pathService.join(projectFolder, distDir, "standalone");
762
801
  const monorepoServer = pathService.join(standaloneRoot, repoRootToProject, "server.js");
763
802
  const rootServer = pathService.join(standaloneRoot, "server.js");
764
- const monorepoServerExists = yield* fs.exists(monorepoServer).pipe(import_effect8.Effect.catchAll(() => import_effect8.Effect.succeed(false)));
803
+ const monorepoServerExists = yield* fs.exists(monorepoServer).pipe(import_effect9.Effect.catchAll(() => import_effect9.Effect.succeed(false)));
765
804
  const serverPath = monorepoServerExists ? monorepoServer : rootServer;
766
- const serverExists = yield* fs.exists(serverPath).pipe(import_effect8.Effect.catchAll(() => import_effect8.Effect.succeed(false)));
805
+ const serverExists = yield* fs.exists(serverPath).pipe(import_effect9.Effect.catchAll(() => import_effect9.Effect.succeed(false)));
767
806
  if (!serverExists) return void 0;
768
807
  const serverDirectory = pathService.dirname(serverPath);
769
808
  const entrypoint = toPortablePath(pathService.relative(standaloneRoot, serverPath));
770
809
  return { standaloneRoot, serverDirectory, entrypoint };
771
810
  });
772
- var buildStandalonePublicAssets = import_effect8.Effect.fn("nextjs.buildStandalonePublicAssets")(function* (projectFolder, standaloneRoot, serverDirectory) {
773
- const pathService = yield* import_platform5.Path.Path;
811
+ var buildStandalonePublicAssets = import_effect9.Effect.fn("nextjs.buildStandalonePublicAssets")(function* (projectFolder, standaloneRoot, serverDirectory) {
812
+ const pathService = yield* import_platform6.Path.Path;
774
813
  const publicFiles = yield* getDefaultPathMap(pathService.join(projectFolder, "public"));
775
814
  const assetPaths = [];
776
815
  const assetOverrides = {};
@@ -786,8 +825,8 @@ var buildStandalonePublicAssets = import_effect8.Effect.fn("nextjs.buildStandalo
786
825
  }
787
826
  return { assetPaths, assetOverrides, filePathMap };
788
827
  });
789
- var createStaticExportConfig = import_effect8.Effect.fn("nextjs.createStaticExportConfig")(function* (defaults, projectFolder) {
790
- const pathService = yield* import_platform5.Path.Path;
828
+ var createStaticExportConfig = import_effect9.Effect.fn("nextjs.createStaticExportConfig")(function* (defaults, projectFolder) {
829
+ const pathService = yield* import_platform6.Path.Path;
791
830
  const outputDirectory = pathService.join(projectFolder, "out");
792
831
  const files = yield* getDefaultPathMap(outputDirectory);
793
832
  const assetPaths = [];
@@ -810,8 +849,8 @@ var createStaticExportConfig = import_effect8.Effect.fn("nextjs.createStaticExpo
810
849
  package: void 0
811
850
  };
812
851
  });
813
- var createStandaloneConfig = import_effect8.Effect.fn("nextjs.createStandaloneConfig")(function* (defaults, projectFolder, manifest) {
814
- const pathService = yield* import_platform5.Path.Path;
852
+ var createStandaloneConfig = import_effect9.Effect.fn("nextjs.createStandaloneConfig")(function* (defaults, projectFolder, manifest) {
853
+ const pathService = yield* import_platform6.Path.Path;
815
854
  const resolved = yield* resolveStandaloneServer(projectFolder, manifest.distDir, manifest.repoRootToProject);
816
855
  if (!resolved) return defaults;
817
856
  const { standaloneRoot, serverDirectory, entrypoint } = resolved;
@@ -844,7 +883,7 @@ var createStandaloneConfig = import_effect8.Effect.fn("nextjs.createStandaloneCo
844
883
  }
845
884
  };
846
885
  });
847
- var createStandaloneV2Config = import_effect8.Effect.fn("nextjs.createStandaloneV2Config")(function* (defaults, projectFolder, manifest) {
886
+ var createStandaloneV2Config = import_effect9.Effect.fn("nextjs.createStandaloneV2Config")(function* (defaults, projectFolder, manifest) {
848
887
  const resolved = yield* resolveStandaloneServer(projectFolder, manifest.distDir, manifest.repoRootToProject);
849
888
  if (!resolved) return defaults;
850
889
  const { standaloneRoot, serverDirectory, entrypoint } = resolved;
@@ -942,14 +981,19 @@ var nextjs = {
942
981
  streaming: true,
943
982
  commands: ["next build"],
944
983
  entrypoint: ".next/standalone/server.js",
945
- assetsDir: ".next/static",
984
+ // No `assetsDir`: this is only the fallback for a standalone build whose
985
+ // Gigadrive manifest is missing, and `.next/static` answers
986
+ // `/_next/static/...` rather than its own stripped prefix. Every path that
987
+ // resolves a real Next.js build (`refineDefaultConfig`) maps those chunks
988
+ // itself, so declaring the directory here would publish them at the wrong
989
+ // URLs.
946
990
  populateAssetCache: true,
947
991
  routes: [{ source: "/*", destination: ".next/standalone/server.js" }],
948
992
  environmentVariables: { NODE_ENV: "production" }
949
993
  }),
950
- refineDefaultConfig: (defaults, projectFolder) => import_effect8.Effect.gen(function* () {
951
- const fs = yield* import_platform5.FileSystem.FileSystem;
952
- const manifestContent = yield* fs.readFileString(`${projectFolder}/.gigadrive/nextjs.json`).pipe(import_effect8.Effect.catchAll(() => import_effect8.Effect.succeed(void 0)));
994
+ refineDefaultConfig: (defaults, projectFolder) => import_effect9.Effect.gen(function* () {
995
+ const fs = yield* import_platform6.FileSystem.FileSystem;
996
+ const manifestContent = yield* fs.readFileString(`${projectFolder}/.gigadrive/nextjs.json`).pipe(import_effect9.Effect.catchAll(() => import_effect9.Effect.succeed(void 0)));
953
997
  const manifest = manifestContent ? parseGigadriveNextBuildManifest(manifestContent) : void 0;
954
998
  if (!manifest) return defaults;
955
999
  if (manifest.version === 2) {
@@ -960,8 +1004,8 @@ var nextjs = {
960
1004
  };
961
1005
 
962
1006
  // src/detection/frameworks/nuxt.ts
963
- var import_platform6 = require("@effect/platform");
964
- var import_effect9 = require("effect");
1007
+ var import_platform7 = require("@effect/platform");
1008
+ var import_effect10 = require("effect");
965
1009
  var isVercelBuildOutputV3 = (content) => {
966
1010
  try {
967
1011
  const config = JSON.parse(content);
@@ -988,9 +1032,9 @@ var nuxt = {
988
1032
  routes: [{ source: "/*", destination: ".output/server/index.mjs" }],
989
1033
  environmentVariables: { NODE_ENV: "production", NITRO_PRESET: "node-server" }
990
1034
  }),
991
- refineDefaultConfig: (defaults, projectFolder) => import_effect9.Effect.gen(function* () {
992
- const fs = yield* import_platform6.FileSystem.FileSystem;
993
- const buildOutputConfig = yield* fs.readFileString(`${projectFolder}/.vercel/output/config.json`).pipe(import_effect9.Effect.catchAll(() => import_effect9.Effect.succeed(void 0)));
1035
+ refineDefaultConfig: (defaults, projectFolder) => import_effect10.Effect.gen(function* () {
1036
+ const fs = yield* import_platform7.FileSystem.FileSystem;
1037
+ const buildOutputConfig = yield* fs.readFileString(`${projectFolder}/.vercel/output/config.json`).pipe(import_effect10.Effect.catchAll(() => import_effect10.Effect.succeed(void 0)));
994
1038
  if (!buildOutputConfig || !isVercelBuildOutputV3(buildOutputConfig)) {
995
1039
  return defaults;
996
1040
  }
@@ -1113,7 +1157,7 @@ var FRAMEWORK_DEFINITIONS = [
1113
1157
  ].sort((a, b) => b.priority - a.priority);
1114
1158
 
1115
1159
  // src/detection/generate-config.ts
1116
- var import_effect10 = require("effect");
1160
+ var import_effect11 = require("effect");
1117
1161
  var getInstallCommand = (pm) => {
1118
1162
  switch (pm) {
1119
1163
  case "bun":
@@ -1129,11 +1173,11 @@ var getInstallCommand = (pm) => {
1129
1173
  return "npm install";
1130
1174
  }
1131
1175
  };
1132
- var generateConfig = import_effect10.Effect.fn("generateConfig")(function* (framework, packageManager, refinedDefaults) {
1176
+ var generateConfig = import_effect11.Effect.fn("generateConfig")(function* (framework, packageManager, projectFolder, refinedDefaults) {
1133
1177
  const defaults = refinedDefaults ?? framework.getDefaultConfig(packageManager);
1134
1178
  const installCmd = defaults.installCommand ?? getInstallCommand(packageManager);
1135
1179
  const commands = [installCmd, ...defaults.commands];
1136
- yield* import_effect10.Effect.logDebug(`Generating config for ${framework.name}`, {
1180
+ yield* import_effect11.Effect.logDebug(`Generating config for ${framework.name}`, {
1137
1181
  runtime: defaults.runtime,
1138
1182
  entrypoint: defaults.entrypoint,
1139
1183
  commands
@@ -1168,10 +1212,26 @@ var generateConfig = import_effect10.Effect.fn("generateConfig")(function* (fram
1168
1212
  ...defaults.normalizedConfig
1169
1213
  };
1170
1214
  if (defaults.assetsDir || defaults.assetPaths || defaults.assetPrefixes || defaults.assetManifests) {
1215
+ const paths = defaults.assetPaths ? [...defaults.assetPaths] : [];
1216
+ const overrides = { ...defaults.assetOverrides };
1217
+ const servesDirectoryIndexes = entrypoints.length === 0 && routes.length === 0;
1218
+ const assetsDir = defaults.assetsDir;
1219
+ if (assetsDir && !defaults.assetPaths && !defaults.assetPrefixes && !defaults.assetManifests) {
1220
+ for (const file of yield* collectAssetFiles(projectFolder, assetsDir)) {
1221
+ if (framework.language === "php" && /\.(php|phtml|phar)$/i.test(file)) continue;
1222
+ paths.push(`${assetsDir}/${file}`);
1223
+ if (!servesDirectoryIndexes || file in overrides) continue;
1224
+ if (file === "index.html") {
1225
+ overrides[file] = { path: "" };
1226
+ } else if (file.endsWith("/index.html")) {
1227
+ overrides[file] = { path: file.slice(0, -"/index.html".length) };
1228
+ }
1229
+ }
1230
+ }
1171
1231
  config.assets = {
1172
- paths: defaults.assetPaths ? [...defaults.assetPaths] : [],
1232
+ paths,
1173
1233
  prefixToStrip: defaults.assetsPrefixToStrip ?? (defaults.assetsDir ? defaults.assetsDir + "/" : ""),
1174
- overrides: defaults.assetOverrides ? { ...defaults.assetOverrides } : void 0,
1234
+ overrides: Object.keys(overrides).length > 0 ? overrides : void 0,
1175
1235
  prefixes: defaults.assetPrefixes ? defaults.assetPrefixes.map((prefix) => ({ ...prefix })) : void 0,
1176
1236
  manifests: defaults.assetManifests ? defaults.assetManifests.map((manifest) => ({ ...manifest })) : void 0,
1177
1237
  dynamicRoutes: true,
@@ -1182,31 +1242,31 @@ var generateConfig = import_effect10.Effect.fn("generateConfig")(function* (fram
1182
1242
  });
1183
1243
 
1184
1244
  // src/detection/read-dependencies.ts
1185
- var import_platform7 = require("@effect/platform");
1186
- var import_effect12 = require("effect");
1245
+ var import_platform8 = require("@effect/platform");
1246
+ var import_effect13 = require("effect");
1187
1247
 
1188
1248
  // src/detection/types.ts
1189
- var import_effect11 = require("effect");
1190
- var ManifestNotFoundError = class extends import_effect11.Schema.TaggedError()("ManifestNotFoundError", {
1191
- message: import_effect11.Schema.String,
1192
- filePath: import_effect11.Schema.String
1249
+ var import_effect12 = require("effect");
1250
+ var ManifestNotFoundError = class extends import_effect12.Schema.TaggedError()("ManifestNotFoundError", {
1251
+ message: import_effect12.Schema.String,
1252
+ filePath: import_effect12.Schema.String
1193
1253
  }) {
1194
1254
  };
1195
- var ManifestReadError = class extends import_effect11.Schema.TaggedError()("ManifestReadError", {
1196
- message: import_effect11.Schema.String,
1197
- filePath: import_effect11.Schema.String
1255
+ var ManifestReadError = class extends import_effect12.Schema.TaggedError()("ManifestReadError", {
1256
+ message: import_effect12.Schema.String,
1257
+ filePath: import_effect12.Schema.String
1198
1258
  }) {
1199
1259
  };
1200
- var ManifestParseError = class extends import_effect11.Schema.TaggedError()("ManifestParseError", {
1201
- message: import_effect11.Schema.String,
1202
- filePath: import_effect11.Schema.String
1260
+ var ManifestParseError = class extends import_effect12.Schema.TaggedError()("ManifestParseError", {
1261
+ message: import_effect12.Schema.String,
1262
+ filePath: import_effect12.Schema.String
1203
1263
  }) {
1204
1264
  };
1205
- var FrameworkNotDetectedError = class extends import_effect11.Schema.TaggedError()(
1265
+ var FrameworkNotDetectedError = class extends import_effect12.Schema.TaggedError()(
1206
1266
  "FrameworkNotDetectedError",
1207
1267
  {
1208
- message: import_effect11.Schema.String,
1209
- directory: import_effect11.Schema.String
1268
+ message: import_effect12.Schema.String,
1269
+ directory: import_effect12.Schema.String
1210
1270
  }
1211
1271
  ) {
1212
1272
  };
@@ -1216,25 +1276,25 @@ var MANIFEST_CONFIG = {
1216
1276
  node: { file: "package.json", depKeys: ["dependencies", "devDependencies"] },
1217
1277
  php: { file: "composer.json", depKeys: ["require", "require-dev"] }
1218
1278
  };
1219
- var readManifest = import_effect12.Effect.fn("readManifest")(function* (filePath) {
1220
- const fs = yield* import_platform7.FileSystem.FileSystem;
1221
- const exists = yield* fs.exists(filePath).pipe(import_effect12.Effect.catchAll(() => import_effect12.Effect.succeed(false)));
1279
+ var readManifest = import_effect13.Effect.fn("readManifest")(function* (filePath) {
1280
+ const fs = yield* import_platform8.FileSystem.FileSystem;
1281
+ const exists = yield* fs.exists(filePath).pipe(import_effect13.Effect.catchAll(() => import_effect13.Effect.succeed(false)));
1222
1282
  if (!exists) {
1223
- return yield* import_effect12.Effect.fail(new ManifestNotFoundError({ message: "Manifest not found", filePath }));
1283
+ return yield* import_effect13.Effect.fail(new ManifestNotFoundError({ message: "Manifest not found", filePath }));
1224
1284
  }
1225
- const content = yield* fs.readFileString(filePath).pipe(import_effect12.Effect.mapError(() => new ManifestReadError({ message: "Failed to read manifest", filePath })));
1226
- const parsed = yield* import_effect12.Effect.try({
1285
+ const content = yield* fs.readFileString(filePath).pipe(import_effect13.Effect.mapError(() => new ManifestReadError({ message: "Failed to read manifest", filePath })));
1286
+ const parsed = yield* import_effect13.Effect.try({
1227
1287
  try: () => JSON.parse(content),
1228
1288
  catch: () => new ManifestParseError({ message: "Failed to parse manifest JSON", filePath })
1229
1289
  });
1230
1290
  return parsed;
1231
1291
  });
1232
- var readDependencies = import_effect12.Effect.fn("readDependencies")(function* (projectFolder, language) {
1233
- const pathService = yield* import_platform7.Path.Path;
1292
+ var readDependencies = import_effect13.Effect.fn("readDependencies")(function* (projectFolder, language) {
1293
+ const pathService = yield* import_platform8.Path.Path;
1234
1294
  const config = MANIFEST_CONFIG[language];
1235
1295
  const filePath = pathService.join(projectFolder, config.file);
1236
1296
  const manifest = yield* readManifest(filePath).pipe(
1237
- import_effect12.Effect.catchTag("ManifestNotFoundError", () => import_effect12.Effect.succeed(null))
1297
+ import_effect13.Effect.catchTag("ManifestNotFoundError", () => import_effect13.Effect.succeed(null))
1238
1298
  );
1239
1299
  if (!manifest) {
1240
1300
  return /* @__PURE__ */ new Set();
@@ -1252,9 +1312,9 @@ var readDependencies = import_effect12.Effect.fn("readDependencies")(function* (
1252
1312
  });
1253
1313
 
1254
1314
  // src/detection/detect-framework.ts
1255
- var matchesDetectionItem = import_effect13.Effect.fn("matchesDetectionItem")(function* (item, projectFolder, framework, cachedReadDeps) {
1256
- const fs = yield* import_platform8.FileSystem.FileSystem;
1257
- const pathService = yield* import_platform8.Path.Path;
1315
+ var matchesDetectionItem = import_effect14.Effect.fn("matchesDetectionItem")(function* (item, projectFolder, framework, cachedReadDeps) {
1316
+ const fs = yield* import_platform9.FileSystem.FileSystem;
1317
+ const pathService = yield* import_platform9.Path.Path;
1258
1318
  if (item.matchPackage != null) {
1259
1319
  const deps = yield* cachedReadDeps(`${projectFolder}\0${framework.language}`);
1260
1320
  if (!deps.has(item.matchPackage)) {
@@ -1263,12 +1323,12 @@ var matchesDetectionItem = import_effect13.Effect.fn("matchesDetectionItem")(fun
1263
1323
  }
1264
1324
  if (item.path != null) {
1265
1325
  const filePath = pathService.join(projectFolder, item.path);
1266
- const exists = yield* fs.exists(filePath).pipe(import_effect13.Effect.catchAll(() => import_effect13.Effect.succeed(false)));
1326
+ const exists = yield* fs.exists(filePath).pipe(import_effect14.Effect.catchAll(() => import_effect14.Effect.succeed(false)));
1267
1327
  if (!exists) {
1268
1328
  return false;
1269
1329
  }
1270
1330
  if (item.matchContent != null) {
1271
- const content = yield* fs.readFileString(filePath).pipe(import_effect13.Effect.catchAll(() => import_effect13.Effect.succeed("")));
1331
+ const content = yield* fs.readFileString(filePath).pipe(import_effect14.Effect.catchAll(() => import_effect14.Effect.succeed("")));
1272
1332
  let regexMatch = false;
1273
1333
  try {
1274
1334
  regexMatch = new RegExp(item.matchContent).test(content);
@@ -1281,7 +1341,7 @@ var matchesDetectionItem = import_effect13.Effect.fn("matchesDetectionItem")(fun
1281
1341
  }
1282
1342
  return true;
1283
1343
  });
1284
- var matchesFramework = import_effect13.Effect.fn("matchesFramework")(function* (framework, projectFolder, cachedReadDeps) {
1344
+ var matchesFramework = import_effect14.Effect.fn("matchesFramework")(function* (framework, projectFolder, cachedReadDeps) {
1285
1345
  for (const detector of framework.detectors) {
1286
1346
  const matches = yield* matchesDetectionItem(detector, projectFolder, framework, cachedReadDeps);
1287
1347
  if (!matches) {
@@ -1290,9 +1350,9 @@ var matchesFramework = import_effect13.Effect.fn("matchesFramework")(function* (
1290
1350
  }
1291
1351
  return true;
1292
1352
  });
1293
- var detectFramework = import_effect13.Effect.fn("detectFramework")(function* (projectFolder) {
1294
- yield* import_effect13.Effect.logDebug(`Detecting framework in ${projectFolder}`);
1295
- const cachedReadDeps = yield* import_effect13.Effect.cachedFunction((key) => {
1353
+ var detectFramework = import_effect14.Effect.fn("detectFramework")(function* (projectFolder) {
1354
+ yield* import_effect14.Effect.logDebug(`Detecting framework in ${projectFolder}`);
1355
+ const cachedReadDeps = yield* import_effect14.Effect.cachedFunction((key) => {
1296
1356
  const sepIndex = key.lastIndexOf("\0");
1297
1357
  const folder = key.slice(0, sepIndex);
1298
1358
  const language = key.slice(sepIndex + 1);
@@ -1301,16 +1361,16 @@ var detectFramework = import_effect13.Effect.fn("detectFramework")(function* (pr
1301
1361
  for (const framework of FRAMEWORK_DEFINITIONS) {
1302
1362
  const matches = yield* matchesFramework(framework, projectFolder, cachedReadDeps);
1303
1363
  if (matches) {
1304
- yield* import_effect13.Effect.log(`Detected framework: ${framework.name}`, { slug: framework.slug });
1364
+ yield* import_effect14.Effect.log(`Detected framework: ${framework.name}`, { slug: framework.slug });
1305
1365
  const detectedPackageManager = yield* detectPackageManager(projectFolder);
1306
1366
  const packageManager = framework.language === "php" ? "composer" : detectedPackageManager;
1307
1367
  const defaults = framework.getDefaultConfig(packageManager);
1308
1368
  const refinedDefaults = framework.refineDefaultConfig ? yield* framework.refineDefaultConfig(defaults, projectFolder) : defaults;
1309
- const config = yield* generateConfig(framework, packageManager, refinedDefaults);
1369
+ const config = yield* generateConfig(framework, packageManager, projectFolder, refinedDefaults);
1310
1370
  return { framework, packageManager, config };
1311
1371
  }
1312
1372
  }
1313
- return yield* import_effect13.Effect.fail(
1373
+ return yield* import_effect14.Effect.fail(
1314
1374
  new FrameworkNotDetectedError({
1315
1375
  message: `No framework detected in project directory`,
1316
1376
  directory: projectFolder
@@ -1319,9 +1379,9 @@ var detectFramework = import_effect13.Effect.fn("detectFramework")(function* (pr
1319
1379
  });
1320
1380
 
1321
1381
  // src/detection/merge-config.ts
1322
- var import_effect14 = require("effect");
1323
- var mergeWithFrameworkDefaults = import_effect14.Effect.fn("mergeWithFrameworkDefaults")(function* (userConfig, frameworkConfig) {
1324
- yield* import_effect14.Effect.logDebug("Merging user config with framework defaults");
1382
+ var import_effect15 = require("effect");
1383
+ var mergeWithFrameworkDefaults = import_effect15.Effect.fn("mergeWithFrameworkDefaults")(function* (userConfig, frameworkConfig) {
1384
+ yield* import_effect15.Effect.logDebug("Merging user config with framework defaults");
1325
1385
  const userHasAssets = (userConfig.assets?.paths?.length ?? 0) > 0 || (userConfig.assets?.prefixes?.length ?? 0) > 0 || (userConfig.assets?.manifests?.length ?? 0) > 0;
1326
1386
  const merged = {
1327
1387
  regions: userConfig.regions,
@@ -1343,47 +1403,47 @@ var mergeWithFrameworkDefaults = import_effect14.Effect.fn("mergeWithFrameworkDe
1343
1403
  });
1344
1404
 
1345
1405
  // src/errors.ts
1346
- var import_effect15 = require("effect");
1347
- var ConfigFileNotFoundError = class extends import_effect15.Schema.TaggedError()("ConfigFileNotFoundError", {
1348
- message: import_effect15.Schema.String,
1349
- filePath: import_effect15.Schema.String
1406
+ var import_effect16 = require("effect");
1407
+ var ConfigFileNotFoundError = class extends import_effect16.Schema.TaggedError()("ConfigFileNotFoundError", {
1408
+ message: import_effect16.Schema.String,
1409
+ filePath: import_effect16.Schema.String
1350
1410
  }) {
1351
1411
  };
1352
- var ConfigFileEmptyError = class extends import_effect15.Schema.TaggedError()("ConfigFileEmptyError", {
1353
- message: import_effect15.Schema.String,
1354
- filePath: import_effect15.Schema.String
1412
+ var ConfigFileEmptyError = class extends import_effect16.Schema.TaggedError()("ConfigFileEmptyError", {
1413
+ message: import_effect16.Schema.String,
1414
+ filePath: import_effect16.Schema.String
1355
1415
  }) {
1356
1416
  };
1357
- var ConfigFileParseError = class extends import_effect15.Schema.TaggedError()("ConfigFileParseError", {
1358
- message: import_effect15.Schema.String,
1359
- filePath: import_effect15.Schema.String,
1360
- cause: import_effect15.Schema.optional(import_effect15.Schema.String)
1417
+ var ConfigFileParseError = class extends import_effect16.Schema.TaggedError()("ConfigFileParseError", {
1418
+ message: import_effect16.Schema.String,
1419
+ filePath: import_effect16.Schema.String,
1420
+ cause: import_effect16.Schema.optional(import_effect16.Schema.String)
1361
1421
  }) {
1362
1422
  };
1363
- var ConfigModuleLoadError = class extends import_effect15.Schema.TaggedError()("ConfigModuleLoadError", {
1364
- message: import_effect15.Schema.String,
1365
- filePath: import_effect15.Schema.String,
1366
- cause: import_effect15.Schema.optional(import_effect15.Schema.String)
1423
+ var ConfigModuleLoadError = class extends import_effect16.Schema.TaggedError()("ConfigModuleLoadError", {
1424
+ message: import_effect16.Schema.String,
1425
+ filePath: import_effect16.Schema.String,
1426
+ cause: import_effect16.Schema.optional(import_effect16.Schema.String)
1367
1427
  }) {
1368
1428
  };
1369
- var ConfigVersionError = class extends import_effect15.Schema.TaggedError()("ConfigVersionError", {
1370
- message: import_effect15.Schema.String,
1371
- filePath: import_effect15.Schema.String,
1372
- version: import_effect15.Schema.optional(import_effect15.Schema.Number)
1429
+ var ConfigVersionError = class extends import_effect16.Schema.TaggedError()("ConfigVersionError", {
1430
+ message: import_effect16.Schema.String,
1431
+ filePath: import_effect16.Schema.String,
1432
+ version: import_effect16.Schema.optional(import_effect16.Schema.Number)
1373
1433
  }) {
1374
1434
  };
1375
- var ConfigSchemaValidationError = class extends import_effect15.Schema.TaggedError()(
1435
+ var ConfigSchemaValidationError = class extends import_effect16.Schema.TaggedError()(
1376
1436
  "ConfigSchemaValidationError",
1377
1437
  {
1378
- message: import_effect15.Schema.String,
1379
- filePath: import_effect15.Schema.String,
1380
- validationErrors: import_effect15.Schema.Array(import_effect15.Schema.String)
1438
+ message: import_effect16.Schema.String,
1439
+ filePath: import_effect16.Schema.String,
1440
+ validationErrors: import_effect16.Schema.Array(import_effect16.Schema.String)
1381
1441
  }
1382
1442
  ) {
1383
1443
  };
1384
- var FunctionConfigError = class extends import_effect15.Schema.TaggedError()("FunctionConfigError", {
1385
- message: import_effect15.Schema.String,
1386
- functionPath: import_effect15.Schema.String
1444
+ var FunctionConfigError = class extends import_effect16.Schema.TaggedError()("FunctionConfigError", {
1445
+ message: import_effect16.Schema.String,
1446
+ functionPath: import_effect16.Schema.String
1387
1447
  }) {
1388
1448
  };
1389
1449
 
@@ -1403,23 +1463,23 @@ var DEFAULT_FUNCTION_DURATION_SECONDS = 30;
1403
1463
  var MAX_FUNCTION_DURATION_SECONDS = 28800;
1404
1464
 
1405
1465
  // src/parse-config.ts
1406
- var import_effect21 = require("effect");
1466
+ var import_effect22 = require("effect");
1407
1467
 
1408
1468
  // src/services/raw-config-reader.ts
1409
- var import_platform9 = require("@effect/platform");
1410
- var import_effect17 = require("effect");
1469
+ var import_platform10 = require("@effect/platform");
1470
+ var import_effect18 = require("effect");
1411
1471
  var import_yaml = require("yaml");
1412
1472
 
1413
1473
  // src/services/config-module-loader.ts
1414
- var import_effect16 = require("effect");
1474
+ var import_effect17 = require("effect");
1415
1475
  var import_jiti = require("jiti");
1416
1476
  var MISSING_DEFAULT_EXPORT = /* @__PURE__ */ Symbol("MissingDefaultExport");
1417
1477
  var STRICT_DEFAULT_EXPORT_EXTENSIONS = [".ts", ".mts", ".mjs"];
1418
- var ConfigModuleLoader = class extends import_effect16.Effect.Service()("ConfigModuleLoader", {
1419
- effect: import_effect16.Effect.gen(function* () {
1420
- const loadConfigModule = import_effect16.Effect.fn("ConfigModuleLoader.loadConfigModule")(function* (filePath) {
1478
+ var ConfigModuleLoader = class extends import_effect17.Effect.Service()("ConfigModuleLoader", {
1479
+ effect: import_effect17.Effect.gen(function* () {
1480
+ const loadConfigModule = import_effect17.Effect.fn("ConfigModuleLoader.loadConfigModule")(function* (filePath) {
1421
1481
  const extension = filePath.slice(filePath.lastIndexOf(".")).toLowerCase();
1422
- const mod = yield* import_effect16.Effect.tryPromise({
1482
+ const mod = yield* import_effect17.Effect.tryPromise({
1423
1483
  try: async () => {
1424
1484
  const jiti = (0, import_jiti.createJiti)(filePath, { fsCache: false, interopDefault: true, moduleCache: false });
1425
1485
  const namespace = await jiti.import(filePath);
@@ -1438,7 +1498,7 @@ var ConfigModuleLoader = class extends import_effect16.Effect.Service()("ConfigM
1438
1498
  })
1439
1499
  });
1440
1500
  if (mod === MISSING_DEFAULT_EXPORT) {
1441
- return yield* import_effect16.Effect.fail(
1501
+ return yield* import_effect17.Effect.fail(
1442
1502
  new ConfigModuleLoadError({
1443
1503
  message: `Config module at ${filePath} does not have a default export. Export the config object as the default export (or via module.exports for CommonJS files), optionally wrapped in defineConfig.`,
1444
1504
  filePath
@@ -1446,7 +1506,7 @@ var ConfigModuleLoader = class extends import_effect16.Effect.Service()("ConfigM
1446
1506
  );
1447
1507
  }
1448
1508
  if (typeof mod === "function") {
1449
- return yield* import_effect16.Effect.fail(
1509
+ return yield* import_effect17.Effect.fail(
1450
1510
  new ConfigModuleLoadError({
1451
1511
  message: `Config module at ${filePath} default-exports a function; config factories are not supported. Export a config object instead (optionally wrapped in defineConfig).`,
1452
1512
  filePath
@@ -1454,7 +1514,7 @@ var ConfigModuleLoader = class extends import_effect16.Effect.Service()("ConfigM
1454
1514
  );
1455
1515
  }
1456
1516
  if (typeof mod !== "object" || mod === null || Array.isArray(mod)) {
1457
- return yield* import_effect16.Effect.fail(
1517
+ return yield* import_effect17.Effect.fail(
1458
1518
  new ConfigModuleLoadError({
1459
1519
  message: `Config module at ${filePath} must default-export a config object.`,
1460
1520
  filePath
@@ -1484,36 +1544,36 @@ var ALLOWED_CONFIG_NAMES = [
1484
1544
  "nebula.json"
1485
1545
  ];
1486
1546
  var MODULE_EXTENSIONS = [".ts", ".mts", ".cts", ".js", ".mjs", ".cjs"];
1487
- var RawConfigReader = class extends import_effect17.Effect.Service()("RawConfigReader", {
1547
+ var RawConfigReader = class extends import_effect18.Effect.Service()("RawConfigReader", {
1488
1548
  dependencies: [ConfigModuleLoader.Default],
1489
- effect: import_effect17.Effect.gen(function* () {
1490
- const fs = yield* import_platform9.FileSystem.FileSystem;
1491
- const pathService = yield* import_platform9.Path.Path;
1549
+ effect: import_effect18.Effect.gen(function* () {
1550
+ const fs = yield* import_platform10.FileSystem.FileSystem;
1551
+ const pathService = yield* import_platform10.Path.Path;
1492
1552
  const moduleLoader = yield* ConfigModuleLoader;
1493
- const findConfig = import_effect17.Effect.fn("RawConfigReader.findConfig")(function* (projectFolder) {
1553
+ const findConfig = import_effect18.Effect.fn("RawConfigReader.findConfig")(function* (projectFolder) {
1494
1554
  for (const name of ALLOWED_CONFIG_NAMES) {
1495
1555
  const filePath = pathService.join(projectFolder, name);
1496
- const exists = yield* fs.exists(filePath).pipe(import_effect17.Effect.catchAll(() => import_effect17.Effect.succeed(false)));
1556
+ const exists = yield* fs.exists(filePath).pipe(import_effect18.Effect.catchAll(() => import_effect18.Effect.succeed(false)));
1497
1557
  if (exists) {
1498
1558
  return filePath;
1499
1559
  }
1500
1560
  }
1501
1561
  return null;
1502
1562
  });
1503
- const readRawConfig = import_effect17.Effect.fn("RawConfigReader.readRawConfig")(function* (filePath, options) {
1504
- const exists = yield* fs.exists(filePath).pipe(import_effect17.Effect.catchAll(() => import_effect17.Effect.succeed(false)));
1563
+ const readRawConfig = import_effect18.Effect.fn("RawConfigReader.readRawConfig")(function* (filePath, options) {
1564
+ const exists = yield* fs.exists(filePath).pipe(import_effect18.Effect.catchAll(() => import_effect18.Effect.succeed(false)));
1505
1565
  if (!exists) {
1506
- return yield* import_effect17.Effect.fail(
1566
+ return yield* import_effect18.Effect.fail(
1507
1567
  new ConfigFileNotFoundError({ message: `Config file not found at ${filePath}`, filePath })
1508
1568
  );
1509
1569
  }
1510
1570
  const fileContents = yield* fs.readFileString(filePath).pipe(
1511
- import_effect17.Effect.mapError(
1571
+ import_effect18.Effect.mapError(
1512
1572
  () => new ConfigFileParseError({ message: `Failed to read config file at ${filePath}`, filePath })
1513
1573
  )
1514
1574
  );
1515
1575
  if (fileContents.length === 0) {
1516
- return yield* import_effect17.Effect.fail(
1576
+ return yield* import_effect18.Effect.fail(
1517
1577
  new ConfigFileEmptyError({ message: `Config file is empty at ${filePath}`, filePath })
1518
1578
  );
1519
1579
  }
@@ -1529,7 +1589,7 @@ var RawConfigReader = class extends import_effect17.Effect.Service()("RawConfigR
1529
1589
  parsed = (0, import_yaml.parse)(fileContents);
1530
1590
  }
1531
1591
  } catch (error) {
1532
- return yield* import_effect17.Effect.fail(
1592
+ return yield* import_effect18.Effect.fail(
1533
1593
  new ConfigFileParseError({
1534
1594
  message: `Failed to parse config file at ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`,
1535
1595
  filePath,
@@ -1539,21 +1599,21 @@ var RawConfigReader = class extends import_effect17.Effect.Service()("RawConfigR
1539
1599
  }
1540
1600
  }
1541
1601
  if (parsed == null) {
1542
- return yield* import_effect17.Effect.fail(
1602
+ return yield* import_effect18.Effect.fail(
1543
1603
  new ConfigFileParseError({ message: `Config file could not be parsed at ${filePath}`, filePath })
1544
1604
  );
1545
1605
  }
1546
1606
  if (!options?.disableVersionCheck && typeof parsed.version !== "number") {
1547
- return yield* import_effect17.Effect.fail(
1607
+ return yield* import_effect18.Effect.fail(
1548
1608
  new ConfigVersionError({ message: `Config file is missing version at ${filePath}`, filePath })
1549
1609
  );
1550
1610
  }
1551
1611
  return parsed;
1552
1612
  });
1553
1613
  const readConfigFile = (configFilePath) => readRawConfig(configFilePath, { disableVersionCheck: true }).pipe(
1554
- import_effect17.Effect.map((parsed) => parsed),
1555
- import_effect17.Effect.catchTag("ConfigFileNotFoundError", () => import_effect17.Effect.succeed(null)),
1556
- import_effect17.Effect.withSpan("RawConfigReader.readConfigFile")
1614
+ import_effect18.Effect.map((parsed) => parsed),
1615
+ import_effect18.Effect.catchTag("ConfigFileNotFoundError", () => import_effect18.Effect.succeed(null)),
1616
+ import_effect18.Effect.withSpan("RawConfigReader.readConfigFile")
1557
1617
  );
1558
1618
  return { findConfig, readRawConfig, readConfigFile };
1559
1619
  })
@@ -1563,17 +1623,17 @@ var RawConfigReader = class extends import_effect17.Effect.Service()("RawConfigR
1563
1623
  // src/services/schema-validator.ts
1564
1624
  var import_ajv = __toESM(require("ajv"));
1565
1625
  var import_ajv_formats = __toESM(require("ajv-formats"));
1566
- var import_effect18 = require("effect");
1567
- var SchemaValidator = class extends import_effect18.Effect.Service()("SchemaValidator", {
1568
- effect: import_effect18.Effect.gen(function* () {
1626
+ var import_effect19 = require("effect");
1627
+ var SchemaValidator = class extends import_effect19.Effect.Service()("SchemaValidator", {
1628
+ effect: import_effect19.Effect.gen(function* () {
1569
1629
  const ajv = new import_ajv.default();
1570
1630
  (0, import_ajv_formats.default)(ajv);
1571
- const validate = import_effect18.Effect.fn("SchemaValidator.validate")(function* (config, schema, filePath) {
1631
+ const validate = import_effect19.Effect.fn("SchemaValidator.validate")(function* (config, schema, filePath) {
1572
1632
  const compiledValidate = ajv.compile(schema);
1573
1633
  const valid = compiledValidate(config);
1574
1634
  if (!valid) {
1575
1635
  const errors = compiledValidate.errors?.map((e) => `${e.instancePath || "/"} ${e.message ?? ""}`.trim()) ?? [];
1576
- return yield* import_effect18.Effect.fail(
1636
+ return yield* import_effect19.Effect.fail(
1577
1637
  new ConfigSchemaValidationError({
1578
1638
  message: `Config file at ${filePath} is invalid: ${ajv.errorsText(compiledValidate.errors)}`,
1579
1639
  filePath,
@@ -1587,9 +1647,6 @@ var SchemaValidator = class extends import_effect18.Effect.Service()("SchemaVali
1587
1647
  }) {
1588
1648
  };
1589
1649
 
1590
- // src/services/v4-config-parser.ts
1591
- var import_platform10 = require("@effect/platform");
1592
-
1593
1650
  // ../build-utils/src/get-files-for-pattern.ts
1594
1651
  var import_minimatch = require("minimatch");
1595
1652
  var import_promises = require("fs/promises");
@@ -1632,11 +1689,9 @@ var getFilesForPattern = async (pattern, projectFolder, excludeFiles = []) => {
1632
1689
  };
1633
1690
 
1634
1691
  // src/services/v4-config-parser.ts
1635
- var import_effect19 = require("effect");
1692
+ var import_effect20 = require("effect");
1636
1693
  var import_minimatch2 = require("minimatch");
1637
1694
  var import_safe_regex2 = __toESM(require("safe-regex2"));
1638
- var MAX_ASSET_DEPTH = 100;
1639
- var DISALLOWED_ASSET_EXTENSIONS = [".htaccess", ".htpasswd"];
1640
1695
  var DEFAULT_FUNCTION_SETTINGS = {
1641
1696
  memory: 128,
1642
1697
  max_duration: DEFAULT_FUNCTION_DURATION_SECONDS,
@@ -1738,7 +1793,7 @@ var mapRoute = (route, entrypoints) => ({
1738
1793
  negativeRequirements: route.missing,
1739
1794
  status: route.statusCode
1740
1795
  });
1741
- var parseEntrypoints = import_effect19.Effect.fn("parseEntrypoints")(function* (config, projectFolder) {
1796
+ var parseEntrypoints = import_effect20.Effect.fn("parseEntrypoints")(function* (config, projectFolder) {
1742
1797
  const entrypoints = [];
1743
1798
  if (config.functions == null) return entrypoints;
1744
1799
  for (const [fnPath, func] of Object.entries(config.functions)) {
@@ -1748,7 +1803,7 @@ var parseEntrypoints = import_effect19.Effect.fn("parseEntrypoints")(function* (
1748
1803
  functionPath: fnPath
1749
1804
  });
1750
1805
  }
1751
- const matchedFiles = yield* import_effect19.Effect.tryPromise({
1806
+ const matchedFiles = yield* import_effect20.Effect.tryPromise({
1752
1807
  try: () => getFilesForPattern(fnPath, projectFolder, func.excludeFiles),
1753
1808
  catch: (error) => new FunctionConfigError({
1754
1809
  message: `Failed to resolve files for function pattern '${fnPath}': ${error instanceof Error ? error.message : String(error)}`,
@@ -1784,57 +1839,21 @@ var parseEntrypoints = import_effect19.Effect.fn("parseEntrypoints")(function* (
1784
1839
  }
1785
1840
  return entrypoints;
1786
1841
  });
1787
- var collectAssets = import_effect19.Effect.fn("collectAssets")(function* (config, projectFolder) {
1842
+ var collectAssets = import_effect20.Effect.fn("collectAssets")(function* (config, projectFolder) {
1788
1843
  if (config.assets == null) return [];
1789
- const fs = yield* import_platform10.FileSystem.FileSystem;
1790
- const pathService = yield* import_platform10.Path.Path;
1791
- const assetsPath = pathService.join(projectFolder, config.assets);
1792
- const assetsExist = yield* fs.exists(assetsPath).pipe(import_effect19.Effect.catchAll(() => import_effect19.Effect.succeed(false)));
1793
- if (!assetsExist) return [];
1794
- const stat = yield* fs.stat(assetsPath).pipe(import_effect19.Effect.catchAll(() => import_effect19.Effect.succeed(null)));
1795
- if (!stat || stat.type !== "Directory") return [];
1796
- const allFiles = yield* collectFilesRecursively(assetsPath);
1797
- const assets = [];
1798
- for (const assetName of allFiles) {
1799
- if (DISALLOWED_ASSET_EXTENSIONS.some((ext) => assetName.toLowerCase().endsWith(ext.toLowerCase()))) continue;
1800
- if (getFunctionSettings(`${config.assets}/${assetName}`, config) != null) continue;
1801
- assets.push(`${config.assets}/${assetName}`);
1802
- }
1803
- return assets;
1844
+ const assetNames = yield* collectAssetFiles(projectFolder, config.assets);
1845
+ return assetNames.filter((assetName) => getFunctionSettings(`${config.assets}/${assetName}`, config) == null).map((assetName) => `${config.assets}/${assetName}`);
1804
1846
  });
1805
- var collectFilesRecursively = import_effect19.Effect.fn("collectFilesRecursively")(
1806
- function* (basePath, relativePath = "", depth = 0) {
1807
- if (depth > MAX_ASSET_DEPTH) return [];
1808
- const fs = yield* import_platform10.FileSystem.FileSystem;
1809
- const pathSvc = yield* import_platform10.Path.Path;
1810
- const currentPath = relativePath ? pathSvc.join(basePath, relativePath) : basePath;
1811
- const entries = yield* fs.readDirectory(currentPath).pipe(import_effect19.Effect.catchAll(() => import_effect19.Effect.succeed([])));
1812
- const result = [];
1813
- for (const name of entries) {
1814
- const fullPath = pathSvc.join(currentPath, name);
1815
- const entryRelative = relativePath ? pathSvc.join(relativePath, name) : name;
1816
- const stat = yield* fs.stat(fullPath).pipe(import_effect19.Effect.catchAll(() => import_effect19.Effect.succeed(null)));
1817
- if (!stat) continue;
1818
- if (stat.type === "Directory") {
1819
- const nested = yield* collectFilesRecursively(basePath, entryRelative, depth + 1);
1820
- result.push(...nested);
1821
- } else {
1822
- result.push(entryRelative);
1823
- }
1824
- }
1825
- return result;
1826
- }
1827
- );
1828
- var V4ConfigParser = class extends import_effect19.Effect.Service()("V4ConfigParser", {
1847
+ var V4ConfigParser = class extends import_effect20.Effect.Service()("V4ConfigParser", {
1829
1848
  accessors: true,
1830
- effect: import_effect19.Effect.succeed({
1849
+ effect: import_effect20.Effect.succeed({
1831
1850
  /**
1832
1851
  * Parses a ConfigV4 into a NormalizedConfig.
1833
1852
  *
1834
1853
  * @param config - The raw V4 config object
1835
1854
  * @param projectFolder - Absolute path to the project root
1836
1855
  */
1837
- parse: import_effect19.Effect.fn("V4ConfigParser.parse")(function* (config, projectFolder) {
1856
+ parse: import_effect20.Effect.fn("V4ConfigParser.parse")(function* (config, projectFolder) {
1838
1857
  const entrypoints = yield* parseEntrypoints(config, projectFolder);
1839
1858
  const assets = yield* collectAssets(config, projectFolder);
1840
1859
  return {
@@ -1889,7 +1908,7 @@ var deepMerge = (target, ...partials) => {
1889
1908
  };
1890
1909
 
1891
1910
  // src/services/vercel-build-output-parser.ts
1892
- var import_effect20 = require("effect");
1911
+ var import_effect21 = require("effect");
1893
1912
 
1894
1913
  // src/build-output-v3/determine-repo-root.ts
1895
1914
  var import_path = __toESM(require("path"));
@@ -1985,11 +2004,11 @@ var translateVercelRuntime = (runtime) => {
1985
2004
  var CONFIG_PATH = ".vercel/output/config.json";
1986
2005
  var FUNCTIONS_FOLDER = ".vercel/output/functions";
1987
2006
  var FUNCTION_CONFIGS_PATTERN = `${FUNCTIONS_FOLDER}/**/*.func/.vc-config.json`;
1988
- var VercelBuildOutputParser = class extends import_effect20.Effect.Service()("VercelBuildOutputParser", {
1989
- effect: import_effect20.Effect.gen(function* () {
2007
+ var VercelBuildOutputParser = class extends import_effect21.Effect.Service()("VercelBuildOutputParser", {
2008
+ effect: import_effect21.Effect.gen(function* () {
1990
2009
  const rawConfigReader = yield* RawConfigReader;
1991
2010
  const pathService = yield* import_platform11.Path.Path;
1992
- const parse = import_effect20.Effect.fn("VercelBuildOutputParser.parse")(function* (parseResult, projectFolder) {
2011
+ const parse = import_effect21.Effect.fn("VercelBuildOutputParser.parse")(function* (parseResult, projectFolder) {
1993
2012
  const config = yield* rawConfigReader.readConfigFile(pathService.join(projectFolder, CONFIG_PATH));
1994
2013
  if (!config || typeof config.version !== "number" || config.version < 3) {
1995
2014
  return parseResult;
@@ -2001,8 +2020,8 @@ var VercelBuildOutputParser = class extends import_effect20.Effect.Service()("Ve
2001
2020
  merged.regions = [...new Set(merged.regions)];
2002
2021
  return merged;
2003
2022
  });
2004
- const loadFunctions = import_effect20.Effect.fn("VercelBuildOutputParser.loadFunctions")(function* (config, parseResult, projectFolder) {
2005
- const functionConfigs = yield* import_effect20.Effect.tryPromise({
2023
+ const loadFunctions = import_effect21.Effect.fn("VercelBuildOutputParser.loadFunctions")(function* (config, parseResult, projectFolder) {
2024
+ const functionConfigs = yield* import_effect21.Effect.tryPromise({
2006
2025
  try: () => getFilesForPattern(FUNCTION_CONFIGS_PATTERN, projectFolder),
2007
2026
  catch: (error) => new ConfigFileParseError({
2008
2027
  message: `Failed to scan for function configs: ${error instanceof Error ? error.message : String(error)}`,
@@ -2601,7 +2620,7 @@ var schema_default = {
2601
2620
  };
2602
2621
 
2603
2622
  // src/parse-config.ts
2604
- var parseConfigRaw = import_effect21.Effect.fn("parseConfigRaw")(function* (filePath, projectFolder) {
2623
+ var parseConfigRaw = import_effect22.Effect.fn("parseConfigRaw")(function* (filePath, projectFolder) {
2605
2624
  const rawReader = yield* RawConfigReader;
2606
2625
  const validator = yield* SchemaValidator;
2607
2626
  const v4Parser = yield* V4ConfigParser;
@@ -2612,7 +2631,7 @@ var parseConfigRaw = import_effect21.Effect.fn("parseConfigRaw")(function* (file
2612
2631
  };
2613
2632
  const schema = schemaMap[version];
2614
2633
  if (!schema) {
2615
- return yield* import_effect21.Effect.fail(
2634
+ return yield* import_effect22.Effect.fail(
2616
2635
  new ConfigVersionError({
2617
2636
  message: `Config file at ${filePath} has an unsupported version: ${version}`,
2618
2637
  filePath,
@@ -2623,11 +2642,11 @@ var parseConfigRaw = import_effect21.Effect.fn("parseConfigRaw")(function* (file
2623
2642
  yield* validator.validate(parsed, schema, filePath);
2624
2643
  return yield* v4Parser.parse(parsed, projectFolder);
2625
2644
  });
2626
- var parseConfig = import_effect21.Effect.fn("parseConfig")(function* (filePath, projectFolder) {
2645
+ var parseConfig = import_effect22.Effect.fn("parseConfig")(function* (filePath, projectFolder) {
2627
2646
  const parseResult = yield* parseConfigRaw(filePath, projectFolder);
2628
2647
  return yield* postProcessConfig(parseResult, projectFolder);
2629
2648
  });
2630
- var postProcessConfig = import_effect21.Effect.fn("postProcessConfig")(function* (config, projectFolder) {
2649
+ var postProcessConfig = import_effect22.Effect.fn("postProcessConfig")(function* (config, projectFolder) {
2631
2650
  const vercelParser = yield* VercelBuildOutputParser;
2632
2651
  let result = yield* vercelParser.parse(config, projectFolder);
2633
2652
  const hasAssets = (result.assets?.paths?.length ?? 0) > 0 || (result.assets?.prefixes?.length ?? 0) > 0 || (result.assets?.manifests?.length ?? 0) > 0;
@@ -2656,14 +2675,14 @@ var RUNTIME_DEFINITIONS = [
2656
2675
  var AVAILABLE_RUNTIMES = [...RUNTIME_DEFINITIONS];
2657
2676
 
2658
2677
  // src/services/index.ts
2659
- var import_effect22 = require("effect");
2660
- var BaseLayers = import_effect22.Layer.mergeAll(
2678
+ var import_effect23 = require("effect");
2679
+ var BaseLayers = import_effect23.Layer.mergeAll(
2661
2680
  ConfigModuleLoader.Default,
2662
2681
  RawConfigReader.Default,
2663
2682
  SchemaValidator.Default,
2664
2683
  V4ConfigParser.Default
2665
2684
  );
2666
- var NetworkConfigLive = VercelBuildOutputParser.Default.pipe(import_effect22.Layer.provideMerge(BaseLayers));
2685
+ var NetworkConfigLive = VercelBuildOutputParser.Default.pipe(import_effect23.Layer.provideMerge(BaseLayers));
2667
2686
  // Annotate the CommonJS export names for ESM import in node:
2668
2687
  0 && (module.exports = {
2669
2688
  ALLOWED_CONFIG_NAMES,
@@ -2704,6 +2723,7 @@ var NetworkConfigLive = VercelBuildOutputParser.Default.pipe(import_effect22.Lay
2704
2723
  StaticAssetManifestV1Schema,
2705
2724
  V4ConfigParser,
2706
2725
  VercelBuildOutputParser,
2726
+ collectAssetFiles,
2707
2727
  defineConfig,
2708
2728
  detectFramework,
2709
2729
  detectPackageManager,