@pikku/cli 0.12.56 → 0.12.57
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-meta.gen.json +4 -0
- 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/cli.wiring.js +4 -0
- package/dist/src/deploy/codegen/per-unit-codegen.js +1 -0
- package/dist/src/fabric/functions/validate.function.js +13 -0
- package/dist/src/functions/commands/pikku-command-bootstrap.js +2 -2
- package/dist/src/utils/file-import-path.d.ts +5 -1
- package/dist/src/utils/file-import-path.js +6 -2
- package/dist/src/utils/generate-bootstrap-file.d.ts +5 -1
- package/dist/src/utils/generate-bootstrap-file.js +6 -2
- package/package.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.57
|
|
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';
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
},
|
|
55
55
|
"excludeTarget": {
|
|
56
56
|
"description": "Exclude functions by deploy target (comma-separated: serverless, server)"
|
|
57
|
+
},
|
|
58
|
+
"forceRelativeImports": {
|
|
59
|
+
"description": "Emit relative imports even when packageMappings would apply (used by per-unit deploy codegen)",
|
|
60
|
+
"default": false
|
|
57
61
|
}
|
|
58
62
|
},
|
|
59
63
|
"description": "Generate all Pikku files (types, schemas, wirings, etc.)",
|
|
@@ -1317,7 +1317,7 @@
|
|
|
1317
1317
|
"BootstrapInput"
|
|
1318
1318
|
],
|
|
1319
1319
|
"outputs": [],
|
|
1320
|
-
"implementationHash": "
|
|
1320
|
+
"implementationHash": "fd410e4cd2a0e949",
|
|
1321
1321
|
"contractHash": "51a9a80b6231e50f",
|
|
1322
1322
|
"inputHash": "14102501",
|
|
1323
1323
|
"outputHash": "0d154de9"
|
|
@@ -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.57
|
|
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.57') {
|
|
15
|
+
process.stderr.write(`\n Update available 0.12.57 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
|
|
16
16
|
}
|
|
17
17
|
} catch {}
|
|
18
18
|
}
|
package/dist/src/cli.wiring.js
CHANGED
|
@@ -157,6 +157,10 @@ wireCLI({
|
|
|
157
157
|
excludeTarget: {
|
|
158
158
|
description: 'Exclude functions by deploy target (comma-separated: serverless, server)',
|
|
159
159
|
},
|
|
160
|
+
forceRelativeImports: {
|
|
161
|
+
description: 'Emit relative imports even when packageMappings would apply (used by per-unit deploy codegen)',
|
|
162
|
+
default: false,
|
|
163
|
+
},
|
|
160
164
|
},
|
|
161
165
|
}),
|
|
162
166
|
bootstrap: pikkuCLICommand({
|
|
@@ -258,6 +258,19 @@ export async function runValidate(startDir = process.cwd()) {
|
|
|
258
258
|
w('gitignore-missing-generated', `.gitignore does not ignore Fabric generated/runtime artifacts: ${missing.join(', ')} — committing them lets a stale copy shadow the freshly generated one (e.g. a committed __fabric_scaffold.vite.config.mjs or .pikku-runtime breaks the sandbox dev server)`, gitignorePath, lines('Add these entries to .gitignore:', ...missing.map((entry) => ` ${entry}`), 'They are regenerated on every dev boot / scaffold / codegen and must never be committed.'));
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
+
// ── required project files ────────────────────────────────────────────
|
|
262
|
+
// These files must exist and be committed — they are seeded from the sandbox
|
|
263
|
+
// but belong to the project so the AI agent can read and update them.
|
|
264
|
+
for (const relPath of [
|
|
265
|
+
'db/annotations.ts',
|
|
266
|
+
'knowledge/design-language.md',
|
|
267
|
+
'knowledge/security.md',
|
|
268
|
+
'knowledge/technology.md',
|
|
269
|
+
]) {
|
|
270
|
+
if (!existsSync(join(root, relPath))) {
|
|
271
|
+
w(`missing-required-file-${relPath.replace(/[^a-z0-9]/gi, '-')}`, `${relPath} is missing — this file must be committed to the project`, join(root, relPath), lines(`Create ${relPath} and commit it.`, 'The starter-template ships a stub you can copy as a starting point.'));
|
|
272
|
+
}
|
|
273
|
+
}
|
|
261
274
|
const rootPkgPath = join(root, 'package.json');
|
|
262
275
|
const rootPkg = await readJsonSafe(rootPkgPath);
|
|
263
276
|
if (!rootPkg) {
|
|
@@ -12,7 +12,7 @@ export const pikkuBootstrap = pikkuSessionlessFunc({
|
|
|
12
12
|
addonBootstraps.push(`${decl.package}/.pikku/pikku-bootstrap.gen.js`);
|
|
13
13
|
logger.debug(`• Addon bootstrap: ${decl.package}`);
|
|
14
14
|
}
|
|
15
|
-
const wireAddonFileImports = Array.from(stateBeforeBootstrap.rpc?.wireAddonFiles ?? []).map((to) => `import '${getFileImportRelativePath(config.bootstrapFile, to, config.packageMappings)}'`);
|
|
15
|
+
const wireAddonFileImports = Array.from(stateBeforeBootstrap.rpc?.wireAddonFiles ?? []).map((to) => `import '${getFileImportRelativePath(config.bootstrapFile, to, config.packageMappings, config.forceRelativeImports)}'`);
|
|
16
16
|
const localImportTargets = Array.from(new Set([
|
|
17
17
|
...(config.rpcInternalWiringMetaFile &&
|
|
18
18
|
existsSync(config.rpcInternalWiringMetaFile)
|
|
@@ -26,7 +26,7 @@ export const pikkuBootstrap = pikkuSessionlessFunc({
|
|
|
26
26
|
logger.warn(`Skipping invalid bootstrap import path: ${String(to)}`);
|
|
27
27
|
return false;
|
|
28
28
|
});
|
|
29
|
-
const localImports = safeLocalImportTargets.map((to) => `import '${getFileImportRelativePath(config.bootstrapFile, to, config.packageMappings)}'`);
|
|
29
|
+
const localImports = safeLocalImportTargets.map((to) => `import '${getFileImportRelativePath(config.bootstrapFile, to, config.packageMappings, config.forceRelativeImports)}'`);
|
|
30
30
|
const addonImports = addonBootstraps.map((packagePath) => `import '${packagePath}'`);
|
|
31
31
|
const outDir = dirname(config.bootstrapFile);
|
|
32
32
|
const metaServiceFile = join(outDir, 'pikku-meta-service.gen.ts');
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export declare const getFileImportRelativePath: (from: string, to: string, packageMappings: Record<string, string
|
|
1
|
+
export declare const getFileImportRelativePath: (from: string, to: string, packageMappings: Record<string, string>,
|
|
2
|
+
/** When true, packageMappings are never applied — always emit relative paths.
|
|
3
|
+
* Use for generated files that live outside the workspace (e.g. .deploy/)
|
|
4
|
+
* where package-name imports can't be resolved by the bundler. */
|
|
5
|
+
forceRelative?: boolean) => string;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { relative, dirname, resolve } from 'path';
|
|
2
|
-
export const getFileImportRelativePath = (from, to, packageMappings
|
|
2
|
+
export const getFileImportRelativePath = (from, to, packageMappings,
|
|
3
|
+
/** When true, packageMappings are never applied — always emit relative paths.
|
|
4
|
+
* Use for generated files that live outside the workspace (e.g. .deploy/)
|
|
5
|
+
* where package-name imports can't be resolved by the bundler. */
|
|
6
|
+
forceRelative = false) => {
|
|
3
7
|
let filePath = relative(dirname(from), to);
|
|
4
8
|
if (!/^\.+\//.test(filePath)) {
|
|
5
9
|
filePath = `./${filePath}`;
|
|
@@ -41,7 +45,7 @@ export const getFileImportRelativePath = (from, to, packageMappings) => {
|
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
// Only apply packageMappings if files are not in the same package
|
|
44
|
-
if (!inSamePackage) {
|
|
48
|
+
if (!inSamePackage && !forceRelative) {
|
|
45
49
|
for (const [path, packageName] of Object.entries(packageMappings)) {
|
|
46
50
|
if (path === '.')
|
|
47
51
|
continue;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { Config } from '../../types/application-types.js';
|
|
2
2
|
import type { CLILogger } from '../services/cli-logger.service.js';
|
|
3
|
-
export declare const generateBootstrapFile: (logger: CLILogger, config: Config, bootstrapFile: string, specificImports: string[], schemas?: boolean, hasMiddleware?: boolean
|
|
3
|
+
export declare const generateBootstrapFile: (logger: CLILogger, config: Config, bootstrapFile: string, specificImports: string[], schemas?: boolean, hasMiddleware?: boolean,
|
|
4
|
+
/** Use relative imports even when packageMappings would normally apply.
|
|
5
|
+
* Set to true for per-unit deploy bootstrap files that live outside the
|
|
6
|
+
* workspace (e.g. .deploy/) where package-name imports can't be resolved. */
|
|
7
|
+
forceRelative?: boolean) => Promise<void>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { getFileImportRelativePath } from './file-import-path.js';
|
|
2
2
|
import { writeFileInDir } from './file-writer.js';
|
|
3
|
-
export const generateBootstrapFile = async (logger, config, bootstrapFile, specificImports, schemas, hasMiddleware
|
|
3
|
+
export const generateBootstrapFile = async (logger, config, bootstrapFile, specificImports, schemas, hasMiddleware,
|
|
4
|
+
/** Use relative imports even when packageMappings would normally apply.
|
|
5
|
+
* Set to true for per-unit deploy bootstrap files that live outside the
|
|
6
|
+
* workspace (e.g. .deploy/) where package-name imports can't be resolved. */
|
|
7
|
+
forceRelative = false) => {
|
|
4
8
|
// Common imports that every bootstrap file needs
|
|
5
9
|
const commonImports = [];
|
|
6
10
|
// Add middleware first (must be registered before functions meta)
|
|
@@ -18,7 +22,7 @@ export const generateBootstrapFile = async (logger, config, bootstrapFile, speci
|
|
|
18
22
|
// Combine common imports with specific imports
|
|
19
23
|
const allImports = [...commonImports, ...specificImports];
|
|
20
24
|
await writeFileInDir(logger, bootstrapFile, allImports
|
|
21
|
-
.map((to) => `import '${getFileImportRelativePath(bootstrapFile, to, config.packageMappings)}'`)
|
|
25
|
+
.map((to) => `import '${getFileImportRelativePath(bootstrapFile, to, config.packageMappings, forceRelative)}'`)
|
|
22
26
|
.sort((to) => (to.includes('meta') ? -1 : 1)) // Ensure meta files are at the top
|
|
23
27
|
.join('\n'));
|
|
24
28
|
};
|