Skip to content

Commit

Permalink
Merge branch 'master' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
KentarouTakeda authored Dec 28, 2023
2 parents 2243915 + e2efd96 commit bc947d0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- run: touch package-lock.json
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [14, 16, 18, 20]
version: [18, 20]
steps:
- uses: actions/checkout@v4
- run: touch package-lock.json
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "honkit-plugin-plantuml-server",
"version": "1.3.1",
"version": "2.0.0",
"description": "PlantUML plugin for HonKit. No Java or Graphviz required.",
"engines": {
"honkit": "*"
"honkit": "*",
"node": ">=18"
},
"homepage": "https://github.com/KentarouTakeda/honkit-plugin-plantuml-server",
"bugs": {
Expand Down Expand Up @@ -37,7 +38,6 @@
"license": "MIT",
"dependencies": {
"mkdirp": "^3.0.1",
"node-fetch": "^2.6.7",
"plantuml-encoder": "^1.4.0",
"png-strip-chunks": "^0.3.3",
"promise-retry": "^2.0.1",
Expand All @@ -48,8 +48,7 @@
"@swc/jest": "^0.2.22",
"@tsconfig/node16-strictest": "^1.0.0",
"@types/jest": "^29.1.2",
"@types/node": "^16.11.56",
"@types/node-fetch": "^2.6.2",
"@types/node": "^18.19.3",
"@types/promise-retry": "^1.1.3",
"@types/svgo": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^6.4.1",
Expand Down
5 changes: 2 additions & 3 deletions src/PlantUMLServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { createHash } from 'crypto';
import EventEmitter from 'events';
import fs from 'fs';
import { mkdirp } from 'mkdirp';
import fetch from 'node-fetch';
import { encode } from 'plantuml-encoder';
import promiseRetry from 'promise-retry';

Expand Down Expand Up @@ -81,7 +80,7 @@ export class PlantUMLServer extends EventEmitter {
async request(url: string): Promise<ArrayBuffer | null> {
const response = await promiseRetry(
(retry) =>
fetch(url, { timeout: 10000 })
fetch(url, { signal: AbortSignal.timeout(15000) })
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
Expand All @@ -100,7 +99,7 @@ export class PlantUMLServer extends EventEmitter {
this.emit('process:server:error', url, response.statusText);
return null;
}
const text = await response.buffer();
const text = await response.arrayBuffer();
return text;
}

Expand Down

0 comments on commit bc947d0

Please sign in to comment.