wavesjs / waves

[deprecated]
http://wavesjs.github.io
BSD 3-Clause "New" or "Revised" License
52 stars 4 forks source link

npm run build #16

Closed Henri-Weezic closed 9 years ago

Henri-Weezic commented 9 years ago

Hi, I'm a user of your WAVES library project.

I'm trying to create my own custom build as it describes in the README.md. The command 'npm run build' gives me some error and so I'm reporting here.

It seems like it can not find the module 'loaders', and it should be 'waves-loaders'. So I rename the folder and all is good.

'babel-runtime' package is missing as 'devDependencies'. Differents modules need it so I install the package under the 'waves' folder like this way : 'npm install --savedev babel-runtime'.

After that, all seems to work, but when I included the script file 'waves.min.js' to the html page, javascript console gives me an error with the 'babel-helpers' function. I didn't found the way to resolve it, and I think the problem should be caused by the 'babel-runtime' package.

b-ma commented 9 years ago

Hi, there was some heavy refactoring on the bundle that might explain the problem. This should work now.

Be careful however because some of the namespaces have changed, in particular loaders is now exposed in waves.loaders and not in waves.helpers.loaders anymore, also the repository is now here https://github.com/wavesjs/waves and the doc moved there http://wavesjs.github.io/.

Let me know if this changes fixed your problem.

Henri-Weezic commented 9 years ago

Thanks for your replying. So with the new 'waves.min.js' script file included in my HTML page, I get a message error with the 'transport' module. I commented this line and I get the same error with 'playControl' module. It seems that the browser didn't find the 'waves.audio' component. I join an image below with the undefined error.

Actually, I'm trying to create an engine and add to the 'transport' module. So with your new components architecture, I added a 'require' line in 'waves-audio.js' and place my engine js file to 'es6/engines' subfolder. It seems that I don't need to add the new dependency in the 'package.json'. The command 'npm run bundle' works fine in the 'waves-audio.js' and I get my engine in the generated minify file.

But in the higher level ('waves' folder), the same command download the same components from git and replace the 'waves-audio.min.js' file created previously. So if I want to generate the minify 'waves.js' file, what is the command ? It should be something like a combined command with 'browserify' and 'uglify' but I didn't find in your 'script.js' file.

image

b-ma commented 9 years ago

Hi, many things in your problems...

First, when you create your local variables for your audio components, you forgot the uppercase in constructor names, so it is undefined. Replace waves.audio.metronome with waves.audio.Metronome and it should work.

Secondly, I really don't understand why do you try to add your component inside the library. What about creating your own engine in some /lib folder (or similar) and just consume it in your app ? The kind of thing you are trying to achieve is not provided by the library and I really don't see why it should be, as it is a library and not a framework.

Henri-Weezic commented 9 years ago

Ok, so for the first problem, I didn't change my code before you updated the library. So it works now. Thanks ! You should update the Granular Engine code example too on this page : http://wavesjs.github.io/audio/.

And for the second, I'll try as you say. I was thinking about to recreate the minified 'waves.js' including my engine, but I didn't think about to create an external module and add it after.

Anyhow, thanks for your fast replying.

b-ma commented 9 years ago

Hey, thanks for the information concerning the docs, we have indeed some work to do on the examples to keep them up to date.