rosetack 0.1.4 → 0.1.5
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/deploy/api/rosetack.ts +11 -21
- package/deploy/server.cjs +4 -0
- package/dist-cli/compiler.mjs +761 -137
- package/dist-cli/edge.mjs +88 -8
- package/dist-cli/rosetack.mjs +966 -188
- package/dist-cli/runtime.mjs +698 -29
- package/dist-cli/test.mjs +786 -142
- package/package.json +9 -1
- package/src/FRAMEWORK_VERSION +1 -1
- package/src/cli/edge.ts +13 -3
- package/src/cli/index.ts +51 -37
- package/src/cli/origin.ts +9 -0
- package/src/cli/prod-server.ts +179 -28
- package/src/cli/prompt.ts +53 -4
- package/src/cli/shell.ts +40 -5
- package/src/cli/shutdown.ts +54 -0
- package/src/compiler/index.ts +709 -64
- package/src/runtime/index.ts +786 -43
- package/src/types/rosetack.d.ts +3 -0
package/deploy/api/rosetack.ts
CHANGED
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Vercel function entry: the edge adapter, unchanged.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* and never touch this code. That split is the whole rosetack story: the
|
|
9
|
-
* static half costs zero function invocations.
|
|
4
|
+
* vercel.json rewrites every unmatched path here and ships dist/ with the
|
|
5
|
+
* bundle (the adapter imports dist/server.js at runtime, so the function
|
|
6
|
+
* cannot start without it). The handler is createEdgeHandler's returned
|
|
7
|
+
* (request) => Response, exposed behind Vercel's Web Standard signature.
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `export default { fetch }` - one handler object, every method. The
|
|
15
|
-
* Node.js runtime compiles TypeScript entrypoints and their imports, so
|
|
16
|
-
* this file and the adapter it pulls in stay .ts.
|
|
17
|
-
*
|
|
18
|
-
* Install: copy this file to <project>/api/rosetack.ts and deploy/vercel.json
|
|
19
|
-
* to <project>/vercel.json, then `vercel --prod`. In a project that depends
|
|
20
|
-
* on the published package the import below becomes:
|
|
21
|
-
* import { createEdgeHandler } from 'rosetack/edge';
|
|
9
|
+
* The dist path goes through fileURLToPath, NOT URL.pathname: on Windows a
|
|
10
|
+
* pathname carries the drive as `/C:/...` and the leading slash makes the
|
|
11
|
+
* dynamic import resolve against the drive root instead of this directory.
|
|
22
12
|
*/
|
|
23
|
-
import { createEdgeHandler } from '../src/cli/edge.ts';
|
|
24
13
|
import { fileURLToPath } from 'node:url';
|
|
14
|
+
import { createEdgeHandler } from '../src/cli/edge.ts';
|
|
25
15
|
|
|
26
|
-
|
|
27
|
-
const handle = await createEdgeHandler(
|
|
16
|
+
const dist = fileURLToPath(new URL('../dist/', import.meta.url));
|
|
17
|
+
const handle = await createEdgeHandler(dist);
|
|
28
18
|
|
|
29
19
|
export default { fetch: handle };
|