@gigadrive/network-config 0.0.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/build-output-v3/index.js +1 -0
- package/dist/build-output-v3/index.js.map +7 -0
- package/dist/build-output-v3/parse.js +2 -0
- package/dist/build-output-v3/parse.js.map +7 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +7 -0
- package/dist/normalized-config.js +2 -0
- package/dist/normalized-config.js.map +7 -0
- package/dist/parse-raw-config.js +2 -0
- package/dist/parse-raw-config.js.map +7 -0
- package/dist/regions.js +2 -0
- package/dist/regions.js.map +7 -0
- package/dist/runtime.js +2 -0
- package/dist/runtime.js.map +7 -0
- package/dist/v4/index.js +1 -0
- package/dist/v4/index.js.map +7 -0
- package/dist/v4/parse.js +2 -0
- package/dist/v4/parse.js.map +7 -0
- package/package.json +27 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import w from"fs";import s from"path";import".";import{getFilesForPattern as j}from"../../../build-utils/src/get-files-for-pattern";import{parseRawConfig as z}from"../parse-raw-config";const R=".vercel/output/config.json",S=".vercel/output/functions/*.func/.vc-config.json",A=async(o,n)=>{const e=await h(s.join(n,R));return!e||e.version<3||(await E(e,o,n),await b(e,o)),o},b=async(o,n)=>{n.assets||(n.assets={paths:[],prefixToStrip:""}),n.assets.overrides={...n.assets.overrides??{},...o.overrides}},E=async(o,n,e)=>{const C=await j(S,e);for(const c of C){const i=await h(s.join(e,c));if(!i){n.errors.push(`Failed to read function config at ${c}`);continue}const r=s.basename(s.dirname(c)).replace(/\.func$/,""),a=M(i.runtime);if(!a){n.errors.push(`Unsupported runtime for function ${r}: ${i.runtime}`);continue}const y=`.vercel/output/functions/${r}.func`,u=i.handler,N=i.maxDuration,v=i.memory;n.regions=Array.from(new Set([...n.regions??[],...(i.regions??["us-east-1"]).map(t=>O(t))]));const d={},f=i.environment;if(f!=null&&typeof f=="object")for(const t of Object.values(f))for(const[m,x]of Object.entries(t))d[m]=x;const g=a==null||a.startsWith("node-")||a.startsWith("bun-"),p={};for(const[t,m]of Object.entries(i.filePathMap??{}))p[s.join(e,t)]=m;n.entrypoints.push({displayName:r,runtime:a,path:u,memory:v??1024,maxDuration:N??15,environmentVariables:d,streaming:g,package:{rootOverwrite:s.join(e,y),filePathMap:p}});const l=g?"SERVERLESS_FUNCTION_STREAMING":"SERVERLESS_FUNCTION";[{path:`/${r}`,methods:["ANY"],headers:{},destination:u,handler:l},...o.routes?.filter(t=>t.dest===`/${r}`).map(t=>({path:t.src??`/${r}`,methods:["ANY"],headers:{},destination:u,handler:l}))??[]].forEach(t=>{n.routes.push(t)})}},h=async o=>w.existsSync(o)?await z(o):null,M=o=>{switch(o){case"nodejs12.x":case"nodejs14.x":case"nodejs16.x":case"nodejs18.x":return"node-18";case"nodejs20.x":case"nodejs22.x":return"node-20";default:return null}},O=o=>({arn1:"eu-north-1",bom1:"ap-south-1",cdg1:"eu-west-3",cle1:"us-east-2",cpt1:"af-south-1",dub1:"eu-west-1",fra1:"eu-central-1",gru1:"sa-east-1",hkg1:"ap-east-1",hnd1:"ap-northeast-1",iad1:"us-east-1",icn1:"ap-northeast-2",kix1:"ap-northeast-3",lhr1:"eu-west-2",pdx1:"us-west-2",sfo1:"us-west-1",sin1:"ap-southeast-1",syd1:"ap-southeast-2"})[o.toLowerCase()]??"us-east-1";export{E as loadFunctions,A as parseVercelBuildOutputV3,h as readConfigFile,O as translateVercelRegion,M as translateVercelRuntime};
|
|
2
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/build-output-v3/parse.ts"],
|
|
4
|
+
"sourcesContent": ["import fs from 'fs';\nimport path from 'path';\nimport { type Config, type Route, type ServerlessFunctionConfig } from '.';\nimport { getFilesForPattern } from '../../../build-utils/src/get-files-for-pattern';\nimport type {\n NormalizedConfig,\n NormalizedConfigRoute,\n NormalizedConfigRouteHandler,\n NormalizedConfigRouteMethod,\n} from '../normalized-config';\nimport { parseRawConfig } from '../parse-raw-config';\nimport type { Region } from '../regions';\nimport type { Runtime } from '../runtime';\n\nconst configPath = '.vercel/output/config.json';\nconst functionConfigsPattern = '.vercel/output/functions/*.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 await loadFunctions(config, parseResult, projectFolder);\n await loadAssetOverrides(config, parseResult);\n\n return parseResult;\n};\n\nconst loadAssetOverrides = async (config: Config, parseResult: NormalizedConfig) => {\n if (!parseResult.assets) {\n parseResult.assets = {\n paths: [],\n prefixToStrip: '',\n };\n }\n\n parseResult.assets.overrides = {\n ...(parseResult.assets.overrides ?? {}),\n ...config.overrides,\n };\n};\n\nexport const loadFunctions = async (config: Config, parseResult: NormalizedConfig, projectFolder: string) => {\n const functionConfigs = await getFilesForPattern(functionConfigsPattern, projectFolder);\n\n // console.debug('functionConfigs', functionConfigs);\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 functionName: string = path.basename(path.dirname(functionConfigPath)).replace(/\\.func$/, '');\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 handler = functionConfig.handler;\n const maxDuration = functionConfig.maxDuration;\n const memory = functionConfig.memory;\n\n // add regions and filter duplicates\n parseResult.regions = Array.from(\n new Set([\n ...(parseResult.regions ?? []),\n ...(functionConfig.regions ?? ['us-east-1']).map((r) => translateVercelRegion(r)),\n ])\n ) as Region[];\n\n const environmentVariables: Record<string, string> = {};\n\n const functionEnv = functionConfig.environment;\n\n if (functionEnv != null && typeof functionEnv === 'object') {\n for (const env of Object.values(functionEnv)) {\n for (const [key, value] of Object.entries(env)) {\n environmentVariables[key] = value;\n }\n }\n }\n\n const streaming: boolean = runtime == null || runtime.startsWith('node-') || runtime.startsWith('bun-');\n\n // translate filePathMap relative paths to absolute paths\n const filePathMap: Record<string, string> = {};\n for (const [key, value] of Object.entries(functionConfig.filePathMap ?? {})) {\n filePathMap[path.join(projectFolder, key)] = value;\n }\n\n parseResult.entrypoints.push({\n displayName: functionName,\n runtime,\n path: handler,\n memory: memory ?? 1024,\n maxDuration: maxDuration ?? 15,\n environmentVariables,\n streaming,\n package: {\n rootOverwrite: path.join(projectFolder, functionDirectory),\n filePathMap: filePathMap,\n },\n });\n\n const handlerType: NormalizedConfigRouteHandler = streaming\n ? 'SERVERLESS_FUNCTION_STREAMING'\n : 'SERVERLESS_FUNCTION';\n\n (\n [\n {\n path: `/${functionName}`,\n methods: ['ANY'],\n headers: {},\n destination: handler,\n handler: handlerType,\n },\n ...(config.routes\n ?.filter((r) => r.dest === `/${functionName}`)\n .map((r: Route) => ({\n path: r.src ?? `/${functionName}`,\n methods: ['ANY'] as NormalizedConfigRouteMethod[],\n headers: {},\n destination: handler,\n handler: handlerType,\n })) ?? []),\n ] as NormalizedConfigRoute[]\n ).forEach((route) => {\n parseResult.routes.push(route);\n });\n }\n};\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);\n\n return parsed as T;\n};\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\n/**\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"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAQ,KACf,OAAOC,MAAU,OACjB,MAAuE,IACvE,OAAS,sBAAAC,MAA0B,iDAOnC,OAAS,kBAAAC,MAAsB,sBAI/B,MAAMC,EAAa,6BACbC,EAAyB,kDAQlBC,EAA2B,MACtCC,EACAC,IAC8B,CAE9B,MAAMC,EAAS,MAAMC,EAAuBT,EAAK,KAAKO,EAAeJ,CAAU,CAAC,EAEhF,MAAI,CAACK,GAAUA,EAAO,QAAU,IAahC,MAAME,EAAcF,EAAQF,EAAaC,CAAa,EACtD,MAAMI,EAAmBH,EAAQF,CAAW,GAErCA,CACT,EAEMK,EAAqB,MAAOH,EAAgBF,IAAkC,CAC7EA,EAAY,SACf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,iBACN,KAAM,gBACR,GAEiBA,EAAO,YAAY,CAAC,GAAK",
|
|
6
|
+
"names": ["fs", "path", "getFilesForPattern", "parseRawConfig", "configPath", "functionConfigsPattern", "parseVercelBuildOutputV3", "parseResult", "projectFolder", "config", "readConfigFile", "loadFunctions", "loadAssetOverrides", "functionConfigs", "functionConfigPath", "functionConfig", "functionName", "runtime", "translateVercelRuntime", "functionDirectory", "handler", "maxDuration", "memory", "r", "translateVercelRegion", "environmentVariables", "functionEnv", "env", "key", "value", "streaming", "filePathMap", "handlerType", "route", "configFilePath", "region"]
|
|
7
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import c from"ajv";import f from"ajv-formats";import{parseVercelBuildOutputV3 as d}from"./build-output-v3/parse";import{parseRawConfig as l}from"./parse-raw-config";import{parseConfigV4 as g}from"./v4/parse";import u from"./v4/schema.json";const $=async(a,t)=>{const r=await l(a),o=r.version,p={4:u},n=a.replace("/tmp/unzipped/",""),s=p[o];if(!s)throw new Error(`Config file at ${n} has an unsupported version: ${o}`);const e=new c;f(e);const m=e.compile(s);if(!m(r))throw new Error(`Config file at ${n} is invalid: ${e.errorsText(m.errors)}`);let i=await{4:g}[o](r,t);return i=await d(i,t),i};export{$ as parseConfig};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["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 return parseResult;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAS,MAChB,OAAOC,MAAgB,cACvB,OAAS,4BAAAC,MAAgC,0BAEzC,OAAS,kBAAAC,MAAsB,qBAC/B,OAAS,iBAAAC,MAAqB,aAC9B,OAAOC,MAAc,mBAEd,MAAMC,EAAc,MAAOC,EAAkBC,IAAqD,CACvG,MAAMC,EAAS,MAAMN,EAAeI,CAAQ,EACtCG,EAAUD,EAAO,QAEjBE,EAAoC,CAIxC,EAAGN,CACL,EAGMO,EAAeL,EAAS,QAAQ,iBAAkB,EAAE,EAEpDM,EAASF,EAAUD,CAAO,EAEhC,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,kBAAkBD,CAAY,gCAAgCF,CAAO,EAAE,EAIzF,MAAMI,EAAM,IAAId,EAChBC,EAAWa,CAAG,EAEd,MAAMC,EAAWD,EAAI,QAAQD,CAAM,EAGnC,GAAI,CADUE,EAASN,CAAM,EAE3B,MAAM,IAAI,MAAM,kBAAkBG,CAAY,gBAAgBE,EAAI,WAAWC,EAAS,MAAM,CAAC,EAAE,EAWjG,IAAIC,EAAgC,KAPoD,CAItF,EAAGZ,CACL,EAEoDM,CAAO,EAAED,EAAQD,CAAa,EAGlF,OAAAQ,EAAc,MAAMd,EAAyBc,EAAaR,CAAa,EAEhEQ,CACT",
|
|
6
|
+
"names": ["Ajv", "addFormats", "parseVercelBuildOutputV3", "parseRawConfig", "parseConfigV4", "schemaV4", "parseConfig", "filePath", "projectFolder", "parsed", "version", "schemaMap", "relativePath", "schema", "ajv", "validate", "parseResult"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/normalized-config.ts"],
|
|
4
|
+
"sourcesContent": ["import { type Region } from './regions';\nimport { type Runtime } from './runtime';\n\n/**\n * The object structure that all config versions will be parsed into.\n * This is done to provide a consistent interface for the rest of the codebase and easily provision the necessary resources, regardless of the config version.\n */\nexport interface NormalizedConfig {\n /**\n * The regions to deploy the project to.\n */\n regions: Region[];\n\n assets?: {\n /**\n * The relative file paths of the static assets to be deployed to the edge.\n */\n paths?: string[];\n\n /**\n * The prefix to strip from the asset path when serving.\n */\n prefixToStrip?: string;\n\n /**\n * Overrides for specific assets. Can be used to change the path or Content-Type of an asset.\n */\n overrides?: Record<\n string,\n {\n path?: string;\n contentType?: string;\n }\n >;\n\n /**\n * Whether routes for the assets should be generated during deployment.\n */\n dynamicRoutes?: boolean;\n\n /**\n * If true, the assets will be cached at the edge during deployment.\n */\n populateCache?: boolean;\n };\n\n /**\n * Additional environment variables to set during runtime and build.\n */\n environmentVariables: Record<string, string>;\n\n /**\n * The bash commands that will be run to build the project.\n */\n commands: string[];\n\n entrypoints: Array<NormalizedConfigEntrypoint>;\n\n routes: Array<NormalizedConfigRoute>;\n\n services?: Array<NormalizedConfigService>;\n\n /**\n * Warning codes to be printed to the output during deployment.\n */\n warnings: string[];\n\n /**\n * Error codes to be printed to the output during deployment.\n */\n errors: string[];\n}\n\nexport interface NormalizedConfigService {\n type: NormalizedConfigServiceType;\n}\n\nexport type NormalizedConfigServiceType = 'redis' | 'postgres';\n\nexport type UpstashAWSRegion =\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\nexport interface NormalizedConfigServiceRedis extends NormalizedConfigService {\n envBindings?: Record<'url' | 'host' | 'port' | 'password' | 'db' | 'ssl', string>;\n primaryRegion?: UpstashAWSRegion | 'us-central1';\n readRegions?: UpstashAWSRegion[];\n eviction?: boolean;\n}\n\nexport type NeonAWSRegion =\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\nexport interface NormalizedConfigServicePostgres extends NormalizedConfigService {\n envBindings?: Record<'url' | 'host' | 'port' | 'user' | 'password' | 'database', string>;\n postgresVersion?: '17' | '16' | '15' | '14';\n region?: NeonAWSRegion;\n}\n\nexport interface NormalizedConfigEntrypoint {\n displayName?: string;\n path: string;\n runtime: Runtime;\n memory: number;\n maxDuration: number;\n schedule?: string;\n symlinks?: Record<string, string>;\n environmentVariables?: Record<string, string>;\n streaming?: boolean;\n package?: {\n rootOverwrite?: string;\n filePathMap?: Record<string, string>;\n };\n}\n\nexport interface NormalizedConfigRoute {\n path: string;\n destination: string;\n handler: NormalizedConfigRouteHandler | undefined;\n methods: NormalizedConfigRouteMethod[];\n headers: Record<string, string>;\n positiveRequirements?: NormalizedConfigRouteMatchRequirements;\n negativeRequirements?: NormalizedConfigRouteMatchRequirements;\n status?: number;\n}\n\nexport type NormalizedConfigRouteHandler =\n | 'SERVERLESS_FUNCTION'\n | 'SERVERLESS_FUNCTION_STREAMING'\n | 'HTTP_REDIRECT'\n | 'HTTP_PROXY'\n | 'ASSET';\n\nexport type NormalizedConfigRouteMethod = 'ANY' | 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';\n\nexport type NormalizedConfigRouteMatchRequirements =\n | []\n | [\n | {\n /**\n * The type of request element to check\n */\n type: 'host';\n /**\n * A regular expression used to match the value. Named groups can be used in the destination\n */\n value: string;\n }\n | {\n /**\n * The type of request element to check\n */\n type: 'header' | 'cookie' | 'query';\n /**\n * The name of the element contained in the particular type\n */\n key: string;\n /**\n * A regular expression used to match the value. Named groups can be used in the destination\n */\n value?: string;\n },\n ];\n"],
|
|
5
|
+
"mappings": "AAAA,MAA4B,YAC5B,MAA6B",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import i from"fs";import f from"path";import{parse as t}from"yaml";const w=async r=>{if(!i.existsSync(r))throw new Error(`Config file not found at ${r}`);const o=i.readFileSync(r,"utf8");if(o.length===0)throw new Error(`Config file is empty at ${r}`);const n=f.extname(r).toLowerCase();let e;try{n===".json"?e=JSON.parse(o):[".yml",".yaml"].includes(n)?e=t(o):e=t(o)}catch(s){throw new Error(`Failed to parse config file at ${r}: ${s instanceof Error?s.message:"Unknown error"}`)}if(e===void 0)throw new Error(`Config file could not be parsed at ${r}`);if(typeof e.version!="number")throw new Error(`Config file is missing version at ${r}`);return e};export{w as parseRawConfig};
|
|
2
|
+
//# sourceMappingURL=parse-raw-config.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/parse-raw-config.ts"],
|
|
4
|
+
"sourcesContent": ["import fs from 'fs';\nimport path from 'path';\nimport { parse as parseYaml } from 'yaml';\n\nexport const parseRawConfig = async (filePath: string): 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 (typeof parsed.version !== 'number') {\n throw new Error(`Config file is missing version at ${filePath}`);\n }\n\n return parsed;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAQ,KACf,OAAOC,MAAU,OACjB,OAAS,SAASC,MAAiB,OAE5B,MAAMC,EAAiB,MAAOC,GAAmC,CAEtE,GAAI,CAACJ,EAAG,WAAWI,CAAQ,EACzB,MAAM,IAAI,MAAM,4BAA4BA,CAAQ,EAAE,EAIxD,MAAMC,EAAeL,EAAG,aAAaI,EAAU,MAAM,EAErD,GAAIC,EAAa,SAAW,EAC1B,MAAM,IAAI,MAAM,2BAA2BD,CAAQ,EAAE,EAIvD,MAAME,EAAgBL,EAAK,QAAQG,CAAQ,EAAE,YAAY,EAGzD,IAAIG,EACJ,GAAI,CACED,IAAkB,QACpBC,EAAS,KAAK,MAAMF,CAAY,EACvB,CAAC,OAAQ,OAAO,EAAE,SAASC,CAAa,EACjDC,EAASL,EAAUG,CAAY,EAG/BE,EAASL,EAAUG,CAAY,CAEnC,OAASG,EAAO,CACd,MAAM,IAAI,MACR,kCAAkCJ,CAAQ,KAAKI,aAAiB,MAAQA,EAAM,QAAU,eAAe,EACzG,CACF,CAEA,GAAID,IAAW,OACb,MAAM,IAAI,MAAM,sCAAsCH,CAAQ,EAAE,EAIlE,GAAI,OAAOG,EAAO,SAAY,SAC5B,MAAM,IAAI,MAAM,qCAAqCH,CAAQ,EAAE,EAGjE,OAAOG,CACT",
|
|
6
|
+
"names": ["fs", "path", "parseYaml", "parseRawConfig", "filePath", "fileContents", "fileExtension", "parsed", "error"]
|
|
7
|
+
}
|
package/dist/regions.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const t=["us-east-1","us-east-2","us-west-1","us-west-2","ap-south-1","ap-northeast-3","ap-northeast-2","ap-southeast-1","ap-southeast-2","ap-northeast-1","ca-central-1","eu-central-1","eu-west-1","eu-west-2","eu-west-3","eu-north-1","sa-east-1"],e=[...t];export{e as AVAILABLE_REGIONS};
|
|
2
|
+
//# sourceMappingURL=regions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/regions.ts"],
|
|
4
|
+
"sourcesContent": ["// 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"],
|
|
5
|
+
"mappings": "AACA,MAAMA,EAAqB,CACzB,YACA,YACA,YACA,YACA,aACA,iBACA,iBACA,iBACA,iBACA,iBACA,eACA,eACA,YACA,YACA,YACA,aACA,WACF,EAMaC,EAA8B,CAAC,GAAGD,CAAkB",
|
|
6
|
+
"names": ["REGION_DEFINITIONS", "AVAILABLE_REGIONS"]
|
|
7
|
+
}
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/runtime.ts"],
|
|
4
|
+
"sourcesContent": ["// 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"],
|
|
5
|
+
"mappings": "AACA,MAAMA,EAAsB,CAC1B,SACA,SACA,SACA,UACA,UACA,UACA,UACA,OACF,EAMaC,EAAgC,CAAC,GAAGD,CAAmB",
|
|
6
|
+
"names": ["RUNTIME_DEFINITIONS", "AVAILABLE_RUNTIMES"]
|
|
7
|
+
}
|
package/dist/v4/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
package/dist/v4/parse.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import m from"fs";import{minimatch as y}from"minimatch";import{getFilesForPattern as C}from"../../../build-utils/src/get-files-for-pattern";import{AVAILABLE_REGIONS as R}from"../regions";const w=async(t,r)=>{const n=t.regions?.includes("global")===!0?R:t.regions?.filter(e=>e!=="global")??["global"],l=t.populateAssetCache??!1,s=t.env??{},f=t.build_commands??[],d=[],h=[],p=[];if(t.functions!=null)for(const[e,o]of Object.entries(t.functions)){const i=x(e,t);if(i==null)throw new Error(`Settings invalid for function at path '${e}'`);(await C(e,r,o.excludeFiles)).forEach(a=>{d.find(u=>u.path===a)||t.functions!=null&&Object.keys(t.functions).find(u=>u===a&&u!==e)||d.push({path:a,runtime:i.runtime??"node-20",memory:i.memory??128,maxDuration:i.max_duration??30,schedule:o.schedule,symlinks:o.symlinks,streaming:i.runtime==null||i.runtime.startsWith("node-")||i.runtime.startsWith("bun-")})})}const c=[];if(t.assets!=null){const e=`${r}/${t.assets}`;if(m.existsSync(e)&&m.statSync(e).isDirectory())for(const o of m.readdirSync(`${r}/${t.assets}`,{recursive:!0})){if(m.statSync(`${r}/${t.assets}/${o}`).isDirectory())continue;const i=[".htaccess",".htpasswd"],a=o.toString();i.some(u=>a.toLowerCase().endsWith(u.toLowerCase()))||c.push(`${t.assets}/${a}`)}}const g=t.routes??[];return{regions:n,assets:{paths:c.sort(),prefixToStrip:(t.assets??"")+"/",dynamicRoutes:!0,populateCache:l},environmentVariables:s,commands:f,entrypoints:d,errors:h,warnings:p,routes:g.map(e=>{const o=e.destination.toLowerCase().startsWith("http://")||e.destination.toLowerCase().startsWith("https://")?e.redirect===!0?"HTTP_REDIRECT":"HTTP_PROXY":e.redirect===!0?"HTTP_REDIRECT":"SERVERLESS_FUNCTION";return{path:e.source,destination:e.destination,handler:o,headers:e.headers??{},methods:e.methods??["ANY"],positiveRequirements:e.has,negativeRequirements:e.missing,status:e.statusCode}})}},x=(t,r)=>{let n;for(const[l,s]of Object.entries(r.functions??{}))(y(t,l)||new RegExp(l).test(t))&&(n==null&&(n={memory:128,max_duration:30,schedule:void 0,symlinks:void 0,excludeFiles:void 0,includeFiles:void 0}),s.runtime!=null&&(n.runtime=s.runtime),s.memory!=null&&(n.memory=s.memory),s.max_duration!=null&&(n.max_duration=s.max_duration),s.schedule!=null&&(n.schedule=s.schedule),s.symlinks!=null&&(n.symlinks=s.symlinks),s.excludeFiles!=null&&(n.excludeFiles=s.excludeFiles),s.includeFiles!=null&&(n.includeFiles=s.includeFiles));return n};export{x as getFunctionSettings,w as parseConfigV4};
|
|
2
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/v4/parse.ts"],
|
|
4
|
+
"sourcesContent": ["import fs from 'fs';\nimport { minimatch } from 'minimatch';\nimport type { ConfigV4, ConfigV4FunctionSettings } from '.';\nimport { getFilesForPattern } from '../../../build-utils/src/get-files-for-pattern';\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"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAQ,KACf,OAAS,aAAAC,MAAiB,YAE1B,OAAS,sBAAAC,MAA0B,iDAOnC,OAAS,qBAAAC,MAAsC,aAExC,MAAMC,EAAgB,MAAOC,EAAkBC,IAAqD,CACzG,MAAMC,EACJF,EAAO,SAAS,SAAS,QAAQ,IAAM,GACnCF,EACCE,EAAO,SAAS,OAAQG,GAAWA,IAAW,QAAQ,GAAK,CAAC,QAAQ,EAErEC,EAAqBJ,EAAO,oBAAsB,GAClDK,EAAuBL,EAAO,KAAO,CAAC,EACtCM,EAAWN,EAAO,gBAAkB,CAAC,EACrCO,EAA4C,CAAC,EAC7CC,EAAmB,CAAC,EACpBC,EAAqB,CAAC,EAE5B,GAAIT,EAAO,WAAa,KACtB,SAAW,CAACU,EAAMC,CAAI,IAAK,OAAO,QAAQX,EAAO,SAAS,EAAG,CAC3D,MAAMY,EAAWC,EAAoBH,EAAMV,CAAM,EAEjD,GAAIY,GAAY,KACd,MAAM,IAAI,MAAM,0CAA0CF,CAAI,GAAG,GAGlE,MAAMb,EAAmBa,EAAMT,EAAeU,EAAK,YAAY,GAAG,QAASG,GAAS,CAE/EP,EAAY,KAAMQ,GAAeA,EAAW,OAASD,CAAI,GAIzDd,EAAO,WA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,YAAY,EAAE,WAAW,SAAS,GAAKA,EAAM,YAAY,YAAY,EAAE,WAAW,UAAU,EAC1GA,EAAM,WAAa,GACjB,gBACA,aACFA,EAAM,WAAa,GACjB,gBACA,sBAER,MAAO,CACL,KAAMA,EAAM,OACZ,YAAaA,EAAM,YACnB,QAAAC,EACA,QAASD,EAAM,SAAW,CAAC,EAC3B,QAASA,EAAM,SAAW,CAAC,KAAK,EAChC,qBAAsBA,EAAM,IAC5B,qBAAsBA,EAAM,QAC5B,OAAQA,EAAM,UAChB,CACF,CAAC,CACH,CACF,EAQaV,EAAsB,CAACH,EAAcV,IAA2D,CAK3G,IAAIyB,EAEJ,SAAW,CAACC,EAAKC,CAAK,IAAK,OAAO,QAAQ3B,EAAO,WAAa,CAAC,CAAC,GAE1DJ,EAAUc,EAAMgB,CAAG,GAAK,IAAI,OAAOA,CAAG,EAAE,KAAKhB,CAAI,KAC/Ce,GAAoB,OACtBA,EAAmB,CACjB,OAAQ,IACR,aAAc,GACd,SAAU,OACV,SAAU,OACV,aAAc,OACd,aAAc,MAChB,GAGEE,EAAM,SAAW,OACnBF,EAAiB,QAAUE,EAAM,SAG/BA,EAAM,QAAU,OAClBF,EAAiB,OAASE,EAAM,QAG9BA,EAAM,cAAgB,OACxBF,EAAiB,aAAeE,EAAM,cAGpCA,EAAM,UAAY,OACpBF,EAAiB,SAAWE,EAAM,UAGhCA,EAAM,UAAY,OACpBF,EAAiB,SAAWE,EAAM,UAGhCA,EAAM,cAAgB,OACxBF,EAAiB,aAAeE,EAAM,cAGpCA,EAAM,cAAgB,OACxBF,EAAiB,aAAeE,EAAM,eAK5C,OAAOF,CACT",
|
|
6
|
+
"names": ["fs", "minimatch", "getFilesForPattern", "AVAILABLE_REGIONS", "parseConfigV4", "config", "projectFolder", "regions", "region", "populateAssetCache", "environmentVariables", "commands", "entrypoints", "errors", "warnings", "path", "func", "settings", "getFunctionSettings", "file", "entrypoint", "assets", "assetsPath", "asset", "disallowedExtensions", "assetName", "ext", "routes", "route", "handler", "functionSettings", "key", "value"]
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gigadrive/network-config",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"devDependencies": {
|
|
5
|
+
"esbuild": "^0.24.0"
|
|
6
|
+
},
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"ajv": "^8.17.1",
|
|
12
|
+
"ajv-formats": "^3.0.1",
|
|
13
|
+
"minimatch": "^9.0.4",
|
|
14
|
+
"yaml": "^2.7.0"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/Gigadrive/sdk.git"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"clean": "rm -rf dist",
|
|
25
|
+
"build": "node build.mjs"
|
|
26
|
+
}
|
|
27
|
+
}
|