diff --git a/index.html b/index.html index fe6a308f..1dcf0539 100644 --- a/index.html +++ b/index.html @@ -162,11 +162,6 @@ - diff --git a/package-lock.json b/package-lock.json index 511305b7..9ed9995b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,6 @@ "@tanstack/react-virtual": "3.13.12", "@virtuoso.dev/masonry": "^1.4.0", "axios": "^1.13.6", - "buffer": "^6.0.3", "clsx": "^2.1.1", "color-hash": "^2.0.2", "consola": "^3.4.2", @@ -5526,26 +5525,6 @@ "dev": true, "license": "MIT" }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/baseline-browser-mapping": { "version": "2.10.8", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.8.tgz", @@ -5636,30 +5615,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -9153,26 +9108,6 @@ "node": ">=4" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", diff --git a/package.json b/package.json index 2a35785e..54b4ad65 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "@tanstack/react-virtual": "3.13.12", "@virtuoso.dev/masonry": "^1.4.0", "axios": "^1.13.6", - "buffer": "^6.0.3", "clsx": "^2.1.1", "color-hash": "^2.0.2", "consola": "^3.4.2", diff --git a/src/features/dashboard/subscription-templates/template-editor-actions/template-editor-actions.feature.tsx b/src/features/dashboard/subscription-templates/template-editor-actions/template-editor-actions.feature.tsx index f5c3cff5..118f3588 100644 --- a/src/features/dashboard/subscription-templates/template-editor-actions/template-editor-actions.feature.tsx +++ b/src/features/dashboard/subscription-templates/template-editor-actions/template-editor-actions.feature.tsx @@ -13,6 +13,7 @@ import { useClipboard, useDisclosure, useMediaQuery } from '@mantine/hooks' import { PiCheckSquareOffset, PiFloppyDisk } from 'react-icons/pi' import { ActionIcon, Button, Group, Menu } from '@mantine/core' import { useTranslation } from 'react-i18next' +import { encode } from '@stablelib/base64' import { RefObject } from 'react' import { useDownloadTemplate } from '@shared/ui/load-templates/use-download-template' @@ -66,7 +67,7 @@ export function TemplateEditorActionsFeature(props: Props) { updateConfig({ variables: { uuid: template.uuid, - encodedTemplateYaml: Buffer.from(currentValue, 'utf-8').toString('base64') + encodedTemplateYaml: encode(new TextEncoder().encode(currentValue)) } }) } diff --git a/src/widgets/dashboard/templates/subscription-template-editor/subscription-template-editor.widget.tsx b/src/widgets/dashboard/templates/subscription-template-editor/subscription-template-editor.widget.tsx index 3848c138..e315570a 100644 --- a/src/widgets/dashboard/templates/subscription-template-editor/subscription-template-editor.widget.tsx +++ b/src/widgets/dashboard/templates/subscription-template-editor/subscription-template-editor.widget.tsx @@ -6,6 +6,7 @@ import 'monaco-yaml/yaml.worker.js' import { Box, Card, Paper } from '@mantine/core' import { useLayoutEffect, useRef } from 'react' import { useTranslation } from 'react-i18next' +import { decode } from '@stablelib/base64' import { TemplateEditorActionsFeature } from '@features/dashboard/subscription-templates/template-editor-actions' import { monacoTheme } from '@shared/constants/monaco-theme/monaco-theme' @@ -30,7 +31,7 @@ export function SubscriptionTemplateEditorWidget(props: Props) { const getConfig = () => { if (editorType === 'yaml') { return template.encodedTemplateYaml - ? Buffer.from(template.encodedTemplateYaml, 'base64').toString() + ? new TextDecoder().decode(decode(template.encodedTemplateYaml)) : '' } return JSON.stringify(template.templateJson, null, 2) diff --git a/vite.config.ts b/vite.config.ts index 6ffbeaa8..ab5ec814 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -67,8 +67,6 @@ export default defineConfig({ utils: [ 'nanoid', 'ufo', - 'base64-js', - 'buffer', 'consola', 'semver', 'is-svg',