mirror of
https://github.com/coder/code-server.git
synced 2026-11-22 02:38:39 +08:00
* Stop generating shrinkwraps npm 12 removes support for shrinkwraps. Additionally, VS Code has switched to pnpm and this will make generating the shrinkwraps less straightforward. Exact pins in the package.json would not be a sufficient replacement since that does not cover transitive dependencies. The recommendation for end user packages installed globally with npm seems to be to be to bundle dependencies. One idea would be to build for every platform and bundle them all, but the whole reason we have the npm package is to support platforms for which we are not building. If we build them, we could just add a regular release for that platform on GitHub. So instead for each native module we would need to add rebuild commands in the postinstall. And ideally remove the current platform builds to at least try keeping the tarball size down. I am not sure it is worth the effort for what it feels like fighting with npm, so this change does not attempt that. * Remove devDependencies from extensions package.json Not strictly necessary since we only install production dependencies in the postinstall, but might as well save some bytes. * Update Code to 1.146.0 * Support pnpm for post-install * Get Node version from package.json lib/vscode/remote/.npmrc no longer exists * Switch to pnpm VS Code recently switched to pnpm so various scripts needed to be updated, and we might as well follow suite with code-server's own dependencies. In general this change just swaps out "npm" invocations for "pnpm" plus any necessary flag changes to match but to call out some less obvious changes: 1. The extensions directory no longer has a post-install script, so there is no need to copy one anymore. 2. When merging the remote package.json, only copy the dependencies since that is all we need, to avoid copying in new properties like packageManager. 3. Remove unused publish:npm. It points to a nonexistent file anyway. 4. Remove publish:docker and just call the script directly, to avoid an npm/pnpm dependency in a job that really has no need for it. * Update nfpm maintainer
51 lines
1.2 KiB
Bash
Executable File
51 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
help() {
|
|
echo >&2 " You can build with 'pnpm run watch' or you can build a release"
|
|
echo >&2 " For example: 'pnpm run build && pnpm run build:vscode && KEEP_MODULES=1 pnpm run release'"
|
|
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release pnpm run test:e2e'"
|
|
echo >&2 " You can manually run that release with 'node ./release'"
|
|
}
|
|
|
|
main() {
|
|
cd "$(dirname "$0")/../.."
|
|
|
|
source ./ci/lib.sh
|
|
|
|
pushd test/e2e/extensions/test-extension
|
|
echo "Building test extension"
|
|
pnpm run build
|
|
popd
|
|
|
|
local dir="$PWD"
|
|
if [[ ! ${CODE_SERVER_TEST_ENTRY-} ]]; then
|
|
echo "Set CODE_SERVER_TEST_ENTRY to test another build of code-server"
|
|
else
|
|
pushd "$CODE_SERVER_TEST_ENTRY"
|
|
dir="$PWD"
|
|
popd
|
|
fi
|
|
|
|
echo "Testing build in '$dir'"
|
|
|
|
# Simple sanity checks to see that we've built. There could still be things
|
|
# wrong (native modules version issues, incomplete build, etc).
|
|
if [[ ! -d $dir/out ]]; then
|
|
echo >&2 "No code-server build detected"
|
|
help
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -d $dir/lib/vscode/out ]]; then
|
|
echo >&2 "No VS Code build detected"
|
|
help
|
|
exit 1
|
|
fi
|
|
|
|
cd test
|
|
./node_modules/.bin/playwright test "$@"
|
|
}
|
|
|
|
main "$@"
|