From 8fa55cd9bd3c7f781e78f51e39d82cbad8865bb6 Mon Sep 17 00:00:00 2001 From: Offroaders123 <65947371+Offroaders123@users.noreply.github.com> Date: Sun, 2 Jul 2023 21:00:45 -0700 Subject: [PATCH] NBTify Deflate-Raw Bringing Dovetail up to the latest version of NBTify! That means that now there is support for Deflate-Raw compressed files! This update was waiting on fixes for some additional compression errors in NBTify that went unnoticed in the tests I wrote for Node, because Node has a different streams implementation which was behaving differently, and is passing the tests unexpectedly, meaning the extra unhandled errors were only happening in the browser. https://github.com/Offroaders123/Dovetail/issues/1 --- index.html | 32 ++++++++++++++++++++------------ package-lock.json | 16 ++++++++-------- package.json | 4 ++-- public/service-worker.js | 2 +- src/app.ts | 8 ++++---- styles.css | 4 ++++ 6 files changed, 39 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index b8a9a9a..80fc51c 100644 --- a/index.html +++ b/index.html @@ -63,18 +63,26 @@

Format Options

Compression - - - +
+ + +
+
+ + +
diff --git a/package-lock.json b/package-lock.json index d1274d3..7c59ae1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,12 +7,12 @@ "name": "dovetail", "dependencies": { "compression-streams-polyfill": "^0.1.4", - "nbtify": "^1.35.2" + "nbtify": "^1.60.2" }, "devDependencies": { "better-typescript": "^0.1.3", "new-javascript": "^0.3.4", - "typescript": "^5.1.3", + "typescript": "^5.1.6", "vite": "^4.3.9" } }, @@ -468,9 +468,9 @@ } }, "node_modules/nbtify": { - "version": "1.35.2", - "resolved": "https://registry.npmjs.org/nbtify/-/nbtify-1.35.2.tgz", - "integrity": "sha512-eF4rs2uROOMepPVNxq/IPFAC80pFbZ5SWwhOFSMNNwMvRVHrwlEBF21VCZK9OSxwRI5uKtpl5oCekQvRvyqxPg==" + "version": "1.60.2", + "resolved": "https://registry.npmjs.org/nbtify/-/nbtify-1.60.2.tgz", + "integrity": "sha512-p63A4g7b01SMStSNyK2/QFRfTTW9IC3PSPy3SscHOAMr1BSL+UIcm65bQweI8AWost/igfWBkXFExVHldyBfrw==" }, "node_modules/new-javascript": { "version": "0.3.4", @@ -538,9 +538,9 @@ } }, "node_modules/typescript": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", - "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index 8f4b592..3093e5e 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,12 @@ }, "dependencies": { "compression-streams-polyfill": "^0.1.4", - "nbtify": "^1.35.2" + "nbtify": "^1.60.2" }, "devDependencies": { "better-typescript": "^0.1.3", "new-javascript": "^0.3.4", - "typescript": "^5.1.3", + "typescript": "^5.1.6", "vite": "^4.3.9" } } \ No newline at end of file diff --git a/public/service-worker.js b/public/service-worker.js index 45908d5..f773dcd 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -4,7 +4,7 @@ var self = /** @type { ServiceWorkerGlobalScope } */ (/** @type { unknown } */ (globalThis)); const NAME = "Dovetail"; -const VERSION = "v1.6.2"; +const VERSION = "v1.6.3"; const CACHE_NAME = /** @type { const } */ (`${NAME} ${VERSION}`); self.addEventListener("activate",event => { diff --git a/src/app.ts b/src/app.ts index e148f40..42da50c 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,6 +1,6 @@ import "./compression-polyfill.js"; import { read, write, parse, stringify, NBTData, Int32 } from "nbtify"; -import type { Name, Endian, Compression, BedrockLevel, NBTDataOptions, RootTag } from "nbtify"; +import type { Name, Endian, Compression, BedrockLevel, FormatOptions, RootTag } from "nbtify"; const platform = navigator.userAgentData?.platform ?? navigator.platform; const isiOSDevice = /^(Mac|iPhone|iPad|iPod)/i.test(platform) && typeof navigator.standalone === "boolean"; @@ -110,7 +110,7 @@ export async function openFile(file: File): Promise { /** * Updates the Format Options dialog to match the NBT file's metadata. */ -export function openOptions({ name, endian, compression, bedrockLevel }: NBTData): NBTDataOptions { +export function openOptions({ name, endian, compression, bedrockLevel }: NBTData): FormatOptions { const { elements } = formatForm; if (name !== null){ @@ -143,7 +143,7 @@ export async function readFile(file: File): Promise(buffer,{ strict: false }); } else { alert(error); - return null; + return null; } } } @@ -151,7 +151,7 @@ export async function readFile(file: File): Promise div + div { + margin-top: 0.25em; } \ No newline at end of file