jam 0.9.2 → 0.9.3
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 +47 -46
- package/bin/jam.js +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -1,62 +1,63 @@
|
|
|
1
1
|
# jam
|
|
2
2
|
|
|
3
|
-
`jam`
|
|
3
|
+
`jam` serves JavaScript and TypeScript files as HTTP routes with isolated per-request execution.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```sh
|
|
8
8
|
jam [flags] [scripts-dir]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
jam --port 3000
|
|
42
|
-
jam ./app
|
|
43
|
-
jam --php --public ./public ./app
|
|
11
|
+
## Common Commands
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
# Serve scripts from ./scripts on port 3000
|
|
15
|
+
jam ./scripts
|
|
16
|
+
|
|
17
|
+
# Development mode with detailed error pages
|
|
18
|
+
jam --mode development ./scripts
|
|
19
|
+
|
|
20
|
+
# Use a config file
|
|
21
|
+
jam --config ./jamconfig.json ./scripts
|
|
22
|
+
|
|
23
|
+
# Enable PHP-style globals
|
|
24
|
+
jam --php ./scripts
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For the complete CLI surface, run:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
jam --help
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Minimal Script
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
export default {
|
|
37
|
+
fetch() {
|
|
38
|
+
return new Response("Hello from Jam");
|
|
39
|
+
}
|
|
40
|
+
};
|
|
44
41
|
```
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
Saved as `scripts/app.ts`, this route is available at `/app`.
|
|
44
|
+
|
|
45
|
+
## Docs
|
|
46
|
+
|
|
47
|
+
- [Introduction](../../docs/001-introduction.md)
|
|
48
|
+
- [Getting Started](../../docs/002-getting-started.md)
|
|
49
|
+
- [Build a Real App](../../docs/003-writing-scripts.md)
|
|
50
|
+
- [Configuration](../../docs/004-configuration.md)
|
|
51
|
+
- [Runtime APIs](../../docs/005-runtime-apis.md)
|
|
52
|
+
- [Templates](../../docs/006-templates.md)
|
|
53
|
+
- [Deployment](../../docs/007-deployment.md)
|
|
49
54
|
|
|
50
55
|
## Development
|
|
51
56
|
|
|
52
57
|
`jam` has two entry points with different roles:
|
|
53
58
|
|
|
54
|
-
- `bin/jam.js`: Node-facing dispatch shim for
|
|
55
|
-
|
|
56
|
-
- It picks the correct platform package (`jam-darwin-arm64`, `jam-darwin-x64`, `jam-linux-arm64`, `jam-linux-x64`), installs it if needed, and forwards execution to its binary.
|
|
57
|
-
- `src/entry.ts`: Bun runtime CLI entrypoint.
|
|
58
|
-
- This is what gets compiled into each platform binary.
|
|
59
|
-
- It should remain minimal and primarily call into `main` from `src/main.ts`.
|
|
60
|
-
- CI and release scripts build it for each target.
|
|
59
|
+
- `bin/jam.js`: Node-facing dispatch shim for npm usage.
|
|
60
|
+
- `src/entry.ts`: Bun runtime CLI entrypoint compiled into platform binaries.
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
For repeatable runtime engineering workflows, see the repo-local skills index:
|
|
63
|
+
[`../../skills/README.md`](../../skills/README.md).
|
package/bin/jam.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// If the platform package is not installed yet, this shim tries to install it
|
|
12
12
|
// on demand via `npm install <platform-package>@<version> --no-save`.
|
|
13
13
|
// If Bun is available in a local repo checkout and no platform package is
|
|
14
|
-
// present, it falls back to running `src/
|
|
14
|
+
// present, it falls back to running `src/entry.ts` directly for development.
|
|
15
15
|
//
|
|
16
16
|
// `src/entry.ts` is the Bun source entrypoint used by platform package builds;
|
|
17
17
|
// this file (`jam.js`) is the runtime dispatcher that selects and runs them.
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jam",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "An application server for isolated JavaScript",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"author": "Michael Jackson <mjijackson@gmail.com>",
|
|
6
7
|
"type": "module",
|
|
7
8
|
"types": "types/index.d.ts",
|
|
8
9
|
"repository": {
|
|
@@ -28,10 +29,10 @@
|
|
|
28
29
|
]
|
|
29
30
|
},
|
|
30
31
|
"optionalDependencies": {
|
|
31
|
-
"jam-darwin-arm64": "0.9.
|
|
32
|
-
"jam-darwin-x64": "0.9.
|
|
33
|
-
"jam-linux-arm64": "0.9.
|
|
34
|
-
"jam-linux-x64": "0.9.
|
|
32
|
+
"jam-darwin-arm64": "0.9.3",
|
|
33
|
+
"jam-darwin-x64": "0.9.3",
|
|
34
|
+
"jam-linux-arm64": "0.9.3",
|
|
35
|
+
"jam-linux-x64": "0.9.3"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
38
|
"@jridgewell/trace-mapping": "^0.3.31",
|