@guren/plugin-lambda 0.2.1 → 0.3.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.
@@ -1,7 +1,7 @@
1
1
  import { n as LAMBDA_HANDLER_MODULE, t as LAMBDA_HANDLER_EXPORTS } from "./handlers-CkWGWQQX.js";
2
2
  import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
3
  import { resolve } from "node:path";
4
- import { DEV_ONLY_MODULES, MCP_SDK_SUBPATH_PREFIX, assertOutputDirOutsideRoot, importSpecifier, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, stageStaticAssets, unusedSqlClients } from "@guren/core/internal/deploy-build";
4
+ import { DEV_ONLY_MODULES, MCP_SDK_SUBPATH_PREFIX, assertOutputDirOutsideRoot, clientManifestJson, importSpecifier, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, stageStaticAssets, unusedSqlClients } from "@guren/core/internal/deploy-build";
5
5
  //#region src/build.ts
6
6
  const MCP_UNAVAILABLE = "The MCP endpoint is unavailable on AWS Lambda — it generates files on disk.";
7
7
  /**
@@ -91,11 +91,16 @@ async function buildLambdaOutput(options = {}) {
91
91
  mkdirSync(funcDir, { recursive: true });
92
92
  stageStaticAssets(publicDir, resolve(out, "assets"));
93
93
  const env = buildLambdaEnvironment(assetEnv, ssrFile, ssrDir);
94
+ const viteManifest = clientManifestJson(publicDir);
95
+ const bakedEnv = viteManifest ? {
96
+ ...env,
97
+ GUREN_VITE_MANIFEST: viteManifest
98
+ } : env;
94
99
  const wrapperPath = resolve(out, `${LAMBDA_HANDLER_MODULE}.ts`);
95
100
  writeFileSync(wrapperPath, renderHandlerModule({
96
101
  out,
97
102
  entrypoint,
98
- env
103
+ env: bakedEnv
99
104
  }));
100
105
  await bundleHandler(wrapperPath, funcDir, stubsFor(root, options.databaseDialects));
101
106
  writeFileSync(resolve(funcDir, "package.json"), `${JSON.stringify({ type: "module" }, null, 2)}\n`);
package/dist/commands.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as buildLambdaOutput } from "./build-56qBHosh.js";
1
+ import { t as buildLambdaOutput } from "./build-BYE_vKGQ.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-CkWGWQQX.js";
2
- import { t as buildLambdaOutput } from "./build-56qBHosh.js";
2
+ import { t as buildLambdaOutput } from "./build-BYE_vKGQ.js";
3
3
  import { definePlugin } from "@guren/core";
4
4
  //#region src/index.ts
5
5
  const factory = definePlugin({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/plugin-lambda",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  "typecheck": "tsc --noEmit"
46
46
  },
47
47
  "dependencies": {
48
- "@guren/core": "^1.8.1",
48
+ "@guren/core": "^1.10.0",
49
49
  "citty": "^0.1.6"
50
50
  },
51
51
  "peerDependencies": {