Add functionality to install modules during init#233
Merged
Luke-Roy-IBM merged 4 commits intoapache:masterfrom Mar 10, 2023
Merged
Add functionality to install modules during init#233Luke-Roy-IBM merged 4 commits intoapache:masterfrom
Luke-Roy-IBM merged 4 commits intoapache:masterfrom
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.
style95
reviewed
Mar 10, 2023
| 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 |
Member
There was a problem hiding this comment.
This is nice!
I want to let this in but unsure if there would be no side effect.
Member
Author
There was a problem hiding this comment.
From my tests so far the current functionality is not impacted
Member
There was a problem hiding this comment.
No edge case comes up in my mind too.
Member
Author
|
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"
}
} |
msciabarra
pushed a commit
to nuvolaris/openwhisk-runtime-nodejs
that referenced
this pull request
Apr 6, 2023
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.