kimi-code/apps/vscode/scripts/vsix-publish.mjs
qer d1ca65e1de
feat(vscode): migrate extension to Node SDK (#1769)
* feat(vscode): migrate extension to Node SDK

* fix(vscode): address CI failures

* fix(vis): handle token count records

* fix(vscode): keep chat toolbar and header readable at narrow widths

* fix(vscode): map yolo to core yolo permission and honor the global yolo setting

* docs(vscode): record Node SDK migration design

* docs(vscode): split breaking changes out of the 0.6.0 changelog

* fix(vscode): keep a resumed session's thinking effort instead of reapplying the default

* fix(vscode): announce session status when a view attaches so the display matches it

* fix(vscode): align webview thinking effort handling with the TUI
2026-07-16 17:27:21 +08:00

44 lines
1.4 KiB
JavaScript

#!/usr/bin/env node
import { existsSync } from 'node:fs';
import { runLocalCli } from './local-cli.mjs';
import { parsePublishArguments, publishUsage } from './publish-args.mjs';
import { extensionRoot, isMainModule } from './vsix-targets.mjs';
import { verifyVsix } from './vsix-verify.mjs';
async function main() {
const options = parsePublishArguments(process.argv.slice(2));
if (options.help) {
console.log(publishUsage('Visual Studio Marketplace'));
return;
}
if (!process.env.VSCE_PAT) throw new Error('VSCE_PAT is required to publish.');
await verifyInputs(options);
for (const file of options.files) {
console.log(`Publishing verified package ${file}...`);
runLocalCli(
'@vscode/vsce',
'vsce',
['publish', '--packagePath', file, '--skip-duplicate'],
{ cwd: extensionRoot },
);
}
}
async function verifyInputs(options) {
for (let index = 0; index < options.targets.length; index += 1) {
const file = options.files[index];
if (!existsSync(file)) {
throw new Error(`Missing VSIX ${file}. Run pnpm run package:platform first.`);
}
await verifyVsix(file, options.targets[index], { sourceRoot: extensionRoot });
}
}
if (isMainModule(import.meta.url)) {
main().catch((error) => {
console.error(`Marketplace publish failed: ${error instanceof Error ? error.message : String(error)}`);
process.exitCode = 1;
});
}