@solcreek/adapter-creek 0.2.2 → 0.2.4
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/dist/build.js +13 -2
- package/dist/bundler.js +3 -2
- package/dist/compat.d.ts +21 -0
- package/dist/compat.js +21 -0
- package/dist/manifest.js +3 -2
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -340,8 +340,19 @@ export async function handleBuild(ctx) {
|
|
|
340
340
|
// exposes these per-output as `output.assets` (the result of file tracing).
|
|
341
341
|
// We embed them in __USER_FILES so the fs shim can serve them in workerd.
|
|
342
342
|
const userFiles = await collectUserFiles(ctx.outputs, ctx.distDir, ctx.projectDir);
|
|
343
|
-
|
|
344
|
-
|
|
343
|
+
const userFilePaths = Object.keys(userFiles).sort();
|
|
344
|
+
if (userFilePaths.length > 0) {
|
|
345
|
+
// List the paths: these are non-code files your routes read at runtime
|
|
346
|
+
// (file-traced from your code), embedded so the workerd fs shim can serve
|
|
347
|
+
// them. Listing them lets you spot anything unexpected (e.g. a stray .env).
|
|
348
|
+
console.log(` [Creek Adapter] ${userFilePaths.length} user data files embedded (files read at runtime via fs):`);
|
|
349
|
+
const SHOWN = 30;
|
|
350
|
+
for (const p of userFilePaths.slice(0, SHOWN)) {
|
|
351
|
+
console.log(` - ${p}`);
|
|
352
|
+
}
|
|
353
|
+
if (userFilePaths.length > SHOWN) {
|
|
354
|
+
console.log(` ... and ${userFilePaths.length - SHOWN} more`);
|
|
355
|
+
}
|
|
345
356
|
}
|
|
346
357
|
// Step 4: Generate worker entry
|
|
347
358
|
console.log(" [Creek Adapter] Scanning external modules...");
|
package/dist/bundler.js
CHANGED
|
@@ -12,6 +12,7 @@ import * as path from "node:path";
|
|
|
12
12
|
import { execFileSync } from "node:child_process";
|
|
13
13
|
import { builtinModules, createRequire } from "node:module";
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
|
+
import { WORKER_COMPATIBILITY_DATE, WORKER_COMPATIBILITY_FLAGS } from "./compat.js";
|
|
15
16
|
/**
|
|
16
17
|
* Resolve wrangler's CLI entry script through Node module resolution.
|
|
17
18
|
*
|
|
@@ -676,8 +677,8 @@ export async function bundleForWorkers(opts) {
|
|
|
676
677
|
const wranglerConfig = {
|
|
677
678
|
name: "creek-adapter-build",
|
|
678
679
|
main: entryPath,
|
|
679
|
-
compatibility_date:
|
|
680
|
-
compatibility_flags: [
|
|
680
|
+
compatibility_date: WORKER_COMPATIBILITY_DATE,
|
|
681
|
+
compatibility_flags: [...WORKER_COMPATIBILITY_FLAGS],
|
|
681
682
|
define: {
|
|
682
683
|
__dirname: '""',
|
|
683
684
|
__filename: '""',
|
package/dist/compat.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for the compatibility settings the generated
|
|
3
|
+
* worker is built AND deployed with.
|
|
4
|
+
*
|
|
5
|
+
* The Next.js worker statically imports node:http (server APIs). Per
|
|
6
|
+
* Cloudflare's Node.js docs, node:http is served by the umbrella
|
|
7
|
+
* `nodejs_compat` flag (NOT `nodejs_compat_v2`, which the docs no longer
|
|
8
|
+
* list and which WfP rejects for node:http). Its SERVER modules
|
|
9
|
+
* (`http.createServer`/`Server`/`ServerResponse`) are gated behind
|
|
10
|
+
* `enable_nodejs_http_server_modules`, auto-enabled only at
|
|
11
|
+
* compatibility_date >= 2025-09-01 (client APIs at 2025-08-15). This is why
|
|
12
|
+
* a 2025-03-14 deploy was rejected with "No such module node:http".
|
|
13
|
+
*
|
|
14
|
+
* The bundle step (bundler.ts) and the deploy manifest (manifest.ts) MUST
|
|
15
|
+
* agree: the worker is validated at upload against the date/flags it ships
|
|
16
|
+
* with, so the deploy must use exactly what the bundle was built against.
|
|
17
|
+
* Keep DATE >= 2025-09-01.
|
|
18
|
+
*/
|
|
19
|
+
export declare const WORKER_COMPATIBILITY_DATE = "2026-03-28";
|
|
20
|
+
export declare const WORKER_COMPATIBILITY_FLAGS: readonly string[];
|
|
21
|
+
//# sourceMappingURL=compat.d.ts.map
|
package/dist/compat.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for the compatibility settings the generated
|
|
3
|
+
* worker is built AND deployed with.
|
|
4
|
+
*
|
|
5
|
+
* The Next.js worker statically imports node:http (server APIs). Per
|
|
6
|
+
* Cloudflare's Node.js docs, node:http is served by the umbrella
|
|
7
|
+
* `nodejs_compat` flag (NOT `nodejs_compat_v2`, which the docs no longer
|
|
8
|
+
* list and which WfP rejects for node:http). Its SERVER modules
|
|
9
|
+
* (`http.createServer`/`Server`/`ServerResponse`) are gated behind
|
|
10
|
+
* `enable_nodejs_http_server_modules`, auto-enabled only at
|
|
11
|
+
* compatibility_date >= 2025-09-01 (client APIs at 2025-08-15). This is why
|
|
12
|
+
* a 2025-03-14 deploy was rejected with "No such module node:http".
|
|
13
|
+
*
|
|
14
|
+
* The bundle step (bundler.ts) and the deploy manifest (manifest.ts) MUST
|
|
15
|
+
* agree: the worker is validated at upload against the date/flags it ships
|
|
16
|
+
* with, so the deploy must use exactly what the bundle was built against.
|
|
17
|
+
* Keep DATE >= 2025-09-01.
|
|
18
|
+
*/
|
|
19
|
+
export const WORKER_COMPATIBILITY_DATE = "2026-03-28";
|
|
20
|
+
export const WORKER_COMPATIBILITY_FLAGS = ["nodejs_compat"];
|
|
21
|
+
//# sourceMappingURL=compat.js.map
|
package/dist/manifest.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import * as fs from "node:fs/promises";
|
|
8
8
|
import * as path from "node:path";
|
|
9
9
|
import { createRequire } from "node:module";
|
|
10
|
+
import { WORKER_COMPATIBILITY_DATE, WORKER_COMPATIBILITY_FLAGS } from "./compat.js";
|
|
10
11
|
const require = createRequire(import.meta.url);
|
|
11
12
|
const adapterPackage = require("../package.json");
|
|
12
13
|
export async function writeManifest(outputDir, opts) {
|
|
@@ -22,8 +23,8 @@ export async function writeManifest(outputDir, opts) {
|
|
|
22
23
|
entrypoint: opts.entrypoint,
|
|
23
24
|
serverFiles: opts.serverFiles,
|
|
24
25
|
assetDir: "assets",
|
|
25
|
-
compatibilityDate:
|
|
26
|
-
compatibilityFlags: [
|
|
26
|
+
compatibilityDate: WORKER_COMPATIBILITY_DATE,
|
|
27
|
+
compatibilityFlags: [...WORKER_COMPATIBILITY_FLAGS],
|
|
27
28
|
hasMiddleware: opts.hasMiddleware,
|
|
28
29
|
hasPrerender: opts.hasPrerender,
|
|
29
30
|
// Always inject DO bindings for Next.js SSR (ISR cache support)
|