-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functionality to install modules during init #233
Conversation
Install modules specified in package.json during initialisation as a alternative to packageing them. Detect if the node_modules directory is missing and installes the node modules.
@@ -46,6 +46,17 @@ function initializeActionHandler(message) { | |||
return Promise.reject('Zipped actions must contain either package.json or index.js at the root.'); | |||
} | |||
|
|||
// install npm modules during init if source code zip doesn´t containt them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice!
I want to let this in but unsure if there would be no side effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my tests so far the current functionality is not impacted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No edge case comes up in my mind too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Simple example that shows how the new functionality works
function main(args) {
const oneLinerJoke = require('./one-liner-joke');
let getRandomJoke = oneLinerJoke.getRandomJoke();
return {
body: getRandomJoke.body
}
}
module.exports.main = main;
{
"name": "my-action",
"main": "index.js",
"dependencies" : {
"one-liner-joke" : "1.2.2"
}
} |
* Add functionality to install modules during init Install modules specified in package.json during initialisation as a alternative to packageing them. Detect if the node_modules directory is missing and installes the node modules. * check if package.json has dependencies and install if required * remove trailing whitespace * read package.json correctly as object
Install modules specified in package.json during initialisation as a alternative to packageing them. Detect if the node_modules directory is missing and installes the node modules.