@guren/plugin-lambda 0.7.1 → 0.7.2

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.
@@ -1,7 +1,7 @@
1
1
  import { n as LAMBDA_HANDLER_MODULE, t as LAMBDA_HANDLER_EXPORTS } from "./handlers-Dtt3k5Ue.js";
2
2
  import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
3
  import { resolve } from "node:path";
4
- import { DEV_ONLY_MODULES, assertOutputDirOutsideRoot, bundledRuntimeEnv, importSpecifier, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, stageStaticAssets, unusedSqlClients } from "@guren/core/internal/deploy-build";
4
+ import { BUN_DEPLOY_MINIFY, DEV_ONLY_MODULES, assertOutputDirOutsideRoot, bundledRuntimeEnv, importSpecifier, renderDevOnlyStub, reportRenamedNameKeyedClasses, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, stageStaticAssets, unusedSqlClients } from "@guren/core/internal/deploy-build";
5
5
  import { reportDeployRuntimeHazards } from "@guren/core/internal/deploy-check";
6
6
  //#region src/build.ts
7
7
  /**
@@ -86,7 +86,7 @@ async function buildLambdaOutput(options = {}) {
86
86
  entrypoint,
87
87
  env: bakedEnv
88
88
  }));
89
- await bundleHandler(wrapperPath, funcDir, stubsFor(root, options.databaseDialects));
89
+ await bundleHandler(wrapperPath, funcDir, stubsFor(root, options.databaseDialects), root);
90
90
  writeFileSync(resolve(funcDir, "package.json"), `${JSON.stringify({ type: "module" }, null, 2)}\n`);
91
91
  if (ssrFile) cpSync(ssrDir, resolve(funcDir, ".guren/ssr"), { recursive: true });
92
92
  if (existsSync(migrationsDir)) cpSync(migrationsDir, resolve(funcDir, "db/migrations"), { recursive: true });
@@ -117,18 +117,15 @@ function renderHandlerModule(input) {
117
117
  lines.push("");
118
118
  return lines.join("\n");
119
119
  }
120
- async function bundleHandler(handlerEntry, funcDir, stubs) {
120
+ async function bundleHandler(handlerEntry, funcDir, stubs, root) {
121
121
  const filter = stubFilter(stubs);
122
122
  const result = await Bun.build({
123
123
  entrypoints: [handlerEntry],
124
124
  throw: false,
125
125
  outdir: funcDir,
126
126
  target: "node",
127
- minify: {
128
- whitespace: true,
129
- syntax: true,
130
- identifiers: false
131
- },
127
+ minify: BUN_DEPLOY_MINIFY,
128
+ metafile: true,
132
129
  define: {
133
130
  "process.env.NODE_ENV": "\"production\"",
134
131
  "import.meta.url": "\"file:///var/task/config/lambda.js\""
@@ -155,6 +152,10 @@ async function bundleHandler(handlerEntry, funcDir, stubs) {
155
152
  const details = result.logs.map((log) => String(log)).join("\n");
156
153
  throw new Error(`Lambda build: bun build failed.\n${details}`);
157
154
  }
155
+ await reportRenamedNameKeyedClasses(result, {
156
+ root,
157
+ label: "Lambda build"
158
+ });
158
159
  }
159
160
  function zipFunction(out, funcDir) {
160
161
  if (Bun.spawnSync({
package/dist/commands.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as buildLambdaOutput } from "./build-Dc1x5-hH.js";
1
+ import { t as buildLambdaOutput } from "./build-7sNA3uo6.js";
2
2
  import { DATABASE_DIALECTS, parseDatabaseDialects } from "@guren/core/internal/deploy-build";
3
3
  import { defineCommand } from "citty";
4
4
  var commands_default = { "lambda:build": defineCommand({
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as LAMBDA_HANDLER_MODULE, r as lambdaHandlerId, t as LAMBDA_HANDLER_EXPORTS } from "./handlers-Dtt3k5Ue.js";
2
- import { t as buildLambdaOutput } from "./build-Dc1x5-hH.js";
2
+ import { t as buildLambdaOutput } from "./build-7sNA3uo6.js";
3
3
  import { definePlugin } from "@guren/core";
4
4
  //#region src/session/dynamodb-store.ts
5
5
  var DynamoDbSessionStore = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/plugin-lambda",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Deploy a Guren application to AWS Lambda on the Node.js runtime, with a CDK construct for the infrastructure.",
5
5
  "keywords": [
6
6
  "guren",
@@ -66,7 +66,7 @@
66
66
  "typecheck": "tsc --noEmit"
67
67
  },
68
68
  "dependencies": {
69
- "@guren/core": "^1.20.1",
69
+ "@guren/core": "^1.21.0",
70
70
  "citty": "^0.1.6"
71
71
  },
72
72
  "peerDependencies": {