@easel-sh/cli 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +195 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/create-lambda-gateway.d.ts +11 -0
- package/dist/commands/create-lambda-gateway.d.ts.map +1 -0
- package/dist/commands/create-lambda-gateway.js +409 -0
- package/dist/commands/create-lambda-gateway.js.map +1 -0
- package/dist/commands/generate-manifest.d.ts +7 -0
- package/dist/commands/generate-manifest.d.ts.map +1 -0
- package/dist/commands/generate-manifest.js +145 -0
- package/dist/commands/generate-manifest.js.map +1 -0
- package/dist/commands/list-functions.d.ts +7 -0
- package/dist/commands/list-functions.d.ts.map +1 -0
- package/dist/commands/list-functions.js +140 -0
- package/dist/commands/list-functions.js.map +1 -0
- package/dist/commands/package-functions.d.ts +9 -0
- package/dist/commands/package-functions.d.ts.map +1 -0
- package/dist/commands/package-functions.js +292 -0
- package/dist/commands/package-functions.js.map +1 -0
- package/dist/commands/upload-manifest.d.ts +7 -0
- package/dist/commands/upload-manifest.d.ts.map +1 -0
- package/dist/commands/upload-manifest.js +53 -0
- package/dist/commands/upload-manifest.js.map +1 -0
- package/dist/commands/upload-static.d.ts +7 -0
- package/dist/commands/upload-static.d.ts.map +1 -0
- package/dist/commands/upload-static.js +142 -0
- package/dist/commands/upload-static.js.map +1 -0
- package/dist/utils/types.d.ts +38 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +2 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/vercel-config.d.ts +60 -0
- package/dist/utils/vercel-config.d.ts.map +1 -0
- package/dist/utils/vercel-config.js +121 -0
- package/dist/utils/vercel-config.js.map +1 -0
- package/dist/utils.d.ts +31 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +263 -0
- package/dist/utils.js.map +1 -0
- package/package.json +26 -0
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { hideBin } from 'yargs/helpers';
|
|
4
|
+
import { listFunctions } from './commands/list-functions.js';
|
|
5
|
+
import { generateManifest } from "./commands/generate-manifest.js";
|
|
6
|
+
import { uploadManifest } from "./commands/upload-manifest.js";
|
|
7
|
+
import { uploadStatic } from "./commands/upload-static.js";
|
|
8
|
+
import { createLambdaGateway } from "./commands/create-lambda-gateway.js";
|
|
9
|
+
import { packageFunctions } from "./commands/package-functions.js";
|
|
10
|
+
yargs(hideBin(process.argv))
|
|
11
|
+
.scriptName("cli")
|
|
12
|
+
.command("list-functions <dir>", "List functions from directory", (yargs) => {
|
|
13
|
+
return yargs
|
|
14
|
+
.positional("dir", {
|
|
15
|
+
type: "string",
|
|
16
|
+
describe: "Directory to scan for functions",
|
|
17
|
+
demandOption: true,
|
|
18
|
+
})
|
|
19
|
+
.option("output", {
|
|
20
|
+
type: "string",
|
|
21
|
+
choices: ["text", "json"],
|
|
22
|
+
default: "text",
|
|
23
|
+
describe: "Output format",
|
|
24
|
+
})
|
|
25
|
+
.option("functions-dir", {
|
|
26
|
+
type: "string",
|
|
27
|
+
describe: "Custom functions directory (default: uses <dir>)",
|
|
28
|
+
});
|
|
29
|
+
}, (argv) => {
|
|
30
|
+
listFunctions({
|
|
31
|
+
dir: argv.dir,
|
|
32
|
+
output: argv.output,
|
|
33
|
+
functionsDir: argv["functions-dir"],
|
|
34
|
+
});
|
|
35
|
+
})
|
|
36
|
+
.command("generate-manifest <vercel-output-dir>", "Generate deployment manifest from Vercel output", (yargs) => {
|
|
37
|
+
return yargs
|
|
38
|
+
.positional("vercel-output-dir", {
|
|
39
|
+
type: "string",
|
|
40
|
+
describe: "Directory containing .vercel/output",
|
|
41
|
+
demandOption: true,
|
|
42
|
+
})
|
|
43
|
+
.option("output", {
|
|
44
|
+
type: "string",
|
|
45
|
+
describe: "Output file path (default: stdout)",
|
|
46
|
+
})
|
|
47
|
+
.option("hostname", {
|
|
48
|
+
type: "string",
|
|
49
|
+
describe: "Hostname to include in manifest metadata",
|
|
50
|
+
});
|
|
51
|
+
}, (argv) => {
|
|
52
|
+
generateManifest({
|
|
53
|
+
vercelOutputDir: argv.vercelOutputDir,
|
|
54
|
+
output: argv.output,
|
|
55
|
+
hostname: argv.hostname,
|
|
56
|
+
});
|
|
57
|
+
})
|
|
58
|
+
.command("upload-manifest <manifest-file>", "Upload deployment manifest to metadata service", (yargs) => {
|
|
59
|
+
return yargs
|
|
60
|
+
.positional("manifest-file", {
|
|
61
|
+
type: "string",
|
|
62
|
+
describe: "Path to manifest JSON file",
|
|
63
|
+
demandOption: true,
|
|
64
|
+
})
|
|
65
|
+
.option("hostname", {
|
|
66
|
+
type: "string",
|
|
67
|
+
describe: "Hostname for the manifest",
|
|
68
|
+
demandOption: true,
|
|
69
|
+
})
|
|
70
|
+
.option("service-url", {
|
|
71
|
+
type: "string",
|
|
72
|
+
describe: "Metadata service URL",
|
|
73
|
+
default: "http://localhost:3001",
|
|
74
|
+
});
|
|
75
|
+
}, async (argv) => {
|
|
76
|
+
try {
|
|
77
|
+
await uploadManifest({
|
|
78
|
+
manifestFile: argv.manifestFile,
|
|
79
|
+
hostname: argv.hostname,
|
|
80
|
+
serviceUrl: argv["service-url"],
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.error("Error:", error.message);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
.command("upload-static <vercel-output-dir>", "Upload static assets to Bunny Edge Storage via metadata service", (yargs) => {
|
|
89
|
+
return yargs
|
|
90
|
+
.positional("vercel-output-dir", {
|
|
91
|
+
type: "string",
|
|
92
|
+
describe: "Directory containing .vercel/output",
|
|
93
|
+
demandOption: true,
|
|
94
|
+
})
|
|
95
|
+
.option("hostname", {
|
|
96
|
+
type: "string",
|
|
97
|
+
describe: "Hostname for the static assets",
|
|
98
|
+
demandOption: true,
|
|
99
|
+
})
|
|
100
|
+
.option("service-url", {
|
|
101
|
+
type: "string",
|
|
102
|
+
describe: "Metadata service URL",
|
|
103
|
+
default: "http://localhost:3001",
|
|
104
|
+
});
|
|
105
|
+
}, async (argv) => {
|
|
106
|
+
try {
|
|
107
|
+
await uploadStatic({
|
|
108
|
+
vercelOutputDir: argv.vercelOutputDir,
|
|
109
|
+
hostname: argv.hostname,
|
|
110
|
+
serviceUrl: argv["service-url"],
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
console.error("Error:", error.message);
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
.command("create-lambda-gateway [vercel-output-dir]", "Create SST config with lambda functions for each lambda group in a deployment", (yargs) => {
|
|
119
|
+
return yargs
|
|
120
|
+
.positional("vercel-output-dir", {
|
|
121
|
+
type: "string",
|
|
122
|
+
describe: "Directory containing .vercel/output (default: current directory)",
|
|
123
|
+
default: process.cwd(),
|
|
124
|
+
})
|
|
125
|
+
.option("functions-dir", {
|
|
126
|
+
type: "string",
|
|
127
|
+
describe: "Override functions directory (default: <vercel-output-dir>/.vercel/output/functions)",
|
|
128
|
+
})
|
|
129
|
+
.option("manifest-file", {
|
|
130
|
+
type: "string",
|
|
131
|
+
describe: "Override manifest file path (default: <vercel-output-dir>/.vercel/output/manifest.json)",
|
|
132
|
+
})
|
|
133
|
+
.option("static-dir", {
|
|
134
|
+
type: "string",
|
|
135
|
+
describe: "Override static directory (default: <vercel-output-dir>/.vercel/output/static)",
|
|
136
|
+
})
|
|
137
|
+
.option("output", {
|
|
138
|
+
type: "string",
|
|
139
|
+
describe: "Output file path (default: sst.config.ts in current directory)",
|
|
140
|
+
})
|
|
141
|
+
.option("stage", {
|
|
142
|
+
type: "string",
|
|
143
|
+
describe: "Deployment stage",
|
|
144
|
+
})
|
|
145
|
+
.option("profile", {
|
|
146
|
+
type: "string",
|
|
147
|
+
describe: "AWS profile name",
|
|
148
|
+
});
|
|
149
|
+
}, (argv) => {
|
|
150
|
+
try {
|
|
151
|
+
createLambdaGateway({
|
|
152
|
+
vercelOutputDir: argv.vercelOutputDir,
|
|
153
|
+
functionsDir: argv["functions-dir"],
|
|
154
|
+
manifestFile: argv["manifest-file"],
|
|
155
|
+
staticDir: argv["static-dir"],
|
|
156
|
+
output: argv.output,
|
|
157
|
+
stage: argv.stage,
|
|
158
|
+
profile: argv.profile,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
console.error("Error:", error.message);
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
.command("package-functions <vercel-output-dir>", "Package function directories into zip files named by their hash", (yargs) => {
|
|
167
|
+
return yargs
|
|
168
|
+
.positional("vercel-output-dir", {
|
|
169
|
+
type: "string",
|
|
170
|
+
describe: "Directory containing .vercel/output",
|
|
171
|
+
demandOption: true,
|
|
172
|
+
})
|
|
173
|
+
.option("manifest-file", {
|
|
174
|
+
type: "string",
|
|
175
|
+
describe: "Override manifest file path (default: <vercel-output-dir>/.vercel/output/manifest.json)",
|
|
176
|
+
});
|
|
177
|
+
}, (argv) => {
|
|
178
|
+
try {
|
|
179
|
+
packageFunctions({
|
|
180
|
+
vercelOutputDir: argv.vercelOutputDir,
|
|
181
|
+
manifestFile: argv["manifest-file"],
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
console.error("Error:", error.message);
|
|
186
|
+
process.exit(1);
|
|
187
|
+
}
|
|
188
|
+
})
|
|
189
|
+
.demandCommand(1, "You need at least one command before moving on")
|
|
190
|
+
.help()
|
|
191
|
+
.alias("help", "h")
|
|
192
|
+
.version()
|
|
193
|
+
.alias("version", "v")
|
|
194
|
+
.parse();
|
|
195
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACzB,UAAU,CAAC,KAAK,CAAC;KACjB,OAAO,CACN,sBAAsB,EACtB,+BAA+B,EAC/B,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,KAAK;SACT,UAAU,CAAC,KAAK,EAAE;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,iCAAiC;QAC3C,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;QACzB,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,eAAe;KAC1B,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,kDAAkD;KAC7D,CAAC,CAAC;AACP,CAAC,EACD,CAAC,IAAI,EAAE,EAAE;IACP,aAAa,CAAC;QACZ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AK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CACF;KACA,OAAO,CACN,uCAAuC,EACvC,iEAAiE,EACjE,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,KAAK;SACT,UAAU,CAAC,mBAAmB,EAAE;QAC/B,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,qCAAqC;QAC/C,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,QAAQ;QACd,QAAQ,EACN,yFAAyF;KAC5F,CAAC,CAAC;AACP,CAAC,EACD,CAAC,IAAI,EAAE,EAAE;IACP,IAAI,CAAC;QACH,gBAAgB,CAAC;YACf,eAAe,EAAE,IAAI,CAAC,eAAyB;YAC/C,YAAY,EAAE,IAAI,CAAC,eAAe,CAAuB;SAC1D,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CACF;KACA,aAAa,CAAC,CAAC,EAAE,gDAAgD,CAAC;KAClE,IAAI,EAAE;KACN,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC;KAClB,OAAO,EAAE;KACT,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC;KACrB,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CreateLambdaGatewayOptions {
|
|
2
|
+
vercelOutputDir?: string;
|
|
3
|
+
functionsDir?: string;
|
|
4
|
+
manifestFile?: string;
|
|
5
|
+
staticDir?: string;
|
|
6
|
+
output?: string;
|
|
7
|
+
stage?: string;
|
|
8
|
+
profile?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function createLambdaGateway(options: CreateLambdaGatewayOptions): void;
|
|
11
|
+
//# sourceMappingURL=create-lambda-gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-lambda-gateway.d.ts","sourceRoot":"","sources":["../../src/commands/create-lambda-gateway.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,0BAA0B;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,IAAI,CAmI7E"}
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as os from "os";
|
|
4
|
+
import { scanFunctions, resolveVercelOutputDir } from "../utils.js";
|
|
5
|
+
export function createLambdaGateway(options) {
|
|
6
|
+
const { vercelOutputDir, functionsDir, manifestFile, staticDir, output, stage, profile, } = options;
|
|
7
|
+
// Resolve base Vercel output directory
|
|
8
|
+
let baseOutputDir;
|
|
9
|
+
if (vercelOutputDir) {
|
|
10
|
+
baseOutputDir = resolveVercelOutputDir(vercelOutputDir);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
// Default to current directory
|
|
14
|
+
baseOutputDir = resolveVercelOutputDir(process.cwd());
|
|
15
|
+
}
|
|
16
|
+
// Determine functions directory
|
|
17
|
+
let resolvedFunctionsDir;
|
|
18
|
+
if (functionsDir) {
|
|
19
|
+
resolvedFunctionsDir = path.resolve(functionsDir);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
resolvedFunctionsDir = path.join(baseOutputDir, "functions");
|
|
23
|
+
}
|
|
24
|
+
if (!fs.existsSync(resolvedFunctionsDir)) {
|
|
25
|
+
throw new Error(`Functions directory not found: ${resolvedFunctionsDir}`);
|
|
26
|
+
}
|
|
27
|
+
// Get lambda groups (functions grouped by hash)
|
|
28
|
+
const hashGroups = new Map();
|
|
29
|
+
// Scan functions directory
|
|
30
|
+
const functions = scanFunctions(resolvedFunctionsDir, resolvedFunctionsDir);
|
|
31
|
+
const functionsWithHash = functions.filter((f) => f.hash);
|
|
32
|
+
if (functionsWithHash.length === 0) {
|
|
33
|
+
throw new Error(`No functions with hashes found in: ${resolvedFunctionsDir}`);
|
|
34
|
+
}
|
|
35
|
+
// Optionally validate against manifest if provided
|
|
36
|
+
let resolvedManifestFile;
|
|
37
|
+
if (manifestFile) {
|
|
38
|
+
resolvedManifestFile = path.resolve(manifestFile);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// Try default location in base output dir
|
|
42
|
+
const defaultManifest = path.join(baseOutputDir, "manifest.json");
|
|
43
|
+
if (fs.existsSync(defaultManifest)) {
|
|
44
|
+
resolvedManifestFile = defaultManifest;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (resolvedManifestFile) {
|
|
48
|
+
if (!fs.existsSync(resolvedManifestFile)) {
|
|
49
|
+
throw new Error(`Manifest file not found: ${resolvedManifestFile}`);
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const manifest = JSON.parse(fs.readFileSync(resolvedManifestFile, "utf8"));
|
|
53
|
+
// Log info about manifest if it has resourceHashes
|
|
54
|
+
if (manifest.resourceHashes &&
|
|
55
|
+
Object.keys(manifest.resourceHashes).length > 0) {
|
|
56
|
+
const manifestHashCount = Object.keys(manifest.resourceHashes).length;
|
|
57
|
+
console.log(`Manifest contains ${manifestHashCount} resource hash(es)`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.warn(`Warning: Could not parse manifest file: ${error.message}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Group functions by hash
|
|
65
|
+
for (const func of functionsWithHash) {
|
|
66
|
+
if (func.hash) {
|
|
67
|
+
if (!hashGroups.has(func.hash)) {
|
|
68
|
+
hashGroups.set(func.hash, []);
|
|
69
|
+
}
|
|
70
|
+
hashGroups.get(func.hash).push({
|
|
71
|
+
resourceName: func.resourceName,
|
|
72
|
+
funcDir: func.funcDir,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Determine output path for relative path calculation
|
|
77
|
+
const outputPath = output
|
|
78
|
+
? path.resolve(output)
|
|
79
|
+
: path.join(process.cwd(), "sst.config.ts");
|
|
80
|
+
const outputDir = path.dirname(outputPath);
|
|
81
|
+
// Create temporary directory for handler files
|
|
82
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "lambda-handlers-"));
|
|
83
|
+
// Generate SST config
|
|
84
|
+
const sstConfig = generateSstConfig(hashGroups, outputDir, tempDir, stage, profile);
|
|
85
|
+
// Write output
|
|
86
|
+
fs.writeFileSync(outputPath, sstConfig, "utf8");
|
|
87
|
+
// Summary output
|
|
88
|
+
console.log(`✓ SST config written to: ${outputPath}`);
|
|
89
|
+
console.log(`✓ Created ${hashGroups.size} lambda function group(s) with ${functionsWithHash.length} total function(s)`);
|
|
90
|
+
// Show hash groups summary
|
|
91
|
+
const sortedHashes = Array.from(hashGroups.keys()).sort();
|
|
92
|
+
for (const hash of sortedHashes) {
|
|
93
|
+
const group = hashGroups.get(hash);
|
|
94
|
+
console.log(` - Hash ${hash.substring(0, 8)}... (${group.length} function(s))`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function generateSstConfig(hashGroups, outputDir, tempDir, stage, profile) {
|
|
98
|
+
// HTTP methods to support
|
|
99
|
+
const httpMethods = [
|
|
100
|
+
"GET",
|
|
101
|
+
"POST",
|
|
102
|
+
"PUT",
|
|
103
|
+
"DELETE",
|
|
104
|
+
"PATCH",
|
|
105
|
+
"OPTIONS",
|
|
106
|
+
"HEAD",
|
|
107
|
+
];
|
|
108
|
+
// Sort hashes for consistent output
|
|
109
|
+
const sortedHashes = Array.from(hashGroups.keys()).sort();
|
|
110
|
+
// Generate function definitions and route definitions
|
|
111
|
+
const functionDefinitions = [];
|
|
112
|
+
const routeDefinitions = [];
|
|
113
|
+
sortedHashes.forEach((hash) => {
|
|
114
|
+
// Get the first function in the group to use as the handler
|
|
115
|
+
const firstFunc = hashGroups.get(hash)[0];
|
|
116
|
+
// Make the function directory path relative to the output directory
|
|
117
|
+
const funcDirAbsolute = firstFunc.funcDir;
|
|
118
|
+
const funcDirRelative = path.relative(outputDir, funcDirAbsolute);
|
|
119
|
+
// Normalize path separators for cross-platform compatibility
|
|
120
|
+
// SST expects forward slashes
|
|
121
|
+
const funcDirPath = funcDirRelative.replace(/\\/g, "/");
|
|
122
|
+
// Read .vc-config.json to get the handler and filePathMap
|
|
123
|
+
const vcConfigPath = path.join(funcDirAbsolute, ".vc-config.json");
|
|
124
|
+
let handlerPath = `${funcDirPath}/handler.handler`; // default fallback
|
|
125
|
+
let filePathMap = {};
|
|
126
|
+
let vcHandlerFile = "handler.js"; // default handler file from config
|
|
127
|
+
if (fs.existsSync(vcConfigPath)) {
|
|
128
|
+
try {
|
|
129
|
+
const vcConfig = JSON.parse(fs.readFileSync(vcConfigPath, "utf8"));
|
|
130
|
+
// Extract handler file from config
|
|
131
|
+
if (vcConfig.handler) {
|
|
132
|
+
vcHandlerFile = vcConfig.handler;
|
|
133
|
+
}
|
|
134
|
+
// Extract filePathMap for copyFiles
|
|
135
|
+
if (vcConfig.filePathMap && typeof vcConfig.filePathMap === "object") {
|
|
136
|
+
filePathMap = vcConfig.filePathMap;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
console.warn(`Warning: Could not read .vc-config.json from ${funcDirAbsolute}: ${error.message}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
console.warn(`Warning: .vc-config.json not found in ${funcDirAbsolute}, using default handler`);
|
|
145
|
+
}
|
|
146
|
+
// Generate handler wrapper file
|
|
147
|
+
const handlerWrapperCode = `/* eslint-disable @typescript-eslint/no-require-imports */
|
|
148
|
+
|
|
149
|
+
const handler = require("./${vcHandlerFile.replace(/\.js$/, "")}");
|
|
150
|
+
|
|
151
|
+
const { Readable } = require("stream");
|
|
152
|
+
|
|
153
|
+
const { EventEmitter } = require("events");
|
|
154
|
+
|
|
155
|
+
module.exports.handler = async (event, _context) => {
|
|
156
|
+
return new Promise((resolve, reject) => {
|
|
157
|
+
// Convert AWS Lambda API Gateway event to Node.js request/response objects
|
|
158
|
+
// Support both API Gateway V1 (REST) and V2 (HTTP) formats
|
|
159
|
+
const isV2 = event.requestContext && event.requestContext.http;
|
|
160
|
+
const method = isV2
|
|
161
|
+
? event.requestContext.http.method
|
|
162
|
+
: event.httpMethod || "GET";
|
|
163
|
+
|
|
164
|
+
// Normalize headers (API Gateway V2 uses lowercase, V1 can be mixed)
|
|
165
|
+
const normalizedHeaders = {};
|
|
166
|
+
if (event.headers) {
|
|
167
|
+
Object.entries(event.headers).forEach(([key, value]) => {
|
|
168
|
+
normalizedHeaders[key.toLowerCase()] = value;
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Build URL with query parameters
|
|
173
|
+
const queryParams = { ...(event.queryStringParameters || {}) };
|
|
174
|
+
|
|
175
|
+
// Extract the URL from the 'x-matched-path' header
|
|
176
|
+
// This header contains the original path that was matched
|
|
177
|
+
let path = "/";
|
|
178
|
+
const matchedPath = normalizedHeaders["x-matched-path"];
|
|
179
|
+
if (matchedPath) {
|
|
180
|
+
path = matchedPath;
|
|
181
|
+
// Ensure path starts with /
|
|
182
|
+
if (!path.startsWith("/")) {
|
|
183
|
+
path = "/" + path;
|
|
184
|
+
}
|
|
185
|
+
} else {
|
|
186
|
+
// Fallback to original path if no 'x-matched-path' header
|
|
187
|
+
path = isV2
|
|
188
|
+
? event.rawPath || event.path || "/"
|
|
189
|
+
: event.path || "/";
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const url = new URL(path, \`http://\${event.headers?.host || event.headers?.["host"] || "localhost"}\`);
|
|
193
|
+
|
|
194
|
+
// Add remaining query parameters
|
|
195
|
+
Object.entries(queryParams).forEach(([key, value]) => {
|
|
196
|
+
url.searchParams.set(key, value);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// Handle body - decode if base64 encoded
|
|
200
|
+
let bodyBuffer = null;
|
|
201
|
+
if (event.body) {
|
|
202
|
+
if (event.isBase64Encoded) {
|
|
203
|
+
bodyBuffer = Buffer.from(event.body, "base64");
|
|
204
|
+
} else {
|
|
205
|
+
bodyBuffer = Buffer.from(event.body, "utf8");
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Create a mock request object
|
|
210
|
+
const req = Object.assign(
|
|
211
|
+
new Readable({
|
|
212
|
+
read() {
|
|
213
|
+
if (bodyBuffer) {
|
|
214
|
+
this.push(bodyBuffer);
|
|
215
|
+
}
|
|
216
|
+
this.push(null);
|
|
217
|
+
},
|
|
218
|
+
}),
|
|
219
|
+
{
|
|
220
|
+
method: method,
|
|
221
|
+
url: url.pathname + url.search,
|
|
222
|
+
headers: normalizedHeaders,
|
|
223
|
+
query: queryParams,
|
|
224
|
+
body: bodyBuffer,
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
// Create a mock response object
|
|
229
|
+
let statusCode = 200;
|
|
230
|
+
const headers = {};
|
|
231
|
+
let body = "";
|
|
232
|
+
let headersSent = false;
|
|
233
|
+
const res = Object.assign(new EventEmitter(), {
|
|
234
|
+
setHeader: (key, value) => {
|
|
235
|
+
if (!headersSent) {
|
|
236
|
+
headers[key.toLowerCase()] = value;
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
getHeader: (key) => headers[key.toLowerCase()],
|
|
240
|
+
removeHeader: (key) => {
|
|
241
|
+
delete headers[key.toLowerCase()];
|
|
242
|
+
},
|
|
243
|
+
appendHeader: (key, value) => {
|
|
244
|
+
if (!headersSent) {
|
|
245
|
+
const lowerKey = key.toLowerCase();
|
|
246
|
+
const existing = headers[lowerKey];
|
|
247
|
+
if (existing) {
|
|
248
|
+
// Append to existing header (comma-separated)
|
|
249
|
+
headers[lowerKey] = Array.isArray(existing)
|
|
250
|
+
? existing.concat(value)
|
|
251
|
+
: [existing, value];
|
|
252
|
+
} else {
|
|
253
|
+
headers[lowerKey] = value;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
hasHeader: (key) => {
|
|
258
|
+
return key.toLowerCase() in headers;
|
|
259
|
+
},
|
|
260
|
+
getHeaderNames: () => Object.keys(headers),
|
|
261
|
+
writeHead: (code, responseHeaders) => {
|
|
262
|
+
if (!headersSent) {
|
|
263
|
+
statusCode = code;
|
|
264
|
+
if (responseHeaders) {
|
|
265
|
+
Object.entries(responseHeaders).forEach(([key, value]) => {
|
|
266
|
+
headers[key.toLowerCase()] = value;
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
headersSent = true;
|
|
270
|
+
}
|
|
271
|
+
return res;
|
|
272
|
+
},
|
|
273
|
+
write: (chunk) => {
|
|
274
|
+
if (!headersSent) {
|
|
275
|
+
headersSent = true;
|
|
276
|
+
}
|
|
277
|
+
body += chunk.toString();
|
|
278
|
+
return true;
|
|
279
|
+
},
|
|
280
|
+
end: (chunk) => {
|
|
281
|
+
if (chunk) {
|
|
282
|
+
body += chunk.toString();
|
|
283
|
+
}
|
|
284
|
+
if (!headersSent) {
|
|
285
|
+
headersSent = true;
|
|
286
|
+
}
|
|
287
|
+
// Normalize headers - convert arrays to comma-separated strings
|
|
288
|
+
const normalizedHeaders = {};
|
|
289
|
+
Object.entries(headers).forEach(([key, value]) => {
|
|
290
|
+
normalizedHeaders[key] = Array.isArray(value) ? value.join(", ") : value;
|
|
291
|
+
});
|
|
292
|
+
// Return AWS Lambda API Gateway response format
|
|
293
|
+
// Use statusCode (which can be set via res.statusCode = value or writeHead)
|
|
294
|
+
resolve({
|
|
295
|
+
statusCode: statusCode || 200,
|
|
296
|
+
headers: normalizedHeaders,
|
|
297
|
+
body: body,
|
|
298
|
+
});
|
|
299
|
+
},
|
|
300
|
+
headersSent: false,
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
// Define statusCode as a getter/setter to sync with the local variable
|
|
304
|
+
// This allows handlers to set res.statusCode = 404 and have it work correctly
|
|
305
|
+
Object.defineProperty(res, "statusCode", {
|
|
306
|
+
get: () => statusCode,
|
|
307
|
+
set: (value) => {
|
|
308
|
+
statusCode = value;
|
|
309
|
+
},
|
|
310
|
+
enumerable: true,
|
|
311
|
+
configurable: true,
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// Handle errors
|
|
315
|
+
req.on("error", reject);
|
|
316
|
+
res.on("error", reject);
|
|
317
|
+
|
|
318
|
+
// Call the Next.js handler
|
|
319
|
+
try {
|
|
320
|
+
handler(req, res);
|
|
321
|
+
} catch (error) {
|
|
322
|
+
reject(error);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
`;
|
|
327
|
+
// Write handler wrapper to temporary directory
|
|
328
|
+
const handlerFileName = `handler-${hash.substring(0, 8)}.js`;
|
|
329
|
+
const handlerWrapperPath = path.join(tempDir, handlerFileName);
|
|
330
|
+
fs.writeFileSync(handlerWrapperPath, handlerWrapperCode, "utf8");
|
|
331
|
+
// Make handler path relative to output directory for copyFiles
|
|
332
|
+
const handlerRelativePath = path
|
|
333
|
+
.relative(outputDir, handlerWrapperPath)
|
|
334
|
+
.replace(/\\/g, "/");
|
|
335
|
+
// Handler path is just the handler name (relative to bundle directory)
|
|
336
|
+
handlerPath = "handler.handler";
|
|
337
|
+
// Create function name using full hash (sanitized for variable name)
|
|
338
|
+
// Replace any invalid characters with underscores
|
|
339
|
+
const functionName = `Function${hash.replace(/[^a-zA-Z0-9]/g, "_")}`;
|
|
340
|
+
// Build copyFiles array from filePathMap
|
|
341
|
+
// Use filePathMap entries as-is (no path resolution)
|
|
342
|
+
const copyFilesEntries = Object.entries(filePathMap)
|
|
343
|
+
.map(([from, to]) => {
|
|
344
|
+
return ` {
|
|
345
|
+
from: "${from}",
|
|
346
|
+
to: "${to}",
|
|
347
|
+
}`;
|
|
348
|
+
})
|
|
349
|
+
.join(",\n");
|
|
350
|
+
// Add handler file to copyFiles (copy to root of function bundle)
|
|
351
|
+
const handlerCopyEntry = ` {
|
|
352
|
+
from: "${handlerRelativePath}",
|
|
353
|
+
to: "handler.js",
|
|
354
|
+
}`;
|
|
355
|
+
// Combine filePathMap entries with handler file
|
|
356
|
+
const allCopyFilesEntries = copyFilesEntries
|
|
357
|
+
? `${copyFilesEntries},\n${handlerCopyEntry}`
|
|
358
|
+
: handlerCopyEntry;
|
|
359
|
+
// Create function definition with copyFiles and bundle
|
|
360
|
+
const functionDef = ` const ${functionName} = new sst.aws.Function("${functionName}", {
|
|
361
|
+
handler: "${handlerPath}",
|
|
362
|
+
bundle: "${funcDirPath}",
|
|
363
|
+
copyFiles: [
|
|
364
|
+
${allCopyFilesEntries}
|
|
365
|
+
],
|
|
366
|
+
});`;
|
|
367
|
+
functionDefinitions.push(functionDef);
|
|
368
|
+
// Create routes for each HTTP method pointing to the function using .arn
|
|
369
|
+
const routes = httpMethods
|
|
370
|
+
.map((method) => ` api.route("${method} /${hash}", ${functionName}.arn);`)
|
|
371
|
+
.join("\n");
|
|
372
|
+
routeDefinitions.push(routes);
|
|
373
|
+
});
|
|
374
|
+
const profileConfig = profile ? `\n profile: "${profile}",` : "";
|
|
375
|
+
const stageConfig = stage ? `\n stage: "${stage}",` : "";
|
|
376
|
+
return `/// <reference path="./.sst/platform/config.d.ts" />
|
|
377
|
+
|
|
378
|
+
export default $config({
|
|
379
|
+
app(input) {
|
|
380
|
+
return {
|
|
381
|
+
name: "lambda-gateway",
|
|
382
|
+
removal: input?.stage === "production" ? "retain" : "remove",
|
|
383
|
+
protect: ["production"].includes(input?.stage),
|
|
384
|
+
home: "aws",
|
|
385
|
+
providers: {
|
|
386
|
+
aws: {${profileConfig}
|
|
387
|
+
},
|
|
388
|
+
},${stageConfig}
|
|
389
|
+
};
|
|
390
|
+
},
|
|
391
|
+
|
|
392
|
+
async run() {
|
|
393
|
+
// Create API Gateway
|
|
394
|
+
const api = new sst.aws.ApiGatewayV2("Api");
|
|
395
|
+
|
|
396
|
+
// Create lambda functions for each hash group
|
|
397
|
+
${functionDefinitions.join("\n\n")}
|
|
398
|
+
|
|
399
|
+
// Add routes for each lambda group (by hash)
|
|
400
|
+
${routeDefinitions.join("\n\n")}
|
|
401
|
+
|
|
402
|
+
return {
|
|
403
|
+
api: api.url,
|
|
404
|
+
};
|
|
405
|
+
},
|
|
406
|
+
});
|
|
407
|
+
`;
|
|
408
|
+
}
|
|
409
|
+
//# sourceMappingURL=create-lambda-gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-lambda-gateway.js","sourceRoot":"","sources":["../../src/commands/create-lambda-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAapE,MAAM,UAAU,mBAAmB,CAAC,OAAmC;IACrE,MAAM,EACJ,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,MAAM,EACN,KAAK,EACL,OAAO,GACR,GAAG,OAAO,CAAC;IAEZ,uCAAuC;IACvC,IAAI,aAAqB,CAAC;IAC1B,IAAI,eAAe,EAAE,CAAC;QACpB,aAAa,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAAC;IAC1D,CAAC;SAAM,CAAC;QACN,+BAA+B;QA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