@t4h.framework/dev 0.0.0-experimental-20260902161345 → 0.0.0-experimental-20260902164013
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/CHANGELOG.md +2 -2
- package/README.md +5 -5
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @t4h.framework/dev
|
|
2
2
|
|
|
3
|
-
## 0.0.0-experimental-
|
|
3
|
+
## 0.0.0-experimental-20260902164013
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- [#145](https://github.com/tech4humans-brasil/framework/pull/145) [`
|
|
7
|
+
- [#145](https://github.com/tech4humans-brasil/framework/pull/145) [`09724c3`](https://github.com/tech4humans-brasil/framework/commit/09724c3f0bb573d55b94495835362e7b66bc570e) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Replaces the interactive REPL of `framework dev` with an HTTP dev server: Hono routes workflow (`POST /projects/:projectId/workflows/:workflowId/runs` answers `201 { id }`, `PATCH .../runs/:runId/activities/:activityId` advances a pending async activity), mandatory workflow authorization resolved from the app/workflow `Authorization` manifest, `/_dev` routes for tooling (manifest, runs, waiting activities, env, SSE events) and Vite in middleware mode for a UI. Workflow runs now live in an in-memory SQLite database inside the app process, the ORM dev claim stores its rows in `db.sqlite` instead of rewriting `db.json` on every change, child workflows run in parallel, and `framework dev` gains `--port` (`PORT`) and `--host`. `DevServer` and `isWorkflowWaiting` are gone; use `Server`.
|
|
8
8
|
|
|
9
9
|
## 0.14.2
|
|
10
10
|
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ When you run `framework dev` (via `@t4h.framework/cli`), this package powers the
|
|
|
8
8
|
|
|
9
9
|
1. **TypeScript watch** — compiles your app on every change.
|
|
10
10
|
2. **App process** — forks a child Node process that loads your compiled `App` and runs the workflow engine on an in-memory SQLite database.
|
|
11
|
-
3. **HTTP server** — a [Hono](https://hono.dev) app that
|
|
11
|
+
3. **HTTP server** — a [Hono](https://hono.dev) app that exposes your workflows (create runs, advance pending activities), enforces the workflow authorization and adds `/_dev` routes for tooling.
|
|
12
12
|
4. **Vite** — a Vite dev server in middleware mode serves everything that is not an API route, ready for a UI plugin.
|
|
13
13
|
5. **Dev claims** — provides local implementations for ORM, HTTP, file system, cache, SMTP, and more.
|
|
14
14
|
|
|
@@ -99,7 +99,7 @@ framework dev --entrypoint ./package.json -e API_KEY=secret -e DB_HOST=localhost
|
|
|
99
99
|
|
|
100
100
|
## HTTP routes
|
|
101
101
|
|
|
102
|
-
The
|
|
102
|
+
The dev server has no tenants and a single live version (the last build), so the routes carry only the project and the workflow. `projectId` must match your `App` id.
|
|
103
103
|
|
|
104
104
|
| Method | Route | Authorization | Response |
|
|
105
105
|
|--------|-------|---------------|----------|
|
|
@@ -118,7 +118,7 @@ curl -X POST http://localhost:3000/projects/my-app/workflows/my-workflow/runs \
|
|
|
118
118
|
|
|
119
119
|
### Authorization
|
|
120
120
|
|
|
121
|
-
Every
|
|
121
|
+
Every `/projects` route requires an authorization: the workflow `authorization` wins over the app one, its manifest `pathToModule` is imported and its default export receives the manifest `context` templated with the request (`<< headers.x-signature >>`, `<< rawBody >>`, `<< body.id >>`, `<< params.projectId >>`, `<< query.token >>`). A falsy result or a thrown error answers `401`. A workflow without any authorization is refused when the manifest arrives (the server emits `error`) and answers `500` if reached.
|
|
122
122
|
|
|
123
123
|
`pathToModule` may be `@t4h.framework/hmac/authorize`, `@t4h.framework/jwks/authorize`, `@t4h.framework/oidc/authorize`, an absolute path, a path relative to the project or a `file://` URL.
|
|
124
124
|
|
|
@@ -139,9 +139,9 @@ Everything else is handed to Vite, so a UI plugin registered in the project's `v
|
|
|
139
139
|
|
|
140
140
|
## State
|
|
141
141
|
|
|
142
|
-
Workflow runs, activities, pending async activities and logs live in an in-memory SQLite database (`node:sqlite`) inside the app process. Every successful build forks a fresh process, so **a rebuild resets all runs, timers and pending activities**; the `manifest` SSE event tells a UI to reload.
|
|
142
|
+
Workflow runs, activities, pending async activities and logs live in an in-memory SQLite database (`node:sqlite`) inside the app process. Every successful build forks a fresh process, so **a rebuild resets all runs, timers and pending activities**; the `manifest` SSE event tells a UI to reload. There is no durability, queue or resume in the dev server by design.
|
|
143
143
|
|
|
144
|
-
Sync activities run inline, `sleep` and other timers use `setTimeout`, and child workflows started with `startWorkflow` / `startWorkflowMany` run in parallel
|
|
144
|
+
Sync activities run inline, `sleep` and other timers use `setTimeout`, and child workflows started with `startWorkflow` / `startWorkflowMany` run in parallel.
|
|
145
145
|
|
|
146
146
|
The ORM claim is the exception: its rows live in `db.sqlite` next to your `package.json` and survive rebuilds and restarts (add it to `.gitignore`). Delete the file to start over. The previous `db.json` is no longer read.
|
|
147
147
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t4h.framework/dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260902164013",
|
|
4
4
|
"description": "Dev server for the T4H Framework",
|
|
5
5
|
"homepage": "https://github.com/tech4humans-brasil/framework/tree/main/packages/dev",
|
|
6
6
|
"bugs": "https://github.com/tech4humans-brasil/framework/issues",
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
"@types/dot-object": "^2.1.6",
|
|
71
71
|
"@types/json-schema": "^7.0.15",
|
|
72
72
|
"@types/mime-types": "^3",
|
|
73
|
-
"@types/node": "^
|
|
73
|
+
"@types/node": "^26.4.0",
|
|
74
74
|
"@types/nodemailer": "^7.0.11",
|
|
75
75
|
"json-schema-typed": "^8.0.2",
|
|
76
76
|
"typescript": "^5.9.3",
|
|
77
|
-
"vitest": "^4.
|
|
77
|
+
"vitest": "^4.1.11"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@t4h.framework/core": "^0.9.1"
|