@solcreek/adapter-creek 0.1.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/LICENSE +190 -0
- package/README.md +184 -0
- package/dist/build.d.ts +57 -0
- package/dist/build.js +1382 -0
- package/dist/bundler.d.ts +20 -0
- package/dist/bundler.js +991 -0
- package/dist/cache-handler.d.ts +32 -0
- package/dist/cache-handler.js +100 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +247 -0
- package/dist/manifest.d.ts +40 -0
- package/dist/manifest.js +27 -0
- package/dist/worker-entry.d.ts +133 -0
- package/dist/worker-entry.js +7734 -0
- package/package.json +64 -0
- package/src/shims/als-polyfill.js +7 -0
- package/src/shims/critters.js +7 -0
- package/src/shims/empty.js +2 -0
- package/src/shims/env.js +3 -0
- package/src/shims/fast-set-immediate.js +285 -0
- package/src/shims/fs.js +225 -0
- package/src/shims/http.js +240 -0
- package/src/shims/image-optimizer.js +18 -0
- package/src/shims/load-manifest.js +123 -0
- package/src/shims/opentelemetry.js +229 -0
- package/src/shims/sharp.js +12 -0
- package/src/shims/sqlite3-binding.js +517 -0
- package/src/shims/track-module-loading.js +68 -0
- package/src/shims/vm.js +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 SolCreek, Inc.
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# adapter-creek
|
|
2
|
+
|
|
3
|
+
Next.js deployment adapter for [Creek](https://creek.dev).
|
|
4
|
+
|
|
5
|
+
## What is Creek?
|
|
6
|
+
|
|
7
|
+
Creek is an open-source edge deployment platform built on [Cloudflare Workers for Platforms](https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/). It provides a managed infrastructure layer so you can deploy full-stack apps to the edge without managing Cloudflare resources directly.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx creek deploy
|
|
11
|
+
# Live in seconds → https://my-app-acme.bycreek.com
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Creek handles: multi-tenant isolation, preview URLs, custom domains, environment variables, DO bindings, static asset hosting, team management, and AI agent integration (MCP server) — all through a single CLI or API.
|
|
15
|
+
|
|
16
|
+
## Why adapter-creek?
|
|
17
|
+
|
|
18
|
+
This adapter implements the Next.js 16.2+ `NextAdapter` interface to deploy Next.js apps through Creek's infrastructure. It bundles build output directly for Cloudflare Workers.
|
|
19
|
+
|
|
20
|
+
**Creek vs. self-hosting with Cloudflare + opennext:**
|
|
21
|
+
|
|
22
|
+
| | Creek | Cloudflare + opennext |
|
|
23
|
+
|--|-------|----------------------|
|
|
24
|
+
| Deploy | `creek deploy` (one command) | wrangler.toml + opennext build + wrangler deploy |
|
|
25
|
+
| Config | Zero-config (auto-detect) | Manual wrangler.toml + open-next.config.ts |
|
|
26
|
+
| CF account | Not needed | Required (your own account) |
|
|
27
|
+
| Preview URLs | Automatic per-deploy | DIY routing |
|
|
28
|
+
| Custom domains | `creek domains add` | CF Dashboard + manual DNS |
|
|
29
|
+
| DO for ISR | Auto-injected | Manual setup + migration management |
|
|
30
|
+
| Env variables | Encrypted, `creek env set` | wrangler.toml or CF Dashboard |
|
|
31
|
+
| Teams / RBAC | Built-in | None |
|
|
32
|
+
| Adapter updates | Creek team maintains | You maintain opennext patches |
|
|
33
|
+
| Build pipeline | Adapter API (typed) | 8-step workaround chain |
|
|
34
|
+
|
|
35
|
+
Creek is a **platform** — this adapter is the bridge between Next.js and that platform. opennext is a **tool** for self-hosting on your own CF account.
|
|
36
|
+
|
|
37
|
+
## Status
|
|
38
|
+
|
|
39
|
+
Near-complete Next.js coverage on Cloudflare Workers. Single entry in the skip manifest is an upstream Turbopack canary regression, unrelated to the adapter.
|
|
40
|
+
|
|
41
|
+
| Feature | Status |
|
|
42
|
+
|---------|:------:|
|
|
43
|
+
| Static pages / SSG | ✅ |
|
|
44
|
+
| SSR (progressive streaming) | ✅ |
|
|
45
|
+
| Middleware (edge + node runtimes) | ✅ |
|
|
46
|
+
| Server Actions | ✅ |
|
|
47
|
+
| App Router incl. PPR / `'use cache'` | ✅ |
|
|
48
|
+
| ISR, tag / path revalidation | ✅ (Durable-Objects-backed) |
|
|
49
|
+
| Image Optimization | ✅ CF Image Resizing |
|
|
50
|
+
| `@vercel/og` (node + edge) | ✅ WASM-path |
|
|
51
|
+
| `sqlite3` native-addon packages | ✅ transparent sql.js shim |
|
|
52
|
+
| Multi-runtime isolation (opt-in) | ✅ `CREEK_MULTI_WORKER=1` |
|
|
53
|
+
| Next.js e2e deploy suite | ~99% of in-scope tests |
|
|
54
|
+
|
|
55
|
+
## Requirements
|
|
56
|
+
|
|
57
|
+
- Next.js ≥ 16.2
|
|
58
|
+
- Turbopack (default) or Webpack via `--webpack`
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
The adapter is used automatically when deploying with Creek:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npx creek deploy
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For manual use, set `NEXT_ADAPTER_PATH`:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
NEXT_ADAPTER_PATH=@solcreek/adapter-creek npx next build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Or configure in `next.config.js`:
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
module.exports = {
|
|
78
|
+
adapterPath: require.resolve('@solcreek/adapter-creek'),
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Output goes to `.creek/adapter-output/`:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
.creek/adapter-output/
|
|
86
|
+
assets/ — static files (WfP Static Assets API)
|
|
87
|
+
server/worker.js — bundled CF Workers entry (single-worker mode)
|
|
88
|
+
server/wrangler.toml — bindings, DOs, nodejs_compat flags
|
|
89
|
+
manifest.json — deploy metadata
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Opt-in multi-worker mode (enterprise-tier)
|
|
93
|
+
|
|
94
|
+
`CREEK_MULTI_WORKER=1` switches the build to a 3-worker topology with runtime-label-aware dispatch — the same shape Vercel uses for its per-runtime deployment model. Unlocks Node-runtime × Edge-runtime isolation inside a single Creek deploy without losing the `env.*` bindings that Next.js expects.
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
.creek/adapter-output/
|
|
98
|
+
dispatcher/worker.js — route → runtime map + service-binding fan-out
|
|
99
|
+
node-runtime/worker.js — nodejs handlers
|
|
100
|
+
edge-runtime/worker.js — edge handlers
|
|
101
|
+
assets/ …
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## How It Works
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
next build (Turbopack by default, Webpack via --webpack)
|
|
108
|
+
→ modifyConfig
|
|
109
|
+
• `outputFileTracingRoot` (monorepo aware)
|
|
110
|
+
• `cacheMaxMemorySize: 0` (we ship a DO-backed IncrementalCache)
|
|
111
|
+
• `maxPostponedStateSize: 20mb` (workerd-safe PPR fallback size)
|
|
112
|
+
|
|
113
|
+
→ onBuildComplete
|
|
114
|
+
1. Collect static files from typed outputs
|
|
115
|
+
2. Embed .next/ manifests (JSON + JS, base64-safe)
|
|
116
|
+
3. Seed ISR/`'use cache'` entries (composable cache handler in-bundle)
|
|
117
|
+
4. Bundle `.sqlite` fixtures via Next.js's file trace
|
|
118
|
+
5. Generate the worker entry
|
|
119
|
+
- middleware + `@next/routing` resolveRoutes
|
|
120
|
+
- streaming HTML with `Content-Encoding: identity` pin
|
|
121
|
+
(stops miniflare's edge-sim from bulk-gzipping progressive chunks)
|
|
122
|
+
- edge/node dispatch via `_ENTRIES` registry
|
|
123
|
+
- same-origin `fetch()` coalescer for RSC chunk-count fidelity
|
|
124
|
+
- `IncomingMessage` / `ServerResponse` bridge
|
|
125
|
+
6. Post-process Turbopack output
|
|
126
|
+
- hard-resolve `[externals]*.js` lazy-requires
|
|
127
|
+
- collect ssr/ lazy-require aliases → wrangler `alias` map
|
|
128
|
+
- (preserves module identity; no source rewrite of ssr/ chunks)
|
|
129
|
+
7. esbuild + workerd bundle via `wrangler --dry-run`
|
|
130
|
+
8. Write `.creek/adapter-output/` + deploy manifest
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Side systems plugged in for specific Next.js features:
|
|
134
|
+
|
|
135
|
+
- **`@solcreek/adapter-creek` sqlite3 shim** — post-install patch at `scripts/patch-node-modules-sqlite3.mjs` replaces `node_modules/sqlite3`'s native binding with a sql.js-backed drop-in so user code that imports `sqlite3` builds and runs on workerd. Same-API, WASM-path.
|
|
136
|
+
- **Content-Encoding: identity on FL-compressed types** — labels text/html / text/plain / JSON / RSC streams so miniflare's edge-simulator doesn't collapse progressive chunks into a single gzipped blob. Real CF edge still re-compresses at the byte-stream level in production.
|
|
137
|
+
|
|
138
|
+
## Testing
|
|
139
|
+
|
|
140
|
+
This adapter runs the [Next.js adapter test suite](https://nextjs.org/docs/app/api-reference/config/next-config-js/adapterPath#testing-adapters) against the real workerd runtime via [miniflare](https://miniflare.dev/) embedded in-process (not `wrangler dev` spawning a subprocess).
|
|
141
|
+
|
|
142
|
+
Each adapter tests against its own target runtime:
|
|
143
|
+
|
|
144
|
+
| Adapter | Test runtime |
|
|
145
|
+
|---------|-------------|
|
|
146
|
+
| adapter-vercel | Node.js (`next start`) |
|
|
147
|
+
| adapter-bun | Bun (`bun serve`) |
|
|
148
|
+
| **adapter-creek** | **CF Workers via miniflare** |
|
|
149
|
+
|
|
150
|
+
This ensures test results reflect real workerd behaviour — `nodejs_compat` boundaries, V8 isolate limits, chunked transfer semantics — not a Node.js approximation.
|
|
151
|
+
|
|
152
|
+
### Harness scripts
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
scripts/e2e-deploy.sh # Build + start miniflare, print localhost URL
|
|
156
|
+
scripts/e2e-logs.sh # Return BUILD_ID, DEPLOYMENT_ID, server logs
|
|
157
|
+
scripts/e2e-cleanup.sh # Stop the miniflare process + its children
|
|
158
|
+
scripts/worker-dev-server-miniflare.mjs # single-worker launcher (default)
|
|
159
|
+
scripts/multi-worker-dev.mjs # 3-worker launcher (CREEK_MULTI_WORKER=1)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Running locally
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Clone the Next.js repo alongside this adapter
|
|
166
|
+
git clone --depth 25 --branch canary https://github.com/vercel/next.js nextjs
|
|
167
|
+
cd nextjs && pnpm install && pnpm build && pnpm install
|
|
168
|
+
pnpm playwright install chromium
|
|
169
|
+
|
|
170
|
+
# Single test, default single-worker mode
|
|
171
|
+
./scripts/local-test.sh test/e2e/app-dir/actions/app-action.test.ts
|
|
172
|
+
|
|
173
|
+
# Opt-in multi-worker mode
|
|
174
|
+
CREEK_MULTI_WORKER=1 ./scripts/local-test.sh test/e2e/app-dir/actions/app-action.test.ts
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### CI
|
|
178
|
+
|
|
179
|
+
- `.github/workflows/checks.yml` — PR + push on main; typecheck, unit tests, build
|
|
180
|
+
- `.github/workflows/test-e2e-deploy.yml` — workflow_dispatch; full 16-way e2e matrix against canary Next.js
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
Apache 2.0
|
package/dist/build.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core build handler for Creek's Next.js adapter.
|
|
3
|
+
*
|
|
4
|
+
* Called by Next.js after build completes via onBuildComplete().
|
|
5
|
+
* With --webpack, .next/server/ contains standard CJS that esbuild
|
|
6
|
+
* can bundle directly (unlike Turbopack's custom chunked format).
|
|
7
|
+
*
|
|
8
|
+
* Note: onBuildComplete runs BEFORE standalone output is generated
|
|
9
|
+
* (Next.js source: build/index.js:2544-2581), so we cannot rely on
|
|
10
|
+
* .next/standalone/. Instead we import directly from .next/server/.
|
|
11
|
+
*/
|
|
12
|
+
import type { NextAdapter } from "next";
|
|
13
|
+
type BuildContext = Parameters<NonNullable<NextAdapter["onBuildComplete"]>>[0];
|
|
14
|
+
export declare function handleBuild(ctx: BuildContext): Promise<void>;
|
|
15
|
+
/** Prerender entry for ISR cache seeding */
|
|
16
|
+
export interface PrerenderEntry {
|
|
17
|
+
pathname: string;
|
|
18
|
+
html: string;
|
|
19
|
+
postponedState?: string;
|
|
20
|
+
allowsFallbackShellResume?: boolean;
|
|
21
|
+
initialRevalidate?: number | false;
|
|
22
|
+
initialStatus?: number;
|
|
23
|
+
initialHeaders?: Record<string, string | string[]>;
|
|
24
|
+
initialExpiration?: number;
|
|
25
|
+
pprHeaders?: Record<string, string>;
|
|
26
|
+
lastModified?: number;
|
|
27
|
+
segmentPaths?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* Headers captured from the `.meta` sidecar file next to the prerendered
|
|
30
|
+
* HTML (e.g. `.next/server/app/index.meta`). `initialHeaders` comes from
|
|
31
|
+
* `prerender-manifest.json` and *does not* include the `x-next-cache-tags`
|
|
32
|
+
* entry for cacheComponents routes — those tags are only written to the
|
|
33
|
+
* per-route `.meta` file. Without reading them, our runtime tag-staleness
|
|
34
|
+
* check (`__CREEK_TAG_INVALIDATED_AT` ∩ `staticEntry.cacheTags`) never
|
|
35
|
+
* fires for cacheComponents pages, so `revalidateTag` silently fails.
|
|
36
|
+
*/
|
|
37
|
+
metaHeaders?: Record<string, string | string[]>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A single \`'use cache'\` entry extracted at build time from a prerender's
|
|
41
|
+
* embedded renderResumeDataCache. Mirrors Next.js's UseCacheCacheStoreSerialized
|
|
42
|
+
* shape (see packages/next/src/server/resume-data-cache/cache-store.ts) so the
|
|
43
|
+
* worker can restore these straight into CreekComposableCacheHandler without
|
|
44
|
+
* running Next.js's parse path (which allocates streams tied to a request's
|
|
45
|
+
* IoContext).
|
|
46
|
+
*/
|
|
47
|
+
export interface ComposableCacheSeed {
|
|
48
|
+
key: string;
|
|
49
|
+
value: string;
|
|
50
|
+
tags: string[];
|
|
51
|
+
stale: number;
|
|
52
|
+
timestamp: number;
|
|
53
|
+
expire: number;
|
|
54
|
+
revalidate: number;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=build.d.ts.map
|