@pikku/cli 0.12.72 → 0.12.74
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/.pikku/agent/pikku-agent-types.gen.d.ts +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/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/console/pikku-node-types.gen.d.ts +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 +1 -1
- package/dist/.pikku/function/pikku-functions.gen.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/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.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/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.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/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/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/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.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/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/bun-coverage-loader.js +7 -4
- package/dist/src/functions/commands/dev.js +19 -5
- package/dist/src/utils/tsc-check.js +24 -6
- package/package.json +3 -3
|
@@ -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.74
|
|
3
3
|
*/
|
|
4
4
|
import { CoreAIAgent, PikkuAIMiddlewareHooks } from '@pikku/core/ai-agent';
|
|
5
5
|
import type { PikkuPermission, PikkuMiddleware, Services, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js';
|
|
@@ -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.74
|
|
3
3
|
*/
|
|
4
4
|
export { wireVariable } from '@pikku/core/variable';
|
|
5
5
|
export type { CoreVariable, VariableDefinitionMeta, VariableDefinitionsMeta } from '@pikku/core/variable';
|
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.74') {
|
|
15
|
+
process.stderr.write(`\n Update available 0.12.74 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
|
|
16
16
|
}
|
|
17
17
|
} catch {}
|
|
18
18
|
}
|
|
@@ -31,11 +31,14 @@ export async function registerBunCoverageLoader({ rootDir, }) {
|
|
|
31
31
|
name: 'pikku-istanbul-coverage',
|
|
32
32
|
setup(build) {
|
|
33
33
|
build.onLoad({ filter }, async (args) => {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
// Bun (≥1.3.14) rejects `return undefined` from onLoad with
|
|
35
|
+
// "onLoad() expects an object returned", so non-instrumented files
|
|
36
|
+
// (.gen/.test/.d, node_modules) pass through as an object instead.
|
|
36
37
|
const source = await readFile(args.path, 'utf-8');
|
|
37
|
-
const
|
|
38
|
-
|
|
38
|
+
const loader = args.path.endsWith('.tsx') ? 'tsx' : 'ts';
|
|
39
|
+
if (!shouldInstrument(args.path))
|
|
40
|
+
return { contents: source, loader };
|
|
41
|
+
return { contents: instrumenter.instrumentSync(source, args.path), loader };
|
|
39
42
|
});
|
|
40
43
|
},
|
|
41
44
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join, resolve } from 'path';
|
|
2
2
|
import { pikkuSessionlessFunc } from '#pikku';
|
|
3
3
|
import chokidar from 'chokidar';
|
|
4
|
-
import { pikkuDevReloader } from '@pikku/core/dev';
|
|
4
|
+
import { pikkuDevReloader, reloadGeneratedMeta } from '@pikku/core/dev';
|
|
5
5
|
import { ConsoleLogger, LocalEmailService, spy, InMemoryQueueService, InMemoryWorkflowService, InMemoryTriggerService, InMemoryAIRunStateService, } from '@pikku/core/services';
|
|
6
6
|
import { KyselyAIStorageService, KyselyAIRunStateService, KyselyAgentRunService, } from '@pikku/kysely';
|
|
7
7
|
import { stopSingletonServices } from '@pikku/core';
|
|
@@ -252,12 +252,12 @@ export const dev = pikkuSessionlessFunc({
|
|
|
252
252
|
process.exit(0);
|
|
253
253
|
}
|
|
254
254
|
});
|
|
255
|
-
|
|
256
|
-
await pikkuDevReloader({
|
|
255
|
+
const devReloader = enableHmr
|
|
256
|
+
? await pikkuDevReloader({
|
|
257
257
|
srcDirectories: watchDirectories,
|
|
258
258
|
logger,
|
|
259
|
-
})
|
|
260
|
-
|
|
259
|
+
})
|
|
260
|
+
: undefined;
|
|
261
261
|
if (enableWatch) {
|
|
262
262
|
const genIgnore = /\.gen\.tsx?$/;
|
|
263
263
|
configWatcher = chokidar.watch(watchDirectories, {
|
|
@@ -278,6 +278,20 @@ export const dev = pikkuSessionlessFunc({
|
|
|
278
278
|
invalidateInspectorState();
|
|
279
279
|
await runAllWithCommandState();
|
|
280
280
|
workflowService.wireQueueWorkers();
|
|
281
|
+
// Pull the regenerated meta + JSON schemas into the running
|
|
282
|
+
// process so new/changed functions are callable without a
|
|
283
|
+
// restart (the hot-reloader registers their implementations).
|
|
284
|
+
await reloadGeneratedMeta({
|
|
285
|
+
pikkuDir,
|
|
286
|
+
logger,
|
|
287
|
+
schemaService: resolvedServices.schema,
|
|
288
|
+
});
|
|
289
|
+
// Re-import recently changed files now that the fresh meta is
|
|
290
|
+
// in state: wire* calls skip routes whose meta doesn't exist,
|
|
291
|
+
// so a NEW route in a changed wiring file only registers on
|
|
292
|
+
// this post-codegen pass (the reloader's instant pass ran too
|
|
293
|
+
// early to see it).
|
|
294
|
+
await devReloader?.reimportPending();
|
|
281
295
|
logger.info({
|
|
282
296
|
message: `✓ Generated in ${Date.now() - start}ms`,
|
|
283
297
|
type: 'timing',
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import { dirname, isAbsolute, relative } from 'node:path';
|
|
2
|
+
import { dirname, isAbsolute, join, relative } from 'node:path';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
3
4
|
import { PikkuError } from '@pikku/core';
|
|
5
|
+
// Type-check with the PROJECT's own TypeScript when it has one — the CLI's
|
|
6
|
+
// bundled compiler can be a different major (e.g. TS 6 vs a project on TS 5)
|
|
7
|
+
// and produce diagnostics the project's real `tsc` never would (seen as
|
|
8
|
+
// phantom TS2591 "Cannot find name 'process'" on a tsconfig that is clean
|
|
9
|
+
// under the project's compiler). Falls back to the CLI's typescript.
|
|
10
|
+
const loadProjectTs = (rootDir) => {
|
|
11
|
+
try {
|
|
12
|
+
return createRequire(join(rootDir, 'noop.cjs'))('typescript');
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return ts;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
4
18
|
// A type-check failure is expected (the --tsc gate did its job) — throw a
|
|
5
19
|
// PikkuError so the runner logs the message alone, not a stack trace.
|
|
6
20
|
export class PikkuTypecheckFailedError extends PikkuError {
|
|
@@ -108,12 +122,13 @@ export const renderTscFull = (diagnostics, rootDir, formatHost) => {
|
|
|
108
122
|
* so the caller can pick the compact (`--tsc-summary`) or full (`--tsc`) render.
|
|
109
123
|
*/
|
|
110
124
|
export const runProjectTypecheck = (tsconfigPath, rootDir) => {
|
|
125
|
+
const tsImpl = loadProjectTs(rootDir);
|
|
111
126
|
const formatHost = {
|
|
112
127
|
getCanonicalFileName: (f) => f,
|
|
113
128
|
getCurrentDirectory: () => rootDir,
|
|
114
|
-
getNewLine: () =>
|
|
129
|
+
getNewLine: () => tsImpl.sys.newLine,
|
|
115
130
|
};
|
|
116
|
-
const configFile =
|
|
131
|
+
const configFile = tsImpl.readConfigFile(tsconfigPath, tsImpl.sys.readFile);
|
|
117
132
|
if (configFile.error) {
|
|
118
133
|
const diagnostics = [configFile.error];
|
|
119
134
|
return {
|
|
@@ -122,8 +137,8 @@ export const runProjectTypecheck = (tsconfigPath, rootDir) => {
|
|
|
122
137
|
formatHost,
|
|
123
138
|
};
|
|
124
139
|
}
|
|
125
|
-
const parsed =
|
|
126
|
-
const program =
|
|
140
|
+
const parsed = tsImpl.parseJsonConfigFileContent(configFile.config, tsImpl.sys, dirname(tsconfigPath));
|
|
141
|
+
const program = tsImpl.createProgram({
|
|
127
142
|
rootNames: parsed.fileNames,
|
|
128
143
|
options: {
|
|
129
144
|
...parsed.options,
|
|
@@ -132,7 +147,10 @@ export const runProjectTypecheck = (tsconfigPath, rootDir) => {
|
|
|
132
147
|
tsBuildInfoFile: undefined,
|
|
133
148
|
},
|
|
134
149
|
});
|
|
135
|
-
const diagnostics = [
|
|
150
|
+
const diagnostics = [
|
|
151
|
+
...parsed.errors,
|
|
152
|
+
...tsImpl.getPreEmitDiagnostics(program),
|
|
153
|
+
];
|
|
136
154
|
return {
|
|
137
155
|
result: collectTscDiagnostics(diagnostics, rootDir),
|
|
138
156
|
diagnostics,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/cli",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.74",
|
|
4
4
|
"author": "yasser.fadl@gmail.com",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"imports": {
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"zod-to-ts": "^2.1.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@pikku/core": "^0.12.
|
|
62
|
+
"@pikku/core": "^0.12.57"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@pikku/core": "^0.12.
|
|
65
|
+
"@pikku/core": "^0.12.57",
|
|
66
66
|
"@types/istanbul-lib-instrument": "^1.7.7",
|
|
67
67
|
"@types/node": "^24.11.0",
|
|
68
68
|
"@types/pg": "^8.11.0",
|