From 681c9ce9cea96c770155e25b1c9d0f557e109d51 Mon Sep 17 00:00:00 2001 From: Jake Runzer Date: Wed, 17 Aug 2022 23:48:32 -0400 Subject: [PATCH] Add node_modules/.bin to path (#415) * add node_modules/.bin to path * update snapshot tests --- src/providers/node/mod.rs | 2 +- tests/snapshots/generate_plan_tests__node.snap | 3 +++ tests/snapshots/generate_plan_tests__node_bun.snap | 3 +++ tests/snapshots/generate_plan_tests__node_bun_no_start.snap | 3 +++ tests/snapshots/generate_plan_tests__node_bun_web_server.snap | 3 +++ tests/snapshots/generate_plan_tests__node_custom_version.snap | 3 +++ tests/snapshots/generate_plan_tests__node_main_file.snap | 3 +++ .../generate_plan_tests__node_main_file_not_exist.snap | 3 +++ tests/snapshots/generate_plan_tests__node_monorepo.snap | 3 +++ .../generate_plan_tests__node_no_lockfile_canvas.snap | 3 +++ tests/snapshots/generate_plan_tests__node_no_scripts.snap | 3 +++ tests/snapshots/generate_plan_tests__node_npm.snap | 3 +++ .../snapshots/generate_plan_tests__node_npm_old_lockfile.snap | 3 +++ tests/snapshots/generate_plan_tests__node_nx.snap | 3 +++ tests/snapshots/generate_plan_tests__node_pnpm.snap | 3 +++ .../generate_plan_tests__node_pnpm_custom_node_version.snap | 3 +++ tests/snapshots/generate_plan_tests__node_pnpm_v7.snap | 3 +++ tests/snapshots/generate_plan_tests__node_variables.snap | 3 +++ tests/snapshots/generate_plan_tests__node_yarn.snap | 3 +++ tests/snapshots/generate_plan_tests__node_yarn_berry.snap | 3 +++ .../generate_plan_tests__node_yarn_custom_node_version.snap | 3 +++ tests/snapshots/generate_plan_tests__node_yarn_prisma.snap | 3 +++ .../generate_plan_tests__overriding_environment_variables.snap | 3 +++ tests/snapshots/generate_plan_tests__procfile.snap | 3 +++ 24 files changed, 70 insertions(+), 1 deletion(-) diff --git a/src/providers/node/mod.rs b/src/providers/node/mod.rs index bc6ebc387..be729aac4 100644 --- a/src/providers/node/mod.rs +++ b/src/providers/node/mod.rs @@ -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)?; @@ -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))) diff --git a/tests/snapshots/generate_plan_tests__node.snap b/tests/snapshots/generate_plan_tests__node.snap index 619b553e7..4b1ab13f5 100644 --- a/tests/snapshots/generate_plan_tests__node.snap +++ b/tests/snapshots/generate_plan_tests__node.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_bun.snap b/tests/snapshots/generate_plan_tests__node_bun.snap index 5e28774ff..0696d50a5 100644 --- a/tests/snapshots/generate_plan_tests__node_bun.snap +++ b/tests/snapshots/generate_plan_tests__node_bun.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.bun" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_bun_no_start.snap b/tests/snapshots/generate_plan_tests__node_bun_no_start.snap index 9c50fc7ea..a26afbbac 100644 --- a/tests/snapshots/generate_plan_tests__node_bun_no_start.snap +++ b/tests/snapshots/generate_plan_tests__node_bun_no_start.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.bun" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_bun_web_server.snap b/tests/snapshots/generate_plan_tests__node_bun_web_server.snap index 9c50fc7ea..a26afbbac 100644 --- a/tests/snapshots/generate_plan_tests__node_bun_web_server.snap +++ b/tests/snapshots/generate_plan_tests__node_bun_web_server.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.bun" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_custom_version.snap b/tests/snapshots/generate_plan_tests__node_custom_version.snap index 06a82d513..c9e6fe73a 100644 --- a/tests/snapshots/generate_plan_tests__node_custom_version.snap +++ b/tests/snapshots/generate_plan_tests__node_custom_version.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_main_file.snap b/tests/snapshots/generate_plan_tests__node_main_file.snap index 8abfc1977..ef81ecbbf 100644 --- a/tests/snapshots/generate_plan_tests__node_main_file.snap +++ b/tests/snapshots/generate_plan_tests__node_main_file.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_main_file_not_exist.snap b/tests/snapshots/generate_plan_tests__node_main_file_not_exist.snap index 8c514acc4..7cf4ecc85 100644 --- a/tests/snapshots/generate_plan_tests__node_main_file_not_exist.snap +++ b/tests/snapshots/generate_plan_tests__node_main_file_not_exist.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_monorepo.snap b/tests/snapshots/generate_plan_tests__node_monorepo.snap index e8d8a17e1..f71454ef4 100644 --- a/tests/snapshots/generate_plan_tests__node_monorepo.snap +++ b/tests/snapshots/generate_plan_tests__node_monorepo.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/usr/local/share/.cache/yarn/v6" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_no_lockfile_canvas.snap b/tests/snapshots/generate_plan_tests__node_no_lockfile_canvas.snap index 19e222bb7..09fba1011 100644 --- a/tests/snapshots/generate_plan_tests__node_no_lockfile_canvas.snap +++ b/tests/snapshots/generate_plan_tests__node_no_lockfile_canvas.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_no_scripts.snap b/tests/snapshots/generate_plan_tests__node_no_scripts.snap index 8c514acc4..7cf4ecc85 100644 --- a/tests/snapshots/generate_plan_tests__node_no_scripts.snap +++ b/tests/snapshots/generate_plan_tests__node_no_scripts.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_npm.snap b/tests/snapshots/generate_plan_tests__node_npm.snap index c6c29183c..754dcd380 100644 --- a/tests/snapshots/generate_plan_tests__node_npm.snap +++ b/tests/snapshots/generate_plan_tests__node_npm.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_npm_old_lockfile.snap b/tests/snapshots/generate_plan_tests__node_npm_old_lockfile.snap index c4ab1bfde..c052ffcec 100644 --- a/tests/snapshots/generate_plan_tests__node_npm_old_lockfile.snap +++ b/tests/snapshots/generate_plan_tests__node_npm_old_lockfile.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_nx.snap b/tests/snapshots/generate_plan_tests__node_nx.snap index 67aec940e..d010ff4fa 100644 --- a/tests/snapshots/generate_plan_tests__node_nx.snap +++ b/tests/snapshots/generate_plan_tests__node_nx.snap @@ -22,6 +22,9 @@ expression: plan "cacheDirectories": [ "/root/.npm", "/root/.cache/Cypress" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_pnpm.snap b/tests/snapshots/generate_plan_tests__node_pnpm.snap index d7b3a2c36..4b835caac 100644 --- a/tests/snapshots/generate_plan_tests__node_pnpm.snap +++ b/tests/snapshots/generate_plan_tests__node_pnpm.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.cache/pnpm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_pnpm_custom_node_version.snap b/tests/snapshots/generate_plan_tests__node_pnpm_custom_node_version.snap index 0caefdde0..1dc37965f 100644 --- a/tests/snapshots/generate_plan_tests__node_pnpm_custom_node_version.snap +++ b/tests/snapshots/generate_plan_tests__node_pnpm_custom_node_version.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.cache/pnpm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_pnpm_v7.snap b/tests/snapshots/generate_plan_tests__node_pnpm_v7.snap index 49c1d8421..7edd2adae 100644 --- a/tests/snapshots/generate_plan_tests__node_pnpm_v7.snap +++ b/tests/snapshots/generate_plan_tests__node_pnpm_v7.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.cache/pnpm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_variables.snap b/tests/snapshots/generate_plan_tests__node_variables.snap index 8c514acc4..7cf4ecc85 100644 --- a/tests/snapshots/generate_plan_tests__node_variables.snap +++ b/tests/snapshots/generate_plan_tests__node_variables.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_yarn.snap b/tests/snapshots/generate_plan_tests__node_yarn.snap index 73773df37..5883d2b03 100644 --- a/tests/snapshots/generate_plan_tests__node_yarn.snap +++ b/tests/snapshots/generate_plan_tests__node_yarn.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/usr/local/share/.cache/yarn/v6" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_yarn_berry.snap b/tests/snapshots/generate_plan_tests__node_yarn_berry.snap index 3a10a7c18..e2cc2d348 100644 --- a/tests/snapshots/generate_plan_tests__node_yarn_berry.snap +++ b/tests/snapshots/generate_plan_tests__node_yarn_berry.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/usr/local/share/.cache/yarn/v6" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_yarn_custom_node_version.snap b/tests/snapshots/generate_plan_tests__node_yarn_custom_node_version.snap index e9ab8f3c0..66d4b7aa3 100644 --- a/tests/snapshots/generate_plan_tests__node_yarn_custom_node_version.snap +++ b/tests/snapshots/generate_plan_tests__node_yarn_custom_node_version.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/usr/local/share/.cache/yarn/v6" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__node_yarn_prisma.snap b/tests/snapshots/generate_plan_tests__node_yarn_prisma.snap index 3d9c0560f..52dbbfe28 100644 --- a/tests/snapshots/generate_plan_tests__node_yarn_prisma.snap +++ b/tests/snapshots/generate_plan_tests__node_yarn_prisma.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/usr/local/share/.cache/yarn/v6" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__overriding_environment_variables.snap b/tests/snapshots/generate_plan_tests__overriding_environment_variables.snap index 4e280ba44..4a8b86af0 100644 --- a/tests/snapshots/generate_plan_tests__overriding_environment_variables.snap +++ b/tests/snapshots/generate_plan_tests__overriding_environment_variables.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, { diff --git a/tests/snapshots/generate_plan_tests__procfile.snap b/tests/snapshots/generate_plan_tests__procfile.snap index 8c514acc4..7cf4ecc85 100644 --- a/tests/snapshots/generate_plan_tests__procfile.snap +++ b/tests/snapshots/generate_plan_tests__procfile.snap @@ -21,6 +21,9 @@ expression: plan ], "cacheDirectories": [ "/root/.npm" + ], + "paths": [ + "/app/node_modules/.bin" ] }, {