@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.
@@ -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, cleanupOpenApiLambda, } from "../../core/openapi";
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
- const inputPath = join(lambdasDir, file);
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
- // Clean up generated OpenAPI file
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 - Watch mode with LocalStack integration
2
+ * Dev command - Live mode using AppSync Events bridge
3
3
  */
4
4
  export declare const devCommand: import("citty").CommandDef<{
5
- "no-package": {
5
+ "no-localstack": {
6
6
  type: "boolean";
7
7
  description: string;
8
8
  default: false;
9
9
  };
10
- "no-localstack": {
10
+ verbose: {
11
11
  type: "boolean";
12
+ alias: string;
12
13
  description: string;
13
14
  default: false;
14
15
  };