Skip to content

Commit 5afeaac

Browse files
committed
Switch from glkaudio to two packages from audio-decode
Update to Typescript 5.9 and other dependencies
1 parent 0fd94df commit 5afeaac

14 files changed

Lines changed: 58 additions & 49 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Parchment is MIT licensed, and incorporates the following upstream projects:
3030
Name | Upstream repo | License
3131
------- | ------------- | -------
3232
AsyncGlk | [curiousdannii/asyncglk](https://github.com/curiousdannii/asyncglk) | [MIT](https://github.com/curiousdannii/asyncglk/blob/master/LICENSE)
33-
Bocfel | [garglk/garglk](https://github.com/garglk/garglk) | [GPL-2.0](https://github.com/garglk/garglk/blob/master/terps/bocfel/COPYING.GPLv2)/[GPL-3.0](https://github.com/garglk/garglk/blob/master/terps/bocfel/COPYING.GPLv3)
33+
Bocfel | [garglk/garglk](https://github.com/garglk/garglk) | [MIT](https://github.com/garglk/garglk/blob/master/terps/bocfel/LICENSE)
3434
Emglken | [curiousdannii/emglken](https://github.com/curiousdannii/emglken) | [MIT](https://github.com/curiousdannii/emglken/blob/master/LICENSE)
3535
Git | [DavidKinder/Git](https://github.com/DavidKinder/Git) | [MIT](https://github.com/DavidKinder/Git/blob/master/README.txt)
3636
Glulxe | [erkyrath/glulxe](https://github.com/erkyrath/glulxe) | [MIT](https://github.com/erkyrath/glulxe/blob/master/LICENSE)

build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ const common_options = {
170170
// Removing the Emscripten ENVIRONMENT_IS_ variables so that the globals defined above will be used instead. Most Node code will be excluded, except that some variables will still be defined
171171
name: 'EmglkenEnvironmentRemover',
172172
setup(build) {
173-
build.onLoad({filter: /emglken\/build\/\w+.js$/}, async (args) => {
173+
build.onLoad({filter: /emglken\/build\/[-\w]+.js$/}, async (args) => {
174174
let code = await fs.readFile(args.path, 'utf8')
175175
const env_lines = [
176176
// Emscripten 3.1.74

package.json

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parchment",
3-
"version": "2025.1.0",
3+
"version": "2026.4.0",
44
"description": "Parchment Interactive Fiction Player",
55
"repository": "curiousdannii/parchment",
66
"keywords": [
@@ -14,38 +14,40 @@
1414
"homepage": "https://github.com/curiousdannii/parchment#readme",
1515
"type": "module",
1616
"dependencies": {
17-
"base32768": "^3.0.1",
17+
"@audio/decode-aiff": "^1.1.0",
18+
"@audio/decode-vorbis": "^1.0.0",
19+
"base32768": "^5.0.0",
1820
"body-scroll-lock": "^4.0.0-beta.0",
1921
"emglken": "^0.7.0",
2022
"fflate": "^0.8.1",
2123
"file-saver": "^2.0.5",
22-
"glkaudio": "file:src/upstream/asyncglk/src/glkaudio/pkg",
23-
"jquery": "^3.7.1",
24+
"jquery": "^4.0.0",
2425
"js-cookie": "^3.0.1",
2526
"lodash-es": "^4.17.21",
2627
"path-browserify-esm": "^1.0.4",
27-
"pretty-bytes": "^6.1.1"
28+
"pretty-bytes": "^7.0.0"
2829
},
2930
"devDependencies": {
30-
"@types/body-scroll-lock": "^3.1.2",
31-
"@types/file-saver": "^2.0.7",
32-
"@types/jquery": "^3.5.11",
33-
"@types/js-cookie": "^3.0.4",
34-
"@types/lodash-es": "^4.17.5",
35-
"@types/minimist": "^1.2.2",
36-
"@typescript-eslint/parser": "~8.18.0",
37-
"esbuild": "^0.25.0",
38-
"esbuild-svelte": "^0.8.1",
39-
"eslint": "^9.12.0",
40-
"eslint-plugin-compat": "^6.0.0",
41-
"eslint-plugin-svelte": "^2.44.1",
31+
"esbuild": "^0.28.0",
32+
"esbuild-svelte": "^0.9.0",
33+
"eslint": "^10.0.0",
34+
"@eslint/js": "^10.0.0",
35+
"eslint-plugin-compat": "^7.0.0",
36+
"eslint-plugin-svelte": "^3.0.0",
4237
"minimist": "^1.2.6",
4338
"regtest-html": "^0.1.4",
4439
"svelte": "^4.2.19",
4540
"svelte-check": "^4.0.4",
4641
"svelte-preprocess": "^6.0.3",
47-
"typescript": "~5.6.0",
48-
"typescript-eslint": "~8.17.0"
42+
"typescript": "~5.9.0",
43+
"typescript-eslint": "~8.58.0",
44+
"@types/body-scroll-lock": "^3.1.2",
45+
"@types/file-saver": "^2.0.7",
46+
"@types/jquery": "^4.0.0",
47+
"@types/js-cookie": "^3.0.0",
48+
"@types/lodash-es": "^4.17.5",
49+
"@types/minimist": "^1.2.2",
50+
"@typescript-eslint/parser": "~8.58.0"
4951
},
5052
"scripts": {
5153
"build": "./build.js",

src/common/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ https://github.com/curiousdannii/parchment
99
1010
*/
1111

12-
export async function Uint8Array_to_base64(data: Uint8Array): Promise<string> {
12+
export async function Uint8Array_to_base64(data: Uint8Array<ArrayBuffer>): Promise<string> {
1313
if (typeof Buffer !== 'undefined') {
1414
return Buffer.from(data.buffer).toString('base64')
1515
}

src/common/formats.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ https://github.com/curiousdannii/parchment
1111

1212
import {Blorb} from '../upstream/asyncglk/src/index-common.js'
1313

14-
import type {ParchmentOptions, StoryOptions} from './interface.js'
14+
import type {EmglkenEngine, EmglkenEngineOptions, ParchmentOptions, StoryOptions} from './interface.js'
1515

1616
export interface Engine {
1717
id: string
@@ -29,11 +29,11 @@ export interface Format {
2929
async function generic_emglken_vm(story: StoryOptions, options: ParchmentOptions, requires: [any, Uint8Array]) {
3030
const [engine, wasmBinary] = requires
3131

32-
const vm_options = Object.assign({}, options, {
33-
arguments: [story.path],
32+
const vm_options: EmglkenEngineOptions = Object.assign({}, options, {
33+
arguments: [story.path!],
3434
})
3535

36-
const vm = await engine.default({wasmBinary})
36+
const vm: EmglkenEngine = await engine.default({wasmBinary})
3737
vm.start(vm_options)
3838
}
3939

@@ -195,7 +195,7 @@ export function identify_blorb_storyfile_format(blorb: Blorb) {
195195
GLUL: 'glulx',
196196
ZCOD: 'zcode',
197197
}
198-
const chunktype = blorb.get_chunk('exec', 0)?.blorbtype
198+
const chunktype = blorb.get_chunk('Exec', 0)?.chunktype
199199
if (chunktype && blorb_chunks[chunktype]) {
200200
return find_format(blorb_chunks[chunktype])
201201
}

src/common/interface.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ https://github.com/curiousdannii/parchment
1111

1212
import type {BrowserDialog, /*GlkApi,*/ GlkOte, GlkOteOptions, TruthyOption} from '../upstream/asyncglk/src/index-common.js'
1313

14+
export interface EmglkenEngineOptions extends ParchmentOptions {
15+
arguments: string[],
16+
}
17+
18+
export interface EmglkenEngine {
19+
start: (options: EmglkenEngineOptions) => void,
20+
}
21+
1422
/** The size and gzipped size of a file */
1523
export interface FileSize {
1624
/** Size of file in bytes, gzip compressed (doesn't need to be exact) */

src/inform7/index.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ https://github.com/curiousdannii/parchment
1212
import {gunzipSync} from 'fflate'
1313

1414
import {Blorb, FileView, parse_base64} from '../upstream/asyncglk/src/index-browser.ts'
15-
import {default as Bocfel} from 'emglken/build/bocfel.js'
15+
import {default as Bocfel} from 'emglken/build/bocfel-noz6.js'
1616
import {default as Glulxe} from 'emglken/build/glulxe.js'
17-
import type {ParchmentOptions} from '../common/interface.js'
17+
import type {EmglkenEngine, EmglkenEngineOptions} from '../common/interface.js'
1818
import {get_default_options, get_query_options} from '../common/options.js'
1919

2020
import './inform7.css'
2121

22-
interface Inform7ParchmentOptions extends ParchmentOptions {
23-
arguments?: string[],
22+
interface Inform7ParchmentOptions extends EmglkenEngineOptions {
2423
story_name: string,
2524
}
2625

@@ -37,7 +36,7 @@ async function launch() {
3736
}
3837

3938
// Update the Dialog storage version
40-
await options.Dialog.init(this.options)
39+
await options.Dialog.init(options)
4140

4241
// Discriminate
4342
const storyfilepath = options.default_story[0]
@@ -69,7 +68,7 @@ async function launch() {
6968
url: options.lib_path + wasm_base_filename,
7069
})
7170
}
72-
catch (err) {
71+
catch (err: any) {
7372
return options.GlkOte.error(`Error loading engine: ${err.status}`)
7473
}
7574

@@ -82,7 +81,7 @@ async function launch() {
8281
url: storyfilepath,
8382
})
8483
}
85-
catch (err) {
84+
catch (err: any) {
8685
return options.GlkOte.error(`Error loading storyfile: ${err.status}`)
8786
}
8887

@@ -97,7 +96,7 @@ async function launch() {
9796

9897
const wasmBinary_gz = await parse_base64(wasm_base64)
9998
const wasmBinary = gunzipSync(wasmBinary_gz)
100-
const vm = await engine({wasmBinary})
99+
const vm: EmglkenEngine = await engine({wasmBinary}) as EmglkenEngine
101100
vm.start(options)
102101
}
103102
catch (err) {

src/iplayif.com/app/src/front-page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default class FrontPage {
6666
},
6767
}
6868

69-
const files: Map<string, Uint8Array> = new Map()
69+
const files: Map<string, Uint8Array<ArrayBuffer>> = new Map()
7070
files.set('index.html', utf8encoder.encode(this.index_html))
7171

7272
ctx.body = await process_index_html(options, files)

src/iplayif.com/app/src/sitegen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default class SiteGenerator {
8585
]
8686

8787
// Get all the files
88-
const files: Map<string, Uint8Array> = new Map()
88+
const files: Map<string, Uint8Array<ArrayBuffer>> = new Map()
8989
for (const file of paths) {
9090
const url = `https://${this.options.cdn_domain}/dist/web/${file}`
9191
const response = await fetch(url)
@@ -102,7 +102,7 @@ export default class SiteGenerator {
102102
single_file: true,
103103
story: {
104104
author: metadata.author,
105-
data: await fs.readFile(story_file.filepath),
105+
data: await fs.readFile(story_file.filepath) as Uint8Array<ArrayBuffer>,
106106
description: metadata.description,
107107
filename,
108108
format: metadata.format,

src/tools/file-exporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ window.run = function() {
3939
files[usr_path] = [base32768_decode(data), {mtime: metadata.mtime}]
4040
}
4141

42-
const zip_file = zipSync(files)
42+
const zip_file = zipSync(files) as Uint8Array<ArrayBuffer>
4343
filesaver.saveAs(new Blob([zip_file]), 'parchment-files.zip')
4444
}

0 commit comments

Comments
 (0)