@gigadrive/network-config 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -300,6 +300,17 @@ var loadFunctions = async (config, parseResult, projectFolder) => {
|
|
|
300
300
|
};
|
|
301
301
|
};
|
|
302
302
|
|
|
303
|
+
// src/filter-functions-from-assets.ts
|
|
304
|
+
var filterFunctionsFromAssets = async (config) => {
|
|
305
|
+
return {
|
|
306
|
+
...config,
|
|
307
|
+
assets: {
|
|
308
|
+
...config.assets,
|
|
309
|
+
paths: config.assets?.paths?.filter((path6) => !config.entrypoints.some((entrypoint) => entrypoint.path === path6))
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
|
|
303
314
|
// src/v4/parse.ts
|
|
304
315
|
import { getFilesForPattern as getFilesForPattern2 } from "@gigadrive/build-utils";
|
|
305
316
|
import fs5 from "fs";
|
|
@@ -376,6 +387,9 @@ var parseConfigV4 = async (config, projectFolder) => {
|
|
|
376
387
|
if (disallowedExtensions.some((ext) => assetName.toLowerCase().endsWith(ext.toLowerCase()))) {
|
|
377
388
|
continue;
|
|
378
389
|
}
|
|
390
|
+
if (getFunctionSettings(`${config.assets}/${assetName}`, config) != null) {
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
379
393
|
assets.push(`${config.assets}/${assetName}`);
|
|
380
394
|
}
|
|
381
395
|
}
|
|
@@ -822,6 +836,7 @@ var parseConfig = async (filePath, projectFolder) => {
|
|
|
822
836
|
"The current project config does not resolve to any functions, assets or routes and can not be deployed."
|
|
823
837
|
);
|
|
824
838
|
}
|
|
839
|
+
parseResult = await filterFunctionsFromAssets(parseResult);
|
|
825
840
|
return parseResult;
|
|
826
841
|
};
|
|
827
842
|
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/find-config.ts","../src/parse-config.ts","../src/build-output-v3/parse.ts","../src/build-output-v3/determine-repo-root.ts","../src/build-output-v3/get-default-path-map.ts","../src/build-output-v3/get-monorepo-files.ts","../src/build-output-v3/read-config-file.ts","../src/parse-raw-config.ts","../src/build-output-v3/translate-vercel-region.ts","../src/build-output-v3/translate-vercel-runtime.ts","../src/v4/parse.ts","../src/regions.ts","../src/v4/schema.json","../src/runtime.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nexport const ALLOWED_CONFIG_NAMES = ['gigadrive.yaml', 'gigadrive.yml', 'nebula.yaml', 'nebula.yml', 'nebula.json'];\n\n/**\n * Finds a config file in the project folder.\n * @param projectFolder The folder to search for a config file in.\n * @returns The path to the config file, or null if no config file is found.\n */\nexport const findConfig = (projectFolder: string): string | null => {\n for (const name of ALLOWED_CONFIG_NAMES) {\n const filePath = path.join(projectFolder, name);\n if (fs.existsSync(filePath)) {\n return filePath;\n }\n }\n return null;\n};\n","import Ajv from 'ajv';\nimport addFormats from 'ajv-formats';\nimport { parseVercelBuildOutputV3 } from './build-output-v3/parse';\nimport type { NormalizedConfig } from './normalized-config';\nimport { parseRawConfig } from './parse-raw-config';\nimport { parseConfigV4 } from './v4/parse';\nimport schemaV4 from './v4/schema.json';\n\nexport const parseConfig = async (filePath: string, projectFolder: string): Promise<NormalizedConfig> => {\n const parsed = await parseRawConfig(filePath);\n const version = parsed.version;\n\n const schemaMap: Record<number, object> = {\n /*1: schemaV1,\n 2: schemaV2,\n 3: schemaV3,*/\n 4: schemaV4,\n };\n\n // build the path to the config file relative to the project root (strip /tmp/unzipped prefix)\n const relativePath = filePath.replace('/tmp/unzipped/', '');\n\n const schema = schemaMap[version];\n\n if (!schema) {\n throw new Error(`Config file at ${relativePath} has an unsupported version: ${version}`);\n }\n\n // validate the config file\n const ajv = new Ajv();\n addFormats(ajv);\n\n const validate = ajv.compile(schema);\n\n const valid = validate(parsed);\n if (!valid) {\n throw new Error(`Config file at ${relativePath} is invalid: ${ajv.errorsText(validate.errors)}`);\n }\n\n // @ts-ignore\n const parserMap: Record<number, (config, projectFolder) => Promise<NormalizedConfig>> = {\n /*1: parseConfigV1,\n 2: parseConfigV2,\n 3: parseConfigV3,*/\n 4: parseConfigV4,\n };\n\n let parseResult: NormalizedConfig = await parserMap[version](parsed, projectFolder);\n\n // TODO: apply transformers\n parseResult = await parseVercelBuildOutputV3(parseResult, projectFolder);\n\n // if the config does not resolve to any resources, warn the user\n if (parseResult.entrypoints.length === 0 && (parseResult.assets?.paths?.length || 0) === 0) {\n parseResult.warnings.push('The current project does not have any functions or assets to deploy.');\n } else if (\n parseResult.entrypoints.length === 0 &&\n (parseResult.assets?.paths?.length || 0) === 0 &&\n parseResult.routes.length === 0\n ) {\n parseResult.errors.push(\n 'The current project config does not resolve to any functions, assets or routes and can not be deployed.'\n );\n }\n\n return parseResult;\n};\n","import { getFilesForPattern } from '@gigadrive/build-utils';\nimport { deepMerge } from '@gigadrive/commons';\nimport path from 'path';\nimport { type Config, type ServerlessFunctionConfig } from '.';\nimport type {\n NormalizedConfig,\n NormalizedConfigRoute,\n NormalizedConfigRouteHandler,\n NormalizedConfigRouteMethod,\n} from '../normalized-config';\nimport type { Region } from '../regions';\nimport { determineRepoRoot } from './determine-repo-root';\nimport { getDefaultPathMap } from './get-default-path-map';\nimport { getMonorepoFiles } from './get-monorepo-files';\nimport { readConfigFile } from './read-config-file';\nimport { translateVercelRegion } from './translate-vercel-region';\nimport { translateVercelRuntime } from './translate-vercel-runtime';\n\nconst configPath = '.vercel/output/config.json';\nconst functionsFolder = '.vercel/output/functions';\nconst functionConfigsPattern = `${functionsFolder}/**/*.func/.vc-config.json`;\n\n/**\n * Transforms a parsed config file using Vercel's Build Output API v3\n * @param parseResult The result of parsing the existing config file\n * @param projectFolder The path to the project folder\n * @returns\n */\nexport const parseVercelBuildOutputV3 = async (\n parseResult: NormalizedConfig,\n projectFolder: string\n): Promise<NormalizedConfig> => {\n // read config file\n const config = await readConfigFile<Config>(path.join(projectFolder, configPath));\n\n if (!config || config.version < 3) {\n // TODO: Log error\n return parseResult;\n }\n\n // TODO: Routes\n // TODO: Images\n // TODO: Wildcards\n // TODO: Cache\n // TODO: Cron\n // TODO: Edge Functions\n // TODO: Prerender Functions\n\n const functionData = await loadFunctions(config, parseResult, projectFolder);\n const assetOverrides = await loadAssetOverrides(config, parseResult);\n\n return deepMerge(parseResult, functionData, assetOverrides);\n};\n\nconst loadAssetOverrides = async (\n config: Config,\n parseResult: NormalizedConfig\n): Promise<Partial<NormalizedConfig>> => {\n return {\n assets: {\n overrides: {\n ...(parseResult.assets?.overrides ?? {}),\n ...config.overrides,\n },\n },\n };\n};\n\nexport const loadFunctions = async (\n config: Config,\n parseResult: NormalizedConfig,\n projectFolder: string\n): Promise<Partial<NormalizedConfig>> => {\n const functionConfigs = await getFilesForPattern(functionConfigsPattern, projectFolder);\n\n const result: Partial<NormalizedConfig> = {\n entrypoints: [],\n routes: [],\n regions: [],\n };\n\n for (const functionConfigPath of functionConfigs) {\n const functionConfig = await readConfigFile<ServerlessFunctionConfig>(path.join(projectFolder, functionConfigPath));\n\n if (!functionConfig) {\n parseResult.errors.push(`Failed to read function config at ${functionConfigPath}`);\n continue;\n }\n\n const functionPathRelative = path.dirname(functionConfigPath).replace(functionsFolder, '');\n const functionName = functionPathRelative.replace(/^\\/|\\.func$/g, '');\n const runtime = translateVercelRuntime(functionConfig.runtime);\n\n if (!runtime) {\n parseResult.errors.push(`Unsupported runtime for function ${functionName}: ${functionConfig.runtime}`);\n continue;\n }\n\n const functionDirectory = `.vercel/output/functions/${functionName}.func`;\n const {\n handler,\n maxDuration,\n memory,\n regions = [],\n environment,\n filePathMap: configFilePathMap = {},\n } = functionConfig;\n\n // Add regions or use default if empty\n const translatedRegions = regions.length > 0 ? regions.map(translateVercelRegion) : ['us-east-1'];\n\n // Filter duplicates\n result.regions = Array.from(new Set([...parseResult.regions, ...translatedRegions])) as Region[];\n\n // Process environment variables\n const environmentVariables: Record<string, string> = {};\n if (environment && typeof environment === 'object') {\n for (const env of Object.values(environment)) {\n Object.assign(environmentVariables, env);\n }\n }\n\n const streaming = runtime.startsWith('node-') || runtime.startsWith('bun-');\n\n // Process file path map\n let filePathMap: Record<string, string> = {};\n for (const [key, value] of Object.entries(configFilePathMap)) {\n filePathMap[path.join(projectFolder, key)] = value;\n }\n\n // Default file path map if none provided\n if (Object.keys(filePathMap).length === 0) {\n filePathMap = getDefaultPathMap(path.join(projectFolder, functionDirectory));\n }\n\n // Add entrypoint\n if (!result.entrypoints) {\n result.entrypoints = [];\n }\n\n result.entrypoints.push({\n displayName: functionName,\n runtime,\n path: path.join(functionDirectory, handler),\n memory: memory ?? 1024,\n maxDuration: maxDuration ?? 15,\n environmentVariables,\n streaming,\n package: {\n filePathMap,\n },\n });\n\n // Create routes\n const handlerType: NormalizedConfigRouteHandler = streaming\n ? 'SERVERLESS_FUNCTION_STREAMING'\n : 'SERVERLESS_FUNCTION';\n\n const defaultRoute: NormalizedConfigRoute = {\n path: `/${functionName}`,\n methods: ['ANY'],\n headers: {},\n destination: handler,\n handler: handlerType,\n };\n\n const configRoutes =\n config.routes\n ?.filter((r) => r.dest === `/${functionName}`)\n .map(\n (r) =>\n ({\n path: r.src ?? `/${functionName}`,\n methods: ['ANY'] as NormalizedConfigRouteMethod[],\n headers: {},\n destination: handler,\n handler: handlerType,\n }) as NormalizedConfigRoute\n ) ?? [];\n\n if (!result.routes) {\n result.routes = [];\n }\n\n result.routes.push(defaultRoute, ...configRoutes);\n }\n\n return {\n ...result,\n userArchive: {\n rootOverwrite: determineRepoRoot(projectFolder, result),\n fileWhitelist: [\n `${projectFolder}/*`,\n ...getMonorepoFiles(projectFolder, result.entrypoints?.map((e) => e.package?.filePathMap ?? {}) ?? []),\n ],\n },\n };\n};\n","import path from 'path';\nimport { NormalizedConfig } from '../normalized-config';\n\n/**\n * Determines the root of the repository based on the project folder and configuration.\n * Analyzes file paths in entrypoint packages to find the common root directory.\n *\n * @param projectFolder - The base folder path of the project\n * @param config - The normalized configuration that may contain entrypoints with file path maps\n * @returns The determined repository root path\n */\nexport const determineRepoRoot = (projectFolder: string, config: Partial<NormalizedConfig>): string => {\n // Default to project folder if no entrypoints or file paths\n if (!config.entrypoints?.length) {\n return projectFolder;\n }\n\n // Collect all file paths from entrypoints\n const filePaths: string[] = [];\n for (const entrypoint of config.entrypoints) {\n if (entrypoint.package?.filePathMap) {\n filePaths.push(...Object.keys(entrypoint.package.filePathMap));\n }\n }\n\n // If no file paths found, return project folder\n if (filePaths.length === 0) {\n return projectFolder;\n }\n\n // Get common path components\n const pathParts = filePaths.map((p) => p.split(path.sep));\n const firstPath = pathParts[0];\n\n let commonParts: string[] = [];\n for (let i = 0; i < firstPath.length; i++) {\n const part = firstPath[i];\n if (pathParts.every((parts) => parts[i] === part)) {\n commonParts.push(part);\n } else {\n break;\n }\n }\n\n // Join common parts to form the common root\n const commonRoot = commonParts.join(path.sep);\n\n // Only return common root if it's higher in the directory tree than the project folder\n // (i.e., project folder is a subdirectory of the common root)\n if (commonRoot && projectFolder.startsWith(commonRoot) && commonRoot !== projectFolder) {\n return commonRoot;\n }\n\n return projectFolder;\n};\n","import fs from 'fs';\nimport path from 'path';\n\n/**\n * Creates a mapping of absolute file paths to their relative paths\n * starting from the provided directory.\n *\n * This is the default path map that will be used for Vercel-based functions, when the function does not specify a filePathMap.\n *\n * @param directory - The absolute path of the directory to process\n * @returns A record where keys are absolute file paths and values are relative paths\n */\nexport const getDefaultPathMap = (directory: string): Record<string, string> => {\n const result: Record<string, string> = {};\n\n if (!fs.existsSync(directory)) {\n return result;\n }\n\n /**\n * Recursively processes a directory and adds file mappings to the result\n *\n * @param currentPath - The absolute path of the current directory being processed\n * @param basePath - The relative path accumulated during recursion\n */\n const processDirectory = (currentPath: string, basePath: string = '') => {\n const files = fs.readdirSync(currentPath, { withFileTypes: true });\n\n for (const file of files) {\n const fullPath = path.join(currentPath, file.name);\n const relativePath = path.join(basePath, file.name);\n\n if (file.isDirectory()) {\n processDirectory(fullPath, relativePath);\n } else {\n result[fullPath] = relativePath;\n }\n }\n };\n\n processDirectory(directory);\n return result;\n};\n","import { FilePathMap } from '../normalized-config';\n\n/**\n * Returns files that are not part of the project directory\n * @param directory Absolute path of a directory\n * @param filePathMaps Array of file path maps for functions\n * @returns Array of file paths that are not within the directory\n */\nexport function getMonorepoFiles(directory: string, filePathMaps: FilePathMap[]): string[] {\n const result: string[] = [];\n\n for (const filePathMap of filePathMaps ?? []) {\n if (!filePathMap) {\n continue;\n }\n\n for (const file of Object.keys(filePathMap)) {\n if (!file.startsWith(directory)) {\n result.push(file);\n }\n }\n }\n\n return result;\n}\n","import fs from 'fs';\nimport { parseRawConfig } from '../parse-raw-config';\n\n/**\n * Reads and parses a configuration file at the specified path.\n *\n * @param configFilePath - The path to the configuration file to read\n * @returns The parsed configuration object, or null if the file doesn't exist\n * @template T - The type of the configuration object\n */\nexport const readConfigFile = async <T>(configFilePath: string): Promise<T | null> => {\n if (!fs.existsSync(configFilePath)) {\n // skip vercel transformation if no vercel output exists\n return null;\n }\n\n const parsed = await parseRawConfig(configFilePath, { disableVersionCheck: true });\n\n return parsed as T;\n};\n","import fs from 'fs';\nimport path from 'path';\nimport { parse as parseYaml } from 'yaml';\n\nexport const parseRawConfig = async (\n filePath: string,\n { disableVersionCheck = false }: { disableVersionCheck?: boolean } = {}\n): Promise<any> => {\n // check if the file exists\n if (!fs.existsSync(filePath)) {\n throw new Error(`Config file not found at ${filePath}`);\n }\n\n // read the file\n const fileContents = fs.readFileSync(filePath, 'utf8');\n\n if (fileContents.length === 0) {\n throw new Error(`Config file is empty at ${filePath}`);\n }\n\n // determine file type based on extension\n const fileExtension = path.extname(filePath).toLowerCase();\n\n // parse the file based on its extension\n let parsed;\n try {\n if (fileExtension === '.json') {\n parsed = JSON.parse(fileContents);\n } else if (['.yml', '.yaml'].includes(fileExtension)) {\n parsed = parseYaml(fileContents);\n } else {\n // Try to parse as YAML by default, which is more forgiving\n parsed = parseYaml(fileContents);\n }\n } catch (error) {\n throw new Error(\n `Failed to parse config file at ${filePath}: ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n\n if (parsed === undefined) {\n throw new Error(`Config file could not be parsed at ${filePath}`);\n }\n\n // check if the version is present\n if (!disableVersionCheck && typeof parsed.version !== 'number') {\n throw new Error(`Config file is missing version at ${filePath}`);\n }\n\n return parsed;\n};\n","/**\n * Translates Vercel region codes to AWS region codes.\n *\n * Vercel uses three-letter codes (e.g., \"iad1\") to identify their regions,\n * while AWS uses longer region codes (e.g., \"us-east-1\").\n * This function maps the Vercel region code to its corresponding AWS region code.\n *\n * @param region - The Vercel region code to translate\n * @returns The corresponding AWS region code, defaults to 'us-east-1' if not found\n * @link https://vercel.com/docs/edge-network/regions#region-list\n */\nexport const translateVercelRegion = (region: string): string => {\n const regionMap: Record<string, string> = {\n arn1: 'eu-north-1',\n bom1: 'ap-south-1',\n cdg1: 'eu-west-3',\n cle1: 'us-east-2',\n cpt1: 'af-south-1',\n dub1: 'eu-west-1',\n fra1: 'eu-central-1',\n gru1: 'sa-east-1',\n hkg1: 'ap-east-1',\n hnd1: 'ap-northeast-1',\n iad1: 'us-east-1',\n icn1: 'ap-northeast-2',\n kix1: 'ap-northeast-3',\n lhr1: 'eu-west-2',\n pdx1: 'us-west-2',\n sfo1: 'us-west-1',\n sin1: 'ap-southeast-1',\n syd1: 'ap-southeast-2',\n };\n\n return regionMap[region.toLowerCase()] ?? 'us-east-1';\n};\n","import { Runtime } from '../runtime';\n\n/**\n * Translates Vercel runtime strings to our standardized Runtime format\n *\n * @param runtime - The Vercel runtime identifier (e.g. 'nodejs18.x')\n * @returns The corresponding Runtime value or null if no match is found\n */\nexport const translateVercelRuntime = (runtime: string): Runtime | null => {\n switch (runtime) {\n case 'nodejs12.x':\n case 'nodejs14.x':\n case 'nodejs16.x':\n case 'nodejs18.x':\n return 'node-18';\n case 'nodejs20.x':\n case 'nodejs22.x': // TODO: Update when Lambda supports Node.js 22\n return 'node-20';\n default:\n return null;\n }\n};\n","import { getFilesForPattern } from '@gigadrive/build-utils';\nimport fs from 'fs';\nimport { minimatch } from 'minimatch';\nimport type { ConfigV4, ConfigV4FunctionSettings } from '.';\nimport type {\n NormalizedConfig,\n NormalizedConfigEntrypoint,\n NormalizedConfigRoute,\n NormalizedConfigRouteHandler,\n} from '../normalized-config';\nimport { AVAILABLE_REGIONS, type Region } from '../regions';\n\nexport const parseConfigV4 = async (config: ConfigV4, projectFolder: string): Promise<NormalizedConfig> => {\n const regions =\n config.regions?.includes('global') === true\n ? AVAILABLE_REGIONS\n : (config.regions?.filter((region) => region !== 'global') ?? ['global']);\n\n const populateAssetCache = config.populateAssetCache ?? false;\n const environmentVariables = config.env ?? {};\n const commands = config.build_commands ?? [];\n const entrypoints: NormalizedConfigEntrypoint[] = [];\n const errors: string[] = [];\n const warnings: string[] = [];\n\n if (config.functions != null) {\n for (const [path, func] of Object.entries(config.functions)) {\n const settings = getFunctionSettings(path, config);\n\n if (settings == null) {\n throw new Error(`Settings invalid for function at path '${path}'`);\n }\n\n (await getFilesForPattern(path, projectFolder, func.excludeFiles)).forEach((file) => {\n // check if file is already in entrypoints, or if the path has a definition other than this one that matches it exactly\n if (entrypoints.find((entrypoint) => entrypoint.path === file)) {\n return;\n }\n\n if (config.functions != null && Object.keys(config.functions).find((func) => func === file && func !== path)) {\n return;\n }\n\n entrypoints.push({\n path: file,\n runtime: settings.runtime ?? 'node-20',\n memory: settings.memory ?? 128,\n maxDuration: settings.max_duration ?? 30,\n schedule: func.schedule,\n symlinks: func.symlinks,\n streaming:\n settings.runtime == null || settings.runtime.startsWith('node-') || settings.runtime.startsWith('bun-'),\n });\n });\n }\n }\n\n const assets: string[] = [];\n\n if (config.assets != null) {\n // list all files in assets folder recursively\n\n const assetsPath = `${projectFolder}/${config.assets}`;\n\n if (fs.existsSync(assetsPath) && fs.statSync(assetsPath).isDirectory()) {\n // console.debug('---- ASSET DEBUG ----');\n // console.debug('projectFolder', fs.readdirSync(assetsPath, { recursive: true }));\n\n // find all files in assets folder using fs\n for (const asset of fs.readdirSync(`${projectFolder}/${config.assets}`, {\n recursive: true,\n })) {\n // if file is a directory, skip it\n if (fs.statSync(`${projectFolder}/${config.assets}/${asset}`).isDirectory()) {\n continue;\n }\n\n const disallowedExtensions = ['.htaccess', '.htpasswd'];\n\n const assetName = asset.toString();\n\n if (disallowedExtensions.some((ext) => assetName.toLowerCase().endsWith(ext.toLowerCase()))) {\n continue;\n }\n\n assets.push(`${config.assets}/${assetName}`);\n }\n }\n }\n\n const routes = config.routes ?? [];\n\n return {\n regions: regions as Region[],\n assets: {\n paths: assets.sort(),\n prefixToStrip: (config.assets ?? '') + '/',\n dynamicRoutes: true,\n populateCache: populateAssetCache,\n },\n environmentVariables,\n commands,\n entrypoints,\n errors,\n warnings,\n routes: routes.map((route) => {\n // check if the destination has a protocol, if so use REDIRECT handler\n const handler: NormalizedConfigRouteHandler =\n route.destination.toLowerCase().startsWith('http://') || route.destination.toLowerCase().startsWith('https://')\n ? route.redirect === true\n ? 'HTTP_REDIRECT'\n : 'HTTP_PROXY'\n : route.redirect === true\n ? 'HTTP_REDIRECT'\n : 'SERVERLESS_FUNCTION';\n\n return {\n path: route.source,\n destination: route.destination,\n handler,\n headers: route.headers ?? {},\n methods: route.methods ?? ['ANY'],\n positiveRequirements: route.has,\n negativeRequirements: route.missing,\n status: route.statusCode,\n } as NormalizedConfigRoute;\n }),\n };\n};\n\n/**\n * Gets the runtime, memory and max duration for a given path.\n * @param path\n * @param config\n * @returns The runtime, memory and max duration for the given path. Should return undefined when a path should not be deployed as a function.\n */\nexport const getFunctionSettings = (path: string, config: ConfigV4): ConfigV4FunctionSettings | undefined => {\n // functions don't have to state all their options.\n // some function definitions might be glob or regex patterns.\n // go through all function definitions, find those that match the path and merge them.\n\n let functionSettings: ConfigV4FunctionSettings | undefined;\n\n for (const [key, value] of Object.entries(config.functions ?? {})) {\n // make sure to check for both glob and regex patterns\n if (minimatch(path, key) || new RegExp(key).test(path)) {\n if (functionSettings == null) {\n functionSettings = {\n memory: 128,\n max_duration: 30,\n schedule: undefined,\n symlinks: undefined,\n excludeFiles: undefined,\n includeFiles: undefined,\n };\n }\n\n if (value.runtime != null) {\n functionSettings.runtime = value.runtime;\n }\n\n if (value.memory != null) {\n functionSettings.memory = value.memory;\n }\n\n if (value.max_duration != null) {\n functionSettings.max_duration = value.max_duration;\n }\n\n if (value.schedule != null) {\n functionSettings.schedule = value.schedule;\n }\n\n if (value.symlinks != null) {\n functionSettings.symlinks = value.symlinks;\n }\n\n if (value.excludeFiles != null) {\n functionSettings.excludeFiles = value.excludeFiles;\n }\n\n if (value.includeFiles != null) {\n functionSettings.includeFiles = value.includeFiles;\n }\n }\n }\n\n return functionSettings;\n};\n","// Define all available runtimes in a single array\nconst REGION_DEFINITIONS = [\n 'us-east-1',\n 'us-east-2',\n 'us-west-1',\n 'us-west-2',\n 'ap-south-1',\n 'ap-northeast-3',\n 'ap-northeast-2',\n 'ap-southeast-1',\n 'ap-southeast-2',\n 'ap-northeast-1',\n 'ca-central-1',\n 'eu-central-1',\n 'eu-west-1',\n 'eu-west-2',\n 'eu-west-3',\n 'eu-north-1',\n 'sa-east-1',\n] as const;\n\n// Generate the Runtime type from the array\nexport type Region = (typeof REGION_DEFINITIONS)[number];\n\n// Export the available runtimes\nexport const AVAILABLE_REGIONS: Region[] = [...REGION_DEFINITIONS];\n","{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"Config V4\",\n \"description\": \"Configuration schema for version 4\",\n \"type\": \"object\",\n \"required\": [\"version\"],\n \"properties\": {\n \"version\": {\n \"type\": \"integer\",\n \"enum\": [4],\n \"description\": \"The version of the configuration file\"\n },\n \"presets\": {\n \"type\": [\"array\", \"null\"],\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uri\"\n },\n \"description\": \"A list of presets to apply to the project. Each preset will be applied in order.\"\n },\n \"assets\": {\n \"type\": [\"string\", \"null\"],\n \"description\": \"The folder which holds the assets to be deployed to the edge. Defaults to none.\"\n },\n \"populateAssetCache\": {\n \"type\": [\"boolean\", \"null\"],\n \"description\": \"If true, the assets will be cached at the edge during deployment. This may increase the deployment time, depending on the size of the assets. Defaults to false.\"\n },\n \"regions\": {\n \"type\": [\"array\", \"null\"],\n \"description\": \"The regions to which the project will be deployed. Use \\\"global\\\" to deploy to all regions. More regions will incur higher costs.\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"build_commands\": {\n \"type\": [\"array\", \"null\"],\n \"description\": \"The commands to run to build the project. For example, `bun install` or `npm install`.\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"functions\": {\n \"type\": [\"object\", \"null\"],\n \"description\": \"The serverless functions to deploy.\",\n \"additionalProperties\": {\n \"type\": \"object\",\n \"properties\": {\n \"memory\": {\n \"type\": \"number\",\n \"description\": \"The memory in MB to allocate to the function. Defaults to 128.\",\n \"maximum\": 3009,\n \"minimum\": 128\n },\n \"max_duration\": {\n \"type\": \"number\",\n \"description\": \"The max duration in seconds for the function after which it will be terminated. Defaults to 30.\",\n \"maximum\": 900,\n \"minimum\": 1\n },\n \"runtime\": {\n \"$ref\": \"#/$defs/runtimes\",\n \"description\": \"The runtime to use for the function.\"\n },\n \"schedule\": {\n \"type\": \"string\",\n \"description\": \"An expression to schedule the function to run at specific times.\",\n \"pattern\": \"^(?:rate[(](?:(?:1[ ]+(hour|minute|day))|(?:[0-9]+[ ]+(hours|minutes|days)))[)])|(?:cron[(](?:(?:(?:[0-5]?[0-9])|[*])(?:(?:[-](?:(?:[0-5]?[0-9])|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[0-5]?[0-9])|[*])(?:(?:[-](?:(?:[0-5]?[0-9])|[*]))|(?:[/][0-9]+))?)*)[ ]+(?:(?:(?:[0-2]?[0-9])|[*])(?:(?:[-](?:(?:[0-2]?[0-9])|[*]))|(?:[/][0-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OCT|NOV|DEC)|[*])(?:(?:[-](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:[/][0-9]+)?)|(?:[/][0-9]+))?(?:[,](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:(?:[-](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:[/][0-9]+)?)|(?:[/][0-9]+))?)*)[ ]+[?]))[ ]+(?:(?:(?:[12][0-9]{3})|[*])(?:(?:[-](?:(?:[12][0-9]{3})|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[12][0-9]{3})|[*])(?:(?:[-](?:(?:[12][0-9]{3})|[*]))|(?:[/][0-9]+))?)*)[)])$\"\n },\n \"symlinks\": {\n \"type\": \"object\",\n \"description\": \"A list of symbolic links to create in the function's package.\",\n \"maxProperties\": 100,\n \"minProperties\": 1,\n \"patternProperties\": {\n \"^.{1,256}$\": {\n \"type\": \"string\",\n \"maxLength\": 256\n }\n },\n \"additionalProperties\": false\n },\n \"excludeFiles\": {\n \"oneOf\": [{ \"type\": \"string\" }, { \"type\": \"array\", \"items\": { \"type\": \"string\" } }],\n \"description\": \"A glob pattern to match files that should be excluded from your Serverless Function. If you're using a Community Runtime, the behavior might vary.\"\n },\n \"includeFiles\": {\n \"oneOf\": [{ \"type\": \"string\" }, { \"type\": \"array\", \"items\": { \"type\": \"string\" } }],\n \"description\": \"A glob pattern to match files that should be included in your Serverless Function. If you're using a Community Runtime, the behavior might vary.\"\n }\n }\n }\n },\n \"env\": {\n \"type\": \"object\",\n \"maxProperties\": 100,\n \"minProperties\": 0,\n \"patternProperties\": {\n \".+\": {\n \"maxLength\": 65536,\n \"minLength\": 0,\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false,\n \"description\": \"Additional environment variables to set during runtime and build.\"\n },\n \"routes\": {\n \"type\": [\"array\", \"null\"],\n \"description\": \"A list of route definitions.\",\n \"maxItems\": 1024,\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"source\", \"destination\"],\n \"properties\": {\n \"source\": {\n \"description\": \"A pattern that matches each incoming pathname (excluding querystring).\",\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"destination\": {\n \"description\": \"An absolute pathname to an existing resource or an external URL.\",\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"has\": {\n \"$ref\": \"#/$defs/matchRequirements\"\n },\n \"missing\": {\n \"$ref\": \"#/$defs/matchRequirements\"\n },\n \"statusCode\": {\n \"description\": \"An optional integer to override the status code of the response.\",\n \"type\": \"integer\",\n \"minimum\": 100,\n \"maximum\": 999\n },\n \"redirect\": {\n \"type\": \"boolean\",\n \"description\": \"An optional boolean to force a redirect response.\"\n },\n \"methods\": {\n \"type\": \"array\",\n \"description\": \"The HTTP methods to match for the route. Defaults to all methods.\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\"ANY\", \"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\", \"HEAD\", \"OPTIONS\"]\n }\n },\n \"headers\": {\n \"type\": \"object\",\n \"description\": \"Additional headers to add to the response.\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"services\": {\n \"type\": \"object\",\n \"description\": \"Optionally, specify additional services like databases to deploy.\",\n \"properties\": {\n \"redis\": {\n \"oneOf\": [\n {\n \"type\": \"null\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"envBindings\": {\n \"type\": \"object\",\n \"description\": \"Optionally, specify what environment variables the credentials will be bound to. For example: `{ url: 'REDIS_URL' }` will bind the `url` environment variable to the Redis URL. If you don't specify any bindings, they will be bound to the REDIS_URL, REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_DB, and REDIS_SSL environment variables.\",\n \"additionalProperties\": false,\n \"properties\": {\n \"url\": { \"type\": \"string\" },\n \"host\": { \"type\": \"string\" },\n \"port\": { \"type\": \"string\" },\n \"password\": { \"type\": \"string\" },\n \"db\": { \"type\": \"string\" },\n \"ssl\": { \"type\": \"string\" }\n }\n },\n \"primaryRegion\": {\n \"type\": \"string\",\n \"description\": \"The primary region to deploy the Redis instance to.\",\n \"enum\": [\n \"us-east-1\",\n \"us-east-2\",\n \"us-west-1\",\n \"us-west-2\",\n \"eu-central-1\",\n \"eu-west-1\",\n \"eu-west-2\",\n \"sa-east-1\",\n \"ap-south-1\",\n \"ap-northeast-1\",\n \"ap-southeast-1\",\n \"ap-southeast-2\",\n \"us-central1\"\n ]\n },\n \"readRegions\": {\n \"type\": \"array\",\n \"description\": \"Optionally, add additional regions to read from. More regions will incur higher costs.\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"us-east-1\",\n \"us-east-2\",\n \"us-west-1\",\n \"us-west-2\",\n \"eu-central-1\",\n \"eu-west-1\",\n \"eu-west-2\",\n \"sa-east-1\",\n \"ap-south-1\",\n \"ap-northeast-1\",\n \"ap-southeast-1\",\n \"ap-southeast-2\"\n ]\n }\n },\n \"eviction\": {\n \"type\": \"boolean\",\n \"description\": \"Optionally, enable Redis eviction. This will evict the least recently used keys in order to make space for new ones.\"\n }\n }\n }\n ]\n },\n \"postgres\": {\n \"oneOf\": [\n {\n \"type\": \"null\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"envBindings\": {\n \"type\": \"object\",\n \"description\": \"Optionally, specify what environment variables the credentials will be bound to. For example: `{ url: 'POSTGRES_URL' }` will bind the `url` environment variable to the Postgres URL. If you don't specify any bindings, they will be bound to the POSTGRES_URL, POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DATABASE environment variables.\",\n \"additionalProperties\": false,\n \"properties\": {\n \"url\": { \"type\": \"string\" },\n \"host\": { \"type\": \"string\" },\n \"port\": { \"type\": \"string\" },\n \"user\": { \"type\": \"string\" },\n \"password\": { \"type\": \"string\" },\n \"database\": { \"type\": \"string\" }\n }\n },\n \"postgresVersion\": {\n \"type\": \"string\",\n \"description\": \"The version of Postgres to deploy.\",\n \"enum\": [\"17\", \"16\", \"15\", \"14\"]\n },\n \"region\": {\n \"type\": \"string\",\n \"description\": \"The region to deploy the Postgres instance to.\",\n \"enum\": [\n \"us-east-1\",\n \"us-east-2\",\n \"us-west-2\",\n \"ap-southeast-1\",\n \"ap-southeast-2\",\n \"eu-central-1\",\n \"eu-west-2\",\n \"sa-east-1\"\n ]\n }\n }\n }\n ]\n }\n }\n }\n },\n \"$defs\": {\n \"runtimes\": {\n \"type\": \"string\",\n \"enum\": [\"php-83\", \"php-82\", \"php-81\", \"php-80\", \"node-20\", \"node-18\", \"node-16\", \"bun-1\"]\n },\n \"matchRequirements\": {\n \"description\": \"An array of requirements that are needed to match\",\n \"type\": \"array\",\n \"maxItems\": 16,\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"type\", \"value\"],\n \"properties\": {\n \"type\": {\n \"description\": \"The type of request element to check\",\n \"type\": \"string\",\n \"enum\": [\"host\"]\n },\n \"value\": {\n \"description\": \"A regular expression used to match the value. Named groups can be used in the destination\",\n \"type\": \"string\",\n \"maxLength\": 4096\n }\n }\n },\n {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"type\", \"key\"],\n \"properties\": {\n \"type\": {\n \"description\": \"The type of request element to check\",\n \"type\": \"string\",\n \"enum\": [\"header\", \"cookie\", \"query\"]\n },\n \"key\": {\n \"description\": \"The name of the element contained in the particular type\",\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"value\": {\n \"description\": \"A regular expression used to match the value. Named groups can be used in the destination\",\n \"type\": \"string\",\n \"maxLength\": 4096\n }\n }\n }\n ]\n }\n }\n }\n}\n","// Define all available runtimes in a single array\nconst RUNTIME_DEFINITIONS = [\n 'php-84',\n 'php-83',\n 'php-81',\n 'node-22',\n 'node-20',\n 'node-18',\n 'node-16',\n 'bun-1',\n] as const;\n\n// Generate the Runtime type from the array\nexport type Runtime = (typeof RUNTIME_DEFINITIONS)[number];\n\n// Export the available runtimes\nexport const AVAILABLE_RUNTIMES: Runtime[] = [...RUNTIME_DEFINITIONS];\n"],"mappings":";AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAEV,IAAM,uBAAuB,CAAC,kBAAkB,iBAAiB,eAAe,cAAc,aAAa;AAO3G,IAAM,aAAa,CAAC,kBAAyC;AAClE,aAAW,QAAQ,sBAAsB;AACvC,UAAM,WAAW,KAAK,KAAK,eAAe,IAAI;AAC9C,QAAI,GAAG,WAAW,QAAQ,GAAG;AAC3B,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;;;AClBA,OAAO,SAAS;AAChB,OAAO,gBAAgB;;;ACDvB,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAC1B,OAAOA,WAAU;;;ACFjB,OAAOC,WAAU;AAWV,IAAM,oBAAoB,CAAC,eAAuB,WAA8C;AAErG,MAAI,CAAC,OAAO,aAAa,QAAQ;AAC/B,WAAO;AAAA,EACT;AAGA,QAAM,YAAsB,CAAC;AAC7B,aAAW,cAAc,OAAO,aAAa;AAC3C,QAAI,WAAW,SAAS,aAAa;AACnC,gBAAU,KAAK,GAAG,OAAO,KAAK,WAAW,QAAQ,WAAW,CAAC;AAAA,IAC/D;AAAA,EACF;AAGA,MAAI,UAAU,WAAW,GAAG;AAC1B,WAAO;AAAA,EACT;AAGA,QAAM,YAAY,UAAU,IAAI,CAAC,MAAM,EAAE,MAAMA,MAAK,GAAG,CAAC;AACxD,QAAM,YAAY,UAAU,CAAC;AAE7B,MAAI,cAAwB,CAAC;AAC7B,WAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACzC,UAAM,OAAO,UAAU,CAAC;AACxB,QAAI,UAAU,MAAM,CAAC,UAAU,MAAM,CAAC,MAAM,IAAI,GAAG;AACjD,kBAAY,KAAK,IAAI;AAAA,IACvB,OAAO;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1
|
+
{"version":3,"sources":["../src/find-config.ts","../src/parse-config.ts","../src/build-output-v3/parse.ts","../src/build-output-v3/determine-repo-root.ts","../src/build-output-v3/get-default-path-map.ts","../src/build-output-v3/get-monorepo-files.ts","../src/build-output-v3/read-config-file.ts","../src/parse-raw-config.ts","../src/build-output-v3/translate-vercel-region.ts","../src/build-output-v3/translate-vercel-runtime.ts","../src/filter-functions-from-assets.ts","../src/v4/parse.ts","../src/regions.ts","../src/v4/schema.json","../src/runtime.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nexport const ALLOWED_CONFIG_NAMES = ['gigadrive.yaml', 'gigadrive.yml', 'nebula.yaml', 'nebula.yml', 'nebula.json'];\n\n/**\n * Finds a config file in the project folder.\n * @param projectFolder The folder to search for a config file in.\n * @returns The path to the config file, or null if no config file is found.\n */\nexport const findConfig = (projectFolder: string): string | null => {\n for (const name of ALLOWED_CONFIG_NAMES) {\n const filePath = path.join(projectFolder, name);\n if (fs.existsSync(filePath)) {\n return filePath;\n }\n }\n return null;\n};\n","import Ajv from 'ajv';\nimport addFormats from 'ajv-formats';\nimport { parseVercelBuildOutputV3 } from './build-output-v3/parse';\nimport { filterFunctionsFromAssets } from './filter-functions-from-assets';\nimport type { NormalizedConfig } from './normalized-config';\nimport { parseRawConfig } from './parse-raw-config';\nimport { parseConfigV4 } from './v4/parse';\nimport schemaV4 from './v4/schema.json';\n\nexport const parseConfig = async (filePath: string, projectFolder: string): Promise<NormalizedConfig> => {\n const parsed = await parseRawConfig(filePath);\n const version = parsed.version;\n\n const schemaMap: Record<number, object> = {\n /*1: schemaV1,\n 2: schemaV2,\n 3: schemaV3,*/\n 4: schemaV4,\n };\n\n // build the path to the config file relative to the project root (strip /tmp/unzipped prefix)\n const relativePath = filePath.replace('/tmp/unzipped/', '');\n\n const schema = schemaMap[version];\n\n if (!schema) {\n throw new Error(`Config file at ${relativePath} has an unsupported version: ${version}`);\n }\n\n // validate the config file\n const ajv = new Ajv();\n addFormats(ajv);\n\n const validate = ajv.compile(schema);\n\n const valid = validate(parsed);\n if (!valid) {\n throw new Error(`Config file at ${relativePath} is invalid: ${ajv.errorsText(validate.errors)}`);\n }\n\n // @ts-ignore\n const parserMap: Record<number, (config, projectFolder) => Promise<NormalizedConfig>> = {\n /*1: parseConfigV1,\n 2: parseConfigV2,\n 3: parseConfigV3,*/\n 4: parseConfigV4,\n };\n\n let parseResult: NormalizedConfig = await parserMap[version](parsed, projectFolder);\n\n // TODO: apply transformers\n parseResult = await parseVercelBuildOutputV3(parseResult, projectFolder);\n\n // if the config does not resolve to any resources, warn the user\n if (parseResult.entrypoints.length === 0 && (parseResult.assets?.paths?.length || 0) === 0) {\n parseResult.warnings.push('The current project does not have any functions or assets to deploy.');\n } else if (\n parseResult.entrypoints.length === 0 &&\n (parseResult.assets?.paths?.length || 0) === 0 &&\n parseResult.routes.length === 0\n ) {\n parseResult.errors.push(\n 'The current project config does not resolve to any functions, assets or routes and can not be deployed.'\n );\n }\n\n parseResult = await filterFunctionsFromAssets(parseResult);\n\n return parseResult;\n};\n","import { getFilesForPattern } from '@gigadrive/build-utils';\nimport { deepMerge } from '@gigadrive/commons';\nimport path from 'path';\nimport { type Config, type ServerlessFunctionConfig } from '.';\nimport type {\n NormalizedConfig,\n NormalizedConfigRoute,\n NormalizedConfigRouteHandler,\n NormalizedConfigRouteMethod,\n} from '../normalized-config';\nimport type { Region } from '../regions';\nimport { determineRepoRoot } from './determine-repo-root';\nimport { getDefaultPathMap } from './get-default-path-map';\nimport { getMonorepoFiles } from './get-monorepo-files';\nimport { readConfigFile } from './read-config-file';\nimport { translateVercelRegion } from './translate-vercel-region';\nimport { translateVercelRuntime } from './translate-vercel-runtime';\n\nconst configPath = '.vercel/output/config.json';\nconst functionsFolder = '.vercel/output/functions';\nconst functionConfigsPattern = `${functionsFolder}/**/*.func/.vc-config.json`;\n\n/**\n * Transforms a parsed config file using Vercel's Build Output API v3\n * @param parseResult The result of parsing the existing config file\n * @param projectFolder The path to the project folder\n * @returns\n */\nexport const parseVercelBuildOutputV3 = async (\n parseResult: NormalizedConfig,\n projectFolder: string\n): Promise<NormalizedConfig> => {\n // read config file\n const config = await readConfigFile<Config>(path.join(projectFolder, configPath));\n\n if (!config || config.version < 3) {\n // TODO: Log error\n return parseResult;\n }\n\n // TODO: Routes\n // TODO: Images\n // TODO: Wildcards\n // TODO: Cache\n // TODO: Cron\n // TODO: Edge Functions\n // TODO: Prerender Functions\n\n const functionData = await loadFunctions(config, parseResult, projectFolder);\n const assetOverrides = await loadAssetOverrides(config, parseResult);\n\n return deepMerge(parseResult, functionData, assetOverrides);\n};\n\nconst loadAssetOverrides = async (\n config: Config,\n parseResult: NormalizedConfig\n): Promise<Partial<NormalizedConfig>> => {\n return {\n assets: {\n overrides: {\n ...(parseResult.assets?.overrides ?? {}),\n ...config.overrides,\n },\n },\n };\n};\n\nexport const loadFunctions = async (\n config: Config,\n parseResult: NormalizedConfig,\n projectFolder: string\n): Promise<Partial<NormalizedConfig>> => {\n const functionConfigs = await getFilesForPattern(functionConfigsPattern, projectFolder);\n\n const result: Partial<NormalizedConfig> = {\n entrypoints: [],\n routes: [],\n regions: [],\n };\n\n for (const functionConfigPath of functionConfigs) {\n const functionConfig = await readConfigFile<ServerlessFunctionConfig>(path.join(projectFolder, functionConfigPath));\n\n if (!functionConfig) {\n parseResult.errors.push(`Failed to read function config at ${functionConfigPath}`);\n continue;\n }\n\n const functionPathRelative = path.dirname(functionConfigPath).replace(functionsFolder, '');\n const functionName = functionPathRelative.replace(/^\\/|\\.func$/g, '');\n const runtime = translateVercelRuntime(functionConfig.runtime);\n\n if (!runtime) {\n parseResult.errors.push(`Unsupported runtime for function ${functionName}: ${functionConfig.runtime}`);\n continue;\n }\n\n const functionDirectory = `.vercel/output/functions/${functionName}.func`;\n const {\n handler,\n maxDuration,\n memory,\n regions = [],\n environment,\n filePathMap: configFilePathMap = {},\n } = functionConfig;\n\n // Add regions or use default if empty\n const translatedRegions = regions.length > 0 ? regions.map(translateVercelRegion) : ['us-east-1'];\n\n // Filter duplicates\n result.regions = Array.from(new Set([...parseResult.regions, ...translatedRegions])) as Region[];\n\n // Process environment variables\n const environmentVariables: Record<string, string> = {};\n if (environment && typeof environment === 'object') {\n for (const env of Object.values(environment)) {\n Object.assign(environmentVariables, env);\n }\n }\n\n const streaming = runtime.startsWith('node-') || runtime.startsWith('bun-');\n\n // Process file path map\n let filePathMap: Record<string, string> = {};\n for (const [key, value] of Object.entries(configFilePathMap)) {\n filePathMap[path.join(projectFolder, key)] = value;\n }\n\n // Default file path map if none provided\n if (Object.keys(filePathMap).length === 0) {\n filePathMap = getDefaultPathMap(path.join(projectFolder, functionDirectory));\n }\n\n // Add entrypoint\n if (!result.entrypoints) {\n result.entrypoints = [];\n }\n\n result.entrypoints.push({\n displayName: functionName,\n runtime,\n path: path.join(functionDirectory, handler),\n memory: memory ?? 1024,\n maxDuration: maxDuration ?? 15,\n environmentVariables,\n streaming,\n package: {\n filePathMap,\n },\n });\n\n // Create routes\n const handlerType: NormalizedConfigRouteHandler = streaming\n ? 'SERVERLESS_FUNCTION_STREAMING'\n : 'SERVERLESS_FUNCTION';\n\n const defaultRoute: NormalizedConfigRoute = {\n path: `/${functionName}`,\n methods: ['ANY'],\n headers: {},\n destination: handler,\n handler: handlerType,\n };\n\n const configRoutes =\n config.routes\n ?.filter((r) => r.dest === `/${functionName}`)\n .map(\n (r) =>\n ({\n path: r.src ?? `/${functionName}`,\n methods: ['ANY'] as NormalizedConfigRouteMethod[],\n headers: {},\n destination: handler,\n handler: handlerType,\n }) as NormalizedConfigRoute\n ) ?? [];\n\n if (!result.routes) {\n result.routes = [];\n }\n\n result.routes.push(defaultRoute, ...configRoutes);\n }\n\n return {\n ...result,\n userArchive: {\n rootOverwrite: determineRepoRoot(projectFolder, result),\n fileWhitelist: [\n `${projectFolder}/*`,\n ...getMonorepoFiles(projectFolder, result.entrypoints?.map((e) => e.package?.filePathMap ?? {}) ?? []),\n ],\n },\n };\n};\n","import path from 'path';\nimport { NormalizedConfig } from '../normalized-config';\n\n/**\n * Determines the root of the repository based on the project folder and configuration.\n * Analyzes file paths in entrypoint packages to find the common root directory.\n *\n * @param projectFolder - The base folder path of the project\n * @param config - The normalized configuration that may contain entrypoints with file path maps\n * @returns The determined repository root path\n */\nexport const determineRepoRoot = (projectFolder: string, config: Partial<NormalizedConfig>): string => {\n // Default to project folder if no entrypoints or file paths\n if (!config.entrypoints?.length) {\n return projectFolder;\n }\n\n // Collect all file paths from entrypoints\n const filePaths: string[] = [];\n for (const entrypoint of config.entrypoints) {\n if (entrypoint.package?.filePathMap) {\n filePaths.push(...Object.keys(entrypoint.package.filePathMap));\n }\n }\n\n // If no file paths found, return project folder\n if (filePaths.length === 0) {\n return projectFolder;\n }\n\n // Get common path components\n const pathParts = filePaths.map((p) => p.split(path.sep));\n const firstPath = pathParts[0];\n\n let commonParts: string[] = [];\n for (let i = 0; i < firstPath.length; i++) {\n const part = firstPath[i];\n if (pathParts.every((parts) => parts[i] === part)) {\n commonParts.push(part);\n } else {\n break;\n }\n }\n\n // Join common parts to form the common root\n const commonRoot = commonParts.join(path.sep);\n\n // Only return common root if it's higher in the directory tree than the project folder\n // (i.e., project folder is a subdirectory of the common root)\n if (commonRoot && projectFolder.startsWith(commonRoot) && commonRoot !== projectFolder) {\n return commonRoot;\n }\n\n return projectFolder;\n};\n","import fs from 'fs';\nimport path from 'path';\n\n/**\n * Creates a mapping of absolute file paths to their relative paths\n * starting from the provided directory.\n *\n * This is the default path map that will be used for Vercel-based functions, when the function does not specify a filePathMap.\n *\n * @param directory - The absolute path of the directory to process\n * @returns A record where keys are absolute file paths and values are relative paths\n */\nexport const getDefaultPathMap = (directory: string): Record<string, string> => {\n const result: Record<string, string> = {};\n\n if (!fs.existsSync(directory)) {\n return result;\n }\n\n /**\n * Recursively processes a directory and adds file mappings to the result\n *\n * @param currentPath - The absolute path of the current directory being processed\n * @param basePath - The relative path accumulated during recursion\n */\n const processDirectory = (currentPath: string, basePath: string = '') => {\n const files = fs.readdirSync(currentPath, { withFileTypes: true });\n\n for (const file of files) {\n const fullPath = path.join(currentPath, file.name);\n const relativePath = path.join(basePath, file.name);\n\n if (file.isDirectory()) {\n processDirectory(fullPath, relativePath);\n } else {\n result[fullPath] = relativePath;\n }\n }\n };\n\n processDirectory(directory);\n return result;\n};\n","import { FilePathMap } from '../normalized-config';\n\n/**\n * Returns files that are not part of the project directory\n * @param directory Absolute path of a directory\n * @param filePathMaps Array of file path maps for functions\n * @returns Array of file paths that are not within the directory\n */\nexport function getMonorepoFiles(directory: string, filePathMaps: FilePathMap[]): string[] {\n const result: string[] = [];\n\n for (const filePathMap of filePathMaps ?? []) {\n if (!filePathMap) {\n continue;\n }\n\n for (const file of Object.keys(filePathMap)) {\n if (!file.startsWith(directory)) {\n result.push(file);\n }\n }\n }\n\n return result;\n}\n","import fs from 'fs';\nimport { parseRawConfig } from '../parse-raw-config';\n\n/**\n * Reads and parses a configuration file at the specified path.\n *\n * @param configFilePath - The path to the configuration file to read\n * @returns The parsed configuration object, or null if the file doesn't exist\n * @template T - The type of the configuration object\n */\nexport const readConfigFile = async <T>(configFilePath: string): Promise<T | null> => {\n if (!fs.existsSync(configFilePath)) {\n // skip vercel transformation if no vercel output exists\n return null;\n }\n\n const parsed = await parseRawConfig(configFilePath, { disableVersionCheck: true });\n\n return parsed as T;\n};\n","import fs from 'fs';\nimport path from 'path';\nimport { parse as parseYaml } from 'yaml';\n\nexport const parseRawConfig = async (\n filePath: string,\n { disableVersionCheck = false }: { disableVersionCheck?: boolean } = {}\n): Promise<any> => {\n // check if the file exists\n if (!fs.existsSync(filePath)) {\n throw new Error(`Config file not found at ${filePath}`);\n }\n\n // read the file\n const fileContents = fs.readFileSync(filePath, 'utf8');\n\n if (fileContents.length === 0) {\n throw new Error(`Config file is empty at ${filePath}`);\n }\n\n // determine file type based on extension\n const fileExtension = path.extname(filePath).toLowerCase();\n\n // parse the file based on its extension\n let parsed;\n try {\n if (fileExtension === '.json') {\n parsed = JSON.parse(fileContents);\n } else if (['.yml', '.yaml'].includes(fileExtension)) {\n parsed = parseYaml(fileContents);\n } else {\n // Try to parse as YAML by default, which is more forgiving\n parsed = parseYaml(fileContents);\n }\n } catch (error) {\n throw new Error(\n `Failed to parse config file at ${filePath}: ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n\n if (parsed === undefined) {\n throw new Error(`Config file could not be parsed at ${filePath}`);\n }\n\n // check if the version is present\n if (!disableVersionCheck && typeof parsed.version !== 'number') {\n throw new Error(`Config file is missing version at ${filePath}`);\n }\n\n return parsed;\n};\n","/**\n * Translates Vercel region codes to AWS region codes.\n *\n * Vercel uses three-letter codes (e.g., \"iad1\") to identify their regions,\n * while AWS uses longer region codes (e.g., \"us-east-1\").\n * This function maps the Vercel region code to its corresponding AWS region code.\n *\n * @param region - The Vercel region code to translate\n * @returns The corresponding AWS region code, defaults to 'us-east-1' if not found\n * @link https://vercel.com/docs/edge-network/regions#region-list\n */\nexport const translateVercelRegion = (region: string): string => {\n const regionMap: Record<string, string> = {\n arn1: 'eu-north-1',\n bom1: 'ap-south-1',\n cdg1: 'eu-west-3',\n cle1: 'us-east-2',\n cpt1: 'af-south-1',\n dub1: 'eu-west-1',\n fra1: 'eu-central-1',\n gru1: 'sa-east-1',\n hkg1: 'ap-east-1',\n hnd1: 'ap-northeast-1',\n iad1: 'us-east-1',\n icn1: 'ap-northeast-2',\n kix1: 'ap-northeast-3',\n lhr1: 'eu-west-2',\n pdx1: 'us-west-2',\n sfo1: 'us-west-1',\n sin1: 'ap-southeast-1',\n syd1: 'ap-southeast-2',\n };\n\n return regionMap[region.toLowerCase()] ?? 'us-east-1';\n};\n","import { Runtime } from '../runtime';\n\n/**\n * Translates Vercel runtime strings to our standardized Runtime format\n *\n * @param runtime - The Vercel runtime identifier (e.g. 'nodejs18.x')\n * @returns The corresponding Runtime value or null if no match is found\n */\nexport const translateVercelRuntime = (runtime: string): Runtime | null => {\n switch (runtime) {\n case 'nodejs12.x':\n case 'nodejs14.x':\n case 'nodejs16.x':\n case 'nodejs18.x':\n return 'node-18';\n case 'nodejs20.x':\n case 'nodejs22.x': // TODO: Update when Lambda supports Node.js 22\n return 'node-20';\n default:\n return null;\n }\n};\n","import { NormalizedConfig } from './normalized-config';\n\n/**\n * Ensure a normalized config has no function files that are also defined as assets.\n * For example, a file `public/index.php` should not be defined as an asset, when it is a function and `public` is an asset folder.\n * @param config The normalized config to filter.\n * @returns A promise that resolves to the filtered config.\n */\nexport const filterFunctionsFromAssets = async (config: NormalizedConfig): Promise<NormalizedConfig> => {\n return {\n ...config,\n assets: {\n ...config.assets,\n paths: config.assets?.paths?.filter((path) => !config.entrypoints.some((entrypoint) => entrypoint.path === path)),\n },\n };\n};\n","import { getFilesForPattern } from '@gigadrive/build-utils';\nimport fs from 'fs';\nimport { minimatch } from 'minimatch';\nimport type { ConfigV4, ConfigV4FunctionSettings } from '.';\nimport type {\n NormalizedConfig,\n NormalizedConfigEntrypoint,\n NormalizedConfigRoute,\n NormalizedConfigRouteHandler,\n} from '../normalized-config';\nimport { AVAILABLE_REGIONS, type Region } from '../regions';\n\nexport const parseConfigV4 = async (config: ConfigV4, projectFolder: string): Promise<NormalizedConfig> => {\n const regions =\n config.regions?.includes('global') === true\n ? AVAILABLE_REGIONS\n : (config.regions?.filter((region) => region !== 'global') ?? ['global']);\n\n const populateAssetCache = config.populateAssetCache ?? false;\n const environmentVariables = config.env ?? {};\n const commands = config.build_commands ?? [];\n const entrypoints: NormalizedConfigEntrypoint[] = [];\n const errors: string[] = [];\n const warnings: string[] = [];\n\n if (config.functions != null) {\n for (const [path, func] of Object.entries(config.functions)) {\n const settings = getFunctionSettings(path, config);\n\n if (settings == null) {\n throw new Error(`Settings invalid for function at path '${path}'`);\n }\n\n (await getFilesForPattern(path, projectFolder, func.excludeFiles)).forEach((file) => {\n // check if file is already in entrypoints, or if the path has a definition other than this one that matches it exactly\n if (entrypoints.find((entrypoint) => entrypoint.path === file)) {\n return;\n }\n\n if (config.functions != null && Object.keys(config.functions).find((func) => func === file && func !== path)) {\n return;\n }\n\n entrypoints.push({\n path: file,\n runtime: settings.runtime ?? 'node-20',\n memory: settings.memory ?? 128,\n maxDuration: settings.max_duration ?? 30,\n schedule: func.schedule,\n symlinks: func.symlinks,\n streaming:\n settings.runtime == null || settings.runtime.startsWith('node-') || settings.runtime.startsWith('bun-'),\n });\n });\n }\n }\n\n const assets: string[] = [];\n\n if (config.assets != null) {\n // list all files in assets folder recursively\n\n const assetsPath = `${projectFolder}/${config.assets}`;\n\n if (fs.existsSync(assetsPath) && fs.statSync(assetsPath).isDirectory()) {\n // console.debug('---- ASSET DEBUG ----');\n // console.debug('projectFolder', fs.readdirSync(assetsPath, { recursive: true }));\n\n // find all files in assets folder using fs\n for (const asset of fs.readdirSync(`${projectFolder}/${config.assets}`, {\n recursive: true,\n })) {\n // if file is a directory, skip it\n if (fs.statSync(`${projectFolder}/${config.assets}/${asset}`).isDirectory()) {\n continue;\n }\n\n const disallowedExtensions = ['.htaccess', '.htpasswd'];\n\n const assetName = asset.toString();\n\n if (disallowedExtensions.some((ext) => assetName.toLowerCase().endsWith(ext.toLowerCase()))) {\n continue;\n }\n\n // if it is a function, skip it\n if (getFunctionSettings(`${config.assets}/${assetName}`, config) != null) {\n continue;\n }\n\n assets.push(`${config.assets}/${assetName}`);\n }\n }\n }\n\n const routes = config.routes ?? [];\n\n return {\n regions: regions as Region[],\n assets: {\n paths: assets.sort(),\n prefixToStrip: (config.assets ?? '') + '/',\n dynamicRoutes: true,\n populateCache: populateAssetCache,\n },\n environmentVariables,\n commands,\n entrypoints,\n errors,\n warnings,\n routes: routes.map((route) => {\n // check if the destination has a protocol, if so use REDIRECT handler\n const handler: NormalizedConfigRouteHandler =\n route.destination.toLowerCase().startsWith('http://') || route.destination.toLowerCase().startsWith('https://')\n ? route.redirect === true\n ? 'HTTP_REDIRECT'\n : 'HTTP_PROXY'\n : route.redirect === true\n ? 'HTTP_REDIRECT'\n : 'SERVERLESS_FUNCTION';\n\n return {\n path: route.source,\n destination: route.destination,\n handler,\n headers: route.headers ?? {},\n methods: route.methods ?? ['ANY'],\n positiveRequirements: route.has,\n negativeRequirements: route.missing,\n status: route.statusCode,\n } as NormalizedConfigRoute;\n }),\n };\n};\n\n/**\n * Gets the runtime, memory and max duration for a given path.\n * @param path\n * @param config\n * @returns The runtime, memory and max duration for the given path. Should return undefined when a path should not be deployed as a function.\n */\nexport const getFunctionSettings = (path: string, config: ConfigV4): ConfigV4FunctionSettings | undefined => {\n // functions don't have to state all their options.\n // some function definitions might be glob or regex patterns.\n // go through all function definitions, find those that match the path and merge them.\n\n let functionSettings: ConfigV4FunctionSettings | undefined;\n\n for (const [key, value] of Object.entries(config.functions ?? {})) {\n // make sure to check for both glob and regex patterns\n if (minimatch(path, key) || new RegExp(key).test(path)) {\n if (functionSettings == null) {\n functionSettings = {\n memory: 128,\n max_duration: 30,\n schedule: undefined,\n symlinks: undefined,\n excludeFiles: undefined,\n includeFiles: undefined,\n };\n }\n\n if (value.runtime != null) {\n functionSettings.runtime = value.runtime;\n }\n\n if (value.memory != null) {\n functionSettings.memory = value.memory;\n }\n\n if (value.max_duration != null) {\n functionSettings.max_duration = value.max_duration;\n }\n\n if (value.schedule != null) {\n functionSettings.schedule = value.schedule;\n }\n\n if (value.symlinks != null) {\n functionSettings.symlinks = value.symlinks;\n }\n\n if (value.excludeFiles != null) {\n functionSettings.excludeFiles = value.excludeFiles;\n }\n\n if (value.includeFiles != null) {\n functionSettings.includeFiles = value.includeFiles;\n }\n }\n }\n\n return functionSettings;\n};\n","// Define all available runtimes in a single array\nconst REGION_DEFINITIONS = [\n 'us-east-1',\n 'us-east-2',\n 'us-west-1',\n 'us-west-2',\n 'ap-south-1',\n 'ap-northeast-3',\n 'ap-northeast-2',\n 'ap-southeast-1',\n 'ap-southeast-2',\n 'ap-northeast-1',\n 'ca-central-1',\n 'eu-central-1',\n 'eu-west-1',\n 'eu-west-2',\n 'eu-west-3',\n 'eu-north-1',\n 'sa-east-1',\n] as const;\n\n// Generate the Runtime type from the array\nexport type Region = (typeof REGION_DEFINITIONS)[number];\n\n// Export the available runtimes\nexport const AVAILABLE_REGIONS: Region[] = [...REGION_DEFINITIONS];\n","{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"Config V4\",\n \"description\": \"Configuration schema for version 4\",\n \"type\": \"object\",\n \"required\": [\"version\"],\n \"properties\": {\n \"version\": {\n \"type\": \"integer\",\n \"enum\": [4],\n \"description\": \"The version of the configuration file\"\n },\n \"presets\": {\n \"type\": [\"array\", \"null\"],\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uri\"\n },\n \"description\": \"A list of presets to apply to the project. Each preset will be applied in order.\"\n },\n \"assets\": {\n \"type\": [\"string\", \"null\"],\n \"description\": \"The folder which holds the assets to be deployed to the edge. Defaults to none.\"\n },\n \"populateAssetCache\": {\n \"type\": [\"boolean\", \"null\"],\n \"description\": \"If true, the assets will be cached at the edge during deployment. This may increase the deployment time, depending on the size of the assets. Defaults to false.\"\n },\n \"regions\": {\n \"type\": [\"array\", \"null\"],\n \"description\": \"The regions to which the project will be deployed. Use \\\"global\\\" to deploy to all regions. More regions will incur higher costs.\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"build_commands\": {\n \"type\": [\"array\", \"null\"],\n \"description\": \"The commands to run to build the project. For example, `bun install` or `npm install`.\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"functions\": {\n \"type\": [\"object\", \"null\"],\n \"description\": \"The serverless functions to deploy.\",\n \"additionalProperties\": {\n \"type\": \"object\",\n \"properties\": {\n \"memory\": {\n \"type\": \"number\",\n \"description\": \"The memory in MB to allocate to the function. Defaults to 128.\",\n \"maximum\": 3009,\n \"minimum\": 128\n },\n \"max_duration\": {\n \"type\": \"number\",\n \"description\": \"The max duration in seconds for the function after which it will be terminated. Defaults to 30.\",\n \"maximum\": 900,\n \"minimum\": 1\n },\n \"runtime\": {\n \"$ref\": \"#/$defs/runtimes\",\n \"description\": \"The runtime to use for the function.\"\n },\n \"schedule\": {\n \"type\": \"string\",\n \"description\": \"An expression to schedule the function to run at specific times.\",\n \"pattern\": \"^(?:rate[(](?:(?:1[ ]+(hour|minute|day))|(?:[0-9]+[ ]+(hours|minutes|days)))[)])|(?:cron[(](?:(?:(?:[0-5]?[0-9])|[*])(?:(?:[-](?:(?:[0-5]?[0-9])|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[0-5]?[0-9])|[*])(?:(?:[-](?:(?:[0-5]?[0-9])|[*]))|(?:[/][0-9]+))?)*)[ ]+(?:(?:(?:[0-2]?[0-9])|[*])(?:(?:[-](?:(?:[0-2]?[0-9])|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[0-2]?[0-9])|[*])(?:(?:[-](?:(?:[0-2]?[0-9])|[*]))|(?:[/][0-9]+))?)*)[ ]+(?:(?:[?][ ]+(?:(?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:(?:[-](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:[/][0-9]+)?)|(?:[/][0-9]+))?(?:[,](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:(?:[-](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:[/][0-9]+)?)|(?:[/][0-9]+))?)*)[ ]+(?:(?:(?:[1-7]|(?:SUN|MON|TUE|WED|THU|FRI|SAT))[#][0-5])|(?:(?:(?:(?:[1-7]|(?:SUN|MON|TUE|WED|THU|FRI|SAT))L?)|[L*])(?:(?:[-](?:(?:(?:[1-7]|(?:SUN|MON|TUE|WED|THU|FRI|SAT))L?)|[L*]))|(?:[/][0-9]+))?(?:[,](?:(?:(?:[1-7]|(?:SUN|MON|TUE|WED|THU|FRI|SAT))L?)|[L*])(?:(?:[-](?:(?:(?:[1-7]|(?:SUN|MON|TUE|WED|THU|FRI|SAT))L?)|[L*]))|(?:[/][0-9]+))?)*)))|(?:(?:(?:(?:(?:[1-3]?[0-9])W?)|LW|[L*])(?:(?:[-](?:(?:(?:[1-3]?[0-9])W?)|LW|[L*]))|(?:[/][0-9]+))?(?:[,](?:(?:(?:[1-3]?[0-9])W?)|LW|[L*])(?:(?:[-](?:(?:(?:[1-3]?[0-9])W?)|LW|[L*]))|(?:[/][0-9]+))?)*)[ ]+(?:(?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:(?:[-](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:[/][0-9]+)?)|(?:[/][0-9]+))?(?:[,](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:(?:[-](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:[/][0-9]+)?)|(?:[/][0-9]+))?)*)[ ]+[?]))[ ]+(?:(?:(?:[12][0-9]{3})|[*])(?:(?:[-](?:(?:[12][0-9]{3})|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[12][0-9]{3})|[*])(?:(?:[-](?:(?:[12][0-9]{3})|[*]))|(?:[/][0-9]+))?)*)[)])$\"\n },\n \"symlinks\": {\n \"type\": \"object\",\n \"description\": \"A list of symbolic links to create in the function's package.\",\n \"maxProperties\": 100,\n \"minProperties\": 1,\n \"patternProperties\": {\n \"^.{1,256}$\": {\n \"type\": \"string\",\n \"maxLength\": 256\n }\n },\n \"additionalProperties\": false\n },\n \"excludeFiles\": {\n \"oneOf\": [{ \"type\": \"string\" }, { \"type\": \"array\", \"items\": { \"type\": \"string\" } }],\n \"description\": \"A glob pattern to match files that should be excluded from your Serverless Function. If you're using a Community Runtime, the behavior might vary.\"\n },\n \"includeFiles\": {\n \"oneOf\": [{ \"type\": \"string\" }, { \"type\": \"array\", \"items\": { \"type\": \"string\" } }],\n \"description\": \"A glob pattern to match files that should be included in your Serverless Function. If you're using a Community Runtime, the behavior might vary.\"\n }\n }\n }\n },\n \"env\": {\n \"type\": \"object\",\n \"maxProperties\": 100,\n \"minProperties\": 0,\n \"patternProperties\": {\n \".+\": {\n \"maxLength\": 65536,\n \"minLength\": 0,\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false,\n \"description\": \"Additional environment variables to set during runtime and build.\"\n },\n \"routes\": {\n \"type\": [\"array\", \"null\"],\n \"description\": \"A list of route definitions.\",\n \"maxItems\": 1024,\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"source\", \"destination\"],\n \"properties\": {\n \"source\": {\n \"description\": \"A pattern that matches each incoming pathname (excluding querystring).\",\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"destination\": {\n \"description\": \"An absolute pathname to an existing resource or an external URL.\",\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"has\": {\n \"$ref\": \"#/$defs/matchRequirements\"\n },\n \"missing\": {\n \"$ref\": \"#/$defs/matchRequirements\"\n },\n \"statusCode\": {\n \"description\": \"An optional integer to override the status code of the response.\",\n \"type\": \"integer\",\n \"minimum\": 100,\n \"maximum\": 999\n },\n \"redirect\": {\n \"type\": \"boolean\",\n \"description\": \"An optional boolean to force a redirect response.\"\n },\n \"methods\": {\n \"type\": \"array\",\n \"description\": \"The HTTP methods to match for the route. Defaults to all methods.\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\"ANY\", \"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\", \"HEAD\", \"OPTIONS\"]\n }\n },\n \"headers\": {\n \"type\": \"object\",\n \"description\": \"Additional headers to add to the response.\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"services\": {\n \"type\": \"object\",\n \"description\": \"Optionally, specify additional services like databases to deploy.\",\n \"properties\": {\n \"redis\": {\n \"oneOf\": [\n {\n \"type\": \"null\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"envBindings\": {\n \"type\": \"object\",\n \"description\": \"Optionally, specify what environment variables the credentials will be bound to. For example: `{ url: 'REDIS_URL' }` will bind the `url` environment variable to the Redis URL. If you don't specify any bindings, they will be bound to the REDIS_URL, REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_DB, and REDIS_SSL environment variables.\",\n \"additionalProperties\": false,\n \"properties\": {\n \"url\": { \"type\": \"string\" },\n \"host\": { \"type\": \"string\" },\n \"port\": { \"type\": \"string\" },\n \"password\": { \"type\": \"string\" },\n \"db\": { \"type\": \"string\" },\n \"ssl\": { \"type\": \"string\" }\n }\n },\n \"primaryRegion\": {\n \"type\": \"string\",\n \"description\": \"The primary region to deploy the Redis instance to.\",\n \"enum\": [\n \"us-east-1\",\n \"us-east-2\",\n \"us-west-1\",\n \"us-west-2\",\n \"eu-central-1\",\n \"eu-west-1\",\n \"eu-west-2\",\n \"sa-east-1\",\n \"ap-south-1\",\n \"ap-northeast-1\",\n \"ap-southeast-1\",\n \"ap-southeast-2\",\n \"us-central1\"\n ]\n },\n \"readRegions\": {\n \"type\": \"array\",\n \"description\": \"Optionally, add additional regions to read from. More regions will incur higher costs.\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"us-east-1\",\n \"us-east-2\",\n \"us-west-1\",\n \"us-west-2\",\n \"eu-central-1\",\n \"eu-west-1\",\n \"eu-west-2\",\n \"sa-east-1\",\n \"ap-south-1\",\n \"ap-northeast-1\",\n \"ap-southeast-1\",\n \"ap-southeast-2\"\n ]\n }\n },\n \"eviction\": {\n \"type\": \"boolean\",\n \"description\": \"Optionally, enable Redis eviction. This will evict the least recently used keys in order to make space for new ones.\"\n }\n }\n }\n ]\n },\n \"postgres\": {\n \"oneOf\": [\n {\n \"type\": \"null\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"envBindings\": {\n \"type\": \"object\",\n \"description\": \"Optionally, specify what environment variables the credentials will be bound to. For example: `{ url: 'POSTGRES_URL' }` will bind the `url` environment variable to the Postgres URL. If you don't specify any bindings, they will be bound to the POSTGRES_URL, POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DATABASE environment variables.\",\n \"additionalProperties\": false,\n \"properties\": {\n \"url\": { \"type\": \"string\" },\n \"host\": { \"type\": \"string\" },\n \"port\": { \"type\": \"string\" },\n \"user\": { \"type\": \"string\" },\n \"password\": { \"type\": \"string\" },\n \"database\": { \"type\": \"string\" }\n }\n },\n \"postgresVersion\": {\n \"type\": \"string\",\n \"description\": \"The version of Postgres to deploy.\",\n \"enum\": [\"17\", \"16\", \"15\", \"14\"]\n },\n \"region\": {\n \"type\": \"string\",\n \"description\": \"The region to deploy the Postgres instance to.\",\n \"enum\": [\n \"us-east-1\",\n \"us-east-2\",\n \"us-west-2\",\n \"ap-southeast-1\",\n \"ap-southeast-2\",\n \"eu-central-1\",\n \"eu-west-2\",\n \"sa-east-1\"\n ]\n }\n }\n }\n ]\n }\n }\n }\n },\n \"$defs\": {\n \"runtimes\": {\n \"type\": \"string\",\n \"enum\": [\"php-83\", \"php-82\", \"php-81\", \"php-80\", \"node-20\", \"node-18\", \"node-16\", \"bun-1\"]\n },\n \"matchRequirements\": {\n \"description\": \"An array of requirements that are needed to match\",\n \"type\": \"array\",\n \"maxItems\": 16,\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"type\", \"value\"],\n \"properties\": {\n \"type\": {\n \"description\": \"The type of request element to check\",\n \"type\": \"string\",\n \"enum\": [\"host\"]\n },\n \"value\": {\n \"description\": \"A regular expression used to match the value. Named groups can be used in the destination\",\n \"type\": \"string\",\n \"maxLength\": 4096\n }\n }\n },\n {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"type\", \"key\"],\n \"properties\": {\n \"type\": {\n \"description\": \"The type of request element to check\",\n \"type\": \"string\",\n \"enum\": [\"header\", \"cookie\", \"query\"]\n },\n \"key\": {\n \"description\": \"The name of the element contained in the particular type\",\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"value\": {\n \"description\": \"A regular expression used to match the value. Named groups can be used in the destination\",\n \"type\": \"string\",\n \"maxLength\": 4096\n }\n }\n }\n ]\n }\n }\n }\n}\n","// Define all available runtimes in a single array\nconst RUNTIME_DEFINITIONS = [\n 'php-84',\n 'php-83',\n 'php-81',\n 'node-22',\n 'node-20',\n 'node-18',\n 'node-16',\n 'bun-1',\n] as const;\n\n// Generate the Runtime type from the array\nexport type Runtime = (typeof RUNTIME_DEFINITIONS)[number];\n\n// Export the available runtimes\nexport const AVAILABLE_RUNTIMES: Runtime[] = [...RUNTIME_DEFINITIONS];\n"],"mappings":";AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAEV,IAAM,uBAAuB,CAAC,kBAAkB,iBAAiB,eAAe,cAAc,aAAa;AAO3G,IAAM,aAAa,CAAC,kBAAyC;AAClE,aAAW,QAAQ,sBAAsB;AACvC,UAAM,WAAW,KAAK,KAAK,eAAe,IAAI;AAC9C,QAAI,GAAG,WAAW,QAAQ,GAAG;AAC3B,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;;;AClBA,OAAO,SAAS;AAChB,OAAO,gBAAgB;;;ACDvB,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAC1B,OAAOA,WAAU;;;ACFjB,OAAOC,WAAU;AAWV,IAAM,oBAAoB,CAAC,eAAuB,WAA8C;AAErG,MAAI,CAAC,OAAO,aAAa,QAAQ;AAC/B,WAAO;AAAA,EACT;AAGA,QAAM,YAAsB,CAAC;AAC7B,aAAW,cAAc,OAAO,aAAa;AAC3C,QAAI,WAAW,SAAS,aAAa;AACnC,gBAAU,KAAK,GAAG,OA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