feat: add silky cli tools

This commit is contained in:
2025-04-27 22:16:09 +08:00
parent 75d181ef43
commit 6867de838e
42 changed files with 3867 additions and 251 deletions

View File

@@ -0,0 +1,26 @@
import path from 'node:path';
import pkg from './package.json';
import fs from 'node:fs';
// bun run src/index.ts --
import { fileURLToPath } from 'node:url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/**
*
* @param {string} p
* @returns
*/
export const w = (p) => path.join(__dirname, p);
await Bun.build({
target: 'node',
format: 'esm',
entrypoints: [w('./src/index.ts')],
outdir: w('./dist'),
naming: {
entry: 'silky.mjs',
},
external: ['pm2'],
define: {
ENVISION_VERSION: JSON.stringify(pkg.version),
},
env: 'ENVISION_*',
});