Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ jobs:
with:
node-version: '20'

- name: Clean Deno cache
run: deno cache --reload mod.ts cli.ts

- name: Build npm package
run: deno task build:npm
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'

- name: Verify npm package structure
run: |
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"lint": { "rules": { "exclude": ["no-explicit-any"] } },
"imports": {
"@deno/dnt": "jsr:@deno/dnt@^0.41.3",
"@deno/dnt": "jsr:@deno/dnt@^0.42.3",
"@std/fs": "jsr:@std/fs@^1",
"@std/path": "jsr:@std/path@^1",
"handlebars": "npm:handlebars@^4.7.8"
Expand Down
7 changes: 7 additions & 0 deletions package.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@
"bin": { "statedoc": "./esm/cli.js" },
"exports": { ".": "./mod.js" },
"engines": { "node": ">=18" },
"dependencies": {
"fast-glob": "^3.3.2",
"handlebars": "^4.7.8"
},
"devDependencies": {
"@types/node": "^20.17.13"
},
"peerDependencies": { "@mermaid-js/mermaid-cli": ">=10.9.0" }
}
13 changes: 9 additions & 4 deletions scripts/build_npm.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

import { build, emptyDir } from "@deno/dnt";

// Note: Using @deno/dnt@^0.41.3 instead of 0.42.3 due to WASM panic issue
// in dnt's Reflect.get (wasm/src/lib.rs line 56). Version 0.42.3 attempts
// to use Reflect.get on a non-object value, causing a panic. Revert to 0.41.3
// until the issue is fixed upstream.
// Updated to @deno/dnt@^0.42.3 to fix @types/node version resolution issue.
// Previous version 0.41.3 attempted to use @types/node@24.2.0 which doesn't
// exist in the npm registry, causing build failures.

await emptyDir("./npm");

Expand All @@ -20,6 +19,12 @@ try {
compilerOptions: { lib: ["ES2022", "DOM"] },
typeCheck: false, // Skip type checking to avoid shim limitations
test: false, // Skip tests to avoid test runner issues
packageManager: "npm",
skipNpmInstall: false, // We need npm install to verify dependencies work
scriptModule: false,
postBuild() {
// No additional post-build steps needed
},
});
console.log("Built to npm/");
} catch (error) {
Expand Down