@actuallyjamez/elysian 0.7.0 → 0.8.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/commands/build.js +10 -9
- package/dist/cli/commands/dev.d.ts +4 -3
- package/dist/cli/commands/dev.js +313 -261
- package/dist/cli/commands/init/scaffold.js +24 -3
- package/dist/cli/commands/init/templates.js +1 -1
- package/dist/cli/commands/init/terraform-live.d.ts +27 -0
- package/dist/cli/commands/init/terraform-live.js +140 -0
- package/dist/cli/commands/init/terraform.js +27 -3
- package/dist/cli/commands/init.js +2 -4
- package/dist/core/appsync-client.d.ts +154 -0
- package/dist/core/appsync-client.js +363 -0
- package/dist/core/bundler.js +52 -5
- package/dist/core/handler-wrapper.js +20 -2
- package/dist/core/localstack.d.ts +53 -0
- package/dist/core/localstack.js +226 -1
- package/dist/core/openapi.d.ts +3 -3
- package/dist/core/openapi.js +28 -10
- package/dist/core/stub-bundler.d.ts +27 -0
- package/dist/core/stub-bundler.js +102 -0
- package/dist/core/worker-runner.d.ts +77 -0
- package/dist/core/worker-runner.js +295 -0
- package/dist/runtime/stub.d.ts +61 -0
- package/dist/runtime/stub.js +576 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import { bundleLambda } from "../../core/bundler";
|
|
|
9
9
|
import { packageLambda } from "../../core/packager";
|
|
10
10
|
import { generateManifest, writeManifest } from "../../core/manifest";
|
|
11
11
|
import { writeTerraformVars } from "../../core/terraform";
|
|
12
|
-
import { shouldGenerateOpenApi, writeOpenApiLambda,
|
|
12
|
+
import { shouldGenerateOpenApi, writeOpenApiLambda, } from "../../core/openapi";
|
|
13
13
|
import { createWrapperEntry } from "../../core/handler-wrapper";
|
|
14
14
|
import { getLambdaBundleName } from "../../core/naming";
|
|
15
15
|
import { ui, pc, formatDuration, formatSize } from "../ui";
|
|
@@ -53,6 +53,9 @@ export const buildCommand = defineCommand({
|
|
|
53
53
|
}
|
|
54
54
|
mkdirSync(outputDir, { recursive: true });
|
|
55
55
|
mkdirSync(terraformDir, { recursive: true });
|
|
56
|
+
// Create temp directory for generated files
|
|
57
|
+
const tempDir = join(outputDir, "__temp__");
|
|
58
|
+
mkdirSync(tempDir, { recursive: true });
|
|
56
59
|
// Get lambda files
|
|
57
60
|
let lambdaFiles = readdirSync(lambdasDir).filter((f) => f.endsWith(".ts") && !f.startsWith("__"));
|
|
58
61
|
if (lambdaFiles.length === 0) {
|
|
@@ -61,18 +64,19 @@ export const buildCommand = defineCommand({
|
|
|
61
64
|
}
|
|
62
65
|
// Generate OpenAPI aggregator if enabled
|
|
63
66
|
if (shouldGenerateOpenApi(config)) {
|
|
64
|
-
await writeOpenApiLambda(lambdaFiles, lambdasDir, config);
|
|
67
|
+
await writeOpenApiLambda(lambdaFiles, lambdasDir, config, tempDir);
|
|
65
68
|
lambdaFiles.push("__openapi__.ts");
|
|
66
69
|
}
|
|
67
70
|
// Build phase
|
|
68
71
|
ui.success(`Compiling ${lambdaFiles.length} lambdas...`);
|
|
69
|
-
const tempDir = join(outputDir, "__temp__");
|
|
70
|
-
mkdirSync(tempDir, { recursive: true });
|
|
71
72
|
const buildResults = [];
|
|
72
73
|
for (const file of lambdaFiles) {
|
|
73
74
|
const lambdaName = file.replace(/\.ts$/, "");
|
|
74
75
|
const bundleName = getLambdaBundleName(name, lambdaName);
|
|
75
|
-
|
|
76
|
+
// For OpenAPI, the source is in tempDir; for regular lambdas, it's in lambdasDir
|
|
77
|
+
const inputPath = file === "__openapi__.ts"
|
|
78
|
+
? join(tempDir, file)
|
|
79
|
+
: join(lambdasDir, file);
|
|
76
80
|
// Create wrapper entry that imports the original and exports handler
|
|
77
81
|
const wrapperPath = join(tempDir, `${lambdaName}-wrapper.ts`);
|
|
78
82
|
const wrapperContent = createWrapperEntry(inputPath);
|
|
@@ -87,10 +91,7 @@ export const buildCommand = defineCommand({
|
|
|
87
91
|
}
|
|
88
92
|
// Clean up temp directory
|
|
89
93
|
rmSync(tempDir, { recursive: true, force: true });
|
|
90
|
-
//
|
|
91
|
-
if (shouldGenerateOpenApi(config)) {
|
|
92
|
-
await cleanupOpenApiLambda(lambdasDir);
|
|
93
|
-
}
|
|
94
|
+
// No need to clean up OpenAPI file separately - it's in tempDir
|
|
94
95
|
// Package phase
|
|
95
96
|
ui.success("Packaging lambdas...");
|
|
96
97
|
const packageSizes = new Map();
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dev command -
|
|
2
|
+
* Dev command - Live mode using AppSync Events bridge
|
|
3
3
|
*/
|
|
4
4
|
export declare const devCommand: import("citty").CommandDef<{
|
|
5
|
-
"no-
|
|
5
|
+
"no-localstack": {
|
|
6
6
|
type: "boolean";
|
|
7
7
|
description: string;
|
|
8
8
|
default: false;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
verbose: {
|
|
11
11
|
type: "boolean";
|
|
12
|
+
alias: string;
|
|
12
13
|
description: string;
|
|
13
14
|
default: false;
|
|
14
15
|
};
|