anaisbetts / grunt-build-atom-shell

Grunt task to build Electron and rebuild node modules
MIT License
122 stars 11 forks source link

rebuild-native-modules workflow #22

Open Wortex17 opened 9 years ago

Wortex17 commented 9 years ago

Can you document / explain what rebuild-native-modules exactly does? Which modules (where) does it rebuild? Can i define the directory where the packages lie that need to be rebuilt? (if they are not in the default directory). Does it rebuild them matching the previously generated custom distribution?

In line of that question, is this feedback when running it expected?:

 Found existing node.js installation, skipping install to save time!
Warning: Arguments to path.resolve must be strings Use --force to continue.
anaisbetts commented 9 years ago

rebuild-native-modules recompiles all of the modules you've installed via npm install to be compatible with Atom Shell (on initial install, they will be built against your system's node.js, which won't work). You don't need to define a directory, it will always be looking through your app's packages (even if they are >2nd level dependencies i.e. a JS lib which depends on a native module). Basically, if it works right, you don't have to think about it at all :)

The warning isn't expected, can you run with --verbose --stack?

Wortex17 commented 9 years ago

So, if I understood correctly, I "only" looks at the modules installed at the package.json from where grunt was started too, right? Is it possible to define a different package / root directory for that process? My workflow is different as I have a project which builds a branded atom-shell (by using grunt-build-atom-shell), but a seperate project which actually contains the modules (this will be the app later started with the custom branded shell). they are not the same and thus do not share a package.json I wanted to seperate the logic between building the shell and building the app within. For this purpose, it would be really usefull if I could decide where the native-module rebuilding is executed in.

The warning isn't expected, can you run with --verbose --stack?

Will do, while opening a seperate issue for that

anaisbetts commented 9 years ago

@Wortex17 I believe it looks at the root package.json. I'm not sure that this supports your scenario out of the box, but I'd take a PR to make it work

Wortex17 commented 9 years ago

Hmm i'm wondering what it would need to be configurable this way. I think it would be sufficient to change the cwd somewhere the rebuild-native-modules task. grunt-build-atom-shell works different that most of the other grunt modules I'm used to. Currently there is no way to define mutliple build setups (just a global configuration used for all tasks), so I guess I would have to provide a setting in the config to set the cwd of the r-n-m task.