Files
SuperCharged-Claude-Code-Up…/skills/plugins/claude-code-safety-net/scripts/build.ts
admin b723e2bd7d Reorganize: Move all skills to skills/ folder
- Created skills/ directory
- Moved 272 skills to skills/ subfolder
- Kept agents/ at root level
- Kept installation scripts and docs at root level

Repository structure:
- skills/           - All 272 skills from skills.sh
- agents/           - Agent definitions
- *.sh, *.ps1       - Installation scripts
- README.md, etc.   - Documentation

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 18:05:17 +00:00

47 lines
1.2 KiB
TypeScript

#!/usr/bin/env bun
/**
* Build script that injects __PKG_VERSION__ at compile time
* to avoid embedding the full package.json in the bundle.
*/
import pkg from '../package.json';
const result = await Bun.build({
entrypoints: ['src/index.ts', 'src/bin/cc-safety-net.ts'],
outdir: 'dist',
target: 'node',
define: {
__PKG_VERSION__: JSON.stringify(pkg.version),
},
});
if (!result.success) {
console.error('Build failed:');
for (const log of result.logs) {
console.error(log);
}
process.exit(1);
}
const indexOutput = result.outputs.find((o) => o.path.endsWith('index.js'));
const binOutput = result.outputs.find((o) => o.path.endsWith('cc-safety-net.js'));
if (indexOutput) {
console.log(` dist/index.js ${(indexOutput.size / 1024).toFixed(2)} KB`);
}
if (binOutput) {
console.log(` dist/bin/cc-safety-net.js ${(binOutput.size / 1024).toFixed(2)} KB`);
}
// Run build:types and build:schema
const typesResult = Bun.spawnSync(['bun', 'run', 'build:types']);
if (typesResult.exitCode !== 0) {
console.error('build:types failed');
process.exit(1);
}
const schemaResult = Bun.spawnSync(['bun', 'run', 'build:schema']);
if (schemaResult.exitCode !== 0) {
console.error('build:schema failed');
process.exit(1);
}