@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.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +289 -102
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +273 -86
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1007,8 +1007,8 @@ var detectContainerProject = import_effect6.Effect.fn("detectContainerProject")(
|
|
|
1007
1007
|
});
|
|
1008
1008
|
|
|
1009
1009
|
// src/detection/detect-framework.ts
|
|
1010
|
-
var
|
|
1011
|
-
var
|
|
1010
|
+
var import_platform12 = require("@effect/platform");
|
|
1011
|
+
var import_effect18 = require("effect");
|
|
1012
1012
|
|
|
1013
1013
|
// src/detection/detect-package-manager.ts
|
|
1014
1014
|
var import_platform4 = require("@effect/platform");
|
|
@@ -1057,6 +1057,68 @@ var astro = {
|
|
|
1057
1057
|
})
|
|
1058
1058
|
};
|
|
1059
1059
|
|
|
1060
|
+
// src/detection/frameworks/php-front-controller.ts
|
|
1061
|
+
var phpFrontControllerDefaults = ({
|
|
1062
|
+
documentRoot,
|
|
1063
|
+
writablePaths = [],
|
|
1064
|
+
excludeFiles = [],
|
|
1065
|
+
memory = 256,
|
|
1066
|
+
environmentVariables = {}
|
|
1067
|
+
}) => {
|
|
1068
|
+
const entrypoint = documentRoot === "." ? "index.php" : `${documentRoot}/index.php`;
|
|
1069
|
+
return {
|
|
1070
|
+
runtime: "php-84",
|
|
1071
|
+
memory,
|
|
1072
|
+
maxDuration: 30,
|
|
1073
|
+
streaming: false,
|
|
1074
|
+
commands: [],
|
|
1075
|
+
entrypoint,
|
|
1076
|
+
assetsDir: documentRoot,
|
|
1077
|
+
excludeFiles: [".ddev", "node_modules/", ...excludeFiles],
|
|
1078
|
+
routes: [{ source: "/*", destination: entrypoint }],
|
|
1079
|
+
environmentVariables,
|
|
1080
|
+
...writablePaths.length > 0 ? { package: { writablePaths } } : {}
|
|
1081
|
+
};
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
// src/detection/frameworks/cakephp.ts
|
|
1085
|
+
var cakephp = {
|
|
1086
|
+
slug: "cakephp",
|
|
1087
|
+
name: "CakePHP",
|
|
1088
|
+
language: "php",
|
|
1089
|
+
detectors: [{ matchPackage: "cakephp/cakephp" }, { path: "webroot/index.php" }],
|
|
1090
|
+
priority: 80,
|
|
1091
|
+
getDefaultConfig: () => phpFrontControllerDefaults({
|
|
1092
|
+
documentRoot: "webroot",
|
|
1093
|
+
// config/paths.php puts TMP and LOGS inside the project.
|
|
1094
|
+
writablePaths: [
|
|
1095
|
+
"tmp/cache/models",
|
|
1096
|
+
"tmp/cache/persistent",
|
|
1097
|
+
"tmp/cache/views",
|
|
1098
|
+
"tmp/sessions",
|
|
1099
|
+
"tmp/tests",
|
|
1100
|
+
"logs"
|
|
1101
|
+
],
|
|
1102
|
+
excludeFiles: ["tests/", "tmp/", "logs/"]
|
|
1103
|
+
})
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
// src/detection/frameworks/codeigniter.ts
|
|
1107
|
+
var codeigniter = {
|
|
1108
|
+
slug: "codeigniter",
|
|
1109
|
+
name: "CodeIgniter",
|
|
1110
|
+
language: "php",
|
|
1111
|
+
detectors: [{ matchPackage: "codeigniter4/framework" }, { path: "spark" }],
|
|
1112
|
+
priority: 80,
|
|
1113
|
+
getDefaultConfig: () => phpFrontControllerDefaults({
|
|
1114
|
+
documentRoot: "public",
|
|
1115
|
+
// WRITEPATH: the cache, file session and log handlers write below it.
|
|
1116
|
+
writablePaths: ["writable/cache", "writable/debugbar", "writable/logs", "writable/session", "writable/uploads"],
|
|
1117
|
+
excludeFiles: ["tests/", "writable/"],
|
|
1118
|
+
environmentVariables: { CI_ENVIRONMENT: "production" }
|
|
1119
|
+
})
|
|
1120
|
+
};
|
|
1121
|
+
|
|
1060
1122
|
// src/detection/frameworks/resolve-node-entrypoint.ts
|
|
1061
1123
|
var import_platform5 = require("@effect/platform");
|
|
1062
1124
|
var import_effect8 = require("effect");
|
|
@@ -1214,6 +1276,21 @@ var hono = {
|
|
|
1214
1276
|
refineDefaultConfig: resolveNodeServerEntrypoint
|
|
1215
1277
|
};
|
|
1216
1278
|
|
|
1279
|
+
// src/detection/frameworks/laminas.ts
|
|
1280
|
+
var laminas = {
|
|
1281
|
+
slug: "laminas",
|
|
1282
|
+
name: "Laminas MVC",
|
|
1283
|
+
language: "php",
|
|
1284
|
+
detectors: [{ matchPackage: "laminas/laminas-mvc" }, { path: "public/index.php" }],
|
|
1285
|
+
priority: 80,
|
|
1286
|
+
getDefaultConfig: () => phpFrontControllerDefaults({
|
|
1287
|
+
documentRoot: "public",
|
|
1288
|
+
// The merged-config and module-map caches of the skeleton.
|
|
1289
|
+
writablePaths: ["data/cache"],
|
|
1290
|
+
excludeFiles: ["test/", "data/cache/"]
|
|
1291
|
+
})
|
|
1292
|
+
};
|
|
1293
|
+
|
|
1217
1294
|
// src/detection/frameworks/laravel.ts
|
|
1218
1295
|
var laravel = {
|
|
1219
1296
|
slug: "laravel",
|
|
@@ -1232,6 +1309,18 @@ var laravel = {
|
|
|
1232
1309
|
populateAssetCache: true,
|
|
1233
1310
|
excludeFiles: ["tests/", "storage/", ".ddev", "node_modules/"],
|
|
1234
1311
|
routes: [{ source: "/*", destination: "public/index.php" }],
|
|
1312
|
+
package: {
|
|
1313
|
+
// storage/ is excluded, so the directories Laravel writes compiled
|
|
1314
|
+
// views, file caches, sessions and logs to are created empty.
|
|
1315
|
+
writablePaths: [
|
|
1316
|
+
"bootstrap/cache",
|
|
1317
|
+
"storage/app/public",
|
|
1318
|
+
"storage/framework/cache/data",
|
|
1319
|
+
"storage/framework/sessions",
|
|
1320
|
+
"storage/framework/views",
|
|
1321
|
+
"storage/logs"
|
|
1322
|
+
]
|
|
1323
|
+
},
|
|
1235
1324
|
environmentVariables: {
|
|
1236
1325
|
APP_NAME: "Laravel",
|
|
1237
1326
|
APP_ENV: "production",
|
|
@@ -1245,6 +1334,21 @@ var laravel = {
|
|
|
1245
1334
|
})
|
|
1246
1335
|
};
|
|
1247
1336
|
|
|
1337
|
+
// src/detection/frameworks/mezzio.ts
|
|
1338
|
+
var mezzio = {
|
|
1339
|
+
slug: "mezzio",
|
|
1340
|
+
name: "Mezzio",
|
|
1341
|
+
language: "php",
|
|
1342
|
+
detectors: [{ matchPackage: "mezzio/mezzio" }, { path: "public/index.php" }],
|
|
1343
|
+
priority: 80,
|
|
1344
|
+
getDefaultConfig: () => phpFrontControllerDefaults({
|
|
1345
|
+
documentRoot: "public",
|
|
1346
|
+
// config/config.php writes the merged config cache here.
|
|
1347
|
+
writablePaths: ["data/cache"],
|
|
1348
|
+
excludeFiles: ["test/", "data/cache/"]
|
|
1349
|
+
})
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1248
1352
|
// src/detection/frameworks/nestjs.ts
|
|
1249
1353
|
var import_platform6 = require("@effect/platform");
|
|
1250
1354
|
var import_effect9 = require("effect");
|
|
@@ -1848,6 +1952,43 @@ var nuxt = {
|
|
|
1848
1952
|
})
|
|
1849
1953
|
};
|
|
1850
1954
|
|
|
1955
|
+
// src/detection/frameworks/php.ts
|
|
1956
|
+
var import_platform10 = require("@effect/platform");
|
|
1957
|
+
var import_effect14 = require("effect");
|
|
1958
|
+
var COMPOSER_FILES = ["composer.json", "composer.lock"];
|
|
1959
|
+
var DOCUMENT_ROOTS = ["public", "web", "webroot", "public_html", "htdocs", "."];
|
|
1960
|
+
var refinePhpDocumentRoot = (defaults, projectFolder) => import_effect14.Effect.gen(function* () {
|
|
1961
|
+
const fs = yield* import_platform10.FileSystem.FileSystem;
|
|
1962
|
+
const pathService = yield* import_platform10.Path.Path;
|
|
1963
|
+
for (const documentRoot of DOCUMENT_ROOTS) {
|
|
1964
|
+
const frontController = pathService.join(projectFolder, documentRoot, "index.php");
|
|
1965
|
+
if (yield* fs.exists(frontController).pipe(import_effect14.Effect.catchAll(() => import_effect14.Effect.succeed(false)))) {
|
|
1966
|
+
return phpFrontControllerDefaults({ documentRoot, excludeFiles: COMPOSER_FILES });
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
return defaults;
|
|
1970
|
+
});
|
|
1971
|
+
var getDefaultConfig = () => phpFrontControllerDefaults({ documentRoot: ".", excludeFiles: COMPOSER_FILES });
|
|
1972
|
+
var frontControllerPath = (documentRoot) => documentRoot === "." ? "index.php" : `${documentRoot}/index.php`;
|
|
1973
|
+
var phpComposerProjects = DOCUMENT_ROOTS.map((documentRoot) => ({
|
|
1974
|
+
slug: "php",
|
|
1975
|
+
name: "PHP",
|
|
1976
|
+
language: "php",
|
|
1977
|
+
detectors: [{ path: "composer.json" }, { path: frontControllerPath(documentRoot) }],
|
|
1978
|
+
priority: 7,
|
|
1979
|
+
getDefaultConfig,
|
|
1980
|
+
refineDefaultConfig: refinePhpDocumentRoot
|
|
1981
|
+
}));
|
|
1982
|
+
var phpSites = DOCUMENT_ROOTS.map((documentRoot) => ({
|
|
1983
|
+
slug: "php-site",
|
|
1984
|
+
name: "PHP",
|
|
1985
|
+
language: "php",
|
|
1986
|
+
detectors: [{ path: frontControllerPath(documentRoot) }],
|
|
1987
|
+
priority: 6,
|
|
1988
|
+
getDefaultConfig: () => ({ ...getDefaultConfig(), installCommand: "" }),
|
|
1989
|
+
refineDefaultConfig: (defaults, projectFolder) => refinePhpDocumentRoot(defaults, projectFolder).pipe(import_effect14.Effect.map((refined) => ({ ...refined, installCommand: "" })))
|
|
1990
|
+
}));
|
|
1991
|
+
|
|
1851
1992
|
// src/detection/frameworks/remix.ts
|
|
1852
1993
|
var remix = {
|
|
1853
1994
|
slug: "remix",
|
|
@@ -1869,6 +2010,21 @@ var remix = {
|
|
|
1869
2010
|
})
|
|
1870
2011
|
};
|
|
1871
2012
|
|
|
2013
|
+
// src/detection/frameworks/slim.ts
|
|
2014
|
+
var slim = {
|
|
2015
|
+
slug: "slim",
|
|
2016
|
+
name: "Slim",
|
|
2017
|
+
language: "php",
|
|
2018
|
+
detectors: [{ matchPackage: "slim/slim" }, { path: "public/index.php" }],
|
|
2019
|
+
priority: 75,
|
|
2020
|
+
getDefaultConfig: () => phpFrontControllerDefaults({
|
|
2021
|
+
documentRoot: "public",
|
|
2022
|
+
// slim/slim-skeleton logs to logs/ and caches the container and routes in var/cache.
|
|
2023
|
+
writablePaths: ["logs", "var/cache"],
|
|
2024
|
+
excludeFiles: ["tests/", "logs/", "var/"]
|
|
2025
|
+
})
|
|
2026
|
+
};
|
|
2027
|
+
|
|
1872
2028
|
// src/detection/frameworks/sveltekit.ts
|
|
1873
2029
|
var sveltekit = {
|
|
1874
2030
|
slug: "sveltekit",
|
|
@@ -1908,12 +2064,13 @@ var symfony = {
|
|
|
1908
2064
|
assetsDir: "public",
|
|
1909
2065
|
populateAssetCache: true,
|
|
1910
2066
|
excludeFiles: ["tests/*", ".ddev", "var"],
|
|
1911
|
-
symlinks: { var: "/tmp" },
|
|
1912
2067
|
routes: [{ source: "/*", destination: "public/index.php" }],
|
|
2068
|
+
// The kernel's cache and log directories. A symlink to /tmp used to stand
|
|
2069
|
+
// in for them, which the build rejected as pointing outside the project.
|
|
2070
|
+
package: { writablePaths: ["var/cache", "var/log"] },
|
|
1913
2071
|
environmentVariables: {
|
|
1914
2072
|
APP_ENV: "prod",
|
|
1915
2073
|
APP_DEBUG: "false",
|
|
1916
|
-
APP_SECRET: "please_change_this_value_in_your_settings",
|
|
1917
2074
|
MESSENGER_TRANSPORT_DSN: "doctrine://default?auto_setup=0"
|
|
1918
2075
|
}
|
|
1919
2076
|
})
|
|
@@ -1939,6 +2096,22 @@ var vite = {
|
|
|
1939
2096
|
})
|
|
1940
2097
|
};
|
|
1941
2098
|
|
|
2099
|
+
// src/detection/frameworks/yii.ts
|
|
2100
|
+
var yii = {
|
|
2101
|
+
slug: "yii",
|
|
2102
|
+
name: "Yii 2",
|
|
2103
|
+
language: "php",
|
|
2104
|
+
detectors: [{ matchPackage: "yiisoft/yii2" }, { path: "web/index.php" }],
|
|
2105
|
+
priority: 80,
|
|
2106
|
+
getDefaultConfig: () => phpFrontControllerDefaults({
|
|
2107
|
+
documentRoot: "web",
|
|
2108
|
+
// @runtime holds cache, logs and sessions; the asset manager publishes
|
|
2109
|
+
// bundles from vendor/ into web/assets when a page first uses them.
|
|
2110
|
+
writablePaths: ["runtime", "web/assets"],
|
|
2111
|
+
excludeFiles: ["tests/", "runtime/", "web/assets/"]
|
|
2112
|
+
})
|
|
2113
|
+
};
|
|
2114
|
+
|
|
1942
2115
|
// src/detection/frameworks/index.ts
|
|
1943
2116
|
var FRAMEWORK_DEFINITIONS = [
|
|
1944
2117
|
nextjs,
|
|
@@ -1949,15 +2122,23 @@ var FRAMEWORK_DEFINITIONS = [
|
|
|
1949
2122
|
astro,
|
|
1950
2123
|
laravel,
|
|
1951
2124
|
symfony,
|
|
2125
|
+
cakephp,
|
|
2126
|
+
codeigniter,
|
|
2127
|
+
laminas,
|
|
2128
|
+
mezzio,
|
|
2129
|
+
yii,
|
|
2130
|
+
slim,
|
|
1952
2131
|
hono,
|
|
1953
2132
|
elysia,
|
|
1954
2133
|
fastify,
|
|
1955
2134
|
express,
|
|
2135
|
+
...phpComposerProjects,
|
|
2136
|
+
...phpSites,
|
|
1956
2137
|
vite
|
|
1957
2138
|
].sort((a, b) => b.priority - a.priority);
|
|
1958
2139
|
|
|
1959
2140
|
// src/detection/generate-config.ts
|
|
1960
|
-
var
|
|
2141
|
+
var import_effect15 = require("effect");
|
|
1961
2142
|
var getInstallCommand = (pm) => {
|
|
1962
2143
|
switch (pm) {
|
|
1963
2144
|
case "bun":
|
|
@@ -1973,11 +2154,16 @@ var getInstallCommand = (pm) => {
|
|
|
1973
2154
|
return "npm install";
|
|
1974
2155
|
}
|
|
1975
2156
|
};
|
|
1976
|
-
var
|
|
2157
|
+
var COMPOSER_ROOT_FILES = /* @__PURE__ */ new Set(["composer.json", "composer.lock", "auth.json"]);
|
|
2158
|
+
var isPrivatePhpProjectFile = (projectPath) => {
|
|
2159
|
+
const segments = projectPath.split("/").filter((segment) => segment !== "" && segment !== ".");
|
|
2160
|
+
return segments.some((segment) => segment.startsWith(".")) || segments[0] === "vendor" || segments[0] === "node_modules" || segments.length === 1 && COMPOSER_ROOT_FILES.has(segments[0] ?? "");
|
|
2161
|
+
};
|
|
2162
|
+
var generateConfig = import_effect15.Effect.fn("generateConfig")(function* (framework, packageManager, projectFolder, refinedDefaults) {
|
|
1977
2163
|
const defaults = refinedDefaults ?? framework.getDefaultConfig(packageManager);
|
|
1978
2164
|
const installCmd = defaults.installCommand ?? getInstallCommand(packageManager);
|
|
1979
|
-
const commands = [installCmd, ...defaults.commands];
|
|
1980
|
-
yield*
|
|
2165
|
+
const commands = installCmd ? [installCmd, ...defaults.commands] : [...defaults.commands];
|
|
2166
|
+
yield* import_effect15.Effect.logDebug(`Generating config for ${framework.name}`, {
|
|
1981
2167
|
runtime: defaults.runtime,
|
|
1982
2168
|
entrypoint: defaults.entrypoint,
|
|
1983
2169
|
commands
|
|
@@ -2019,6 +2205,7 @@ var generateConfig = import_effect14.Effect.fn("generateConfig")(function* (fram
|
|
|
2019
2205
|
if (assetsDir && !defaults.assetPaths && !defaults.assetPrefixes && !defaults.assetManifests) {
|
|
2020
2206
|
for (const file of yield* collectAssetFiles(projectFolder, assetsDir)) {
|
|
2021
2207
|
if (framework.language === "php" && /\.(php|phtml|phar)$/i.test(file)) continue;
|
|
2208
|
+
if (framework.language === "php" && isPrivatePhpProjectFile(`${assetsDir}/${file}`)) continue;
|
|
2022
2209
|
paths.push(`${assetsDir}/${file}`);
|
|
2023
2210
|
if (!servesDirectoryIndexes || file in overrides) continue;
|
|
2024
2211
|
if (file === "index.html") {
|
|
@@ -2042,31 +2229,31 @@ var generateConfig = import_effect14.Effect.fn("generateConfig")(function* (fram
|
|
|
2042
2229
|
});
|
|
2043
2230
|
|
|
2044
2231
|
// src/detection/read-dependencies.ts
|
|
2045
|
-
var
|
|
2046
|
-
var
|
|
2232
|
+
var import_platform11 = require("@effect/platform");
|
|
2233
|
+
var import_effect17 = require("effect");
|
|
2047
2234
|
|
|
2048
2235
|
// src/detection/types.ts
|
|
2049
|
-
var
|
|
2050
|
-
var ManifestNotFoundError = class extends
|
|
2051
|
-
message:
|
|
2052
|
-
filePath:
|
|
2236
|
+
var import_effect16 = require("effect");
|
|
2237
|
+
var ManifestNotFoundError = class extends import_effect16.Schema.TaggedError()("ManifestNotFoundError", {
|
|
2238
|
+
message: import_effect16.Schema.String,
|
|
2239
|
+
filePath: import_effect16.Schema.String
|
|
2053
2240
|
}) {
|
|
2054
2241
|
};
|
|
2055
|
-
var ManifestReadError = class extends
|
|
2056
|
-
message:
|
|
2057
|
-
filePath:
|
|
2242
|
+
var ManifestReadError = class extends import_effect16.Schema.TaggedError()("ManifestReadError", {
|
|
2243
|
+
message: import_effect16.Schema.String,
|
|
2244
|
+
filePath: import_effect16.Schema.String
|
|
2058
2245
|
}) {
|
|
2059
2246
|
};
|
|
2060
|
-
var ManifestParseError = class extends
|
|
2061
|
-
message:
|
|
2062
|
-
filePath:
|
|
2247
|
+
var ManifestParseError = class extends import_effect16.Schema.TaggedError()("ManifestParseError", {
|
|
2248
|
+
message: import_effect16.Schema.String,
|
|
2249
|
+
filePath: import_effect16.Schema.String
|
|
2063
2250
|
}) {
|
|
2064
2251
|
};
|
|
2065
|
-
var FrameworkNotDetectedError = class extends
|
|
2252
|
+
var FrameworkNotDetectedError = class extends import_effect16.Schema.TaggedError()(
|
|
2066
2253
|
"FrameworkNotDetectedError",
|
|
2067
2254
|
{
|
|
2068
|
-
message:
|
|
2069
|
-
directory:
|
|
2255
|
+
message: import_effect16.Schema.String,
|
|
2256
|
+
directory: import_effect16.Schema.String
|
|
2070
2257
|
}
|
|
2071
2258
|
) {
|
|
2072
2259
|
};
|
|
@@ -2076,25 +2263,25 @@ var MANIFEST_CONFIG = {
|
|
|
2076
2263
|
node: { file: "package.json", depKeys: ["dependencies", "devDependencies"] },
|
|
2077
2264
|
php: { file: "composer.json", depKeys: ["require", "require-dev"] }
|
|
2078
2265
|
};
|
|
2079
|
-
var readManifest =
|
|
2080
|
-
const fs = yield*
|
|
2081
|
-
const exists = yield* fs.exists(filePath).pipe(
|
|
2266
|
+
var readManifest = import_effect17.Effect.fn("readManifest")(function* (filePath) {
|
|
2267
|
+
const fs = yield* import_platform11.FileSystem.FileSystem;
|
|
2268
|
+
const exists = yield* fs.exists(filePath).pipe(import_effect17.Effect.catchAll(() => import_effect17.Effect.succeed(false)));
|
|
2082
2269
|
if (!exists) {
|
|
2083
|
-
return yield*
|
|
2270
|
+
return yield* import_effect17.Effect.fail(new ManifestNotFoundError({ message: "Manifest not found", filePath }));
|
|
2084
2271
|
}
|
|
2085
|
-
const content = yield* fs.readFileString(filePath).pipe(
|
|
2086
|
-
const parsed = yield*
|
|
2272
|
+
const content = yield* fs.readFileString(filePath).pipe(import_effect17.Effect.mapError(() => new ManifestReadError({ message: "Failed to read manifest", filePath })));
|
|
2273
|
+
const parsed = yield* import_effect17.Effect.try({
|
|
2087
2274
|
try: () => JSON.parse(content),
|
|
2088
2275
|
catch: () => new ManifestParseError({ message: "Failed to parse manifest JSON", filePath })
|
|
2089
2276
|
});
|
|
2090
2277
|
return parsed;
|
|
2091
2278
|
});
|
|
2092
|
-
var readDependencies =
|
|
2093
|
-
const pathService = yield*
|
|
2279
|
+
var readDependencies = import_effect17.Effect.fn("readDependencies")(function* (projectFolder, language) {
|
|
2280
|
+
const pathService = yield* import_platform11.Path.Path;
|
|
2094
2281
|
const config = MANIFEST_CONFIG[language];
|
|
2095
2282
|
const filePath = pathService.join(projectFolder, config.file);
|
|
2096
2283
|
const manifest = yield* readManifest(filePath).pipe(
|
|
2097
|
-
|
|
2284
|
+
import_effect17.Effect.catchTag("ManifestNotFoundError", () => import_effect17.Effect.succeed(null))
|
|
2098
2285
|
);
|
|
2099
2286
|
if (!manifest) {
|
|
2100
2287
|
return /* @__PURE__ */ new Set();
|
|
@@ -2112,9 +2299,9 @@ var readDependencies = import_effect16.Effect.fn("readDependencies")(function* (
|
|
|
2112
2299
|
});
|
|
2113
2300
|
|
|
2114
2301
|
// src/detection/detect-framework.ts
|
|
2115
|
-
var matchesDetectionItem =
|
|
2116
|
-
const fs = yield*
|
|
2117
|
-
const pathService = yield*
|
|
2302
|
+
var matchesDetectionItem = import_effect18.Effect.fn("matchesDetectionItem")(function* (item, projectFolder, framework, cachedReadDeps) {
|
|
2303
|
+
const fs = yield* import_platform12.FileSystem.FileSystem;
|
|
2304
|
+
const pathService = yield* import_platform12.Path.Path;
|
|
2118
2305
|
if (item.matchPackage != null) {
|
|
2119
2306
|
const deps = yield* cachedReadDeps(`${projectFolder}\0${framework.language}`);
|
|
2120
2307
|
if (!deps.has(item.matchPackage)) {
|
|
@@ -2123,12 +2310,12 @@ var matchesDetectionItem = import_effect17.Effect.fn("matchesDetectionItem")(fun
|
|
|
2123
2310
|
}
|
|
2124
2311
|
if (item.path != null) {
|
|
2125
2312
|
const filePath = pathService.join(projectFolder, item.path);
|
|
2126
|
-
const exists = yield* fs.exists(filePath).pipe(
|
|
2313
|
+
const exists = yield* fs.exists(filePath).pipe(import_effect18.Effect.catchAll(() => import_effect18.Effect.succeed(false)));
|
|
2127
2314
|
if (!exists) {
|
|
2128
2315
|
return false;
|
|
2129
2316
|
}
|
|
2130
2317
|
if (item.matchContent != null) {
|
|
2131
|
-
const content = yield* fs.readFileString(filePath).pipe(
|
|
2318
|
+
const content = yield* fs.readFileString(filePath).pipe(import_effect18.Effect.catchAll(() => import_effect18.Effect.succeed("")));
|
|
2132
2319
|
let regexMatch = false;
|
|
2133
2320
|
try {
|
|
2134
2321
|
regexMatch = new RegExp(item.matchContent).test(content);
|
|
@@ -2141,7 +2328,7 @@ var matchesDetectionItem = import_effect17.Effect.fn("matchesDetectionItem")(fun
|
|
|
2141
2328
|
}
|
|
2142
2329
|
return true;
|
|
2143
2330
|
});
|
|
2144
|
-
var matchesFramework =
|
|
2331
|
+
var matchesFramework = import_effect18.Effect.fn("matchesFramework")(function* (framework, projectFolder, cachedReadDeps) {
|
|
2145
2332
|
for (const detector of framework.detectors) {
|
|
2146
2333
|
const matches = yield* matchesDetectionItem(detector, projectFolder, framework, cachedReadDeps);
|
|
2147
2334
|
if (!matches) {
|
|
@@ -2150,9 +2337,9 @@ var matchesFramework = import_effect17.Effect.fn("matchesFramework")(function* (
|
|
|
2150
2337
|
}
|
|
2151
2338
|
return true;
|
|
2152
2339
|
});
|
|
2153
|
-
var detectFramework =
|
|
2154
|
-
yield*
|
|
2155
|
-
const cachedReadDeps = yield*
|
|
2340
|
+
var detectFramework = import_effect18.Effect.fn("detectFramework")(function* (projectFolder) {
|
|
2341
|
+
yield* import_effect18.Effect.logDebug(`Detecting framework in ${projectFolder}`);
|
|
2342
|
+
const cachedReadDeps = yield* import_effect18.Effect.cachedFunction((key) => {
|
|
2156
2343
|
const sepIndex = key.lastIndexOf("\0");
|
|
2157
2344
|
const folder = key.slice(0, sepIndex);
|
|
2158
2345
|
const language = key.slice(sepIndex + 1);
|
|
@@ -2161,7 +2348,7 @@ var detectFramework = import_effect17.Effect.fn("detectFramework")(function* (pr
|
|
|
2161
2348
|
for (const framework of FRAMEWORK_DEFINITIONS) {
|
|
2162
2349
|
const matches = yield* matchesFramework(framework, projectFolder, cachedReadDeps);
|
|
2163
2350
|
if (matches) {
|
|
2164
|
-
yield*
|
|
2351
|
+
yield* import_effect18.Effect.log(`Detected framework: ${framework.name}`, { slug: framework.slug });
|
|
2165
2352
|
const detectedPackageManager = yield* detectPackageManager(projectFolder);
|
|
2166
2353
|
const packageManager = framework.language === "php" ? "composer" : detectedPackageManager;
|
|
2167
2354
|
const defaults = framework.getDefaultConfig(packageManager);
|
|
@@ -2170,7 +2357,7 @@ var detectFramework = import_effect17.Effect.fn("detectFramework")(function* (pr
|
|
|
2170
2357
|
return { framework, packageManager, config };
|
|
2171
2358
|
}
|
|
2172
2359
|
}
|
|
2173
|
-
return yield*
|
|
2360
|
+
return yield* import_effect18.Effect.fail(
|
|
2174
2361
|
new FrameworkNotDetectedError({
|
|
2175
2362
|
message: `No framework detected in project directory`,
|
|
2176
2363
|
directory: projectFolder
|
|
@@ -2179,9 +2366,9 @@ var detectFramework = import_effect17.Effect.fn("detectFramework")(function* (pr
|
|
|
2179
2366
|
});
|
|
2180
2367
|
|
|
2181
2368
|
// src/detection/merge-config.ts
|
|
2182
|
-
var
|
|
2183
|
-
var mergeWithFrameworkDefaults =
|
|
2184
|
-
yield*
|
|
2369
|
+
var import_effect19 = require("effect");
|
|
2370
|
+
var mergeWithFrameworkDefaults = import_effect19.Effect.fn("mergeWithFrameworkDefaults")(function* (userConfig, frameworkConfig) {
|
|
2371
|
+
yield* import_effect19.Effect.logDebug("Merging user config with framework defaults");
|
|
2185
2372
|
const userHasAssets = (userConfig.assets?.paths?.length ?? 0) > 0 || (userConfig.assets?.prefixes?.length ?? 0) > 0 || (userConfig.assets?.manifests?.length ?? 0) > 0;
|
|
2186
2373
|
const isContainer = (entrypoint) => entrypoint.runtime === CONTAINER_RUNTIME;
|
|
2187
2374
|
const userFileFunctions = userConfig.entrypoints.filter((entrypoint) => !isContainer(entrypoint));
|
|
@@ -2222,23 +2409,23 @@ var filterFunctionsFromAssets = (config) => {
|
|
|
2222
2409
|
};
|
|
2223
2410
|
|
|
2224
2411
|
// src/parse-config.ts
|
|
2225
|
-
var
|
|
2412
|
+
var import_effect25 = require("effect");
|
|
2226
2413
|
|
|
2227
2414
|
// src/services/raw-config-reader.ts
|
|
2228
|
-
var
|
|
2229
|
-
var
|
|
2415
|
+
var import_platform13 = require("@effect/platform");
|
|
2416
|
+
var import_effect21 = require("effect");
|
|
2230
2417
|
var import_yaml2 = require("yaml");
|
|
2231
2418
|
|
|
2232
2419
|
// src/services/config-module-loader.ts
|
|
2233
|
-
var
|
|
2420
|
+
var import_effect20 = require("effect");
|
|
2234
2421
|
var import_jiti = require("jiti");
|
|
2235
2422
|
var MISSING_DEFAULT_EXPORT = /* @__PURE__ */ Symbol("MissingDefaultExport");
|
|
2236
2423
|
var STRICT_DEFAULT_EXPORT_EXTENSIONS = [".ts", ".mts", ".mjs"];
|
|
2237
|
-
var ConfigModuleLoader = class extends
|
|
2238
|
-
effect:
|
|
2239
|
-
const loadConfigModule =
|
|
2424
|
+
var ConfigModuleLoader = class extends import_effect20.Effect.Service()("ConfigModuleLoader", {
|
|
2425
|
+
effect: import_effect20.Effect.gen(function* () {
|
|
2426
|
+
const loadConfigModule = import_effect20.Effect.fn("ConfigModuleLoader.loadConfigModule")(function* (filePath) {
|
|
2240
2427
|
const extension = filePath.slice(filePath.lastIndexOf(".")).toLowerCase();
|
|
2241
|
-
const mod = yield*
|
|
2428
|
+
const mod = yield* import_effect20.Effect.tryPromise({
|
|
2242
2429
|
try: async () => {
|
|
2243
2430
|
const jiti = (0, import_jiti.createJiti)(filePath, { fsCache: false, interopDefault: true, moduleCache: false });
|
|
2244
2431
|
const namespace = await jiti.import(filePath);
|
|
@@ -2257,7 +2444,7 @@ var ConfigModuleLoader = class extends import_effect19.Effect.Service()("ConfigM
|
|
|
2257
2444
|
})
|
|
2258
2445
|
});
|
|
2259
2446
|
if (mod === MISSING_DEFAULT_EXPORT) {
|
|
2260
|
-
return yield*
|
|
2447
|
+
return yield* import_effect20.Effect.fail(
|
|
2261
2448
|
new ConfigModuleLoadError({
|
|
2262
2449
|
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.`,
|
|
2263
2450
|
filePath
|
|
@@ -2265,7 +2452,7 @@ var ConfigModuleLoader = class extends import_effect19.Effect.Service()("ConfigM
|
|
|
2265
2452
|
);
|
|
2266
2453
|
}
|
|
2267
2454
|
if (typeof mod === "function") {
|
|
2268
|
-
return yield*
|
|
2455
|
+
return yield* import_effect20.Effect.fail(
|
|
2269
2456
|
new ConfigModuleLoadError({
|
|
2270
2457
|
message: `Config module at ${filePath} default-exports a function; config factories are not supported. Export a config object instead (optionally wrapped in defineConfig).`,
|
|
2271
2458
|
filePath
|
|
@@ -2273,7 +2460,7 @@ var ConfigModuleLoader = class extends import_effect19.Effect.Service()("ConfigM
|
|
|
2273
2460
|
);
|
|
2274
2461
|
}
|
|
2275
2462
|
if (typeof mod !== "object" || mod === null || Array.isArray(mod)) {
|
|
2276
|
-
return yield*
|
|
2463
|
+
return yield* import_effect20.Effect.fail(
|
|
2277
2464
|
new ConfigModuleLoadError({
|
|
2278
2465
|
message: `Config module at ${filePath} must default-export a config object.`,
|
|
2279
2466
|
filePath
|
|
@@ -2303,36 +2490,36 @@ var ALLOWED_CONFIG_NAMES = [
|
|
|
2303
2490
|
"nebula.json"
|
|
2304
2491
|
];
|
|
2305
2492
|
var MODULE_EXTENSIONS = [".ts", ".mts", ".cts", ".js", ".mjs", ".cjs"];
|
|
2306
|
-
var RawConfigReader = class extends
|
|
2493
|
+
var RawConfigReader = class extends import_effect21.Effect.Service()("RawConfigReader", {
|
|
2307
2494
|
dependencies: [ConfigModuleLoader.Default],
|
|
2308
|
-
effect:
|
|
2309
|
-
const fs = yield*
|
|
2310
|
-
const pathService = yield*
|
|
2495
|
+
effect: import_effect21.Effect.gen(function* () {
|
|
2496
|
+
const fs = yield* import_platform13.FileSystem.FileSystem;
|
|
2497
|
+
const pathService = yield* import_platform13.Path.Path;
|
|
2311
2498
|
const moduleLoader = yield* ConfigModuleLoader;
|
|
2312
|
-
const findConfig =
|
|
2499
|
+
const findConfig = import_effect21.Effect.fn("RawConfigReader.findConfig")(function* (projectFolder) {
|
|
2313
2500
|
for (const name of ALLOWED_CONFIG_NAMES) {
|
|
2314
2501
|
const filePath = pathService.join(projectFolder, name);
|
|
2315
|
-
const exists = yield* fs.exists(filePath).pipe(
|
|
2502
|
+
const exists = yield* fs.exists(filePath).pipe(import_effect21.Effect.catchAll(() => import_effect21.Effect.succeed(false)));
|
|
2316
2503
|
if (exists) {
|
|
2317
2504
|
return filePath;
|
|
2318
2505
|
}
|
|
2319
2506
|
}
|
|
2320
2507
|
return null;
|
|
2321
2508
|
});
|
|
2322
|
-
const readRawConfig =
|
|
2323
|
-
const exists = yield* fs.exists(filePath).pipe(
|
|
2509
|
+
const readRawConfig = import_effect21.Effect.fn("RawConfigReader.readRawConfig")(function* (filePath, options) {
|
|
2510
|
+
const exists = yield* fs.exists(filePath).pipe(import_effect21.Effect.catchAll(() => import_effect21.Effect.succeed(false)));
|
|
2324
2511
|
if (!exists) {
|
|
2325
|
-
return yield*
|
|
2512
|
+
return yield* import_effect21.Effect.fail(
|
|
2326
2513
|
new ConfigFileNotFoundError({ message: `Config file not found at ${filePath}`, filePath })
|
|
2327
2514
|
);
|
|
2328
2515
|
}
|
|
2329
2516
|
const fileContents = yield* fs.readFileString(filePath).pipe(
|
|
2330
|
-
|
|
2517
|
+
import_effect21.Effect.mapError(
|
|
2331
2518
|
() => new ConfigFileParseError({ message: `Failed to read config file at ${filePath}`, filePath })
|
|
2332
2519
|
)
|
|
2333
2520
|
);
|
|
2334
2521
|
if (fileContents.length === 0) {
|
|
2335
|
-
return yield*
|
|
2522
|
+
return yield* import_effect21.Effect.fail(
|
|
2336
2523
|
new ConfigFileEmptyError({ message: `Config file is empty at ${filePath}`, filePath })
|
|
2337
2524
|
);
|
|
2338
2525
|
}
|
|
@@ -2348,7 +2535,7 @@ var RawConfigReader = class extends import_effect20.Effect.Service()("RawConfigR
|
|
|
2348
2535
|
parsed = (0, import_yaml2.parse)(fileContents);
|
|
2349
2536
|
}
|
|
2350
2537
|
} catch (error) {
|
|
2351
|
-
return yield*
|
|
2538
|
+
return yield* import_effect21.Effect.fail(
|
|
2352
2539
|
new ConfigFileParseError({
|
|
2353
2540
|
message: `Failed to parse config file at ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
2354
2541
|
filePath,
|
|
@@ -2358,21 +2545,21 @@ var RawConfigReader = class extends import_effect20.Effect.Service()("RawConfigR
|
|
|
2358
2545
|
}
|
|
2359
2546
|
}
|
|
2360
2547
|
if (parsed == null) {
|
|
2361
|
-
return yield*
|
|
2548
|
+
return yield* import_effect21.Effect.fail(
|
|
2362
2549
|
new ConfigFileParseError({ message: `Config file could not be parsed at ${filePath}`, filePath })
|
|
2363
2550
|
);
|
|
2364
2551
|
}
|
|
2365
2552
|
if (!options?.disableVersionCheck && typeof parsed.version !== "number") {
|
|
2366
|
-
return yield*
|
|
2553
|
+
return yield* import_effect21.Effect.fail(
|
|
2367
2554
|
new ConfigVersionError({ message: `Config file is missing version at ${filePath}`, filePath })
|
|
2368
2555
|
);
|
|
2369
2556
|
}
|
|
2370
2557
|
return parsed;
|
|
2371
2558
|
});
|
|
2372
2559
|
const readConfigFile = (configFilePath) => readRawConfig(configFilePath, { disableVersionCheck: true }).pipe(
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2560
|
+
import_effect21.Effect.map((parsed) => parsed),
|
|
2561
|
+
import_effect21.Effect.catchTag("ConfigFileNotFoundError", () => import_effect21.Effect.succeed(null)),
|
|
2562
|
+
import_effect21.Effect.withSpan("RawConfigReader.readConfigFile")
|
|
2376
2563
|
);
|
|
2377
2564
|
return { findConfig, readRawConfig, readConfigFile };
|
|
2378
2565
|
})
|
|
@@ -2382,17 +2569,17 @@ var RawConfigReader = class extends import_effect20.Effect.Service()("RawConfigR
|
|
|
2382
2569
|
// src/services/schema-validator.ts
|
|
2383
2570
|
var import_ajv = __toESM(require("ajv"));
|
|
2384
2571
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2385
|
-
var
|
|
2386
|
-
var SchemaValidator = class extends
|
|
2387
|
-
effect:
|
|
2572
|
+
var import_effect22 = require("effect");
|
|
2573
|
+
var SchemaValidator = class extends import_effect22.Effect.Service()("SchemaValidator", {
|
|
2574
|
+
effect: import_effect22.Effect.gen(function* () {
|
|
2388
2575
|
const ajv = new import_ajv.default();
|
|
2389
2576
|
(0, import_ajv_formats.default)(ajv);
|
|
2390
|
-
const validate =
|
|
2577
|
+
const validate = import_effect22.Effect.fn("SchemaValidator.validate")(function* (config, schema, filePath) {
|
|
2391
2578
|
const compiledValidate = ajv.compile(schema);
|
|
2392
2579
|
const valid = compiledValidate(config);
|
|
2393
2580
|
if (!valid) {
|
|
2394
2581
|
const errors = compiledValidate.errors?.map((e) => `${e.instancePath || "/"} ${e.message ?? ""}`.trim()) ?? [];
|
|
2395
|
-
return yield*
|
|
2582
|
+
return yield* import_effect22.Effect.fail(
|
|
2396
2583
|
new ConfigSchemaValidationError({
|
|
2397
2584
|
message: `Config file at ${filePath} is invalid: ${ajv.errorsText(compiledValidate.errors)}`,
|
|
2398
2585
|
filePath,
|
|
@@ -2448,7 +2635,7 @@ var getFilesForPattern = async (pattern, projectFolder, excludeFiles = []) => {
|
|
|
2448
2635
|
};
|
|
2449
2636
|
|
|
2450
2637
|
// src/services/v4-config-parser.ts
|
|
2451
|
-
var
|
|
2638
|
+
var import_effect23 = require("effect");
|
|
2452
2639
|
var import_minimatch2 = require("minimatch");
|
|
2453
2640
|
var import_node_path2 = require("path");
|
|
2454
2641
|
var import_safe_regex2 = __toESM(require("safe-regex2"));
|
|
@@ -2599,7 +2786,7 @@ var mapRoute = (route, entrypoints) => ({
|
|
|
2599
2786
|
negativeRequirements: route.missing,
|
|
2600
2787
|
status: route.statusCode
|
|
2601
2788
|
});
|
|
2602
|
-
var parseEntrypoints =
|
|
2789
|
+
var parseEntrypoints = import_effect23.Effect.fn("parseEntrypoints")(function* (config, projectFolder) {
|
|
2603
2790
|
const entrypoints = [];
|
|
2604
2791
|
const dockerFunctions = [];
|
|
2605
2792
|
if (config.functions == null) return { entrypoints, dockerFunctions };
|
|
@@ -2610,7 +2797,7 @@ var parseEntrypoints = import_effect22.Effect.fn("parseEntrypoints")(function* (
|
|
|
2610
2797
|
functionPath: fnPath
|
|
2611
2798
|
});
|
|
2612
2799
|
}
|
|
2613
|
-
const matchedFiles = yield*
|
|
2800
|
+
const matchedFiles = yield* import_effect23.Effect.tryPromise({
|
|
2614
2801
|
try: () => getFilesForPattern(fnPath, projectFolder, func.excludeFiles),
|
|
2615
2802
|
catch: (error) => new FunctionConfigError({
|
|
2616
2803
|
message: `Failed to resolve files for function pattern '${fnPath}': ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -2685,13 +2872,13 @@ var parseEntrypoints = import_effect22.Effect.fn("parseEntrypoints")(function* (
|
|
|
2685
2872
|
}
|
|
2686
2873
|
return { entrypoints, dockerFunctions };
|
|
2687
2874
|
});
|
|
2688
|
-
var collectAssets =
|
|
2875
|
+
var collectAssets = import_effect23.Effect.fn("collectAssets")(function* (config, projectFolder) {
|
|
2689
2876
|
if (config.assets == null) return [];
|
|
2690
2877
|
const assetNames = yield* collectAssetFiles(projectFolder, config.assets);
|
|
2691
2878
|
return assetNames.filter((assetName) => getFunctionSettings(`${config.assets}/${assetName}`, config) == null).map((assetName) => `${config.assets}/${assetName}`);
|
|
2692
2879
|
});
|
|
2693
2880
|
var reservedRuntimePorts = (entrypoint) => entrypoint.runtime === CONTAINER_RUNTIME ? [] : entrypoint.runtime.startsWith("php-") ? [8080, 9e3] : [8080];
|
|
2694
|
-
var parseContainers =
|
|
2881
|
+
var parseContainers = import_effect23.Effect.fn("parseContainers")(function* (config, projectFolder, fileEntrypoints, dockerFunctions) {
|
|
2695
2882
|
const warnings = [];
|
|
2696
2883
|
let containers = {};
|
|
2697
2884
|
if (config.compose != null) {
|
|
@@ -2724,16 +2911,16 @@ var parseContainers = import_effect22.Effect.fn("parseContainers")(function* (co
|
|
|
2724
2911
|
}
|
|
2725
2912
|
return { ...result, warnings };
|
|
2726
2913
|
});
|
|
2727
|
-
var V4ConfigParser = class extends
|
|
2914
|
+
var V4ConfigParser = class extends import_effect23.Effect.Service()("V4ConfigParser", {
|
|
2728
2915
|
accessors: true,
|
|
2729
|
-
effect:
|
|
2916
|
+
effect: import_effect23.Effect.succeed({
|
|
2730
2917
|
/**
|
|
2731
2918
|
* Parses a ConfigV4 into a NormalizedConfig.
|
|
2732
2919
|
*
|
|
2733
2920
|
* @param config - The raw V4 config object
|
|
2734
2921
|
* @param projectFolder - Absolute path to the project root
|
|
2735
2922
|
*/
|
|
2736
|
-
parse:
|
|
2923
|
+
parse: import_effect23.Effect.fn("V4ConfigParser.parse")(function* (config, projectFolder) {
|
|
2737
2924
|
const { entrypoints: fileEntrypoints, dockerFunctions } = yield* parseEntrypoints(config, projectFolder);
|
|
2738
2925
|
const containers = yield* parseContainers(config, projectFolder, fileEntrypoints, dockerFunctions);
|
|
2739
2926
|
const entrypoints = [...fileEntrypoints, ...containers.entrypoints];
|
|
@@ -2775,7 +2962,7 @@ var V4ConfigParser = class extends import_effect22.Effect.Service()("V4ConfigPar
|
|
|
2775
2962
|
};
|
|
2776
2963
|
|
|
2777
2964
|
// src/services/vercel-build-output-parser.ts
|
|
2778
|
-
var
|
|
2965
|
+
var import_platform14 = require("@effect/platform");
|
|
2779
2966
|
|
|
2780
2967
|
// ../commons/src/deep-merge.ts
|
|
2781
2968
|
var deepMerge = (target, ...partials) => {
|
|
@@ -2804,7 +2991,7 @@ var deepMerge = (target, ...partials) => {
|
|
|
2804
2991
|
};
|
|
2805
2992
|
|
|
2806
2993
|
// src/services/vercel-build-output-parser.ts
|
|
2807
|
-
var
|
|
2994
|
+
var import_effect24 = require("effect");
|
|
2808
2995
|
|
|
2809
2996
|
// src/build-output-v3/determine-repo-root.ts
|
|
2810
2997
|
var import_path = __toESM(require("path"));
|
|
@@ -2900,11 +3087,11 @@ var translateVercelRuntime = (runtime) => {
|
|
|
2900
3087
|
var CONFIG_PATH = ".vercel/output/config.json";
|
|
2901
3088
|
var FUNCTIONS_FOLDER = ".vercel/output/functions";
|
|
2902
3089
|
var FUNCTION_CONFIGS_PATTERN = `${FUNCTIONS_FOLDER}/**/*.func/.vc-config.json`;
|
|
2903
|
-
var VercelBuildOutputParser = class extends
|
|
2904
|
-
effect:
|
|
3090
|
+
var VercelBuildOutputParser = class extends import_effect24.Effect.Service()("VercelBuildOutputParser", {
|
|
3091
|
+
effect: import_effect24.Effect.gen(function* () {
|
|
2905
3092
|
const rawConfigReader = yield* RawConfigReader;
|
|
2906
|
-
const pathService = yield*
|
|
2907
|
-
const parse =
|
|
3093
|
+
const pathService = yield* import_platform14.Path.Path;
|
|
3094
|
+
const parse = import_effect24.Effect.fn("VercelBuildOutputParser.parse")(function* (parseResult, projectFolder) {
|
|
2908
3095
|
const config = yield* rawConfigReader.readConfigFile(pathService.join(projectFolder, CONFIG_PATH));
|
|
2909
3096
|
if (!config || typeof config.version !== "number" || config.version < 3) {
|
|
2910
3097
|
return parseResult;
|
|
@@ -2916,8 +3103,8 @@ var VercelBuildOutputParser = class extends import_effect23.Effect.Service()("Ve
|
|
|
2916
3103
|
merged.regions = [...new Set(merged.regions)];
|
|
2917
3104
|
return merged;
|
|
2918
3105
|
});
|
|
2919
|
-
const loadFunctions =
|
|
2920
|
-
const functionConfigs = yield*
|
|
3106
|
+
const loadFunctions = import_effect24.Effect.fn("VercelBuildOutputParser.loadFunctions")(function* (config, parseResult, projectFolder) {
|
|
3107
|
+
const functionConfigs = yield* import_effect24.Effect.tryPromise({
|
|
2921
3108
|
try: () => getFilesForPattern(FUNCTION_CONFIGS_PATTERN, projectFolder),
|
|
2922
3109
|
catch: (error) => new ConfigFileParseError({
|
|
2923
3110
|
message: `Failed to scan for function configs: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -3834,7 +4021,7 @@ var schema_default = {
|
|
|
3834
4021
|
};
|
|
3835
4022
|
|
|
3836
4023
|
// src/parse-config.ts
|
|
3837
|
-
var parseConfigRaw =
|
|
4024
|
+
var parseConfigRaw = import_effect25.Effect.fn("parseConfigRaw")(function* (filePath, projectFolder) {
|
|
3838
4025
|
const rawReader = yield* RawConfigReader;
|
|
3839
4026
|
const validator = yield* SchemaValidator;
|
|
3840
4027
|
const v4Parser = yield* V4ConfigParser;
|
|
@@ -3845,7 +4032,7 @@ var parseConfigRaw = import_effect24.Effect.fn("parseConfigRaw")(function* (file
|
|
|
3845
4032
|
};
|
|
3846
4033
|
const schema = schemaMap[version];
|
|
3847
4034
|
if (!schema) {
|
|
3848
|
-
return yield*
|
|
4035
|
+
return yield* import_effect25.Effect.fail(
|
|
3849
4036
|
new ConfigVersionError({
|
|
3850
4037
|
message: `Config file at ${filePath} has an unsupported version: ${version}`,
|
|
3851
4038
|
filePath,
|
|
@@ -3856,11 +4043,11 @@ var parseConfigRaw = import_effect24.Effect.fn("parseConfigRaw")(function* (file
|
|
|
3856
4043
|
yield* validator.validate(parsed, schema, filePath);
|
|
3857
4044
|
return yield* v4Parser.parse(parsed, projectFolder);
|
|
3858
4045
|
});
|
|
3859
|
-
var parseConfig =
|
|
4046
|
+
var parseConfig = import_effect25.Effect.fn("parseConfig")(function* (filePath, projectFolder) {
|
|
3860
4047
|
const parseResult = yield* parseConfigRaw(filePath, projectFolder);
|
|
3861
4048
|
return yield* postProcessConfig(parseResult, projectFolder);
|
|
3862
4049
|
});
|
|
3863
|
-
var postProcessConfig =
|
|
4050
|
+
var postProcessConfig = import_effect25.Effect.fn("postProcessConfig")(function* (config, projectFolder) {
|
|
3864
4051
|
const vercelParser = yield* VercelBuildOutputParser;
|
|
3865
4052
|
let result = yield* vercelParser.parse(config, projectFolder);
|
|
3866
4053
|
const hasAssets = (result.assets?.paths?.length ?? 0) > 0 || (result.assets?.prefixes?.length ?? 0) > 0 || (result.assets?.manifests?.length ?? 0) > 0;
|
|
@@ -3917,14 +4104,14 @@ var RUNTIME_DEFINITIONS = [
|
|
|
3917
4104
|
var AVAILABLE_RUNTIMES = [...RUNTIME_DEFINITIONS];
|
|
3918
4105
|
|
|
3919
4106
|
// src/services/index.ts
|
|
3920
|
-
var
|
|
3921
|
-
var BaseLayers =
|
|
4107
|
+
var import_effect26 = require("effect");
|
|
4108
|
+
var BaseLayers = import_effect26.Layer.mergeAll(
|
|
3922
4109
|
ConfigModuleLoader.Default,
|
|
3923
4110
|
RawConfigReader.Default,
|
|
3924
4111
|
SchemaValidator.Default,
|
|
3925
4112
|
V4ConfigParser.Default
|
|
3926
4113
|
);
|
|
3927
|
-
var NetworkConfigLive = VercelBuildOutputParser.Default.pipe(
|
|
4114
|
+
var NetworkConfigLive = VercelBuildOutputParser.Default.pipe(import_effect26.Layer.provideMerge(BaseLayers));
|
|
3928
4115
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3929
4116
|
0 && (module.exports = {
|
|
3930
4117
|
ALLOWED_CONFIG_NAMES,
|