diff --git a/.github/actions/build-docker/action.yml b/.github/actions/build-docker/action.yml index 6f8250d2acd4f..5af39b9240575 100644 --- a/.github/actions/build-docker/action.yml +++ b/.github/actions/build-docker/action.yml @@ -29,6 +29,9 @@ inputs: required: false description: 'Setup node.js' default: 'true' + NPM_TOKEN: + required: false + description: 'NPM token' runs: using: composite @@ -65,6 +68,7 @@ runs: node-version: ${{ inputs.node-version }} cache-modules: true install: true + NPM_TOKEN: ${{ inputs.NPM_TOKEN }} - run: yarn build if: inputs.setup == 'true' diff --git a/.github/actions/meteor-build/action.yml b/.github/actions/meteor-build/action.yml index dfbc1cef41504..5255951467000 100644 --- a/.github/actions/meteor-build/action.yml +++ b/.github/actions/meteor-build/action.yml @@ -13,6 +13,9 @@ inputs: required: true description: 'Node version' type: string + NPM_TOKEN: + required: false + description: 'NPM token' runs: using: composite @@ -29,6 +32,7 @@ runs: node-version: ${{ inputs.node-version }} cache-modules: true install: true + NPM_TOKEN: ${{ inputs.NPM_TOKEN }} # - name: Free disk space # run: | diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index 60d54ab896dd6..1035e2835792d 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -1,22 +1,27 @@ name: 'Setup Node' +description: 'Setup NodeJS' inputs: node-version: required: true - type: string + description: 'Node version' cache-modules: required: false - type: boolean + description: 'Cache node_modules' install: required: false - type: boolean + description: 'Install dependencies' deno-dir: required: false - type: string + description: 'Deno directory' default: ~/.deno-cache + NPM_TOKEN: + required: false + description: 'NPM token' outputs: node-version: + description: 'Node version' value: ${{ steps.node-version.outputs.node-version }} runs: @@ -49,6 +54,13 @@ runs: node-version: ${{ inputs.node-version }} cache: 'yarn' + - name: yarn login + shell: bash + if: inputs.NPM_TOKEN + run: | + echo "//registry.npmjs.org/:_authToken=${{ inputs.NPM_TOKEN }}" > ~/.npmrc + - name: yarn install + if: inputs.install shell: bash run: yarn diff --git a/.github/workflows/ci-code-check.yml b/.github/workflows/ci-code-check.yml index fd214bc39488d..af50b3230ba7b 100644 --- a/.github/workflows/ci-code-check.yml +++ b/.github/workflows/ci-code-check.yml @@ -35,6 +35,7 @@ jobs: node-version: ${{ inputs.node-version }} cache-modules: true install: true + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # - name: Free disk space # run: | diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index 31a8bc2ea2b62..e6c02b7b6417a 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -130,6 +130,8 @@ jobs: node-version: ${{ inputs.node-version }} cache-modules: true install: true + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - uses: rharkor/caching-for-turbo@v1.5 - run: yarn build @@ -145,6 +147,7 @@ jobs: # the same reason we need to rebuild the docker image at this point is the reason we dont want to publish it publish-image: false setup: false + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Start httpbin container and wait for it to be ready if: inputs.type == 'api' diff --git a/.github/workflows/ci-test-unit.yml b/.github/workflows/ci-test-unit.yml index a32c1e575b8f4..840808ff5e31f 100644 --- a/.github/workflows/ci-test-unit.yml +++ b/.github/workflows/ci-test-unit.yml @@ -39,6 +39,7 @@ jobs: node-version: ${{ inputs.node-version }} cache-modules: true install: true + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - uses: rharkor/caching-for-turbo@v1.5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 246c34423bb19..514dd6d1c5182 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,6 +152,7 @@ jobs: node-version: ${{ needs.release-versions.outputs.node-version }} cache-modules: true install: true + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Cache vite uses: actions/cache@v3 @@ -253,6 +254,7 @@ jobs: node-version: ${{ needs.release-versions.outputs.node-version }} platform: ${{ matrix.platform }} build-containers: ${{ matrix.platform == 'alpine' && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} build-gh-docker: name: 🚢 Build Docker Images for Production @@ -280,6 +282,7 @@ jobs: node-version: ${{ needs.release-versions.outputs.node-version }} platform: ${{ matrix.platform }} build-containers: ${{ matrix.platform == 'alpine' && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Rename official Docker tag to GitHub Container Registry if: matrix.platform == 'official' @@ -560,6 +563,7 @@ jobs: release: preview username: ${{ secrets.CR_USER }} password: ${{ secrets.CR_PAT }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} docker-image-publish: name: 🚀 Publish Docker Image (main) diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index 5ef8027b14676..b2eae5d90b929 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -37,6 +37,7 @@ jobs: node-version: 14.21.3 cache-modules: true install: true + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - uses: rharkor/caching-for-turbo@v1.5 diff --git a/.github/workflows/pr-update-description.yml b/.github/workflows/pr-update-description.yml index e792127eac9dd..084f2a383480b 100644 --- a/.github/workflows/pr-update-description.yml +++ b/.github/workflows/pr-update-description.yml @@ -24,6 +24,7 @@ jobs: node-version: 14.21.3 cache-modules: true install: true + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - uses: rharkor/caching-for-turbo@v1.5 diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index ccc3408e194e2..3f2067ac7ec32 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -27,6 +27,7 @@ jobs: node-version: 14.21.3 cache-modules: true install: true + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - uses: rharkor/caching-for-turbo@v1.5 diff --git a/ee/packages/api-client/.eslintrc.json b/packages/api-client/.eslintrc.json similarity index 100% rename from ee/packages/api-client/.eslintrc.json rename to packages/api-client/.eslintrc.json diff --git a/ee/packages/api-client/CHANGELOG.md b/packages/api-client/CHANGELOG.md similarity index 100% rename from ee/packages/api-client/CHANGELOG.md rename to packages/api-client/CHANGELOG.md diff --git a/ee/packages/api-client/LICENSE b/packages/api-client/LICENSE similarity index 100% rename from ee/packages/api-client/LICENSE rename to packages/api-client/LICENSE diff --git a/ee/packages/api-client/__tests__/2fahandling.spec.ts b/packages/api-client/__tests__/2fahandling.spec.ts similarity index 100% rename from ee/packages/api-client/__tests__/2fahandling.spec.ts rename to packages/api-client/__tests__/2fahandling.spec.ts diff --git a/ee/packages/api-client/jest.config.ts b/packages/api-client/jest.config.ts similarity index 100% rename from ee/packages/api-client/jest.config.ts rename to packages/api-client/jest.config.ts diff --git a/ee/packages/api-client/package.json b/packages/api-client/package.json similarity index 100% rename from ee/packages/api-client/package.json rename to packages/api-client/package.json diff --git a/ee/packages/api-client/src/Credentials.ts b/packages/api-client/src/Credentials.ts similarity index 100% rename from ee/packages/api-client/src/Credentials.ts rename to packages/api-client/src/Credentials.ts diff --git a/ee/packages/api-client/src/RestClientInterface.ts b/packages/api-client/src/RestClientInterface.ts similarity index 100% rename from ee/packages/api-client/src/RestClientInterface.ts rename to packages/api-client/src/RestClientInterface.ts diff --git a/ee/packages/api-client/src/errors.ts b/packages/api-client/src/errors.ts similarity index 100% rename from ee/packages/api-client/src/errors.ts rename to packages/api-client/src/errors.ts diff --git a/ee/packages/api-client/src/index.ts b/packages/api-client/src/index.ts similarity index 100% rename from ee/packages/api-client/src/index.ts rename to packages/api-client/src/index.ts diff --git a/ee/packages/api-client/tsconfig.json b/packages/api-client/tsconfig.json similarity index 71% rename from ee/packages/api-client/tsconfig.json rename to packages/api-client/tsconfig.json index b397e2c4421fb..9d8ef0c3a3736 100644 --- a/ee/packages/api-client/tsconfig.json +++ b/packages/api-client/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.client.json", + "extends": "../../tsconfig.base.client.json", "compilerOptions": { "module": "commonjs", "rootDir": "./src", diff --git a/ee/packages/ddp-client/.eslintrc.json b/packages/ddp-client/.eslintrc.json similarity index 100% rename from ee/packages/ddp-client/.eslintrc.json rename to packages/ddp-client/.eslintrc.json diff --git a/ee/packages/ddp-client/CHANGELOG.md b/packages/ddp-client/CHANGELOG.md similarity index 100% rename from ee/packages/ddp-client/CHANGELOG.md rename to packages/ddp-client/CHANGELOG.md diff --git a/ee/packages/ddp-client/LICENSE b/packages/ddp-client/LICENSE similarity index 100% rename from ee/packages/ddp-client/LICENSE rename to packages/ddp-client/LICENSE diff --git a/ee/packages/ddp-client/README.md b/packages/ddp-client/README.md similarity index 100% rename from ee/packages/ddp-client/README.md rename to packages/ddp-client/README.md diff --git a/ee/packages/ddp-client/__examples__/simple.ts b/packages/ddp-client/__examples__/simple.ts similarity index 100% rename from ee/packages/ddp-client/__examples__/simple.ts rename to packages/ddp-client/__examples__/simple.ts diff --git a/ee/packages/ddp-client/__mocks__/ws.ts b/packages/ddp-client/__mocks__/ws.ts similarity index 100% rename from ee/packages/ddp-client/__mocks__/ws.ts rename to packages/ddp-client/__mocks__/ws.ts diff --git a/ee/packages/ddp-client/__tests__/Account.spec.ts b/packages/ddp-client/__tests__/Account.spec.ts similarity index 100% rename from ee/packages/ddp-client/__tests__/Account.spec.ts rename to packages/ddp-client/__tests__/Account.spec.ts diff --git a/ee/packages/ddp-client/__tests__/ClientStream.spec.ts b/packages/ddp-client/__tests__/ClientStream.spec.ts similarity index 100% rename from ee/packages/ddp-client/__tests__/ClientStream.spec.ts rename to packages/ddp-client/__tests__/ClientStream.spec.ts diff --git a/ee/packages/ddp-client/__tests__/Connection.spec.ts b/packages/ddp-client/__tests__/Connection.spec.ts similarity index 100% rename from ee/packages/ddp-client/__tests__/Connection.spec.ts rename to packages/ddp-client/__tests__/Connection.spec.ts diff --git a/ee/packages/ddp-client/__tests__/DDPDispatcher.spec.ts b/packages/ddp-client/__tests__/DDPDispatcher.spec.ts similarity index 100% rename from ee/packages/ddp-client/__tests__/DDPDispatcher.spec.ts rename to packages/ddp-client/__tests__/DDPDispatcher.spec.ts diff --git a/ee/packages/ddp-client/__tests__/DDPSDK.spec.ts b/packages/ddp-client/__tests__/DDPSDK.spec.ts similarity index 100% rename from ee/packages/ddp-client/__tests__/DDPSDK.spec.ts rename to packages/ddp-client/__tests__/DDPSDK.spec.ts diff --git a/ee/packages/ddp-client/__tests__/MinimalDDPClient.spec.ts b/packages/ddp-client/__tests__/MinimalDDPClient.spec.ts similarity index 100% rename from ee/packages/ddp-client/__tests__/MinimalDDPClient.spec.ts rename to packages/ddp-client/__tests__/MinimalDDPClient.spec.ts diff --git a/ee/packages/ddp-client/__tests__/Timeout.spec.ts b/packages/ddp-client/__tests__/Timeout.spec.ts similarity index 100% rename from ee/packages/ddp-client/__tests__/Timeout.spec.ts rename to packages/ddp-client/__tests__/Timeout.spec.ts diff --git a/ee/packages/ddp-client/__tests__/helpers/index.ts b/packages/ddp-client/__tests__/helpers/index.ts similarity index 100% rename from ee/packages/ddp-client/__tests__/helpers/index.ts rename to packages/ddp-client/__tests__/helpers/index.ts diff --git a/ee/packages/ddp-client/__tests__/wrapOnceEventIntoPromise.spec.ts b/packages/ddp-client/__tests__/wrapOnceEventIntoPromise.spec.ts similarity index 100% rename from ee/packages/ddp-client/__tests__/wrapOnceEventIntoPromise.spec.ts rename to packages/ddp-client/__tests__/wrapOnceEventIntoPromise.spec.ts diff --git a/ee/packages/ddp-client/jest.config.ts b/packages/ddp-client/jest.config.ts similarity index 100% rename from ee/packages/ddp-client/jest.config.ts rename to packages/ddp-client/jest.config.ts diff --git a/ee/packages/ddp-client/package.json b/packages/ddp-client/package.json similarity index 100% rename from ee/packages/ddp-client/package.json rename to packages/ddp-client/package.json diff --git a/ee/packages/ddp-client/src/ClientStream.ts b/packages/ddp-client/src/ClientStream.ts similarity index 100% rename from ee/packages/ddp-client/src/ClientStream.ts rename to packages/ddp-client/src/ClientStream.ts diff --git a/ee/packages/ddp-client/src/Connection.ts b/packages/ddp-client/src/Connection.ts similarity index 100% rename from ee/packages/ddp-client/src/Connection.ts rename to packages/ddp-client/src/Connection.ts diff --git a/ee/packages/ddp-client/src/DDPDispatcher.ts b/packages/ddp-client/src/DDPDispatcher.ts similarity index 100% rename from ee/packages/ddp-client/src/DDPDispatcher.ts rename to packages/ddp-client/src/DDPDispatcher.ts diff --git a/ee/packages/ddp-client/src/DDPSDK.ts b/packages/ddp-client/src/DDPSDK.ts similarity index 100% rename from ee/packages/ddp-client/src/DDPSDK.ts rename to packages/ddp-client/src/DDPSDK.ts diff --git a/ee/packages/ddp-client/src/MinimalDDPClient.ts b/packages/ddp-client/src/MinimalDDPClient.ts similarity index 100% rename from ee/packages/ddp-client/src/MinimalDDPClient.ts rename to packages/ddp-client/src/MinimalDDPClient.ts diff --git a/ee/packages/ddp-client/src/TimeoutControl.ts b/packages/ddp-client/src/TimeoutControl.ts similarity index 100% rename from ee/packages/ddp-client/src/TimeoutControl.ts rename to packages/ddp-client/src/TimeoutControl.ts diff --git a/ee/packages/ddp-client/src/index.ts b/packages/ddp-client/src/index.ts similarity index 100% rename from ee/packages/ddp-client/src/index.ts rename to packages/ddp-client/src/index.ts diff --git a/ee/packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts b/packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts similarity index 100% rename from ee/packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts rename to packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts diff --git a/ee/packages/ddp-client/src/legacy/types/SDKLegacy.ts b/packages/ddp-client/src/legacy/types/SDKLegacy.ts similarity index 100% rename from ee/packages/ddp-client/src/legacy/types/SDKLegacy.ts rename to packages/ddp-client/src/legacy/types/SDKLegacy.ts diff --git a/ee/packages/ddp-client/src/livechat/LivechatClientImpl.ts b/packages/ddp-client/src/livechat/LivechatClientImpl.ts similarity index 100% rename from ee/packages/ddp-client/src/livechat/LivechatClientImpl.ts rename to packages/ddp-client/src/livechat/LivechatClientImpl.ts diff --git a/ee/packages/ddp-client/src/livechat/types/LivechatSDK.ts b/packages/ddp-client/src/livechat/types/LivechatSDK.ts similarity index 100% rename from ee/packages/ddp-client/src/livechat/types/LivechatSDK.ts rename to packages/ddp-client/src/livechat/types/LivechatSDK.ts diff --git a/ee/packages/ddp-client/src/types/Account.ts b/packages/ddp-client/src/types/Account.ts similarity index 100% rename from ee/packages/ddp-client/src/types/Account.ts rename to packages/ddp-client/src/types/Account.ts diff --git a/ee/packages/ddp-client/src/types/ClientStream.ts b/packages/ddp-client/src/types/ClientStream.ts similarity index 100% rename from ee/packages/ddp-client/src/types/ClientStream.ts rename to packages/ddp-client/src/types/ClientStream.ts diff --git a/ee/packages/ddp-client/src/types/DDPClient.ts b/packages/ddp-client/src/types/DDPClient.ts similarity index 100% rename from ee/packages/ddp-client/src/types/DDPClient.ts rename to packages/ddp-client/src/types/DDPClient.ts diff --git a/ee/packages/ddp-client/src/types/IncomingPayload.ts b/packages/ddp-client/src/types/IncomingPayload.ts similarity index 100% rename from ee/packages/ddp-client/src/types/IncomingPayload.ts rename to packages/ddp-client/src/types/IncomingPayload.ts diff --git a/ee/packages/ddp-client/src/types/OutgoingPayload.ts b/packages/ddp-client/src/types/OutgoingPayload.ts similarity index 100% rename from ee/packages/ddp-client/src/types/OutgoingPayload.ts rename to packages/ddp-client/src/types/OutgoingPayload.ts diff --git a/ee/packages/ddp-client/src/types/RemoveListener.ts b/packages/ddp-client/src/types/RemoveListener.ts similarity index 100% rename from ee/packages/ddp-client/src/types/RemoveListener.ts rename to packages/ddp-client/src/types/RemoveListener.ts diff --git a/ee/packages/ddp-client/src/types/SDK.ts b/packages/ddp-client/src/types/SDK.ts similarity index 100% rename from ee/packages/ddp-client/src/types/SDK.ts rename to packages/ddp-client/src/types/SDK.ts diff --git a/ee/packages/ddp-client/src/types/Subscription.ts b/packages/ddp-client/src/types/Subscription.ts similarity index 100% rename from ee/packages/ddp-client/src/types/Subscription.ts rename to packages/ddp-client/src/types/Subscription.ts diff --git a/ee/packages/ddp-client/src/types/connectionPayloads.ts b/packages/ddp-client/src/types/connectionPayloads.ts similarity index 100% rename from ee/packages/ddp-client/src/types/connectionPayloads.ts rename to packages/ddp-client/src/types/connectionPayloads.ts diff --git a/ee/packages/ddp-client/src/types/heartbeatsPayloads.ts b/packages/ddp-client/src/types/heartbeatsPayloads.ts similarity index 100% rename from ee/packages/ddp-client/src/types/heartbeatsPayloads.ts rename to packages/ddp-client/src/types/heartbeatsPayloads.ts diff --git a/ee/packages/ddp-client/src/types/methods.ts b/packages/ddp-client/src/types/methods.ts similarity index 100% rename from ee/packages/ddp-client/src/types/methods.ts rename to packages/ddp-client/src/types/methods.ts diff --git a/ee/packages/ddp-client/src/types/methodsPayloads.ts b/packages/ddp-client/src/types/methodsPayloads.ts similarity index 100% rename from ee/packages/ddp-client/src/types/methodsPayloads.ts rename to packages/ddp-client/src/types/methodsPayloads.ts diff --git a/ee/packages/ddp-client/src/types/publicationPayloads.ts b/packages/ddp-client/src/types/publicationPayloads.ts similarity index 100% rename from ee/packages/ddp-client/src/types/publicationPayloads.ts rename to packages/ddp-client/src/types/publicationPayloads.ts diff --git a/ee/packages/ddp-client/src/types/streams.ts b/packages/ddp-client/src/types/streams.ts similarity index 100% rename from ee/packages/ddp-client/src/types/streams.ts rename to packages/ddp-client/src/types/streams.ts diff --git a/ee/packages/ddp-client/src/wrapOnceEventIntoPromise.ts b/packages/ddp-client/src/wrapOnceEventIntoPromise.ts similarity index 100% rename from ee/packages/ddp-client/src/wrapOnceEventIntoPromise.ts rename to packages/ddp-client/src/wrapOnceEventIntoPromise.ts diff --git a/ee/packages/ddp-client/tsconfig.json b/packages/ddp-client/tsconfig.json similarity index 81% rename from ee/packages/ddp-client/tsconfig.json rename to packages/ddp-client/tsconfig.json index 29b8cb051fe34..b98ff74ba385e 100644 --- a/ee/packages/ddp-client/tsconfig.json +++ b/packages/ddp-client/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.client.json", + "extends": "../../tsconfig.base.client.json", "compilerOptions": { "rootDir": "./src", "outDir": "./dist", diff --git a/yarn.lock b/yarn.lock index de477be8048a3..6a6c2a8ee9d05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8463,9 +8463,9 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/api-client@workspace:^, @rocket.chat/api-client@workspace:ee/packages/api-client": +"@rocket.chat/api-client@workspace:^, @rocket.chat/api-client@workspace:packages/api-client": version: 0.0.0-use.local - resolution: "@rocket.chat/api-client@workspace:ee/packages/api-client" + resolution: "@rocket.chat/api-client@workspace:packages/api-client" dependencies: "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/jest-presets": "workspace:~" @@ -8657,9 +8657,9 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/ddp-client@workspace:^, @rocket.chat/ddp-client@workspace:ee/packages/ddp-client, @rocket.chat/ddp-client@workspace:~": +"@rocket.chat/ddp-client@workspace:^, @rocket.chat/ddp-client@workspace:packages/ddp-client, @rocket.chat/ddp-client@workspace:~": version: 0.0.0-use.local - resolution: "@rocket.chat/ddp-client@workspace:ee/packages/ddp-client" + resolution: "@rocket.chat/ddp-client@workspace:packages/ddp-client" dependencies: "@rocket.chat/api-client": "workspace:^" "@rocket.chat/core-typings": "workspace:~"