also looking at this
fix(release): build and verify all npm package artifacts
#289
11 files
+290
-3
| @@ -2,7 +2,11 @@ | ||
| 2 | 2 | * Build script for @craft-native/android |
| 3 | 3 | */ |
| 4 | 4 | |
| 5 | await Bun.build({ | |
| 5 | import { rm } from 'node:fs/promises' | |
| 6 | ||
| 7 | await rm('./dist', { recursive: true, force: true }) | |
| 8 | ||
| 9 | const result = await Bun.build({ | |
| 6 | 10 | entrypoints: ['./src/index.ts'], |
| 7 | 11 | outdir: './dist', |
| 8 | 12 | target: 'bun', |
| @@ -11,4 +15,10 @@ await Bun.build({ | ||
| 11 | 15 | sourcemap: 'external', |
| 12 | 16 | }) |
| 13 | 17 | |
| 18 | if (!result.success) | |
| 19 | throw new AggregateError(result.logs, 'Android builder compilation failed') | |
| 20 | ||
| 21 | // Use the locked compiler, as the SDK build does, rather than Pantry's PATH tsc. | |
| 22 | await Bun.$`bun ../typescript/scripts/tsc.ts src/index.ts --declaration --emitDeclarationOnly --module esnext --target esnext --moduleResolution bundler --types bun --skipLibCheck --ignoreConfig --outDir dist` | |
| 23 | ||
| 14 | 24 | console.log('✅ Build complete') |