@t4h.framework/dev 0.0.0-experimental-20260909045544 → 0.0.0-experimental-20260911032651
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 +29 -14
- package/dist/constants/server.d.ts +1 -0
- package/dist/constants/server.js +1 -0
- package/dist/constants/server.js.map +1 -1
- package/dist/use-cases/EnqueueWorkflowRunNextTick.usecase.d.ts +4 -0
- package/dist/use-cases/EnqueueWorkflowRunNextTick.usecase.js +29 -10
- package/dist/use-cases/EnqueueWorkflowRunNextTick.usecase.js.map +1 -1
- package/package.json +23 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
# @t4h.framework/dev
|
|
2
2
|
|
|
3
|
-
## 0.0.0-experimental-
|
|
3
|
+
## 0.0.0-experimental-20260911032651
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
7
|
+
- [#173](https://github.com/tech4humans-brasil/framework/pull/173) [`fb800a8`](https://github.com/tech4humans-brasil/framework/commit/fb800a85e7e1c094cf2944644f79d44117038435) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Caps how many workflow runs the dev server advances at the same time.
|
|
8
|
+
|
|
9
|
+
Every child run was scheduled on its own, so a `split` over thousands of blocks
|
|
10
|
+
started every child at once and exhausted the heap before any of them finished
|
|
11
|
+
— a workflow that fans out over a large file could not be tried locally at all.
|
|
12
|
+
|
|
13
|
+
Runs now go through a FIFO queue bounded by
|
|
14
|
+
`WORKFLOW_RUN_NEXT_TICK_CONCURRENCY`. Children still run in parallel, just not
|
|
15
|
+
all at once, which also makes local behaviour closer to what a bounded worker
|
|
16
|
+
pool does when the project is published.
|
|
17
|
+
|
|
18
|
+
## 0.20.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#170](https://github.com/tech4humans-brasil/framework/pull/170) [`aa72268`](https://github.com/tech4humans-brasil/framework/commit/aa72268d040a743743cac31cc14e26b8620b0e3f) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Adds the `jwks` callback auth: a detached signature over the callback body,
|
|
8
23
|
verified with the public key the `kid` resolves to at a JWKS URL — the way Amber
|
|
9
24
|
signs its webhooks.
|
|
10
25
|
|
|
@@ -21,18 +36,18 @@
|
|
|
21
36
|
|
|
22
37
|
**webhook**: documents the new type.
|
|
23
38
|
|
|
24
|
-
- Updated dependencies [[`
|
|
25
|
-
- @t4h.framework/core@0.
|
|
26
|
-
- @t4h.framework/jwks@0.
|
|
27
|
-
- @t4h.framework/webhook@0.
|
|
28
|
-
- @t4h.framework/cache@0.
|
|
29
|
-
- @t4h.framework/fs@0.
|
|
30
|
-
- @t4h.framework/hmac@0.
|
|
31
|
-
- @t4h.framework/http@0.
|
|
32
|
-
- @t4h.framework/oidc@0.
|
|
33
|
-
- @t4h.framework/orm@0.
|
|
34
|
-
- @t4h.framework/sftp@0.
|
|
35
|
-
- @t4h.framework/smtp@0.
|
|
39
|
+
- Updated dependencies [[`aa72268`](https://github.com/tech4humans-brasil/framework/commit/aa72268d040a743743cac31cc14e26b8620b0e3f)]:
|
|
40
|
+
- @t4h.framework/core@0.14.0
|
|
41
|
+
- @t4h.framework/jwks@0.7.0
|
|
42
|
+
- @t4h.framework/webhook@0.2.1
|
|
43
|
+
- @t4h.framework/cache@0.6.4
|
|
44
|
+
- @t4h.framework/fs@0.9.4
|
|
45
|
+
- @t4h.framework/hmac@0.3.1
|
|
46
|
+
- @t4h.framework/http@0.6.3
|
|
47
|
+
- @t4h.framework/oidc@0.6.4
|
|
48
|
+
- @t4h.framework/orm@0.7.5
|
|
49
|
+
- @t4h.framework/sftp@0.7.4
|
|
50
|
+
- @t4h.framework/smtp@0.6.4
|
|
36
51
|
|
|
37
52
|
## 0.20.0
|
|
38
53
|
|
|
@@ -9,3 +9,4 @@ export declare const PROJECTS_ROUTES_PREFIX = "/projects";
|
|
|
9
9
|
export declare const DEV_ROUTES_PREFIX = "/_dev";
|
|
10
10
|
export declare const SERVER_URL_ARG = "--server-url=";
|
|
11
11
|
export declare const WORKFLOW_RUN_EVENTS: readonly ["run:created", "run:updated"];
|
|
12
|
+
export declare const WORKFLOW_RUN_NEXT_TICK_CONCURRENCY = 10;
|
package/dist/constants/server.js
CHANGED
|
@@ -9,4 +9,5 @@ export const PROJECTS_ROUTES_PREFIX = '/projects';
|
|
|
9
9
|
export const DEV_ROUTES_PREFIX = '/_dev';
|
|
10
10
|
export const SERVER_URL_ARG = '--server-url=';
|
|
11
11
|
export const WORKFLOW_RUN_EVENTS = ['run:created', 'run:updated'];
|
|
12
|
+
export const WORKFLOW_RUN_NEXT_TICK_CONCURRENCY = 10;
|
|
12
13
|
//# sourceMappingURL=server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/constants/server.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA;AAEhC,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAA;AAEvC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,GAAG,IAAI,CAAA;AAElD,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,GAAG,IAAI,CAAA;AAEvD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAA;AAE7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAA;AAE3C,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAA;AAElD,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAA;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAA;AAExC,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAA;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,aAAa,EAAE,aAAa,CAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/constants/server.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA;AAEhC,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAA;AAEvC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,GAAG,IAAI,CAAA;AAElD,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,GAAG,IAAI,CAAA;AAEvD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAA;AAE7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAA;AAE3C,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAA;AAElD,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAA;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAA;AAExC,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAA;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,aAAa,EAAE,aAAa,CAAU,CAAA;AAE1E,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,CAAA"}
|
|
@@ -3,7 +3,11 @@ import { WorkflowRunLockService } from '../services/WorkflowRunLock.service.js';
|
|
|
3
3
|
export declare class EnqueueWorkflowRunNextTick {
|
|
4
4
|
private readonly workflowRun;
|
|
5
5
|
private readonly lock;
|
|
6
|
+
private readonly pending;
|
|
7
|
+
private running;
|
|
6
8
|
constructor(workflowRun: WorkflowRunFacade, lock: WorkflowRunLockService);
|
|
7
9
|
enqueue(runId: string): void;
|
|
8
10
|
enqueueMany(runIds: readonly string[]): void;
|
|
11
|
+
private drain;
|
|
12
|
+
private run;
|
|
9
13
|
}
|
|
@@ -9,29 +9,48 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
9
9
|
};
|
|
10
10
|
import { styleText } from 'node:util';
|
|
11
11
|
import { Inject, Injectable } from 'pleroma';
|
|
12
|
+
import { WORKFLOW_RUN_NEXT_TICK_CONCURRENCY } from '../constants/server.js';
|
|
12
13
|
import { WorkflowRunFacade } from '../services/WorkflowRunFacade.service.js';
|
|
13
14
|
import { WorkflowRunLockService } from '../services/WorkflowRunLock.service.js';
|
|
14
15
|
let EnqueueWorkflowRunNextTick = class EnqueueWorkflowRunNextTick {
|
|
15
16
|
workflowRun;
|
|
16
17
|
lock;
|
|
18
|
+
pending = [];
|
|
19
|
+
running = 0;
|
|
17
20
|
constructor(workflowRun, lock) {
|
|
18
21
|
this.workflowRun = workflowRun;
|
|
19
22
|
this.lock = lock;
|
|
20
23
|
}
|
|
21
24
|
enqueue(runId) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
.detach(() => this.workflowRun.nextTick(runId))
|
|
25
|
-
.catch(error => {
|
|
26
|
-
console.error(styleText('red', `[Runtime] next tick failed for run ${runId}:`, {
|
|
27
|
-
stream: process.stderr,
|
|
28
|
-
}), error);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
25
|
+
this.pending.push(runId);
|
|
26
|
+
this.drain();
|
|
31
27
|
}
|
|
32
28
|
enqueueMany(runIds) {
|
|
33
29
|
for (const runId of runIds)
|
|
34
|
-
this.
|
|
30
|
+
this.pending.push(runId);
|
|
31
|
+
this.drain();
|
|
32
|
+
}
|
|
33
|
+
drain() {
|
|
34
|
+
while (this.running < WORKFLOW_RUN_NEXT_TICK_CONCURRENCY &&
|
|
35
|
+
this.pending.length > 0) {
|
|
36
|
+
const runId = this.pending.shift();
|
|
37
|
+
this.running += 1;
|
|
38
|
+
setImmediate(() => void this.run(runId));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async run(runId) {
|
|
42
|
+
try {
|
|
43
|
+
await this.lock.detach(() => this.workflowRun.nextTick(runId));
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
console.error(styleText('red', `[Runtime] next tick failed for run ${runId}:`, {
|
|
47
|
+
stream: process.stderr,
|
|
48
|
+
}), error);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
this.running -= 1;
|
|
52
|
+
this.drain();
|
|
53
|
+
}
|
|
35
54
|
}
|
|
36
55
|
};
|
|
37
56
|
EnqueueWorkflowRunNextTick = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnqueueWorkflowRunNextTick.usecase.js","sourceRoot":"","sources":["../../src/use-cases/EnqueueWorkflowRunNextTick.usecase.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAA;AAGxE,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;
|
|
1
|
+
{"version":3,"file":"EnqueueWorkflowRunNextTick.usecase.js","sourceRoot":"","sources":["../../src/use-cases/EnqueueWorkflowRunNextTick.usecase.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAE5C,OAAO,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAA;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAA;AAGxE,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAOlB;IAGA;IATF,OAAO,GAAa,EAAE,CAAA;IAE/B,OAAO,GAAG,CAAC,CAAA;IAEnB,YAEmB,WAA8B,EAG9B,IAA4B;QAH5B,gBAAW,GAAX,WAAW,CAAmB;QAG9B,SAAI,GAAJ,IAAI,CAAwB;IAC5C,CAAC;IAEG,OAAO,CAAC,KAAa;QAC1B,IAAI,CAAC,OAAO,CAAC,IAA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BAAsB,CAAC,CAAA;GAT5B,0BAA0B,CAsDtC"}
|
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-20260911032651",
|
|
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",
|
|
@@ -59,18 +59,18 @@
|
|
|
59
59
|
"vite": "^8.0.3"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@t4h.framework/cache": "^0.
|
|
63
|
-
"@t4h.framework/core": "^0.
|
|
64
|
-
"@t4h.framework/fs": "^0.
|
|
65
|
-
"@t4h.framework/hmac": "^0.
|
|
66
|
-
"@t4h.framework/http": "^0.
|
|
67
|
-
"@t4h.framework/jwks": "^0.
|
|
68
|
-
"@t4h.framework/oidc": "^0.
|
|
69
|
-
"@t4h.framework/orm": "^0.
|
|
62
|
+
"@t4h.framework/cache": "^0.6.4",
|
|
63
|
+
"@t4h.framework/core": "^0.14.0",
|
|
64
|
+
"@t4h.framework/fs": "^0.9.4",
|
|
65
|
+
"@t4h.framework/hmac": "^0.3.1",
|
|
66
|
+
"@t4h.framework/http": "^0.6.3",
|
|
67
|
+
"@t4h.framework/jwks": "^0.7.0",
|
|
68
|
+
"@t4h.framework/oidc": "^0.6.4",
|
|
69
|
+
"@t4h.framework/orm": "^0.7.5",
|
|
70
70
|
"@t4h.framework/runtime-claims": "^0.1.0",
|
|
71
|
-
"@t4h.framework/sftp": "^0.
|
|
72
|
-
"@t4h.framework/smtp": "^0.
|
|
73
|
-
"@t4h.framework/webhook": "^0.
|
|
71
|
+
"@t4h.framework/sftp": "^0.7.4",
|
|
72
|
+
"@t4h.framework/smtp": "^0.6.4",
|
|
73
|
+
"@t4h.framework/webhook": "^0.2.1",
|
|
74
74
|
"@types/dot-object": "^2.1.6",
|
|
75
75
|
"@types/json-schema": "^7.0.15",
|
|
76
76
|
"@types/mime-types": "^3",
|
|
@@ -81,18 +81,18 @@
|
|
|
81
81
|
"vitest": "^4.0.18"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@t4h.framework/cache": "^0.
|
|
85
|
-
"@t4h.framework/core": "^0.
|
|
86
|
-
"@t4h.framework/fs": "^0.
|
|
87
|
-
"@t4h.framework/hmac": "^0.
|
|
88
|
-
"@t4h.framework/http": "^0.
|
|
89
|
-
"@t4h.framework/jwks": "^0.
|
|
90
|
-
"@t4h.framework/oidc": "^0.
|
|
91
|
-
"@t4h.framework/orm": "^0.
|
|
84
|
+
"@t4h.framework/cache": "^0.6.4",
|
|
85
|
+
"@t4h.framework/core": "^0.14.0",
|
|
86
|
+
"@t4h.framework/fs": "^0.9.4",
|
|
87
|
+
"@t4h.framework/hmac": "^0.3.1",
|
|
88
|
+
"@t4h.framework/http": "^0.6.3",
|
|
89
|
+
"@t4h.framework/jwks": "^0.7.0",
|
|
90
|
+
"@t4h.framework/oidc": "^0.6.4",
|
|
91
|
+
"@t4h.framework/orm": "^0.7.5",
|
|
92
92
|
"@t4h.framework/runtime-claims": "^0.1.0",
|
|
93
|
-
"@t4h.framework/sftp": "^0.
|
|
94
|
-
"@t4h.framework/smtp": "^0.
|
|
95
|
-
"@t4h.framework/webhook": "^0.
|
|
93
|
+
"@t4h.framework/sftp": "^0.7.4",
|
|
94
|
+
"@t4h.framework/smtp": "^0.6.4",
|
|
95
|
+
"@t4h.framework/webhook": "^0.2.1",
|
|
96
96
|
"typescript": "^5.9.3"
|
|
97
97
|
},
|
|
98
98
|
"peerDependenciesMeta": {
|