diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 289d5e3..94c1fc5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,6 +32,14 @@ jobs: - name: Install dependencies run: bun install + - name: Verify package in Node + run: | + PACKAGE=$(npm pack --silent) + mkdir /tmp/opencode-wakelock-smoke + npm install --prefix /tmp/opencode-wakelock-smoke "$PWD/$PACKAGE" + cd /tmp/opencode-wakelock-smoke + node --input-type=module -e "const plugin = (await import('opencode-wakelock')).default; if (plugin.id !== 'opencode-wakelock' || typeof plugin.server !== 'function') process.exit(1)" + - name: Check if version already published id: check run: | diff --git a/package.json b/package.json index 26daf53..170d987 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "type": "module", "license": "MIT", - "main": "index.ts", - "version": "0.2.2", + "main": "dist/index.js", + "files": ["dist/index.js"], + "version": "0.2.3", "engines": { "opencode": ">=1.14.0" }, @@ -17,9 +18,14 @@ "type": "git", "url": "git+https://github.com/IgnisDa/opencode-wakelock.git" }, + "scripts": { + "build": "tsc", + "prepack": "npm run build" + }, "devDependencies": { "@opencode-ai/plugin": "latest", - "bun-types": "latest" + "bun-types": "latest", + "typescript": "7.0.2" }, "keywords": [ "sleep", diff --git a/tsconfig.json b/tsconfig.json index cc85826..1dc7ace 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "target": "ESNext", "module": "ESNext", "moduleResolution": "bundler", + "outDir": "dist", "strict": true, "types": ["bun-types"] }