move to monorepo

This commit is contained in:
musistudio
2025-12-25 15:11:32 +08:00
parent a7e20325db
commit 6a20b2021d
107 changed files with 5308 additions and 1118 deletions

36
scripts/build-shared.js Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env node
const { execSync } = require('child_process');
const path = require('path');
const fs = require('fs');
console.log('Building Shared package...');
try {
const sharedDir = path.join(__dirname, '../packages/shared');
// Create dist directory
const distDir = path.join(sharedDir, 'dist');
if (!fs.existsSync(distDir)) {
fs.mkdirSync(distDir, { recursive: true });
}
// Generate type declaration files
console.log('Generating type declaration files...');
execSync('tsc --emitDeclarationOnly', {
stdio: 'inherit',
cwd: sharedDir
});
// Build the shared package
console.log('Building shared package...');
execSync('esbuild src/index.ts --bundle --platform=node --minify --tree-shaking=true --outfile=dist/index.js', {
stdio: 'inherit',
cwd: sharedDir
});
console.log('Shared package build completed successfully!');
} catch (error) {
console.error('Shared package build failed:', error.message);
process.exit(1);
}