-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Request yarn to be available for launch
This change adds supports to cases where yarn is used in start commands. A common example is the use of yarn workspaces or frameworks (like lerna) built on top of yarn workspaces. A chose yarn command is run in a particular workspace using the following syntax: `yarn workspace <workspace_name> <command>` See https://classic.yarnpkg.com/en/docs/cli/workspace/ This requires the yarn tool to be available at launch time. See added integration test for an example. Also, see issue paketo-buildpacks/nodejs#456
- Loading branch information
Showing
12 changed files
with
467 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/.bin | ||
/.build | ||
/bin | ||
/build |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ package yarnstart | |
const ( | ||
Node = "node" | ||
NodeModules = "node_modules" | ||
Yarn = "yarn" | ||
) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"main": "packages/sample-app/index.js", | ||
"scripts": { | ||
"start": "yarn workspace @sample/sample-app start" | ||
}, | ||
"private": true, | ||
"workspaces": [ | ||
"packages/*" | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
integration/testdata/workspaces_app/packages/sample-app/index.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const express = require('express'); | ||
const app = express(); | ||
const config = require('@sample/sample-config'); | ||
|
||
app.get('/', (req, res) => { | ||
res.send({ | ||
config: config(), | ||
}); | ||
}); | ||
|
||
const port = process.env.PORT || 8080; | ||
|
||
app.listen(port, () => console.log(`Sample app listening on port ${ port }!`)); |
12 changes: 12 additions & 0 deletions
12
integration/testdata/workspaces_app/packages/sample-app/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "@sample/sample-app", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "node index.js" | ||
}, | ||
"dependencies": { | ||
"@sample/sample-config": "^1.0.0", | ||
"express": "^4.16.3" | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
integration/testdata/workspaces_app/packages/sample-config/index.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const config = () => { | ||
return { | ||
prop1: 'Package A value 1', | ||
prop2: 'Package A value 2', | ||
}; | ||
}; | ||
|
||
module.exports = config; |
5 changes: 5 additions & 0 deletions
5
integration/testdata/workspaces_app/packages/sample-config/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "@sample/sample-config", | ||
"version": "1.0.0", | ||
"main": "index.js" | ||
} |
Oops, something went wrong.