rework misskey-js build to preserve original package structure

This commit is contained in:
Hazelnoot 2025-10-01 15:55:45 -04:00
parent b8a3bd6182
commit 2faeabe79c
7 changed files with 55 additions and 15 deletions

View file

@ -0,0 +1,12 @@
import {libBuild, outDir, testDBuild, testDSource} from './_common.mjs';
import {rm, cp} from 'fs/promises';
// Always clean the output, because artifacts are cached in the build directory instead.
console.log(`Cleaning output directory ${outDir}...`);
await rm(outDir, { recursive: true, force: true });
// Copy built lib to output directory.
await cp(libBuild, outDir, { recursive: true });
// Stage test-d sources in the build directory so tsd will work.
await cp(testDSource, testDBuild, { recursive: true });