diff --git a/.circleci/config.yml b/.circleci/config.yml index d93306cf4f10..1c94e5fece78 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2.1 default_image: &default_image docker: - - image: cimg/node:20.11.1 + - image: cimg/node:22.11.0 default_resource_class: &default_resource_class resource_class: medium @@ -87,7 +87,7 @@ commands: # reusable commands default: 'BASE_IMAGE' type: string docker_build_arg_value: - default: 'node:20.11.1' + default: 'node:22.11.0' type: string image_name: default: 'bitcli/bit' @@ -116,7 +116,7 @@ commands: # reusable commands default: 'BASE_IMAGE' type: string docker_build_arg_value: - default: 'node:20.11.1' + default: 'node:22.11.0' type: string image_name: default: 'bitcli/bit' @@ -198,13 +198,13 @@ commands: # reusable commands windows_set_node_version: parameters: version: - default: 20.11.1 + default: 22.11.0 type: string steps: - run: choco upgrade nvm -y - run: nvm -v - - run: nvm install 20.11.1 - - run: nvm use 20.11.1 + - run: nvm install 22.11.0 + - run: nvm use 22.11.0 - run: node -v windows_add_bvm_to_path: steps: @@ -230,7 +230,7 @@ commands: # reusable commands name: Install pnpm command: > npm config set prefix '~/.npm-global' && - npm install --global pnpm@8.10.4 && + npm install --global pnpm@9.1.2 && echo 'export PATH=~/.npm-global/bin:$PATH' >> $BASH_ENV compress_bit: @@ -272,8 +272,18 @@ jobs: - attach_workspace: at: ./ - docker_build_and_push: - docker_build_arg_value: "node:20.11.1" - docker_tag_suffix: "-node-20.11.1" + docker_build_arg_value: "node:20.13.1" + docker_tag_suffix: "-node-20.13.1" + + docker_build_node_22: + machine: + image: ubuntu-2004:202111-02 + steps: + - attach_workspace: + at: ./ + - docker_build_and_push: + docker_build_arg_value: "node:22.11.0" + docker_tag_suffix: "-node-22.11.0" # docker_non_root_build: # machine: @@ -285,19 +295,20 @@ jobs: # image_name: "bitcli/bit-non-root" # docker_file_name: "Dockerfile-bit-non-root" - docker_non_root_build_node_20: + docker_non_root_build_node_22: machine: image: ubuntu-2004:202111-02 steps: - attach_workspace: at: ./ - docker_build_and_push: - docker_build_arg_value: "node:20.11.1" + docker_build_arg_value: "node:22.11.0" image_name: "bitcli/bit-non-root" docker_file_name: "Dockerfile-bit-non-root" - docker_tag_suffix: "-node-20.11.1" + docker_tag_suffix: "-node-22.11.0" + - server_docker_build_node_20: + server_docker_build_node_22: machine: image: ubuntu-2004:202111-02 steps: @@ -305,11 +316,10 @@ jobs: at: ./ - docker_build_and_push: docker_build_arg_name: "BIT_IMAGE" - docker_build_arg_value: "`npm show @teambit/bit version`-node-20.11.1" + docker_build_arg_value: "`npm show @teambit/bit version`-node-22.11.0" image_name: "bitcli/bit-server" docker_file_name: "Dockerfile-bit-server" - docker_tag_suffix: "-node-20.11.1" - + docker_tag_suffix: "-node-22.11.0" set_ssh_key: <<: *defaults working_directory: ~/.ssh @@ -668,6 +678,7 @@ jobs: echo "registry=https://node-registry.bit.cloud" >> .npmrc && pnpm dlx @ialdama/jsonmod --key pnpm.supportedArchitectures.os --values linux --values linux && pnpm dlx @ialdama/jsonmod --key pnpm.supportedArchitectures.cpu --values x64 --values x64 && + pnpm dlx @ialdama/jsonmod --key pnpm.overrides.uri-js --values npm:uri-js-replace && pnpm add @teambit/bit - compress_bit - run: @@ -714,6 +725,7 @@ jobs: echo "registry=https://node-registry.bit.cloud" >> .npmrc && pnpm dlx @ialdama/jsonmod --key pnpm.supportedArchitectures.os --values darwin --values darwin && pnpm dlx @ialdama/jsonmod --key pnpm.supportedArchitectures.cpu --values x64 --values x64 && + pnpm dlx @ialdama/jsonmod --key pnpm.overrides.uri-js --values npm:uri-js-replace && pnpm add @teambit/bit - compress_bit - run: @@ -762,6 +774,7 @@ jobs: pnpm dlx @ialdama/jsonmod --key pnpm.supportedArchitectures.os --values win32 --values win32 && pnpm dlx @ialdama/jsonmod --key pnpm.supportedArchitectures.cpu --values x64 --values x64 && pnpm dlx @ialdama/jsonmod --key pnpm.neverBuiltDependencies --values cpu-features --values ssh2 && + pnpm dlx @ialdama/jsonmod --key pnpm.overrides.uri-js --values npm:uri-js-replace && pnpm add @teambit/bit - compress_bit - run: @@ -923,9 +936,9 @@ jobs: # - run: node -v # - run: npm -v # - run: yarn -v - # # - run: choco install nodejs --version 20.11.1 + # # - run: choco install nodejs --version 22.11.0 # # - run: node -v - # - run: cinst nodejs --version 20.11.1 + # - run: cinst nodejs --version 22.11.0 # - run: node -v windows_checkout_code: @@ -1364,15 +1377,21 @@ workflows: # - server_docker_build_node_18: # requires: # - docker_build_node_18 - - docker_build_node_20: + # - docker_build_node_20: + # requires: + # - harmony_publish_to_gcloud + - docker_build_node_22: requires: - harmony_publish_to_gcloud - - docker_non_root_build_node_20: + - docker_non_root_build_node_22: requires: - harmony_publish_to_gcloud - - server_docker_build_node_20: + # - server_docker_build_node_20: + # requires: + # - docker_build_node_20 + - server_docker_build_node_22: requires: - - docker_build_node_20 + - docker_build_node_22 windows-nightly: triggers: @@ -1513,18 +1532,30 @@ workflows: # requires: # - harmony_deploy_approval_job # - docker_build_node_18 - - docker_build_node_20: + # - docker_build_node_20: + # requires: + # - harmony_deploy_approval_job + # - harmony_publish_to_gcloud + # - docker_non_root_build_node_20: + # requires: + # - harmony_deploy_approval_job + # - harmony_publish_to_gcloud + # - server_docker_build_node_20: + # requires: + # - harmony_deploy_approval_job + # - docker_build_node_20 + - docker_build_node_22: requires: - harmony_deploy_approval_job - harmony_publish_to_gcloud - - docker_non_root_build_node_20: + - docker_non_root_build_node_22: requires: - harmony_deploy_approval_job - harmony_publish_to_gcloud - - server_docker_build_node_20: + - server_docker_build_node_22: requires: - harmony_deploy_approval_job - - docker_build_node_20 + - docker_build_node_22 # uncomment to update esbuild arm64 cache # get_arm64_workflow_packages: diff --git a/scopes/harmony/bit/bootstrap.ts b/scopes/harmony/bit/bootstrap.ts index 4dcbe3e7c453..f58447b6f4ed 100644 --- a/scopes/harmony/bit/bootstrap.ts +++ b/scopes/harmony/bit/bootstrap.ts @@ -9,8 +9,8 @@ import { BIT_VERSION, GLOBAL_CONFIG, GLOBAL_LOGS } from '@teambit/legacy/dist/co import { printWarning, shouldDisableConsole, shouldDisableLoader } from '@teambit/legacy/dist/logger/logger'; import { loader } from '@teambit/legacy.loader'; -const RECOMMENDED_NODE_VERSIONS = '>=20.0.0 <21.0.0'; -const SUPPORTED_NODE_VERSIONS = '>=16.0.0 <21.0.0'; +const RECOMMENDED_NODE_VERSIONS = '>=20.0.0 <23.0.0'; +const SUPPORTED_NODE_VERSIONS = '>=16.0.0 <23.0.0'; process.env.MEMFS_DONT_WARN = 'true'; // suppress fs experimental warnings from memfs @@ -21,6 +21,39 @@ require('regenerator-runtime/runtime'); // eslint-disable-next-line @typescript-eslint/no-misused-promises process.on('unhandledRejection', async (err: any) => handleUnhandledRejection(err)); +const originalEmit = process.emit; +// @ts-expect-error - TS complains about the return type of originalEmit.apply +process.emit = function (name, data) { + // -------------------------------------------- + // this fix is based on yarn fix for the similar issue, see code here: + // https://github.com/yarnpkg/berry/blob/2cf0a8fe3e4d4bd7d4d344245d24a85a45d4c5c9/packages/yarnpkg-pnp/sources/loader/applyPatch.ts#L414-L435 + // ignore punycode deprecation warning + // ignoring this warning for now, as the main issue is that + // this package https://www.npmjs.com/package/uri-js?activeTab=readme is using it and it's deprecated + // the package have the correct punycode version as a dependency from the user land + // but it uses it incorrectly, it should use it with a trailing slash + // the require in their code is require('punycode') and not require('punycode/') (with trailing slash) + // As this package is not maintained anymore, we can't fix it from our side + // see more at: + // https://github.com/garycourt/uri-js/issues/97 + // https://github.com/garycourt/uri-js/pull/95 + // on the bit repo we overriding the uri-js package with a fixed version (see overrides in workspace.jsonc) + // "uri-js": "npm:uri-js-replace" + // but we don't want to override it automatically for all the users + // there are many other packages (like webpack, eslint, etc) that are using this uri-js package + // so if we won't ignore it, all users will get this warning + if ( + name === `warning` && + typeof data === `object` && + ((data.name === `DeprecationWarning` && data.message.includes(`punycode`)) || data.code === `DEP0040`) + ) + return false; + // -------------------------------------------- + + // eslint-disable-next-line prefer-rest-params + return originalEmit.apply(process, arguments as unknown as Parameters); +}; + // by default Bluebird enables the longStackTraces when env is `development`, or when // BLUEBIRD_DEBUG is set. // the drawback of enabling it all the time is a performance hit. (see http://bluebirdjs.com/docs/api/promise.longstacktraces.html) diff --git a/scripts/docker-teambit-bit/Dockerfile-bit b/scripts/docker-teambit-bit/Dockerfile-bit index a2d3aba2137f..88660c7d2b01 100644 --- a/scripts/docker-teambit-bit/Dockerfile-bit +++ b/scripts/docker-teambit-bit/Dockerfile-bit @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=node:20.11.1 +ARG BASE_IMAGE=node:22.11.0 FROM $BASE_IMAGE USER root diff --git a/scripts/docker-teambit-bit/Dockerfile-bit-non-root b/scripts/docker-teambit-bit/Dockerfile-bit-non-root index f9b398a7650a..9fd2708ec8e4 100644 --- a/scripts/docker-teambit-bit/Dockerfile-bit-non-root +++ b/scripts/docker-teambit-bit/Dockerfile-bit-non-root @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=node:20.11.1 +ARG BASE_IMAGE=node:22.11.0 FROM $BASE_IMAGE RUN adduser --disabled-password --gecos '' user RUN chown -R user /usr/local/ diff --git a/workspace.jsonc b/workspace.jsonc index 59247fa0333a..f2d8fda9cc07 100644 --- a/workspace.jsonc +++ b/workspace.jsonc @@ -528,10 +528,14 @@ "signal-exit@4": "^4.0.2", "@types/react": "^17.0.67", "@types/react-dom": "^17.0.21", - "minio@7.0": "7.1.3" + "minio@7.0": "7.1.3", + // See more info here - + // https://github.com/garycourt/uri-js/pull/95 + // https://github.com/garycourt/uri-js/issues/97 + "uri-js": "npm:uri-js-replace" }, "rootComponents": true, - "nodeVersion": "20.11.1", + "nodeVersion": "22.11.0", "engineStrict": true, // This is a temporary workaround to fix "bit compile" on macOS and Windows. // "bit compile" breaks node_modules when hard links are used. @@ -616,7 +620,7 @@ "packageJson": { "name": "@teambit/{name}", // @teambit/discovery.ui.sidebar "bvm": { - "node": "20.11.1" + "node": "22.11.0" }, "bin": { "bbit": "bin/bit"