fix: fix bundle (#956)

* fix: fix bundle

* test(kimi-code): remove obsolete pino-pretty test
This commit is contained in:
liruifengv 2026-06-22 13:59:57 +08:00 committed by GitHub
parent 3443a00a43
commit 152bb69d86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 50 deletions

View file

@ -75,16 +75,8 @@
}, },
"optionalDependencies": { "optionalDependencies": {
"@mariozechner/clipboard": "^0.3.2", "@mariozechner/clipboard": "^0.3.2",
"chalk": "^5.4.1",
"cli-highlight": "^2.1.11",
"commander": "^13.1.0",
"koffi": "^2.16.0", "koffi": "^2.16.0",
"node-pty": "^1.1.0", "node-pty": "^1.1.0"
"pathe": "^2.0.3",
"pino-pretty": "^13.0.0",
"semver": "^7.7.4",
"smol-toml": "^1.6.1",
"zod": "^4.3.6"
}, },
"devDependencies": { "devDependencies": {
"@earendil-works/pi-tui": "^0.74.0", "@earendil-works/pi-tui": "^0.74.0",

View file

@ -9,7 +9,7 @@
*/ */
import type { ChildProcess } from 'node:child_process'; import type { ChildProcess } from 'node:child_process';
import { mkdtempSync, readFileSync, rmSync } from 'node:fs'; import { mkdtempSync, rmSync } from 'node:fs';
import { createServer, type Server } from 'node:net'; import { createServer, type Server } from 'node:net';
import { tmpdir } from 'node:os'; import { tmpdir } from 'node:os';
import { dirname, join } from 'node:path'; import { dirname, join } from 'node:path';
@ -40,14 +40,6 @@ function makeProgram(): Command {
} }
describe('kimi server', () => { describe('kimi server', () => {
it('declares pino-pretty as a CLI runtime dependency', () => {
const packageJson = JSON.parse(
readFileSync(new URL('../../../package.json', import.meta.url), 'utf-8'),
) as { optionalDependencies?: Record<string, string> };
expect(packageJson.optionalDependencies).toHaveProperty('pino-pretty');
});
it('registers the expected `server` subcommands while lifecycle commands are hidden', () => { it('registers the expected `server` subcommands while lifecycle commands are hidden', () => {
const program = makeProgram(); const program = makeProgram();
const server = program.commands.find((c) => c.name() === 'server'); const server = program.commands.find((c) => c.name() === 'server');

View file

@ -31,14 +31,7 @@ export default defineConfig({
[BUILT_IN_CATALOG_DEFINE]: builtInCatalogDefine(), [BUILT_IN_CATALOG_DEFINE]: builtInCatalogDefine(),
}, },
deps: { deps: {
alwaysBundle: [/^@moonshot-ai\//], onlyBundle: false,
// node-pty is a native addon: its `pty.node` binary cannot be bundled and
// must resolve from node_modules at runtime. Keep it external (even though
// its importer @moonshot-ai/agent-core is force-bundled above) and declare it
// as a runtime dependency of this package so npm/npx installs it with its
// prebuilt binary. Bundling it leaves the binary unresolvable → the terminal
// PTY fails with "Failed to load native module: pty.node".
neverBundle: ['node-pty'],
}, },
outputOptions: { outputOptions: {
codeSplitting: false, codeSplitting: false,

1
docs/.gitignore vendored
View file

@ -1,3 +1,4 @@
node_modules node_modules
.vitepress/dist .vitepress/dist
.vitepress/cache .vitepress/cache
.vitepress/.temp

44
pnpm-lock.yaml generated
View file

@ -108,19 +108,6 @@ importers:
'@types/yazl': '@types/yazl':
specifier: ^2.4.6 specifier: ^2.4.6
version: 2.4.6 version: 2.4.6
postject:
specifier: 1.0.0-alpha.6
version: 1.0.0-alpha.6
tsx:
specifier: ^4.21.0
version: 4.21.0
yazl:
specifier: ^3.3.1
version: 3.3.1
optionalDependencies:
'@mariozechner/clipboard':
specifier: ^0.3.2
version: 0.3.2
chalk: chalk:
specifier: ^5.4.1 specifier: ^5.4.1
version: 5.6.2 version: 5.6.2
@ -130,27 +117,37 @@ importers:
commander: commander:
specifier: ^13.1.0 specifier: ^13.1.0
version: 13.1.0 version: 13.1.0
koffi:
specifier: ^2.16.0
version: 2.16.0
node-pty:
specifier: ^1.1.0
version: 1.1.0
pathe: pathe:
specifier: ^2.0.3 specifier: ^2.0.3
version: 2.0.3 version: 2.0.3
pino-pretty: postject:
specifier: ^13.0.0 specifier: 1.0.0-alpha.6
version: 13.1.3 version: 1.0.0-alpha.6
semver: semver:
specifier: ^7.7.4 specifier: ^7.7.4
version: 7.7.4 version: 7.7.4
smol-toml: smol-toml:
specifier: ^1.6.1 specifier: ^1.6.1
version: 1.6.1 version: 1.6.1
tsx:
specifier: ^4.21.0
version: 4.21.0
yazl:
specifier: ^3.3.1
version: 3.3.1
zod: zod:
specifier: ^4.3.6 specifier: ^4.3.6
version: 4.3.6 version: 4.3.6
optionalDependencies:
'@mariozechner/clipboard':
specifier: ^0.3.2
version: 0.3.2
koffi:
specifier: ^2.16.0
version: 2.16.0
node-pty:
specifier: ^1.1.0
version: 1.1.0
apps/kimi-web: apps/kimi-web:
dependencies: dependencies:
@ -8884,8 +8881,7 @@ snapshots:
commander@10.0.1: {} commander@10.0.1: {}
commander@13.1.0: commander@13.1.0: {}
optional: true
commander@14.0.3: {} commander@14.0.3: {}