@actuallyjamez/elysian 0.5.0 → 0.5.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.
|
@@ -85,18 +85,18 @@ export const buildCommand = defineCommand({
|
|
|
85
85
|
mkdirSync(tempDir, { recursive: true });
|
|
86
86
|
const buildResults = [];
|
|
87
87
|
for (const file of lambdaFiles) {
|
|
88
|
-
const
|
|
89
|
-
const bundleName = getLambdaBundleName(name,
|
|
88
|
+
const lambdaName = file.replace(/\.ts$/, "");
|
|
89
|
+
const bundleName = getLambdaBundleName(name, lambdaName);
|
|
90
90
|
const inputPath = join(lambdasDir, file);
|
|
91
91
|
// Create wrapper entry that imports the original and exports handler
|
|
92
|
-
const wrapperPath = join(tempDir, `${
|
|
92
|
+
const wrapperPath = join(tempDir, `${lambdaName}-wrapper.ts`);
|
|
93
93
|
const wrapperContent = createWrapperEntry(inputPath);
|
|
94
94
|
await Bun.write(wrapperPath, wrapperContent);
|
|
95
95
|
// Bundle the wrapper with prefixed name
|
|
96
96
|
const result = await bundleLambda(bundleName, wrapperPath, outputDir, config);
|
|
97
|
-
buildResults.push({ ...result, name, bundleName });
|
|
97
|
+
buildResults.push({ ...result, name: lambdaName, bundleName });
|
|
98
98
|
if (!result.success) {
|
|
99
|
-
console.log(` ${pc.red("✗")} Failed to build ${
|
|
99
|
+
console.log(` ${pc.red("✗")} Failed to build ${lambdaName}: ${result.error}`);
|
|
100
100
|
process.exit(1);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -111,19 +111,19 @@ export const buildCommand = defineCommand({
|
|
|
111
111
|
console.log(` ${pc.green("✓")} Packaging lambdas...`);
|
|
112
112
|
const packageSizes = new Map();
|
|
113
113
|
for (const file of lambdaFiles) {
|
|
114
|
-
const
|
|
115
|
-
const bundleName = getLambdaBundleName(name,
|
|
114
|
+
const lambdaName = file.replace(/\.ts$/, "");
|
|
115
|
+
const bundleName = getLambdaBundleName(name, lambdaName);
|
|
116
116
|
const jsPath = join(outputDir, `${bundleName}.js`);
|
|
117
117
|
const result = await packageLambda(bundleName, jsPath, outputDir);
|
|
118
118
|
if (!result.success) {
|
|
119
|
-
console.log(` ${pc.red("✗")} Failed to package ${
|
|
119
|
+
console.log(` ${pc.red("✗")} Failed to package ${lambdaName}: ${result.error}`);
|
|
120
120
|
process.exit(1);
|
|
121
121
|
}
|
|
122
122
|
// Get zip size (store by original name for display)
|
|
123
123
|
const zipPath = join(outputDir, `${bundleName}.zip`);
|
|
124
124
|
const stat = await Bun.file(zipPath).stat();
|
|
125
125
|
if (stat) {
|
|
126
|
-
packageSizes.set(
|
|
126
|
+
packageSizes.set(lambdaName, stat.size);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
// Generate manifest
|
|
@@ -87,7 +87,7 @@ export const initCommand = defineCommand({
|
|
|
87
87
|
const pm = answers.packageManager;
|
|
88
88
|
const runCmd = pm === "npm" ? "npm run" : pm;
|
|
89
89
|
// If we created in a subdirectory, tell user to cd into it
|
|
90
|
-
const cdStep = targetDir !== "." ? `cd ${targetDir}\n
|
|
90
|
+
const cdStep = targetDir !== "." ? `cd ${targetDir}\n` : "";
|
|
91
91
|
console.log(` ${pc.green("✓")} Project initialized!`);
|
|
92
92
|
console.log();
|
|
93
93
|
console.log(` ${pc.bold("Next steps")}:`);
|