@guren/plugin-vercel 0.3.1 → 0.4.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.
Files changed (2) hide show
  1. package/dist/index.js +7 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { cpSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
2
2
  import { basename, extname, resolve } from "node:path";
3
3
  import { definePlugin } from "@guren/core";
4
- import { DEV_ONLY_MODULES, MCP_SDK_SUBPATH_PREFIX, assertOutputDirOutsideRoot, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, unusedSqlClients } from "@guren/core/internal/deploy-build";
4
+ import { DEV_ONLY_MODULES, MCP_SDK_SUBPATH_PREFIX, assertOutputDirOutsideRoot, clientManifestJson, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, unusedSqlClients } from "@guren/core/internal/deploy-build";
5
5
  //#region src/index.ts
6
6
  /** Prefixes every diagnostic this build emits. */
7
7
  const LABEL = "Vercel build";
@@ -67,7 +67,8 @@ async function buildVercelOutput(options = {}) {
67
67
  entrypoint,
68
68
  funcDir,
69
69
  root,
70
- dialects: options.databaseDialects
70
+ dialects: options.databaseDialects,
71
+ viteManifest: clientManifestJson(publicDir)
71
72
  });
72
73
  if (existsSync(ssrDir)) cpSync(ssrDir, resolve(funcDir, ".guren/ssr"), { recursive: true });
73
74
  if (existsSync(migrationsDir)) cpSync(migrationsDir, resolve(funcDir, "db/migrations"), { recursive: true });
@@ -149,7 +150,10 @@ async function bundleFunction(input) {
149
150
  syntax: true,
150
151
  identifiers: false
151
152
  },
152
- define: { "process.env.NODE_ENV": "\"production\"" },
153
+ define: {
154
+ "process.env.NODE_ENV": "\"production\"",
155
+ ...input.viteManifest ? { "process.env.GUREN_VITE_MANIFEST": JSON.stringify(input.viteManifest) } : {}
156
+ },
153
157
  plugins: [{
154
158
  name: "guren-vercel-stubs",
155
159
  setup(build) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/plugin-vercel",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "typecheck": "tsc --noEmit"
36
36
  },
37
37
  "dependencies": {
38
- "@guren/core": "^1.8.1"
38
+ "@guren/core": "^1.10.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^20.14.10",