@guren/plugin-cloudflare 0.7.0 → 0.8.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.
- package/README.md +2 -0
- package/dist/{build-DLJgpyN5.js → build-Bq9KODjL.js} +5 -0
- package/dist/commands.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,6 +18,8 @@ bunx wrangler deploy
|
|
|
18
18
|
|
|
19
19
|
`cloudflare:build` runs your app's `build` script, then assembles a `.cloudflare/` directory containing the worker entry, static assets for Workers Static Assets, and flattened D1 migrations. It is generated output — add it to `.gitignore` and rebuild before every deploy.
|
|
20
20
|
|
|
21
|
+
Before the app build it runs the deploy-runtime checks `guren doctor` reports and warns, without failing, when sessions or OAuth state would sit in process memory, a `ScryptHasher` is constructed, or providers are discovered from the filesystem. Each works locally and breaks on Workers, and the warning prints where you are still reading rather than after the Vite output.
|
|
22
|
+
|
|
21
23
|
## API
|
|
22
24
|
|
|
23
25
|
- **`createWorkersHandler(app)`** — wraps a Guren `Application` in a Workers module handler. Boot is lazy and deduplicated on the first request, because `boot()` performs I/O that workerd forbids in global scope. The handler deduplicates boot itself, so boot-once holds for anything matching `WorkersAppLike`, not only Guren's `Application`. It also exposes `boot(env)`, for an entrypoint that holds `env` but no request — an agent Durable Object woken by an alarm. The latch behind both is `bootWorkersApp(app, env)` / `bootAndFetch(app, request, env, ctx)`, keyed on the app.
|
|
@@ -2,6 +2,7 @@ import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statS
|
|
|
2
2
|
import { join, relative, resolve, sep } from "node:path";
|
|
3
3
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
4
|
import { AGENTS_CONFIG_FILE, DEV_ONLY_MODULES, DOCUMENT_ASSET_EXTENSIONS, DOCUMENT_ASSET_HEADERS, MCP_PLUGIN_PACKAGE, MCP_TRANSPORT_SPECIFIER, SQL_CLIENT_MODULES, appUsesMcpPlugin, assertOutputDirOutsideRoot, clientManifestJson, importSpecifier, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, stageStaticAssets, stubbableDevOnlyModules } from "@guren/core/internal/deploy-build";
|
|
5
|
+
import { reportDeployRuntimeHazards } from "@guren/core/internal/deploy-check";
|
|
5
6
|
//#region src/templates.ts
|
|
6
7
|
/**
|
|
7
8
|
* The OAuth consent flow this plugin scaffolds, shipped as real sources under
|
|
@@ -66,6 +67,10 @@ async function buildCloudflareOutput(options = {}) {
|
|
|
66
67
|
const agents = hostsAgents ? await readAgentRegistry(root) : NO_AGENTS;
|
|
67
68
|
const agentBindings = assertAgentDurableObjects(root, agents.exports);
|
|
68
69
|
warnUnroutedAgents(agents);
|
|
70
|
+
await reportDeployRuntimeHazards({
|
|
71
|
+
root,
|
|
72
|
+
label: "Cloudflare build"
|
|
73
|
+
});
|
|
69
74
|
if (!options.skipAppBuild) runAppBuild(root, packageJson.scripts ?? {});
|
|
70
75
|
if (!existsSync(appEntry)) throw new Error(`Cloudflare build: app entry not found at ${appEntry}. Pass "appEntry" if your Application lives elsewhere.`);
|
|
71
76
|
const ssrImport = await resolveSsrImport(ssrDir, ssrEntryKey);
|
package/dist/commands.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { captureWorkersEnv, getWorkersEnv, isWorkersRuntime, resetWorkersEnv } from "./env.js";
|
|
2
|
-
import { n as flattenD1Migrations, t as buildCloudflareOutput } from "./build-
|
|
2
|
+
import { n as flattenD1Migrations, t as buildCloudflareOutput } from "./build-Bq9KODjL.js";
|
|
3
3
|
import { definePlugin } from "@guren/core";
|
|
4
4
|
//#region src/boot.ts
|
|
5
5
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guren/plugin-cloudflare",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"typecheck": "tsc --noEmit"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@guren/core": "^1.
|
|
49
|
+
"@guren/core": "^1.15.0",
|
|
50
50
|
"citty": "^0.1.6"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|