File tree Expand file tree Collapse file tree 7 files changed +56
-13
lines changed
Expand file tree Collapse file tree 7 files changed +56
-13
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ release-gcp/
99release-images /
1010node_modules
1111vendor /modules
12- /node_modules.asar
1312node- *
1413/plugins
1514/lib /coder-cloud-agent
Original file line number Diff line number Diff line change 9999 # yarn to fetch node_modules if necessary without build scripts running.
100100 # We cannot use --no-scripts because we still want dependent package scripts to run.
101101 jq ' del(.scripts)' < " $VSCODE_SRC_PATH /package.json" > " $VSCODE_OUT_PATH /package.json"
102+
103+ pushd " $VSCODE_OUT_PATH "
104+ symlink_asar
105+ popd
102106}
103107
104108main " $@ "
Original file line number Diff line number Diff line change @@ -76,13 +76,26 @@ main() {
7676 fi
7777}
7878
79+ # This is a copy of symlink_asar in ../lib.sh. Look there for details.
80+ symlink_asar () {
81+ rm -rf node_modules.asar
82+ if [ " ${WINDIR-} " ]; then
83+ mklink /J node_modules.asar node_modules
84+ else
85+ ln -s node_modules node_modules.asar
86+ fi
87+ }
88+
7989vscode_yarn () {
8090 echo ' Installing vendor dependencies...'
8191 cd vendor/modules/code-oss-dev
8292 yarn --production --frozen-lockfile
8393
94+ symlink_asar
95+
8496 cd extensions
8597 yarn --production --frozen-lockfile
98+
8699 for ext in * /; do
87100 ext=" ${ext%/ } "
88101 echo " extensions/$ext : installing dependencies"
Original file line number Diff line number Diff line change @@ -32,14 +32,14 @@ main() {
3232 doctoc --title ' # iPad' docs/ipad.md > /dev/null
3333 doctoc --title ' # Termux' docs/termux.md > /dev/null
3434
35- # # TODO: replace with a method that generates fewer false positives.
36- # if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
37- # echo "Files need generation or are formatted incorrectly:"
38- # git -c color.ui=always status | grep --color=no '\[31m'
39- # echo "Please run the following locally:"
40- # echo " yarn fmt"
41- # exit 1
42- # fi
35+ # TODO: replace with a method that generates fewer false positives.
36+ if [[ ${CI-} && $( git ls-files --other --modified --exclude-standard) ]]; then
37+ echo " Files need generation or are formatted incorrectly:"
38+ git -c color.ui=always status | grep --color=no ' \[31m'
39+ echo " Please run the following locally:"
40+ echo " yarn fmt"
41+ exit 1
42+ fi
4343}
4444
4545main " $@ "
Original file line number Diff line number Diff line change @@ -13,8 +13,17 @@ main() {
1313 cd vendor
1414 echo ' Installing vendor dependencies...'
1515
16- # Ignore scripts to prevent partial install which omits development dependencies.
17- yarn install --modules-folder modules --ignore-scripts
16+ # * We install in 'modules' instead of 'node_modules' because VS Code's extensions
17+ # use a webpack config which cannot differentiate between its own node_modules
18+ # and itself being in a directory with the same name.
19+ #
20+ # * We ignore scripts because NPM/Yarn's default behavior is to assume that
21+ # devDependencies are not needed, and that even git repo based packages are
22+ # assumed to be compiled. Because the default behavior for VS Code's `postinstall`
23+ # assumes we're also compiled, this needs to be ignored.
24+ yarn install --modules-folder modules --ignore-scripts --frozen-lockfile
25+
26+ # Finally, run the vendor `postinstall`
1827 yarn run postinstall
1928}
2029
Original file line number Diff line number Diff line change @@ -104,3 +104,21 @@ export OS
104104# RELEASE_PATH is the destination directory for the release from the root.
105105# Defaults to release
106106RELEASE_PATH=" ${RELEASE_PATH-release} "
107+
108+ # VS Code bundles some modules into an asar which is an archive format that
109+ # works like tar. It then seems to get unpacked into node_modules.asar.
110+ #
111+ # I don't know why they do this but all the dependencies they bundle already
112+ # exist in node_modules so just symlink it. We have to do this since not only VS
113+ # Code itself but also extensions will look specifically in this directory for
114+ # files (like the ripgrep binary or the oniguruma wasm).
115+ symlink_asar () {
116+ rm -rf node_modules.asar
117+ if [ " ${WINDIR-} " ]; then
118+ # mklink takes the link name first.
119+ mklink /J node_modules.asar node_modules
120+ else
121+ # ln takes the link name second.
122+ ln -s node_modules node_modules.asar
123+ fi
124+ }
Original file line number Diff line number Diff line change @@ -250,9 +250,9 @@ chrome-remote-interface@0.28.2:
250250 commander "2.11.x"
251251 ws "^7.2.0"
252252
253- code-oss-dev@cdr/vscode#50f8fff79d612104eed6eb067daf596031fe9f83 :
253+ code-oss-dev@cdr/vscode#96a09a7846538c3bbedb6a2aeca729537bb8202b :
254254 version "1.60.0"
255- resolved "https://codeload.github.com/cdr/vscode/tar.gz/50f8fff79d612104eed6eb067daf596031fe9f83 "
255+ resolved "https://codeload.github.com/cdr/vscode/tar.gz/96a09a7846538c3bbedb6a2aeca729537bb8202b "
256256 dependencies :
257257 " @coder/logger" " ^1.1.16"
258258 " @microsoft/applicationinsights-web" " ^2.6.4"
You can’t perform that action at this time.
0 commit comments