cwilso / WebMIDIAPIShim

Polyfill using the Jazz NPAPI MIDI plugin to implement the Web MIDI API on Mac and Windows.
380 stars 53 forks source link

Build scripts bitrotted #74

Closed rektide closed 6 years ago

rektide commented 6 years ago

I am trying to work on improvements (open and close return promises in the current version of the spec) and debug some issues I'm seeing with Nodejs (I am near certain this is breaking my node scripts), however I am having a real time of it trying to get any of these build scripts to run. Trying to work with the minified source has proved difficult.

There are a lot of >= package versions, which I believe permit drastically more modern versions of packages to be loaded.

First off, doing an npm ls tells me I have unsatisfied peer dependencies:

npm ERR! peer dep missing: babel-core@6 || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc, required by babelify@8.0.0

I used npm install babel-core@6 to try to work around that.

Next attempt gave me:

> web-midi-api-dev@0.0.0 build-nodejs /home/rektide/projects/archive/WebMIDIAPIShim
> gulp build-nodejs

[03:34:17] Using gulpfile ~/projects/archive/WebMIDIAPIShim/gulpfile.js
[03:34:17] Starting 'build-nodejs'...

events.js:183
      throw er; // Unhandled 'error' event
      ^
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'

I backtracked from here. I saw the babelify I have is 8.0.0, but the package.json is >=6.0.0. So I changed that to ^6.0.0, thinking that would give me a more compatible version. I wiped node_modules, and did npm install again. Babelify 6.4.0, no missing peer dependencies.

This time, npm run build-nodejs gave me,

[03:39:13] Starting 'build-nodejs'...
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: Cannot find module 'babelify/node_modules/babel-core/node_modules/core-js/es6/map' from '/home/rektide/projects/archive/WebMIDIAPIShim/src'
    at /home/rektide/projects/archive/WebMIDIAPIShim/node_modules/browser-resolve/node_modules/resolve/lib/async.js:46:17
    at process (/home/rektide/projects/archive/WebMIDIAPIShim/node_modules/browser-resolve/node_modules/resolve/lib/async.js:173:43)
    at ondir (/home/rektide/projects/archive/WebMIDIAPIShim/node_modules/browser-resolve/node_modules/resolve/lib/async.js:188:17)
    at load (/home/rektide/projects/archive/WebMIDIAPIShim/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/home/rektide/projects/archive/WebMIDIAPIShim/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /home/rektide/projects/archive/WebMIDIAPIShim/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:152:21)

I tried going into node_modules/babelify/node_modules/babel-core. It looks to be babel 5.8.35, and there is no node_modules directory. I ran npm install from inside there, then backed out to the top of webmidiapishim.

This actually ran.

I can try to make a PR that sets babelify to be ^6.0.0, and suggest this workaround (recursing into babelify's babel-core, npm installing again) in the README. Not sure if this is a good path or not? Thoughts?

jazz-soft commented 6 years ago

I believe this is fixed in abudaan's branch: https://github.com/abudaan/WebMIDIAPIShim

cwilso commented 6 years ago

Should be fixed now?