@guren/plugin-vercel 0.5.1 → 0.6.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.
- package/README.md +2 -0
- package/dist/index.js +8 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -16,6 +16,8 @@ bun run vercel:build
|
|
|
16
16
|
vercel deploy --prebuilt
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
Before writing any output, `vercel:build` runs the deploy-runtime checks `guren doctor` reports and warns, without failing, on an in-memory session or OAuth store, a Bun-only password hasher (`Argon2Hasher`, `hasher: 'argon2'`, or `new Hash({ algorithm: 'argon2' })`), or filesystem provider discovery — each works locally and breaks across function invocations.
|
|
20
|
+
|
|
19
21
|
## API
|
|
20
22
|
|
|
21
23
|
- **`createVercelHandler(app)`** — boots a Guren `Application` and returns a `fetch` handler for the serverless function.
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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 { DOCUMENT_ASSET_EXTENSIONS, DOCUMENT_ASSET_HEADERS, MCP_SDK_SUBPATH_PREFIX, appUsesMcpPlugin, assertOutputDirOutsideRoot,
|
|
4
|
+
import { DOCUMENT_ASSET_EXTENSIONS, DOCUMENT_ASSET_HEADERS, MCP_SDK_SUBPATH_PREFIX, appUsesMcpPlugin, assertOutputDirOutsideRoot, bundledRuntimeEnv, removeShadowingIndex, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, stubbableDevOnlyModules, unusedSqlClients } from "@guren/core/internal/deploy-build";
|
|
5
|
+
import { reportDeployRuntimeHazards } from "@guren/core/internal/deploy-check";
|
|
5
6
|
//#region src/index.ts
|
|
6
7
|
/** Prefixes every diagnostic this build emits. */
|
|
7
8
|
const LABEL = "Vercel build";
|
|
@@ -31,6 +32,10 @@ async function buildVercelOutput(options = {}) {
|
|
|
31
32
|
const migrationsDir = resolvePathLike(options.migrationsDir ?? resolve(root, "db/migrations"));
|
|
32
33
|
assertOutputDirOutsideRoot(out, root, LABEL);
|
|
33
34
|
if (!existsSync(entrypoint)) throw new Error(`${LABEL}: entrypoint not found at ${entrypoint}. Run \`bunx guren plugin @guren/plugin-vercel\` to scaffold src/vercel.ts, or pass "entrypoint".`);
|
|
35
|
+
await reportDeployRuntimeHazards({
|
|
36
|
+
root,
|
|
37
|
+
label: LABEL
|
|
38
|
+
});
|
|
34
39
|
const env = buildVercelEnvironment(publicDir, ssrDir);
|
|
35
40
|
resetOutputDir(out, root, LABEL);
|
|
36
41
|
mkdirSync(funcDir, { recursive: true });
|
|
@@ -67,7 +72,7 @@ async function buildVercelOutput(options = {}) {
|
|
|
67
72
|
funcDir,
|
|
68
73
|
root,
|
|
69
74
|
dialects: options.databaseDialects,
|
|
70
|
-
|
|
75
|
+
bundledEnv: bundledRuntimeEnv(root, publicDir, LABEL)
|
|
71
76
|
});
|
|
72
77
|
if (existsSync(ssrDir)) cpSync(ssrDir, resolve(funcDir, ".guren/ssr"), { recursive: true });
|
|
73
78
|
if (existsSync(migrationsDir)) cpSync(migrationsDir, resolve(funcDir, "db/migrations"), { recursive: true });
|
|
@@ -158,7 +163,7 @@ async function bundleFunction(input) {
|
|
|
158
163
|
},
|
|
159
164
|
define: {
|
|
160
165
|
"process.env.NODE_ENV": "\"production\"",
|
|
161
|
-
...input.
|
|
166
|
+
...Object.fromEntries(Object.entries(input.bundledEnv).map(([key, value]) => [`process.env.${key}`, JSON.stringify(value)]))
|
|
162
167
|
},
|
|
163
168
|
plugins: [{
|
|
164
169
|
name: "guren-vercel-stubs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guren/plugin-vercel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
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.
|
|
38
|
+
"@guren/core": "^1.19.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^20.14.10",
|