@pikku/cli 0.12.78 → 0.12.79
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.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/utils/assert-single-core-version.d.ts +25 -8
- package/dist/src/utils/assert-single-core-version.js +130 -9
- package/package.json +4 -4
|
@@ -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.79
|
|
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.79
|
|
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.79') {
|
|
15
|
+
process.stderr.write(`\n Update available 0.12.79 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
|
|
16
16
|
}
|
|
17
17
|
} catch {}
|
|
18
18
|
}
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Minimal semver range check for the shapes @pikku/cli publishes in its own
|
|
3
|
+
* peerDependencies (exact, ^, ~, >=/>/<=/< comparators, space-joined ANDs,
|
|
4
|
+
* || unions). Returns null when the range is not understood so the caller
|
|
5
|
+
* skips the check instead of false-blocking a build. No prerelease handling —
|
|
6
|
+
* a prerelease compares as its base version.
|
|
7
|
+
*/
|
|
8
|
+
export declare function coreSatisfiesRange(version: string, range: string): boolean | null;
|
|
9
|
+
/**
|
|
10
|
+
* Fail the build when the installed @pikku/core cannot work with this CLI.
|
|
11
|
+
*
|
|
12
|
+
* Two distinct failure classes, checked in order:
|
|
13
|
+
*
|
|
14
|
+
* 1. SPLIT (PKU717): more than one @pikku/core version installed. Two module
|
|
15
|
+
* instances means two separate pikkuState registries at runtime — wirings
|
|
16
|
+
* (workflows, RPCs, queue workers, middleware) register into whichever copy
|
|
17
|
+
* the wiring files import, while the runner may read the other, so they
|
|
18
|
+
* silently fail to resolve (the classic symptom being `WorkflowNotFoundError`
|
|
19
|
+
* for a workflow that is plainly registered). Distinct versions are the
|
|
20
|
+
* reliable signal: package managers dedupe identical versions to one physical
|
|
21
|
+
* copy, so >1 version guarantees a split.
|
|
3
22
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* registered). Distinct versions are the reliable signal: package managers dedupe
|
|
10
|
-
* identical versions to one physical copy, so >1 version guarantees a split.
|
|
23
|
+
* 2. SKEW (PKU718): exactly one @pikku/core, but its version violates the CLI's
|
|
24
|
+
* own @pikku/core peer range. Some package managers (bun, yarn) install past
|
|
25
|
+
* an unsatisfied peer range instead of failing, and the resulting pair breaks
|
|
26
|
+
* codegen/runtime with cryptic missing-export errors. Fail here with the
|
|
27
|
+
* exact versions instead.
|
|
11
28
|
*/
|
|
12
29
|
export declare function assertSingleCoreVersion(rootDir: string, logger: {
|
|
13
30
|
warn: (message: string) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { realpathSync } from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
4
5
|
import { glob } from 'tinyglobby';
|
|
5
6
|
import { ErrorCode } from '@pikku/inspector';
|
|
6
7
|
// Bounded globs (no unbounded `**`) covering the real @pikku/core copies each
|
|
@@ -14,15 +15,109 @@ const PATTERNS = [
|
|
|
14
15
|
'@*/*/node_modules/@pikku/core/package.json',
|
|
15
16
|
];
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* Minimal semver range check for the shapes @pikku/cli publishes in its own
|
|
19
|
+
* peerDependencies (exact, ^, ~, >=/>/<=/< comparators, space-joined ANDs,
|
|
20
|
+
* || unions). Returns null when the range is not understood so the caller
|
|
21
|
+
* skips the check instead of false-blocking a build. No prerelease handling —
|
|
22
|
+
* a prerelease compares as its base version.
|
|
23
|
+
*/
|
|
24
|
+
export function coreSatisfiesRange(version, range) {
|
|
25
|
+
const parse = (v) => {
|
|
26
|
+
const m = /^(\d+)\.(\d+)\.(\d+)/.exec(v);
|
|
27
|
+
return m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;
|
|
28
|
+
};
|
|
29
|
+
const cmp = (a, b) => {
|
|
30
|
+
for (let i = 0; i < 3; i++)
|
|
31
|
+
if (a[i] !== b[i])
|
|
32
|
+
return a[i] - b[i];
|
|
33
|
+
return 0;
|
|
34
|
+
};
|
|
35
|
+
const ver = parse(version);
|
|
36
|
+
if (!ver)
|
|
37
|
+
return null;
|
|
38
|
+
const comparator = (c) => {
|
|
39
|
+
const m = /^(\^|~|>=|<=|>|<|=)?\s*(\d+\.\d+\.\d+)$/.exec(c.trim());
|
|
40
|
+
if (!m)
|
|
41
|
+
return null;
|
|
42
|
+
const op = m[1] ?? '=';
|
|
43
|
+
const bound = parse(m[2]);
|
|
44
|
+
if (op === '>=')
|
|
45
|
+
return cmp(ver, bound) >= 0;
|
|
46
|
+
if (op === '>')
|
|
47
|
+
return cmp(ver, bound) > 0;
|
|
48
|
+
if (op === '<=')
|
|
49
|
+
return cmp(ver, bound) <= 0;
|
|
50
|
+
if (op === '<')
|
|
51
|
+
return cmp(ver, bound) < 0;
|
|
52
|
+
if (op === '=')
|
|
53
|
+
return cmp(ver, bound) === 0;
|
|
54
|
+
if (cmp(ver, bound) < 0)
|
|
55
|
+
return false;
|
|
56
|
+
// upper bound: ^ bumps the leftmost non-zero part; ~ bumps the minor
|
|
57
|
+
let upper;
|
|
58
|
+
if (op === '~')
|
|
59
|
+
upper = [bound[0], bound[1] + 1, 0];
|
|
60
|
+
else if (bound[0] > 0)
|
|
61
|
+
upper = [bound[0] + 1, 0, 0];
|
|
62
|
+
else if (bound[1] > 0)
|
|
63
|
+
upper = [0, bound[1] + 1, 0];
|
|
64
|
+
else
|
|
65
|
+
upper = [0, 0, bound[2] + 1];
|
|
66
|
+
return cmp(ver, upper) < 0;
|
|
67
|
+
};
|
|
68
|
+
for (const clause of range.split('||')) {
|
|
69
|
+
const comparators = clause.trim().split(/\s+/).filter(Boolean);
|
|
70
|
+
if (comparators.length === 0)
|
|
71
|
+
continue;
|
|
72
|
+
const results = comparators.map(comparator);
|
|
73
|
+
if (results.includes(null))
|
|
74
|
+
return null;
|
|
75
|
+
if (results.every(Boolean))
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
// The CLI's own package.json — version + declared @pikku/core peer range.
|
|
81
|
+
// Dual path like get-cli-version.ts: ../../ from src/, ../../../ from dist/src/.
|
|
82
|
+
async function getCliManifest() {
|
|
83
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
84
|
+
for (const rel of ['../..', '../../..']) {
|
|
85
|
+
const raw = await readFile(path.join(here, rel, 'package.json'), 'utf-8').catch(() => '');
|
|
86
|
+
if (!raw)
|
|
87
|
+
continue;
|
|
88
|
+
try {
|
|
89
|
+
const pkg = JSON.parse(raw);
|
|
90
|
+
if (pkg.name !== '@pikku/cli')
|
|
91
|
+
continue;
|
|
92
|
+
const corePeerRange = pkg.peerDependencies?.['@pikku/core'];
|
|
93
|
+
if (typeof pkg.version === 'string' && typeof corePeerRange === 'string')
|
|
94
|
+
return { version: pkg.version, corePeerRange };
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Unparseable manifest — try the other layout.
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Fail the build when the installed @pikku/core cannot work with this CLI.
|
|
104
|
+
*
|
|
105
|
+
* Two distinct failure classes, checked in order:
|
|
18
106
|
*
|
|
19
|
-
*
|
|
20
|
-
* separate pikkuState registries
|
|
21
|
-
* workers, middleware) register into whichever copy
|
|
22
|
-
* while the runner may read the other, so they
|
|
23
|
-
* classic symptom being `WorkflowNotFoundError`
|
|
24
|
-
* registered). Distinct versions are the
|
|
25
|
-
* identical versions to one physical
|
|
107
|
+
* 1. SPLIT (PKU717): more than one @pikku/core version installed. Two module
|
|
108
|
+
* instances means two separate pikkuState registries at runtime — wirings
|
|
109
|
+
* (workflows, RPCs, queue workers, middleware) register into whichever copy
|
|
110
|
+
* the wiring files import, while the runner may read the other, so they
|
|
111
|
+
* silently fail to resolve (the classic symptom being `WorkflowNotFoundError`
|
|
112
|
+
* for a workflow that is plainly registered). Distinct versions are the
|
|
113
|
+
* reliable signal: package managers dedupe identical versions to one physical
|
|
114
|
+
* copy, so >1 version guarantees a split.
|
|
115
|
+
*
|
|
116
|
+
* 2. SKEW (PKU718): exactly one @pikku/core, but its version violates the CLI's
|
|
117
|
+
* own @pikku/core peer range. Some package managers (bun, yarn) install past
|
|
118
|
+
* an unsatisfied peer range instead of failing, and the resulting pair breaks
|
|
119
|
+
* codegen/runtime with cryptic missing-export errors. Fail here with the
|
|
120
|
+
* exact versions instead.
|
|
26
121
|
*/
|
|
27
122
|
export async function assertSingleCoreVersion(rootDir, logger) {
|
|
28
123
|
const nodeModules = path.join(path.resolve(rootDir), 'node_modules');
|
|
@@ -57,8 +152,10 @@ export async function assertSingleCoreVersion(rootDir, logger) {
|
|
|
57
152
|
}
|
|
58
153
|
}
|
|
59
154
|
const versions = new Set(byRealPath.values());
|
|
60
|
-
if (versions.size <= 1)
|
|
155
|
+
if (versions.size <= 1) {
|
|
156
|
+
await assertCoreVersionInPeerRange([...versions][0], logger);
|
|
61
157
|
return;
|
|
158
|
+
}
|
|
62
159
|
const found_ = [...byRealPath.entries()]
|
|
63
160
|
.sort((a, b) => a[1].localeCompare(b[1]))
|
|
64
161
|
.map(([p, v]) => ` ${v} ${path.dirname(p)}`)
|
|
@@ -78,3 +175,27 @@ export async function assertSingleCoreVersion(rootDir, logger) {
|
|
|
78
175
|
}
|
|
79
176
|
throw new Error(message);
|
|
80
177
|
}
|
|
178
|
+
// SKEW (PKU718): a single installed core that violates the CLI's own peer range.
|
|
179
|
+
async function assertCoreVersionInPeerRange(coreVersion, logger) {
|
|
180
|
+
if (!coreVersion)
|
|
181
|
+
return; // no core found — nothing to validate against
|
|
182
|
+
const cli = await getCliManifest();
|
|
183
|
+
if (!cli)
|
|
184
|
+
return; // manifest not found/parseable — never false-block a build
|
|
185
|
+
const ok = coreSatisfiesRange(coreVersion, cli.corePeerRange);
|
|
186
|
+
if (ok !== false)
|
|
187
|
+
return; // satisfied, or range not understood — skip
|
|
188
|
+
const message = `[${ErrorCode.CORE_VERSION_SKEW}] @pikku/cli@${cli.version} requires @pikku/core@${cli.corePeerRange} ` +
|
|
189
|
+
`(peerDependencies), but ${coreVersion} is installed.\n` +
|
|
190
|
+
`Some package managers (bun, yarn) install past an unsatisfied peer range instead of\n` +
|
|
191
|
+
`failing, and a cli/core version skew breaks codegen and runtime with cryptic\n` +
|
|
192
|
+
`missing-export errors.\n\n` +
|
|
193
|
+
`Fix: @pikku/cli and @pikku/core move together — bump both to the same release (update\n` +
|
|
194
|
+
`any overrides/resolutions pins too), then reinstall. Set PIKKU_ALLOW_CORE_SKEW=1 to\n` +
|
|
195
|
+
`downgrade this to a warning if you have verified the installed pair is compatible.`;
|
|
196
|
+
if (process.env?.PIKKU_ALLOW_CORE_SKEW) {
|
|
197
|
+
logger.warn(message);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
throw new Error(message);
|
|
201
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/cli",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.79",
|
|
4
4
|
"author": "yasser.fadl@gmail.com",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"imports": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@pikku/bun-server": "^0.12.4",
|
|
33
33
|
"@pikku/deploy-cloudflare": "^0.12.8",
|
|
34
34
|
"@pikku/fetch": "^0.12.7",
|
|
35
|
-
"@pikku/inspector": "^0.12.
|
|
35
|
+
"@pikku/inspector": "^0.12.41",
|
|
36
36
|
"@pikku/kysely": "^0.13.0",
|
|
37
37
|
"@pikku/kysely-node-sqlite": "^0.12.3",
|
|
38
38
|
"@pikku/node-http-server": "^0.12.6",
|
|
@@ -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.61"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@pikku/core": "^0.12.
|
|
65
|
+
"@pikku/core": "^0.12.61",
|
|
66
66
|
"@types/istanbul-lib-instrument": "^1.7.7",
|
|
67
67
|
"@types/node": "^24.11.0",
|
|
68
68
|
"@types/pg": "^8.11.0",
|