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": {
"@mariozechner/clipboard": "^0.3.2",
"chalk": "^5.4.1",
"cli-highlight": "^2.1.11",
"commander": "^13.1.0",
"koffi": "^2.16.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"
"node-pty": "^1.1.0"
},
"devDependencies": {
"@earendil-works/pi-tui": "^0.74.0",

View file

@ -9,7 +9,7 @@
*/
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 { tmpdir } from 'node:os';
import { dirname, join } from 'node:path';
@ -40,14 +40,6 @@ function makeProgram(): Command {
}
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', () => {
const program = makeProgram();
const server = program.commands.find((c) => c.name() === 'server');

View file

@ -31,14 +31,7 @@ export default defineConfig({
[BUILT_IN_CATALOG_DEFINE]: builtInCatalogDefine(),
},
deps: {
alwaysBundle: [/^@moonshot-ai\//],
// 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'],
onlyBundle: false,
},
outputOptions: {
codeSplitting: false,

1
docs/.gitignore vendored
View file

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

44
pnpm-lock.yaml generated
View file

@ -108,19 +108,6 @@ importers:
'@types/yazl':
specifier: ^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:
specifier: ^5.4.1
version: 5.6.2
@ -130,27 +117,37 @@ importers:
commander:
specifier: ^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:
specifier: ^2.0.3
version: 2.0.3
pino-pretty:
specifier: ^13.0.0
version: 13.1.3
postject:
specifier: 1.0.0-alpha.6
version: 1.0.0-alpha.6
semver:
specifier: ^7.7.4
version: 7.7.4
smol-toml:
specifier: ^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:
specifier: ^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:
dependencies:
@ -8884,8 +8881,7 @@ snapshots:
commander@10.0.1: {}
commander@13.1.0:
optional: true
commander@13.1.0: {}
commander@14.0.3: {}