@gigadrive/network-config 5.1.0 → 5.2.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.mjs CHANGED
@@ -905,8 +905,8 @@ var detectContainerProject = Effect3.fn("detectContainerProject")(function* (pro
905
905
  });
906
906
 
907
907
  // src/detection/detect-framework.ts
908
- import { FileSystem as FileSystem11, Path as Path9 } from "@effect/platform";
909
- import { Effect as Effect13 } from "effect";
908
+ import { FileSystem as FileSystem12, Path as Path10 } from "@effect/platform";
909
+ import { Effect as Effect14 } from "effect";
910
910
 
911
911
  // src/detection/detect-package-manager.ts
912
912
  import { FileSystem as FileSystem4, Path as Path4 } from "@effect/platform";
@@ -955,6 +955,68 @@ var astro = {
955
955
  })
956
956
  };
957
957
 
958
+ // src/detection/frameworks/php-front-controller.ts
959
+ var phpFrontControllerDefaults = ({
960
+ documentRoot,
961
+ writablePaths = [],
962
+ excludeFiles = [],
963
+ memory = 256,
964
+ environmentVariables = {}
965
+ }) => {
966
+ const entrypoint = documentRoot === "." ? "index.php" : `${documentRoot}/index.php`;
967
+ return {
968
+ runtime: "php-84",
969
+ memory,
970
+ maxDuration: 30,
971
+ streaming: false,
972
+ commands: [],
973
+ entrypoint,
974
+ assetsDir: documentRoot,
975
+ excludeFiles: [".ddev", "node_modules/", ...excludeFiles],
976
+ routes: [{ source: "/*", destination: entrypoint }],
977
+ environmentVariables,
978
+ ...writablePaths.length > 0 ? { package: { writablePaths } } : {}
979
+ };
980
+ };
981
+
982
+ // src/detection/frameworks/cakephp.ts
983
+ var cakephp = {
984
+ slug: "cakephp",
985
+ name: "CakePHP",
986
+ language: "php",
987
+ detectors: [{ matchPackage: "cakephp/cakephp" }, { path: "webroot/index.php" }],
988
+ priority: 80,
989
+ getDefaultConfig: () => phpFrontControllerDefaults({
990
+ documentRoot: "webroot",
991
+ // config/paths.php puts TMP and LOGS inside the project.
992
+ writablePaths: [
993
+ "tmp/cache/models",
994
+ "tmp/cache/persistent",
995
+ "tmp/cache/views",
996
+ "tmp/sessions",
997
+ "tmp/tests",
998
+ "logs"
999
+ ],
1000
+ excludeFiles: ["tests/", "tmp/", "logs/"]
1001
+ })
1002
+ };
1003
+
1004
+ // src/detection/frameworks/codeigniter.ts
1005
+ var codeigniter = {
1006
+ slug: "codeigniter",
1007
+ name: "CodeIgniter",
1008
+ language: "php",
1009
+ detectors: [{ matchPackage: "codeigniter4/framework" }, { path: "spark" }],
1010
+ priority: 80,
1011
+ getDefaultConfig: () => phpFrontControllerDefaults({
1012
+ documentRoot: "public",
1013
+ // WRITEPATH: the cache, file session and log handlers write below it.
1014
+ writablePaths: ["writable/cache", "writable/debugbar", "writable/logs", "writable/session", "writable/uploads"],
1015
+ excludeFiles: ["tests/", "writable/"],
1016
+ environmentVariables: { CI_ENVIRONMENT: "production" }
1017
+ })
1018
+ };
1019
+
958
1020
  // src/detection/frameworks/resolve-node-entrypoint.ts
959
1021
  import { FileSystem as FileSystem5, Path as Path5 } from "@effect/platform";
960
1022
  import { Effect as Effect5 } from "effect";
@@ -1112,6 +1174,21 @@ var hono = {
1112
1174
  refineDefaultConfig: resolveNodeServerEntrypoint
1113
1175
  };
1114
1176
 
1177
+ // src/detection/frameworks/laminas.ts
1178
+ var laminas = {
1179
+ slug: "laminas",
1180
+ name: "Laminas MVC",
1181
+ language: "php",
1182
+ detectors: [{ matchPackage: "laminas/laminas-mvc" }, { path: "public/index.php" }],
1183
+ priority: 80,
1184
+ getDefaultConfig: () => phpFrontControllerDefaults({
1185
+ documentRoot: "public",
1186
+ // The merged-config and module-map caches of the skeleton.
1187
+ writablePaths: ["data/cache"],
1188
+ excludeFiles: ["test/", "data/cache/"]
1189
+ })
1190
+ };
1191
+
1115
1192
  // src/detection/frameworks/laravel.ts
1116
1193
  var laravel = {
1117
1194
  slug: "laravel",
@@ -1130,6 +1207,18 @@ var laravel = {
1130
1207
  populateAssetCache: true,
1131
1208
  excludeFiles: ["tests/", "storage/", ".ddev", "node_modules/"],
1132
1209
  routes: [{ source: "/*", destination: "public/index.php" }],
1210
+ package: {
1211
+ // storage/ is excluded, so the directories Laravel writes compiled
1212
+ // views, file caches, sessions and logs to are created empty.
1213
+ writablePaths: [
1214
+ "bootstrap/cache",
1215
+ "storage/app/public",
1216
+ "storage/framework/cache/data",
1217
+ "storage/framework/sessions",
1218
+ "storage/framework/views",
1219
+ "storage/logs"
1220
+ ]
1221
+ },
1133
1222
  environmentVariables: {
1134
1223
  APP_NAME: "Laravel",
1135
1224
  APP_ENV: "production",
@@ -1143,6 +1232,21 @@ var laravel = {
1143
1232
  })
1144
1233
  };
1145
1234
 
1235
+ // src/detection/frameworks/mezzio.ts
1236
+ var mezzio = {
1237
+ slug: "mezzio",
1238
+ name: "Mezzio",
1239
+ language: "php",
1240
+ detectors: [{ matchPackage: "mezzio/mezzio" }, { path: "public/index.php" }],
1241
+ priority: 80,
1242
+ getDefaultConfig: () => phpFrontControllerDefaults({
1243
+ documentRoot: "public",
1244
+ // config/config.php writes the merged config cache here.
1245
+ writablePaths: ["data/cache"],
1246
+ excludeFiles: ["test/", "data/cache/"]
1247
+ })
1248
+ };
1249
+
1146
1250
  // src/detection/frameworks/nestjs.ts
1147
1251
  import { FileSystem as FileSystem6 } from "@effect/platform";
1148
1252
  import { Effect as Effect6 } from "effect";
@@ -1746,6 +1850,43 @@ var nuxt = {
1746
1850
  })
1747
1851
  };
1748
1852
 
1853
+ // src/detection/frameworks/php.ts
1854
+ import { FileSystem as FileSystem10, Path as Path8 } from "@effect/platform";
1855
+ import { Effect as Effect10 } from "effect";
1856
+ var COMPOSER_FILES = ["composer.json", "composer.lock"];
1857
+ var DOCUMENT_ROOTS = ["public", "web", "webroot", "public_html", "htdocs", "."];
1858
+ var refinePhpDocumentRoot = (defaults, projectFolder) => Effect10.gen(function* () {
1859
+ const fs = yield* FileSystem10.FileSystem;
1860
+ const pathService = yield* Path8.Path;
1861
+ for (const documentRoot of DOCUMENT_ROOTS) {
1862
+ const frontController = pathService.join(projectFolder, documentRoot, "index.php");
1863
+ if (yield* fs.exists(frontController).pipe(Effect10.catchAll(() => Effect10.succeed(false)))) {
1864
+ return phpFrontControllerDefaults({ documentRoot, excludeFiles: COMPOSER_FILES });
1865
+ }
1866
+ }
1867
+ return defaults;
1868
+ });
1869
+ var getDefaultConfig = () => phpFrontControllerDefaults({ documentRoot: ".", excludeFiles: COMPOSER_FILES });
1870
+ var frontControllerPath = (documentRoot) => documentRoot === "." ? "index.php" : `${documentRoot}/index.php`;
1871
+ var phpComposerProjects = DOCUMENT_ROOTS.map((documentRoot) => ({
1872
+ slug: "php",
1873
+ name: "PHP",
1874
+ language: "php",
1875
+ detectors: [{ path: "composer.json" }, { path: frontControllerPath(documentRoot) }],
1876
+ priority: 7,
1877
+ getDefaultConfig,
1878
+ refineDefaultConfig: refinePhpDocumentRoot
1879
+ }));
1880
+ var phpSites = DOCUMENT_ROOTS.map((documentRoot) => ({
1881
+ slug: "php-site",
1882
+ name: "PHP",
1883
+ language: "php",
1884
+ detectors: [{ path: frontControllerPath(documentRoot) }],
1885
+ priority: 6,
1886
+ getDefaultConfig: () => ({ ...getDefaultConfig(), installCommand: "" }),
1887
+ refineDefaultConfig: (defaults, projectFolder) => refinePhpDocumentRoot(defaults, projectFolder).pipe(Effect10.map((refined) => ({ ...refined, installCommand: "" })))
1888
+ }));
1889
+
1749
1890
  // src/detection/frameworks/remix.ts
1750
1891
  var remix = {
1751
1892
  slug: "remix",
@@ -1767,6 +1908,21 @@ var remix = {
1767
1908
  })
1768
1909
  };
1769
1910
 
1911
+ // src/detection/frameworks/slim.ts
1912
+ var slim = {
1913
+ slug: "slim",
1914
+ name: "Slim",
1915
+ language: "php",
1916
+ detectors: [{ matchPackage: "slim/slim" }, { path: "public/index.php" }],
1917
+ priority: 75,
1918
+ getDefaultConfig: () => phpFrontControllerDefaults({
1919
+ documentRoot: "public",
1920
+ // slim/slim-skeleton logs to logs/ and caches the container and routes in var/cache.
1921
+ writablePaths: ["logs", "var/cache"],
1922
+ excludeFiles: ["tests/", "logs/", "var/"]
1923
+ })
1924
+ };
1925
+
1770
1926
  // src/detection/frameworks/sveltekit.ts
1771
1927
  var sveltekit = {
1772
1928
  slug: "sveltekit",
@@ -1806,12 +1962,13 @@ var symfony = {
1806
1962
  assetsDir: "public",
1807
1963
  populateAssetCache: true,
1808
1964
  excludeFiles: ["tests/*", ".ddev", "var"],
1809
- symlinks: { var: "/tmp" },
1810
1965
  routes: [{ source: "/*", destination: "public/index.php" }],
1966
+ // The kernel's cache and log directories. A symlink to /tmp used to stand
1967
+ // in for them, which the build rejected as pointing outside the project.
1968
+ package: { writablePaths: ["var/cache", "var/log"] },
1811
1969
  environmentVariables: {
1812
1970
  APP_ENV: "prod",
1813
1971
  APP_DEBUG: "false",
1814
- APP_SECRET: "please_change_this_value_in_your_settings",
1815
1972
  MESSENGER_TRANSPORT_DSN: "doctrine://default?auto_setup=0"
1816
1973
  }
1817
1974
  })
@@ -1837,6 +1994,22 @@ var vite = {
1837
1994
  })
1838
1995
  };
1839
1996
 
1997
+ // src/detection/frameworks/yii.ts
1998
+ var yii = {
1999
+ slug: "yii",
2000
+ name: "Yii 2",
2001
+ language: "php",
2002
+ detectors: [{ matchPackage: "yiisoft/yii2" }, { path: "web/index.php" }],
2003
+ priority: 80,
2004
+ getDefaultConfig: () => phpFrontControllerDefaults({
2005
+ documentRoot: "web",
2006
+ // @runtime holds cache, logs and sessions; the asset manager publishes
2007
+ // bundles from vendor/ into web/assets when a page first uses them.
2008
+ writablePaths: ["runtime", "web/assets"],
2009
+ excludeFiles: ["tests/", "runtime/", "web/assets/"]
2010
+ })
2011
+ };
2012
+
1840
2013
  // src/detection/frameworks/index.ts
1841
2014
  var FRAMEWORK_DEFINITIONS = [
1842
2015
  nextjs,
@@ -1847,15 +2020,23 @@ var FRAMEWORK_DEFINITIONS = [
1847
2020
  astro,
1848
2021
  laravel,
1849
2022
  symfony,
2023
+ cakephp,
2024
+ codeigniter,
2025
+ laminas,
2026
+ mezzio,
2027
+ yii,
2028
+ slim,
1850
2029
  hono,
1851
2030
  elysia,
1852
2031
  fastify,
1853
2032
  express,
2033
+ ...phpComposerProjects,
2034
+ ...phpSites,
1854
2035
  vite
1855
2036
  ].sort((a, b) => b.priority - a.priority);
1856
2037
 
1857
2038
  // src/detection/generate-config.ts
1858
- import { Effect as Effect10 } from "effect";
2039
+ import { Effect as Effect11 } from "effect";
1859
2040
  var getInstallCommand = (pm) => {
1860
2041
  switch (pm) {
1861
2042
  case "bun":
@@ -1871,11 +2052,16 @@ var getInstallCommand = (pm) => {
1871
2052
  return "npm install";
1872
2053
  }
1873
2054
  };
1874
- var generateConfig = Effect10.fn("generateConfig")(function* (framework, packageManager, projectFolder, refinedDefaults) {
2055
+ var COMPOSER_ROOT_FILES = /* @__PURE__ */ new Set(["composer.json", "composer.lock", "auth.json"]);
2056
+ var isPrivatePhpProjectFile = (projectPath) => {
2057
+ const segments = projectPath.split("/").filter((segment) => segment !== "" && segment !== ".");
2058
+ return segments.some((segment) => segment.startsWith(".")) || segments[0] === "vendor" || segments[0] === "node_modules" || segments.length === 1 && COMPOSER_ROOT_FILES.has(segments[0] ?? "");
2059
+ };
2060
+ var generateConfig = Effect11.fn("generateConfig")(function* (framework, packageManager, projectFolder, refinedDefaults) {
1875
2061
  const defaults = refinedDefaults ?? framework.getDefaultConfig(packageManager);
1876
2062
  const installCmd = defaults.installCommand ?? getInstallCommand(packageManager);
1877
- const commands = [installCmd, ...defaults.commands];
1878
- yield* Effect10.logDebug(`Generating config for ${framework.name}`, {
2063
+ const commands = installCmd ? [installCmd, ...defaults.commands] : [...defaults.commands];
2064
+ yield* Effect11.logDebug(`Generating config for ${framework.name}`, {
1879
2065
  runtime: defaults.runtime,
1880
2066
  entrypoint: defaults.entrypoint,
1881
2067
  commands
@@ -1917,6 +2103,7 @@ var generateConfig = Effect10.fn("generateConfig")(function* (framework, package
1917
2103
  if (assetsDir && !defaults.assetPaths && !defaults.assetPrefixes && !defaults.assetManifests) {
1918
2104
  for (const file of yield* collectAssetFiles(projectFolder, assetsDir)) {
1919
2105
  if (framework.language === "php" && /\.(php|phtml|phar)$/i.test(file)) continue;
2106
+ if (framework.language === "php" && isPrivatePhpProjectFile(`${assetsDir}/${file}`)) continue;
1920
2107
  paths.push(`${assetsDir}/${file}`);
1921
2108
  if (!servesDirectoryIndexes || file in overrides) continue;
1922
2109
  if (file === "index.html") {
@@ -1940,8 +2127,8 @@ var generateConfig = Effect10.fn("generateConfig")(function* (framework, package
1940
2127
  });
1941
2128
 
1942
2129
  // src/detection/read-dependencies.ts
1943
- import { FileSystem as FileSystem10, Path as Path8 } from "@effect/platform";
1944
- import { Effect as Effect12 } from "effect";
2130
+ import { FileSystem as FileSystem11, Path as Path9 } from "@effect/platform";
2131
+ import { Effect as Effect13 } from "effect";
1945
2132
 
1946
2133
  // src/detection/types.ts
1947
2134
  import { Schema as Schema5 } from "effect";
@@ -1974,25 +2161,25 @@ var MANIFEST_CONFIG = {
1974
2161
  node: { file: "package.json", depKeys: ["dependencies", "devDependencies"] },
1975
2162
  php: { file: "composer.json", depKeys: ["require", "require-dev"] }
1976
2163
  };
1977
- var readManifest = Effect12.fn("readManifest")(function* (filePath) {
1978
- const fs = yield* FileSystem10.FileSystem;
1979
- const exists = yield* fs.exists(filePath).pipe(Effect12.catchAll(() => Effect12.succeed(false)));
2164
+ var readManifest = Effect13.fn("readManifest")(function* (filePath) {
2165
+ const fs = yield* FileSystem11.FileSystem;
2166
+ const exists = yield* fs.exists(filePath).pipe(Effect13.catchAll(() => Effect13.succeed(false)));
1980
2167
  if (!exists) {
1981
- return yield* Effect12.fail(new ManifestNotFoundError({ message: "Manifest not found", filePath }));
2168
+ return yield* Effect13.fail(new ManifestNotFoundError({ message: "Manifest not found", filePath }));
1982
2169
  }
1983
- const content = yield* fs.readFileString(filePath).pipe(Effect12.mapError(() => new ManifestReadError({ message: "Failed to read manifest", filePath })));
1984
- const parsed = yield* Effect12.try({
2170
+ const content = yield* fs.readFileString(filePath).pipe(Effect13.mapError(() => new ManifestReadError({ message: "Failed to read manifest", filePath })));
2171
+ const parsed = yield* Effect13.try({
1985
2172
  try: () => JSON.parse(content),
1986
2173
  catch: () => new ManifestParseError({ message: "Failed to parse manifest JSON", filePath })
1987
2174
  });
1988
2175
  return parsed;
1989
2176
  });
1990
- var readDependencies = Effect12.fn("readDependencies")(function* (projectFolder, language) {
1991
- const pathService = yield* Path8.Path;
2177
+ var readDependencies = Effect13.fn("readDependencies")(function* (projectFolder, language) {
2178
+ const pathService = yield* Path9.Path;
1992
2179
  const config = MANIFEST_CONFIG[language];
1993
2180
  const filePath = pathService.join(projectFolder, config.file);
1994
2181
  const manifest = yield* readManifest(filePath).pipe(
1995
- Effect12.catchTag("ManifestNotFoundError", () => Effect12.succeed(null))
2182
+ Effect13.catchTag("ManifestNotFoundError", () => Effect13.succeed(null))
1996
2183
  );
1997
2184
  if (!manifest) {
1998
2185
  return /* @__PURE__ */ new Set();
@@ -2010,9 +2197,9 @@ var readDependencies = Effect12.fn("readDependencies")(function* (projectFolder,
2010
2197
  });
2011
2198
 
2012
2199
  // src/detection/detect-framework.ts
2013
- var matchesDetectionItem = Effect13.fn("matchesDetectionItem")(function* (item, projectFolder, framework, cachedReadDeps) {
2014
- const fs = yield* FileSystem11.FileSystem;
2015
- const pathService = yield* Path9.Path;
2200
+ var matchesDetectionItem = Effect14.fn("matchesDetectionItem")(function* (item, projectFolder, framework, cachedReadDeps) {
2201
+ const fs = yield* FileSystem12.FileSystem;
2202
+ const pathService = yield* Path10.Path;
2016
2203
  if (item.matchPackage != null) {
2017
2204
  const deps = yield* cachedReadDeps(`${projectFolder}\0${framework.language}`);
2018
2205
  if (!deps.has(item.matchPackage)) {
@@ -2021,12 +2208,12 @@ var matchesDetectionItem = Effect13.fn("matchesDetectionItem")(function* (item,
2021
2208
  }
2022
2209
  if (item.path != null) {
2023
2210
  const filePath = pathService.join(projectFolder, item.path);
2024
- const exists = yield* fs.exists(filePath).pipe(Effect13.catchAll(() => Effect13.succeed(false)));
2211
+ const exists = yield* fs.exists(filePath).pipe(Effect14.catchAll(() => Effect14.succeed(false)));
2025
2212
  if (!exists) {
2026
2213
  return false;
2027
2214
  }
2028
2215
  if (item.matchContent != null) {
2029
- const content = yield* fs.readFileString(filePath).pipe(Effect13.catchAll(() => Effect13.succeed("")));
2216
+ const content = yield* fs.readFileString(filePath).pipe(Effect14.catchAll(() => Effect14.succeed("")));
2030
2217
  let regexMatch = false;
2031
2218
  try {
2032
2219
  regexMatch = new RegExp(item.matchContent).test(content);
@@ -2039,7 +2226,7 @@ var matchesDetectionItem = Effect13.fn("matchesDetectionItem")(function* (item,
2039
2226
  }
2040
2227
  return true;
2041
2228
  });
2042
- var matchesFramework = Effect13.fn("matchesFramework")(function* (framework, projectFolder, cachedReadDeps) {
2229
+ var matchesFramework = Effect14.fn("matchesFramework")(function* (framework, projectFolder, cachedReadDeps) {
2043
2230
  for (const detector of framework.detectors) {
2044
2231
  const matches = yield* matchesDetectionItem(detector, projectFolder, framework, cachedReadDeps);
2045
2232
  if (!matches) {
@@ -2048,9 +2235,9 @@ var matchesFramework = Effect13.fn("matchesFramework")(function* (framework, pro
2048
2235
  }
2049
2236
  return true;
2050
2237
  });
2051
- var detectFramework = Effect13.fn("detectFramework")(function* (projectFolder) {
2052
- yield* Effect13.logDebug(`Detecting framework in ${projectFolder}`);
2053
- const cachedReadDeps = yield* Effect13.cachedFunction((key) => {
2238
+ var detectFramework = Effect14.fn("detectFramework")(function* (projectFolder) {
2239
+ yield* Effect14.logDebug(`Detecting framework in ${projectFolder}`);
2240
+ const cachedReadDeps = yield* Effect14.cachedFunction((key) => {
2054
2241
  const sepIndex = key.lastIndexOf("\0");
2055
2242
  const folder = key.slice(0, sepIndex);
2056
2243
  const language = key.slice(sepIndex + 1);
@@ -2059,7 +2246,7 @@ var detectFramework = Effect13.fn("detectFramework")(function* (projectFolder) {
2059
2246
  for (const framework of FRAMEWORK_DEFINITIONS) {
2060
2247
  const matches = yield* matchesFramework(framework, projectFolder, cachedReadDeps);
2061
2248
  if (matches) {
2062
- yield* Effect13.log(`Detected framework: ${framework.name}`, { slug: framework.slug });
2249
+ yield* Effect14.log(`Detected framework: ${framework.name}`, { slug: framework.slug });
2063
2250
  const detectedPackageManager = yield* detectPackageManager(projectFolder);
2064
2251
  const packageManager = framework.language === "php" ? "composer" : detectedPackageManager;
2065
2252
  const defaults = framework.getDefaultConfig(packageManager);
@@ -2068,7 +2255,7 @@ var detectFramework = Effect13.fn("detectFramework")(function* (projectFolder) {
2068
2255
  return { framework, packageManager, config };
2069
2256
  }
2070
2257
  }
2071
- return yield* Effect13.fail(
2258
+ return yield* Effect14.fail(
2072
2259
  new FrameworkNotDetectedError({
2073
2260
  message: `No framework detected in project directory`,
2074
2261
  directory: projectFolder
@@ -2077,9 +2264,9 @@ var detectFramework = Effect13.fn("detectFramework")(function* (projectFolder) {
2077
2264
  });
2078
2265
 
2079
2266
  // src/detection/merge-config.ts
2080
- import { Effect as Effect14 } from "effect";
2081
- var mergeWithFrameworkDefaults = Effect14.fn("mergeWithFrameworkDefaults")(function* (userConfig, frameworkConfig) {
2082
- yield* Effect14.logDebug("Merging user config with framework defaults");
2267
+ import { Effect as Effect15 } from "effect";
2268
+ var mergeWithFrameworkDefaults = Effect15.fn("mergeWithFrameworkDefaults")(function* (userConfig, frameworkConfig) {
2269
+ yield* Effect15.logDebug("Merging user config with framework defaults");
2083
2270
  const userHasAssets = (userConfig.assets?.paths?.length ?? 0) > 0 || (userConfig.assets?.prefixes?.length ?? 0) > 0 || (userConfig.assets?.manifests?.length ?? 0) > 0;
2084
2271
  const isContainer = (entrypoint) => entrypoint.runtime === CONTAINER_RUNTIME;
2085
2272
  const userFileFunctions = userConfig.entrypoints.filter((entrypoint) => !isContainer(entrypoint));
@@ -2120,23 +2307,23 @@ var filterFunctionsFromAssets = (config) => {
2120
2307
  };
2121
2308
 
2122
2309
  // src/parse-config.ts
2123
- import { Effect as Effect20 } from "effect";
2310
+ import { Effect as Effect21 } from "effect";
2124
2311
 
2125
2312
  // src/services/raw-config-reader.ts
2126
- import { FileSystem as FileSystem12, Path as Path10 } from "@effect/platform";
2127
- import { Effect as Effect16 } from "effect";
2313
+ import { FileSystem as FileSystem13, Path as Path11 } from "@effect/platform";
2314
+ import { Effect as Effect17 } from "effect";
2128
2315
  import { parse as parseYaml2 } from "yaml";
2129
2316
 
2130
2317
  // src/services/config-module-loader.ts
2131
- import { Effect as Effect15 } from "effect";
2318
+ import { Effect as Effect16 } from "effect";
2132
2319
  import { createJiti } from "jiti";
2133
2320
  var MISSING_DEFAULT_EXPORT = /* @__PURE__ */ Symbol("MissingDefaultExport");
2134
2321
  var STRICT_DEFAULT_EXPORT_EXTENSIONS = [".ts", ".mts", ".mjs"];
2135
- var ConfigModuleLoader = class extends Effect15.Service()("ConfigModuleLoader", {
2136
- effect: Effect15.gen(function* () {
2137
- const loadConfigModule = Effect15.fn("ConfigModuleLoader.loadConfigModule")(function* (filePath) {
2322
+ var ConfigModuleLoader = class extends Effect16.Service()("ConfigModuleLoader", {
2323
+ effect: Effect16.gen(function* () {
2324
+ const loadConfigModule = Effect16.fn("ConfigModuleLoader.loadConfigModule")(function* (filePath) {
2138
2325
  const extension = filePath.slice(filePath.lastIndexOf(".")).toLowerCase();
2139
- const mod = yield* Effect15.tryPromise({
2326
+ const mod = yield* Effect16.tryPromise({
2140
2327
  try: async () => {
2141
2328
  const jiti = createJiti(filePath, { fsCache: false, interopDefault: true, moduleCache: false });
2142
2329
  const namespace = await jiti.import(filePath);
@@ -2155,7 +2342,7 @@ var ConfigModuleLoader = class extends Effect15.Service()("ConfigModuleLoader",
2155
2342
  })
2156
2343
  });
2157
2344
  if (mod === MISSING_DEFAULT_EXPORT) {
2158
- return yield* Effect15.fail(
2345
+ return yield* Effect16.fail(
2159
2346
  new ConfigModuleLoadError({
2160
2347
  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.`,
2161
2348
  filePath
@@ -2163,7 +2350,7 @@ var ConfigModuleLoader = class extends Effect15.Service()("ConfigModuleLoader",
2163
2350
  );
2164
2351
  }
2165
2352
  if (typeof mod === "function") {
2166
- return yield* Effect15.fail(
2353
+ return yield* Effect16.fail(
2167
2354
  new ConfigModuleLoadError({
2168
2355
  message: `Config module at ${filePath} default-exports a function; config factories are not supported. Export a config object instead (optionally wrapped in defineConfig).`,
2169
2356
  filePath
@@ -2171,7 +2358,7 @@ var ConfigModuleLoader = class extends Effect15.Service()("ConfigModuleLoader",
2171
2358
  );
2172
2359
  }
2173
2360
  if (typeof mod !== "object" || mod === null || Array.isArray(mod)) {
2174
- return yield* Effect15.fail(
2361
+ return yield* Effect16.fail(
2175
2362
  new ConfigModuleLoadError({
2176
2363
  message: `Config module at ${filePath} must default-export a config object.`,
2177
2364
  filePath
@@ -2201,36 +2388,36 @@ var ALLOWED_CONFIG_NAMES = [
2201
2388
  "nebula.json"
2202
2389
  ];
2203
2390
  var MODULE_EXTENSIONS = [".ts", ".mts", ".cts", ".js", ".mjs", ".cjs"];
2204
- var RawConfigReader = class extends Effect16.Service()("RawConfigReader", {
2391
+ var RawConfigReader = class extends Effect17.Service()("RawConfigReader", {
2205
2392
  dependencies: [ConfigModuleLoader.Default],
2206
- effect: Effect16.gen(function* () {
2207
- const fs = yield* FileSystem12.FileSystem;
2208
- const pathService = yield* Path10.Path;
2393
+ effect: Effect17.gen(function* () {
2394
+ const fs = yield* FileSystem13.FileSystem;
2395
+ const pathService = yield* Path11.Path;
2209
2396
  const moduleLoader = yield* ConfigModuleLoader;
2210
- const findConfig = Effect16.fn("RawConfigReader.findConfig")(function* (projectFolder) {
2397
+ const findConfig = Effect17.fn("RawConfigReader.findConfig")(function* (projectFolder) {
2211
2398
  for (const name of ALLOWED_CONFIG_NAMES) {
2212
2399
  const filePath = pathService.join(projectFolder, name);
2213
- const exists = yield* fs.exists(filePath).pipe(Effect16.catchAll(() => Effect16.succeed(false)));
2400
+ const exists = yield* fs.exists(filePath).pipe(Effect17.catchAll(() => Effect17.succeed(false)));
2214
2401
  if (exists) {
2215
2402
  return filePath;
2216
2403
  }
2217
2404
  }
2218
2405
  return null;
2219
2406
  });
2220
- const readRawConfig = Effect16.fn("RawConfigReader.readRawConfig")(function* (filePath, options) {
2221
- const exists = yield* fs.exists(filePath).pipe(Effect16.catchAll(() => Effect16.succeed(false)));
2407
+ const readRawConfig = Effect17.fn("RawConfigReader.readRawConfig")(function* (filePath, options) {
2408
+ const exists = yield* fs.exists(filePath).pipe(Effect17.catchAll(() => Effect17.succeed(false)));
2222
2409
  if (!exists) {
2223
- return yield* Effect16.fail(
2410
+ return yield* Effect17.fail(
2224
2411
  new ConfigFileNotFoundError({ message: `Config file not found at ${filePath}`, filePath })
2225
2412
  );
2226
2413
  }
2227
2414
  const fileContents = yield* fs.readFileString(filePath).pipe(
2228
- Effect16.mapError(
2415
+ Effect17.mapError(
2229
2416
  () => new ConfigFileParseError({ message: `Failed to read config file at ${filePath}`, filePath })
2230
2417
  )
2231
2418
  );
2232
2419
  if (fileContents.length === 0) {
2233
- return yield* Effect16.fail(
2420
+ return yield* Effect17.fail(
2234
2421
  new ConfigFileEmptyError({ message: `Config file is empty at ${filePath}`, filePath })
2235
2422
  );
2236
2423
  }
@@ -2246,7 +2433,7 @@ var RawConfigReader = class extends Effect16.Service()("RawConfigReader", {
2246
2433
  parsed = parseYaml2(fileContents);
2247
2434
  }
2248
2435
  } catch (error) {
2249
- return yield* Effect16.fail(
2436
+ return yield* Effect17.fail(
2250
2437
  new ConfigFileParseError({
2251
2438
  message: `Failed to parse config file at ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`,
2252
2439
  filePath,
@@ -2256,21 +2443,21 @@ var RawConfigReader = class extends Effect16.Service()("RawConfigReader", {
2256
2443
  }
2257
2444
  }
2258
2445
  if (parsed == null) {
2259
- return yield* Effect16.fail(
2446
+ return yield* Effect17.fail(
2260
2447
  new ConfigFileParseError({ message: `Config file could not be parsed at ${filePath}`, filePath })
2261
2448
  );
2262
2449
  }
2263
2450
  if (!options?.disableVersionCheck && typeof parsed.version !== "number") {
2264
- return yield* Effect16.fail(
2451
+ return yield* Effect17.fail(
2265
2452
  new ConfigVersionError({ message: `Config file is missing version at ${filePath}`, filePath })
2266
2453
  );
2267
2454
  }
2268
2455
  return parsed;
2269
2456
  });
2270
2457
  const readConfigFile = (configFilePath) => readRawConfig(configFilePath, { disableVersionCheck: true }).pipe(
2271
- Effect16.map((parsed) => parsed),
2272
- Effect16.catchTag("ConfigFileNotFoundError", () => Effect16.succeed(null)),
2273
- Effect16.withSpan("RawConfigReader.readConfigFile")
2458
+ Effect17.map((parsed) => parsed),
2459
+ Effect17.catchTag("ConfigFileNotFoundError", () => Effect17.succeed(null)),
2460
+ Effect17.withSpan("RawConfigReader.readConfigFile")
2274
2461
  );
2275
2462
  return { findConfig, readRawConfig, readConfigFile };
2276
2463
  })
@@ -2280,17 +2467,17 @@ var RawConfigReader = class extends Effect16.Service()("RawConfigReader", {
2280
2467
  // src/services/schema-validator.ts
2281
2468
  import Ajv from "ajv";
2282
2469
  import addFormats from "ajv-formats";
2283
- import { Effect as Effect17 } from "effect";
2284
- var SchemaValidator = class extends Effect17.Service()("SchemaValidator", {
2285
- effect: Effect17.gen(function* () {
2470
+ import { Effect as Effect18 } from "effect";
2471
+ var SchemaValidator = class extends Effect18.Service()("SchemaValidator", {
2472
+ effect: Effect18.gen(function* () {
2286
2473
  const ajv = new Ajv();
2287
2474
  addFormats(ajv);
2288
- const validate = Effect17.fn("SchemaValidator.validate")(function* (config, schema, filePath) {
2475
+ const validate = Effect18.fn("SchemaValidator.validate")(function* (config, schema, filePath) {
2289
2476
  const compiledValidate = ajv.compile(schema);
2290
2477
  const valid = compiledValidate(config);
2291
2478
  if (!valid) {
2292
2479
  const errors = compiledValidate.errors?.map((e) => `${e.instancePath || "/"} ${e.message ?? ""}`.trim()) ?? [];
2293
- return yield* Effect17.fail(
2480
+ return yield* Effect18.fail(
2294
2481
  new ConfigSchemaValidationError({
2295
2482
  message: `Config file at ${filePath} is invalid: ${ajv.errorsText(compiledValidate.errors)}`,
2296
2483
  filePath,
@@ -2346,7 +2533,7 @@ var getFilesForPattern = async (pattern, projectFolder, excludeFiles = []) => {
2346
2533
  };
2347
2534
 
2348
2535
  // src/services/v4-config-parser.ts
2349
- import { Effect as Effect18 } from "effect";
2536
+ import { Effect as Effect19 } from "effect";
2350
2537
  import { minimatch as minimatch2 } from "minimatch";
2351
2538
  import { posix as posix2 } from "path";
2352
2539
  import safeRegex from "safe-regex2";
@@ -2497,7 +2684,7 @@ var mapRoute = (route, entrypoints) => ({
2497
2684
  negativeRequirements: route.missing,
2498
2685
  status: route.statusCode
2499
2686
  });
2500
- var parseEntrypoints = Effect18.fn("parseEntrypoints")(function* (config, projectFolder) {
2687
+ var parseEntrypoints = Effect19.fn("parseEntrypoints")(function* (config, projectFolder) {
2501
2688
  const entrypoints = [];
2502
2689
  const dockerFunctions = [];
2503
2690
  if (config.functions == null) return { entrypoints, dockerFunctions };
@@ -2508,7 +2695,7 @@ var parseEntrypoints = Effect18.fn("parseEntrypoints")(function* (config, projec
2508
2695
  functionPath: fnPath
2509
2696
  });
2510
2697
  }
2511
- const matchedFiles = yield* Effect18.tryPromise({
2698
+ const matchedFiles = yield* Effect19.tryPromise({
2512
2699
  try: () => getFilesForPattern(fnPath, projectFolder, func.excludeFiles),
2513
2700
  catch: (error) => new FunctionConfigError({
2514
2701
  message: `Failed to resolve files for function pattern '${fnPath}': ${error instanceof Error ? error.message : String(error)}`,
@@ -2583,13 +2770,13 @@ var parseEntrypoints = Effect18.fn("parseEntrypoints")(function* (config, projec
2583
2770
  }
2584
2771
  return { entrypoints, dockerFunctions };
2585
2772
  });
2586
- var collectAssets = Effect18.fn("collectAssets")(function* (config, projectFolder) {
2773
+ var collectAssets = Effect19.fn("collectAssets")(function* (config, projectFolder) {
2587
2774
  if (config.assets == null) return [];
2588
2775
  const assetNames = yield* collectAssetFiles(projectFolder, config.assets);
2589
2776
  return assetNames.filter((assetName) => getFunctionSettings(`${config.assets}/${assetName}`, config) == null).map((assetName) => `${config.assets}/${assetName}`);
2590
2777
  });
2591
2778
  var reservedRuntimePorts = (entrypoint) => entrypoint.runtime === CONTAINER_RUNTIME ? [] : entrypoint.runtime.startsWith("php-") ? [8080, 9e3] : [8080];
2592
- var parseContainers = Effect18.fn("parseContainers")(function* (config, projectFolder, fileEntrypoints, dockerFunctions) {
2779
+ var parseContainers = Effect19.fn("parseContainers")(function* (config, projectFolder, fileEntrypoints, dockerFunctions) {
2593
2780
  const warnings = [];
2594
2781
  let containers = {};
2595
2782
  if (config.compose != null) {
@@ -2622,16 +2809,16 @@ var parseContainers = Effect18.fn("parseContainers")(function* (config, projectF
2622
2809
  }
2623
2810
  return { ...result, warnings };
2624
2811
  });
2625
- var V4ConfigParser = class extends Effect18.Service()("V4ConfigParser", {
2812
+ var V4ConfigParser = class extends Effect19.Service()("V4ConfigParser", {
2626
2813
  accessors: true,
2627
- effect: Effect18.succeed({
2814
+ effect: Effect19.succeed({
2628
2815
  /**
2629
2816
  * Parses a ConfigV4 into a NormalizedConfig.
2630
2817
  *
2631
2818
  * @param config - The raw V4 config object
2632
2819
  * @param projectFolder - Absolute path to the project root
2633
2820
  */
2634
- parse: Effect18.fn("V4ConfigParser.parse")(function* (config, projectFolder) {
2821
+ parse: Effect19.fn("V4ConfigParser.parse")(function* (config, projectFolder) {
2635
2822
  const { entrypoints: fileEntrypoints, dockerFunctions } = yield* parseEntrypoints(config, projectFolder);
2636
2823
  const containers = yield* parseContainers(config, projectFolder, fileEntrypoints, dockerFunctions);
2637
2824
  const entrypoints = [...fileEntrypoints, ...containers.entrypoints];
@@ -2673,7 +2860,7 @@ var V4ConfigParser = class extends Effect18.Service()("V4ConfigParser", {
2673
2860
  };
2674
2861
 
2675
2862
  // src/services/vercel-build-output-parser.ts
2676
- import { Path as Path11 } from "@effect/platform";
2863
+ import { Path as Path12 } from "@effect/platform";
2677
2864
 
2678
2865
  // ../commons/src/deep-merge.ts
2679
2866
  var deepMerge = (target, ...partials) => {
@@ -2702,7 +2889,7 @@ var deepMerge = (target, ...partials) => {
2702
2889
  };
2703
2890
 
2704
2891
  // src/services/vercel-build-output-parser.ts
2705
- import { Effect as Effect19 } from "effect";
2892
+ import { Effect as Effect20 } from "effect";
2706
2893
 
2707
2894
  // src/build-output-v3/determine-repo-root.ts
2708
2895
  import path from "path";
@@ -2798,11 +2985,11 @@ var translateVercelRuntime = (runtime) => {
2798
2985
  var CONFIG_PATH = ".vercel/output/config.json";
2799
2986
  var FUNCTIONS_FOLDER = ".vercel/output/functions";
2800
2987
  var FUNCTION_CONFIGS_PATTERN = `${FUNCTIONS_FOLDER}/**/*.func/.vc-config.json`;
2801
- var VercelBuildOutputParser = class extends Effect19.Service()("VercelBuildOutputParser", {
2802
- effect: Effect19.gen(function* () {
2988
+ var VercelBuildOutputParser = class extends Effect20.Service()("VercelBuildOutputParser", {
2989
+ effect: Effect20.gen(function* () {
2803
2990
  const rawConfigReader = yield* RawConfigReader;
2804
- const pathService = yield* Path11.Path;
2805
- const parse = Effect19.fn("VercelBuildOutputParser.parse")(function* (parseResult, projectFolder) {
2991
+ const pathService = yield* Path12.Path;
2992
+ const parse = Effect20.fn("VercelBuildOutputParser.parse")(function* (parseResult, projectFolder) {
2806
2993
  const config = yield* rawConfigReader.readConfigFile(pathService.join(projectFolder, CONFIG_PATH));
2807
2994
  if (!config || typeof config.version !== "number" || config.version < 3) {
2808
2995
  return parseResult;
@@ -2814,8 +3001,8 @@ var VercelBuildOutputParser = class extends Effect19.Service()("VercelBuildOutpu
2814
3001
  merged.regions = [...new Set(merged.regions)];
2815
3002
  return merged;
2816
3003
  });
2817
- const loadFunctions = Effect19.fn("VercelBuildOutputParser.loadFunctions")(function* (config, parseResult, projectFolder) {
2818
- const functionConfigs = yield* Effect19.tryPromise({
3004
+ const loadFunctions = Effect20.fn("VercelBuildOutputParser.loadFunctions")(function* (config, parseResult, projectFolder) {
3005
+ const functionConfigs = yield* Effect20.tryPromise({
2819
3006
  try: () => getFilesForPattern(FUNCTION_CONFIGS_PATTERN, projectFolder),
2820
3007
  catch: (error) => new ConfigFileParseError({
2821
3008
  message: `Failed to scan for function configs: ${error instanceof Error ? error.message : String(error)}`,
@@ -3732,7 +3919,7 @@ var schema_default = {
3732
3919
  };
3733
3920
 
3734
3921
  // src/parse-config.ts
3735
- var parseConfigRaw = Effect20.fn("parseConfigRaw")(function* (filePath, projectFolder) {
3922
+ var parseConfigRaw = Effect21.fn("parseConfigRaw")(function* (filePath, projectFolder) {
3736
3923
  const rawReader = yield* RawConfigReader;
3737
3924
  const validator = yield* SchemaValidator;
3738
3925
  const v4Parser = yield* V4ConfigParser;
@@ -3743,7 +3930,7 @@ var parseConfigRaw = Effect20.fn("parseConfigRaw")(function* (filePath, projectF
3743
3930
  };
3744
3931
  const schema = schemaMap[version];
3745
3932
  if (!schema) {
3746
- return yield* Effect20.fail(
3933
+ return yield* Effect21.fail(
3747
3934
  new ConfigVersionError({
3748
3935
  message: `Config file at ${filePath} has an unsupported version: ${version}`,
3749
3936
  filePath,
@@ -3754,11 +3941,11 @@ var parseConfigRaw = Effect20.fn("parseConfigRaw")(function* (filePath, projectF
3754
3941
  yield* validator.validate(parsed, schema, filePath);
3755
3942
  return yield* v4Parser.parse(parsed, projectFolder);
3756
3943
  });
3757
- var parseConfig = Effect20.fn("parseConfig")(function* (filePath, projectFolder) {
3944
+ var parseConfig = Effect21.fn("parseConfig")(function* (filePath, projectFolder) {
3758
3945
  const parseResult = yield* parseConfigRaw(filePath, projectFolder);
3759
3946
  return yield* postProcessConfig(parseResult, projectFolder);
3760
3947
  });
3761
- var postProcessConfig = Effect20.fn("postProcessConfig")(function* (config, projectFolder) {
3948
+ var postProcessConfig = Effect21.fn("postProcessConfig")(function* (config, projectFolder) {
3762
3949
  const vercelParser = yield* VercelBuildOutputParser;
3763
3950
  let result = yield* vercelParser.parse(config, projectFolder);
3764
3951
  const hasAssets = (result.assets?.paths?.length ?? 0) > 0 || (result.assets?.prefixes?.length ?? 0) > 0 || (result.assets?.manifests?.length ?? 0) > 0;