From 02513b76ed66041044e80f8749df7f29379c424e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milien=20=28perso=29?= <4016501+unixfox@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:58:04 +0200 Subject: [PATCH] fix: fix deno usage of protobuf and jintr (#776) * fix: fix deno usage of protobuf and jintr * fix Import assertions are deprecated --- package.json | 2 +- src/platform/deno.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5c0bf7b0..0b678081 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "clean": "rimraf ./dist ./bundle/browser.js ./bundle/browser.min.js ./bundle/node.cjs ./bundle/cf-worker.js ./bundle/react-native.js ./deno", "build": "npm run clean && npm run build:parser-map && npm run build:esm && npm run bundle:node && npm run bundle:browser && npm run bundle:browser:prod && npm run bundle:cf-worker && npm run bundle:react-native", "build:esm": "tspc", - "build:deno": "cpy ./src ./deno && cpy ./protos ./deno && esbuild ./src/utils/DashManifest.tsx --keep-names --format=esm --platform=neutral --target=es2020 --outfile=./deno/src/utils/DashManifest.js && cpy ./package.json ./deno && replace \".js';\" \".ts';\" ./deno -r && replace '.js\";' '.ts\";' ./deno -r && replace \"'./DashManifest.ts';\" \"'./DashManifest.js';\" ./deno -r && replace \"'jintr';\" \"'https://esm.sh/jintr';\" ./deno -r", + "build:deno": "cpy ./src ./deno && cpy ./protos ./deno && esbuild ./src/utils/DashManifest.tsx --keep-names --format=esm --platform=neutral --target=es2020 --outfile=./deno/src/utils/DashManifest.js && cpy ./package.json ./deno && replace \".js';\" \".ts';\" ./deno -r && replace '.js\";' '.ts\";' ./deno -r && replace \"'./DashManifest.ts';\" \"'./DashManifest.js';\" ./deno -r && replace \"'jintr';\" \"'https://esm.sh/jintr@2.1.1';\" ./deno -r && replace \"@bufbuild/protobuf/wire\" \"https://esm.sh/@bufbuild/protobuf@2.0.0/wire\" ./deno -r", "build:proto": "rimraf ./protos/generated && node ./dev-scripts/generate-proto.mjs", "build:parser-map": "node ./dev-scripts/gen-parser-map.mjs", "bundle:node": "esbuild ./dist/src/platform/node.js --bundle --target=node16 --keep-names --format=cjs --platform=node --outfile=./bundle/node.cjs --external:jintr --external:undici --external:linkedom --external:tslib --banner:js=\"/* eslint-disable */\"", diff --git a/src/platform/deno.ts b/src/platform/deno.ts index f90913eb..b0cb3e8b 100644 --- a/src/platform/deno.ts +++ b/src/platform/deno.ts @@ -3,7 +3,7 @@ import type { ICache } from '../types/Cache.js'; import { Platform } from '../utils/Utils.js'; import evaluate from './jsruntime/jinter.js'; import sha1Hash from './polyfills/web-crypto.js'; -import package_json from '../../package.json' assert { type: 'json' }; +import package_json from '../../package.json' with { type: 'json' }; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore