@@ -56,7 +56,6 @@ bundle_code_server() {
56
56
}
57
57
EOF
58
58
) > " $RELEASE_PATH /package.json"
59
- rsync yarn.lock " $RELEASE_PATH "
60
59
mv npm-shrinkwrap.json " $RELEASE_PATH "
61
60
62
61
rsync ci/build/npm-postinstall.sh " $RELEASE_PATH /postinstall.sh"
@@ -106,34 +105,41 @@ bundle_vscode() {
106
105
}
107
106
108
107
create_shrinkwraps () {
109
- # yarn.lock or package-lock.json files (used to ensure deterministic versions of dependencies) are
110
- # not packaged when publishing to the NPM registry.
111
- # To ensure deterministic dependency versions (even when code-server is installed with NPM), we create
112
- # an npm-shrinkwrap.json file from the currently installed node_modules. This ensures the versions used
113
- # from development (that the yarn.lock guarantees) are also the ones installed by end-users.
114
- # These will include devDependencies, but those will be ignored when installing globally (for code-server), and
115
- # because we use --omit=dev when installing vscode.
116
-
117
- # We first generate the shrinkwrap file for code-server itself - which is the current directory
118
- create_shrinkwrap_keeping_yarn_lock
108
+ # yarn.lock or package-lock.json files (used to ensure deterministic versions
109
+ # of dependencies) are not packaged when publishing to the NPM registry.
110
+
111
+ # To ensure deterministic dependency versions (even when code-server is
112
+ # installed with NPM), we create an npm-shrinkwrap.json file from the
113
+ # currently installed node_modules. This ensures the versions used from
114
+ # development (that the yarn.lock guarantees) are also the ones installed by
115
+ # end-users. These will include devDependencies, but those will be ignored
116
+ # when installing globally (for code-server), and because we use --omit=dev
117
+ # when installing vscode.
118
+
119
+ # We also remove the yarn.lock files once we have done this even though they
120
+ # are ignored by NPM on publish because we use the artifact uploaded to CI
121
+ # (which would still include the yarn.lock) to generate the standalone builds
122
+ # and we want to make sure we are not using yarn accidentally.
123
+
124
+ # We first generate the shrinkwrap file for code-server itself---which is the
125
+ # current directory.
126
+ create_shrinkwrap
119
127
120
128
# Then the shrinkwrap files for the bundled VSCode
121
129
pushd " $VSCODE_SRC_PATH /remote/"
122
- create_shrinkwrap_keeping_yarn_lock
130
+ create_shrinkwrap
123
131
popd
124
132
125
133
pushd " $VSCODE_SRC_PATH /extensions/"
126
- create_shrinkwrap_keeping_yarn_lock
134
+ create_shrinkwrap
127
135
popd
128
136
}
129
137
130
- create_shrinkwrap_keeping_yarn_lock () {
131
- # HACK@edvincent: Generating a shrinkwrap alters the yarn.lock which we don't want (with NPM URLs rather than the Yarn URLs)
132
- # But to generate a valid shrinkwrap, it has to exist... So we copy it to then restore it
133
- cp yarn.lock yarn.lock.temp
138
+ create_shrinkwrap () {
134
139
npm shrinkwrap
135
- cp yarn.lock.temp yarn.lock
136
- rm yarn.lock.temp
140
+ # Note that npm shrinkwrap alters the yarn.lock, but we are not going to keep
141
+ # it anyway.
142
+ rm yarn.lock
137
143
}
138
144
139
145
main " $@ "
0 commit comments