From 5accd657d98cdc09e9fbd1ace14d4b32e5ae8ac2 Mon Sep 17 00:00:00 2001 From: zsviczian Date: Thu, 12 Jun 2025 19:19:14 +0000 Subject: [PATCH] npm version, fix gpt-4-vision --- .devcontainer/devcontainer.json | 17 +++++++++++++++++ .github/dependabot.yml | 7 +++++++ .nvmrc | 2 +- package-lock.json | 12 ++++++++---- package.json | 10 +++++++--- src/utils/matic.ts | 4 ++-- 6 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/dependabot.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..0a658f4 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "name": "Node.js 20", + "image": "mcr.microsoft.com/devcontainers/javascript-node:20", + "features": { + "ghcr.io/devcontainers/features/node:1": { + "version": "20" + } + }, + "postCreateCommand": "npm install", + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.vscode-typescript-next" + ] + } + } +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9b2f0c8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + target-branch: "master" diff --git a/.nvmrc b/.nvmrc index 3c03207..209e3ef 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18 +20 diff --git a/package-lock.json b/package-lock.json index b947a8e..9b487c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@popperjs/core": "^2.11.8", "@zsviczian/colormaster": "^1.2.2", - "@zsviczian/excalidraw": "0.18.0-19", + "@zsviczian/excalidraw": "0.18.0-21", "chroma-js": "^2.4.2", "clsx": "^2.0.0", "es6-promise-pool": "2.5.0", @@ -72,6 +72,10 @@ "ttypescript": "^1.5.15", "typescript": "^5.7.3", "uglify-js": "^3.19.3" + }, + "engines": { + "node": ">=20.0.0", + "npm": ">=10.0.0" } }, "node_modules/@ampproject/remapping": { @@ -3490,9 +3494,9 @@ "license": "MIT" }, "node_modules/@zsviczian/excalidraw": { - "version": "0.18.0-19", - "resolved": "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.18.0-19.tgz", - "integrity": "sha512-29x40tC1x3w55obZuwRbDj6HPq5XHEeOSVJq7XMoxJS3pRgLVQI7uc5jVjxZgVnQ+xhAjWvVHkBrc0dKZfRa1w==", + "version": "0.18.0-21", + "resolved": "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.18.0-21.tgz", + "integrity": "sha512-j7ltw+FY8SrcN7a2NlPACNnUsiG6eZCLAwjZNg275U2puDf4CVGzCl6d4hB24jUn9DL5F4HKrcKLspBhxJHKaA==", "license": "MIT", "dependencies": { "@braintree/sanitize-url": "6.0.2", diff --git a/package.json b/package.json index 0095344..e95dc1c 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ "keywords": [], "author": "", "license": "MIT", -"dependencies": { + "dependencies": { "@popperjs/core": "^2.11.8", - "@zsviczian/excalidraw": "0.18.0-19", + "@zsviczian/excalidraw": "0.18.0-21", "chroma-js": "^2.4.2", "clsx": "^2.0.0", "@zsviczian/colormaster": "^1.2.2", @@ -89,5 +89,9 @@ "resolutions": { "@typescript-eslint/typescript-estree": "5.3.0" }, - "prettier": "@excalidraw/prettier-config" + "prettier": "@excalidraw/prettier-config", + "engines": { + "node": ">=20.0.0", + "npm": ">=10.0.0" + } } diff --git a/src/utils/matic.ts b/src/utils/matic.ts index ce44391..ce880a0 100644 --- a/src/utils/matic.ts +++ b/src/utils/matic.ts @@ -1,4 +1,4 @@ -import { THEME } from "../constants/constants"; +import { EXCALIDRAW_PLUGIN, THEME } from "../constants/constants"; import type { Theme } from "@zsviczian/excalidraw/types/element/src/types"; import type { DataURL } from "@zsviczian/excalidraw/types/excalidraw/types"; import type { OpenAIInput, OpenAIOutput } from "@zsviczian/excalidraw/types/excalidraw/data/ai/types"; @@ -43,7 +43,7 @@ export async function diagramToHTML({ theme?: Theme; }) { const body: OpenAIInput.ChatCompletionCreateParamsBase = { - model: "gpt-4-vision-preview", + model: EXCALIDRAW_PLUGIN.settings.openAIDefaultVisionModel, // 4096 are max output tokens allowed for `gpt-4-vision-preview` currently max_tokens: 4096, temperature: 0.1,