From 4b71ec320790144d07e4c2f56198f2d120bf481d Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 14 Oct 2023 11:02:14 -0700 Subject: [PATCH] Use `@xmldom/xmldom` instead of `xmldom` --- apps/svg/package.json | 5 ++--- apps/svg/src/main.ts | 4 ++-- pnpm-lock.yaml | 23 ++++++++--------------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/apps/svg/package.json b/apps/svg/package.json index 95e140a6..3b199cda 100644 --- a/apps/svg/package.json +++ b/apps/svg/package.json @@ -9,13 +9,12 @@ }, "license": "MIT", "devDependencies": { - "@types/xmldom": "^0.1.31", "esbuild": "^0.17.19", "nxjs-pack": "workspace:^", "nxjs-runtime": "workspace:^" }, "dependencies": { - "canvg": "^4.0.1", - "xmldom": "^0.6.0" + "@xmldom/xmldom": "^0.8.10", + "canvg": "^4.0.1" } } diff --git a/apps/svg/src/main.ts b/apps/svg/src/main.ts index db6280c1..ac85020a 100644 --- a/apps/svg/src/main.ts +++ b/apps/svg/src/main.ts @@ -1,8 +1,8 @@ import { Canvg } from 'canvg'; -import { DOMParser } from 'xmldom'; +import { DOMParser } from '@xmldom/xmldom'; // From: https://commons.wikimedia.org/wiki/File:Ghostscript_Tiger.svg -const svgData = Switch.readFileSync('romfs:/Ghostscript_Tiger.svg'); +const svgData = Switch.readFileSync(new URL('Ghostscript_Tiger.svg', Switch.entrypoint)); const svg = new TextDecoder().decode(svgData); const canvas = Switch.screen; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7aefb512..d56d7ec5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -150,16 +150,13 @@ importers: apps/svg: dependencies: + '@xmldom/xmldom': + specifier: ^0.8.10 + version: 0.8.10 canvg: specifier: ^4.0.1 version: 4.0.1 - xmldom: - specifier: ^0.6.0 - version: 0.6.0 devDependencies: - '@types/xmldom': - specifier: ^0.1.31 - version: 0.1.31 esbuild: specifier: ^0.17.19 version: 0.17.19 @@ -932,14 +929,15 @@ packages: resolution: {integrity: sha512-ASCxdbsrwNfSMXALlC3Decif9rwDMu+80KGp5zI2RLRotfMsTv7fHL8W8VDp24wymzDyIFudhUeSCugrgRFfHQ==} dev: true - /@types/xmldom@0.1.31: - resolution: {integrity: sha512-bVy7s0nvaR5D1mT1a8ZkByHWNOGb6Vn4yi5TWhEdmyKlAG+08SA7Md6+jH+tYmMLueAwNeWvHHpeKrr6S4c4BA==} - dev: true - /@ungap/event-target@0.2.4: resolution: {integrity: sha512-u9Fd3k2qfMtn+0dxbCn/y0pzQ9Ucw6lWR984CrHcbxc+WzcMkJE4VjWHWSb9At40MjwMyHCkJNXroS55Osshhw==} dev: true + /@xmldom/xmldom@0.8.10: + resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==} + engines: {node: '>=10.0.0'} + dev: false + /ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -2900,11 +2898,6 @@ packages: strip-ansi: 6.0.1 dev: true - /xmldom@0.6.0: - resolution: {integrity: sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg==} - engines: {node: '>=10.0.0'} - dev: false - /y18n@4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} dev: true