@pikku/schedule 0.12.10 → 0.12.12
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/dist/in-memory-scheduler-service.d.ts +1 -1
- package/dist/in-memory-scheduler-service.js +8 -3
- package/package.json +13 -7
- package/CHANGELOG.md +0 -430
- package/knowledge/index.md +0 -13
- package/knowledge/questions/index.md +0 -13
- package/knowledge/questions/should-a-delayed-rpc-run-as-the-session-it-was-scheduled-with.md +0 -22
- package/run-tests.sh +0 -68
|
@@ -15,7 +15,7 @@ export declare class InMemorySchedulerService extends SchedulerService {
|
|
|
15
15
|
/**
|
|
16
16
|
* Schedule a one-off delayed RPC call via setTimeout
|
|
17
17
|
*/
|
|
18
|
-
scheduleRPC(delay: number | string, rpcName: string, data?: any, session?: CoreUserSession): Promise<string>;
|
|
18
|
+
scheduleRPC(delay: number | string, rpcName: string, data?: any, session?: CoreUserSession, traceparent?: string): Promise<string>;
|
|
19
19
|
unschedule(taskId: string): Promise<boolean>;
|
|
20
20
|
getTask(taskId: string): Promise<ScheduledTaskInfo | null>;
|
|
21
21
|
getAllTasks(): Promise<ScheduledTaskSummary[]>;
|
|
@@ -5,6 +5,7 @@ import { pikkuState, getSingletonServices } from '@pikku/core/state';
|
|
|
5
5
|
import { runScheduledTask } from '@pikku/core/scheduler';
|
|
6
6
|
import { getScheduledTasks } from '@pikku/core/scheduler';
|
|
7
7
|
import { rpcService } from '@pikku/core/rpc';
|
|
8
|
+
import { traceWire } from '@pikku/core/trace';
|
|
8
9
|
const RUN_HISTORY_LIMIT = 50;
|
|
9
10
|
const getLogger = () => {
|
|
10
11
|
return pikkuState(null, 'package', 'singletonServices').logger;
|
|
@@ -22,7 +23,7 @@ export class InMemorySchedulerService extends SchedulerService {
|
|
|
22
23
|
/**
|
|
23
24
|
* Schedule a one-off delayed RPC call via setTimeout
|
|
24
25
|
*/
|
|
25
|
-
async scheduleRPC(delay, rpcName, data, session) {
|
|
26
|
+
async scheduleRPC(delay, rpcName, data, session, traceparent) {
|
|
26
27
|
const delayMs = typeof delay === 'string' ? parseDurationString(delay) : delay;
|
|
27
28
|
const taskId = `inmem-${++this.idCounter}-${Date.now()}`;
|
|
28
29
|
const scheduledFor = new Date(Date.now() + delayMs);
|
|
@@ -44,8 +45,12 @@ export class InMemorySchedulerService extends SchedulerService {
|
|
|
44
45
|
// This matches what the BullMQ and pg-boss schedulers already do:
|
|
45
46
|
// enqueue `{ rpcName, data, session }` and invoke the RPC with it.
|
|
46
47
|
const services = getSingletonServices();
|
|
47
|
-
const
|
|
48
|
-
|
|
48
|
+
const wire = traceWire(traceparent);
|
|
49
|
+
const rpc = rpcService.getContextRPCService(services, wire, false);
|
|
50
|
+
// The function runs on this hop's span. `invoke` would add a call span
|
|
51
|
+
// under it, and nothing runs on the hop, so the function's parent would
|
|
52
|
+
// be a span nobody saw instead of the one that scheduled it.
|
|
53
|
+
await rpc.rpcWithWire(rpcName, data, wire);
|
|
49
54
|
}
|
|
50
55
|
catch (err) {
|
|
51
56
|
getLogger().error(`Failed to execute delayed RPC '${rpcName}': ${err}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/schedule",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.12",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/pikkujs/pikku.git",
|
|
@@ -16,18 +16,19 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"tsc": "tsc",
|
|
18
18
|
"ncu": "npx npm-check-updates",
|
|
19
|
-
"build": "tsc -b",
|
|
19
|
+
"build": "bun run clean && tsc -b",
|
|
20
20
|
"release": "npm run build && npm test",
|
|
21
21
|
"test": "bash run-tests.sh",
|
|
22
22
|
"test:watch": "bash run-tests.sh --watch",
|
|
23
23
|
"test:coverage": "bash run-tests.sh --coverage",
|
|
24
|
-
"prepublishOnly": "bun run build"
|
|
24
|
+
"prepublishOnly": "bun run build",
|
|
25
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
27
|
-
"@pikku/core": "^0.12.
|
|
28
|
+
"@pikku/core": "^0.12.151"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@types/node": "^
|
|
31
|
+
"@types/node": "^26.6.5"
|
|
31
32
|
},
|
|
32
33
|
"engines": {
|
|
33
34
|
"node": ">=24"
|
|
@@ -41,6 +42,11 @@
|
|
|
41
42
|
"types": "./dist/index.d.ts",
|
|
42
43
|
"import": "./dist/index.js",
|
|
43
44
|
"default": "./dist/index.js"
|
|
44
|
-
}
|
|
45
|
-
|
|
45
|
+
},
|
|
46
|
+
"./package.json": "./package.json"
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist",
|
|
50
|
+
"!dist/**/*.tsbuildinfo"
|
|
51
|
+
]
|
|
46
52
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
## 0.12.10
|
|
2
|
-
|
|
3
|
-
### Patch Changes
|
|
4
|
-
|
|
5
|
-
- de9af6a: RPCs for Pikku Studio's migrated screens. Runtime state that must be visible on a deployed app lives in `@pikku/addon-admin`; local-copy tools stay in `@pikku/addon-console`.
|
|
6
|
-
|
|
7
|
-
`@pikku/addon-admin`:
|
|
8
|
-
|
|
9
|
-
- `admin:getSchedulerHistory` returns each scheduled task's last run, next run and recent runs, from a new `SchedulerService.getTaskRuns()` (empty by default). `InMemorySchedulerService` records the last 50 runs per cron task with status, duration and error. Scope `admin:schedules:read`.
|
|
10
|
-
- `admin:getQueueHistory({ queueNames?, limit? })` returns live counts and recent jobs per queue, from a new optional `QueueService.inspect(queueName, { limit })`, implemented by `InMemoryQueueService` and `BullQueueService` and forwarded by `SignedQueueService`. Scope `admin:queues:read`.
|
|
11
|
-
- `admin:listIncomingWebhookReceipts` / `admin:getIncomingWebhookReceipt` expose received webhooks, backed by a new `IncomingWebhookService.getReceipt(receiptId)` (null by default; implemented by `KyselyIncomingWebhookService`). Scope `admin:webhooks:read`.
|
|
12
|
-
|
|
13
|
-
`@pikku/addon-console`:
|
|
14
|
-
|
|
15
|
-
- `console:variableGet` / `console:variableSet` read and write a project variable, gated on `pikku:console:variables:read` / `:write`.
|
|
16
|
-
- `console:runScenarios({ names?, environment? })` starts `pikku scenario run` as a detached child process and returns `{ runId }` to follow through `listScenarioRuns` / `getScenarioRun`, gated on the new `pikku:console:scenarios:run` scope. `pikku scenario run` takes `--run-id <id>` to record under a caller-chosen id.
|
|
17
|
-
|
|
18
|
-
- Updated dependencies [de9af6a]
|
|
19
|
-
- @pikku/core@0.12.143
|
|
20
|
-
|
|
21
|
-
## 0.12.9
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- 15c4968: The default runtime path no longer needs `node:*`, `Buffer` or an unguarded `process`, so it loads on edge runtimes (Web APIs only).
|
|
26
|
-
|
|
27
|
-
**Breaking:** `FileScenarioRunStore`, `scenarioArtifactContentType` and `scenarioRunSummary` leave the `@pikku/core/services` barrel because they use `node:fs`. Import them from `@pikku/core/services/file-scenario-run-store`. Pre-0.13 breaking changes still ship as a patch.
|
|
28
|
-
|
|
29
|
-
**Breaking:** the HMAC helpers in `@pikku/core/hmac` run on Web Crypto, which is async. `hmacSha256Hex`, `hmacDigest`, `verifyHmacSignature` and `verifyPublicKeySignature` now return a Promise; `timingSafeStringEqual` stays synchronous. `WebhookService.sign` and `WebhookService.verify` return a Promise, and so does `verifySlackSignature` in `@pikku/gateway-slack`: `await` them. A function-style `verify` on a webhook source may return a Promise as well. `verifyPublicKeySignature` accepts RSA and EC (P-256, P-384, P-521) PEM keys; Ed25519 and RSA-PSS keys verify as false.
|
|
30
|
-
|
|
31
|
-
`isProduction()` (and the `PIKKU_MODEL_ALIASES` and `PIKKU_ENV` reads) now ask the registered singleton services' `variables` service first, then `process.env` when `process` exists. With neither, `isProduction()` is true, so an edge deployment never exposes error details by accident. `LocalVariablesService` resolves its `process.env` default when constructed and falls back to an empty store without `process`.
|
|
32
|
-
|
|
33
|
-
Workflow invocation ids use a built-in SHA-1 and stay byte-identical. `@pikku/kysely` and the Cloudflare hibernation server use `globalThis.crypto.randomUUID()` and no `Buffer`; `@pikku/kysely` is marked `sideEffects: false`. `@pikku/ai-deepinfra` reads `DEEPINFRA_API_KEY` only when `process` exists and decodes base64 audio without `Buffer`.
|
|
34
|
-
|
|
35
|
-
Runtime tiers. A package declares where it can run in `package.json`: `"pikku": { "runtime": "edge" | "serverless" | "server" }`, with optional per-subpath overrides (`"exports": { "./dev": "server" }`). `server` is the default. `@pikku/core` and the default services are `edge` (core's Node-only subpaths are `server`), `@pikku/better-auth`, `@pikku/addon-admin` and `@pikku/cloudflare` are `serverless` (better-auth statically imports `node:crypto` scrypt), and `@pikku/addon-console` is `server` and must never land in a deployed unit.
|
|
36
|
-
|
|
37
|
-
`pikku deploy` now verifies each deployed unit before bundling it. The unit is bundled with esbuild (neutral platform, `workerd`/`worker`/`browser` conditions) under its tier's profile, ahead of the adapter's aliases and stubs so they cannot hide anything, and the build fails when the bundle holds a package declared above the unit's tier or a Node built-in the runtime does not provide. The error names the unit, package, import chain and the fix. A built-in the provider stubs is a warning. On an edge unit, a bundled `InMemory*` class also fails the build. The unit's tier is its `runtime`, else the project's own `pikku.runtime`, else the provider default (`serverless` on Cloudflare). Packages that declare nothing are judged by their imports only.
|
|
38
|
-
|
|
39
|
-
`ProviderAdapter.getRuntimeProfile(tier?)` returns the compat date, compat flags, the built-ins the runtime provides (keyed by compat date), the stubbed ones and the externals. The Cloudflare adapter derives `wrangler.toml`, the upload metadata and the bundle externals from it; `node:os` and `node:fs` are not provided before compat date 2025-09-15. The default is `nodejs_compat_v2` with compat date 2024-12-18, which is what `wrangler.toml` and Fabric's live workers already use, so Fabric deploys see no runtime change. Only the direct-API upload in `@pikku/deploy-cloudflare` (`createWorker`, used by its own `deploy()`) moves: it sent `nodejs_compat` with 2024-01-01 before. A newer date or flag is opt-in through the adapter option `new CloudflareProviderAdapter({ compatDate })` or `getCloudflareRuntimeProfile(tier, compatDate)`. From 2025-08-15 `node:http` and `node:https` exist, and from 2025-09-15 `node:os`, `node:fs` (stubbed by the build regardless) and `node:perf_hooks`; the verifier's allowed built-ins follow the effective date. A newer date changes the runtime of every worker deployed with it.
|
|
40
|
-
|
|
41
|
-
`declareScopes(['pikku:console'])` (from `@pikku/core/scope`) declares scopes by id without wiring anything. `wireAddon({ scopes })` only requires a scope of an addon's functions; the tree arrives with the addon's metadata, so a role granting `pikku:console` used to fail PKU124 unless the addon was wired, and a wired `@pikku/addon-console` lands in every unit carrying the `/rpc` catch-all. An app that grants the scope without the console now calls `declareScopes` and no longer needs the scaffold or the addon. When the addon is wired its tree and descriptions win and the bare id adds nothing.
|
|
42
|
-
|
|
43
|
-
More packages declare a tier after bundling each with the edge profile. `edge`: `@pikku/addon-graph`, `@pikku/pino`, `@pikku/jose`, `@pikku/ai-vercel`, `@pikku/ai-voice`. `serverless`: `@pikku/kysely-postgres` (postgres.js needs `node:buffer`, `stream`, `events`), `@pikku/backblaze` (`copyFile` reads a local file, which the build stubs), `@pikku/gateway-slack` (`@slack/web-api` imports `node:os` and `zlib`). `server`: `@pikku/schedule` (`cron` imports `child_process`), `@pikku/aws-services` (the AWS SDK's Node handler needs `node:http2`), `@pikku/browser` (puppeteer), and `@pikku/modelcontextprotocol` except its `./fetch` subpath, which is `edge`.
|
|
44
|
-
|
|
45
|
-
`@pikku/addon-graph` no longer needs `node:crypto` or `Buffer`: the Crypto function hashes and HMACs on Web Crypto (MD5 is built in, since Web Crypto has none) and encodes with `TextEncoder`/`atob`/`btoa`, with output unchanged.
|
|
46
|
-
|
|
47
|
-
- Updated dependencies [6f11bb5]
|
|
48
|
-
- Updated dependencies [0c67e33]
|
|
49
|
-
- Updated dependencies [15c4968]
|
|
50
|
-
- Updated dependencies [d75a23d]
|
|
51
|
-
- Updated dependencies [9b12c8a]
|
|
52
|
-
- @pikku/core@0.12.138
|
|
53
|
-
|
|
54
|
-
## 0.12.8
|
|
55
|
-
|
|
56
|
-
### Patch Changes
|
|
57
|
-
|
|
58
|
-
- 4c7a1b5: Run the monorepo's own scripts through bun instead of yarn. What moves is the
|
|
59
|
-
package manager each package's `prepublishOnly` and build scripts invoke, plus
|
|
60
|
-
the two manifest fixes bun needs to resolve the tree: `uWebSockets.js` is
|
|
61
|
-
declared with an explicit `github:` specifier, and `@pikku/uws-handler` marks
|
|
62
|
-
its `uWebSockets.js` peer optional so a bun install of a consumer that brings
|
|
63
|
-
its own uWS app does not try to fetch it from the registry.
|
|
64
|
-
|
|
65
|
-
Three published behaviours change, all of them cases where an isolated
|
|
66
|
-
`node_modules` or bun as the runtime had been papered over by yarn's hoisting:
|
|
67
|
-
|
|
68
|
-
- `@pikku/migrator-sql` turns foreign keys on when it opens a sqlite database
|
|
69
|
-
through bun. `node:sqlite` enforces them by default and `bun:sqlite` does not,
|
|
70
|
-
which silently turned every `ON DELETE CASCADE` into a no-op under
|
|
71
|
-
`bunx --bun pikku`.
|
|
72
|
-
- `@pikku/cli` resolves a deploy provider against the project being deployed
|
|
73
|
-
rather than against wherever the CLI itself is installed, which is what its
|
|
74
|
-
own "is not installed" error asks the user to arrange.
|
|
75
|
-
- `@pikku/cli` treats a specifier a runtime hands straight back — bun does this
|
|
76
|
-
for the modules it implements itself — as not resolved from the project, so
|
|
77
|
-
it falls back rather than loading the runtime's own copy.
|
|
78
|
-
|
|
79
|
-
- Updated dependencies [4c7a1b5]
|
|
80
|
-
- @pikku/core@0.12.108
|
|
81
|
-
|
|
82
|
-
## 0.12.7
|
|
83
|
-
|
|
84
|
-
### Patch Changes
|
|
85
|
-
|
|
86
|
-
- 266e3bc: One door per name: `@pikku/core/ecosystem/*` and the package root are gone
|
|
87
|
-
|
|
88
|
-
`@pikku/core` published every module twice. `ecosystem/http` re-exported
|
|
89
|
-
`./http`, `ecosystem/services` re-exported `./services`, and a name was
|
|
90
|
-
reachable through either — so every addition had to be made in two places, and a
|
|
91
|
-
consumer's import said nothing about what it actually used. The package root was
|
|
92
|
-
the same problem at a larger scale: a single barrel of 206 names that no bundler
|
|
93
|
-
could take apart, and the one specifier that revealed nothing at all.
|
|
94
|
-
|
|
95
|
-
Both are deleted. Every name now lives on the subpath that owns it, and every
|
|
96
|
-
import carries that subpath — `@pikku/core/http`, `@pikku/core/services`,
|
|
97
|
-
`@pikku/core/errors`, `@pikku/core/types`.
|
|
98
|
-
|
|
99
|
-
Deleting the facades meant the raw subpaths had to become a superset of them,
|
|
100
|
-
which they were not: the facade tree had accumulated 25 names with no raw home
|
|
101
|
-
and about 26 more filed under a different area than the module they came from.
|
|
102
|
-
Those names moved to the area that owns them, and three areas were published as
|
|
103
|
-
new entry points rather than left on a root that is going away — `./types` (the
|
|
104
|
-
shared type surface, the largest single destination), `./state` and
|
|
105
|
-
`./classification`.
|
|
106
|
-
|
|
107
|
-
`./classification` is one door onto one subject: what a value is and how it must
|
|
108
|
-
be handled. Its three halves would each have been an entry point — the brands
|
|
109
|
-
and manifest types, the stored-form helpers (`hashToken`, `unsafeAsSealed` and
|
|
110
|
-
friends), and `SecretValue` — split by whether a name happens to be a type or a
|
|
111
|
-
value, which is the same defect as the facades. The duration and versioned-id
|
|
112
|
-
helpers went to `./utils`, which already published, and `PikkuRequest` went to
|
|
113
|
-
`./function`: it is the transport-agnostic request base, not an HTTP one — HTTP
|
|
114
|
-
has `PikkuHTTPAbstractRequest`, and the only thing outside core that extends
|
|
115
|
-
`PikkuRequest` is Azure's timer request.
|
|
116
|
-
|
|
117
|
-
`./types` inherited the root barrel's habit before it inherited its contents, so
|
|
118
|
-
the names with an owner elsewhere were moved off it. The middleware types and the
|
|
119
|
-
five middleware factories — `pikkuMiddleware`, `pikkuMiddlewareFactory`,
|
|
120
|
-
`pikkuChannelMiddleware`, `pikkuChannelMiddlewareFactory` and
|
|
121
|
-
`pikkuAgentMiddleware`, runtime values on a types entry point — are now
|
|
122
|
-
`@pikku/core/middleware`; the function meta types are `@pikku/core/function`;
|
|
123
|
-
`SerializedError` is `@pikku/core/errors`; and the generic TypeScript helpers
|
|
124
|
-
(`MakeRequired`, `PickRequired`, `PickOptional`, `RequireAtLeastOne`,
|
|
125
|
-
`JSONPrimitive`, `JSONValue`) are `@pikku/core/utils`. What is left on `./types`
|
|
126
|
-
is the vocabulary the wirings share, which no single module owns.
|
|
127
|
-
|
|
128
|
-
`pikku` was itself a root barrel — `export * from '@pikku/core'` — and
|
|
129
|
-
now exports only the services it bundles.
|
|
130
|
-
|
|
131
|
-
One module survives at the old specifier, and only for the bootstrap:
|
|
132
|
-
`packages/cli` is generated by the _published_ CLI pinned in its `build.sh`, and
|
|
133
|
-
that CLI still writes a bare `@pikku/core` into the files it generates for the
|
|
134
|
-
CLI itself. `bootstrap-compat/root.ts` carries the eight types it names, a test
|
|
135
|
-
in core fails if that list grows, and it goes when the pin moves to a CLI
|
|
136
|
-
released from this branch. The adapter names the pinned CLI reaches for —
|
|
137
|
-
`pikkuState` and `CreateWireServices` — are rewritten to `@pikku/core/state` and
|
|
138
|
-
`@pikku/core/types` by the same `build.sh` patch pass, so no second shim is
|
|
139
|
-
needed for them.
|
|
140
|
-
|
|
141
|
-
A guard test keeps the root shut: it parses imports and rejects a bare
|
|
142
|
-
`@pikku/core` rather than grepping for it, because several tests hold a user's
|
|
143
|
-
file as a template literal, where `import … from '@pikku/core'` is fixture text
|
|
144
|
-
rather than an import this repo makes.
|
|
145
|
-
|
|
146
|
-
An agent scaffold a project generated under an older CLI is refreshed rather
|
|
147
|
-
than left to fail: `pikku all` already deleted one importing an entry point
|
|
148
|
-
`@pikku/core` no longer publishes, and the `#pikku` hub joins that list.
|
|
149
|
-
Without it a project that scaffolds the agent endpoint but
|
|
150
|
-
declares no agents keeps the old file forever — the generator that would rewrite
|
|
151
|
-
it only runs when agents exist, and the file being present is what stops it
|
|
152
|
-
being regenerated as missing.
|
|
153
|
-
|
|
154
|
-
`pikku new addon` also wrote a tsconfig `paths` map naming only the deleted hub.
|
|
155
|
-
An addon's `imports` map points into `dist`, so `paths` is what resolves
|
|
156
|
-
`#pikku/<leaf>` for the addon's own source build — it now names the two leaf
|
|
157
|
-
patterns, in both the addon and its test harness.
|
|
158
|
-
|
|
159
|
-
- 786dae5: Bump every dependency whose latest release is a major across the monorepo, and
|
|
160
|
-
port the code the majors broke: `cookie` 2's `parseCookie`/`stringifySetCookie`
|
|
161
|
-
API in `@pikku/core` and the three runtime HTTP adapters, and assistant-ui 0.15's
|
|
162
|
-
store client in `@pikku/assistant-ui`.
|
|
163
|
-
- 6eef0a0: Bump every dependency to its latest compatible minor/patch across the monorepo.
|
|
164
|
-
- Updated dependencies [7722ceb]
|
|
165
|
-
- Updated dependencies [375c1ff]
|
|
166
|
-
- Updated dependencies [02a70cd]
|
|
167
|
-
- Updated dependencies [aeef159]
|
|
168
|
-
- Updated dependencies [a281de6]
|
|
169
|
-
- Updated dependencies [266e3bc]
|
|
170
|
-
- Updated dependencies [02a70cd]
|
|
171
|
-
- Updated dependencies [786dae5]
|
|
172
|
-
- Updated dependencies [6eef0a0]
|
|
173
|
-
- Updated dependencies [3561d67]
|
|
174
|
-
- Updated dependencies [a91c433]
|
|
175
|
-
- Updated dependencies [02a70cd]
|
|
176
|
-
- Updated dependencies [9537f74]
|
|
177
|
-
- Updated dependencies [2b57ca8]
|
|
178
|
-
- Updated dependencies [266e3bc]
|
|
179
|
-
- Updated dependencies [9fce0f1]
|
|
180
|
-
- Updated dependencies [83683a0]
|
|
181
|
-
- Updated dependencies [456c88b]
|
|
182
|
-
- Updated dependencies [456c88b]
|
|
183
|
-
- Updated dependencies [c127273]
|
|
184
|
-
- @pikku/core@0.12.85
|
|
185
|
-
|
|
186
|
-
## 0.12.6
|
|
187
|
-
|
|
188
|
-
### Patch Changes
|
|
189
|
-
|
|
190
|
-
- 6794681: Publish the ecosystem surface as per-area sub-barrels under `@pikku/core/ecosystem/*`, and point generated code, the CLI, the inspector and the runtime adapters at them.
|
|
191
|
-
|
|
192
|
-
348 names that only generated code, the toolchain or a runtime adapter ever imports now have a second home on `@pikku/core/ecosystem/<area>` — one sub-barrel per area, matching how core already publishes its entrypoints, so no single barrel grows without bound and a consumer only pulls in the area it uses.
|
|
193
|
-
|
|
194
|
-
This step is additive: every name is still exported from the entrypoint it was published from before, so nothing downstream breaks. Removing them from the app-facing barrels is a later change, and needs a release carrying `./ecosystem/*` first.
|
|
195
|
-
|
|
196
|
-
- Updated dependencies [7406bfe]
|
|
197
|
-
- Updated dependencies [6794681]
|
|
198
|
-
- @pikku/core@0.12.84
|
|
199
|
-
|
|
200
|
-
## 0.12.5
|
|
201
|
-
|
|
202
|
-
### Patch Changes
|
|
203
|
-
|
|
204
|
-
- dbff6ae: **A delayed RPC now actually runs.** `InMemorySchedulerService.scheduleRPC`
|
|
205
|
-
dispatched through `runScheduledTask`, which resolves names against the wired
|
|
206
|
-
_cron task_ registry — a registry no internally scheduled RPC is ever in. Every
|
|
207
|
-
such call died as `ScheduledTaskNotFoundError` and was swallowed into a log
|
|
208
|
-
line, and the payload captured alongside it was never forwarded. The one that
|
|
209
|
-
mattered was `pikkuWorkflowSleeper`: it is what wakes a run from
|
|
210
|
-
`workflow.sleep`, so an async workflow containing a sleep stopped at the first
|
|
211
|
-
one and stayed `running` forever. It now invokes the RPC with its data, matching
|
|
212
|
-
what the BullMQ and pg-boss schedulers already do.
|
|
213
|
-
- Updated dependencies [41c1a95]
|
|
214
|
-
- Updated dependencies [ce96383]
|
|
215
|
-
- Updated dependencies [7e60867]
|
|
216
|
-
- Updated dependencies [f8f1244]
|
|
217
|
-
- Updated dependencies [dcf20cb]
|
|
218
|
-
- Updated dependencies [6512384]
|
|
219
|
-
- Updated dependencies [e3b4c14]
|
|
220
|
-
- Updated dependencies [efd0ed1]
|
|
221
|
-
- Updated dependencies [cba98fb]
|
|
222
|
-
- Updated dependencies [ce96383]
|
|
223
|
-
- Updated dependencies [f8f1244]
|
|
224
|
-
- Updated dependencies [f8f1244]
|
|
225
|
-
- Updated dependencies [6e93a35]
|
|
226
|
-
- Updated dependencies [6dada45]
|
|
227
|
-
- @pikku/core@0.12.80
|
|
228
|
-
|
|
229
|
-
## 0.12.4
|
|
230
|
-
|
|
231
|
-
### Patch Changes
|
|
232
|
-
|
|
233
|
-
- daec082: Drop Node 22 support — the minimum supported runtime is now Node 24 (LTS).
|
|
234
|
-
|
|
235
|
-
Node 22 deadlocks `pikku dev` at `loadUserBootstrap` (tsx `register()` + `require(esm)` cycle handling on node 22.12+), and Node 20 is already below our floor. The `engines.node` requirement is raised to `>=24` across all packages, matching `.nvmrc` and the CI test matrix. Closes #751.
|
|
236
|
-
|
|
237
|
-
- Updated dependencies [7b17b14]
|
|
238
|
-
- Updated dependencies [daec082]
|
|
239
|
-
- Updated dependencies [e0fd352]
|
|
240
|
-
- @pikku/core@0.12.58
|
|
241
|
-
|
|
242
|
-
## 0.12.3
|
|
243
|
-
|
|
244
|
-
### Patch Changes
|
|
245
|
-
|
|
246
|
-
- 41ce2cb: Upgrade to TypeScript 6 and raise the minimum Node.js version to 22.
|
|
247
|
-
|
|
248
|
-
All packages now build against `typescript@^6.0.3` and declare `engines.node >= 22`. Internal tooling (`ts-json-schema-generator`, `zod-to-ts`) was bumped to TypeScript 6-compatible releases.
|
|
249
|
-
|
|
250
|
-
- Updated dependencies [41ce2cb]
|
|
251
|
-
- @pikku/core@0.12.44
|
|
252
|
-
|
|
253
|
-
## 0.12.0
|
|
254
|
-
|
|
255
|
-
## 0.12.2
|
|
256
|
-
|
|
257
|
-
### Patch Changes
|
|
258
|
-
|
|
259
|
-
- 3e04565: chore: update dependencies to latest minor/patch versions
|
|
260
|
-
- Updated dependencies [cc4c9e9]
|
|
261
|
-
- Updated dependencies [3e04565]
|
|
262
|
-
- @pikku/core@0.12.2
|
|
263
|
-
|
|
264
|
-
## 0.12.1
|
|
265
|
-
|
|
266
|
-
### Patch Changes
|
|
267
|
-
|
|
268
|
-
- e04531f: Code quality improvements: resolve oxlint warnings and apply autofixes across the codebase (unused bindings, unnecessary constructors, prefer `const` over `let`, etc.). No behaviour changes.
|
|
269
|
-
- Updated dependencies [62a8725]
|
|
270
|
-
- Updated dependencies [a3bdb0d]
|
|
271
|
-
- Updated dependencies [e0349ff]
|
|
272
|
-
- Updated dependencies [62a8725]
|
|
273
|
-
- Updated dependencies [e04531f]
|
|
274
|
-
- Updated dependencies [62a8725]
|
|
275
|
-
- Updated dependencies [a83efb8]
|
|
276
|
-
- Updated dependencies [8eed717]
|
|
277
|
-
- Updated dependencies [62a8725]
|
|
278
|
-
- Updated dependencies [62a8725]
|
|
279
|
-
- Updated dependencies [62a8725]
|
|
280
|
-
- @pikku/core@0.12.1
|
|
281
|
-
|
|
282
|
-
### New Features
|
|
283
|
-
|
|
284
|
-
- `InMemorySchedulerService` replacing `PikkuTaskScheduler` with full `SchedulerService` interface
|
|
285
|
-
- Recurring cron task support via `node-cron`
|
|
286
|
-
- `setServices()`, `start()`, `stop()` lifecycle methods
|
|
287
|
-
|
|
288
|
-
## 0.11.0
|
|
289
|
-
|
|
290
|
-
## 0.11.1
|
|
291
|
-
|
|
292
|
-
### Patch Changes
|
|
293
|
-
|
|
294
|
-
- 4b811db: chore: updating all dependencies
|
|
295
|
-
- 06e1a31: breaking: change session services to wire services
|
|
296
|
-
- Updated dependencies [4b811db]
|
|
297
|
-
- Updated dependencies [e12a00c]
|
|
298
|
-
- Updated dependencies [4579434]
|
|
299
|
-
- Updated dependencies [28aeb7f]
|
|
300
|
-
- Updated dependencies [ce902b1]
|
|
301
|
-
- Updated dependencies [06e1a31]
|
|
302
|
-
- @pikku/core@0.11.1
|
|
303
|
-
|
|
304
|
-
### Minor Changes
|
|
305
|
-
|
|
306
|
-
- Workflow support
|
|
307
|
-
|
|
308
|
-
# @pikku/schedule
|
|
309
|
-
|
|
310
|
-
## 0.10.0
|
|
311
|
-
|
|
312
|
-
This release includes significant improvements across the framework including tree-shaking support, middleware/permission factories, enhanced CLI functionality, improved TypeScript type safety, and comprehensive test strategies.
|
|
313
|
-
|
|
314
|
-
For complete details, see https://pikku.dev/changelogs/0_10_0.md
|
|
315
|
-
|
|
316
|
-
## 0.9.3-next.0
|
|
317
|
-
|
|
318
|
-
### Patch Changes
|
|
319
|
-
|
|
320
|
-
- Updated dependencies
|
|
321
|
-
- @pikku/core@0.9.12-next.0
|
|
322
|
-
|
|
323
|
-
## 0.9.2
|
|
324
|
-
|
|
325
|
-
### Patch Changes
|
|
326
|
-
|
|
327
|
-
- a5905a9: chore: updating all dependencies
|
|
328
|
-
- Updated dependencies [1256238]
|
|
329
|
-
- Updated dependencies [6cf8efd]
|
|
330
|
-
- Updated dependencies [d3a9a09]
|
|
331
|
-
- Updated dependencies [840e078]
|
|
332
|
-
- Updated dependencies [667d23c]
|
|
333
|
-
- Updated dependencies [a5905a9]
|
|
334
|
-
- @pikku/core@0.9.2
|
|
335
|
-
|
|
336
|
-
## 0.9.1
|
|
337
|
-
|
|
338
|
-
### Patch Changes
|
|
339
|
-
|
|
340
|
-
- fdb1593: core: bumping everything with a patch to sync up the major release inconsistencies in dependencies
|
|
341
|
-
- Updated dependencies [fdb1593]
|
|
342
|
-
- @pikku/core@0.9.1
|
|
343
|
-
|
|
344
|
-
## 0.9.0
|
|
345
|
-
|
|
346
|
-
### Breaking Changes
|
|
347
|
-
|
|
348
|
-
- Normalized all transports to use "wirings" instead of events/routes/transports for consistency across the framework
|
|
349
|
-
|
|
350
|
-
## 0.8.0
|
|
351
|
-
|
|
352
|
-
- Updating to match remaining packages
|
|
353
|
-
|
|
354
|
-
## 0.7.0
|
|
355
|
-
|
|
356
|
-
- Updating to match remaining packages
|
|
357
|
-
|
|
358
|
-
## 0.6.2
|
|
359
|
-
|
|
360
|
-
### Patch Changes
|
|
361
|
-
|
|
362
|
-
- ebc04eb: refactor: move all global state into pikku state
|
|
363
|
-
- Updated dependencies [ebc04eb]
|
|
364
|
-
- Updated dependencies [8a14f3a]
|
|
365
|
-
- Updated dependencies [2c47386]
|
|
366
|
-
- @pikku/core@0.6.17
|
|
367
|
-
|
|
368
|
-
## 0.6.1
|
|
369
|
-
|
|
370
|
-
### Patch Changes
|
|
371
|
-
|
|
372
|
-
- 0a92fa7: refactor: pulling schema into seperate package since ajv doesnt work on cloudflare (also keeps bundle size small!)
|
|
373
|
-
- Updated dependencies [0a92fa7]
|
|
374
|
-
- @pikku/core@0.6.7
|
|
375
|
-
|
|
376
|
-
## 0.6
|
|
377
|
-
|
|
378
|
-
Marking a major release to include channels and scheduled tasks
|
|
379
|
-
|
|
380
|
-
## 0.5.5
|
|
381
|
-
|
|
382
|
-
### Patch Changes
|
|
383
|
-
|
|
384
|
-
- 662a6cf: feat: adding scheduled tasks names
|
|
385
|
-
- Updated dependencies [662a6cf]
|
|
386
|
-
- Updated dependencies [c8578ea]
|
|
387
|
-
- Updated dependencies [d2f8edf]
|
|
388
|
-
- @pikku/core@0.5.29
|
|
389
|
-
|
|
390
|
-
## 0.5.4
|
|
391
|
-
|
|
392
|
-
### Patch Changes
|
|
393
|
-
|
|
394
|
-
- 886a2fb: refactor: moving singletons (like routes and channels) to global to avoid nodemodule overrides
|
|
395
|
-
- Updated dependencies [a768bad]
|
|
396
|
-
- Updated dependencies [886a2fb]
|
|
397
|
-
- Updated dependencies [886a2fb]
|
|
398
|
-
- @pikku/core@0.5.28
|
|
399
|
-
|
|
400
|
-
## 0.5.3
|
|
401
|
-
|
|
402
|
-
### Patch Changes
|
|
403
|
-
|
|
404
|
-
- 0f96787: refactor: dropping cjs support
|
|
405
|
-
- c23524a: refactor: bump to versions to ensure correct package usage
|
|
406
|
-
- Updated dependencies [0f96787]
|
|
407
|
-
- Updated dependencies [64e4a1e]
|
|
408
|
-
- Updated dependencies [c23524a]
|
|
409
|
-
- @pikku/core@0.5.25
|
|
410
|
-
|
|
411
|
-
## 0.5.2
|
|
412
|
-
|
|
413
|
-
### Patch Changes
|
|
414
|
-
|
|
415
|
-
- bba25cc: chore: updating all packages to reflect major changes
|
|
416
|
-
- Updated dependencies [bba25cc]
|
|
417
|
-
- Updated dependencies [9deb482]
|
|
418
|
-
- Updated dependencies [ee0c6ea]
|
|
419
|
-
- @pikku/core@0.5.24
|
|
420
|
-
|
|
421
|
-
## 0.5.1
|
|
422
|
-
|
|
423
|
-
### Patch Changes
|
|
424
|
-
|
|
425
|
-
- 7fa64a0: feat: making schedule session services optional
|
|
426
|
-
- 539937e: refactor: use a map instead for scheduled tasks
|
|
427
|
-
- Updated dependencies [7fa64a0]
|
|
428
|
-
- Updated dependencies [539937e]
|
|
429
|
-
- Updated dependencies [e9a9968]
|
|
430
|
-
- @pikku/core@0.5.23
|
package/knowledge/index.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: overview
|
|
3
|
-
title: Knowledge
|
|
4
|
-
description: Questions raised by the schedule package's in-memory scheduler
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Knowledge
|
|
8
|
-
|
|
9
|
-
Questions about how the schedule package runs delayed work, where the code does not say what is intended.
|
|
10
|
-
|
|
11
|
-
<!-- pikku:knowledge-index -->
|
|
12
|
-
- [questions](questions/index.md) — something asked and not yet answered
|
|
13
|
-
<!-- /pikku:knowledge-index -->
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: overview
|
|
3
|
-
title: Questions
|
|
4
|
-
description: Things asked of the schedule package and not yet answered
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Questions
|
|
8
|
-
|
|
9
|
-
Something asked and not yet answered. The choice stays, the doubt gets recorded.
|
|
10
|
-
|
|
11
|
-
<!-- pikku:knowledge-index -->
|
|
12
|
-
- [Should a delayed RPC run as the session it was scheduled with?](should-a-delayed-rpc-run-as-the-session-it-was-scheduled-with.md) — The in-memory scheduler stores the session with the task and returns it from getTask, but the timer runs the RPC without it
|
|
13
|
-
<!-- /pikku:knowledge-index -->
|
package/knowledge/questions/should-a-delayed-rpc-run-as-the-session-it-was-scheduled-with.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: question
|
|
3
|
-
title: Should a delayed RPC run as the session it was scheduled with?
|
|
4
|
-
description: The in-memory scheduler stores the session with the task and returns it from getTask, but the timer runs the RPC without it
|
|
5
|
-
tags: [schedule, sessions, rpc]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Should a delayed RPC run as the session it was scheduled with?
|
|
9
|
-
|
|
10
|
-
`scheduleRPC` in `packages/schedule/src/in-memory-scheduler-service.ts` takes an optional `session`
|
|
11
|
-
(line 45). It stores it on the task (lines 85-92), and `getTask` returns it (line 115).
|
|
12
|
-
|
|
13
|
-
The timer callback `run` (line 52) calls `rpcService.getContextRPCService(services, {}, false)` (lines 69-74)
|
|
14
|
-
and then `rpc.invoke(rpcName, data)` (line 75). The `session` is not passed to either call and is not in
|
|
15
|
-
scope inside `run`.
|
|
16
|
-
|
|
17
|
-
The comment at lines 67-68 says the BullMQ and pg-boss schedulers "enqueue `{ rpcName, data, session }`
|
|
18
|
-
and invoke the RPC with it". This file does not do that for the session.
|
|
19
|
-
|
|
20
|
-
Question: should the in-memory scheduler run the RPC as the captured session, as the comment says the other
|
|
21
|
-
schedulers do, or is a delayed RPC meant to run with no user? The code does not settle it, and no note in
|
|
22
|
-
this package records the choice.
|
package/run-tests.sh
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Enable nullglob to handle cases where no files match the pattern
|
|
4
|
-
shopt -s nullglob
|
|
5
|
-
|
|
6
|
-
# Initialize variables for options
|
|
7
|
-
watch_mode=false
|
|
8
|
-
coverage_mode=false
|
|
9
|
-
|
|
10
|
-
# Parse command-line options
|
|
11
|
-
while [[ $# -gt 0 ]]; do
|
|
12
|
-
case $1 in
|
|
13
|
-
--watch)
|
|
14
|
-
watch_mode=true
|
|
15
|
-
shift
|
|
16
|
-
;;
|
|
17
|
-
--coverage)
|
|
18
|
-
coverage_mode=true
|
|
19
|
-
shift
|
|
20
|
-
;;
|
|
21
|
-
*)
|
|
22
|
-
echo "Unknown option: $1"
|
|
23
|
-
exit 1
|
|
24
|
-
;;
|
|
25
|
-
esac
|
|
26
|
-
done
|
|
27
|
-
|
|
28
|
-
# Define the pattern to match your test files
|
|
29
|
-
pattern="src/*.test.ts"
|
|
30
|
-
|
|
31
|
-
# Expand the pattern into an array of files
|
|
32
|
-
files=($(find src -type f -name "*.test.ts"))
|
|
33
|
-
|
|
34
|
-
# Check if any files matched the pattern
|
|
35
|
-
if [ ${#files[@]} -eq 0 ]; then
|
|
36
|
-
echo "No test files found matching pattern: $pattern"
|
|
37
|
-
if [ "${STRICT_TEST_DISCOVERY}" = "1" ]; then
|
|
38
|
-
exit 1
|
|
39
|
-
fi
|
|
40
|
-
exit 0
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
# Construct the bun command
|
|
44
|
-
#
|
|
45
|
-
# --parallel gives every test file its own worker process, which is what node's
|
|
46
|
-
# `--test` did. Several suites keep module-level caches (a TypeScript program, a
|
|
47
|
-
# temp fixture directory) that a shared process would leak between files.
|
|
48
|
-
#
|
|
49
|
-
# --timeout because bun caps a test at 5s by default where node had no cap, and
|
|
50
|
-
# the suites that build real TypeScript programs run well past that.
|
|
51
|
-
bun_cmd=(bun test --parallel --timeout 120000)
|
|
52
|
-
|
|
53
|
-
# Append options based on flags
|
|
54
|
-
if [ "$watch_mode" = true ]; then
|
|
55
|
-
# --watch reruns in one process; parallel workers have nothing to watch.
|
|
56
|
-
bun_cmd=(bun test --watch --timeout 120000)
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
if [ "$coverage_mode" = true ]; then
|
|
60
|
-
# --coverage-dir=. keeps lcov.info at the package root: CI merges every
|
|
61
|
-
# package's report by prefixing its SF paths with the file's own directory,
|
|
62
|
-
# so a nested coverage/ directory would re-root them one level too deep.
|
|
63
|
-
bun_cmd+=(--coverage --coverage-reporter=lcov --coverage-reporter=text --coverage-dir=.)
|
|
64
|
-
export PIKKU_TEST_COVERAGE=1
|
|
65
|
-
fi
|
|
66
|
-
|
|
67
|
-
# Execute the bun command with the expanded list of files
|
|
68
|
-
"${bun_cmd[@]}" "${files[@]}"
|