Compare commits

..

2 Commits

Author SHA1 Message Date
github-actions[bot]
edf0e7d946 release: v0.1.12 2025-12-05 02:10:36 +00:00
YeonGyu-Kim
baa7fadab1 fix(comment-checker): use runtime wasm path resolution instead of require.resolve
require.resolve() was evaluated at build time, hardcoding CI paths.
Now uses import.meta.resolve() at runtime to find wasm files.
2025-12-05 11:09:41 +09:00
2 changed files with 7 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "oh-my-opencode",
"version": "0.1.11",
"version": "0.1.12",
"description": "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -59,8 +59,13 @@ async function initParserClass(): Promise<void> {
parserInitPromise = (async () => {
debugLog("importing web-tree-sitter...")
parserClass = (await import("web-tree-sitter")).default
const treeSitterWasmPath = require.resolve("web-tree-sitter/tree-sitter.wasm")
// Find wasm path relative to web-tree-sitter package at runtime
const webTreeSitterPath = import.meta.resolve("web-tree-sitter")
const packageDir = webTreeSitterPath.replace(/\/[^/]+$/, "").replace("file://", "")
const treeSitterWasmPath = `${packageDir}/tree-sitter.wasm`
debugLog("wasm path:", treeSitterWasmPath)
await parserClass.init({
locateFile: () => treeSitterWasmPath,
})