-
Notifications
You must be signed in to change notification settings - Fork 1
fix: fix build order and simplify workflows #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
67b5b5a
to
26fa059
Compare
can you add the |
Done |
packages/core/src/logs/migrations.ts
Outdated
*/ | ||
function getMigrationsFolder(): string { | ||
// Try binary location first (next to executable) | ||
const binaryDrizzleDir = join(process.execPath, "..", "drizzle"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
binary???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this comment isn't super clear but the CLI is executed as a (bun build) binary.
Looking at it again, i don't really like this logic. So I have changed it (the code now tries to figure out whether it's running as part of a bun built binary)
The CLI package's postbuild script copies the web UI dist files to the public folder. However, the web package wasn't being built before the CLI, causing the build to fail with "No such file or directory" when trying to copy ../web/dist/*. Fixed by updating the root build script to build the web package first, then the CLI package.
The release workflow was missing builds for: 1. Web package - needed by CLI's postbuild script to copy dist files 2. API package - a dependency of the CLI Added both builds in correct dependency order to match the CI workflow, ensuring all dependencies are available when the CLI is built.
Updated the root build command to build all packages in the correct dependency order: types → core → api → server → web → cli This ensures: 1. Developers running 'bun run build' get a complete build 2. All packages are built in dependency order 3. Consistent behavior across local development, CI, and release workflows Build order follows the documented package dependency graph where each package builds after its dependencies are ready.
Both CI and release workflows now use the comprehensive 'bun run build' command instead of duplicating individual package build commands. Benefits: 1. Single source of truth for build order (package.json) 2. Less duplication and easier to maintain 3. If build order needs to change, update it in one place 4. Simpler, more readable workflow files Build order remains: types → core → api → server → web → cli
The build-binaries job does a fresh checkout, so the web dist files won't be available. We need to run 'bun run build' in each build-binaries job to ensure all packages (including web) are built before the binary is compiled. Without this, the CLI's public folder won't have the web UI files when the binary is being compiled.
The binary looks for a 'public' folder next to the executable at runtime to serve the web UI. This change copies the public folder from the CLI package to each binary package after compilation. Also updates the package.json files array to include 'public' so it gets published to npm alongside the binary.
Changed from 'bun run build' (which builds all 6 packages) to only building web and CLI packages before compiling binaries. This is more efficient since: 1. Library packages (types, core, api, server) were already built and validated in build-libs job 2. Binary compilation only needs web dist files (copied to CLI's public folder) 3. Reduces redundant work in the matrix build job Before: Build all 6 packages on each platform After: Build only 2 packages (web + CLI) on each platform
…loader The SQLite backend needs the drizzle migrations folder at runtime to initialize the database. This change: 1. Copies packages/core/drizzle to binary packages after compilation 2. Updates getMigrationsFolder() to check for migrations next to the executable before falling back to the development location 3. Includes 'drizzle' in the binary package.json files array for npm publishing This fixes the "Can't find meta/_journal.json file" error that prevented the SQLite backend from initializing, which caused API responses to be empty.
…d drizzle folders For consistency with the build-binaries.ts script which automatically creates package.json files with these folders in the files array.
- Gitignore public/ and drizzle/ folders in platform packages since they're auto-generated by build-binaries.ts script - Update darwin-arm64 package.json to include public and drizzle in files array
0b16943
to
ed1f04a
Compare
Summary
Fixes the failing CLI build by ensuring the web package is built before the CLI, and simplifies the build system with a unified build command.
Changes
1. Fix build order in root package.json
bun run build
now builds all packages in dependency order: types → core → api → server → web → cli2. Fix release workflow
bun run build
command for consistency3. Simplify CI workflow
bun run --filter <package> build
commands with singlebun run build
commandBuild Order
All workflows now follow the same dependency order:
Fixes
Resolves the issue where CLI build fails with:
This happened because the web package wasn't built before the CLI's postbuild script tried to copy the dist files.