@pikku/cli 0.12.112 → 0.12.113
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 +21 -0
- package/dist/.pikku/addon/index.d.ts +1 -1
- package/dist/.pikku/addon/index.js +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
- package/dist/.pikku/agent/index.d.ts +1 -1
- package/dist/.pikku/agent/index.js +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
- package/dist/.pikku/auth/index.d.ts +1 -1
- package/dist/.pikku/auth/index.js +1 -1
- package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +1 -1
- package/dist/.pikku/auth/pikku-auth-types.gen.js +1 -1
- package/dist/.pikku/channel/index.d.ts +1 -1
- package/dist/.pikku/channel/index.js +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/index.d.ts +1 -1
- package/dist/.pikku/cli/index.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/error/index.d.ts +1 -1
- package/dist/.pikku/error/index.js +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
- package/dist/.pikku/function/index.d.ts +1 -1
- package/dist/.pikku/function/index.js +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +2 -2
- package/dist/.pikku/function/pikku-functions.gen.js +1 -1
- package/dist/.pikku/gateway/index.d.ts +1 -1
- package/dist/.pikku/gateway/index.js +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
- package/dist/.pikku/http/index.d.ts +1 -1
- package/dist/.pikku/http/index.js +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/mcp/index.d.ts +1 -1
- package/dist/.pikku/mcp/index.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/middleware/index.d.ts +1 -1
- package/dist/.pikku/middleware/index.js +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +1 -1
- package/dist/.pikku/queue/index.d.ts +1 -1
- package/dist/.pikku/queue/index.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/scenarios/index.d.ts +1 -1
- package/dist/.pikku/scenarios/index.js +1 -1
- package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/scheduler/index.d.ts +1 -1
- package/dist/.pikku/scheduler/index.js +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +1 -1
- package/dist/.pikku/scopes/index.d.ts +1 -1
- package/dist/.pikku/scopes/index.js +1 -1
- package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
- package/dist/.pikku/secrets/index.d.ts +1 -1
- package/dist/.pikku/secrets/index.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/setup/index.d.ts +1 -1
- package/dist/.pikku/setup/index.js +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
- package/dist/.pikku/trigger/index.d.ts +1 -1
- package/dist/.pikku/trigger/index.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/index.d.ts +1 -1
- package/dist/.pikku/variables/index.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/index.d.ts +1 -1
- package/dist/.pikku/workflow/index.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/src/functions/commands/dev.js +72 -62
- package/dist/src/functions/commands/watch.js +56 -37
- package/package.json +1 -1
- package/surface.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.113
|
|
3
3
|
*/
|
|
4
4
|
import { WorkflowCancelledException } from '@pikku/core/workflow';
|
|
5
5
|
import type { PikkuWorkflowGraphConfig, PikkuWorkflowGraphResult } from '@pikku/core/workflow';
|
package/dist/bin/pikku-bin.mjs
CHANGED
|
@@ -11,8 +11,8 @@ async function checkForUpdate() {
|
|
|
11
11
|
})
|
|
12
12
|
if (!res.ok) return
|
|
13
13
|
const { version: latest } = await res.json()
|
|
14
|
-
if (latest !== '0.12.
|
|
15
|
-
process.stderr.write(`\n Update available 0.12.
|
|
14
|
+
if (latest !== '0.12.113') {
|
|
15
|
+
process.stderr.write(`\n Update available 0.12.113 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
|
|
16
16
|
}
|
|
17
17
|
} catch {}
|
|
18
18
|
}
|
|
@@ -298,14 +298,12 @@ export const dev = pikkuSessionlessFunc({
|
|
|
298
298
|
logger.info(`Pikku Console available at http://${hostname}:${resolvedPort}${consoleMount.urlPrefix}`);
|
|
299
299
|
}
|
|
300
300
|
logger.info(serverReadyLine(hostname, resolvedPort));
|
|
301
|
-
let configWatcher;
|
|
302
301
|
let watcher;
|
|
303
302
|
process.once('SIGINT', async () => {
|
|
304
303
|
logger.info('Stopping dev server...');
|
|
305
304
|
try {
|
|
306
305
|
await lifecycle?.beforeStop?.(resolvedServices);
|
|
307
306
|
await stopSingletonServices();
|
|
308
|
-
await configWatcher?.close();
|
|
309
307
|
await watcher?.close();
|
|
310
308
|
await pikkuServer.stop();
|
|
311
309
|
await lifecycle?.afterStop?.(resolvedServices);
|
|
@@ -322,72 +320,84 @@ export const dev = pikkuSessionlessFunc({
|
|
|
322
320
|
: undefined;
|
|
323
321
|
if (enableWatch) {
|
|
324
322
|
const genIgnore = /\.gen\.tsx?$/;
|
|
325
|
-
|
|
323
|
+
logger.info(`• Watching directories: \n - ${watchDirectories.join('\n - ')}`);
|
|
324
|
+
watcher = chokidar.watch(watchDirectories, {
|
|
326
325
|
ignoreInitial: true,
|
|
327
326
|
ignored: genIgnore,
|
|
328
327
|
});
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
328
|
+
watcher.on('ready', async () => {
|
|
329
|
+
const handle = async () => {
|
|
330
|
+
try {
|
|
331
|
+
const start = Date.now();
|
|
332
|
+
invalidateInspectorState();
|
|
333
|
+
await runAllWithCommandState();
|
|
334
|
+
workflowService.wireQueueWorkers();
|
|
335
|
+
wireAgentScorerQueueWorkers();
|
|
336
|
+
// Pull the regenerated meta + JSON schemas into the running
|
|
337
|
+
// process so new/changed functions are callable without a
|
|
338
|
+
// restart (the hot-reloader registers their implementations).
|
|
339
|
+
await reloadGeneratedMeta({
|
|
340
|
+
pikkuDir,
|
|
341
|
+
logger,
|
|
342
|
+
schemaService: resolvedServices.schema,
|
|
343
|
+
});
|
|
344
|
+
// Re-import recently changed files now that the fresh meta is
|
|
345
|
+
// in state: wire* calls skip routes whose meta doesn't exist,
|
|
346
|
+
// so a NEW route in a changed wiring file only registers on
|
|
347
|
+
// this post-codegen pass (the reloader's instant pass ran too
|
|
348
|
+
// early to see it).
|
|
349
|
+
await devReloader?.reimportPending();
|
|
350
|
+
// reimportPending only re-runs wire* for changed/added files, so a
|
|
351
|
+
// DELETED *.addon.ts leaves its wireAddon entry stranded in the
|
|
352
|
+
// live registry. Prune it against the inspection runAllWithCommandState
|
|
353
|
+
// already produced this pass — a plain read (no refresh) reuses that
|
|
354
|
+
// fresh post-change cache. Forcing refresh=true here re-inspected the
|
|
355
|
+
// whole project a SECOND time: the codegen writes after that inspection
|
|
356
|
+
// bump the ts-write generation, so refresh treats the cache as stale.
|
|
357
|
+
const { rpc } = await getInspectorState();
|
|
358
|
+
reconcileAddonRegistry(rpc.wireAddonDeclarations.keys(), logger);
|
|
359
|
+
logger.info({
|
|
360
|
+
message: `✓ Generated in ${Date.now() - start}ms`,
|
|
361
|
+
type: 'timing',
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
catch (err) {
|
|
365
|
+
logger.error(`Error running watch: ${err}`);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
// A codegen pass holds a whole ts.Program, so two overlapping passes
|
|
369
|
+
// double the peak RSS — enough to OOM a sandbox. Coalesce instead:
|
|
370
|
+
// changes arriving mid-pass schedule exactly one more run after it.
|
|
371
|
+
let inFlight;
|
|
372
|
+
let queued = false;
|
|
373
|
+
const runHandle = async () => {
|
|
374
|
+
if (inFlight) {
|
|
375
|
+
queued = true;
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
do {
|
|
379
|
+
queued = false;
|
|
380
|
+
inFlight = handle();
|
|
338
381
|
try {
|
|
339
|
-
|
|
340
|
-
invalidateInspectorState();
|
|
341
|
-
await runAllWithCommandState();
|
|
342
|
-
workflowService.wireQueueWorkers();
|
|
343
|
-
wireAgentScorerQueueWorkers();
|
|
344
|
-
// Pull the regenerated meta + JSON schemas into the running
|
|
345
|
-
// process so new/changed functions are callable without a
|
|
346
|
-
// restart (the hot-reloader registers their implementations).
|
|
347
|
-
await reloadGeneratedMeta({
|
|
348
|
-
pikkuDir,
|
|
349
|
-
logger,
|
|
350
|
-
schemaService: resolvedServices.schema,
|
|
351
|
-
});
|
|
352
|
-
// Re-import recently changed files now that the fresh meta is
|
|
353
|
-
// in state: wire* calls skip routes whose meta doesn't exist,
|
|
354
|
-
// so a NEW route in a changed wiring file only registers on
|
|
355
|
-
// this post-codegen pass (the reloader's instant pass ran too
|
|
356
|
-
// early to see it).
|
|
357
|
-
await devReloader?.reimportPending();
|
|
358
|
-
// reimportPending only re-runs wire* for changed/added files, so a
|
|
359
|
-
// DELETED *.addon.ts leaves its wireAddon entry stranded in the
|
|
360
|
-
// live registry. Prune it against the inspection runAllWithCommandState
|
|
361
|
-
// already produced this pass — a plain read (no refresh) reuses that
|
|
362
|
-
// fresh post-change cache. Forcing refresh=true here re-inspected the
|
|
363
|
-
// whole project a SECOND time: the codegen writes after that inspection
|
|
364
|
-
// bump the ts-write generation, so refresh treats the cache as stale.
|
|
365
|
-
const { rpc } = await getInspectorState();
|
|
366
|
-
reconcileAddonRegistry(rpc.wireAddonDeclarations.keys(), logger);
|
|
367
|
-
logger.info({
|
|
368
|
-
message: `✓ Generated in ${Date.now() - start}ms`,
|
|
369
|
-
type: 'timing',
|
|
370
|
-
});
|
|
382
|
+
await inFlight;
|
|
371
383
|
}
|
|
372
|
-
|
|
373
|
-
|
|
384
|
+
finally {
|
|
385
|
+
inFlight = undefined;
|
|
374
386
|
}
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
};
|
|
389
|
-
configWatcher.on('ready', generatorWatcher);
|
|
390
|
-
configWatcher.on('change', generatorWatcher);
|
|
387
|
+
} while (queued);
|
|
388
|
+
};
|
|
389
|
+
await runHandle();
|
|
390
|
+
let timeout;
|
|
391
|
+
const deduped = (_file) => {
|
|
392
|
+
if (timeout) {
|
|
393
|
+
clearTimeout(timeout);
|
|
394
|
+
}
|
|
395
|
+
timeout = setTimeout(runHandle, 10);
|
|
396
|
+
};
|
|
397
|
+
watcher?.on('change', deduped);
|
|
398
|
+
watcher?.on('add', deduped);
|
|
399
|
+
watcher?.on('unlink', deduped);
|
|
400
|
+
});
|
|
391
401
|
}
|
|
392
402
|
await new Promise(() => { });
|
|
393
403
|
},
|