[wip] keep modules

This commit is contained in:
Asher 2021-02-11 15:02:17 -06:00
parent 164e8ac0a1
commit d193d19756
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
4 changed files with 17 additions and 22 deletions

13
.npmignore Normal file
View File

@ -0,0 +1,13 @@
# Ignored by default but not sure it applies to sub-directories.
# TODO: test
# node_modules
# Doesn't need to be included as it will be downloaded during postinstall.
/lib/coder-cloud-agent
# Node and the code-server entry script are not used for the npm version since
# the user already has Node.
/bin
/lib/node
/code-server
/node

View File

@ -6,10 +6,6 @@ set -euo pipefail
# MINIFY controls whether minified vscode is bundled. # MINIFY controls whether minified vscode is bundled.
MINIFY="${MINIFY-true}" MINIFY="${MINIFY-true}"
# KEEP_MODULES controls whether the script cleans all node_modules requiring a yarn install
# to run first.
KEEP_MODULES="${KEEP_MODULES-0}"
main() { main() {
cd "$(dirname "${0}")/../.." cd "$(dirname "${0}")/../.."
source ./ci/lib.sh source ./ci/lib.sh
@ -61,11 +57,9 @@ EOF
rsync yarn.lock "$RELEASE_PATH" rsync yarn.lock "$RELEASE_PATH"
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh" rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
if [ "$KEEP_MODULES" = 1 ]; then
rsync node_modules/ "$RELEASE_PATH/node_modules" rsync node_modules/ "$RELEASE_PATH/node_modules"
mkdir -p "$RELEASE_PATH/lib" mkdir -p "$RELEASE_PATH/lib"
rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib" rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib"
fi
} }
bundle_vscode() { bundle_vscode() {
@ -74,11 +68,7 @@ bundle_vscode() {
rsync "$VSCODE_SRC_PATH/out-vscode${MINIFY:+-min}/" "$VSCODE_OUT_PATH/out" rsync "$VSCODE_SRC_PATH/out-vscode${MINIFY:+-min}/" "$VSCODE_OUT_PATH/out"
rsync "$VSCODE_SRC_PATH/.build/extensions/" "$VSCODE_OUT_PATH/extensions" rsync "$VSCODE_SRC_PATH/.build/extensions/" "$VSCODE_OUT_PATH/extensions"
if [ "$KEEP_MODULES" = 0 ]; then
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
else
rsync "$VSCODE_SRC_PATH/node_modules/" "$VSCODE_OUT_PATH/node_modules" rsync "$VSCODE_SRC_PATH/node_modules/" "$VSCODE_OUT_PATH/node_modules"
fi
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions" rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions"
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions" rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions"
rsync "$VSCODE_SRC_PATH/extensions/postinstall.js" "$VSCODE_OUT_PATH/extensions" rsync "$VSCODE_SRC_PATH/extensions/postinstall.js" "$VSCODE_OUT_PATH/extensions"

View File

@ -13,7 +13,6 @@ main() {
-e HOME="/src/.home" \ -e HOME="/src/.home" \
-e USER="coder" \ -e USER="coder" \
-e GITHUB_TOKEN \ -e GITHUB_TOKEN \
-e KEEP_MODULES \
-e MINIFY \ -e MINIFY \
-w /src \ -w /src \
-p 127.0.0.1:8080:8080 \ -p 127.0.0.1:8080:8080 \

View File

@ -109,13 +109,6 @@ yarn test:standalone-release
yarn package yarn package
``` ```
For a faster release build, you can run instead:
```shell
KEEP_MODULES=1 ./ci/steps/release.sh
node ./release
```
## Structure ## Structure
The `code-server` script serves an HTTP API for login and starting a remote VS Code process. The `code-server` script serves an HTTP API for login and starting a remote VS Code process.