-
Notifications
You must be signed in to change notification settings - Fork 1
Add npm build test to CI and fix broken build #14
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
0ca4964
9cfc088
cb8869f
e42a035
41563b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,5 @@ | ||||||||
| import esbuild from "esbuild"; | ||||||||
| import { dtsPlugin } from "esbuild-plugin-d.ts"; | ||||||||
| import { cp, readFile, writeFile } from "@cross/fs"; | ||||||||
| import { readFile, writeFile } from "@cross/fs"; | ||||||||
| import { dirname, fromFileUrl, resolve } from "@std/path"; | ||||||||
|
|
||||||||
| /** | ||||||||
|
|
@@ -68,50 +67,26 @@ if (command === "clean") { | |||||||
|
|
||||||||
| /* Handle argument `build`: Transpile and generate typings */ | ||||||||
| } else if (command === "build") { | ||||||||
| // Build the ESM JavaScript bundle | ||||||||
| await build({ | ||||||||
| entryPoints: [resolve(relativeProjectRoot, "mod.ts")], | ||||||||
| bundle: true, | ||||||||
| minify: true, | ||||||||
| sourcemap: false, | ||||||||
| outdir: resolvedDistPath, | ||||||||
| platform: "node", | ||||||||
| format: "esm", | ||||||||
| // Mark runtime-specific modules as external - they won't be bundled | ||||||||
| // node:test is a Node.js built-in, bun:test is a Bun built-in | ||||||||
| external: ["bun:test", "node:test"], | ||||||||
| // @cross/runtime is a JSR dependency that must be externalized | ||||||||
| external: ["bun:test", "node:test", "@cross/runtime"], | ||||||||
|
||||||||
| // @cross/runtime is a JSR dependency that must be externalized | |
| external: ["bun:test", "node:test", "@cross/runtime"], | |
| external: ["bun:test", "node:test"], |
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.
The new
npm_buildjob only checks thatdeno task build:distcompletes. It doesn’t validate that the produced Node artifact can actually be loaded (e.g., a simplenode -e "import('./dist/mod.js')"or importing the generated package entry). Adding a minimal runtime smoke-check here would catch externals/dependency mismatches that still allow bundling to succeed.