@gigadrive/network-config 5.4.0 → 5.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/define-config.d.mts +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/index.d.mts +103 -7
- package/dist/index.d.ts +103 -7
- package/dist/index.js +856 -374
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +846 -369
- package/dist/index.mjs.map +1 -1
- package/dist/nextjs-adapter.js +11 -0
- package/dist/nextjs-adapter.js.map +1 -1
- package/dist/nextjs-adapter.mjs +11 -0
- package/dist/nextjs-adapter.mjs.map +1 -1
- package/dist/nextjs-cache-handler.js +6 -1
- package/dist/nextjs-cache-handler.js.map +1 -1
- package/dist/nextjs-cache-handler.mjs +6 -1
- package/dist/nextjs-cache-handler.mjs.map +1 -1
- package/dist/v4/schema.json +14 -2
- package/package.json +1 -1
- package/src/v4/schema.json +14 -2
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ __export(src_exports, {
|
|
|
46
46
|
ContainerConfigError: () => ContainerConfigError,
|
|
47
47
|
DEFAULT_CONTAINER_MEMORY_MB: () => DEFAULT_CONTAINER_MEMORY_MB,
|
|
48
48
|
DEFAULT_FUNCTION_DURATION_SECONDS: () => DEFAULT_FUNCTION_DURATION_SECONDS,
|
|
49
|
+
DEFAULT_RUBY_RUNTIME: () => DEFAULT_RUBY_RUNTIME,
|
|
49
50
|
DEFAULT_SIDECAR_MEMORY_MB: () => DEFAULT_SIDECAR_MEMORY_MB,
|
|
50
51
|
FRAMEWORK_DEFINITIONS: () => FRAMEWORK_DEFINITIONS,
|
|
51
52
|
FrameworkNotDetectedError: () => FrameworkNotDetectedError,
|
|
@@ -82,6 +83,7 @@ __export(src_exports, {
|
|
|
82
83
|
detectContainerProject: () => detectContainerProject,
|
|
83
84
|
detectFramework: () => detectFramework,
|
|
84
85
|
detectPackageManager: () => detectPackageManager,
|
|
86
|
+
detectRubyRuntime: () => detectRubyRuntime,
|
|
85
87
|
dockerFunctionContainerName: () => dockerFunctionContainerName,
|
|
86
88
|
filterFunctionsFromAssets: () => filterFunctionsFromAssets,
|
|
87
89
|
generateConfig: () => generateConfig,
|
|
@@ -97,6 +99,9 @@ __export(src_exports, {
|
|
|
97
99
|
postProcessConfig: () => postProcessConfig,
|
|
98
100
|
readComposeContainers: () => readComposeContainers,
|
|
99
101
|
readDependencies: () => readDependencies,
|
|
102
|
+
rubyRuntimeForRequirement: () => rubyRuntimeForRequirement,
|
|
103
|
+
rubyRuntimeForVersion: () => rubyRuntimeForVersion,
|
|
104
|
+
rubyRuntimeFromProjectFiles: () => rubyRuntimeFromProjectFiles,
|
|
100
105
|
splitCommandWords: () => splitCommandWords
|
|
101
106
|
});
|
|
102
107
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -1008,8 +1013,8 @@ var detectContainerProject = import_effect6.Effect.fn("detectContainerProject")(
|
|
|
1008
1013
|
});
|
|
1009
1014
|
|
|
1010
1015
|
// src/detection/detect-framework.ts
|
|
1011
|
-
var
|
|
1012
|
-
var
|
|
1016
|
+
var import_platform16 = require("@effect/platform");
|
|
1017
|
+
var import_effect24 = require("effect");
|
|
1013
1018
|
|
|
1014
1019
|
// src/detection/detect-package-manager.ts
|
|
1015
1020
|
var import_platform4 = require("@effect/platform");
|
|
@@ -1019,7 +1024,10 @@ var LOCKFILE_MAP = [
|
|
|
1019
1024
|
{ files: ["pnpm-lock.yaml"], pm: "pnpm" },
|
|
1020
1025
|
{ files: ["yarn.lock"], pm: "yarn" },
|
|
1021
1026
|
{ files: ["package-lock.json"], pm: "npm" },
|
|
1022
|
-
{ files: ["composer.lock"], pm: "composer" }
|
|
1027
|
+
{ files: ["composer.lock"], pm: "composer" },
|
|
1028
|
+
// A Gemfile is checked last and counts even without its lockfile: Bundler
|
|
1029
|
+
// resolves and writes Gemfile.lock on the first install.
|
|
1030
|
+
{ files: ["Gemfile.lock", "Gemfile"], pm: "bundler" }
|
|
1023
1031
|
];
|
|
1024
1032
|
var detectPackageManager = import_effect7.Effect.fn("detectPackageManager")(function* (projectFolder) {
|
|
1025
1033
|
const fs = yield* import_platform4.FileSystem.FileSystem;
|
|
@@ -1058,6 +1066,192 @@ var astro = {
|
|
|
1058
1066
|
})
|
|
1059
1067
|
};
|
|
1060
1068
|
|
|
1069
|
+
// src/detection/frameworks/ruby-runtime.ts
|
|
1070
|
+
var import_platform5 = require("@effect/platform");
|
|
1071
|
+
var import_effect8 = require("effect");
|
|
1072
|
+
|
|
1073
|
+
// src/detection/frameworks/ruby-requirement.ts
|
|
1074
|
+
var RUBY_VERSION = /^(?:ruby-)?(\d+(?:\.\d+)*)(?:p\d+)?(?:[-.]?(?:preview|rc|dev|alpha|beta|pre)\d*)?$/i;
|
|
1075
|
+
var REQUIREMENT_ATOM = /^(~>|>=|<=|!=|=|>|<)?\s*(\S+)$/;
|
|
1076
|
+
var parseRubyVersion = (text) => {
|
|
1077
|
+
const match = RUBY_VERSION.exec(text);
|
|
1078
|
+
return match ? match[1].split(".").map(Number) : void 0;
|
|
1079
|
+
};
|
|
1080
|
+
var compareRubyVersions = (a, b) => {
|
|
1081
|
+
for (let index = 0; index < Math.max(a.length, b.length); index++) {
|
|
1082
|
+
const difference = (a[index] ?? 0) - (b[index] ?? 0);
|
|
1083
|
+
if (difference !== 0) {
|
|
1084
|
+
return difference;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
return 0;
|
|
1088
|
+
};
|
|
1089
|
+
var pessimisticUpperBound = (segments) => {
|
|
1090
|
+
const kept = segments.length > 1 ? segments.slice(0, -1) : [...segments];
|
|
1091
|
+
kept[kept.length - 1] += 1;
|
|
1092
|
+
return kept;
|
|
1093
|
+
};
|
|
1094
|
+
var parseRubyRequirement = (requirement) => {
|
|
1095
|
+
const parts = requirement.split(",").map((part) => part.trim());
|
|
1096
|
+
const atoms = [];
|
|
1097
|
+
for (const part of parts) {
|
|
1098
|
+
const match = REQUIREMENT_ATOM.exec(part);
|
|
1099
|
+
const segments = match ? parseRubyVersion(match[2]) : void 0;
|
|
1100
|
+
if (!match || !segments) {
|
|
1101
|
+
return void 0;
|
|
1102
|
+
}
|
|
1103
|
+
atoms.push({ operator: match[1] ?? "=", segments });
|
|
1104
|
+
}
|
|
1105
|
+
return atoms;
|
|
1106
|
+
};
|
|
1107
|
+
var atomAllows = ({ operator, segments }, version) => {
|
|
1108
|
+
const comparison = compareRubyVersions(version, segments);
|
|
1109
|
+
switch (operator) {
|
|
1110
|
+
case "=":
|
|
1111
|
+
return comparison === 0;
|
|
1112
|
+
case "!=":
|
|
1113
|
+
return comparison !== 0;
|
|
1114
|
+
case ">":
|
|
1115
|
+
return comparison > 0;
|
|
1116
|
+
case "<":
|
|
1117
|
+
return comparison < 0;
|
|
1118
|
+
case ">=":
|
|
1119
|
+
return comparison >= 0;
|
|
1120
|
+
case "<=":
|
|
1121
|
+
return comparison <= 0;
|
|
1122
|
+
case "~>":
|
|
1123
|
+
return comparison >= 0 && compareRubyVersions(version, pessimisticUpperBound(segments)) < 0;
|
|
1124
|
+
}
|
|
1125
|
+
};
|
|
1126
|
+
var rubyRequirementAllows = (requirement, version) => {
|
|
1127
|
+
const atoms = parseRubyRequirement(requirement);
|
|
1128
|
+
const segments = parseRubyVersion(version);
|
|
1129
|
+
if (!atoms || !segments) {
|
|
1130
|
+
return void 0;
|
|
1131
|
+
}
|
|
1132
|
+
return atoms.every((atom) => atomAllows(atom, segments));
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
// src/detection/frameworks/ruby-runtime.ts
|
|
1136
|
+
var DEFAULT_RUBY_RUNTIME = "ruby-34";
|
|
1137
|
+
var RUBY_RUNTIME_CANDIDATES = [
|
|
1138
|
+
{ runtime: "ruby-40", series: [4, 0], newestVersion: "4.0.9999" },
|
|
1139
|
+
{ runtime: "ruby-34", series: [3, 4], newestVersion: "3.4.9999" },
|
|
1140
|
+
{ runtime: "ruby-33", series: [3, 3], newestVersion: "3.3.9999" }
|
|
1141
|
+
];
|
|
1142
|
+
var rubyRuntimeForVersion = (version) => {
|
|
1143
|
+
const segments = parseRubyVersion(version);
|
|
1144
|
+
if (!segments) {
|
|
1145
|
+
return void 0;
|
|
1146
|
+
}
|
|
1147
|
+
const series = [segments[0], segments[1] ?? 0];
|
|
1148
|
+
const candidate = RUBY_RUNTIME_CANDIDATES.find((candidate2) => compareRubyVersions(candidate2.series, series) <= 0);
|
|
1149
|
+
return (candidate ?? RUBY_RUNTIME_CANDIDATES[RUBY_RUNTIME_CANDIDATES.length - 1]).runtime;
|
|
1150
|
+
};
|
|
1151
|
+
var rubyRuntimeForRequirement = (requirement) => {
|
|
1152
|
+
const atoms = parseRubyRequirement(requirement);
|
|
1153
|
+
if (!atoms) {
|
|
1154
|
+
return void 0;
|
|
1155
|
+
}
|
|
1156
|
+
if (atoms.length === 1 && atoms[0].operator === "=") {
|
|
1157
|
+
return rubyRuntimeForVersion(atoms[0].segments.join("."));
|
|
1158
|
+
}
|
|
1159
|
+
return RUBY_RUNTIME_CANDIDATES.find(({ newestVersion }) => rubyRequirementAllows(requirement, newestVersion) === true)?.runtime;
|
|
1160
|
+
};
|
|
1161
|
+
var versionFromRubyVersionFile = (content) => content.split(/\r?\n/).map((line) => line.trim()).find((line) => line !== "" && !line.startsWith("#"))?.split(/\s/)[0]?.split("@")[0];
|
|
1162
|
+
var versionFromToolVersionsFile = (content) => /^\s*ruby\s+(\S+)/m.exec(content)?.[1];
|
|
1163
|
+
var versionFromGemfileLock = (content) => /^RUBY VERSION\r?\n\s+ruby\s+(\S+)/m.exec(content)?.[1];
|
|
1164
|
+
var GEMFILE_RUBY_DIRECTIVE = /^\s*ruby[\s(]+(.+)$/m;
|
|
1165
|
+
var GEMFILE_RUBY_FILE = /^(?:file:|:file\s*=>|File\.read\s*\(?)\s*(['"])([^'"]+)\1/;
|
|
1166
|
+
var LEADING_STRINGS = /^\s*(['"])([^'"]*)\1\s*(?:,|\)|#|$)/;
|
|
1167
|
+
var RUBY_VERSION_FILES = [".ruby-version", ".tool-versions", "Gemfile", "Gemfile.lock"];
|
|
1168
|
+
var gemfileRubyDirective = (gemfile) => GEMFILE_RUBY_DIRECTIVE.exec(gemfile)?.[1]?.trim();
|
|
1169
|
+
var gemfileRubyVersionFile = (gemfile) => {
|
|
1170
|
+
const directive = gemfileRubyDirective(gemfile);
|
|
1171
|
+
return directive === void 0 ? void 0 : GEMFILE_RUBY_FILE.exec(directive)?.[2];
|
|
1172
|
+
};
|
|
1173
|
+
var runtimeFromVersionFile = (file, content) => {
|
|
1174
|
+
if (content === void 0) {
|
|
1175
|
+
return void 0;
|
|
1176
|
+
}
|
|
1177
|
+
const parse = file.split("/").at(-1) === ".tool-versions" ? versionFromToolVersionsFile : versionFromRubyVersionFile;
|
|
1178
|
+
const version = parse(content);
|
|
1179
|
+
return version === void 0 ? void 0 : rubyRuntimeForVersion(version);
|
|
1180
|
+
};
|
|
1181
|
+
var runtimeFromGemfile = (gemfile, readFile) => {
|
|
1182
|
+
const directive = gemfile === void 0 ? void 0 : gemfileRubyDirective(gemfile);
|
|
1183
|
+
if (directive === void 0) {
|
|
1184
|
+
return void 0;
|
|
1185
|
+
}
|
|
1186
|
+
const versionFile = GEMFILE_RUBY_FILE.exec(directive)?.[2];
|
|
1187
|
+
if (versionFile !== void 0) {
|
|
1188
|
+
return runtimeFromVersionFile(versionFile, readFile(versionFile));
|
|
1189
|
+
}
|
|
1190
|
+
const requirements = [];
|
|
1191
|
+
let rest = directive;
|
|
1192
|
+
for (let match = LEADING_STRINGS.exec(rest); match; match = LEADING_STRINGS.exec(rest)) {
|
|
1193
|
+
requirements.push(match[2]);
|
|
1194
|
+
rest = rest.slice(match[0].length);
|
|
1195
|
+
}
|
|
1196
|
+
return requirements.length === 0 ? void 0 : rubyRuntimeForRequirement(requirements.join(","));
|
|
1197
|
+
};
|
|
1198
|
+
var runtimeFromGemfileLock = (lockfile) => {
|
|
1199
|
+
const version = lockfile === void 0 ? void 0 : versionFromGemfileLock(lockfile);
|
|
1200
|
+
return version === void 0 ? void 0 : rubyRuntimeForVersion(version);
|
|
1201
|
+
};
|
|
1202
|
+
var rubyRuntimeFromProjectFiles = (readFile) => runtimeFromVersionFile(".ruby-version", readFile(".ruby-version")) ?? runtimeFromVersionFile(".tool-versions", readFile(".tool-versions")) ?? runtimeFromGemfile(readFile("Gemfile"), readFile) ?? runtimeFromGemfileLock(readFile("Gemfile.lock"));
|
|
1203
|
+
var readProjectFile = import_effect8.Effect.fn("readProjectFile")(
|
|
1204
|
+
function* (projectFolder, file) {
|
|
1205
|
+
const fs = yield* import_platform5.FileSystem.FileSystem;
|
|
1206
|
+
const pathService = yield* import_platform5.Path.Path;
|
|
1207
|
+
return yield* fs.readFileString(pathService.join(projectFolder, file));
|
|
1208
|
+
},
|
|
1209
|
+
import_effect8.Effect.catchAll(() => import_effect8.Effect.succeed(void 0))
|
|
1210
|
+
);
|
|
1211
|
+
var detectRubyRuntime = import_effect8.Effect.fn("detectRubyRuntime")(function* (projectFolder) {
|
|
1212
|
+
const files = /* @__PURE__ */ new Map();
|
|
1213
|
+
for (const file of RUBY_VERSION_FILES) {
|
|
1214
|
+
files.set(file, yield* readProjectFile(projectFolder, file));
|
|
1215
|
+
}
|
|
1216
|
+
const gemfile = files.get("Gemfile");
|
|
1217
|
+
const versionFile = gemfile === void 0 ? void 0 : gemfileRubyVersionFile(gemfile);
|
|
1218
|
+
if (versionFile !== void 0 && !files.has(versionFile)) {
|
|
1219
|
+
files.set(versionFile, yield* readProjectFile(projectFolder, versionFile));
|
|
1220
|
+
}
|
|
1221
|
+
return rubyRuntimeFromProjectFiles((file) => files.get(file));
|
|
1222
|
+
});
|
|
1223
|
+
var refineRubyRuntime = import_effect8.Effect.fn("refineRubyRuntime")(function* (defaults, projectFolder) {
|
|
1224
|
+
const runtime = yield* detectRubyRuntime(projectFolder);
|
|
1225
|
+
return runtime ? { ...defaults, runtime } : defaults;
|
|
1226
|
+
});
|
|
1227
|
+
var withRubyRuntime = (framework) => ({
|
|
1228
|
+
...framework,
|
|
1229
|
+
refineDefaultConfig: (defaults, projectFolder) => import_effect8.Effect.gen(function* () {
|
|
1230
|
+
const refined = framework.refineDefaultConfig ? yield* framework.refineDefaultConfig(defaults, projectFolder) : defaults;
|
|
1231
|
+
return yield* refineRubyRuntime(refined, projectFolder);
|
|
1232
|
+
})
|
|
1233
|
+
});
|
|
1234
|
+
|
|
1235
|
+
// src/detection/frameworks/bridgetown.ts
|
|
1236
|
+
var bridgetown = {
|
|
1237
|
+
slug: "bridgetown",
|
|
1238
|
+
name: "Bridgetown",
|
|
1239
|
+
language: "ruby",
|
|
1240
|
+
detectors: [{ matchPackage: "bridgetown" }],
|
|
1241
|
+
priority: 70,
|
|
1242
|
+
getDefaultConfig: () => ({
|
|
1243
|
+
runtime: DEFAULT_RUBY_RUNTIME,
|
|
1244
|
+
memory: 128,
|
|
1245
|
+
maxDuration: 30,
|
|
1246
|
+
streaming: false,
|
|
1247
|
+
commands: ["bin/bridgetown deploy"],
|
|
1248
|
+
assetsDir: "output",
|
|
1249
|
+
populateAssetCache: true,
|
|
1250
|
+
routes: [],
|
|
1251
|
+
environmentVariables: { BRIDGETOWN_ENV: "production" }
|
|
1252
|
+
})
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1061
1255
|
// src/detection/generated-secret.ts
|
|
1062
1256
|
var generatedSecret = (format) => `{{gigadrive.secret:${format}}}`;
|
|
1063
1257
|
|
|
@@ -1132,8 +1326,8 @@ var codeigniter = {
|
|
|
1132
1326
|
};
|
|
1133
1327
|
|
|
1134
1328
|
// src/detection/frameworks/resolve-node-entrypoint.ts
|
|
1135
|
-
var
|
|
1136
|
-
var
|
|
1329
|
+
var import_platform6 = require("@effect/platform");
|
|
1330
|
+
var import_effect9 = require("effect");
|
|
1137
1331
|
var SCRIPT_RUNNERS = /* @__PURE__ */ new Set(["node", "bun", "tsx", "ts-node"]);
|
|
1138
1332
|
var COMMON_ENTRYPOINT_CANDIDATES = [
|
|
1139
1333
|
"index.js",
|
|
@@ -1181,14 +1375,14 @@ var applyEntrypoint = (defaults, entrypoint) => ({
|
|
|
1181
1375
|
(route) => route.destination === defaults.entrypoint ? { ...route, destination: entrypoint } : route
|
|
1182
1376
|
)
|
|
1183
1377
|
});
|
|
1184
|
-
var resolveNodeServerEntrypoint = (defaults, projectFolder) =>
|
|
1185
|
-
const fs = yield*
|
|
1186
|
-
const pathService = yield*
|
|
1378
|
+
var resolveNodeServerEntrypoint = (defaults, projectFolder) => import_effect9.Effect.gen(function* () {
|
|
1379
|
+
const fs = yield* import_platform6.FileSystem.FileSystem;
|
|
1380
|
+
const pathService = yield* import_platform6.Path.Path;
|
|
1187
1381
|
const isFile = (relativePath) => fs.stat(pathService.join(projectFolder, relativePath)).pipe(
|
|
1188
|
-
|
|
1189
|
-
|
|
1382
|
+
import_effect9.Effect.map((info) => info.type === "File"),
|
|
1383
|
+
import_effect9.Effect.catchAll(() => import_effect9.Effect.succeed(false))
|
|
1190
1384
|
);
|
|
1191
|
-
const content = yield* fs.readFileString(pathService.join(projectFolder, "package.json")).pipe(
|
|
1385
|
+
const content = yield* fs.readFileString(pathService.join(projectFolder, "package.json")).pipe(import_effect9.Effect.catchAll(() => import_effect9.Effect.succeed(void 0)));
|
|
1192
1386
|
const manifest = content ? parsePackageJson(content) : void 0;
|
|
1193
1387
|
const startScript = typeof manifest?.scripts?.start === "string" ? manifest.scripts.start : void 0;
|
|
1194
1388
|
const candidates = [
|
|
@@ -1268,6 +1462,189 @@ var fastify = {
|
|
|
1268
1462
|
refineDefaultConfig: resolveNodeServerEntrypoint
|
|
1269
1463
|
};
|
|
1270
1464
|
|
|
1465
|
+
// src/detection/frameworks/hanami.ts
|
|
1466
|
+
var import_effect13 = require("effect");
|
|
1467
|
+
|
|
1468
|
+
// src/detection/read-dependencies.ts
|
|
1469
|
+
var import_platform7 = require("@effect/platform");
|
|
1470
|
+
var import_effect11 = require("effect");
|
|
1471
|
+
|
|
1472
|
+
// src/detection/types.ts
|
|
1473
|
+
var import_effect10 = require("effect");
|
|
1474
|
+
var ManifestNotFoundError = class extends import_effect10.Schema.TaggedError()("ManifestNotFoundError", {
|
|
1475
|
+
message: import_effect10.Schema.String,
|
|
1476
|
+
filePath: import_effect10.Schema.String
|
|
1477
|
+
}) {
|
|
1478
|
+
};
|
|
1479
|
+
var ManifestReadError = class extends import_effect10.Schema.TaggedError()("ManifestReadError", {
|
|
1480
|
+
message: import_effect10.Schema.String,
|
|
1481
|
+
filePath: import_effect10.Schema.String
|
|
1482
|
+
}) {
|
|
1483
|
+
};
|
|
1484
|
+
var ManifestParseError = class extends import_effect10.Schema.TaggedError()("ManifestParseError", {
|
|
1485
|
+
message: import_effect10.Schema.String,
|
|
1486
|
+
filePath: import_effect10.Schema.String
|
|
1487
|
+
}) {
|
|
1488
|
+
};
|
|
1489
|
+
var FrameworkNotDetectedError = class extends import_effect10.Schema.TaggedError()(
|
|
1490
|
+
"FrameworkNotDetectedError",
|
|
1491
|
+
{
|
|
1492
|
+
message: import_effect10.Schema.String,
|
|
1493
|
+
directory: import_effect10.Schema.String
|
|
1494
|
+
}
|
|
1495
|
+
) {
|
|
1496
|
+
};
|
|
1497
|
+
|
|
1498
|
+
// src/detection/read-dependencies.ts
|
|
1499
|
+
var MANIFEST_CONFIG = {
|
|
1500
|
+
node: { file: "package.json", depKeys: ["dependencies", "devDependencies"] },
|
|
1501
|
+
php: { file: "composer.json", depKeys: ["require", "require-dev"] }
|
|
1502
|
+
};
|
|
1503
|
+
var GEMFILE_LOCK_SOURCE_SECTIONS = /* @__PURE__ */ new Set(["GEM", "GIT", "PATH"]);
|
|
1504
|
+
var GEMFILE_LOCK_SPEC = /^ {4}([A-Za-z0-9_.-]+) \(/;
|
|
1505
|
+
var GEMFILE_GEM = /^\s*gem[\s(]+['"]([^'"]+)['"]/;
|
|
1506
|
+
var parseGemfileLock = (content) => {
|
|
1507
|
+
const gems = /* @__PURE__ */ new Set();
|
|
1508
|
+
let inSourceSection = false;
|
|
1509
|
+
for (const line of content.split(/\r?\n/)) {
|
|
1510
|
+
if (/^\S/.test(line)) {
|
|
1511
|
+
inSourceSection = GEMFILE_LOCK_SOURCE_SECTIONS.has(line.trim());
|
|
1512
|
+
continue;
|
|
1513
|
+
}
|
|
1514
|
+
const match = inSourceSection ? GEMFILE_LOCK_SPEC.exec(line) : null;
|
|
1515
|
+
if (match) {
|
|
1516
|
+
gems.add(match[1]);
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
return gems;
|
|
1520
|
+
};
|
|
1521
|
+
var parseGemfile = (content) => {
|
|
1522
|
+
const gems = /* @__PURE__ */ new Set();
|
|
1523
|
+
for (const line of content.split(/\r?\n/)) {
|
|
1524
|
+
const match = GEMFILE_GEM.exec(line);
|
|
1525
|
+
if (match) {
|
|
1526
|
+
gems.add(match[1]);
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
return gems;
|
|
1530
|
+
};
|
|
1531
|
+
var readOptionalText = import_effect11.Effect.fn("readOptionalText")(function* (filePath) {
|
|
1532
|
+
const fs = yield* import_platform7.FileSystem.FileSystem;
|
|
1533
|
+
const exists = yield* fs.exists(filePath).pipe(import_effect11.Effect.catchAll(() => import_effect11.Effect.succeed(false)));
|
|
1534
|
+
if (!exists) {
|
|
1535
|
+
return void 0;
|
|
1536
|
+
}
|
|
1537
|
+
return yield* fs.readFileString(filePath).pipe(import_effect11.Effect.mapError(() => new ManifestReadError({ message: "Failed to read manifest", filePath })));
|
|
1538
|
+
});
|
|
1539
|
+
var readGemNames = import_effect11.Effect.fn("readGemNames")(function* (projectFolder) {
|
|
1540
|
+
const pathService = yield* import_platform7.Path.Path;
|
|
1541
|
+
const lockfile = yield* readOptionalText(pathService.join(projectFolder, "Gemfile.lock"));
|
|
1542
|
+
if (lockfile !== void 0) {
|
|
1543
|
+
return parseGemfileLock(lockfile);
|
|
1544
|
+
}
|
|
1545
|
+
const gemfile = yield* readOptionalText(pathService.join(projectFolder, "Gemfile"));
|
|
1546
|
+
return gemfile === void 0 ? /* @__PURE__ */ new Set() : parseGemfile(gemfile);
|
|
1547
|
+
});
|
|
1548
|
+
var readManifest = import_effect11.Effect.fn("readManifest")(function* (filePath) {
|
|
1549
|
+
const fs = yield* import_platform7.FileSystem.FileSystem;
|
|
1550
|
+
const exists = yield* fs.exists(filePath).pipe(import_effect11.Effect.catchAll(() => import_effect11.Effect.succeed(false)));
|
|
1551
|
+
if (!exists) {
|
|
1552
|
+
return yield* import_effect11.Effect.fail(new ManifestNotFoundError({ message: "Manifest not found", filePath }));
|
|
1553
|
+
}
|
|
1554
|
+
const content = yield* fs.readFileString(filePath).pipe(import_effect11.Effect.mapError(() => new ManifestReadError({ message: "Failed to read manifest", filePath })));
|
|
1555
|
+
const parsed = yield* import_effect11.Effect.try({
|
|
1556
|
+
try: () => JSON.parse(content),
|
|
1557
|
+
catch: () => new ManifestParseError({ message: "Failed to parse manifest JSON", filePath })
|
|
1558
|
+
});
|
|
1559
|
+
return parsed;
|
|
1560
|
+
});
|
|
1561
|
+
var readDependencies = import_effect11.Effect.fn("readDependencies")(function* (projectFolder, language) {
|
|
1562
|
+
if (language === "ruby") {
|
|
1563
|
+
return yield* readGemNames(projectFolder);
|
|
1564
|
+
}
|
|
1565
|
+
const pathService = yield* import_platform7.Path.Path;
|
|
1566
|
+
const config = MANIFEST_CONFIG[language];
|
|
1567
|
+
const filePath = pathService.join(projectFolder, config.file);
|
|
1568
|
+
const manifest = yield* readManifest(filePath).pipe(
|
|
1569
|
+
import_effect11.Effect.catchTag("ManifestNotFoundError", () => import_effect11.Effect.succeed(null))
|
|
1570
|
+
);
|
|
1571
|
+
if (!manifest) {
|
|
1572
|
+
return /* @__PURE__ */ new Set();
|
|
1573
|
+
}
|
|
1574
|
+
const deps = /* @__PURE__ */ new Set();
|
|
1575
|
+
for (const key of config.depKeys) {
|
|
1576
|
+
const section = manifest[key];
|
|
1577
|
+
if (section && typeof section === "object" && !Array.isArray(section)) {
|
|
1578
|
+
for (const name of Object.keys(section)) {
|
|
1579
|
+
deps.add(name);
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
return deps;
|
|
1584
|
+
});
|
|
1585
|
+
|
|
1586
|
+
// src/detection/frameworks/ruby-server.ts
|
|
1587
|
+
var import_platform8 = require("@effect/platform");
|
|
1588
|
+
var import_effect12 = require("effect");
|
|
1589
|
+
var rubyServerDefaults = ({
|
|
1590
|
+
entrypoint = "config.ru",
|
|
1591
|
+
memory = 256,
|
|
1592
|
+
commands = [],
|
|
1593
|
+
environmentVariables,
|
|
1594
|
+
excludeFiles,
|
|
1595
|
+
writablePaths = []
|
|
1596
|
+
}) => ({
|
|
1597
|
+
runtime: DEFAULT_RUBY_RUNTIME,
|
|
1598
|
+
memory,
|
|
1599
|
+
maxDuration: 30,
|
|
1600
|
+
streaming: true,
|
|
1601
|
+
commands,
|
|
1602
|
+
entrypoint,
|
|
1603
|
+
assetsDir: "public",
|
|
1604
|
+
populateAssetCache: true,
|
|
1605
|
+
routes: [{ source: "/*", destination: entrypoint }],
|
|
1606
|
+
environmentVariables,
|
|
1607
|
+
...excludeFiles ? { excludeFiles } : {},
|
|
1608
|
+
...writablePaths.length > 0 ? { package: { writablePaths } } : {}
|
|
1609
|
+
});
|
|
1610
|
+
var refineRubyPublicDirectory = import_effect12.Effect.fn("refineRubyPublicDirectory")(function* (defaults, projectFolder) {
|
|
1611
|
+
if (!defaults.assetsDir) {
|
|
1612
|
+
return defaults;
|
|
1613
|
+
}
|
|
1614
|
+
const fs = yield* import_platform8.FileSystem.FileSystem;
|
|
1615
|
+
const pathService = yield* import_platform8.Path.Path;
|
|
1616
|
+
const exists = yield* fs.exists(pathService.join(projectFolder, defaults.assetsDir)).pipe(import_effect12.Effect.catchAll(() => import_effect12.Effect.succeed(false)));
|
|
1617
|
+
if (exists) {
|
|
1618
|
+
return defaults;
|
|
1619
|
+
}
|
|
1620
|
+
const withoutAssets = { ...defaults };
|
|
1621
|
+
delete withoutAssets.assetsDir;
|
|
1622
|
+
delete withoutAssets.populateAssetCache;
|
|
1623
|
+
return withoutAssets;
|
|
1624
|
+
});
|
|
1625
|
+
|
|
1626
|
+
// src/detection/frameworks/hanami.ts
|
|
1627
|
+
var refineHanamiAssets = import_effect13.Effect.fn("refineHanamiAssets")(function* (defaults, projectFolder) {
|
|
1628
|
+
const gems = yield* readDependencies(projectFolder, "ruby").pipe(
|
|
1629
|
+
import_effect13.Effect.catchAll(() => import_effect13.Effect.succeed(/* @__PURE__ */ new Set()))
|
|
1630
|
+
);
|
|
1631
|
+
const withPublicDirectory = yield* refineRubyPublicDirectory(defaults, projectFolder);
|
|
1632
|
+
return gems.has("hanami-assets") ? { ...withPublicDirectory, commands: [...withPublicDirectory.commands, "bundle exec hanami assets compile"] } : withPublicDirectory;
|
|
1633
|
+
});
|
|
1634
|
+
var hanami = {
|
|
1635
|
+
slug: "hanami",
|
|
1636
|
+
name: "Hanami",
|
|
1637
|
+
language: "ruby",
|
|
1638
|
+
detectors: [{ matchPackage: "hanami" }, { path: "config.ru" }],
|
|
1639
|
+
priority: 75,
|
|
1640
|
+
getDefaultConfig: () => rubyServerDefaults({
|
|
1641
|
+
excludeFiles: ["tmp/", "log/", "spec/", "node_modules/", ".git/"],
|
|
1642
|
+
writablePaths: ["tmp", "log"],
|
|
1643
|
+
environmentVariables: { HANAMI_ENV: "production", RACK_ENV: "production" }
|
|
1644
|
+
}),
|
|
1645
|
+
refineDefaultConfig: refineHanamiAssets
|
|
1646
|
+
};
|
|
1647
|
+
|
|
1271
1648
|
// src/detection/frameworks/hono.ts
|
|
1272
1649
|
var hono = {
|
|
1273
1650
|
slug: "hono",
|
|
@@ -1288,6 +1665,30 @@ var hono = {
|
|
|
1288
1665
|
refineDefaultConfig: resolveNodeServerEntrypoint
|
|
1289
1666
|
};
|
|
1290
1667
|
|
|
1668
|
+
// src/detection/frameworks/jekyll.ts
|
|
1669
|
+
var jekyll = {
|
|
1670
|
+
slug: "jekyll",
|
|
1671
|
+
name: "Jekyll",
|
|
1672
|
+
language: "ruby",
|
|
1673
|
+
detectors: [{ matchPackage: "jekyll" }],
|
|
1674
|
+
priority: 70,
|
|
1675
|
+
getDefaultConfig: () => ({
|
|
1676
|
+
runtime: DEFAULT_RUBY_RUNTIME,
|
|
1677
|
+
memory: 128,
|
|
1678
|
+
maxDuration: 30,
|
|
1679
|
+
streaming: false,
|
|
1680
|
+
commands: ["bundle exec jekyll build"],
|
|
1681
|
+
assetsDir: "_site",
|
|
1682
|
+
populateAssetCache: true,
|
|
1683
|
+
routes: [],
|
|
1684
|
+
environmentVariables: { JEKYLL_ENV: "production" }
|
|
1685
|
+
})
|
|
1686
|
+
};
|
|
1687
|
+
var jekyllPresets = [
|
|
1688
|
+
jekyll,
|
|
1689
|
+
{ ...jekyll, detectors: [{ matchPackage: "github-pages" }] }
|
|
1690
|
+
];
|
|
1691
|
+
|
|
1291
1692
|
// src/detection/frameworks/laminas.ts
|
|
1292
1693
|
var laminas = {
|
|
1293
1694
|
slug: "laminas",
|
|
@@ -1367,8 +1768,8 @@ var mezzio = {
|
|
|
1367
1768
|
};
|
|
1368
1769
|
|
|
1369
1770
|
// src/detection/frameworks/nestjs.ts
|
|
1370
|
-
var
|
|
1371
|
-
var
|
|
1771
|
+
var import_platform9 = require("@effect/platform");
|
|
1772
|
+
var import_effect14 = require("effect");
|
|
1372
1773
|
var isRecord3 = (value) => typeof value === "object" && value !== null;
|
|
1373
1774
|
var parseNestCliJson = (content) => {
|
|
1374
1775
|
try {
|
|
@@ -1419,9 +1820,9 @@ var nestjs = {
|
|
|
1419
1820
|
detectors: [{ matchPackage: "@nestjs/core" }],
|
|
1420
1821
|
priority: 90,
|
|
1421
1822
|
getDefaultConfig: () => createNestConfig("dist"),
|
|
1422
|
-
refineDefaultConfig: (defaults, projectFolder) =>
|
|
1423
|
-
const fs = yield*
|
|
1424
|
-
const content = yield* fs.readFileString(`${projectFolder}/nest-cli.json`).pipe(
|
|
1823
|
+
refineDefaultConfig: (defaults, projectFolder) => import_effect14.Effect.gen(function* () {
|
|
1824
|
+
const fs = yield* import_platform9.FileSystem.FileSystem;
|
|
1825
|
+
const content = yield* fs.readFileString(`${projectFolder}/nest-cli.json`).pipe(import_effect14.Effect.catchAll(() => import_effect14.Effect.succeed(void 0)));
|
|
1425
1826
|
if (!content) return defaults;
|
|
1426
1827
|
const nestConfig = parseNestCliJson(content);
|
|
1427
1828
|
const outputPath = nestConfig ? getProjectOutputPath(nestConfig) : void 0;
|
|
@@ -1430,28 +1831,28 @@ var nestjs = {
|
|
|
1430
1831
|
};
|
|
1431
1832
|
|
|
1432
1833
|
// src/detection/frameworks/nextjs.ts
|
|
1433
|
-
var
|
|
1434
|
-
var
|
|
1834
|
+
var import_platform11 = require("@effect/platform");
|
|
1835
|
+
var import_effect17 = require("effect");
|
|
1435
1836
|
|
|
1436
1837
|
// src/build-output-v3/get-default-path-map.ts
|
|
1437
|
-
var
|
|
1438
|
-
var
|
|
1439
|
-
var getDefaultPathMap =
|
|
1440
|
-
const fs = yield*
|
|
1441
|
-
const pathService = yield*
|
|
1838
|
+
var import_platform10 = require("@effect/platform");
|
|
1839
|
+
var import_effect15 = require("effect");
|
|
1840
|
+
var getDefaultPathMap = import_effect15.Effect.fn("getDefaultPathMap")(function* (directory) {
|
|
1841
|
+
const fs = yield* import_platform10.FileSystem.FileSystem;
|
|
1842
|
+
const pathService = yield* import_platform10.Path.Path;
|
|
1442
1843
|
const result = {};
|
|
1443
|
-
const exists = yield* fs.exists(directory).pipe(
|
|
1844
|
+
const exists = yield* fs.exists(directory).pipe(import_effect15.Effect.catchAll(() => import_effect15.Effect.succeed(false)));
|
|
1444
1845
|
if (!exists) {
|
|
1445
1846
|
return result;
|
|
1446
1847
|
}
|
|
1447
1848
|
const MAX_DEPTH = 100;
|
|
1448
|
-
const processDirectory = (currentPath, basePath = "", depth = 0) =>
|
|
1849
|
+
const processDirectory = (currentPath, basePath = "", depth = 0) => import_effect15.Effect.gen(function* () {
|
|
1449
1850
|
if (depth > MAX_DEPTH) return;
|
|
1450
|
-
const entries = yield* fs.readDirectory(currentPath).pipe(
|
|
1851
|
+
const entries = yield* fs.readDirectory(currentPath).pipe(import_effect15.Effect.catchAll(() => import_effect15.Effect.succeed([])));
|
|
1451
1852
|
for (const name of entries) {
|
|
1452
1853
|
const fullPath = pathService.join(currentPath, name);
|
|
1453
1854
|
const relativePath = basePath ? pathService.join(basePath, name) : name;
|
|
1454
|
-
const stat = yield* fs.stat(fullPath).pipe(
|
|
1855
|
+
const stat = yield* fs.stat(fullPath).pipe(import_effect15.Effect.catchAll(() => import_effect15.Effect.succeed(null)));
|
|
1455
1856
|
if (!stat) continue;
|
|
1456
1857
|
if (stat.type === "Directory") {
|
|
1457
1858
|
yield* processDirectory(fullPath, relativePath, depth + 1);
|
|
@@ -1468,244 +1869,246 @@ var getDefaultPathMap = import_effect10.Effect.fn("getDefaultPathMap")(function*
|
|
|
1468
1869
|
var MAXIMUM_ENTRY_PAGE_PATHS = 50;
|
|
1469
1870
|
|
|
1470
1871
|
// src/nextjs-manifest.ts
|
|
1471
|
-
var
|
|
1472
|
-
var StringArraySchema =
|
|
1473
|
-
var StringRecordSchema =
|
|
1474
|
-
var JsonValueSchema =
|
|
1475
|
-
() =>
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1872
|
+
var import_effect16 = require("effect");
|
|
1873
|
+
var StringArraySchema = import_effect16.Schema.mutable(import_effect16.Schema.Array(import_effect16.Schema.String));
|
|
1874
|
+
var StringRecordSchema = import_effect16.Schema.mutable(import_effect16.Schema.Record({ key: import_effect16.Schema.String, value: import_effect16.Schema.String }));
|
|
1875
|
+
var JsonValueSchema = import_effect16.Schema.suspend(
|
|
1876
|
+
() => import_effect16.Schema.Union(
|
|
1877
|
+
import_effect16.Schema.Null,
|
|
1878
|
+
import_effect16.Schema.Boolean,
|
|
1879
|
+
import_effect16.Schema.Number,
|
|
1880
|
+
import_effect16.Schema.String,
|
|
1881
|
+
import_effect16.Schema.mutable(import_effect16.Schema.Array(JsonValueSchema)),
|
|
1882
|
+
import_effect16.Schema.mutable(import_effect16.Schema.Record({ key: import_effect16.Schema.String, value: JsonValueSchema }))
|
|
1482
1883
|
)
|
|
1483
1884
|
);
|
|
1484
|
-
var ImageLocalPatternSchema =
|
|
1485
|
-
|
|
1486
|
-
pathname:
|
|
1487
|
-
search:
|
|
1885
|
+
var ImageLocalPatternSchema = import_effect16.Schema.mutable(
|
|
1886
|
+
import_effect16.Schema.Struct({
|
|
1887
|
+
pathname: import_effect16.Schema.optional(import_effect16.Schema.String),
|
|
1888
|
+
search: import_effect16.Schema.optional(import_effect16.Schema.String)
|
|
1488
1889
|
})
|
|
1489
1890
|
);
|
|
1490
|
-
var ImageRemotePatternSchema =
|
|
1491
|
-
|
|
1492
|
-
protocol:
|
|
1493
|
-
hostname:
|
|
1494
|
-
port:
|
|
1495
|
-
pathname:
|
|
1496
|
-
search:
|
|
1891
|
+
var ImageRemotePatternSchema = import_effect16.Schema.mutable(
|
|
1892
|
+
import_effect16.Schema.Struct({
|
|
1893
|
+
protocol: import_effect16.Schema.optional(import_effect16.Schema.Literal("http", "https")),
|
|
1894
|
+
hostname: import_effect16.Schema.String,
|
|
1895
|
+
port: import_effect16.Schema.optional(import_effect16.Schema.String),
|
|
1896
|
+
pathname: import_effect16.Schema.optional(import_effect16.Schema.String),
|
|
1897
|
+
search: import_effect16.Schema.optional(import_effect16.Schema.String)
|
|
1497
1898
|
})
|
|
1498
1899
|
);
|
|
1499
|
-
var ImageVariantSchema =
|
|
1500
|
-
|
|
1501
|
-
width:
|
|
1502
|
-
height:
|
|
1503
|
-
quality:
|
|
1504
|
-
format:
|
|
1505
|
-
fit:
|
|
1900
|
+
var ImageVariantSchema = import_effect16.Schema.mutable(
|
|
1901
|
+
import_effect16.Schema.Struct({
|
|
1902
|
+
width: import_effect16.Schema.optional(import_effect16.Schema.Number),
|
|
1903
|
+
height: import_effect16.Schema.optional(import_effect16.Schema.Number),
|
|
1904
|
+
quality: import_effect16.Schema.optional(import_effect16.Schema.Number),
|
|
1905
|
+
format: import_effect16.Schema.optional(import_effect16.Schema.Literal("image/avif", "image/webp", "image/jpeg", "image/png")),
|
|
1906
|
+
fit: import_effect16.Schema.optional(import_effect16.Schema.Literal("contain", "cover", "fill", "inside", "outside"))
|
|
1506
1907
|
})
|
|
1507
1908
|
);
|
|
1508
|
-
var PositiveIntSchema =
|
|
1509
|
-
var ImagePolicySchema =
|
|
1510
|
-
|
|
1511
|
-
localPatterns:
|
|
1512
|
-
remotePatterns:
|
|
1513
|
-
widths:
|
|
1514
|
-
heights:
|
|
1515
|
-
qualities:
|
|
1516
|
-
formats:
|
|
1517
|
-
minimumCacheTTL:
|
|
1518
|
-
dangerouslyAllowSVG:
|
|
1519
|
-
contentSecurityPolicy:
|
|
1520
|
-
contentDispositionType:
|
|
1521
|
-
maximumRedirects:
|
|
1522
|
-
maximumResponseBody:
|
|
1523
|
-
variants:
|
|
1909
|
+
var PositiveIntSchema = import_effect16.Schema.Int.pipe(import_effect16.Schema.greaterThan(0));
|
|
1910
|
+
var ImagePolicySchema = import_effect16.Schema.mutable(
|
|
1911
|
+
import_effect16.Schema.Struct({
|
|
1912
|
+
localPatterns: import_effect16.Schema.mutable(import_effect16.Schema.Array(ImageLocalPatternSchema)),
|
|
1913
|
+
remotePatterns: import_effect16.Schema.mutable(import_effect16.Schema.Array(ImageRemotePatternSchema)),
|
|
1914
|
+
widths: import_effect16.Schema.mutable(import_effect16.Schema.Array(PositiveIntSchema)),
|
|
1915
|
+
heights: import_effect16.Schema.mutable(import_effect16.Schema.Array(PositiveIntSchema)),
|
|
1916
|
+
qualities: import_effect16.Schema.mutable(import_effect16.Schema.Array(import_effect16.Schema.Number.pipe(import_effect16.Schema.between(1, 100)))),
|
|
1917
|
+
formats: import_effect16.Schema.mutable(import_effect16.Schema.Array(import_effect16.Schema.Literal("image/avif", "image/webp", "image/jpeg", "image/png"))),
|
|
1918
|
+
minimumCacheTTL: import_effect16.Schema.Number,
|
|
1919
|
+
dangerouslyAllowSVG: import_effect16.Schema.Boolean,
|
|
1920
|
+
contentSecurityPolicy: import_effect16.Schema.String,
|
|
1921
|
+
contentDispositionType: import_effect16.Schema.Literal("inline", "attachment"),
|
|
1922
|
+
maximumRedirects: import_effect16.Schema.Number,
|
|
1923
|
+
maximumResponseBody: import_effect16.Schema.Number,
|
|
1924
|
+
variants: import_effect16.Schema.mutable(import_effect16.Schema.Record({ key: import_effect16.Schema.String, value: ImageVariantSchema }))
|
|
1524
1925
|
})
|
|
1525
1926
|
);
|
|
1526
1927
|
var GigadriveNextPrerenderOutputFields = {
|
|
1527
|
-
id:
|
|
1528
|
-
type:
|
|
1928
|
+
id: import_effect16.Schema.String,
|
|
1929
|
+
type: import_effect16.Schema.Literal("PRERENDER"),
|
|
1529
1930
|
pathname: UrlPathnameSchema,
|
|
1530
|
-
route:
|
|
1531
|
-
parentOutputId:
|
|
1532
|
-
groupId:
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1931
|
+
route: import_effect16.Schema.optional(UrlPathnameSchema),
|
|
1932
|
+
parentOutputId: import_effect16.Schema.String,
|
|
1933
|
+
groupId: import_effect16.Schema.Number,
|
|
1934
|
+
/** Next's key for the page's runtime cache entry, when its build metadata records one. */
|
|
1935
|
+
cacheKey: import_effect16.Schema.optional(import_effect16.Schema.String),
|
|
1936
|
+
pprChain: import_effect16.Schema.optional(import_effect16.Schema.mutable(import_effect16.Schema.Struct({ headers: HttpSingleValueHeadersSchema }))),
|
|
1937
|
+
parentFallbackMode: import_effect16.Schema.optional(JsonValueSchema),
|
|
1938
|
+
fallback: import_effect16.Schema.optional(
|
|
1939
|
+
import_effect16.Schema.mutable(
|
|
1940
|
+
import_effect16.Schema.Struct({
|
|
1941
|
+
filePath: import_effect16.Schema.optional(PortableRelativePathSchema),
|
|
1942
|
+
initialStatus: import_effect16.Schema.optional(import_effect16.Schema.Int.pipe(import_effect16.Schema.between(100, 599))),
|
|
1943
|
+
initialHeaders: import_effect16.Schema.optional(HttpHeadersSchema),
|
|
1944
|
+
initialExpiration: import_effect16.Schema.optional(import_effect16.Schema.Number),
|
|
1945
|
+
initialRevalidate: import_effect16.Schema.optional(import_effect16.Schema.Union(import_effect16.Schema.Number, import_effect16.Schema.Literal(false))),
|
|
1946
|
+
postponedState: import_effect16.Schema.optional(import_effect16.Schema.String)
|
|
1544
1947
|
})
|
|
1545
1948
|
)
|
|
1546
1949
|
),
|
|
1547
|
-
config:
|
|
1548
|
-
|
|
1549
|
-
allowQuery:
|
|
1550
|
-
allowHeader:
|
|
1551
|
-
bypassFor:
|
|
1552
|
-
renderingMode:
|
|
1553
|
-
partialFallback:
|
|
1554
|
-
bypassToken:
|
|
1950
|
+
config: import_effect16.Schema.mutable(
|
|
1951
|
+
import_effect16.Schema.Struct({
|
|
1952
|
+
allowQuery: import_effect16.Schema.optional(StringArraySchema),
|
|
1953
|
+
allowHeader: import_effect16.Schema.optional(StringArraySchema),
|
|
1954
|
+
bypassFor: import_effect16.Schema.optional(import_effect16.Schema.mutable(import_effect16.Schema.Array(JsonValueSchema))),
|
|
1955
|
+
renderingMode: import_effect16.Schema.optional(import_effect16.Schema.String),
|
|
1956
|
+
partialFallback: import_effect16.Schema.optional(import_effect16.Schema.Boolean),
|
|
1957
|
+
bypassToken: import_effect16.Schema.optional(import_effect16.Schema.String)
|
|
1555
1958
|
})
|
|
1556
1959
|
)
|
|
1557
1960
|
};
|
|
1558
|
-
var GigadriveNextPrerenderClassificationSchema =
|
|
1559
|
-
routeType:
|
|
1560
|
-
response:
|
|
1561
|
-
compute:
|
|
1562
|
-
htmlSize:
|
|
1961
|
+
var GigadriveNextPrerenderClassificationSchema = import_effect16.Schema.Struct({
|
|
1962
|
+
routeType: import_effect16.Schema.Literal("route", "fallback", "shell", "page"),
|
|
1963
|
+
response: import_effect16.Schema.Literal("empty", "initial", "complete"),
|
|
1964
|
+
compute: import_effect16.Schema.Literal("blocking", "resuming", "static"),
|
|
1965
|
+
htmlSize: import_effect16.Schema.optional(import_effect16.Schema.Number)
|
|
1563
1966
|
});
|
|
1564
|
-
var GigadriveNextPrerenderWithoutClassificationSchema =
|
|
1565
|
-
routeType:
|
|
1566
|
-
response:
|
|
1567
|
-
compute:
|
|
1568
|
-
htmlSize:
|
|
1967
|
+
var GigadriveNextPrerenderWithoutClassificationSchema = import_effect16.Schema.Struct({
|
|
1968
|
+
routeType: import_effect16.Schema.optional(import_effect16.Schema.Never),
|
|
1969
|
+
response: import_effect16.Schema.optional(import_effect16.Schema.Never),
|
|
1970
|
+
compute: import_effect16.Schema.optional(import_effect16.Schema.Never),
|
|
1971
|
+
htmlSize: import_effect16.Schema.optional(import_effect16.Schema.Never)
|
|
1569
1972
|
});
|
|
1570
|
-
var GigadriveNextPrerenderOutputSchema =
|
|
1571
|
-
|
|
1572
|
-
|
|
1973
|
+
var GigadriveNextPrerenderOutputSchema = import_effect16.Schema.Union(
|
|
1974
|
+
import_effect16.Schema.mutable(
|
|
1975
|
+
import_effect16.Schema.Struct({ ...GigadriveNextPrerenderOutputFields, ...GigadriveNextPrerenderClassificationSchema.fields })
|
|
1573
1976
|
),
|
|
1574
|
-
|
|
1575
|
-
|
|
1977
|
+
import_effect16.Schema.mutable(
|
|
1978
|
+
import_effect16.Schema.Struct({
|
|
1576
1979
|
...GigadriveNextPrerenderOutputFields,
|
|
1577
1980
|
...GigadriveNextPrerenderWithoutClassificationSchema.fields
|
|
1578
1981
|
})
|
|
1579
1982
|
)
|
|
1580
1983
|
);
|
|
1581
|
-
var GigadriveNextStaticAssetPrefixSchema =
|
|
1582
|
-
|
|
1984
|
+
var GigadriveNextStaticAssetPrefixSchema = import_effect16.Schema.mutable(
|
|
1985
|
+
import_effect16.Schema.Struct({
|
|
1583
1986
|
sourceDir: PortableRelativePathSchema,
|
|
1584
1987
|
urlPrefix: PortableRelativePathSchema,
|
|
1585
|
-
immutable:
|
|
1988
|
+
immutable: import_effect16.Schema.Boolean
|
|
1586
1989
|
})
|
|
1587
1990
|
);
|
|
1588
|
-
var GigadriveNextRouteConditionSchema =
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
type:
|
|
1592
|
-
key:
|
|
1593
|
-
value:
|
|
1991
|
+
var GigadriveNextRouteConditionSchema = import_effect16.Schema.Union(
|
|
1992
|
+
import_effect16.Schema.mutable(
|
|
1993
|
+
import_effect16.Schema.Struct({
|
|
1994
|
+
type: import_effect16.Schema.Literal("header", "cookie", "query"),
|
|
1995
|
+
key: import_effect16.Schema.String,
|
|
1996
|
+
value: import_effect16.Schema.optional(import_effect16.Schema.String)
|
|
1594
1997
|
})
|
|
1595
1998
|
),
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
type:
|
|
1599
|
-
value:
|
|
1999
|
+
import_effect16.Schema.mutable(
|
|
2000
|
+
import_effect16.Schema.Struct({
|
|
2001
|
+
type: import_effect16.Schema.Literal("host"),
|
|
2002
|
+
value: import_effect16.Schema.String
|
|
1600
2003
|
})
|
|
1601
2004
|
)
|
|
1602
2005
|
);
|
|
1603
|
-
var GigadriveNextMiddlewareMatcherSchema =
|
|
1604
|
-
|
|
1605
|
-
source:
|
|
1606
|
-
sourceRegex:
|
|
1607
|
-
has:
|
|
1608
|
-
missing:
|
|
2006
|
+
var GigadriveNextMiddlewareMatcherSchema = import_effect16.Schema.mutable(
|
|
2007
|
+
import_effect16.Schema.Struct({
|
|
2008
|
+
source: import_effect16.Schema.String,
|
|
2009
|
+
sourceRegex: import_effect16.Schema.String,
|
|
2010
|
+
has: import_effect16.Schema.optional(import_effect16.Schema.mutable(import_effect16.Schema.Array(GigadriveNextRouteConditionSchema))),
|
|
2011
|
+
missing: import_effect16.Schema.optional(import_effect16.Schema.mutable(import_effect16.Schema.Array(GigadriveNextRouteConditionSchema)))
|
|
1609
2012
|
})
|
|
1610
2013
|
);
|
|
1611
|
-
var GigadriveNextMiddlewareDescriptorSchema =
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
present:
|
|
1615
|
-
matchers:
|
|
2014
|
+
var GigadriveNextMiddlewareDescriptorSchema = import_effect16.Schema.Union(
|
|
2015
|
+
import_effect16.Schema.mutable(
|
|
2016
|
+
import_effect16.Schema.Struct({
|
|
2017
|
+
present: import_effect16.Schema.Literal(true),
|
|
2018
|
+
matchers: import_effect16.Schema.mutable(import_effect16.Schema.Array(GigadriveNextMiddlewareMatcherSchema))
|
|
1616
2019
|
})
|
|
1617
2020
|
),
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
present:
|
|
1621
|
-
matchers:
|
|
2021
|
+
import_effect16.Schema.mutable(
|
|
2022
|
+
import_effect16.Schema.Struct({
|
|
2023
|
+
present: import_effect16.Schema.Literal(false),
|
|
2024
|
+
matchers: import_effect16.Schema.mutable(import_effect16.Schema.Tuple())
|
|
1622
2025
|
})
|
|
1623
2026
|
)
|
|
1624
2027
|
);
|
|
1625
|
-
var GigadriveNextServerDescriptorSchema =
|
|
1626
|
-
|
|
1627
|
-
maxDuration:
|
|
1628
|
-
preferredRegion:
|
|
1629
|
-
env:
|
|
2028
|
+
var GigadriveNextServerDescriptorSchema = import_effect16.Schema.mutable(
|
|
2029
|
+
import_effect16.Schema.Struct({
|
|
2030
|
+
maxDuration: import_effect16.Schema.optional(import_effect16.Schema.Number),
|
|
2031
|
+
preferredRegion: import_effect16.Schema.optional(import_effect16.Schema.Union(import_effect16.Schema.String, StringArraySchema)),
|
|
2032
|
+
env: import_effect16.Schema.optional(StringRecordSchema)
|
|
1630
2033
|
})
|
|
1631
2034
|
);
|
|
1632
|
-
var PrerenderArraySchema =
|
|
1633
|
-
var StaticAssetArraySchema =
|
|
1634
|
-
var JsonValueArraySchema =
|
|
1635
|
-
var GigadriveNextPrerenderSeedMethodsSchema =
|
|
1636
|
-
|
|
2035
|
+
var PrerenderArraySchema = import_effect16.Schema.mutable(import_effect16.Schema.Array(GigadriveNextPrerenderOutputSchema));
|
|
2036
|
+
var StaticAssetArraySchema = import_effect16.Schema.mutable(import_effect16.Schema.Array(GigadriveNextStaticAssetPrefixSchema));
|
|
2037
|
+
var JsonValueArraySchema = import_effect16.Schema.mutable(import_effect16.Schema.Array(JsonValueSchema));
|
|
2038
|
+
var GigadriveNextPrerenderSeedMethodsSchema = import_effect16.Schema.mutable(
|
|
2039
|
+
import_effect16.Schema.Tuple(import_effect16.Schema.Literal("GET"), import_effect16.Schema.Literal("HEAD"))
|
|
1637
2040
|
);
|
|
1638
|
-
var GigadriveNextBuildManifestV1Schema =
|
|
1639
|
-
|
|
1640
|
-
version:
|
|
1641
|
-
output:
|
|
2041
|
+
var GigadriveNextBuildManifestV1Schema = import_effect16.Schema.mutable(
|
|
2042
|
+
import_effect16.Schema.Struct({
|
|
2043
|
+
version: import_effect16.Schema.Literal(1),
|
|
2044
|
+
output: import_effect16.Schema.Literal("standalone", "export"),
|
|
1642
2045
|
distDir: PortableRelativePathSchema,
|
|
1643
2046
|
repoRootToProject: RepositoryRelativePathSchema,
|
|
1644
|
-
nextVersion:
|
|
1645
|
-
buildId:
|
|
2047
|
+
nextVersion: import_effect16.Schema.String,
|
|
2048
|
+
buildId: import_effect16.Schema.String
|
|
1646
2049
|
})
|
|
1647
2050
|
);
|
|
1648
|
-
var GigadriveNextBuildManifestV2ExportSchema =
|
|
1649
|
-
|
|
1650
|
-
version:
|
|
1651
|
-
mode:
|
|
2051
|
+
var GigadriveNextBuildManifestV2ExportSchema = import_effect16.Schema.mutable(
|
|
2052
|
+
import_effect16.Schema.Struct({
|
|
2053
|
+
version: import_effect16.Schema.Literal(2),
|
|
2054
|
+
mode: import_effect16.Schema.Literal("export"),
|
|
1652
2055
|
distDir: PortableRelativePathSchema,
|
|
1653
2056
|
repoRootToProject: RepositoryRelativePathSchema,
|
|
1654
|
-
nextVersion:
|
|
1655
|
-
buildId:
|
|
2057
|
+
nextVersion: import_effect16.Schema.String,
|
|
2058
|
+
buildId: import_effect16.Schema.String
|
|
1656
2059
|
})
|
|
1657
2060
|
);
|
|
1658
|
-
var GigadriveNextBuildManifestV2StandaloneSchema =
|
|
1659
|
-
|
|
1660
|
-
version:
|
|
1661
|
-
mode:
|
|
2061
|
+
var GigadriveNextBuildManifestV2StandaloneSchema = import_effect16.Schema.mutable(
|
|
2062
|
+
import_effect16.Schema.Struct({
|
|
2063
|
+
version: import_effect16.Schema.Literal(2),
|
|
2064
|
+
mode: import_effect16.Schema.Literal("standalone-v2"),
|
|
1662
2065
|
distDir: PortableRelativePathSchema,
|
|
1663
2066
|
repoRootToProject: RepositoryRelativePathSchema,
|
|
1664
|
-
nextVersion:
|
|
1665
|
-
buildId:
|
|
2067
|
+
nextVersion: import_effect16.Schema.String,
|
|
2068
|
+
buildId: import_effect16.Schema.String,
|
|
1666
2069
|
server: GigadriveNextServerDescriptorSchema,
|
|
1667
|
-
config:
|
|
1668
|
-
|
|
1669
|
-
basePath:
|
|
1670
|
-
trailingSlash:
|
|
1671
|
-
cacheComponents:
|
|
1672
|
-
i18n:
|
|
1673
|
-
images:
|
|
2070
|
+
config: import_effect16.Schema.mutable(
|
|
2071
|
+
import_effect16.Schema.Struct({
|
|
2072
|
+
basePath: import_effect16.Schema.String,
|
|
2073
|
+
trailingSlash: import_effect16.Schema.Boolean,
|
|
2074
|
+
cacheComponents: import_effect16.Schema.Boolean,
|
|
2075
|
+
i18n: import_effect16.Schema.optional(JsonValueSchema),
|
|
2076
|
+
images: import_effect16.Schema.optional(ImagePolicySchema)
|
|
1674
2077
|
})
|
|
1675
2078
|
),
|
|
1676
|
-
routing:
|
|
1677
|
-
|
|
2079
|
+
routing: import_effect16.Schema.mutable(
|
|
2080
|
+
import_effect16.Schema.Struct({
|
|
1678
2081
|
beforeMiddleware: JsonValueArraySchema,
|
|
1679
2082
|
beforeFiles: JsonValueArraySchema,
|
|
1680
2083
|
afterFiles: JsonValueArraySchema,
|
|
1681
2084
|
dynamicRoutes: JsonValueArraySchema,
|
|
1682
2085
|
onMatch: JsonValueArraySchema,
|
|
1683
2086
|
fallback: JsonValueArraySchema,
|
|
1684
|
-
shouldNormalizeNextData:
|
|
2087
|
+
shouldNormalizeNextData: import_effect16.Schema.Boolean,
|
|
1685
2088
|
rsc: JsonValueSchema
|
|
1686
2089
|
})
|
|
1687
2090
|
),
|
|
1688
|
-
outputs:
|
|
1689
|
-
|
|
2091
|
+
outputs: import_effect16.Schema.mutable(
|
|
2092
|
+
import_effect16.Schema.Struct({
|
|
1690
2093
|
prerenders: PrerenderArraySchema,
|
|
1691
|
-
prerenderManifest:
|
|
1692
|
-
assetManifest:
|
|
1693
|
-
entryPagePaths:
|
|
2094
|
+
prerenderManifest: import_effect16.Schema.optional(PortableRelativePathSchema),
|
|
2095
|
+
assetManifest: import_effect16.Schema.optional(PortableRelativePathSchema),
|
|
2096
|
+
entryPagePaths: import_effect16.Schema.optional(import_effect16.Schema.mutable(import_effect16.Schema.Array(UrlPathnameSchema))),
|
|
1694
2097
|
staticAssets: StaticAssetArraySchema,
|
|
1695
|
-
middleware:
|
|
2098
|
+
middleware: import_effect16.Schema.optional(GigadriveNextMiddlewareDescriptorSchema)
|
|
1696
2099
|
})
|
|
1697
2100
|
)
|
|
1698
2101
|
})
|
|
1699
2102
|
);
|
|
1700
|
-
var GigadriveNextBuildManifestSchema =
|
|
2103
|
+
var GigadriveNextBuildManifestSchema = import_effect16.Schema.Union(
|
|
1701
2104
|
GigadriveNextBuildManifestV1Schema,
|
|
1702
2105
|
GigadriveNextBuildManifestV2ExportSchema,
|
|
1703
2106
|
GigadriveNextBuildManifestV2StandaloneSchema
|
|
1704
2107
|
);
|
|
1705
|
-
var GigadriveNextPrerenderManifestV1Schema =
|
|
1706
|
-
|
|
1707
|
-
version:
|
|
1708
|
-
seedMethods:
|
|
2108
|
+
var GigadriveNextPrerenderManifestV1Schema = import_effect16.Schema.mutable(
|
|
2109
|
+
import_effect16.Schema.Struct({
|
|
2110
|
+
version: import_effect16.Schema.Literal(1),
|
|
2111
|
+
seedMethods: import_effect16.Schema.optional(GigadriveNextPrerenderSeedMethodsSchema),
|
|
1709
2112
|
prerenders: PrerenderArraySchema
|
|
1710
2113
|
})
|
|
1711
2114
|
);
|
|
@@ -1715,22 +2118,22 @@ var parseGigadriveNextPrerenderManifest = (content) => decodeJson(GigadriveNextP
|
|
|
1715
2118
|
// src/detection/frameworks/nextjs.ts
|
|
1716
2119
|
var toPortablePath = (value) => value.replaceAll("\\", "/");
|
|
1717
2120
|
var STANDALONE_SERVER_MEMORY_MB = 1024;
|
|
1718
|
-
var resolveStandaloneServer =
|
|
1719
|
-
const fs = yield*
|
|
1720
|
-
const pathService = yield*
|
|
2121
|
+
var resolveStandaloneServer = import_effect17.Effect.fn("nextjs.resolveStandaloneServer")(function* (projectFolder, distDir, repoRootToProject) {
|
|
2122
|
+
const fs = yield* import_platform11.FileSystem.FileSystem;
|
|
2123
|
+
const pathService = yield* import_platform11.Path.Path;
|
|
1721
2124
|
const standaloneRoot = pathService.join(projectFolder, distDir, "standalone");
|
|
1722
2125
|
const monorepoServer = pathService.join(standaloneRoot, repoRootToProject, "server.js");
|
|
1723
2126
|
const rootServer = pathService.join(standaloneRoot, "server.js");
|
|
1724
|
-
const monorepoServerExists = yield* fs.exists(monorepoServer).pipe(
|
|
2127
|
+
const monorepoServerExists = yield* fs.exists(monorepoServer).pipe(import_effect17.Effect.catchAll(() => import_effect17.Effect.succeed(false)));
|
|
1725
2128
|
const serverPath = monorepoServerExists ? monorepoServer : rootServer;
|
|
1726
|
-
const serverExists = yield* fs.exists(serverPath).pipe(
|
|
2129
|
+
const serverExists = yield* fs.exists(serverPath).pipe(import_effect17.Effect.catchAll(() => import_effect17.Effect.succeed(false)));
|
|
1727
2130
|
if (!serverExists) return void 0;
|
|
1728
2131
|
const serverDirectory = pathService.dirname(serverPath);
|
|
1729
2132
|
const entrypoint = toPortablePath(pathService.relative(standaloneRoot, serverPath));
|
|
1730
2133
|
return { standaloneRoot, serverDirectory, entrypoint };
|
|
1731
2134
|
});
|
|
1732
|
-
var buildStandalonePublicAssets =
|
|
1733
|
-
const pathService = yield*
|
|
2135
|
+
var buildStandalonePublicAssets = import_effect17.Effect.fn("nextjs.buildStandalonePublicAssets")(function* (projectFolder, standaloneRoot, serverDirectory) {
|
|
2136
|
+
const pathService = yield* import_platform11.Path.Path;
|
|
1734
2137
|
const publicFiles = yield* getDefaultPathMap(pathService.join(projectFolder, "public"));
|
|
1735
2138
|
const assetPaths = [];
|
|
1736
2139
|
const assetOverrides = {};
|
|
@@ -1746,8 +2149,8 @@ var buildStandalonePublicAssets = import_effect12.Effect.fn("nextjs.buildStandal
|
|
|
1746
2149
|
}
|
|
1747
2150
|
return { assetPaths, assetOverrides, filePathMap };
|
|
1748
2151
|
});
|
|
1749
|
-
var createStaticExportConfig =
|
|
1750
|
-
const pathService = yield*
|
|
2152
|
+
var createStaticExportConfig = import_effect17.Effect.fn("nextjs.createStaticExportConfig")(function* (defaults, projectFolder) {
|
|
2153
|
+
const pathService = yield* import_platform11.Path.Path;
|
|
1751
2154
|
const outputDirectory = pathService.join(projectFolder, "out");
|
|
1752
2155
|
const files = yield* getDefaultPathMap(outputDirectory);
|
|
1753
2156
|
const assetPaths = [];
|
|
@@ -1770,8 +2173,8 @@ var createStaticExportConfig = import_effect12.Effect.fn("nextjs.createStaticExp
|
|
|
1770
2173
|
package: void 0
|
|
1771
2174
|
};
|
|
1772
2175
|
});
|
|
1773
|
-
var createStandaloneConfig =
|
|
1774
|
-
const pathService = yield*
|
|
2176
|
+
var createStandaloneConfig = import_effect17.Effect.fn("nextjs.createStandaloneConfig")(function* (defaults, projectFolder, manifest) {
|
|
2177
|
+
const pathService = yield* import_platform11.Path.Path;
|
|
1775
2178
|
const resolved = yield* resolveStandaloneServer(projectFolder, manifest.distDir, manifest.repoRootToProject);
|
|
1776
2179
|
if (!resolved) return defaults;
|
|
1777
2180
|
const { standaloneRoot, serverDirectory, entrypoint } = resolved;
|
|
@@ -1804,7 +2207,7 @@ var createStandaloneConfig = import_effect12.Effect.fn("nextjs.createStandaloneC
|
|
|
1804
2207
|
}
|
|
1805
2208
|
};
|
|
1806
2209
|
});
|
|
1807
|
-
var createStandaloneV2Config =
|
|
2210
|
+
var createStandaloneV2Config = import_effect17.Effect.fn("nextjs.createStandaloneV2Config")(function* (defaults, projectFolder, manifest) {
|
|
1808
2211
|
const resolved = yield* resolveStandaloneServer(projectFolder, manifest.distDir, manifest.repoRootToProject);
|
|
1809
2212
|
if (!resolved) return defaults;
|
|
1810
2213
|
const { standaloneRoot, serverDirectory, entrypoint } = resolved;
|
|
@@ -1912,9 +2315,9 @@ var nextjs = {
|
|
|
1912
2315
|
routes: [{ source: "/*", destination: ".next/standalone/server.js" }],
|
|
1913
2316
|
environmentVariables: { NODE_ENV: "production" }
|
|
1914
2317
|
}),
|
|
1915
|
-
refineDefaultConfig: (defaults, projectFolder) =>
|
|
1916
|
-
const fs = yield*
|
|
1917
|
-
const manifestContent = yield* fs.readFileString(`${projectFolder}/.gigadrive/nextjs.json`).pipe(
|
|
2318
|
+
refineDefaultConfig: (defaults, projectFolder) => import_effect17.Effect.gen(function* () {
|
|
2319
|
+
const fs = yield* import_platform11.FileSystem.FileSystem;
|
|
2320
|
+
const manifestContent = yield* fs.readFileString(`${projectFolder}/.gigadrive/nextjs.json`).pipe(import_effect17.Effect.catchAll(() => import_effect17.Effect.succeed(void 0)));
|
|
1918
2321
|
const manifest = manifestContent ? parseGigadriveNextBuildManifest(manifestContent) : void 0;
|
|
1919
2322
|
if (!manifest) return defaults;
|
|
1920
2323
|
if (manifest.version === 2) {
|
|
@@ -1925,8 +2328,8 @@ var nextjs = {
|
|
|
1925
2328
|
};
|
|
1926
2329
|
|
|
1927
2330
|
// src/detection/frameworks/nuxt.ts
|
|
1928
|
-
var
|
|
1929
|
-
var
|
|
2331
|
+
var import_platform12 = require("@effect/platform");
|
|
2332
|
+
var import_effect18 = require("effect");
|
|
1930
2333
|
var isVercelBuildOutputV3 = (content) => {
|
|
1931
2334
|
try {
|
|
1932
2335
|
const config = JSON.parse(content);
|
|
@@ -1953,9 +2356,9 @@ var nuxt = {
|
|
|
1953
2356
|
routes: [{ source: "/*", destination: ".output/server/index.mjs" }],
|
|
1954
2357
|
environmentVariables: { NODE_ENV: "production", NITRO_PRESET: "node-server" }
|
|
1955
2358
|
}),
|
|
1956
|
-
refineDefaultConfig: (defaults, projectFolder) =>
|
|
1957
|
-
const fs = yield*
|
|
1958
|
-
const buildOutputConfig = yield* fs.readFileString(`${projectFolder}/.vercel/output/config.json`).pipe(
|
|
2359
|
+
refineDefaultConfig: (defaults, projectFolder) => import_effect18.Effect.gen(function* () {
|
|
2360
|
+
const fs = yield* import_platform12.FileSystem.FileSystem;
|
|
2361
|
+
const buildOutputConfig = yield* fs.readFileString(`${projectFolder}/.vercel/output/config.json`).pipe(import_effect18.Effect.catchAll(() => import_effect18.Effect.succeed(void 0)));
|
|
1959
2362
|
if (!buildOutputConfig || !isVercelBuildOutputV3(buildOutputConfig)) {
|
|
1960
2363
|
return defaults;
|
|
1961
2364
|
}
|
|
@@ -1970,16 +2373,16 @@ var nuxt = {
|
|
|
1970
2373
|
};
|
|
1971
2374
|
|
|
1972
2375
|
// src/detection/frameworks/php.ts
|
|
1973
|
-
var
|
|
1974
|
-
var
|
|
2376
|
+
var import_platform13 = require("@effect/platform");
|
|
2377
|
+
var import_effect19 = require("effect");
|
|
1975
2378
|
var COMPOSER_FILES = ["composer.json", "composer.lock"];
|
|
1976
2379
|
var DOCUMENT_ROOTS = ["public", "web", "webroot", "public_html", "htdocs", "."];
|
|
1977
|
-
var refinePhpDocumentRoot = (defaults, projectFolder) =>
|
|
1978
|
-
const fs = yield*
|
|
1979
|
-
const pathService = yield*
|
|
2380
|
+
var refinePhpDocumentRoot = (defaults, projectFolder) => import_effect19.Effect.gen(function* () {
|
|
2381
|
+
const fs = yield* import_platform13.FileSystem.FileSystem;
|
|
2382
|
+
const pathService = yield* import_platform13.Path.Path;
|
|
1980
2383
|
for (const documentRoot of DOCUMENT_ROOTS) {
|
|
1981
2384
|
const frontController = pathService.join(projectFolder, documentRoot, "index.php");
|
|
1982
|
-
if (yield* fs.exists(frontController).pipe(
|
|
2385
|
+
if (yield* fs.exists(frontController).pipe(import_effect19.Effect.catchAll(() => import_effect19.Effect.succeed(false)))) {
|
|
1983
2386
|
return phpFrontControllerDefaults({ documentRoot, excludeFiles: COMPOSER_FILES });
|
|
1984
2387
|
}
|
|
1985
2388
|
}
|
|
@@ -2003,12 +2406,12 @@ var phpSites = DOCUMENT_ROOTS.map((documentRoot) => ({
|
|
|
2003
2406
|
detectors: [{ path: frontControllerPath(documentRoot) }],
|
|
2004
2407
|
priority: 6,
|
|
2005
2408
|
getDefaultConfig: () => ({ ...getDefaultConfig(), installCommand: "" }),
|
|
2006
|
-
refineDefaultConfig: (defaults, projectFolder) => refinePhpDocumentRoot(defaults, projectFolder).pipe(
|
|
2409
|
+
refineDefaultConfig: (defaults, projectFolder) => refinePhpDocumentRoot(defaults, projectFolder).pipe(import_effect19.Effect.map((refined) => ({ ...refined, installCommand: "" })))
|
|
2007
2410
|
}));
|
|
2008
2411
|
|
|
2009
2412
|
// src/detection/frameworks/php-runtime.ts
|
|
2010
|
-
var
|
|
2011
|
-
var
|
|
2413
|
+
var import_platform14 = require("@effect/platform");
|
|
2414
|
+
var import_effect20 = require("effect");
|
|
2012
2415
|
|
|
2013
2416
|
// src/detection/frameworks/composer-constraint.ts
|
|
2014
2417
|
var STABILITY_SUFFIX = /-(?:dev|alpha|beta|a|b|rc|patch|pl|p|stable)\.?\d*$/i;
|
|
@@ -2132,31 +2535,86 @@ var PHP_RUNTIME_CANDIDATES = [
|
|
|
2132
2535
|
{ runtime: "php-83", newestVersion: "8.3.9999" }
|
|
2133
2536
|
];
|
|
2134
2537
|
var phpRuntimeForConstraint = (constraint) => PHP_RUNTIME_CANDIDATES.find(({ newestVersion }) => composerConstraintAllows(constraint, newestVersion) === true)?.runtime;
|
|
2135
|
-
var readPhpConstraint =
|
|
2538
|
+
var readPhpConstraint = import_effect20.Effect.fn("readPhpConstraint")(
|
|
2136
2539
|
function* (projectFolder) {
|
|
2137
|
-
const fs = yield*
|
|
2138
|
-
const pathService = yield*
|
|
2540
|
+
const fs = yield* import_platform14.FileSystem.FileSystem;
|
|
2541
|
+
const pathService = yield* import_platform14.Path.Path;
|
|
2139
2542
|
const content = yield* fs.readFileString(pathService.join(projectFolder, "composer.json"));
|
|
2140
|
-
const manifest = yield*
|
|
2543
|
+
const manifest = yield* import_effect20.Effect.try(() => JSON.parse(content));
|
|
2141
2544
|
const requires = manifest && typeof manifest === "object" && "require" in manifest ? manifest.require : void 0;
|
|
2142
2545
|
const php = requires && typeof requires === "object" && "php" in requires ? requires.php : void 0;
|
|
2143
|
-
return typeof php === "string" ?
|
|
2546
|
+
return typeof php === "string" ? import_effect20.Option.some(php) : import_effect20.Option.none();
|
|
2144
2547
|
},
|
|
2145
|
-
|
|
2548
|
+
import_effect20.Effect.catchAll(() => import_effect20.Effect.succeed(import_effect20.Option.none()))
|
|
2146
2549
|
);
|
|
2147
|
-
var refineComposerPhpRuntime =
|
|
2550
|
+
var refineComposerPhpRuntime = import_effect20.Effect.fn("refineComposerPhpRuntime")(function* (defaults, projectFolder) {
|
|
2148
2551
|
const constraint = yield* readPhpConstraint(projectFolder);
|
|
2149
|
-
const runtime =
|
|
2552
|
+
const runtime = import_effect20.Option.getOrUndefined(import_effect20.Option.flatMapNullable(constraint, phpRuntimeForConstraint));
|
|
2150
2553
|
return runtime ? { ...defaults, runtime } : defaults;
|
|
2151
2554
|
});
|
|
2152
2555
|
var withComposerPhpRuntime = (framework) => ({
|
|
2153
2556
|
...framework,
|
|
2154
|
-
refineDefaultConfig: (defaults, projectFolder) =>
|
|
2557
|
+
refineDefaultConfig: (defaults, projectFolder) => import_effect20.Effect.gen(function* () {
|
|
2155
2558
|
const refined = framework.refineDefaultConfig ? yield* framework.refineDefaultConfig(defaults, projectFolder) : defaults;
|
|
2156
2559
|
return yield* refineComposerPhpRuntime(refined, projectFolder);
|
|
2157
2560
|
})
|
|
2158
2561
|
});
|
|
2159
2562
|
|
|
2563
|
+
// src/detection/frameworks/rack.ts
|
|
2564
|
+
var rack = {
|
|
2565
|
+
slug: "rack",
|
|
2566
|
+
name: "Rack",
|
|
2567
|
+
language: "ruby",
|
|
2568
|
+
detectors: [{ path: "config.ru" }, { path: "Gemfile" }],
|
|
2569
|
+
priority: 10,
|
|
2570
|
+
getDefaultConfig: () => rubyServerDefaults({ environmentVariables: { RACK_ENV: "production" } }),
|
|
2571
|
+
refineDefaultConfig: refineRubyPublicDirectory
|
|
2572
|
+
};
|
|
2573
|
+
|
|
2574
|
+
// src/detection/frameworks/rails.ts
|
|
2575
|
+
var import_effect21 = require("effect");
|
|
2576
|
+
var ASSET_PIPELINE_GEMS = ["propshaft", "sprockets", "sprockets-rails"];
|
|
2577
|
+
var refineRailsAssets = import_effect21.Effect.fn("refineRailsAssets")(function* (defaults, projectFolder) {
|
|
2578
|
+
const gems = yield* readDependencies(projectFolder, "ruby").pipe(
|
|
2579
|
+
import_effect21.Effect.catchAll(() => import_effect21.Effect.succeed(/* @__PURE__ */ new Set()))
|
|
2580
|
+
);
|
|
2581
|
+
const withPublicDirectory = yield* refineRubyPublicDirectory(defaults, projectFolder);
|
|
2582
|
+
return ASSET_PIPELINE_GEMS.some((gem) => gems.has(gem)) ? {
|
|
2583
|
+
...withPublicDirectory,
|
|
2584
|
+
commands: [...withPublicDirectory.commands, "SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile"]
|
|
2585
|
+
} : withPublicDirectory;
|
|
2586
|
+
});
|
|
2587
|
+
var rails = {
|
|
2588
|
+
slug: "rails",
|
|
2589
|
+
name: "Ruby on Rails",
|
|
2590
|
+
language: "ruby",
|
|
2591
|
+
// `railties` is in every Rails application's Gemfile.lock, including ones
|
|
2592
|
+
// that require individual Rails gems instead of `rails`.
|
|
2593
|
+
detectors: [{ matchPackage: "railties" }, { path: "config/application.rb" }],
|
|
2594
|
+
priority: 80,
|
|
2595
|
+
getDefaultConfig: () => rubyServerDefaults({
|
|
2596
|
+
memory: 512,
|
|
2597
|
+
excludeFiles: ["tmp/", "log/", "storage/", "test/", "spec/", "node_modules/", ".git/"],
|
|
2598
|
+
// tmp/, log/ and storage/ are excluded, so the directories Rails writes
|
|
2599
|
+
// caches, pids, sockets, logs and Active Storage files to are created empty.
|
|
2600
|
+
writablePaths: ["tmp/cache", "tmp/pids", "tmp/sockets", "tmp/storage", "log", "storage"],
|
|
2601
|
+
environmentVariables: {
|
|
2602
|
+
RAILS_ENV: "production",
|
|
2603
|
+
RACK_ENV: "production",
|
|
2604
|
+
// Signs and encrypts cookies and sessions; Rails refuses to boot in production without it.
|
|
2605
|
+
SECRET_KEY_BASE: generatedSecret("hex"),
|
|
2606
|
+
RAILS_LOG_TO_STDOUT: "1",
|
|
2607
|
+
RAILS_SERVE_STATIC_FILES: "1",
|
|
2608
|
+
RAILS_MAX_THREADS: "5"
|
|
2609
|
+
}
|
|
2610
|
+
}),
|
|
2611
|
+
refineDefaultConfig: refineRailsAssets
|
|
2612
|
+
};
|
|
2613
|
+
var railsPresets = [
|
|
2614
|
+
rails,
|
|
2615
|
+
{ ...rails, detectors: [{ matchPackage: "rails" }, { path: "config/application.rb" }] }
|
|
2616
|
+
];
|
|
2617
|
+
|
|
2160
2618
|
// src/detection/frameworks/remix.ts
|
|
2161
2619
|
var remix = {
|
|
2162
2620
|
slug: "remix",
|
|
@@ -2178,6 +2636,45 @@ var remix = {
|
|
|
2178
2636
|
})
|
|
2179
2637
|
};
|
|
2180
2638
|
|
|
2639
|
+
// src/detection/frameworks/roda.ts
|
|
2640
|
+
var roda = {
|
|
2641
|
+
slug: "roda",
|
|
2642
|
+
name: "Roda",
|
|
2643
|
+
language: "ruby",
|
|
2644
|
+
detectors: [{ matchPackage: "roda" }, { path: "config.ru" }],
|
|
2645
|
+
priority: 60,
|
|
2646
|
+
getDefaultConfig: () => rubyServerDefaults({ environmentVariables: { RACK_ENV: "production" } }),
|
|
2647
|
+
refineDefaultConfig: refineRubyPublicDirectory
|
|
2648
|
+
};
|
|
2649
|
+
|
|
2650
|
+
// src/detection/frameworks/sinatra.ts
|
|
2651
|
+
var import_platform15 = require("@effect/platform");
|
|
2652
|
+
var import_effect22 = require("effect");
|
|
2653
|
+
var SINATRA_ENTRYPOINTS = ["config.ru", "app.rb", "main.rb", "server.rb", "application.rb"];
|
|
2654
|
+
var refineSinatraEntrypoint = import_effect22.Effect.fn("refineSinatraEntrypoint")(function* (defaults, projectFolder) {
|
|
2655
|
+
const fs = yield* import_platform15.FileSystem.FileSystem;
|
|
2656
|
+
const pathService = yield* import_platform15.Path.Path;
|
|
2657
|
+
const entrypoint = yield* import_effect22.Effect.findFirst(
|
|
2658
|
+
SINATRA_ENTRYPOINTS,
|
|
2659
|
+
(file) => fs.exists(pathService.join(projectFolder, file)).pipe(import_effect22.Effect.catchAll(() => import_effect22.Effect.succeed(false)))
|
|
2660
|
+
);
|
|
2661
|
+
const withPublicDirectory = yield* refineRubyPublicDirectory(defaults, projectFolder);
|
|
2662
|
+
return entrypoint._tag === "Some" ? {
|
|
2663
|
+
...withPublicDirectory,
|
|
2664
|
+
entrypoint: entrypoint.value,
|
|
2665
|
+
routes: [{ source: "/*", destination: entrypoint.value }]
|
|
2666
|
+
} : withPublicDirectory;
|
|
2667
|
+
});
|
|
2668
|
+
var sinatra = {
|
|
2669
|
+
slug: "sinatra",
|
|
2670
|
+
name: "Sinatra",
|
|
2671
|
+
language: "ruby",
|
|
2672
|
+
detectors: [{ matchPackage: "sinatra" }],
|
|
2673
|
+
priority: 60,
|
|
2674
|
+
getDefaultConfig: () => rubyServerDefaults({ environmentVariables: { APP_ENV: "production", RACK_ENV: "production" } }),
|
|
2675
|
+
refineDefaultConfig: refineSinatraEntrypoint
|
|
2676
|
+
};
|
|
2677
|
+
|
|
2181
2678
|
// src/detection/frameworks/slim.ts
|
|
2182
2679
|
var slim = {
|
|
2183
2680
|
slug: "slim",
|
|
@@ -2298,17 +2795,33 @@ var FRAMEWORK_DEFINITIONS = [
|
|
|
2298
2795
|
mezzio,
|
|
2299
2796
|
yii,
|
|
2300
2797
|
slim,
|
|
2798
|
+
...railsPresets,
|
|
2799
|
+
hanami,
|
|
2800
|
+
...jekyllPresets,
|
|
2801
|
+
bridgetown,
|
|
2802
|
+
sinatra,
|
|
2803
|
+
roda,
|
|
2301
2804
|
hono,
|
|
2302
2805
|
elysia,
|
|
2303
2806
|
fastify,
|
|
2304
2807
|
express,
|
|
2808
|
+
rack,
|
|
2305
2809
|
...phpComposerProjects,
|
|
2306
2810
|
...phpSites,
|
|
2307
2811
|
vite
|
|
2308
|
-
].map((framework) =>
|
|
2812
|
+
].map((framework) => {
|
|
2813
|
+
switch (framework.language) {
|
|
2814
|
+
case "php":
|
|
2815
|
+
return withComposerPhpRuntime(framework);
|
|
2816
|
+
case "ruby":
|
|
2817
|
+
return withRubyRuntime(framework);
|
|
2818
|
+
case "node":
|
|
2819
|
+
return framework;
|
|
2820
|
+
}
|
|
2821
|
+
}).sort((a, b) => b.priority - a.priority);
|
|
2309
2822
|
|
|
2310
2823
|
// src/detection/generate-config.ts
|
|
2311
|
-
var
|
|
2824
|
+
var import_effect23 = require("effect");
|
|
2312
2825
|
var getInstallCommand = (pm) => {
|
|
2313
2826
|
switch (pm) {
|
|
2314
2827
|
case "bun":
|
|
@@ -2319,6 +2832,8 @@ var getInstallCommand = (pm) => {
|
|
|
2319
2832
|
return "yarn install";
|
|
2320
2833
|
case "composer":
|
|
2321
2834
|
return "composer install";
|
|
2835
|
+
case "bundler":
|
|
2836
|
+
return "bundle install";
|
|
2322
2837
|
case "npm":
|
|
2323
2838
|
default:
|
|
2324
2839
|
return "npm install";
|
|
@@ -2329,11 +2844,17 @@ var isPrivatePhpProjectFile = (projectPath) => {
|
|
|
2329
2844
|
const segments = projectPath.split("/").filter((segment) => segment !== "" && segment !== ".");
|
|
2330
2845
|
return segments.some((segment) => segment.startsWith(".")) || segments[0] === "vendor" || segments[0] === "node_modules" || segments.length === 1 && COMPOSER_ROOT_FILES.has(segments[0] ?? "");
|
|
2331
2846
|
};
|
|
2332
|
-
var
|
|
2847
|
+
var BUNDLER_FILES = /* @__PURE__ */ new Set(["Gemfile", "Gemfile.lock", "gems.rb", "gems.locked"]);
|
|
2848
|
+
var isPrivateRubyProjectFile = (projectPath) => {
|
|
2849
|
+
const segments = projectPath.split("/").filter((segment) => segment !== "" && segment !== ".");
|
|
2850
|
+
const fileName = segments.at(-1) ?? "";
|
|
2851
|
+
return segments.some((segment) => segment.startsWith(".")) || segments[0] === "vendor" || /\.(rb|ru)$/i.test(fileName) || BUNDLER_FILES.has(fileName);
|
|
2852
|
+
};
|
|
2853
|
+
var generateConfig = import_effect23.Effect.fn("generateConfig")(function* (framework, packageManager, projectFolder, refinedDefaults) {
|
|
2333
2854
|
const defaults = refinedDefaults ?? framework.getDefaultConfig(packageManager);
|
|
2334
2855
|
const installCmd = defaults.installCommand ?? getInstallCommand(packageManager);
|
|
2335
2856
|
const commands = installCmd ? [installCmd, ...defaults.commands] : [...defaults.commands];
|
|
2336
|
-
yield*
|
|
2857
|
+
yield* import_effect23.Effect.logDebug(`Generating config for ${framework.name}`, {
|
|
2337
2858
|
runtime: defaults.runtime,
|
|
2338
2859
|
entrypoint: defaults.entrypoint,
|
|
2339
2860
|
commands
|
|
@@ -2376,6 +2897,7 @@ var generateConfig = import_effect16.Effect.fn("generateConfig")(function* (fram
|
|
|
2376
2897
|
for (const file of yield* collectAssetFiles(projectFolder, assetsDir)) {
|
|
2377
2898
|
if (framework.language === "php" && /\.(php|phtml|phar)$/i.test(file)) continue;
|
|
2378
2899
|
if (framework.language === "php" && isPrivatePhpProjectFile(`${assetsDir}/${file}`)) continue;
|
|
2900
|
+
if (framework.language === "ruby" && isPrivateRubyProjectFile(`${assetsDir}/${file}`)) continue;
|
|
2379
2901
|
paths.push(`${assetsDir}/${file}`);
|
|
2380
2902
|
if (!servesDirectoryIndexes || file in overrides) continue;
|
|
2381
2903
|
if (file === "index.html") {
|
|
@@ -2398,80 +2920,10 @@ var generateConfig = import_effect16.Effect.fn("generateConfig")(function* (fram
|
|
|
2398
2920
|
return config;
|
|
2399
2921
|
});
|
|
2400
2922
|
|
|
2401
|
-
// src/detection/read-dependencies.ts
|
|
2402
|
-
var import_platform12 = require("@effect/platform");
|
|
2403
|
-
var import_effect18 = require("effect");
|
|
2404
|
-
|
|
2405
|
-
// src/detection/types.ts
|
|
2406
|
-
var import_effect17 = require("effect");
|
|
2407
|
-
var ManifestNotFoundError = class extends import_effect17.Schema.TaggedError()("ManifestNotFoundError", {
|
|
2408
|
-
message: import_effect17.Schema.String,
|
|
2409
|
-
filePath: import_effect17.Schema.String
|
|
2410
|
-
}) {
|
|
2411
|
-
};
|
|
2412
|
-
var ManifestReadError = class extends import_effect17.Schema.TaggedError()("ManifestReadError", {
|
|
2413
|
-
message: import_effect17.Schema.String,
|
|
2414
|
-
filePath: import_effect17.Schema.String
|
|
2415
|
-
}) {
|
|
2416
|
-
};
|
|
2417
|
-
var ManifestParseError = class extends import_effect17.Schema.TaggedError()("ManifestParseError", {
|
|
2418
|
-
message: import_effect17.Schema.String,
|
|
2419
|
-
filePath: import_effect17.Schema.String
|
|
2420
|
-
}) {
|
|
2421
|
-
};
|
|
2422
|
-
var FrameworkNotDetectedError = class extends import_effect17.Schema.TaggedError()(
|
|
2423
|
-
"FrameworkNotDetectedError",
|
|
2424
|
-
{
|
|
2425
|
-
message: import_effect17.Schema.String,
|
|
2426
|
-
directory: import_effect17.Schema.String
|
|
2427
|
-
}
|
|
2428
|
-
) {
|
|
2429
|
-
};
|
|
2430
|
-
|
|
2431
|
-
// src/detection/read-dependencies.ts
|
|
2432
|
-
var MANIFEST_CONFIG = {
|
|
2433
|
-
node: { file: "package.json", depKeys: ["dependencies", "devDependencies"] },
|
|
2434
|
-
php: { file: "composer.json", depKeys: ["require", "require-dev"] }
|
|
2435
|
-
};
|
|
2436
|
-
var readManifest = import_effect18.Effect.fn("readManifest")(function* (filePath) {
|
|
2437
|
-
const fs = yield* import_platform12.FileSystem.FileSystem;
|
|
2438
|
-
const exists = yield* fs.exists(filePath).pipe(import_effect18.Effect.catchAll(() => import_effect18.Effect.succeed(false)));
|
|
2439
|
-
if (!exists) {
|
|
2440
|
-
return yield* import_effect18.Effect.fail(new ManifestNotFoundError({ message: "Manifest not found", filePath }));
|
|
2441
|
-
}
|
|
2442
|
-
const content = yield* fs.readFileString(filePath).pipe(import_effect18.Effect.mapError(() => new ManifestReadError({ message: "Failed to read manifest", filePath })));
|
|
2443
|
-
const parsed = yield* import_effect18.Effect.try({
|
|
2444
|
-
try: () => JSON.parse(content),
|
|
2445
|
-
catch: () => new ManifestParseError({ message: "Failed to parse manifest JSON", filePath })
|
|
2446
|
-
});
|
|
2447
|
-
return parsed;
|
|
2448
|
-
});
|
|
2449
|
-
var readDependencies = import_effect18.Effect.fn("readDependencies")(function* (projectFolder, language) {
|
|
2450
|
-
const pathService = yield* import_platform12.Path.Path;
|
|
2451
|
-
const config = MANIFEST_CONFIG[language];
|
|
2452
|
-
const filePath = pathService.join(projectFolder, config.file);
|
|
2453
|
-
const manifest = yield* readManifest(filePath).pipe(
|
|
2454
|
-
import_effect18.Effect.catchTag("ManifestNotFoundError", () => import_effect18.Effect.succeed(null))
|
|
2455
|
-
);
|
|
2456
|
-
if (!manifest) {
|
|
2457
|
-
return /* @__PURE__ */ new Set();
|
|
2458
|
-
}
|
|
2459
|
-
const deps = /* @__PURE__ */ new Set();
|
|
2460
|
-
for (const key of config.depKeys) {
|
|
2461
|
-
const section = manifest[key];
|
|
2462
|
-
if (section && typeof section === "object" && !Array.isArray(section)) {
|
|
2463
|
-
for (const name of Object.keys(section)) {
|
|
2464
|
-
deps.add(name);
|
|
2465
|
-
}
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
return deps;
|
|
2469
|
-
});
|
|
2470
|
-
|
|
2471
2923
|
// src/detection/detect-framework.ts
|
|
2472
|
-
var matchesDetectionItem =
|
|
2473
|
-
const fs = yield*
|
|
2474
|
-
const pathService = yield*
|
|
2924
|
+
var matchesDetectionItem = import_effect24.Effect.fn("matchesDetectionItem")(function* (item, projectFolder, framework, cachedReadDeps) {
|
|
2925
|
+
const fs = yield* import_platform16.FileSystem.FileSystem;
|
|
2926
|
+
const pathService = yield* import_platform16.Path.Path;
|
|
2475
2927
|
if (item.matchPackage != null) {
|
|
2476
2928
|
const deps = yield* cachedReadDeps(`${projectFolder}\0${framework.language}`);
|
|
2477
2929
|
if (!deps.has(item.matchPackage)) {
|
|
@@ -2480,12 +2932,12 @@ var matchesDetectionItem = import_effect19.Effect.fn("matchesDetectionItem")(fun
|
|
|
2480
2932
|
}
|
|
2481
2933
|
if (item.path != null) {
|
|
2482
2934
|
const filePath = pathService.join(projectFolder, item.path);
|
|
2483
|
-
const exists = yield* fs.exists(filePath).pipe(
|
|
2935
|
+
const exists = yield* fs.exists(filePath).pipe(import_effect24.Effect.catchAll(() => import_effect24.Effect.succeed(false)));
|
|
2484
2936
|
if (!exists) {
|
|
2485
2937
|
return false;
|
|
2486
2938
|
}
|
|
2487
2939
|
if (item.matchContent != null) {
|
|
2488
|
-
const content = yield* fs.readFileString(filePath).pipe(
|
|
2940
|
+
const content = yield* fs.readFileString(filePath).pipe(import_effect24.Effect.catchAll(() => import_effect24.Effect.succeed("")));
|
|
2489
2941
|
let regexMatch = false;
|
|
2490
2942
|
try {
|
|
2491
2943
|
regexMatch = new RegExp(item.matchContent).test(content);
|
|
@@ -2498,7 +2950,7 @@ var matchesDetectionItem = import_effect19.Effect.fn("matchesDetectionItem")(fun
|
|
|
2498
2950
|
}
|
|
2499
2951
|
return true;
|
|
2500
2952
|
});
|
|
2501
|
-
var matchesFramework =
|
|
2953
|
+
var matchesFramework = import_effect24.Effect.fn("matchesFramework")(function* (framework, projectFolder, cachedReadDeps) {
|
|
2502
2954
|
for (const detector of framework.detectors) {
|
|
2503
2955
|
const matches = yield* matchesDetectionItem(detector, projectFolder, framework, cachedReadDeps);
|
|
2504
2956
|
if (!matches) {
|
|
@@ -2507,9 +2959,19 @@ var matchesFramework = import_effect19.Effect.fn("matchesFramework")(function* (
|
|
|
2507
2959
|
}
|
|
2508
2960
|
return true;
|
|
2509
2961
|
});
|
|
2510
|
-
var
|
|
2511
|
-
|
|
2512
|
-
|
|
2962
|
+
var packageManagerForLanguage = (language, detected) => {
|
|
2963
|
+
switch (language) {
|
|
2964
|
+
case "php":
|
|
2965
|
+
return "composer";
|
|
2966
|
+
case "ruby":
|
|
2967
|
+
return "bundler";
|
|
2968
|
+
case "node":
|
|
2969
|
+
return detected === "bundler" ? "npm" : detected;
|
|
2970
|
+
}
|
|
2971
|
+
};
|
|
2972
|
+
var detectFramework = import_effect24.Effect.fn("detectFramework")(function* (projectFolder) {
|
|
2973
|
+
yield* import_effect24.Effect.logDebug(`Detecting framework in ${projectFolder}`);
|
|
2974
|
+
const cachedReadDeps = yield* import_effect24.Effect.cachedFunction((key) => {
|
|
2513
2975
|
const sepIndex = key.lastIndexOf("\0");
|
|
2514
2976
|
const folder = key.slice(0, sepIndex);
|
|
2515
2977
|
const language = key.slice(sepIndex + 1);
|
|
@@ -2518,16 +2980,16 @@ var detectFramework = import_effect19.Effect.fn("detectFramework")(function* (pr
|
|
|
2518
2980
|
for (const framework of FRAMEWORK_DEFINITIONS) {
|
|
2519
2981
|
const matches = yield* matchesFramework(framework, projectFolder, cachedReadDeps);
|
|
2520
2982
|
if (matches) {
|
|
2521
|
-
yield*
|
|
2983
|
+
yield* import_effect24.Effect.log(`Detected framework: ${framework.name}`, { slug: framework.slug });
|
|
2522
2984
|
const detectedPackageManager = yield* detectPackageManager(projectFolder);
|
|
2523
|
-
const packageManager = framework.language
|
|
2985
|
+
const packageManager = packageManagerForLanguage(framework.language, detectedPackageManager);
|
|
2524
2986
|
const defaults = framework.getDefaultConfig(packageManager);
|
|
2525
2987
|
const refinedDefaults = framework.refineDefaultConfig ? yield* framework.refineDefaultConfig(defaults, projectFolder) : defaults;
|
|
2526
2988
|
const config = yield* generateConfig(framework, packageManager, projectFolder, refinedDefaults);
|
|
2527
2989
|
return { framework, packageManager, config };
|
|
2528
2990
|
}
|
|
2529
2991
|
}
|
|
2530
|
-
return yield*
|
|
2992
|
+
return yield* import_effect24.Effect.fail(
|
|
2531
2993
|
new FrameworkNotDetectedError({
|
|
2532
2994
|
message: `No framework detected in project directory`,
|
|
2533
2995
|
directory: projectFolder
|
|
@@ -2536,9 +2998,9 @@ var detectFramework = import_effect19.Effect.fn("detectFramework")(function* (pr
|
|
|
2536
2998
|
});
|
|
2537
2999
|
|
|
2538
3000
|
// src/detection/merge-config.ts
|
|
2539
|
-
var
|
|
2540
|
-
var mergeWithFrameworkDefaults =
|
|
2541
|
-
yield*
|
|
3001
|
+
var import_effect25 = require("effect");
|
|
3002
|
+
var mergeWithFrameworkDefaults = import_effect25.Effect.fn("mergeWithFrameworkDefaults")(function* (userConfig, frameworkConfig) {
|
|
3003
|
+
yield* import_effect25.Effect.logDebug("Merging user config with framework defaults");
|
|
2542
3004
|
const userHasAssets = (userConfig.assets?.paths?.length ?? 0) > 0 || (userConfig.assets?.prefixes?.length ?? 0) > 0 || (userConfig.assets?.manifests?.length ?? 0) > 0;
|
|
2543
3005
|
const isContainer = (entrypoint) => entrypoint.runtime === CONTAINER_RUNTIME;
|
|
2544
3006
|
const userFileFunctions = userConfig.entrypoints.filter((entrypoint) => !isContainer(entrypoint));
|
|
@@ -2579,23 +3041,23 @@ var filterFunctionsFromAssets = (config) => {
|
|
|
2579
3041
|
};
|
|
2580
3042
|
|
|
2581
3043
|
// src/parse-config.ts
|
|
2582
|
-
var
|
|
3044
|
+
var import_effect31 = require("effect");
|
|
2583
3045
|
|
|
2584
3046
|
// src/services/raw-config-reader.ts
|
|
2585
|
-
var
|
|
2586
|
-
var
|
|
3047
|
+
var import_platform17 = require("@effect/platform");
|
|
3048
|
+
var import_effect27 = require("effect");
|
|
2587
3049
|
var import_yaml2 = require("yaml");
|
|
2588
3050
|
|
|
2589
3051
|
// src/services/config-module-loader.ts
|
|
2590
|
-
var
|
|
3052
|
+
var import_effect26 = require("effect");
|
|
2591
3053
|
var import_jiti = require("jiti");
|
|
2592
3054
|
var MISSING_DEFAULT_EXPORT = /* @__PURE__ */ Symbol("MissingDefaultExport");
|
|
2593
3055
|
var STRICT_DEFAULT_EXPORT_EXTENSIONS = [".ts", ".mts", ".mjs"];
|
|
2594
|
-
var ConfigModuleLoader = class extends
|
|
2595
|
-
effect:
|
|
2596
|
-
const loadConfigModule =
|
|
3056
|
+
var ConfigModuleLoader = class extends import_effect26.Effect.Service()("ConfigModuleLoader", {
|
|
3057
|
+
effect: import_effect26.Effect.gen(function* () {
|
|
3058
|
+
const loadConfigModule = import_effect26.Effect.fn("ConfigModuleLoader.loadConfigModule")(function* (filePath) {
|
|
2597
3059
|
const extension = filePath.slice(filePath.lastIndexOf(".")).toLowerCase();
|
|
2598
|
-
const mod = yield*
|
|
3060
|
+
const mod = yield* import_effect26.Effect.tryPromise({
|
|
2599
3061
|
try: async () => {
|
|
2600
3062
|
const jiti = (0, import_jiti.createJiti)(filePath, { fsCache: false, interopDefault: true, moduleCache: false });
|
|
2601
3063
|
const namespace = await jiti.import(filePath);
|
|
@@ -2614,7 +3076,7 @@ var ConfigModuleLoader = class extends import_effect21.Effect.Service()("ConfigM
|
|
|
2614
3076
|
})
|
|
2615
3077
|
});
|
|
2616
3078
|
if (mod === MISSING_DEFAULT_EXPORT) {
|
|
2617
|
-
return yield*
|
|
3079
|
+
return yield* import_effect26.Effect.fail(
|
|
2618
3080
|
new ConfigModuleLoadError({
|
|
2619
3081
|
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.`,
|
|
2620
3082
|
filePath
|
|
@@ -2622,7 +3084,7 @@ var ConfigModuleLoader = class extends import_effect21.Effect.Service()("ConfigM
|
|
|
2622
3084
|
);
|
|
2623
3085
|
}
|
|
2624
3086
|
if (typeof mod === "function") {
|
|
2625
|
-
return yield*
|
|
3087
|
+
return yield* import_effect26.Effect.fail(
|
|
2626
3088
|
new ConfigModuleLoadError({
|
|
2627
3089
|
message: `Config module at ${filePath} default-exports a function; config factories are not supported. Export a config object instead (optionally wrapped in defineConfig).`,
|
|
2628
3090
|
filePath
|
|
@@ -2630,7 +3092,7 @@ var ConfigModuleLoader = class extends import_effect21.Effect.Service()("ConfigM
|
|
|
2630
3092
|
);
|
|
2631
3093
|
}
|
|
2632
3094
|
if (typeof mod !== "object" || mod === null || Array.isArray(mod)) {
|
|
2633
|
-
return yield*
|
|
3095
|
+
return yield* import_effect26.Effect.fail(
|
|
2634
3096
|
new ConfigModuleLoadError({
|
|
2635
3097
|
message: `Config module at ${filePath} must default-export a config object.`,
|
|
2636
3098
|
filePath
|
|
@@ -2660,36 +3122,36 @@ var ALLOWED_CONFIG_NAMES = [
|
|
|
2660
3122
|
"nebula.json"
|
|
2661
3123
|
];
|
|
2662
3124
|
var MODULE_EXTENSIONS = [".ts", ".mts", ".cts", ".js", ".mjs", ".cjs"];
|
|
2663
|
-
var RawConfigReader = class extends
|
|
3125
|
+
var RawConfigReader = class extends import_effect27.Effect.Service()("RawConfigReader", {
|
|
2664
3126
|
dependencies: [ConfigModuleLoader.Default],
|
|
2665
|
-
effect:
|
|
2666
|
-
const fs = yield*
|
|
2667
|
-
const pathService = yield*
|
|
3127
|
+
effect: import_effect27.Effect.gen(function* () {
|
|
3128
|
+
const fs = yield* import_platform17.FileSystem.FileSystem;
|
|
3129
|
+
const pathService = yield* import_platform17.Path.Path;
|
|
2668
3130
|
const moduleLoader = yield* ConfigModuleLoader;
|
|
2669
|
-
const findConfig =
|
|
3131
|
+
const findConfig = import_effect27.Effect.fn("RawConfigReader.findConfig")(function* (projectFolder) {
|
|
2670
3132
|
for (const name of ALLOWED_CONFIG_NAMES) {
|
|
2671
3133
|
const filePath = pathService.join(projectFolder, name);
|
|
2672
|
-
const exists = yield* fs.exists(filePath).pipe(
|
|
3134
|
+
const exists = yield* fs.exists(filePath).pipe(import_effect27.Effect.catchAll(() => import_effect27.Effect.succeed(false)));
|
|
2673
3135
|
if (exists) {
|
|
2674
3136
|
return filePath;
|
|
2675
3137
|
}
|
|
2676
3138
|
}
|
|
2677
3139
|
return null;
|
|
2678
3140
|
});
|
|
2679
|
-
const readRawConfig =
|
|
2680
|
-
const exists = yield* fs.exists(filePath).pipe(
|
|
3141
|
+
const readRawConfig = import_effect27.Effect.fn("RawConfigReader.readRawConfig")(function* (filePath, options) {
|
|
3142
|
+
const exists = yield* fs.exists(filePath).pipe(import_effect27.Effect.catchAll(() => import_effect27.Effect.succeed(false)));
|
|
2681
3143
|
if (!exists) {
|
|
2682
|
-
return yield*
|
|
3144
|
+
return yield* import_effect27.Effect.fail(
|
|
2683
3145
|
new ConfigFileNotFoundError({ message: `Config file not found at ${filePath}`, filePath })
|
|
2684
3146
|
);
|
|
2685
3147
|
}
|
|
2686
3148
|
const fileContents = yield* fs.readFileString(filePath).pipe(
|
|
2687
|
-
|
|
3149
|
+
import_effect27.Effect.mapError(
|
|
2688
3150
|
() => new ConfigFileParseError({ message: `Failed to read config file at ${filePath}`, filePath })
|
|
2689
3151
|
)
|
|
2690
3152
|
);
|
|
2691
3153
|
if (fileContents.length === 0) {
|
|
2692
|
-
return yield*
|
|
3154
|
+
return yield* import_effect27.Effect.fail(
|
|
2693
3155
|
new ConfigFileEmptyError({ message: `Config file is empty at ${filePath}`, filePath })
|
|
2694
3156
|
);
|
|
2695
3157
|
}
|
|
@@ -2705,7 +3167,7 @@ var RawConfigReader = class extends import_effect22.Effect.Service()("RawConfigR
|
|
|
2705
3167
|
parsed = (0, import_yaml2.parse)(fileContents);
|
|
2706
3168
|
}
|
|
2707
3169
|
} catch (error) {
|
|
2708
|
-
return yield*
|
|
3170
|
+
return yield* import_effect27.Effect.fail(
|
|
2709
3171
|
new ConfigFileParseError({
|
|
2710
3172
|
message: `Failed to parse config file at ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
2711
3173
|
filePath,
|
|
@@ -2715,21 +3177,21 @@ var RawConfigReader = class extends import_effect22.Effect.Service()("RawConfigR
|
|
|
2715
3177
|
}
|
|
2716
3178
|
}
|
|
2717
3179
|
if (parsed == null) {
|
|
2718
|
-
return yield*
|
|
3180
|
+
return yield* import_effect27.Effect.fail(
|
|
2719
3181
|
new ConfigFileParseError({ message: `Config file could not be parsed at ${filePath}`, filePath })
|
|
2720
3182
|
);
|
|
2721
3183
|
}
|
|
2722
3184
|
if (!options?.disableVersionCheck && typeof parsed.version !== "number") {
|
|
2723
|
-
return yield*
|
|
3185
|
+
return yield* import_effect27.Effect.fail(
|
|
2724
3186
|
new ConfigVersionError({ message: `Config file is missing version at ${filePath}`, filePath })
|
|
2725
3187
|
);
|
|
2726
3188
|
}
|
|
2727
3189
|
return parsed;
|
|
2728
3190
|
});
|
|
2729
3191
|
const readConfigFile = (configFilePath) => readRawConfig(configFilePath, { disableVersionCheck: true }).pipe(
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
3192
|
+
import_effect27.Effect.map((parsed) => parsed),
|
|
3193
|
+
import_effect27.Effect.catchTag("ConfigFileNotFoundError", () => import_effect27.Effect.succeed(null)),
|
|
3194
|
+
import_effect27.Effect.withSpan("RawConfigReader.readConfigFile")
|
|
2733
3195
|
);
|
|
2734
3196
|
return { findConfig, readRawConfig, readConfigFile };
|
|
2735
3197
|
})
|
|
@@ -2739,17 +3201,17 @@ var RawConfigReader = class extends import_effect22.Effect.Service()("RawConfigR
|
|
|
2739
3201
|
// src/services/schema-validator.ts
|
|
2740
3202
|
var import_ajv = __toESM(require("ajv"));
|
|
2741
3203
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2742
|
-
var
|
|
2743
|
-
var SchemaValidator = class extends
|
|
2744
|
-
effect:
|
|
3204
|
+
var import_effect28 = require("effect");
|
|
3205
|
+
var SchemaValidator = class extends import_effect28.Effect.Service()("SchemaValidator", {
|
|
3206
|
+
effect: import_effect28.Effect.gen(function* () {
|
|
2745
3207
|
const ajv = new import_ajv.default();
|
|
2746
3208
|
(0, import_ajv_formats.default)(ajv);
|
|
2747
|
-
const validate =
|
|
3209
|
+
const validate = import_effect28.Effect.fn("SchemaValidator.validate")(function* (config, schema, filePath) {
|
|
2748
3210
|
const compiledValidate = ajv.compile(schema);
|
|
2749
3211
|
const valid = compiledValidate(config);
|
|
2750
3212
|
if (!valid) {
|
|
2751
3213
|
const errors = compiledValidate.errors?.map((e) => `${e.instancePath || "/"} ${e.message ?? ""}`.trim()) ?? [];
|
|
2752
|
-
return yield*
|
|
3214
|
+
return yield* import_effect28.Effect.fail(
|
|
2753
3215
|
new ConfigSchemaValidationError({
|
|
2754
3216
|
message: `Config file at ${filePath} is invalid: ${ajv.errorsText(compiledValidate.errors)}`,
|
|
2755
3217
|
filePath,
|
|
@@ -2805,7 +3267,7 @@ var getFilesForPattern = async (pattern, projectFolder, excludeFiles = []) => {
|
|
|
2805
3267
|
};
|
|
2806
3268
|
|
|
2807
3269
|
// src/services/v4-config-parser.ts
|
|
2808
|
-
var
|
|
3270
|
+
var import_effect29 = require("effect");
|
|
2809
3271
|
var import_minimatch2 = require("minimatch");
|
|
2810
3272
|
var import_node_path2 = require("path");
|
|
2811
3273
|
var import_safe_regex2 = __toESM(require("safe-regex2"));
|
|
@@ -2821,7 +3283,7 @@ var toArray = (value) => {
|
|
|
2821
3283
|
if (value == null) return void 0;
|
|
2822
3284
|
return Array.isArray(value) ? value : [value];
|
|
2823
3285
|
};
|
|
2824
|
-
var runtimeStreamsByDefault = (runtime) => runtime == null || runtime.startsWith("node-") || runtime.startsWith("bun-");
|
|
3286
|
+
var runtimeStreamsByDefault = (runtime) => runtime == null || runtime.startsWith("node-") || runtime.startsWith("bun-") || runtime.startsWith("ruby-");
|
|
2825
3287
|
var normalizeImagePolicy = (images) => {
|
|
2826
3288
|
if (!images) return void 0;
|
|
2827
3289
|
return {
|
|
@@ -2956,7 +3418,7 @@ var mapRoute = (route, entrypoints) => ({
|
|
|
2956
3418
|
negativeRequirements: route.missing,
|
|
2957
3419
|
status: route.statusCode
|
|
2958
3420
|
});
|
|
2959
|
-
var parseEntrypoints =
|
|
3421
|
+
var parseEntrypoints = import_effect29.Effect.fn("parseEntrypoints")(function* (config, projectFolder) {
|
|
2960
3422
|
const entrypoints = [];
|
|
2961
3423
|
const dockerFunctions = [];
|
|
2962
3424
|
if (config.functions == null) return { entrypoints, dockerFunctions };
|
|
@@ -2967,7 +3429,7 @@ var parseEntrypoints = import_effect24.Effect.fn("parseEntrypoints")(function* (
|
|
|
2967
3429
|
functionPath: fnPath
|
|
2968
3430
|
});
|
|
2969
3431
|
}
|
|
2970
|
-
const matchedFiles = yield*
|
|
3432
|
+
const matchedFiles = yield* import_effect29.Effect.tryPromise({
|
|
2971
3433
|
try: () => getFilesForPattern(fnPath, projectFolder, func.excludeFiles),
|
|
2972
3434
|
catch: (error) => new FunctionConfigError({
|
|
2973
3435
|
message: `Failed to resolve files for function pattern '${fnPath}': ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -3042,13 +3504,13 @@ var parseEntrypoints = import_effect24.Effect.fn("parseEntrypoints")(function* (
|
|
|
3042
3504
|
}
|
|
3043
3505
|
return { entrypoints, dockerFunctions };
|
|
3044
3506
|
});
|
|
3045
|
-
var collectAssets =
|
|
3507
|
+
var collectAssets = import_effect29.Effect.fn("collectAssets")(function* (config, projectFolder) {
|
|
3046
3508
|
if (config.assets == null) return [];
|
|
3047
3509
|
const assetNames = yield* collectAssetFiles(projectFolder, config.assets);
|
|
3048
3510
|
return assetNames.filter((assetName) => getFunctionSettings(`${config.assets}/${assetName}`, config) == null).map((assetName) => `${config.assets}/${assetName}`);
|
|
3049
3511
|
});
|
|
3050
3512
|
var reservedRuntimePorts = (entrypoint) => entrypoint.runtime === CONTAINER_RUNTIME ? [] : entrypoint.runtime.startsWith("php-") ? [8080, 9e3] : [8080];
|
|
3051
|
-
var parseContainers =
|
|
3513
|
+
var parseContainers = import_effect29.Effect.fn("parseContainers")(function* (config, projectFolder, fileEntrypoints, dockerFunctions) {
|
|
3052
3514
|
const warnings = [];
|
|
3053
3515
|
let containers = {};
|
|
3054
3516
|
if (config.compose != null) {
|
|
@@ -3081,16 +3543,16 @@ var parseContainers = import_effect24.Effect.fn("parseContainers")(function* (co
|
|
|
3081
3543
|
}
|
|
3082
3544
|
return { ...result, warnings };
|
|
3083
3545
|
});
|
|
3084
|
-
var V4ConfigParser = class extends
|
|
3546
|
+
var V4ConfigParser = class extends import_effect29.Effect.Service()("V4ConfigParser", {
|
|
3085
3547
|
accessors: true,
|
|
3086
|
-
effect:
|
|
3548
|
+
effect: import_effect29.Effect.succeed({
|
|
3087
3549
|
/**
|
|
3088
3550
|
* Parses a ConfigV4 into a NormalizedConfig.
|
|
3089
3551
|
*
|
|
3090
3552
|
* @param config - The raw V4 config object
|
|
3091
3553
|
* @param projectFolder - Absolute path to the project root
|
|
3092
3554
|
*/
|
|
3093
|
-
parse:
|
|
3555
|
+
parse: import_effect29.Effect.fn("V4ConfigParser.parse")(function* (config, projectFolder) {
|
|
3094
3556
|
const { entrypoints: fileEntrypoints, dockerFunctions } = yield* parseEntrypoints(config, projectFolder);
|
|
3095
3557
|
const containers = yield* parseContainers(config, projectFolder, fileEntrypoints, dockerFunctions);
|
|
3096
3558
|
const entrypoints = [...fileEntrypoints, ...containers.entrypoints];
|
|
@@ -3132,7 +3594,7 @@ var V4ConfigParser = class extends import_effect24.Effect.Service()("V4ConfigPar
|
|
|
3132
3594
|
};
|
|
3133
3595
|
|
|
3134
3596
|
// src/services/vercel-build-output-parser.ts
|
|
3135
|
-
var
|
|
3597
|
+
var import_platform18 = require("@effect/platform");
|
|
3136
3598
|
|
|
3137
3599
|
// ../commons/src/deep-merge.ts
|
|
3138
3600
|
var deepMerge = (target, ...partials) => {
|
|
@@ -3161,7 +3623,7 @@ var deepMerge = (target, ...partials) => {
|
|
|
3161
3623
|
};
|
|
3162
3624
|
|
|
3163
3625
|
// src/services/vercel-build-output-parser.ts
|
|
3164
|
-
var
|
|
3626
|
+
var import_effect30 = require("effect");
|
|
3165
3627
|
|
|
3166
3628
|
// src/build-output-v3/determine-repo-root.ts
|
|
3167
3629
|
var import_path = __toESM(require("path"));
|
|
@@ -3257,11 +3719,11 @@ var translateVercelRuntime = (runtime) => {
|
|
|
3257
3719
|
var CONFIG_PATH = ".vercel/output/config.json";
|
|
3258
3720
|
var FUNCTIONS_FOLDER = ".vercel/output/functions";
|
|
3259
3721
|
var FUNCTION_CONFIGS_PATTERN = `${FUNCTIONS_FOLDER}/**/*.func/.vc-config.json`;
|
|
3260
|
-
var VercelBuildOutputParser = class extends
|
|
3261
|
-
effect:
|
|
3722
|
+
var VercelBuildOutputParser = class extends import_effect30.Effect.Service()("VercelBuildOutputParser", {
|
|
3723
|
+
effect: import_effect30.Effect.gen(function* () {
|
|
3262
3724
|
const rawConfigReader = yield* RawConfigReader;
|
|
3263
|
-
const pathService = yield*
|
|
3264
|
-
const parse =
|
|
3725
|
+
const pathService = yield* import_platform18.Path.Path;
|
|
3726
|
+
const parse = import_effect30.Effect.fn("VercelBuildOutputParser.parse")(function* (parseResult, projectFolder) {
|
|
3265
3727
|
const config = yield* rawConfigReader.readConfigFile(pathService.join(projectFolder, CONFIG_PATH));
|
|
3266
3728
|
if (!config || typeof config.version !== "number" || config.version < 3) {
|
|
3267
3729
|
return parseResult;
|
|
@@ -3273,8 +3735,8 @@ var VercelBuildOutputParser = class extends import_effect25.Effect.Service()("Ve
|
|
|
3273
3735
|
merged.regions = [...new Set(merged.regions)];
|
|
3274
3736
|
return merged;
|
|
3275
3737
|
});
|
|
3276
|
-
const loadFunctions =
|
|
3277
|
-
const functionConfigs = yield*
|
|
3738
|
+
const loadFunctions = import_effect30.Effect.fn("VercelBuildOutputParser.loadFunctions")(function* (config, parseResult, projectFolder) {
|
|
3739
|
+
const functionConfigs = yield* import_effect30.Effect.tryPromise({
|
|
3278
3740
|
try: () => getFilesForPattern(FUNCTION_CONFIGS_PATTERN, projectFolder),
|
|
3279
3741
|
catch: (error) => new ConfigFileParseError({
|
|
3280
3742
|
message: `Failed to scan for function configs: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -3571,7 +4033,7 @@ var schema_default = {
|
|
|
3571
4033
|
},
|
|
3572
4034
|
streaming: {
|
|
3573
4035
|
type: "boolean",
|
|
3574
|
-
description: "Enable function response streaming. When omitted, Node and
|
|
4036
|
+
description: "Enable function response streaming. When omitted, Node, Bun and Ruby runtimes stream by default."
|
|
3575
4037
|
},
|
|
3576
4038
|
schedule: {
|
|
3577
4039
|
$ref: "#/$defs/schedule",
|
|
@@ -4137,7 +4599,19 @@ var schema_default = {
|
|
|
4137
4599
|
},
|
|
4138
4600
|
runtimes: {
|
|
4139
4601
|
type: "string",
|
|
4140
|
-
enum: [
|
|
4602
|
+
enum: [
|
|
4603
|
+
"php-84",
|
|
4604
|
+
"php-83",
|
|
4605
|
+
"php-81",
|
|
4606
|
+
"ruby-40",
|
|
4607
|
+
"ruby-34",
|
|
4608
|
+
"ruby-33",
|
|
4609
|
+
"node-22",
|
|
4610
|
+
"node-20",
|
|
4611
|
+
"node-18",
|
|
4612
|
+
"node-16",
|
|
4613
|
+
"bun-1"
|
|
4614
|
+
]
|
|
4141
4615
|
},
|
|
4142
4616
|
matchRequirements: {
|
|
4143
4617
|
description: "An array of requirements that are needed to match",
|
|
@@ -4191,7 +4665,7 @@ var schema_default = {
|
|
|
4191
4665
|
};
|
|
4192
4666
|
|
|
4193
4667
|
// src/parse-config.ts
|
|
4194
|
-
var parseConfigRaw =
|
|
4668
|
+
var parseConfigRaw = import_effect31.Effect.fn("parseConfigRaw")(function* (filePath, projectFolder) {
|
|
4195
4669
|
const rawReader = yield* RawConfigReader;
|
|
4196
4670
|
const validator = yield* SchemaValidator;
|
|
4197
4671
|
const v4Parser = yield* V4ConfigParser;
|
|
@@ -4202,7 +4676,7 @@ var parseConfigRaw = import_effect26.Effect.fn("parseConfigRaw")(function* (file
|
|
|
4202
4676
|
};
|
|
4203
4677
|
const schema = schemaMap[version];
|
|
4204
4678
|
if (!schema) {
|
|
4205
|
-
return yield*
|
|
4679
|
+
return yield* import_effect31.Effect.fail(
|
|
4206
4680
|
new ConfigVersionError({
|
|
4207
4681
|
message: `Config file at ${filePath} has an unsupported version: ${version}`,
|
|
4208
4682
|
filePath,
|
|
@@ -4213,11 +4687,11 @@ var parseConfigRaw = import_effect26.Effect.fn("parseConfigRaw")(function* (file
|
|
|
4213
4687
|
yield* validator.validate(parsed, schema, filePath);
|
|
4214
4688
|
return yield* v4Parser.parse(parsed, projectFolder);
|
|
4215
4689
|
});
|
|
4216
|
-
var parseConfig =
|
|
4690
|
+
var parseConfig = import_effect31.Effect.fn("parseConfig")(function* (filePath, projectFolder) {
|
|
4217
4691
|
const parseResult = yield* parseConfigRaw(filePath, projectFolder);
|
|
4218
4692
|
return yield* postProcessConfig(parseResult, projectFolder);
|
|
4219
4693
|
});
|
|
4220
|
-
var postProcessConfig =
|
|
4694
|
+
var postProcessConfig = import_effect31.Effect.fn("postProcessConfig")(function* (config, projectFolder) {
|
|
4221
4695
|
const vercelParser = yield* VercelBuildOutputParser;
|
|
4222
4696
|
let result = yield* vercelParser.parse(config, projectFolder);
|
|
4223
4697
|
const hasAssets = (result.assets?.paths?.length ?? 0) > 0 || (result.assets?.prefixes?.length ?? 0) > 0 || (result.assets?.manifests?.length ?? 0) > 0;
|
|
@@ -4265,6 +4739,9 @@ var RUNTIME_DEFINITIONS = [
|
|
|
4265
4739
|
"php-84",
|
|
4266
4740
|
"php-83",
|
|
4267
4741
|
"php-81",
|
|
4742
|
+
"ruby-40",
|
|
4743
|
+
"ruby-34",
|
|
4744
|
+
"ruby-33",
|
|
4268
4745
|
"node-22",
|
|
4269
4746
|
"node-20",
|
|
4270
4747
|
"node-18",
|
|
@@ -4274,14 +4751,14 @@ var RUNTIME_DEFINITIONS = [
|
|
|
4274
4751
|
var AVAILABLE_RUNTIMES = [...RUNTIME_DEFINITIONS];
|
|
4275
4752
|
|
|
4276
4753
|
// src/services/index.ts
|
|
4277
|
-
var
|
|
4278
|
-
var BaseLayers =
|
|
4754
|
+
var import_effect32 = require("effect");
|
|
4755
|
+
var BaseLayers = import_effect32.Layer.mergeAll(
|
|
4279
4756
|
ConfigModuleLoader.Default,
|
|
4280
4757
|
RawConfigReader.Default,
|
|
4281
4758
|
SchemaValidator.Default,
|
|
4282
4759
|
V4ConfigParser.Default
|
|
4283
4760
|
);
|
|
4284
|
-
var NetworkConfigLive = VercelBuildOutputParser.Default.pipe(
|
|
4761
|
+
var NetworkConfigLive = VercelBuildOutputParser.Default.pipe(import_effect32.Layer.provideMerge(BaseLayers));
|
|
4285
4762
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4286
4763
|
0 && (module.exports = {
|
|
4287
4764
|
ALLOWED_CONFIG_NAMES,
|
|
@@ -4300,6 +4777,7 @@ var NetworkConfigLive = VercelBuildOutputParser.Default.pipe(import_effect27.Lay
|
|
|
4300
4777
|
ContainerConfigError,
|
|
4301
4778
|
DEFAULT_CONTAINER_MEMORY_MB,
|
|
4302
4779
|
DEFAULT_FUNCTION_DURATION_SECONDS,
|
|
4780
|
+
DEFAULT_RUBY_RUNTIME,
|
|
4303
4781
|
DEFAULT_SIDECAR_MEMORY_MB,
|
|
4304
4782
|
FRAMEWORK_DEFINITIONS,
|
|
4305
4783
|
FrameworkNotDetectedError,
|
|
@@ -4336,6 +4814,7 @@ var NetworkConfigLive = VercelBuildOutputParser.Default.pipe(import_effect27.Lay
|
|
|
4336
4814
|
detectContainerProject,
|
|
4337
4815
|
detectFramework,
|
|
4338
4816
|
detectPackageManager,
|
|
4817
|
+
detectRubyRuntime,
|
|
4339
4818
|
dockerFunctionContainerName,
|
|
4340
4819
|
filterFunctionsFromAssets,
|
|
4341
4820
|
generateConfig,
|
|
@@ -4351,6 +4830,9 @@ var NetworkConfigLive = VercelBuildOutputParser.Default.pipe(import_effect27.Lay
|
|
|
4351
4830
|
postProcessConfig,
|
|
4352
4831
|
readComposeContainers,
|
|
4353
4832
|
readDependencies,
|
|
4833
|
+
rubyRuntimeForRequirement,
|
|
4834
|
+
rubyRuntimeForVersion,
|
|
4835
|
+
rubyRuntimeFromProjectFiles,
|
|
4354
4836
|
splitCommandWords
|
|
4355
4837
|
});
|
|
4356
4838
|
//# sourceMappingURL=index.js.map
|