From d193d19756f1c31b4ef3e49d83d0c9fcc89c8b33 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 11 Feb 2021 15:02:17 -0600 Subject: [PATCH] [wip] keep modules --- .npmignore | 13 +++++++++++++ ci/build/build-release.sh | 18 ++++-------------- ci/dev/image/run.sh | 1 - docs/CONTRIBUTING.md | 7 ------- 4 files changed, 17 insertions(+), 22 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..be4100c2 --- /dev/null +++ b/.npmignore @@ -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 diff --git a/ci/build/build-release.sh b/ci/build/build-release.sh index a806dc98..b222774d 100755 --- a/ci/build/build-release.sh +++ b/ci/build/build-release.sh @@ -6,10 +6,6 @@ set -euo pipefail # MINIFY controls whether minified vscode is bundled. 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() { cd "$(dirname "${0}")/../.." source ./ci/lib.sh @@ -61,11 +57,9 @@ EOF rsync yarn.lock "$RELEASE_PATH" rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh" - if [ "$KEEP_MODULES" = 1 ]; then - rsync node_modules/ "$RELEASE_PATH/node_modules" - mkdir -p "$RELEASE_PATH/lib" - rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib" - fi + rsync node_modules/ "$RELEASE_PATH/node_modules" + mkdir -p "$RELEASE_PATH/lib" + rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib" } bundle_vscode() { @@ -74,11 +68,7 @@ bundle_vscode() { rsync "$VSCODE_SRC_PATH/out-vscode${MINIFY:+-min}/" "$VSCODE_OUT_PATH/out" 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" - fi + rsync "$VSCODE_SRC_PATH/node_modules/" "$VSCODE_OUT_PATH/node_modules" 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/postinstall.js" "$VSCODE_OUT_PATH/extensions" diff --git a/ci/dev/image/run.sh b/ci/dev/image/run.sh index 3d5e15dd..d89e35d5 100755 --- a/ci/dev/image/run.sh +++ b/ci/dev/image/run.sh @@ -13,7 +13,6 @@ main() { -e HOME="/src/.home" \ -e USER="coder" \ -e GITHUB_TOKEN \ - -e KEEP_MODULES \ -e MINIFY \ -w /src \ -p 127.0.0.1:8080:8080 \ diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index edaaf767..4c987ed8 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -109,13 +109,6 @@ yarn test:standalone-release yarn package ``` -For a faster release build, you can run instead: - -```shell -KEEP_MODULES=1 ./ci/steps/release.sh -node ./release -``` - ## Structure The `code-server` script serves an HTTP API for login and starting a remote VS Code process.