fix: treat npm ci & npm install as install command
#456
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.
Description: 概要
BUILD_COMMANDにnpm installやnpm ciが定義されている場合に、以下のコマンドが付与されることを抑制する。これにより、予期しないインストールプロセスが動いてしまうことを防ぐ。(ex.
--ignore-scripts)npm installnpm install --production(DELETE_NODE_MODULESがtrueでないとき)close #455
Changes: 変更内容
utils/misc.tsのgetBuildCommands内にあるhasInstallCommandの条件式を下記のように変更BUILD_COMMANDに定義されたコマンド内にnpm run installまたはyarn installを含むBUILD_COMMANDに定義されたコマンド内に${pkgManager} installまたはnpm ci`のいずれかを含むExpected Impact: 影響範囲
BUILD_COMMANDにnpm installやnpm ciを定義していた場合、今まで実行されていたnpm installコマンドが実行されなくなる。ただ今までの動作がバグ的挙動であるため、実際に影響を受ける可能性は軽微である。
影響を受けるケース
npm installnpm ci --ignore-scriptsnpm run buildrm -rdf node_modulesnpm install --productionnpm ci --ignore-scriptsnpm run build今までのビルド動作が
npm install部分(≒postinstallなどで実行されるnpm script)に依存していた場合に、破壊的変更となる。Operating Requirements: 動作要件
Additional context: 補足