Closed deevus closed 1 year ago
The solution for saxon-js
is a bit hacky, but it works with very little changes. 🤷
Thank you, that's great! Some comments:
$ npm i
npm WARN skipping integrity check for git dependency ssh://git@github.com/infojunkie/musicxml-mma.git
npm WARN skipping integrity check for git dependency ssh://git@github.com/infojunkie/midi-player.git
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
musicxml-player@0.5.4 postinstall patch-package
patch-package finished with 1 error(s).
added 807 packages, and audited 808 packages in 2m
100 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities $ patch -p1 < patches/webaudiofont+3.0.4.patch patching file node_modules/webaudiofont/npm/dist/WebAudioFontPlayer.js Hunk #1 FAILED at 1220 (different line endings). 1 out of 1 hunk FAILED -- saving rejects to file node_modules/webaudiofont/npm/dist/WebAudioFontPlayer.js.rej $ dos2unix node_modules/webaudiofont/npm/dist/WebAudioFontPlayer.js dos2unix: converting file node_modules/webaudiofont/npm/dist/WebAudioFontPlayer.js to Unix format... $ patch -p1 < patches/webaudiofont+3.0.4.patch patching file node_modules/webaudiofont/npm/dist/WebAudioFontPlayer.js
I wonder if there's an option to `patch-package` that ignores the "line endings" error, e.g. something to pass to `patch` https://stackoverflow.com/questions/7754972/how-do-i-get-patch-to-ignore-carriage-returns
- Would be great to create and apply a patch to `saxon-js` since it's a vendor library, but I will accept your PR without this enhancement.
Weird issue. I'm on MacOS so you would think that the line-endings would be the same.
With regards to using it to patch SaxonJS, I don't think it supports patching arbitrary files. I'll take a look.
The error is a bit weird. Where is the version string 3.0.04
coming from? All references I can find say 3.0.4
Error: Version string '3.0.04' cannot be parsed from /home/kratib/src/infojunkie/testing/musicxml-player/node_modules/webaudiofont/package.json
Ohhh I see what's going on. There's a typo in webaudiofont
's package.json
. The published version is 3.0.4
but the package.json
has 3.0.04
. This is what is breaking patch-package
.
@infojunkie Please try again
Btw I've added a patch for SaxonJS, but since the vendor files are in the index, it won't have any effect. However if you update SaxonJS you can run the patch again.
Thanks, this works really great. I appreciate the way you identified the problems with the 2 dependencies and decided to patch them as a pragmatic fix. Well done!
I have some cleaning up to do on this branch before I can merge into main
.
No problem 😊
I appreciate the opportunity
WebAudioFont
Uses
patch-package
to support bundlingwebaudiofont
by adding an export forWebAudioFontPlayer
.Saxon JS
Updated
./dist/saxon-js/SaxonJS2.rt.js
to assign variables towindow
explicitly. Importing the package intosrc/index.ts
./claim #17