Code Monkey home page Code Monkey logo

Comments (13)

steffenmllr avatar steffenmllr commented on May 13, 2024

Great work! this would also be nice for the cli version. Something like nwbuild --run myapp.
Would you like to add tests for it and send a PR? Trying to get this whole thing shipped by the end of next week.

from nw-builder.

1j01 avatar 1j01 commented on May 13, 2024

My implementation actually just downloads node-webkit for all versions in the options, instead of the one for your current platform. It could completely fail if for some reason in the uncommon case that your current platform wasn't included.

from nw-builder.

steffenmllr avatar steffenmllr commented on May 13, 2024

I would just download the current platform. So if you are on a mac just download the mac version and ignore the --platform settings if it get's called with --run

from nw-builder.

ivantodorovich avatar ivantodorovich commented on May 13, 2024

👍

from nw-builder.

steffenmllr avatar steffenmllr commented on May 13, 2024

The first version is published to npm - should add tests at some point :) Tell me what you think

from nw-builder.

ivantodorovich avatar ivantodorovich commented on May 13, 2024

Thanks!
El abr 20, 2014 11:08 AM, "Steffen Müller" [email protected]
escribió:

The first version is published to npm - should add tests at some point :)
Tell me what you think


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-40895626
.

from nw-builder.

1j01 avatar 1j01 commented on May 13, 2024

So now it downloads only the current platform, but only in the CLI. I'm using the module directly, so running it would still download the platforms in the options. Ideally, you should be able to do

nwb = new NwBuilder({
    files: 'app/**/*',
    platforms: ['mac'] // (doesn't contain current platform)
});

nwb.run(); // only dl current platform (only windows for instance)
setTimeout(function(){
    nwb.build(); // dl chosen platforms (only mac)
}, require("timespan")("5 years").ms());

Changing options.platforms only works for a NwBuilder instance that won't be used again, so it wouldn't work for the above (somewhat ridiculous) case to just move the switch(process.platform){...} into run (which would be nice and simple)
Rather downloadNodeWebkit should be given an argument (platforms) and be called with options.platforms when building and the result* of the switch when running.
*I'm used to coffeescript.

from nw-builder.

steffenmllr avatar steffenmllr commented on May 13, 2024

hmm why are you not using the CLI version for running nw? It wasn't designed to be used programmatically. What exactly are you trying to do? I don't really get it from the code above.

from nw-builder.

1j01 avatar 1j01 commented on May 13, 2024

hmm why are you not using the CLI version for running nw?

Well it didn't exist when I started using the module and also using a cakefile/gulpfile lets you do more with one command, like compiling coffeescript before building/running the app. And not just with a command, but with a keyboard shortcut (^b) in Sublime Text.

It wasn't designed to be used programmatically.

It should be, as it's a real use case, and a recommended one: "For Gulp, just use the module"?
The CLI should just be an interface to the module, and the module should do the choosing of the downloading of the relevant versions and whatnot.

from nw-builder.

adam-lynch avatar adam-lynch commented on May 13, 2024

My team definitely will be using this only programmatically

from nw-builder.

1j01 avatar 1j01 commented on May 13, 2024

I'd like to make a pull request with the small change of moving the platform-choosing out of the CLI and into the API
I think I know enough git to do that now :P

from nw-builder.

mmacaulay avatar mmacaulay commented on May 13, 2024

Got this working, although I found the use of the files option when called with run to be a little weird (especially since it needs to be a glob). Seems like you should be able to just pass in a dir when in run mode and have it create the files object that gets passed to checkFiles. Won't need to do a replace on options.files in the runApp either, just pass in the dir and spawn against that.

Thoughts? I can put together a PR...

from nw-builder.

dgattey avatar dgattey commented on May 13, 2024

Put together a PR and let's check it out.

from nw-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.