diff --git a/.rebase/CHANGELOG.md b/.rebase/CHANGELOG.md index 8e8e158b2b3..d52a2788e49 100644 --- a/.rebase/CHANGELOG.md +++ b/.rebase/CHANGELOG.md @@ -423,3 +423,9 @@ https://github.com/che-incubator/che-code/pull/400 - code/extensions/git/src/ssh-askpass.sh --- + +#### @RomanNikitenko +https://github.com/che-incubator/che-code/pull/695 + +- code/build/npm/preinstall.ts +--- diff --git a/.rebase/replace/code/build/npm/preinstall.ts.json b/.rebase/replace/code/build/npm/preinstall.ts.json new file mode 100644 index 00000000000..c97d6db78ef --- /dev/null +++ b/.rebase/replace/code/build/npm/preinstall.ts.json @@ -0,0 +1,10 @@ +[ + { + "from": "installHeaders();", + "by": "installGypDeps();\n\nif (process.env['VSCODE_SKIP_HEADER_INSTALL']) {\n\tconsole.log('Skipping header install (VSCODE_SKIP_HEADER_INSTALL is set).');\n} else {\n\ttry {\n\t\tinstallHeaders();\n\t} catch (error) {\n\t\tconsole.warn(`\\x1b[33m*** Header installation failed: ${(error as Error).message}\\x1b[0m`);\n\t\tconsole.warn('\\x1b[33m*** Continuing without pre-cached headers. Native modules will resolve headers during their own build.\\x1b[0m');\n\t}\n}" + }, + { + "from": "function installHeaders() {\n\tconst npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';\n\tchild_process.execSync(`${npm} ${process.env.npm_command || 'ci'}`, {\n\t\tenv: process.env,\n\t\tcwd: path.join(import.meta.dirname, 'gyp'),\n\t\tstdio: 'inherit'\n\t});\n\n\t// The node gyp package got installed using the above npm command using the gyp/package.json\n\t// file checked into our repository. So from that point it is safe to construct the path\n\t// to that executable", + "by": "function installGypDeps() {\n\tconst npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';\n\tchild_process.execSync(`${npm} ${process.env.npm_command || 'ci'}`, {\n\t\tenv: process.env,\n\t\tcwd: path.join(import.meta.dirname, 'gyp'),\n\t\tstdio: 'inherit'\n\t});\n}\n\nfunction installHeaders() {\n\t// The node gyp package got installed using installGypDeps() above.\n\t// So from that point it is safe to construct the path to that executable." + } +] diff --git a/rebase.sh b/rebase.sh index 850292bf3c6..d2bd68ccc10 100755 --- a/rebase.sh +++ b/rebase.sh @@ -521,6 +521,8 @@ resolve_conflicts() { apply_changes_multi_line "$conflictingFile" elif [[ "$conflictingFile" == "code/build/gulpfile.reh.ts" ]]; then apply_changes "$conflictingFile" + elif [[ "$conflictingFile" == "code/build/npm/preinstall.ts" ]]; then + apply_changes_multi_line "$conflictingFile" elif [[ "$conflictingFile" == "code/resources/server/bin/helpers/browser-linux.sh" ]]; then apply_changes_multi_line "$conflictingFile" elif [[ "$conflictingFile" == "code/resources/server/bin/remote-cli/code-linux.sh" ]]; then