@econ-v1/app-sdk 5.22.0 → 5.23.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 +44 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,50 @@ runNodeApp(new MyApp());
|
|
|
42
42
|
|
|
43
43
|
The host launches the Bun process, supplies a Unix socket via the `NODE_APP_SOCKET` environment variable, and routes proxied HTTP requests, events, and capability calls over the socket.
|
|
44
44
|
|
|
45
|
+
## Building for production
|
|
46
|
+
|
|
47
|
+
`@econ-v1/app-sdk` is itself a **shared dependency** in the Node deb (installed
|
|
48
|
+
once at `/usr/lib/node/shared/node_modules/@econ-v1/app-sdk`), so it's *not*
|
|
49
|
+
bundled into your app's `dist/index.js`. The build pipeline handles this
|
|
50
|
+
automatically — you don't have to do anything special.
|
|
51
|
+
|
|
52
|
+
Your app's other deps land in one of three buckets:
|
|
53
|
+
|
|
54
|
+
| Where | When |
|
|
55
|
+
|---|---|
|
|
56
|
+
| **Bundled** into `dist/index.js` *(default)* | Pure-JS deps; tree-shaken + minified |
|
|
57
|
+
| **Shared** at `/usr/lib/node/shared/node_modules/` | Dep is in the curated `SHARED_EXTERNALS` list (LLM SDKs, this SDK) |
|
|
58
|
+
| **Private** at `<your-app>/node_modules/` | You opt in via `manifest.json#nodeApp.privateRuntime` (native bindings, version overrides) |
|
|
59
|
+
|
|
60
|
+
Opt into a private dep by editing your `manifest.json`:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"name": "my-app",
|
|
65
|
+
"version": "0.1.0",
|
|
66
|
+
"entrypoint": "dist/index.js",
|
|
67
|
+
"nodeApp": {
|
|
68
|
+
"privateRuntime": ["better-sqlite3"]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Use `privateRuntime` only for packages with native bindings or version
|
|
74
|
+
conflicts with the shared tree — each entry adds its full installed size to
|
|
75
|
+
your app. See the canonical reference at
|
|
76
|
+
[`docs/app-development/12-typescript-dependencies.md`](https://github.com/econ-v1/node/blob/main/docs/app-development/12-typescript-dependencies.md)
|
|
77
|
+
for the full bundling and resolution model.
|
|
78
|
+
|
|
79
|
+
### Build command
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
# Inside the node monorepo:
|
|
83
|
+
bash infra/scripts/build-bun-app.sh modules/my-app dist/build-aarch64/builtin-apps/my-app
|
|
84
|
+
|
|
85
|
+
# As a downstream app (after publishing):
|
|
86
|
+
bunx @econ-v1/app-sdk build .
|
|
87
|
+
```
|
|
88
|
+
|
|
45
89
|
## Defense-in-depth scope checks
|
|
46
90
|
|
|
47
91
|
```typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@econ-v1/app-sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.23.0",
|
|
4
4
|
"description": "TypeScript SDK for building Node mini-app plugins (Bun runtime) on the Lightning-powered marketplace daemon",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"author": "Node contributors",
|