refactor: ♻️ Rewrite build system to fit the monorepo architecture
Some checks failed
Mirror to Codeberg / Mirror (push) Failing after 0s
Test Publish / build (client) (push) Failing after 1s
Test Publish / build (sdk) (push) Failing after 0s

This commit is contained in:
Jesse Wierzbinski 2025-07-04 06:29:43 +02:00
parent 7de4b573e3
commit 90b6399407
No known key found for this signature in database
217 changed files with 2143 additions and 1858 deletions

29
packages/sdk/build.ts Normal file
View file

@ -0,0 +1,29 @@
import { $, build } from "bun";
import manifest from "./package.json" with { type: "json" };
console.log("Building...");
await $`rm -rf dist && mkdir dist`;
await build({
entrypoints: Object.values(manifest.exports).map((entry) => entry.import),
outdir: "dist",
target: "bun",
splitting: true,
minify: true,
external: [
...Object.keys(manifest.dependencies).filter((dep) =>
dep.startsWith("@versia"),
),
"acorn",
],
});
console.log("Copying files...");
await $`mkdir -p dist/node_modules`;
// Copy acorn to dist
await $`cp -rL ../../node_modules/acorn dist/node_modules/acorn`;
console.log("Build complete!");

View file

@ -7,6 +7,9 @@
"name": "Jesse Wierzbinski (CPlusPatch)",
"url": "https://cpluspatch.com"
},
"scripts": {
"build": "bun run build.ts"
},
"readme": "README.md",
"repository": {
"type": "git",
@ -41,24 +44,19 @@
},
"exports": {
".": {
"import": "./inbox-processor.ts",
"default": "./inbox-processor.ts"
"import": "./inbox-processor.ts"
},
"./http": {
"import": "./http.ts",
"default": "./http.ts"
"import": "./http.ts"
},
"./crypto": {
"import": "./crypto.ts",
"default": "./crypto.ts"
"import": "./crypto.ts"
},
"./entities": {
"import": "./entities/index.ts",
"default": "./entities/index.ts"
"import": "./entities/index.ts"
},
"./schemas": {
"import": "./schemas/index.ts",
"default": "./schemas/index.ts"
"import": "./schemas/index.ts"
}
},
"funding": {