Hide bundled node_modules to prevent them from being ignored
This commit is contained in:
parent
d30f3dbdf7
commit
b3ae4d67d3
|
@ -20,7 +20,7 @@ For a proper setup and walkthrough, please see [./doc/guide.md](./doc/guide.md).
|
||||||
```bash
|
```bash
|
||||||
curl -sSOL https://github.com/cdr/code-server/releases/download/3.3.0/code-server_3.3.0_amd64.deb
|
curl -sSOL https://github.com/cdr/code-server/releases/download/3.3.0/code-server_3.3.0_amd64.deb
|
||||||
sudo dpkg -i code-server_3.3.0_amd64.deb
|
sudo dpkg -i code-server_3.3.0_amd64.deb
|
||||||
sudo systemctl enable --now code-server
|
systemctl --user enable --now code-server
|
||||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ sudo systemctl enable --now code-server
|
||||||
```bash
|
```bash
|
||||||
curl -sSOL https://github.com/cdr/code-server/releases/download/3.3.0/code-server-3.3.0-amd64.rpm
|
curl -sSOL https://github.com/cdr/code-server/releases/download/3.3.0/code-server-3.3.0-amd64.rpm
|
||||||
sudo yum install -y code-server-3.3.0-amd64.rpm
|
sudo yum install -y code-server-3.3.0-amd64.rpm
|
||||||
sudo systemctl enable --now code-server
|
systemctl --user enable --now code-server
|
||||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,9 @@ You can disable minification by setting `MINIFY=`.
|
||||||
- Downloads the release-package artifacts for the current commit from CI
|
- Downloads the release-package artifacts for the current commit from CI
|
||||||
- Uses [hub](https://github.com/github/hub) to upload the artifacts to the release
|
- Uses [hub](https://github.com/github/hub) to upload the artifacts to the release
|
||||||
specified in `package.json`
|
specified in `package.json`
|
||||||
|
- [./build/npm-postinstall.sh](./build/npm-postinstall.sh)
|
||||||
|
- Post install script for the npm package
|
||||||
|
- Bundled by`yarn release`
|
||||||
|
|
||||||
## release-container
|
## release-container
|
||||||
|
|
||||||
|
|
|
@ -32,19 +32,20 @@ bundle_code_server() {
|
||||||
mkdir -p "$RELEASE_PATH/src/browser/pages"
|
mkdir -p "$RELEASE_PATH/src/browser/pages"
|
||||||
rsync src/browser/pages/*.html "$RELEASE_PATH/src/browser/pages"
|
rsync src/browser/pages/*.html "$RELEASE_PATH/src/browser/pages"
|
||||||
|
|
||||||
rsync yarn.lock "$RELEASE_PATH"
|
|
||||||
|
|
||||||
# Adds the commit to package.json
|
# Adds the commit to package.json
|
||||||
jq --slurp '.[0] * .[1]' package.json <(
|
jq --slurp '.[0] * .[1]' package.json <(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
{
|
{
|
||||||
"commit": "$(git rev-parse HEAD)",
|
"commit": "$(git rev-parse HEAD)",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "cd lib/vscode && npm rebuild # Builds native modules"
|
"postinstall": "./postinstall.sh"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
) > "$RELEASE_PATH/package.json"
|
) > "$RELEASE_PATH/package.json"
|
||||||
|
rsync yarn.lock "$RELEASE_PATH"
|
||||||
|
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bundle_vscode() {
|
bundle_vscode() {
|
||||||
|
@ -72,13 +73,22 @@ EOF
|
||||||
yarn --production --ignore-scripts
|
yarn --production --ignore-scripts
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Now we clear any native module builds.
|
# We clear any native module builds.
|
||||||
local nativeModules
|
local native_modules
|
||||||
mapfile -t nativeModules < <(find "$VSCODE_OUT_PATH/node_modules" -name "binding.gyp" -exec dirname {} \;)
|
mapfile -t native_modules < <(find "$VSCODE_OUT_PATH/node_modules" -name "binding.gyp" -exec dirname {} \;)
|
||||||
local nm
|
local nm
|
||||||
for nm in "${nativeModules[@]}"; do
|
for nm in "${native_modules[@]}"; do
|
||||||
rm -R "$nm/build"
|
rm -R "$nm/build"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# We have to rename node_modules to node_modules.bundled to avoid them being ignored by yarn.
|
||||||
|
local node_modules
|
||||||
|
mapfile -t node_modules < <(find "$VSCODE_OUT_PATH" -depth -name "node_modules")
|
||||||
|
local nm
|
||||||
|
for nm in "${node_modules[@]}"; do
|
||||||
|
rm -Rf "$nm.bundled"
|
||||||
|
mv "$nm" "$nm.bundled"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
main() {
|
||||||
|
cd lib/vscode
|
||||||
|
|
||||||
|
# We have to rename node_modules.bundled to node_modules.
|
||||||
|
# The bundled modules were renamed originally to avoid being ignored by yarn.
|
||||||
|
local node_modules
|
||||||
|
node_modules="$(find . -depth -name "node_modules.bundled")"
|
||||||
|
local nm
|
||||||
|
for nm in $node_modules; do
|
||||||
|
rm -Rf "${nm%.bundled}"
|
||||||
|
mv "$nm" "${nm%.bundled}"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Rebuilds native modules.
|
||||||
|
npm rebuild
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "code-server",
|
"name": "code-server",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "3.3.0-rc.10",
|
"version": "3.3.0-rc.21",
|
||||||
"description": "Run VS Code on a remote server.",
|
"description": "Run VS Code on a remote server.",
|
||||||
"homepage": "https://github.com/cdr/code-server",
|
"homepage": "https://github.com/cdr/code-server",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
Loading…
Reference in New Issue