From 50ed29e0f04d1222edda13fa2c821eef7e1c65a2 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 30 Jul 2020 10:42:34 -0500 Subject: [PATCH 1/2] Move rimraf to prod deps in extensions The postinstall uses rimraf so it needs to exist in the final build. --- ci/build/npm-postinstall.sh | 3 +-- ci/dev/vscode.patch | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index 09b13013..127d6408 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -35,8 +35,7 @@ vscode_yarn() { cd lib/vscode yarn --production --frozen-lockfile cd extensions - # Cannot use --production here. The postinstall here uses a dev dependency. - yarn --frozen-lockfile + yarn --production --frozen-lockfile } main "$@" diff --git a/ci/dev/vscode.patch b/ci/dev/vscode.patch index ec10c3fa..f9bf7e88 100644 --- a/ci/dev/vscode.patch +++ b/ci/dev/vscode.patch @@ -217,6 +217,26 @@ index 0000000000..88b720ceee + util.rimraf("out-vscode-min"), + common.minifyTask("out-vscode") +)); +diff --git a/extensions/package.json b/extensions/package.json +index 7c668c9744..0778f4f7db 100644 +--- a/extensions/package.json ++++ b/extensions/package.json +@@ -2,13 +2,14 @@ + "name": "vscode-extensions", + "version": "0.0.1", + "description": "Dependencies shared by all extensions", ++ "dependencies_comment": "Move rimraf to dependencies because it is used in the postinstall script.", + "dependencies": { ++ "rimraf": "^3.0.2", + "typescript": "3.9.6" + }, + "scripts": { + "postinstall": "node ./postinstall" + }, + "devDependencies": { +- "rimraf": "^3.0.2" + } + } diff --git a/package.json b/package.json index 86e3d5140d..2e52256e49 100644 --- a/package.json From b63cf192b57af22002fa0e2fa272b624d4e90a26 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 30 Jul 2020 13:22:44 -0500 Subject: [PATCH 2/2] Remove broken symlinks in extensions node modules The broken symlinks cause nfpm to fail. --- ci/dev/vscode.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ci/dev/vscode.patch b/ci/dev/vscode.patch index f9bf7e88..55ce3f94 100644 --- a/ci/dev/vscode.patch +++ b/ci/dev/vscode.patch @@ -237,6 +237,20 @@ index 7c668c9744..0778f4f7db 100644 - "rimraf": "^3.0.2" } } +diff --git a/extensions/postinstall.js b/extensions/postinstall.js +index da4fa3e9d0..50f3e1144f 100644 +--- a/extensions/postinstall.js ++++ b/extensions/postinstall.js +@@ -24,6 +24,9 @@ function processRoot() { + rimraf.sync(filePath); + } + } ++ ++ // Delete .bin so it doesn't contain broken symlinks that trip up nfpm. ++ rimraf.sync(path.join(__dirname, 'node_modules', '.bin')); + } + + function processLib() { diff --git a/package.json b/package.json index 86e3d5140d..2e52256e49 100644 --- a/package.json