@@ -34,60 +34,47 @@ bundle_code_server() {
34
34
35
35
# Adds the commit to package.json
36
36
jq --slurp ' .[0] * .[1]' package.json <(
37
- cat << EOF
37
+ cat << EOF
38
38
{
39
39
"commit": "$( git rev-parse HEAD) ",
40
40
"scripts": {
41
41
"postinstall": "./postinstall.sh"
42
42
}
43
43
}
44
44
EOF
45
- ) > " $RELEASE_PATH /package.json"
45
+ ) > " $RELEASE_PATH /package.json"
46
46
rsync yarn.lock " $RELEASE_PATH "
47
47
rsync ci/build/npm-postinstall.sh " $RELEASE_PATH /postinstall.sh"
48
48
}
49
49
50
50
bundle_vscode () {
51
51
mkdir -p " $VSCODE_OUT_PATH "
52
- rsync " $VSCODE_SRC_PATH /package.json" " $VSCODE_OUT_PATH "
53
52
rsync " $VSCODE_SRC_PATH /yarn.lock" " $VSCODE_OUT_PATH "
54
- rsync " $VSCODE_SRC_PATH /node_modules" " $VSCODE_OUT_PATH "
55
53
rsync " $VSCODE_SRC_PATH /out-vscode${MINIFY+-min} /" " $VSCODE_OUT_PATH /out"
54
+
56
55
rsync " $VSCODE_SRC_PATH /.build/extensions/" " $VSCODE_OUT_PATH /extensions"
56
+ rm -Rf " $VSCODE_OUT_PATH /extensions/node_modules"
57
+ rsync " $VSCODE_SRC_PATH /extensions/package.json" " $VSCODE_OUT_PATH /extensions"
58
+ rsync " $VSCODE_SRC_PATH /extensions/yarn.lock" " $VSCODE_OUT_PATH /extensions"
59
+ rsync " $VSCODE_SRC_PATH /extensions/postinstall.js" " $VSCODE_OUT_PATH /extensions"
57
60
58
61
mkdir -p " $VSCODE_OUT_PATH /resources/linux"
59
62
rsync " $VSCODE_SRC_PATH /resources/linux/code.png" " $VSCODE_OUT_PATH /resources/linux/code.png"
60
63
61
64
# Adds the commit and date to product.json
62
65
jq --slurp ' .[0] * .[1]' " $VSCODE_SRC_PATH /product.json" <(
63
- cat << EOF
66
+ cat << EOF
64
67
{
65
68
"commit": "$( git rev-parse HEAD) ",
66
69
"date": $( jq -n ' now | todate' )
67
70
}
68
71
EOF
69
- ) > " $VSCODE_OUT_PATH /product.json"
70
-
71
- pushd " $VSCODE_OUT_PATH "
72
- yarn --production --frozen-lockfile --ignore-scripts
73
- popd
74
-
75
- # We clear any native module builds.
76
- local native_modules
77
- mapfile -t native_modules < <( find " $VSCODE_OUT_PATH /node_modules" -name " binding.gyp" -exec dirname {} \; )
78
- local nm
79
- for nm in " ${native_modules[@]} " ; do
80
- rm -R " $nm /build"
81
- done
82
-
83
- # We have to rename node_modules to node_modules.bundled to avoid them being ignored by yarn.
84
- local node_modules
85
- mapfile -t node_modules < <( find " $VSCODE_OUT_PATH " -depth -name " node_modules" )
86
- local nm
87
- for nm in " ${node_modules[@]} " ; do
88
- rm -Rf " $nm .bundled"
89
- mv " $nm " " $nm .bundled"
90
- done
72
+ ) > " $VSCODE_OUT_PATH /product.json"
73
+
74
+ # We remove the scripts field so that later on we can run
75
+ # yarn to fetch node_modules if necessary without build scripts running.
76
+ # We cannot use --no-scripts because we still want dependant package scripts to run.
77
+ jq ' del(.scripts)' < " $VSCODE_SRC_PATH /package.json" > " $VSCODE_OUT_PATH /package.json"
91
78
}
92
79
93
80
main " $@ "
0 commit comments