Skip to content

Commit

Permalink
Add node_modules/.bin to path (#415)
Browse files Browse the repository at this point in the history
* add node_modules/.bin to path

* update snapshot tests
  • Loading branch information
coffee-cup authored Aug 18, 2022
1 parent 0fefbb7 commit 681c9ce
Show file tree
Hide file tree
Showing 24 changed files with 70 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ impl Provider for NodeProvider {
// Install
let mut install = Phase::install(Some(NodeProvider::get_install_command(app)));
install.add_cache_directory(NodeProvider::get_package_manager_cache_dir(app));
install.add_path("/app/node_modules/.bin".to_string());

// Cypress cache directory
let all_deps = NodeProvider::get_all_deps(app)?;
Expand All @@ -79,7 +80,6 @@ impl Provider for NodeProvider {
}

// Build

let mut build = if NodeProvider::is_nx_monorepo(app) {
let app_name = NodeProvider::get_nx_app_name(app, env)?.unwrap();
Phase::build(Some(format!("npx nx run {}:build:production", app_name)))
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_bun.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.bun"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_bun_no_start.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.bun"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_bun_web_server.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.bun"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_custom_version.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_main_file.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_monorepo.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/usr/local/share/.cache/yarn/v6"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_no_scripts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_npm.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_nx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ expression: plan
"cacheDirectories": [
"/root/.npm",
"/root/.cache/Cypress"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_pnpm.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.cache/pnpm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.cache/pnpm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_pnpm_v7.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.cache/pnpm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_variables.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_yarn.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/usr/local/share/.cache/yarn/v6"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_yarn_berry.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/usr/local/share/.cache/yarn/v6"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/usr/local/share/.cache/yarn/v6"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__node_yarn_prisma.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/usr/local/share/.cache/yarn/v6"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/generate_plan_tests__procfile.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ expression: plan
],
"cacheDirectories": [
"/root/.npm"
],
"paths": [
"/app/node_modules/.bin"
]
},
{
Expand Down

0 comments on commit 681c9ce

Please sign in to comment.