diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d8b31a1..8f37cd7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,8 @@ jobs: node-version: "lts/*" - name: Install dependencies run: npm i --package-lock-only && npm clean-install + - name: Tests and docs + run: npm run unit-test && npm run gdocs - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/lib/methods/index.js b/lib/methods/index.js index c31b603..894571b 100644 --- a/lib/methods/index.js +++ b/lib/methods/index.js @@ -188,7 +188,8 @@ const Methods = ({ mr.params = r; } catch (e) { mr.params = undefined; - mr.error = e?.error?.stack || e?.stack || e?.error || e; + mr.error = (e?.error?.stack && e?.error) || + (e?.stack && e); this.log('error', 'Methods', mr.error, callData); } if (!data.id) { diff --git a/package.json b/package.json index a7a68ec..ede3740 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,15 @@ "error": "^10.4.0" }, "devDependencies": { + "jsdoc": "^4.0.3", "jsdoc-tsimport-plugin": "^1.0.5", - "typescript": "^5.3.3", - "semantic-release": "^22.0.12", - "tap": "^18.6.1" + "semantic-release": "^24.0.0", + "tap": "^18.6.1", + "typescript": "^5.3.3" }, "scripts": { "unit-test": "./node_modules/.bin/tap --snapshot-clean-cwd --coverage-report=html ./tests/unit/ ", - "gdocs": "jsdoc -c jsdoc.json . | npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir types" + "gdocs": "node_modules/jsdoc/jsdoc.js -c jsdoc.json . | npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir types" }, "homepage": "https://github.com/zetxx/bridg-wrong/blob/master/README.md", "repository": { diff --git a/types/lib/methods/index.d.ts b/types/lib/methods/index.d.ts index f5e630b..779e4c8 100644 --- a/types/lib/methods/index.d.ts +++ b/types/lib/methods/index.d.ts @@ -11,4 +11,4 @@ declare function Methods({ wires, list: externalList, config }: { wires: any; list: any; config?: {}; -}): import('./types.js').Api; +}): import("./types.js").Api; diff --git a/types/lib/methods/types.d.ts b/types/lib/methods/types.d.ts index 0471ab0..82ae099 100644 --- a/types/lib/methods/types.d.ts +++ b/types/lib/methods/types.d.ts @@ -2,10 +2,10 @@ export const unused: {}; export type add = () => any; export type remove = () => any; export type find = () => any; -export type ask = (message: import('../types.js').message) => Promise; -export type notify = (message: import('../types.js').message) => Promise; -export type send = (message: import('../types.js').message) => void; -export type test = (data: import('../types.js').message, ctx: any) => any; +export type ask = (message: import("../types.js").message) => Promise; +export type notify = (message: import("../types.js").message) => Promise; +export type send = (message: import("../types.js").message) => void; +export type test = (data: import("../types.js").message, ctx: any) => any; export type log = (level: string, logData: any) => void; export type responseMethodName = (p: object, id: string | number) => string; export type Api = { diff --git a/types/lib/wires/index.d.ts b/types/lib/wires/index.d.ts index d2956ef..85f6fb7 100644 --- a/types/lib/wires/index.d.ts +++ b/types/lib/wires/index.d.ts @@ -3,4 +3,4 @@ export = Wires; * Wires bootstrap * @returns {import('./types').Api} */ -declare function Wires(): import('./types').Api; +declare function Wires(): import("./types").Api;