Skip to content

Commit

Permalink
Ensure that we're always referring to node_modules/emglken, not src/u…
Browse files Browse the repository at this point in the history
…pstream/emglken, and test the npm version (follow on to #172)
  • Loading branch information
curiousdannii committed Jan 22, 2025
1 parent bcda785 commit 6c3925f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ jobs:
./tools/package-inform7.sh
- name: Test storyfiles
run: ./tests/runtests.sh
- name: Test npm version of Emglken
if: github.ref == 'refs/heads/master'
run: |
npm install
./build.js
./tools/make-single-file.js
./tools/package-inform7.sh
./tests/runtests.sh
- name: Check browser compatibility
run: ./tests/check-compat.sh
- run: cp tools/deploy.gitignore .gitignore
Expand Down
4 changes: 2 additions & 2 deletions src/inform7/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ https://github.com/curiousdannii/parchment
import {gunzipSync} from 'fflate'

import {Blorb, FileView, parse_base64} from '../upstream/asyncglk/src/index-browser.ts'
import {default as Bocfel} from '../upstream/emglken/build/bocfel.js'
import {default as Glulxe} from '../upstream/emglken/build/glulxe.js'
import {default as Bocfel} from 'emglken/build/bocfel.js'
import {default as Glulxe} from 'emglken/build/glulxe.js'
import type {ParchmentOptions} from '../common/interface.js'
import {get_default_options, get_query_options} from '../common/options.js'

Expand Down
2 changes: 1 addition & 1 deletion src/tools/inform7-wasm-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const rootpath = path.join(path.dirname(fileURLToPath(import.meta.url)), '..')

// Compress and base64 encode the wasm files
for (const vm of ['bocfel', 'glulxe']) {
const wasm = await fs.readFile(path.join(rootpath, `src/upstream/emglken/build/${vm}.wasm`))
const wasm = await fs.readFile(path.join(rootpath, `node_modules/emglken/build/${vm}.wasm`))
const wasm_gz = gzipSync(wasm, {level: 9})
const base64 = await Uint8Array_to_base64(wasm_gz)
await fs.writeFile(path.join(rootpath, `dist/inform7/Parchment/${vm}.js`), `processBase64Zcode('${base64}')`)
Expand Down

0 comments on commit 6c3925f

Please sign in to comment.