feat: enhance .npmignore and config.py for better development environment management; update package.json for improved build process; add prepublish-clean script to remove unnecessary artifacts

This commit is contained in:
catlog22
2026-02-18 00:05:45 +08:00
parent 4a5f7ce7f7
commit 5fb0a0dfbc
4 changed files with 50 additions and 903 deletions

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env node
/**
* Pre-publish cleanup - removes dev artifacts from directories
* that will be included in the npm package via the "files" field.
*/
import { globSync } from 'glob';
import { rmSync } from 'fs';
const patterns = [
'ccw/scripts/__pycache__/**',
'ccw/dist/.ace-tool/**',
'ccw/src/.ace-tool/**',
'codex-lens/src/**/__pycache__/**',
'ccw-litellm/src/**/__pycache__/**',
'codex-lens/src/**/.workflow/**',
'**/.workflow/.cli-history/*.db*',
];
let cleaned = 0;
for (const pattern of patterns) {
const files = globSync(pattern, { ignore: 'node_modules/**', dot: true });
for (const f of files) {
try {
rmSync(f, { force: true });
cleaned++;
} catch { /* skip */ }
}
}
if (cleaned > 0) {
console.log(`[prepublish-clean] Removed ${cleaned} dev artifacts`);
}