From 341d5a70ab92c492ff653242dabf50f154192710 Mon Sep 17 00:00:00 2001 From: Olivier Lamothe Date: Mon, 16 Oct 2023 10:02:19 -0400 Subject: [PATCH 1/8] feat(cli): deprecate config:set region and environment (#1331) https://coveord.atlassian.net/browse/CDX-1246 ## Proposed changes deprecate config:set command flags for region and environment ## Breaking changes BREAKING CHANGE: those flags are no longer supported by the cli and the alternative is to re-execute a login flow with auth:login This change is part of the effort for the next major release of the CLI (v3) --- .../__snapshots__/atomic.specs.ts.snap | 20 ++++++------- packages/cli/core/src/commands/config/set.ts | 30 ++++--------------- 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/packages/cli-e2e/__tests__/__snapshots__/atomic.specs.ts.snap b/packages/cli-e2e/__tests__/__snapshots__/atomic.specs.ts.snap index 5bc938c6cc..18e70f8404 100644 --- a/packages/cli-e2e/__tests__/__snapshots__/atomic.specs.ts.snap +++ b/packages/cli-e2e/__tests__/__snapshots__/atomic.specs.ts.snap @@ -27,11 +27,11 @@ HashedFolder { "name": "results-manager.tsx", }, HashedFile { - "hash": "2WXM24xZscVOUHVUti5Z8stWW2A=", + "hash": "aylWHwQHlU7F0KpZuJopvDi6u/4=", "name": "template-1.html", }, ], - "hash": "HghfGR6Ktv9oQs8WZP2zA+IjlgE=", + "hash": "t9fG5B9toXvcybK/ypFbrMJDTao=", "name": "results-manager", }, HashedFolder { @@ -63,7 +63,7 @@ HashedFolder { "name": "sample-result-component", }, ], - "hash": "ApFF74n5JpLwWNDx/OdGzyfLNlg=", + "hash": "pIrl+qNoENInjtVxeEnRQC5X+s4=", "name": "components", }, HashedFile { @@ -104,7 +104,7 @@ HashedFolder { "name": "utils", }, ], - "hash": "PBxgg8jprlbpGrP2ZWP+y/7lP8A=", + "hash": "pBlrdRw5yuMk/S0mFDAUBGrEvMs=", "name": "src", }, HashedFile { @@ -112,7 +112,7 @@ HashedFolder { "name": "tsconfig.json", }, ], - "hash": "Osl3T0kqmA46szXnCn90VXTERFY=", + "hash": "MX8XJmhwXYKcItyHsBvb0tWTjlM=", "name": "normalizedDir", } `; @@ -153,11 +153,11 @@ HashedFolder { "name": "results-manager.tsx", }, HashedFile { - "hash": "xrt7puz0ZnvNnC32f8nDYJHvCcQ=", + "hash": "M9F3lIlTmnV3mnsbtZgfpkfA7fc=", "name": "template-1.html", }, ], - "hash": "kHLkOJ9S2RmK9QsYV4H3vFWRSOY=", + "hash": "07o/Hx3M8Lf/E88LFkbIQBseMYA=", "name": "results-manager", }, HashedFolder { @@ -189,7 +189,7 @@ HashedFolder { "name": "sample-result-component", }, ], - "hash": "wLPpWj43ALvIz9yZsp4BFoMBbow=", + "hash": "cLJy/0XAUwc0A3avxtG5LmqNsfo=", "name": "components", }, HashedFile { @@ -230,7 +230,7 @@ HashedFolder { "name": "utils", }, ], - "hash": "Ef7/8/tJBJSWIiFfltYXzGL2Imw=", + "hash": "FJTdsvHKymcS4bWGsVDxdv5+xI0=", "name": "src", }, HashedFile { @@ -238,7 +238,7 @@ HashedFolder { "name": "tsconfig.json", }, ], - "hash": "ZzuGBPBUSyPMtIrjdtQn/NoDZOE=", + "hash": "fXSss5dlkGuizSP8OXlIF3OvP2Q=", "name": "normalizedDir", } `; diff --git a/packages/cli/core/src/commands/config/set.ts b/packages/cli/core/src/commands/config/set.ts index 1565a3d326..19dcbea0af 100644 --- a/packages/cli/core/src/commands/config/set.ts +++ b/packages/cli/core/src/commands/config/set.ts @@ -1,30 +1,18 @@ import {CLICommand} from '@coveo/cli-commons/command/cliCommand'; -import {CliUx, Flags} from '@oclif/core'; import {Config} from '@coveo/cli-commons/config/config'; +import {ConfigRenderer} from '@coveo/cli-commons/config/configRenderer'; +import {Before} from '@coveo/cli-commons/decorators/before'; import {AuthenticatedClient} from '@coveo/cli-commons/platform/authenticatedClient'; -import { - IsAuthenticated, - Preconditions, -} from '@coveo/cli-commons/preconditions/index'; +import {IsAuthenticated} from '@coveo/cli-commons/preconditions/index'; import {Trackable} from '@coveo/cli-commons/preconditions/trackable'; -import {InvalidCommandError} from '../../lib/errors/InvalidCommandError'; -import {ConfigRenderer} from '@coveo/cli-commons/config/configRenderer'; +import {Flags} from '@oclif/core'; import type {Example} from '@oclif/core/lib/interfaces'; +import {InvalidCommandError} from '../../lib/errors/InvalidCommandError'; export default class Set extends CLICommand { public static description = 'Modify the current Coveo CLI configuration.'; public static flags = { - // TODO CDX-1246 - environment: Flags.string({ - char: 'e', - hidden: true, - }), - // TODO CDX-1246 - region: Flags.string({ - char: 'r', - hidden: true, - }), organization: Flags.string({ char: 'o', description: @@ -41,15 +29,9 @@ export default class Set extends CLICommand { ]; @Trackable() - @Preconditions(IsAuthenticated()) + @Before(IsAuthenticated()) public async run() { const {flags} = await this.parse(Set); - // TODO CDX-1246 - if (flags.environment || flags.region) { - CliUx.ux.error( - 'To connect to a different region or environment, use the `auth:login` command' - ); - } if (Object.entries(flags).length === 0) { throw new InvalidCommandError('Command should contain at least 1 flag'); } From 54c6937829685e1af20949f082b2de484fa1f6c6 Mon Sep 17 00:00:00 2001 From: Olivier Lamothe Date: Mon, 16 Oct 2023 15:50:52 -0400 Subject: [PATCH 2/8] feat(cli): change node support to 18.18.1 (#1332) https://coveord.atlassian.net/browse/CDX-1407 ## Proposed changes drop support for node 16 ## Breaking changes Modify node support to latest of 18.x (18.18.1) --- .nvmrc | 2 +- packages/cli/core/package.json | 2 +- packages/cli/core/src/commands/ui/create/angular.ts | 4 ++-- packages/cli/core/src/commands/ui/create/react.ts | 4 ++-- packages/cli/core/src/commands/ui/create/vue.ts | 2 +- packages/cli/core/src/hooks/prerun/checkNodeVersion.spec.ts | 2 +- packages/cli/core/src/lib/atomic/createAtomicProject.ts | 2 +- packages/cli/source/package.json | 2 +- packages/ui/cra-template/package.json | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.nvmrc b/.nvmrc index 25bf17fc5a..41d9dbcf4d 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18 \ No newline at end of file +18.18.1 \ No newline at end of file diff --git a/packages/cli/core/package.json b/packages/cli/core/package.json index 382717d3ee..5107908894 100644 --- a/packages/cli/core/package.json +++ b/packages/cli/core/package.json @@ -4,7 +4,7 @@ "author": "Coveo", "description": "Coveo CLI", "engines": { - "node": "^16.13.0 || ^18.12.0" + "node": ">=18.18.1" }, "dependencies": { "@amplitude/analytics-node": "^1.3.3", diff --git a/packages/cli/core/src/commands/ui/create/angular.ts b/packages/cli/core/src/commands/ui/create/angular.ts index 0657804c33..c1eb4b5e3e 100644 --- a/packages/cli/core/src/commands/ui/create/angular.ts +++ b/packages/cli/core/src/commands/ui/create/angular.ts @@ -29,8 +29,8 @@ export default class Angular extends CLICommand { * Requirements Based on https://angular.io/guide/setup-local * and https://www.npmjs.com/package/@angular/cli package.json engines section. */ - public static requiredNodeVersion = '^12.14.1 || >=14.0.0'; - public static requiredNpmVersion = '^6.11.0 || ^7.5.6 || >=8.0.0'; + public static requiredNodeVersion = '>=18.18.1'; + public static requiredNpmVersion = '>=9.8.1'; public static requiredNgVersion = '^15.0.0'; public static description = diff --git a/packages/cli/core/src/commands/ui/create/react.ts b/packages/cli/core/src/commands/ui/create/react.ts index d2032a45d1..e9e0ab97e6 100644 --- a/packages/cli/core/src/commands/ui/create/react.ts +++ b/packages/cli/core/src/commands/ui/create/react.ts @@ -35,10 +35,10 @@ export default class React extends CLICommand { public static cliPackage = 'create-react-app@latest'; /** - * "You’ll need to have Node 14.0.0 or later version on your local development machine" + * "You’ll need to have Node 18.1.1 or later version on your local development machine" * https://github.com/facebook/create-react-app#creating-an-app */ - public static requiredNodeVersion = '>=14.0.0'; + public static requiredNodeVersion = '>=18.1.1'; public static description = 'Create a Coveo Headless-powered search page with the React web framework. See and .'; diff --git a/packages/cli/core/src/commands/ui/create/vue.ts b/packages/cli/core/src/commands/ui/create/vue.ts index 2185ae1273..5ab2510a3d 100644 --- a/packages/cli/core/src/commands/ui/create/vue.ts +++ b/packages/cli/core/src/commands/ui/create/vue.ts @@ -34,7 +34,7 @@ export default class Vue extends CLICommand { * @see https://cli.vuejs.org/guide/installation.html for current requirements. * @see https://github.com/vuejs/vue-cli/blob/dev/CHANGELOG.md for upcoming requirements. */ - public static requiredNodeVersion = '>=16'; + public static requiredNodeVersion = '>=18.1.1'; public static description = 'Create a Coveo Headless-powered search page with the Vue3 and Vite. See and .'; diff --git a/packages/cli/core/src/hooks/prerun/checkNodeVersion.spec.ts b/packages/cli/core/src/hooks/prerun/checkNodeVersion.spec.ts index 9606192938..e320e3e310 100644 --- a/packages/cli/core/src/hooks/prerun/checkNodeVersion.spec.ts +++ b/packages/cli/core/src/hooks/prerun/checkNodeVersion.spec.ts @@ -35,7 +35,7 @@ describe('hooks:checkNodeVersion', () => { .stdout() .stderr() .do(() => { - setProcessNodeVersion('v18.12.0'); + setProcessNodeVersion('v18.18.1'); }) .command(['help']) .it('should not fail when the Node version is supported', ({stdout}) => { diff --git a/packages/cli/core/src/lib/atomic/createAtomicProject.ts b/packages/cli/core/src/lib/atomic/createAtomicProject.ts index b2a5f5ca42..ccd2b5c80d 100644 --- a/packages/cli/core/src/lib/atomic/createAtomicProject.ts +++ b/packages/cli/core/src/lib/atomic/createAtomicProject.ts @@ -34,7 +34,7 @@ export const atomicAppInitializerPackage = '@coveo/create-atomic'; export const atomicLibInitializerPackage = '@coveo/create-atomic-component-project'; -const supportedNodeVersions = '16.x || 18.x'; +const supportedNodeVersions = '>=18.1.1'; const transformPackageNameToNpmInitializer = (packageName: string) => packageName.replace('/create-', '/'); diff --git a/packages/cli/source/package.json b/packages/cli/source/package.json index ce8a3c79fa..cecb00ffaf 100644 --- a/packages/cli/source/package.json +++ b/packages/cli/source/package.json @@ -74,7 +74,7 @@ "prepublishOnly": "rimraf lib && npm run build && oclif manifest" }, "engines": { - "node": "^16.13.0 || ^18.12.0" + "node": ">=18.18.1" }, "bugs": "https://github.com/coveo/cli/issues", "keywords": [ diff --git a/packages/ui/cra-template/package.json b/packages/ui/cra-template/package.json index 397399386e..d64978dad3 100644 --- a/packages/ui/cra-template/package.json +++ b/packages/ui/cra-template/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "engines": { - "node": "^16.13.0 || ^18.12.0" + "node": ">=18.18.1" }, "files": [ "template", From 012b6a45adc474f1d10a8adf5a881eb9faf5e6e8 Mon Sep 17 00:00:00 2001 From: Olivier Lamothe Date: Tue, 17 Oct 2023 16:31:30 -0400 Subject: [PATCH 3/8] feat(cli): use hidden prompt or stdin for auth:token command (#1334) https://coveord.atlassian.net/browse/CDX-665 ## Proposed changes use hidden prompt or stdin for auth:token command ## Breaking changes deprecate --token flag and rely on hidden prompt or stdin for auth:token command. default to stdin for ci environment ## Testing - [x] Unit Tests: - [ ] Functionnal Tests: - [x] Manual Tests: --- .../cli/core/src/commands/auth/token.spec.ts | 23 +++++++++---------- packages/cli/core/src/commands/auth/token.ts | 22 ++++++++++++------ packages/cli/core/src/lib/utils/process.ts | 17 ++++++++++++++ 3 files changed, 43 insertions(+), 19 deletions(-) diff --git a/packages/cli/core/src/commands/auth/token.spec.ts b/packages/cli/core/src/commands/auth/token.spec.ts index 725a1b2842..e1555668a1 100644 --- a/packages/cli/core/src/commands/auth/token.spec.ts +++ b/packages/cli/core/src/commands/auth/token.spec.ts @@ -8,6 +8,7 @@ import {test} from '@oclif/test'; import {Config} from '@coveo/cli-commons/config/config'; import {AuthenticatedClient} from '@coveo/cli-commons/platform/authenticatedClient'; import {PlatformEnvironment} from '@coveo/cli-commons/platform/environment'; +import {CliUx} from '@oclif/core'; const mockedConfig = jest.mocked(Config); const mockedAuthenticatedClient = jest.mocked(AuthenticatedClient); @@ -68,7 +69,8 @@ describe('auth:token', () => { test .stdout() .stderr() - .command(['auth:token', '-e', environment, '-t', 'someToken']) + .stub(CliUx.ux, 'prompt', () => () => 'someToken') + .command(['auth:token', '-e', environment]) .it(`writes the -e=${environment} flag to the configuration`, () => { expect(mockConfigSet).toHaveBeenCalledWith('environment', environment); }); @@ -78,7 +80,8 @@ describe('auth:token', () => { test .stdout() .stderr() - .command(['auth:token', '-r', region, '-t', 'someToken']) + .stub(CliUx.ux, 'prompt', () => () => 'someToken') + .command(['auth:token', '-r', region]) .it(`writes the -r=${region} flag and configuration`, () => { expect(mockConfigSet).toHaveBeenCalledWith( 'region', @@ -91,7 +94,8 @@ describe('auth:token', () => { test .stdout() .stderr() - .command(['auth:token', '-t', 'this-is-the-token']) + .stub(CliUx.ux, 'prompt', () => () => 'this-is-the-token') + .command(['auth:token', '--no-stdin']) .it('save token from oauth service', () => { expect(mockConfigSet).toHaveBeenCalledWith( 'accessToken', @@ -101,20 +105,14 @@ describe('auth:token', () => { }); }); - test - .stdout() - .stderr() - .command(['auth:token']) - .exit(2) - .it('fails when the token flag is not set'); - test .stdout() .stderr() .do(() => { mockGetHasAccessToOrg.mockReturnValueOnce(Promise.resolve(true)); }) - .command(['auth:token', '-t', 'some-token']) + .stub(CliUx.ux, 'prompt', () => () => 'some-token') + .command(['auth:token']) .it( 'succeed when the organization and the token flags are valid', (ctx) => { @@ -130,7 +128,8 @@ describe('auth:token', () => { }) .stdout() .stderr() - .command(['auth:token', '-t', 'some-token']) + .stub(CliUx.ux, 'prompt', () => () => 'some-token') + .command(['auth:token']) .it( 'find the org associated with the token and saves it in the config', () => { diff --git a/packages/cli/core/src/commands/auth/token.ts b/packages/cli/core/src/commands/auth/token.ts index cfed0fe1bc..21d5b8e11b 100644 --- a/packages/cli/core/src/commands/auth/token.ts +++ b/packages/cli/core/src/commands/auth/token.ts @@ -1,5 +1,5 @@ import {CLICommand} from '@coveo/cli-commons/command/cliCommand'; -import {Flags} from '@oclif/core'; +import {CliUx, Flags} from '@oclif/core'; import {Config} from '@coveo/cli-commons/config/config'; import {AuthenticatedClient} from '@coveo/cli-commons/platform/authenticatedClient'; import {PlatformEnvironment} from '@coveo/cli-commons/platform/environment'; @@ -7,6 +7,7 @@ import {Region} from '@coveo/platform-client'; import {withEnvironment, withRegion} from '../../lib/flags/platformCommonFlags'; import {Trackable} from '@coveo/cli-commons/preconditions/trackable'; import {formatOrgId} from '@coveo/cli-commons/utils/ux'; +import {readFromStdinWithTimeout} from '../../lib/utils/process'; export default class Token extends CLICommand { private configuration!: Config; @@ -18,12 +19,12 @@ export default class Token extends CLICommand { public static flags = { ...withRegion(), ...withEnvironment(), - token: Flags.string({ - char: 't', + stdin: Flags.boolean({ + char: 's', description: - 'The API-Key that shall be used to authenticate you to the organization. See .', - required: true, - helpValue: 'xxx-api-key', + 'Whether to read the token from stdin. Default to true when running in a CI environment.', + default: process.env.CI === 'true', + allowNo: true, }), }; @@ -52,7 +53,14 @@ export default class Token extends CLICommand { private async saveToken() { const {flags} = await this.parse(Token); - this.configuration.set('accessToken', flags.token); + + const tok = flags.stdin + ? await readFromStdinWithTimeout(1000) + : await CliUx.ux.prompt('Enter your access token: ', { + type: 'hide', + }); + + this.configuration.set('accessToken', tok); this.configuration.set('anonymous', true); } diff --git a/packages/cli/core/src/lib/utils/process.ts b/packages/cli/core/src/lib/utils/process.ts index 14743ac98f..8f413fcf33 100644 --- a/packages/cli/core/src/lib/utils/process.ts +++ b/packages/cli/core/src/lib/utils/process.ts @@ -94,3 +94,20 @@ export const handleForkedProcess = (subprocess: ChildProcess) => { }); }); }; + +export const readFromStdinWithTimeout = ( + timeoutMs: number +): Promise => { + return new Promise(async (resolve, reject) => { + setTimeout(() => { + reject(`Read stdin timeout after ${timeoutMs}ms`); + }, timeoutMs); + const chunks: Buffer[] = []; + + for await (const chunk of process.stdin) { + chunks.push(chunk); + } + + resolve(Buffer.concat(chunks).toString('utf-8')); + }); +}; From 3e6520737650901d2b176fadc8e2e56441a8d4da Mon Sep 17 00:00:00 2001 From: Olivier Lamothe Date: Wed, 18 Oct 2023 17:06:25 -0400 Subject: [PATCH 4/8] feat(cli): change node support to only 18-20 (#1335) https://coveord.atlassian.net/browse/CDX-1408 ## Proposed changes I recently changed these files to drop support for 16. However, we want to only support 18-20 ranges (not everything above 18) ## Breaking changes Drop support for older version of node js ## Testing - [X] Unit Tests: - [X] Functionnal Tests: - [ ] Manual Tests: --------- Co-authored-by: Louis Bompart --- .github/actions/e2e-run/action.yml | 4 ++-- .github/workflows/build.yml | 3 ++- .nvmrc | 2 +- packages/cli/core/package.json | 2 +- packages/cli/core/src/commands/ui/create/angular.ts | 4 ++-- packages/cli/core/src/commands/ui/create/react.ts | 4 ++-- packages/cli/core/src/commands/ui/create/vue.ts | 2 +- packages/cli/core/src/lib/atomic/createAtomicProject.ts | 2 +- packages/cli/source/package.json | 2 +- packages/ui/cra-template/package.json | 2 +- scripts/cleaning/delete-api-keys.js | 8 ++------ scripts/cleaning/delete-orgs.js | 7 ++----- 12 files changed, 18 insertions(+), 24 deletions(-) diff --git a/.github/actions/e2e-run/action.yml b/.github/actions/e2e-run/action.yml index e6bdb40ae4..8262b96b08 100644 --- a/.github/actions/e2e-run/action.yml +++ b/.github/actions/e2e-run/action.yml @@ -39,7 +39,7 @@ runs: - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 with: cache: 'npm' - node-version-file: '.nvmrc' + node-version: ${{inputs.node}} - uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b # v4 with: cache: 'pip' @@ -79,5 +79,5 @@ runs: - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 if: cancelled() || failure() || success() with: - name: ${{inputs.os}}-${{inputs.spec}}-test-artifacts + name: ${{inputs.os}}-${{inputs.node}}-${{inputs.spec}}-test-artifacts path: ./packages/cli-e2e/artifacts diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00f741e4fc..3b00f65158 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -134,6 +134,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-20.04', 'windows-latest'] + node: ['18', '20'] spec: [ 'angular.specs.ts', @@ -151,7 +152,7 @@ jobs: spec: auth.specs.ci.ts env: # ID of the test run to identify resources to teardown. - TEST_RUN_ID: 'id${{ matrix.os }}-${{ github.sha }}-${{ github.run_attempt }}g' + TEST_RUN_ID: 'id${{ matrix.os }}-${{ matrix.node }}-${{ github.sha }}-${{ github.run_attempt }}g' COVEO_DISABLE_AUTOUPDATE: true CLI_CONFIG_JSON: ${{needs.e2e-setup-login.outputs.cliConfigJson}} steps: diff --git a/.nvmrc b/.nvmrc index 41d9dbcf4d..aad5ebe18d 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.18.1 \ No newline at end of file +20.8.0 \ No newline at end of file diff --git a/packages/cli/core/package.json b/packages/cli/core/package.json index 5107908894..dec581f0c5 100644 --- a/packages/cli/core/package.json +++ b/packages/cli/core/package.json @@ -4,7 +4,7 @@ "author": "Coveo", "description": "Coveo CLI", "engines": { - "node": ">=18.18.1" + "node": "^18.18.1 || ^20.8.1" }, "dependencies": { "@amplitude/analytics-node": "^1.3.3", diff --git a/packages/cli/core/src/commands/ui/create/angular.ts b/packages/cli/core/src/commands/ui/create/angular.ts index c1eb4b5e3e..220fa13fbf 100644 --- a/packages/cli/core/src/commands/ui/create/angular.ts +++ b/packages/cli/core/src/commands/ui/create/angular.ts @@ -29,8 +29,8 @@ export default class Angular extends CLICommand { * Requirements Based on https://angular.io/guide/setup-local * and https://www.npmjs.com/package/@angular/cli package.json engines section. */ - public static requiredNodeVersion = '>=18.18.1'; - public static requiredNpmVersion = '>=9.8.1'; + public static requiredNodeVersion = '^18.18.1 || ^20.8.1'; + public static requiredNpmVersion = '^9.8.1 || ^10.1.0'; public static requiredNgVersion = '^15.0.0'; public static description = diff --git a/packages/cli/core/src/commands/ui/create/react.ts b/packages/cli/core/src/commands/ui/create/react.ts index e9e0ab97e6..09d874d749 100644 --- a/packages/cli/core/src/commands/ui/create/react.ts +++ b/packages/cli/core/src/commands/ui/create/react.ts @@ -35,10 +35,10 @@ export default class React extends CLICommand { public static cliPackage = 'create-react-app@latest'; /** - * "You’ll need to have Node 18.1.1 or later version on your local development machine" + * "You’ll need to have Node 18.18.1 or later version on your local development machine" * https://github.com/facebook/create-react-app#creating-an-app */ - public static requiredNodeVersion = '>=18.1.1'; + public static requiredNodeVersion = '^18.18.1 || ^20.8.1'; public static description = 'Create a Coveo Headless-powered search page with the React web framework. See and .'; diff --git a/packages/cli/core/src/commands/ui/create/vue.ts b/packages/cli/core/src/commands/ui/create/vue.ts index 5ab2510a3d..a45d2bfde7 100644 --- a/packages/cli/core/src/commands/ui/create/vue.ts +++ b/packages/cli/core/src/commands/ui/create/vue.ts @@ -34,7 +34,7 @@ export default class Vue extends CLICommand { * @see https://cli.vuejs.org/guide/installation.html for current requirements. * @see https://github.com/vuejs/vue-cli/blob/dev/CHANGELOG.md for upcoming requirements. */ - public static requiredNodeVersion = '>=18.1.1'; + public static requiredNodeVersion = '^18.18.1 || ^20.8.1'; public static description = 'Create a Coveo Headless-powered search page with the Vue3 and Vite. See and .'; diff --git a/packages/cli/core/src/lib/atomic/createAtomicProject.ts b/packages/cli/core/src/lib/atomic/createAtomicProject.ts index ccd2b5c80d..336a4ce327 100644 --- a/packages/cli/core/src/lib/atomic/createAtomicProject.ts +++ b/packages/cli/core/src/lib/atomic/createAtomicProject.ts @@ -34,7 +34,7 @@ export const atomicAppInitializerPackage = '@coveo/create-atomic'; export const atomicLibInitializerPackage = '@coveo/create-atomic-component-project'; -const supportedNodeVersions = '>=18.1.1'; +const supportedNodeVersions = '^18.18.1 || ^20.8.1'; const transformPackageNameToNpmInitializer = (packageName: string) => packageName.replace('/create-', '/'); diff --git a/packages/cli/source/package.json b/packages/cli/source/package.json index cecb00ffaf..0f656f3c6a 100644 --- a/packages/cli/source/package.json +++ b/packages/cli/source/package.json @@ -74,7 +74,7 @@ "prepublishOnly": "rimraf lib && npm run build && oclif manifest" }, "engines": { - "node": ">=18.18.1" + "node": "^18.18.1 || ^20.8.1" }, "bugs": "https://github.com/coveo/cli/issues", "keywords": [ diff --git a/packages/ui/cra-template/package.json b/packages/ui/cra-template/package.json index d64978dad3..98b49085de 100644 --- a/packages/ui/cra-template/package.json +++ b/packages/ui/cra-template/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "engines": { - "node": ">=18.18.1" + "node": "^18.18.1 || ^20.8.1" }, "files": [ "template", diff --git a/scripts/cleaning/delete-api-keys.js b/scripts/cleaning/delete-api-keys.js index bcadb5ea0f..9df0c4b69e 100644 --- a/scripts/cleaning/delete-api-keys.js +++ b/scripts/cleaning/delete-api-keys.js @@ -1,6 +1,3 @@ -require('isomorphic-fetch'); -require('abortcontroller-polyfill'); - const {homedir} = require('os'); const {join} = require('path'); const {config} = require('dotenv'); @@ -9,9 +6,8 @@ config({path: join(homedir(), '.env')}); function wasCreatedByTheCli(testRunId = '') { return (key) => - (key.displayName?.startsWith(`cli-idwindows-latest-${testRunId}`) || - key.displayName?.startsWith(`cli-idubuntu-20-04-${testRunId}`) || - key.displayName?.startsWith(`cli-id${testRunId}`)) && + key.displayName?.startsWith('cli-id') && + key.displayName?.includes(testRunId) && key.description === 'Generated by the Coveo CLI'; } diff --git a/scripts/cleaning/delete-orgs.js b/scripts/cleaning/delete-orgs.js index a18f1ffbf7..a0ce7fe9ac 100644 --- a/scripts/cleaning/delete-orgs.js +++ b/scripts/cleaning/delete-orgs.js @@ -1,6 +1,3 @@ -require('isomorphic-fetch'); -require('abortcontroller-polyfill'); - const {homedir} = require('os'); const {join} = require('path'); const {config} = require('dotenv'); @@ -15,8 +12,8 @@ config({path: join(homedir(), '.env')}); function wasCreatedByTheCli(testRunId = '') { return (key) => testRunId - ? key.displayName?.startsWith(`cli-e2e-idwindows-latest-${testRunId}`) || - key.displayName?.startsWith(`cli-e2e-idubuntu-20-04-${testRunId}`) + ? key.displayName?.startsWith('cli-e2e-id') && + key.displayName?.includes(testRunId) : key.displayName?.match(/cli-e2e.*g/); } From af1c3ac1796bdfd534b5d037f3a42e23aa3ab225 Mon Sep 17 00:00:00 2001 From: Olivier Lamothe Date: Wed, 25 Oct 2023 16:00:12 -0400 Subject: [PATCH 5/8] feat(cli): node 20.9.0 lts (#1337) https://coveord.atlassian.net/browse/CDX-1495 --- .github/actions/e2e-run/action.yml | 2 +- .nvmrc | 2 +- packages/cli/core/package.json | 2 +- packages/cli/core/src/commands/ui/create/angular.ts | 2 +- packages/cli/core/src/commands/ui/create/react.ts | 2 +- packages/cli/core/src/commands/ui/create/vue.ts | 2 +- packages/cli/core/src/lib/atomic/createAtomicProject.ts | 2 +- packages/cli/source/package.json | 2 +- packages/ui/cra-template/package.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/actions/e2e-run/action.yml b/.github/actions/e2e-run/action.yml index 8262b96b08..95cc1de9a0 100644 --- a/.github/actions/e2e-run/action.yml +++ b/.github/actions/e2e-run/action.yml @@ -39,7 +39,7 @@ runs: - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 with: cache: 'npm' - node-version: ${{inputs.node}} + node-version-file: '.nvmrc' - uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b # v4 with: cache: 'pip' diff --git a/.nvmrc b/.nvmrc index aad5ebe18d..43bff1f8cf 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.8.0 \ No newline at end of file +20.9.0 \ No newline at end of file diff --git a/packages/cli/core/package.json b/packages/cli/core/package.json index dec581f0c5..b206eafa71 100644 --- a/packages/cli/core/package.json +++ b/packages/cli/core/package.json @@ -4,7 +4,7 @@ "author": "Coveo", "description": "Coveo CLI", "engines": { - "node": "^18.18.1 || ^20.8.1" + "node": "^18.18.1 || ^20.9.0" }, "dependencies": { "@amplitude/analytics-node": "^1.3.3", diff --git a/packages/cli/core/src/commands/ui/create/angular.ts b/packages/cli/core/src/commands/ui/create/angular.ts index 220fa13fbf..86a702cc0b 100644 --- a/packages/cli/core/src/commands/ui/create/angular.ts +++ b/packages/cli/core/src/commands/ui/create/angular.ts @@ -29,7 +29,7 @@ export default class Angular extends CLICommand { * Requirements Based on https://angular.io/guide/setup-local * and https://www.npmjs.com/package/@angular/cli package.json engines section. */ - public static requiredNodeVersion = '^18.18.1 || ^20.8.1'; + public static requiredNodeVersion = '^18.18.1 || ^20.9.0'; public static requiredNpmVersion = '^9.8.1 || ^10.1.0'; public static requiredNgVersion = '^15.0.0'; diff --git a/packages/cli/core/src/commands/ui/create/react.ts b/packages/cli/core/src/commands/ui/create/react.ts index 09d874d749..28e05c21b9 100644 --- a/packages/cli/core/src/commands/ui/create/react.ts +++ b/packages/cli/core/src/commands/ui/create/react.ts @@ -38,7 +38,7 @@ export default class React extends CLICommand { * "You’ll need to have Node 18.18.1 or later version on your local development machine" * https://github.com/facebook/create-react-app#creating-an-app */ - public static requiredNodeVersion = '^18.18.1 || ^20.8.1'; + public static requiredNodeVersion = '^18.18.1 || ^20.9.0'; public static description = 'Create a Coveo Headless-powered search page with the React web framework. See and .'; diff --git a/packages/cli/core/src/commands/ui/create/vue.ts b/packages/cli/core/src/commands/ui/create/vue.ts index a45d2bfde7..706f0ceeab 100644 --- a/packages/cli/core/src/commands/ui/create/vue.ts +++ b/packages/cli/core/src/commands/ui/create/vue.ts @@ -34,7 +34,7 @@ export default class Vue extends CLICommand { * @see https://cli.vuejs.org/guide/installation.html for current requirements. * @see https://github.com/vuejs/vue-cli/blob/dev/CHANGELOG.md for upcoming requirements. */ - public static requiredNodeVersion = '^18.18.1 || ^20.8.1'; + public static requiredNodeVersion = '^18.18.1 || ^20.9.0'; public static description = 'Create a Coveo Headless-powered search page with the Vue3 and Vite. See and .'; diff --git a/packages/cli/core/src/lib/atomic/createAtomicProject.ts b/packages/cli/core/src/lib/atomic/createAtomicProject.ts index 336a4ce327..237b344783 100644 --- a/packages/cli/core/src/lib/atomic/createAtomicProject.ts +++ b/packages/cli/core/src/lib/atomic/createAtomicProject.ts @@ -34,7 +34,7 @@ export const atomicAppInitializerPackage = '@coveo/create-atomic'; export const atomicLibInitializerPackage = '@coveo/create-atomic-component-project'; -const supportedNodeVersions = '^18.18.1 || ^20.8.1'; +const supportedNodeVersions = '^18.18.1 || ^20.9.0'; const transformPackageNameToNpmInitializer = (packageName: string) => packageName.replace('/create-', '/'); diff --git a/packages/cli/source/package.json b/packages/cli/source/package.json index 0f656f3c6a..0c421cd602 100644 --- a/packages/cli/source/package.json +++ b/packages/cli/source/package.json @@ -74,7 +74,7 @@ "prepublishOnly": "rimraf lib && npm run build && oclif manifest" }, "engines": { - "node": "^18.18.1 || ^20.8.1" + "node": "^18.18.1 || ^20.9.0" }, "bugs": "https://github.com/coveo/cli/issues", "keywords": [ diff --git a/packages/ui/cra-template/package.json b/packages/ui/cra-template/package.json index 98b49085de..a177280c7c 100644 --- a/packages/ui/cra-template/package.json +++ b/packages/ui/cra-template/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "engines": { - "node": "^18.18.1 || ^20.8.1" + "node": "^18.18.1 || ^20.9.0" }, "files": [ "template", From 1bdd516bc73bf5c6ca1eb8e217fd83ea0af24b7c Mon Sep 17 00:00:00 2001 From: Olivier Lamothe Date: Thu, 26 Oct 2023 13:09:26 -0400 Subject: [PATCH 6/8] ci(cli): fix release workflow (#1338) https://coveord.atlassian.net/browse/CDX-1497 --- .github/workflows/release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3242c1c4b2..5f87ee5259 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,19 @@ on: type: boolean default: false required: false +env: + # Platform environment to log into for the e2e tests. + PLATFORM_ENV: 'stg' + # Username used to log into the organization whose ID is stored in the ORG_ID variable + PLATFORM_USER_NAME: ${{ secrets.PLATFORM_USER_NAME }} + # Password used to log into the organization whose ID is stored in the ORG_ID variable + PLATFORM_USER_PASSWORD: ${{ secrets.PLATFORM_USER_PASSWORD }} + # API key to delete all the API keys created by the e2e tests + PLATFORM_API_KEY: ${{ secrets.PLATFORM_API_KEY }} + # ID of the organization to log into for the e2e tests + ORG_ID: ${{ secrets.ORG_ID }} + # Passphrase use to encode/decode cliConfig + E2E_TOKEN_PASSPHRASE: ${{ secrets.E2E_TOKEN_PASSPHRASE }} jobs: e2e-setup-login: From 16a8eece2c72fdc9aa33acd1a23fcbdcfe116b67 Mon Sep 17 00:00:00 2001 From: Louis Bompart Date: Fri, 27 Oct 2023 11:24:39 -0400 Subject: [PATCH 7/8] chore: stabilize release (#1389) ## Proposed changes - Add `npm test:ci:snap` to update non-e2e snap - Update all snap during the release - Fix the release ## Testing A lot of releases. --- .github/workflows/release.yml | 98 ++++++-- package-lock.json | 8 +- package.json | 1 + packages/cli/commons/package.json | 1 + packages/cli/core/package.json | 1 + packages/cli/source/package.json | 1 + packages/ui/angular/package.json | 1 + .../package.json | 3 +- .../create-atomic-component/package.json | 3 +- .../package.json | 3 +- packages/ui/atomic/health-check/package.json | 3 +- packages/ui/search-token-server/package.json | 1 + utils/release/create-github-release.mjs | 6 +- utils/release/git-publish-all.mjs | 235 ++++++++++-------- utils/release/is-cli-release.mjs | 16 +- 15 files changed, 230 insertions(+), 151 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f87ee5259..b127472668 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,7 @@ on: default: false required: false env: + E2E_USE_NPM_REGISTRY: true # Platform environment to log into for the e2e tests. PLATFORM_ENV: 'stg' # Username used to log into the organization whose ID is stored in the ORG_ID variable @@ -74,6 +75,7 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} VERSION: ${{ inputs.version }} + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} DEBUG: ${{ inputs.debug && '*' || '' }} - name: Prepare artifacts run: | @@ -126,7 +128,7 @@ jobs: cache: 'npm' node-version-file: '.nvmrc' - name: Download artifacts - uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: name: npm-release - name: Apply & delete the patch @@ -147,15 +149,17 @@ jobs: - name: Find modified Snapshots id: snapshots-path run: | - EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) - echo "snapshotsPath<<$EOF" >> "$GITHUB_ENV" - git diff --name-only *.yml >> "$GITHUB_ENV" - echo "$EOF" >> "$GITHUB_ENV" + { + echo 'snapshotsPath<> "$GITHUB_OUTPUT" - name: Upload Jest Snapshots + if: ${{ steps.snapshots-path.outputs.snapshotsPath != ''}} uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 with: name: release-e2e-snaps - path: ${{ env.snapshotsPath }} + path: ${{ steps.snapshots-path.outputs.snapshotsPath }} e2e-teardown: name: End-to-end teardown if: ${{ always() }} @@ -177,8 +181,49 @@ jobs: - uses: ./.github/actions/e2e-clean with: cliConfigJson: ${{ env.CLI_CONFIG_JSON }} - release-git: + unit-tests: + name: Unit Tests + runs-on: 'ubuntu-20.04' needs: [release-npm] + steps: + - name: Setup runner + # Ensure we can use as many file watcher as we want. see https://github.com/facebook/create-react-app/blob/master/docusaurus/docs/troubleshooting.md#npm-start-fail-due-to-watch-error + run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 + - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + cache: 'npm' + node-version-file: '.nvmrc' + - name: Download artifacts + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 + with: + name: npm-release + - name: Apply & delete the patch + run: | + git apply release.patch + rm release.patch + - name: Setup repo + run: npm ci + - name: Build + run: npm run build + - name: Tests + run: npm run test:ci:snap + - name: Find modified Snapshots + id: snapshots-path + run: | + { + echo 'snapshotsPath<> "$GITHUB_OUTPUT" + - name: Upload Jest Snapshots + if: ${{ steps.snapshots-path.outputs.snapshotsPath != ''}} + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: release-e2e-snaps + path: ${{ steps.snapshots-path.outputs.snapshotsPath }} + release-git: + needs: [e2e, release-npm, unit-tests] environment: 'Release' runs-on: ubuntu-20.04 env: @@ -194,7 +239,7 @@ jobs: cache: 'npm' node-version-file: '.nvmrc' - name: Download NPM artifacts - uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: name: npm-release - name: Apply & delete the patch @@ -202,7 +247,7 @@ jobs: git apply release.patch rm release.patch - name: Download E2E artifacts - uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: name: release-e2e-snaps - name: Install dependencies @@ -263,7 +308,7 @@ jobs: cache: 'npm' node-version-file: '.nvmrc' - name: Download artifacts - uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: name: npm-release - name: Apply & delete the patch @@ -274,8 +319,10 @@ jobs: run: npm ci - name: Get CLI version run: | - echo "cliVersion=" >> "$GITHUB_ENV" - cat packages/cli/core/package.json | jq '.version' >> "$GITHUB_ENV" + { + printf "CLI_VERSION=" + cat packages/cli/core/package.json | jq -r '.version' + } >> "$GITHUB_ENV" - name: Build run: npm run build - name: Setup Temporary Keychain @@ -311,19 +358,19 @@ jobs: New-Item -Force -ItemType directory -Path tmp echo "${{ secrets.COVEO_PFX }}" > ./tmp/cert.txt certutil -decode ./tmp/cert.txt ./tmp/cert.pfx - Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.exe" -PassThru | Wait-Process - Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-${{env.cliversion}}-${{env.commitSHA1}}-x86.exe" -PassThru | Wait-Process + Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64.exe" -PassThru | Wait-Process + Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x86.exe" -PassThru | Wait-Process - name: Sign Executable (macOS) working-directory: ./packages/cli/core/dist/macos if: ${{matrix.os == 'macos-latest'}} run: | echo "Signing for ARM64 architecture" security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain - productsign --sign $MACOS_WWDR_TEAM_ID coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64.pkg coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg --keychain build.keychain + productsign --sign $MACOS_WWDR_TEAM_ID coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64.pkg coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg --keychain build.keychain echo "Signing for X64 architecture" security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain - productsign --sign $MACOS_WWDR_TEAM_ID coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.pkg coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg --keychain build.keychain + productsign --sign $MACOS_WWDR_TEAM_ID coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64.pkg coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64-signed.pkg --keychain build.keychain - name: Notarize Executable (macOS) working-directory: ./packages/cli/core/dist/macos if: ${{matrix.os == 'macos-latest'}} @@ -335,20 +382,20 @@ jobs: xcrun notarytool store-credentials "notarytool-profile" --apple-id "${{ secrets.MACOS_APP_USERNAME }}" --team-id "${{ secrets.MACOS_WWDR_TEAM_ID }}" --password "${{ secrets.MACOS_APP_SPECIFIC_PWD }}" echo "Creating temp notarization archive" - ditto -c -k --keepParent "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" "notarization-arm64.zip" - ditto -c -k --keepParent "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" "notarization-x64.zip" + ditto -c -k --keepParent "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg" "notarization-arm64.zip" + ditto -c -k --keepParent "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64-signed.pkg" "notarization-x64.zip" echo "Notarizing app" xcrun notarytool submit "notarization-arm64.zip" --keychain-profile "notarytool-profile" --wait xcrun notarytool submit "notarization-x64.zip" --keychain-profile "notarytool-profile" --wait echo "Attaching staple" - xcrun stapler staple "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" - xcrun stapler staple "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" + xcrun stapler staple "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg" + xcrun stapler staple "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64-signed.pkg" echo "Deleting unsigned packages" - mv "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.pkg" - mv "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64.pkg" + mv "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64-signed.pkg" "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64.pkg" + mv "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg" "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64.pkg" rm notarization-arm64.zip notarization-x64.zip - name: Upload binaries uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 @@ -373,13 +420,14 @@ jobs: cache: 'npm' node-version-file: '.nvmrc' - name: Download NPM artifacts - uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: name: npm-release - name: Download binaries artifacts - uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: name: release-binaries + path: release-binaries - name: Apply & delete the patch run: | git apply release.patch @@ -401,6 +449,6 @@ jobs: uses: svenstaro/upload-release-action@7319e4733ec7a184d739a6f412c40ffc339b69c7 # 2.5.0 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ./packages/cli/core/dist/**/* + file: ./release-binaries/**/* file_glob: true tag: ${{ env.tag }} diff --git a/package-lock.json b/package-lock.json index b6345d1999..83a30a4e08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30752,7 +30752,7 @@ "typescript": "4.9.5" }, "engines": { - "node": "^16.13.0 || ^18.12.0" + "node": "^18.18.1 || ^20.9.0" }, "peerDependencies": { "create-react-app": "*" @@ -30803,7 +30803,7 @@ "undici": "5.22.0" }, "engines": { - "node": "^16.13.0 || ^18.12.0" + "node": "^18.18.1 || ^20.9.0" } }, "packages/ui/angular": { @@ -31268,7 +31268,7 @@ "typescript": "4.9.5" }, "engines": { - "node": "^16.13.0 || ^18.12.0" + "node": "^18.18.1 || ^20.9.0" } }, "packages/ui/search-token-server": { @@ -31409,6 +31409,8 @@ "bin": { "git-lock": "git-lock.mjs", "git-publish-all": "git-publish-all.mjs", + "github-publish": "create-github-release.mjs", + "is-cli-release": "is-cli-release.mjs", "npm-publish": "npm-publish-package.mjs" }, "devDependencies": { diff --git a/package.json b/package.json index cb57fb5f1f..5fb3f97ed4 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "clean": "rimraf package-lock.json node_modules", "build": "nx run-many --target=build --all", "test": "nx run-many --target=test --all", + "test:ci:snap": "nx run-many --target=test:ci:snap --all", "lint": "nx run-many --target=lint --all && prettier --ignore-path .ci.prettierignore --check . && eslint .", "commit": "git-cz", "pr:report": "node ./scripts/pr-bot.js", diff --git a/packages/cli/commons/package.json b/packages/cli/commons/package.json index 52f8b1de3c..709787404b 100644 --- a/packages/cli/commons/package.json +++ b/packages/cli/commons/package.json @@ -40,6 +40,7 @@ }, "scripts": { "test": "jest", + "test:ci:snap": "jest -u", "build": "tsc -b tsconfig.build.json", "prepublishOnly": "npm run build", "release:phase1": "npx -p=@coveord/release npm-publish" diff --git a/packages/cli/core/package.json b/packages/cli/core/package.json index b206eafa71..30524f7d2c 100644 --- a/packages/cli/core/package.json +++ b/packages/cli/core/package.json @@ -174,6 +174,7 @@ "scripts": { "build": "rimraf lib && tsc -b tsconfig.build.json", "test": "jest --colors", + "test:ci:snap": "jest --colors -u", "lint": "prettier --check . && eslint .", "release:phase1": "npx -p=@coveord/release npm-publish", "postpack": "rimraf oclif.manifest.json", diff --git a/packages/cli/source/package.json b/packages/cli/source/package.json index 0c421cd602..97e9a9ff7f 100644 --- a/packages/cli/source/package.json +++ b/packages/cli/source/package.json @@ -68,6 +68,7 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "test": "jest --colors", + "test:ci:snap": "jest --colors -u", "lint": "prettier --config .prettierrc.js --check . && eslint .", "release:phase1": "npx -p=@coveord/release npm-publish", "postpack": "rimraf oclif.manifest.json", diff --git a/packages/ui/angular/package.json b/packages/ui/angular/package.json index c2ec896f86..f0753640e6 100644 --- a/packages/ui/angular/package.json +++ b/packages/ui/angular/package.json @@ -4,6 +4,7 @@ "description": "Coveo schematic for angular", "scripts": { "test": "jest", + "test:ci:snap": "jest -u", "lint": "prettier --check . && eslint .", "build": "tsc -p tsconfig.json", "prebuild": "node ./scripts/clean.js", diff --git a/packages/ui/atomic/create-atomic-component-project/package.json b/packages/ui/atomic/create-atomic-component-project/package.json index 647afb7233..8539bf6c8b 100644 --- a/packages/ui/atomic/create-atomic-component-project/package.json +++ b/packages/ui/atomic/create-atomic-component-project/package.json @@ -13,7 +13,8 @@ ], "scripts": { "release:phase1": "npx -p=@coveord/release npm-publish", - "test": "node --experimental-vm-modules --no-warnings ../../../../node_modules/jest/bin/jest.js" + "test": "node --experimental-vm-modules --no-warnings ../../../../node_modules/jest/bin/jest.js", + "test:ci:snap": "node --experimental-vm-modules --no-warnings ../../../../node_modules/jest/bin/jest.js -u" }, "keywords": [ "coveo", diff --git a/packages/ui/atomic/create-atomic-component/package.json b/packages/ui/atomic/create-atomic-component/package.json index 83d22e217b..c2dbbcc7e0 100644 --- a/packages/ui/atomic/create-atomic-component/package.json +++ b/packages/ui/atomic/create-atomic-component/package.json @@ -13,7 +13,8 @@ ], "scripts": { "release:phase1": "npx -p=@coveord/release npm-publish", - "test": "node --experimental-vm-modules --no-warnings ../../../../node_modules/jest/bin/jest.js" + "test": "node --experimental-vm-modules --no-warnings ../../../../node_modules/jest/bin/jest.js", + "test:ci:snap": "node --experimental-vm-modules --no-warnings ../../../../node_modules/jest/bin/jest.js -u" }, "keywords": [ "coveo", diff --git a/packages/ui/atomic/create-atomic-result-component/package.json b/packages/ui/atomic/create-atomic-result-component/package.json index 758b45b9c4..af7c830d9b 100644 --- a/packages/ui/atomic/create-atomic-result-component/package.json +++ b/packages/ui/atomic/create-atomic-result-component/package.json @@ -13,7 +13,8 @@ ], "scripts": { "release:phase1": "npx -p=@coveord/release npm-publish", - "test": "node --experimental-vm-modules --no-warnings ../../../../node_modules/jest/bin/jest.js" + "test": "node --experimental-vm-modules --no-warnings ../../../../node_modules/jest/bin/jest.js", + "test:ci:snap": "node --experimental-vm-modules --no-warnings ../../../../node_modules/jest/bin/jest.js -u" }, "keywords": [ "coveo", diff --git a/packages/ui/atomic/health-check/package.json b/packages/ui/atomic/health-check/package.json index e233629ec7..723920acf8 100644 --- a/packages/ui/atomic/health-check/package.json +++ b/packages/ui/atomic/health-check/package.json @@ -20,7 +20,8 @@ "pretest": "rimraf dist && tsc -b tsconfig.json", "test:unit": "jest --testPathIgnorePatterns=e2e", "test:e2e": "node --experimental-vm-modules --no-warnings ../../../../node_modules/jest/bin/jest.js --testPathPattern=e2e", - "test": "npm run test:unit && npm run test:e2e" + "test": "npm run test:unit && npm run test:e2e", + "test:ci:snap": "npm run test:unit -- -u && npm run test:e2e -- -u" }, "repository": { "type": "git", diff --git a/packages/ui/search-token-server/package.json b/packages/ui/search-token-server/package.json index c366d80d39..c12bdc1ed4 100644 --- a/packages/ui/search-token-server/package.json +++ b/packages/ui/search-token-server/package.json @@ -25,6 +25,7 @@ "scripts": { "start": "ts-node server.ts", "test": "jest", + "test:ci:snap": "jest -u", "release:phase1": "npx -p=@coveord/release npm-publish" }, "devDependencies": { diff --git a/utils/release/create-github-release.mjs b/utils/release/create-github-release.mjs index 31679496c5..d032042eb0 100644 --- a/utils/release/create-github-release.mjs +++ b/utils/release/create-github-release.mjs @@ -1,3 +1,5 @@ +#!/usr/bin/env node + import {readFileSync} from 'node:fs'; import {Octokit} from 'octokit'; import {createAppAuth} from '@octokit/auth-app'; @@ -15,7 +17,7 @@ const getCliChangelog = () => { const lastVersionChanges = changelog.split(versionH1Matcher)[1]; return lastVersionChanges.trim(); }; -async () => { +(async () => { //#region GitHub authentication const authSecrets = { appId: process.env.RELEASER_APP_ID, @@ -51,4 +53,4 @@ async () => { body: releaseBody, }); exportVariable('tag', cliLatestTag); -}; +})(); diff --git a/utils/release/git-publish-all.mjs b/utils/release/git-publish-all.mjs index 6ac6d58fec..0487622894 100755 --- a/utils/release/git-publish-all.mjs +++ b/utils/release/git-publish-all.mjs @@ -22,6 +22,8 @@ import { gitPublishBranch, gitSetRefOnCommit, gitPush, + gitSetupSshRemote, + gitSetupUser, } from '@coveo/semantic-monorepo-tools'; import {Octokit} from 'octokit'; import {createAppAuth} from '@octokit/auth-app'; @@ -31,97 +33,49 @@ import {dedent} from 'ts-dedent'; import {readFileSync, writeFileSync} from 'fs'; import {removeWriteAccessRestrictions} from './lock-master.mjs'; import {spawnSync} from 'child_process'; -const REPO_OWNER = 'coveo'; -const REPO_NAME = 'cli'; -const GIT_SSH_REMOTE = 'deploy'; -// Commit, tag and push -(async () => { - const PATH = '.'; - - //#region GitHub authentication - const authSecrets = { - appId: process.env.RELEASER_APP_ID, - privateKey: process.env.RELEASER_PRIVATE_KEY, - clientId: process.env.RELEASER_CLIENT_ID, - clientSecret: process.env.RELEASER_CLIENT_SECRET, - installationId: process.env.RELEASER_INSTALLATION_ID, - }; - - const octokit = new Octokit({ - authStrategy: createAppAuth, - auth: authSecrets, - }); - //#endregion - - // Define release # andversion - const currentVersionTag = getCurrentVersion(PATH); - currentVersionTag.inc('prerelease'); - const npmNewVersion = currentVersionTag.format(); - // Write release version in the root package.json - await npmBumpVersion(npmNewVersion, PATH); - - const releaseNumber = currentVersionTag.prerelease[0]; - const gitNewTag = `release-${releaseNumber}`; - - // Find all changes since last release and generate the changelog. - const versionPrefix = 'release-'; - const lastTag = await getLastTag(versionPrefix); - const commits = await getCommits(PATH, lastTag); - const convention = await angularChangelogConvention; - - let changelog = ''; - if (commits.length > 0) { - const parsedCommits = parseCommits(commits, convention.parserOpts); - changelog = await generateChangelog( - parsedCommits, - gitNewTag, - { - host: 'https://github.com', - owner: REPO_OWNER, - repository: REPO_NAME, - }, - convention.writerOpts - ); - await writeChangelog(PATH, changelog); +const setupGit = async () => { + const GIT_USERNAME = 'developer-experience-bot[bot]'; + const GIT_EMAIL = + '91079284+developer-experience-bot[bot]@users.noreply.github.com'; + const DEPLOY_KEY = process.env.DEPLOY_KEY; + if (DEPLOY_KEY === undefined) { + throw new Error('Deploy key is undefined'); } - updateRootReadme(); - - // Find all packages that have been released in this release. - const packagesReleased = readFileSync('.git-message', { - encoding: 'utf-8', - }).trim(); - // Compile git commit message - const commitMessage = dedent` - [version bump] chore(release): release ${gitNewTag} [skip ci] - - ${packagesReleased} + await gitSetupUser(GIT_USERNAME, GIT_EMAIL); + await gitSetupSshRemote(REPO_OWNER, REPO_NAME, DEPLOY_KEY, GIT_SSH_REMOTE); +}; - **/README.md - **/CHANGELOG.md - **/package.json - README.md - CHANGELOG.md - package.json - package-lock.json - packages/ui/cra-template/template.json - `; - - // Craft the commit (complex process, see function) - const commit = await commitChanges(releaseNumber, commitMessage, octokit); - - // Add the tags locally... - for (const tag of packagesReleased.split('\n').concat(gitNewTag)) { - await gitTag(tag, commit); +/** + * Update usage section at the root readme. + */ +function updateRootReadme() { + const usageRegExp = /^(.|\n)*$/m; + const cliReadme = readFileSync('packages/cli/core/README.md', 'utf-8'); + let rootReadme = readFileSync('README.md', 'utf-8'); + const cliUsage = usageRegExp.exec(cliReadme)?.[0]; + if (!cliUsage) { + return; } - // And push them - await gitPushTags(); + writeFileSync('README.md', rootReadme.replace(usageRegExp, cliUsage)); +} - // Unlock the main branch - await removeWriteAccessRestrictions(); -})(); +/** + * Append `.cmd` to the input if the runtime OS is Windows. + * @param {string|TemplateStringsArray} cmd + * @returns + */ +const appendCmdIfWindows = (cmd) => + `${cmd}${process.platform === 'win32' ? '.cmd' : ''}`; + +/** + * Run `npm run pre-commit` + */ +function runPrecommit() { + spawnSync(appendCmdIfWindows`npm`, ['run', 'pre-commit']); +} /** * "Craft" the signed release commit. @@ -182,32 +136,95 @@ async function commitChanges(releaseNumber, commitMessage, octokit) { return commit.data.sha; } -/** - * Update usage section at the root readme. - */ -function updateRootReadme() { - const usageRegExp = /^(.|\n)*$/m; - const cliReadme = readFileSync('packages/cli/core/README.md', 'utf-8'); - let rootReadme = readFileSync('README.md', 'utf-8'); - const cliUsage = usageRegExp.exec(cliReadme)?.[0]; - if (!cliUsage) { - return; - } - rootReadme.replace(usageRegExp, cliUsage); - writeFileSync('README.md', rootReadme); +const REPO_OWNER = 'coveo'; +const REPO_NAME = 'cli'; +const GIT_SSH_REMOTE = 'deploy'; + +// Commit, tag and push +const PATH = '.'; + +//#region GitHub authentication +const authSecrets = { + appId: process.env.RELEASER_APP_ID, + privateKey: process.env.RELEASER_PRIVATE_KEY, + clientId: process.env.RELEASER_CLIENT_ID, + clientSecret: process.env.RELEASER_CLIENT_SECRET, + installationId: process.env.RELEASER_INSTALLATION_ID, +}; + +const octokit = new Octokit({ + authStrategy: createAppAuth, + auth: authSecrets, +}); +//#endregion + +await setupGit(); + +// Define release # andversion +const currentVersionTag = getCurrentVersion(PATH); +currentVersionTag.inc('prerelease'); +const npmNewVersion = currentVersionTag.format(); +// Write release version in the root package.json +await npmBumpVersion(npmNewVersion, PATH); + +const releaseNumber = currentVersionTag.prerelease[0]; +const gitNewTag = `release-${releaseNumber}`; + +// Find all changes since last release and generate the changelog. +const versionPrefix = 'release-'; +const lastTag = await getLastTag(versionPrefix); +const commits = await getCommits(PATH, lastTag); +const convention = await angularChangelogConvention; + +let changelog = ''; +if (commits.length > 0) { + const parsedCommits = parseCommits(commits, convention.parserOpts); + changelog = await generateChangelog( + parsedCommits, + gitNewTag, + { + host: 'https://github.com', + owner: REPO_OWNER, + repository: REPO_NAME, + }, + convention.writerOpts + ); + await writeChangelog(PATH, changelog); } +updateRootReadme(); -/** - * Run `npm run pre-commit` - */ -function runPrecommit() { - spawnSync(appendCmdIfWindows`npm`, ['run', 'pre-commit']); +// Find all packages that have been released in this release. +const packagesReleased = readFileSync('.git-message', { + encoding: 'utf-8', +}).trim(); + +// Compile git commit message +const commitMessage = dedent` + [version bump] chore(release): release ${gitNewTag} [skip ci] + + ${packagesReleased} + + **/README.md + **/CHANGELOG.md + **/package.json + **/*.snap + README.md + CHANGELOG.md + package.json + package-lock.json + packages/ui/cra-template/template.json + `; + +// Craft the commit (complex process, see function) +const commit = await commitChanges(releaseNumber, commitMessage, octokit); + +// Add the tags locally... +for (const tag of packagesReleased.split('\n').concat(gitNewTag)) { + await gitTag(tag, commit); } -/** - * Append `.cmd` to the input if the runtime OS is Windows. - * @param {string|TemplateStringsArray} cmd - * @returns - */ -const appendCmdIfWindows = (cmd) => - `${cmd}${process.platform === 'win32' ? '.cmd' : ''}`; +// And push them +await gitPushTags(); + +// Unlock the main branch +await removeWriteAccessRestrictions(); diff --git a/utils/release/is-cli-release.mjs b/utils/release/is-cli-release.mjs index b4acb59c51..294be9cd9a 100644 --- a/utils/release/is-cli-release.mjs +++ b/utils/release/is-cli-release.mjs @@ -1,13 +1,13 @@ +#!/usr/bin/env node + import {readFileSync} from 'node:fs'; import {setOutput} from '@actions/core'; const CLI_PKG_MATCHER = /^@coveo\/cli@(?\d+\.\d+\.\d+)$/gm; -async () => { - const packagesReleased = readFileSync('.git-message', { - encoding: 'utf-8', - }).trim(); +const packagesReleased = readFileSync('.git-message', { + encoding: 'utf-8', +}).trim(); - // If `@coveo/cli` has not been released we should not build it etc. - const shouldReleaseCli = CLI_PKG_MATCHER.test(packagesReleased); - setOutput('shouldReleaseCli', shouldReleaseCli); -}; +// If `@coveo/cli` has not been released we should not build it etc. +const shouldReleaseCli = CLI_PKG_MATCHER.test(packagesReleased); +setOutput('shouldReleaseCli', shouldReleaseCli); From 909577554ada743587c2bddecc6e32598313d23a Mon Sep 17 00:00:00 2001 From: "developer-experience-bot[bot]" <91079284+developer-experience-bot[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 15:49:34 +0000 Subject: [PATCH 8/8] [version bump] chore(release): release release-19 [skip ci] @coveo/atomic-component-health-check@2.2.15 @coveo/create-atomic-component-project@1.2.15 @coveo/search-token-server@1.35.29 @coveo/cli-commons@2.7.15 @coveo/create-atomic-result-component@1.2.15 @coveo/create-atomic-component@1.2.15 @coveo/cra-template@1.38.15 @coveo/angular@1.36.6 @coveo/cli-plugin-source@2.1.15 @coveo/create-atomic@1.38.17 @coveo/cli@3.0.15 **/README.md **/CHANGELOG.md **/package.json **/*.snap README.md CHANGELOG.md package.json package-lock.json packages/ui/cra-template/template.json --- CHANGELOG.md | 24 ++ README.md | 2 +- .../tests/__snapshots__/test.spec.ts.snap | 391 ++++++++++++++++++ .../tests/__snapshots__/test.spec.ts.snap | 391 ++++++++++++++++++ .../src/e2e/__snapshots__/test.spec.ts.snap | 183 ++++++++ package-lock.json | 121 ++++-- package.json | 2 +- packages/cli-e2e/package.json | 2 +- packages/cli/commons/CHANGELOG.md | 6 + packages/cli/commons/package.json | 2 +- packages/cli/core/CHANGELOG.md | 23 ++ packages/cli/core/README.md | 242 +++++++++-- packages/cli/core/package.json | 20 +- packages/cli/source/CHANGELOG.md | 8 + packages/cli/source/package.json | 4 +- packages/ui/angular/CHANGELOG.md | 2 + packages/ui/angular/package.json | 4 +- .../CHANGELOG.md | 6 + .../package.json | 2 +- .../create-atomic-component/CHANGELOG.md | 6 + .../create-atomic-component/package.json | 4 +- .../components/sample-component/package.json | 2 +- .../CHANGELOG.md | 6 + .../package.json | 4 +- .../sample-result-component/package.json | 2 +- packages/ui/atomic/create-atomic/package.json | 2 +- packages/ui/atomic/health-check/CHANGELOG.md | 6 + packages/ui/atomic/health-check/package.json | 2 +- packages/ui/atomic/template/package.json | 2 +- packages/ui/cra-template/CHANGELOG.md | 8 + packages/ui/cra-template/package.json | 4 +- packages/ui/cra-template/template.json | 2 +- packages/ui/search-token-server/CHANGELOG.md | 2 + packages/ui/search-token-server/package.json | 2 +- utils/release/create-github-release.mjs | 0 utils/release/is-cli-release.mjs | 0 36 files changed, 1401 insertions(+), 88 deletions(-) create mode 100644 create-atomic-component/tests/__snapshots__/test.spec.ts.snap create mode 100644 create-atomic-result-component/tests/__snapshots__/test.spec.ts.snap create mode 100644 health-check/src/e2e/__snapshots__/test.spec.ts.snap mode change 100644 => 100755 utils/release/create-github-release.mjs mode change 100644 => 100755 utils/release/is-cli-release.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a98125021..d6a0497b74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +# release-19 (2023-10-27) + +### Bug Fixes + +- only diff json files ([#1323](https://github.com/coveo/cli/issues/1323)) ([ae1361a](https://github.com/coveo/cli/commits/ae1361a4ca0f553103349ca436a309c61aa56732)) + +### Features + +- add organization to event props ([#1325](https://github.com/coveo/cli/issues/1325)) ([3afcd0f](https://github.com/coveo/cli/commits/3afcd0f78112de9eae8f91218be3df01757f8d3e)) +- **cli:** change node support to 18.18.1 ([#1332](https://github.com/coveo/cli/issues/1332)) ([54c6937](https://github.com/coveo/cli/commits/54c6937829685e1af20949f082b2de484fa1f6c6)) +- **cli:** change node support to only 18-20 ([#1335](https://github.com/coveo/cli/issues/1335)) ([3e65207](https://github.com/coveo/cli/commits/3e6520737650901d2b176fadc8e2e56441a8d4da)) +- **cli:** deprecate config:set region and environment ([#1331](https://github.com/coveo/cli/issues/1331)) ([341d5a7](https://github.com/coveo/cli/commits/341d5a70ab92c492ff653242dabf50f154192710)) +- **cli:** node 20.9.0 lts ([#1337](https://github.com/coveo/cli/issues/1337)) ([af1c3ac](https://github.com/coveo/cli/commits/af1c3ac1796bdfd534b5d037f3a42e23aa3ab225)) +- **cli:** use hidden prompt or stdin for auth:token command ([#1334](https://github.com/coveo/cli/issues/1334)) ([012b6a4](https://github.com/coveo/cli/commits/012b6a45adc474f1d10a8adf5a881eb9faf5e6e8)) +- support imports from `/headless` ([#1326](https://github.com/coveo/cli/issues/1326)) ([d24bec4](https://github.com/coveo/cli/commits/d24bec48e5050ffdbba406fe130a7f7a83ca9b95)) + +### BREAKING CHANGES + +- **cli:** those flags are no longer supported by the cli and the + alternative is to re-execute a login flow with auth:login + +This change is part of the effort for the next major release of the CLI +(v3) + # release-18 (2023-08-24) ### Bug Fixes diff --git a/README.md b/README.md index 99362dfb17..705760fb62 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ $ npm install -g @coveo/cli $ coveo COMMAND running command... $ coveo (--version) -@coveo/cli/2.2.0 linux-x64 node-v18.12.1 +@coveo/cli/3.0.15 linux-x64 node-v20.9.0 $ coveo --help [COMMAND] USAGE $ coveo COMMAND diff --git a/create-atomic-component/tests/__snapshots__/test.spec.ts.snap b/create-atomic-component/tests/__snapshots__/test.spec.ts.snap new file mode 100644 index 0000000000..b56cab3e3a --- /dev/null +++ b/create-atomic-component/tests/__snapshots__/test.spec.ts.snap @@ -0,0 +1,391 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`@coveo/create-atomic-component when called in an existing project when initializing should ouptut a confirmation message upon success 1`] = ` +" + Project successfully configured + + We suggest that you begin by typing: + + $ npm install + $ npm start + + $ npm start + Starts the development server. + + $ npm run build + Builds your project in production mode. + + Happy coding! + + Further reading: + https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components + +" +`; + +exports[`@coveo/create-atomic-component when called in an existing project when initializing should setup a base project and a component 1`] = ` +HashedFolder { + "children": [ + HashedFile { + "hash": "On2XOtGKsiCQNf3sl4iW9KMVbUE=", + "name": "package.json", + }, + HashedFile { + "hash": "dk1NzEu4Fb2ZY6TKzt21xMFvc2c=", + "name": "readme.md", + }, + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFile { + "hash": "ewQGf3/bnIIj+Rv249cv7K7YGsg=", + "name": "stencil-docs.d.ts", + }, + ], + "hash": "OzYoobNX1XCpcFrvvtsD00f4Rwg=", + "name": "docs", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "/5yLi44o1uyQViLBqN4GTX4Wifo=", + "name": "cdn.js", + }, + HashedFile { + "hash": "/5yLi44o1uyQViLBqN4GTX4Wifo=", + "name": "index.cjs.js", + }, + HashedFile { + "hash": "BHkYREiqjkQizanFWrHUH+O5/HI=", + "name": "index.d.ts", + }, + HashedFile { + "hash": "AVg2xEIhlYFa1JdLuHECP4RcRwg=", + "name": "index.es2017.js", + }, + HashedFile { + "hash": "orpFM4J34T2gX7c3vGiovp0rdxM=", + "name": "index.js", + }, + HashedFile { + "hash": "WNqwx6y7/TKh0xE/ENZlA00Dy/g=", + "name": "package.json", + }, + ], + "hash": "sWhaIzdNtSJjLJC7gUXMjbEJdx0=", + "name": "loader", + }, + HashedFile { + "hash": "sPYtbu6I3ccGfKbCoXGFIB4KHTo=", + "name": "package.json", + }, + HashedFile { + "hash": "0paD+lp3fCIv4J/d+YrJ6gkGSbo=", + "name": "readme.md", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "qJnWpbM0djxX/iTkEr7sFyWoEKE=", + "name": "components.d.ts", + }, + HashedFile { + "hash": "XemX7AoOihA4SgQsvWtcStjeiGo=", + "name": "oh-wow-another-component-can-you-believe-it.css", + }, + HashedFile { + "hash": "/LJZFrH80JVNAGsx3FvxhArXJss=", + "name": "oh-wow-another-component-can-you-believe-it.tsx", + }, + ], + "hash": "hn8xJ8lZaPPvjQFOUvWFX55LlDc=", + "name": "src", + }, + HashedFile { + "hash": "DNTPZTeWJfCjTGqD+edK5gP5vUM=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "FrfYsEH74ln6VgpDwNHlSHLZMqA=", + "name": "oh-wow-another-component-can-you-believe-it", + }, + ], + "hash": "K7acc/8RH7arWHNePKbmHUcPJTs=", + "name": "components", + }, + HashedFile { + "hash": "YVuwXfIZfjfeVyLQ6cMy3kUqC3A=", + "name": "html.d.ts", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "L08E7dMK5e0wD5P8meKHfkDDa3o=", + "name": "index.css", + }, + HashedFile { + "hash": "bFh3SmB411lXkJIWZnTDWhG9rfI=", + "name": "index.html", + }, + HashedFile { + "hash": "tGVlR0ig5LSS79ZPOfuAFDEvqMw=", + "name": "index.ts", + }, + ], + "hash": "qEEOwUr4MvYxD5CwMtkP/VqUL8Q=", + "name": "pages", + }, + ], + "hash": "dDomUvCRWep4ytwIQHxYFtOsQ3o=", + "name": "src", + }, + HashedFile { + "hash": "BVZfiCzL+2kulE12K4HLAIl3kJ8=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "DNANdCMVjEkGCg0jZoJBiRE3pF8=", + "name": "no-args", +} +`; + +exports[`@coveo/create-atomic-component when called with a valid component name when initializing should ouptut a confirmation message upon success 1`] = ` +" + Project successfully configured + + We suggest that you begin by typing: + + $ npm install + $ npm start + + $ npm start + Starts the development server. + + $ npm run build + Builds your project in production mode. + + Happy coding! + + Further reading: + https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components + +" +`; + +exports[`@coveo/create-atomic-component when called with a valid component name when initializing should setup a base project and a component 1`] = ` +HashedFolder { + "children": [ + HashedFile { + "hash": "On2XOtGKsiCQNf3sl4iW9KMVbUE=", + "name": "package.json", + }, + HashedFile { + "hash": "dk1NzEu4Fb2ZY6TKzt21xMFvc2c=", + "name": "readme.md", + }, + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFile { + "hash": "WNXSePDB0rxKykx0pmIcvvXf8lY=", + "name": "package.json", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "XemX7AoOihA4SgQsvWtcStjeiGo=", + "name": "valid-component-name.css", + }, + HashedFile { + "hash": "mSEayrhdQLFyjWOgicX78wD8seE=", + "name": "valid-component-name.tsx", + }, + ], + "hash": "TLrPzQ215bJQgHPDj+8uidPXAqo=", + "name": "src", + }, + HashedFile { + "hash": "DNTPZTeWJfCjTGqD+edK5gP5vUM=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "OdOjUj6sQOlaJZL0xMsHtkmhLEM=", + "name": "valid-component-name", + }, + ], + "hash": "pusjYN5OIG2nxlphCimdO2MRZoA=", + "name": "components", + }, + HashedFile { + "hash": "YVuwXfIZfjfeVyLQ6cMy3kUqC3A=", + "name": "html.d.ts", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "L08E7dMK5e0wD5P8meKHfkDDa3o=", + "name": "index.css", + }, + HashedFile { + "hash": "bFh3SmB411lXkJIWZnTDWhG9rfI=", + "name": "index.html", + }, + HashedFile { + "hash": "tGVlR0ig5LSS79ZPOfuAFDEvqMw=", + "name": "index.ts", + }, + ], + "hash": "qEEOwUr4MvYxD5CwMtkP/VqUL8Q=", + "name": "pages", + }, + ], + "hash": "mfttHUbisEc5o1agWYdOGHcyMbM=", + "name": "src", + }, + HashedFile { + "hash": "BVZfiCzL+2kulE12K4HLAIl3kJ8=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "SjnhBdGoPcwxrzS0znwq8DkPeKE=", + "name": "valid-arg", +} +`; + +exports[`@coveo/create-atomic-component when called without any args when initializing should ouptut a confirmation message upon success 1`] = ` +" + Project successfully configured + + We suggest that you begin by typing: + + $ npm install + $ npm start + + $ npm start + Starts the development server. + + $ npm run build + Builds your project in production mode. + + Happy coding! + + Further reading: + https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components + +" +`; + +exports[`@coveo/create-atomic-component when called without any args when initializing should setup a base project and a component 1`] = ` +HashedFolder { + "children": [ + HashedFile { + "hash": "On2XOtGKsiCQNf3sl4iW9KMVbUE=", + "name": "package.json", + }, + HashedFile { + "hash": "dk1NzEu4Fb2ZY6TKzt21xMFvc2c=", + "name": "readme.md", + }, + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFile { + "hash": "YtYrF1uzndR/VQF5Zq9TNFRZFaQ=", + "name": "package.json", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "XemX7AoOihA4SgQsvWtcStjeiGo=", + "name": "sample-component.css", + }, + HashedFile { + "hash": "aeXDp+lsWoSvRwNcTKnynVf/9bk=", + "name": "sample-component.tsx", + }, + ], + "hash": "1fEyvhZ1KbN3o1NA6j8h5U8u3EM=", + "name": "src", + }, + HashedFile { + "hash": "DNTPZTeWJfCjTGqD+edK5gP5vUM=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "3NoNGgDXggN9aKRNQdioGEpwUas=", + "name": "sample-component", + }, + ], + "hash": "etih1u8llZ5RQYnPBgmJoGyNPr0=", + "name": "components", + }, + HashedFile { + "hash": "YVuwXfIZfjfeVyLQ6cMy3kUqC3A=", + "name": "html.d.ts", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "L08E7dMK5e0wD5P8meKHfkDDa3o=", + "name": "index.css", + }, + HashedFile { + "hash": "bFh3SmB411lXkJIWZnTDWhG9rfI=", + "name": "index.html", + }, + HashedFile { + "hash": "tGVlR0ig5LSS79ZPOfuAFDEvqMw=", + "name": "index.ts", + }, + ], + "hash": "qEEOwUr4MvYxD5CwMtkP/VqUL8Q=", + "name": "pages", + }, + ], + "hash": "VL0oxdo/RF+Bjsa1as6+XaL+kyM=", + "name": "src", + }, + HashedFile { + "hash": "BVZfiCzL+2kulE12K4HLAIl3kJ8=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "AgyflBDej8gMqDjYhorG5nuVSY4=", + "name": "no-args", +} +`; diff --git a/create-atomic-result-component/tests/__snapshots__/test.spec.ts.snap b/create-atomic-result-component/tests/__snapshots__/test.spec.ts.snap new file mode 100644 index 0000000000..4990a9932b --- /dev/null +++ b/create-atomic-result-component/tests/__snapshots__/test.spec.ts.snap @@ -0,0 +1,391 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`@coveo/create-atomic-result-component when called in an existing project when initializing should ouptut a confirmation message upon success 1`] = ` +" + Project successfully configured + + We suggest that you begin by typing: + + $ npm install + $ npm start + + $ npm start + Starts the development server. + + $ npm run build + Builds your project in production mode. + + Happy coding! + + Further reading: + https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components + +" +`; + +exports[`@coveo/create-atomic-result-component when called in an existing project when initializing should setup a base project and a component 1`] = ` +HashedFolder { + "children": [ + HashedFile { + "hash": "On2XOtGKsiCQNf3sl4iW9KMVbUE=", + "name": "package.json", + }, + HashedFile { + "hash": "dk1NzEu4Fb2ZY6TKzt21xMFvc2c=", + "name": "readme.md", + }, + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFile { + "hash": "ewQGf3/bnIIj+Rv249cv7K7YGsg=", + "name": "stencil-docs.d.ts", + }, + ], + "hash": "OzYoobNX1XCpcFrvvtsD00f4Rwg=", + "name": "docs", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "/5yLi44o1uyQViLBqN4GTX4Wifo=", + "name": "cdn.js", + }, + HashedFile { + "hash": "/5yLi44o1uyQViLBqN4GTX4Wifo=", + "name": "index.cjs.js", + }, + HashedFile { + "hash": "BHkYREiqjkQizanFWrHUH+O5/HI=", + "name": "index.d.ts", + }, + HashedFile { + "hash": "AVg2xEIhlYFa1JdLuHECP4RcRwg=", + "name": "index.es2017.js", + }, + HashedFile { + "hash": "orpFM4J34T2gX7c3vGiovp0rdxM=", + "name": "index.js", + }, + HashedFile { + "hash": "WNqwx6y7/TKh0xE/ENZlA00Dy/g=", + "name": "package.json", + }, + ], + "hash": "sWhaIzdNtSJjLJC7gUXMjbEJdx0=", + "name": "loader", + }, + HashedFile { + "hash": "y4kuWHgmKIIXIPP4Yeo6RNvl8Ss=", + "name": "package.json", + }, + HashedFile { + "hash": "xP4FebG8AhkGm5G5892sV4YgrI4=", + "name": "readme.md", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "EpKK14CXyjrSNQsuEEKqSalxDxE=", + "name": "components.d.ts", + }, + HashedFile { + "hash": "0kZk+nhPZP6DNXEt1ds/y13pPn4=", + "name": "oh-wow-another-component-can-you-believe-it.css", + }, + HashedFile { + "hash": "I+1b5N1kyPbt/73pkZi5tRoAt68=", + "name": "oh-wow-another-component-can-you-believe-it.tsx", + }, + ], + "hash": "gYxTB9Ls/8KoSIKVfo4JXCBd0kA=", + "name": "src", + }, + HashedFile { + "hash": "DNTPZTeWJfCjTGqD+edK5gP5vUM=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "cIH6wt4RyfxVF3Y6Dg5x1SRULBA=", + "name": "oh-wow-another-component-can-you-believe-it", + }, + ], + "hash": "5LvJ3rlfStpc5ImGjvcWBG5N1og=", + "name": "components", + }, + HashedFile { + "hash": "YVuwXfIZfjfeVyLQ6cMy3kUqC3A=", + "name": "html.d.ts", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "L08E7dMK5e0wD5P8meKHfkDDa3o=", + "name": "index.css", + }, + HashedFile { + "hash": "bFh3SmB411lXkJIWZnTDWhG9rfI=", + "name": "index.html", + }, + HashedFile { + "hash": "tGVlR0ig5LSS79ZPOfuAFDEvqMw=", + "name": "index.ts", + }, + ], + "hash": "qEEOwUr4MvYxD5CwMtkP/VqUL8Q=", + "name": "pages", + }, + ], + "hash": "3ucePTtOG8Lq1ldJbu4QqwNWuWE=", + "name": "src", + }, + HashedFile { + "hash": "BVZfiCzL+2kulE12K4HLAIl3kJ8=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "BdE/jZhm4dOj4jwBJ3nSA5Vvvys=", + "name": "no-args", +} +`; + +exports[`@coveo/create-atomic-result-component when called with a valid component name when initializing should ouptut a confirmation message upon success 1`] = ` +" + Project successfully configured + + We suggest that you begin by typing: + + $ npm install + $ npm start + + $ npm start + Starts the development server. + + $ npm run build + Builds your project in production mode. + + Happy coding! + + Further reading: + https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components + +" +`; + +exports[`@coveo/create-atomic-result-component when called with a valid component name when initializing should setup a base project and a component 1`] = ` +HashedFolder { + "children": [ + HashedFile { + "hash": "On2XOtGKsiCQNf3sl4iW9KMVbUE=", + "name": "package.json", + }, + HashedFile { + "hash": "dk1NzEu4Fb2ZY6TKzt21xMFvc2c=", + "name": "readme.md", + }, + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFile { + "hash": "TsYMWL2vEfN/Css0EnNr+FboO38=", + "name": "package.json", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "0kZk+nhPZP6DNXEt1ds/y13pPn4=", + "name": "valid-component-name.css", + }, + HashedFile { + "hash": "ShFXwot8XbCjD/A7x/1LQ0+hYI4=", + "name": "valid-component-name.tsx", + }, + ], + "hash": "pFuu6S9wb+y09faE9Lxub6t+cfY=", + "name": "src", + }, + HashedFile { + "hash": "DNTPZTeWJfCjTGqD+edK5gP5vUM=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "5sJjww11rRZ4IWddpxlYramSviU=", + "name": "valid-component-name", + }, + ], + "hash": "Ch4M26OnLxd9fkyBZ07ynwGOb+8=", + "name": "components", + }, + HashedFile { + "hash": "YVuwXfIZfjfeVyLQ6cMy3kUqC3A=", + "name": "html.d.ts", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "L08E7dMK5e0wD5P8meKHfkDDa3o=", + "name": "index.css", + }, + HashedFile { + "hash": "bFh3SmB411lXkJIWZnTDWhG9rfI=", + "name": "index.html", + }, + HashedFile { + "hash": "tGVlR0ig5LSS79ZPOfuAFDEvqMw=", + "name": "index.ts", + }, + ], + "hash": "qEEOwUr4MvYxD5CwMtkP/VqUL8Q=", + "name": "pages", + }, + ], + "hash": "wJTmvZEH0W87KuuNzKyuHp9lwaA=", + "name": "src", + }, + HashedFile { + "hash": "BVZfiCzL+2kulE12K4HLAIl3kJ8=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "JhBae+scXj5VDo4lpqteAya9cHg=", + "name": "valid-arg", +} +`; + +exports[`@coveo/create-atomic-result-component when called without any args when initializing should ouptut a confirmation message upon success 1`] = ` +" + Project successfully configured + + We suggest that you begin by typing: + + $ npm install + $ npm start + + $ npm start + Starts the development server. + + $ npm run build + Builds your project in production mode. + + Happy coding! + + Further reading: + https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components + +" +`; + +exports[`@coveo/create-atomic-result-component when called without any args when initializing should setup a base project and a component 1`] = ` +HashedFolder { + "children": [ + HashedFile { + "hash": "On2XOtGKsiCQNf3sl4iW9KMVbUE=", + "name": "package.json", + }, + HashedFile { + "hash": "dk1NzEu4Fb2ZY6TKzt21xMFvc2c=", + "name": "readme.md", + }, + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFile { + "hash": "oUhPvSkp9OH95cFwZqdW7WycZ7Q=", + "name": "package.json", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "0kZk+nhPZP6DNXEt1ds/y13pPn4=", + "name": "sample-result-component.css", + }, + HashedFile { + "hash": "DMYROzP/GYB/aoia+R5JUflx37w=", + "name": "sample-result-component.tsx", + }, + ], + "hash": "zQmeniXwoag2rYtOWGtLO1oiwlQ=", + "name": "src", + }, + HashedFile { + "hash": "DNTPZTeWJfCjTGqD+edK5gP5vUM=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "D35EqcZ0S4b3jLtwk1eQHmlViYc=", + "name": "sample-result-component", + }, + ], + "hash": "v0FhcXKGx+MykpZOkOq8iDv3+fo=", + "name": "components", + }, + HashedFile { + "hash": "YVuwXfIZfjfeVyLQ6cMy3kUqC3A=", + "name": "html.d.ts", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "L08E7dMK5e0wD5P8meKHfkDDa3o=", + "name": "index.css", + }, + HashedFile { + "hash": "bFh3SmB411lXkJIWZnTDWhG9rfI=", + "name": "index.html", + }, + HashedFile { + "hash": "tGVlR0ig5LSS79ZPOfuAFDEvqMw=", + "name": "index.ts", + }, + ], + "hash": "qEEOwUr4MvYxD5CwMtkP/VqUL8Q=", + "name": "pages", + }, + ], + "hash": "yszWNJG5nNw0+tVvVumxLM5UTVQ=", + "name": "src", + }, + HashedFile { + "hash": "BVZfiCzL+2kulE12K4HLAIl3kJ8=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "hr677eW1n629xuO9j0YJLdPNGRo=", + "name": "no-args", +} +`; diff --git a/health-check/src/e2e/__snapshots__/test.spec.ts.snap b/health-check/src/e2e/__snapshots__/test.spec.ts.snap new file mode 100644 index 0000000000..70cbd24386 --- /dev/null +++ b/health-check/src/e2e/__snapshots__/test.spec.ts.snap @@ -0,0 +1,183 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`@coveo/atomic-component-health-check @coveo/create-atomic-component should initialize a base project and a component 1`] = ` +HashedFolder { + "children": [ + HashedFile { + "hash": "On2XOtGKsiCQNf3sl4iW9KMVbUE=", + "name": "package.json", + }, + HashedFile { + "hash": "dk1NzEu4Fb2ZY6TKzt21xMFvc2c=", + "name": "readme.md", + }, + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFile { + "hash": "WNXSePDB0rxKykx0pmIcvvXf8lY=", + "name": "package.json", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "XemX7AoOihA4SgQsvWtcStjeiGo=", + "name": "valid-component-name.css", + }, + HashedFile { + "hash": "mSEayrhdQLFyjWOgicX78wD8seE=", + "name": "valid-component-name.tsx", + }, + ], + "hash": "TLrPzQ215bJQgHPDj+8uidPXAqo=", + "name": "src", + }, + HashedFile { + "hash": "DNTPZTeWJfCjTGqD+edK5gP5vUM=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "OdOjUj6sQOlaJZL0xMsHtkmhLEM=", + "name": "valid-component-name", + }, + ], + "hash": "pusjYN5OIG2nxlphCimdO2MRZoA=", + "name": "components", + }, + HashedFile { + "hash": "YVuwXfIZfjfeVyLQ6cMy3kUqC3A=", + "name": "html.d.ts", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "L08E7dMK5e0wD5P8meKHfkDDa3o=", + "name": "index.css", + }, + HashedFile { + "hash": "bFh3SmB411lXkJIWZnTDWhG9rfI=", + "name": "index.html", + }, + HashedFile { + "hash": "tGVlR0ig5LSS79ZPOfuAFDEvqMw=", + "name": "index.ts", + }, + ], + "hash": "qEEOwUr4MvYxD5CwMtkP/VqUL8Q=", + "name": "pages", + }, + ], + "hash": "mfttHUbisEc5o1agWYdOGHcyMbM=", + "name": "src", + }, + HashedFile { + "hash": "BVZfiCzL+2kulE12K4HLAIl3kJ8=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "SjnhBdGoPcwxrzS0znwq8DkPeKE=", + "name": "create-atomic-component", +} +`; + +exports[`@coveo/atomic-component-health-check @coveo/create-atomic-result-component should initialize a base project and a component 1`] = ` +HashedFolder { + "children": [ + HashedFile { + "hash": "On2XOtGKsiCQNf3sl4iW9KMVbUE=", + "name": "package.json", + }, + HashedFile { + "hash": "dk1NzEu4Fb2ZY6TKzt21xMFvc2c=", + "name": "readme.md", + }, + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFolder { + "children": [ + HashedFile { + "hash": "TsYMWL2vEfN/Css0EnNr+FboO38=", + "name": "package.json", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "0kZk+nhPZP6DNXEt1ds/y13pPn4=", + "name": "valid-component-name.css", + }, + HashedFile { + "hash": "ShFXwot8XbCjD/A7x/1LQ0+hYI4=", + "name": "valid-component-name.tsx", + }, + ], + "hash": "pFuu6S9wb+y09faE9Lxub6t+cfY=", + "name": "src", + }, + HashedFile { + "hash": "DNTPZTeWJfCjTGqD+edK5gP5vUM=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "5sJjww11rRZ4IWddpxlYramSviU=", + "name": "valid-component-name", + }, + ], + "hash": "Ch4M26OnLxd9fkyBZ07ynwGOb+8=", + "name": "components", + }, + HashedFile { + "hash": "YVuwXfIZfjfeVyLQ6cMy3kUqC3A=", + "name": "html.d.ts", + }, + HashedFolder { + "children": [ + HashedFile { + "hash": "L08E7dMK5e0wD5P8meKHfkDDa3o=", + "name": "index.css", + }, + HashedFile { + "hash": "bFh3SmB411lXkJIWZnTDWhG9rfI=", + "name": "index.html", + }, + HashedFile { + "hash": "tGVlR0ig5LSS79ZPOfuAFDEvqMw=", + "name": "index.ts", + }, + ], + "hash": "qEEOwUr4MvYxD5CwMtkP/VqUL8Q=", + "name": "pages", + }, + ], + "hash": "wJTmvZEH0W87KuuNzKyuHp9lwaA=", + "name": "src", + }, + HashedFile { + "hash": "BVZfiCzL+2kulE12K4HLAIl3kJ8=", + "name": "stencil.config.ts", + }, + HashedFile { + "hash": "yMxJnSeOFw52ObOJrKQEh86v+HM=", + "name": "tsconfig.json", + }, + ], + "hash": "JhBae+scXj5VDo4lpqteAya9cHg=", + "name": "create-atomic-result-component", +} +`; diff --git a/package-lock.json b/package-lock.json index 83a30a4e08..14648387d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cli-tools", - "version": "1.0.0-18", + "version": "1.0.0-19", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cli-tools", - "version": "1.0.0-18", + "version": "1.0.0-19", "hasInstallScript": true, "license": "Apache-2.0", "workspaces": [ @@ -145,6 +145,20 @@ "node": ">=10" } }, + "node_modules/@amplitude/node": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@amplitude/node/-/node-1.10.2.tgz", + "integrity": "sha512-E3xp8DOpkF5ThjrRlAmSocnrEYsTPpd3Zg4WdBLms0ackQSgQpw6z84+YMcoPerZHJJ/LEqdo4Cg4Z5Za3D+3Q==", + "dependencies": { + "@amplitude/identify": "^1.10.2", + "@amplitude/types": "^1.10.2", + "@amplitude/utils": "^1.10.2", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@amplitude/types": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/@amplitude/types/-/types-1.10.2.tgz", @@ -30572,7 +30586,7 @@ "@babel/core": "7.21.5", "@babel/preset-env": "7.21.5", "@babel/preset-typescript": "7.21.5", - "@coveo/cli": "2.6.2", + "@coveo/cli": "3.0.15", "@coveo/platform-client": "44.1.0", "abortcontroller-polyfill": "1.7.5", "async-retry": "1.3.3", @@ -30613,9 +30627,58 @@ "node": ">=18" } }, + "packages/cli-e2e/node_modules/@coveo/cli-commons": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@coveo/cli-commons/-/cli-commons-2.6.0.tgz", + "integrity": "sha512-fHO1RIQFkeCQxAoyMJtrICX3j3cEuf5khTEtG57hSLpK1P7ewmxC8+S+URivwKKGvvgJyRe2y76bsZR6uPod/w==", + "dependencies": { + "@amplitude/node": "1.10.2", + "@coveo/platform-client": "44.1.0", + "@oclif/core": "1.24.0", + "abortcontroller-polyfill": "1.7.5", + "chalk": "4.1.2", + "fs-extra": "11.1.1", + "https-proxy-agent": "5.0.1", + "is-ci": "3.0.1", + "isomorphic-fetch": "3.0.0", + "npm-package-arg": "10.1.0", + "semver": "7.5.2", + "ts-dedent": "2.2.0" + } + }, + "packages/cli-e2e/node_modules/@coveo/cli-plugin-source": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@coveo/cli-plugin-source/-/cli-plugin-source-2.0.12.tgz", + "integrity": "sha512-imjrAa73rNg6d99z74I//tzAE5aY5L2uZ/YDLSWUHW8NjCHXpwjdXEx9gu2+ozrLwTpoOp0IGnHYHI3mdNAq6w==", + "dependencies": { + "@coveo/cli-commons": "2.6.0", + "@coveo/platform-client": "44.1.0", + "@coveo/push-api-client": "3.1.15", + "@oclif/core": "1.24.0", + "@oclif/plugin-help": "5.1.23", + "@oclif/plugin-plugins": "2.1.12", + "chalk": "4.1.2", + "jsonschema": "1.4.1", + "ts-dedent": "2.2.0" + }, + "engines": { + "node": "^16.13.0 || ^18.12.0" + } + }, + "packages/cli-e2e/node_modules/is-ci": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", + "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", + "dependencies": { + "ci-info": "^3.2.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, "packages/cli/commons": { "name": "@coveo/cli-commons", - "version": "2.6.0", + "version": "2.7.15", "license": "Apache-2.0", "dependencies": { "@amplitude/analytics-node": "^1.3.3", @@ -30674,13 +30737,13 @@ }, "packages/cli/core": { "name": "@coveo/cli", - "version": "2.6.2", + "version": "3.0.15", "license": "Apache-2.0", "dependencies": { "@amplitude/analytics-node": "^1.3.3", "@amplitude/identify": "^1.9.0", - "@coveo/cli-commons": "2.6.0", - "@coveo/cli-plugin-source": "2.0.12", + "@coveo/cli-commons": "2.7.15", + "@coveo/cli-plugin-source": "2.1.15", "@coveo/platform-client": "44.1.0", "@oclif/core": "1.24.0", "@oclif/plugin-help": "5.1.23", @@ -30716,14 +30779,14 @@ "@amplitude/analytics-types": "^2.1.2", "@amplitude/types": "1.10.2", "@babel/core": "7.21.5", - "@coveo/angular": "1.36.0", - "@coveo/atomic-component-health-check": "2.1.2", + "@coveo/angular": "1.36.6", + "@coveo/atomic-component-health-check": "2.2.15", "@coveo/cli-commons-dev": "6.0.6", - "@coveo/cra-template": "1.37.0", - "@coveo/create-atomic": "1.38.1", - "@coveo/create-atomic-component": "1.1.2", - "@coveo/create-atomic-component-project": "1.1.0", - "@coveo/create-atomic-result-component": "1.1.2", + "@coveo/cra-template": "1.38.15", + "@coveo/create-atomic": "1.38.17", + "@coveo/create-atomic-component": "1.2.15", + "@coveo/create-atomic-component-project": "1.2.15", + "@coveo/create-atomic-result-component": "1.2.15", "@coveo/create-headless-vue": "1.2.0", "@oclif/test": "2.2.21", "@types/archiver": "5.3.2", @@ -30771,10 +30834,10 @@ }, "packages/cli/source": { "name": "@coveo/cli-plugin-source", - "version": "2.0.12", + "version": "2.1.15", "license": "Apache-2.0", "dependencies": { - "@coveo/cli-commons": "2.6.0", + "@coveo/cli-commons": "2.7.15", "@coveo/platform-client": "44.1.0", "@coveo/push-api-client": "3.1.15", "@oclif/core": "1.24.0", @@ -30808,14 +30871,14 @@ }, "packages/ui/angular": { "name": "@coveo/angular", - "version": "1.36.0", + "version": "1.36.6", "license": "Apache-2.0", "dependencies": { "@angular-devkit/core": "^15.0.0", "@angular-devkit/schematics": "^15.0.0", "@angular/cdk": "^15.0.0", "@angular/cli": "^15.0.0", - "@coveo/search-token-server": "1.35.23", + "@coveo/search-token-server": "1.35.29", "@schematics/angular": "^15.0.0", "jest-config": "29.5.0" }, @@ -30838,7 +30901,7 @@ }, "packages/ui/atomic/create-atomic": { "name": "@coveo/create-atomic", - "version": "1.38.1", + "version": "1.38.17", "license": "Apache-2.0", "dependencies": { "@coveo/platform-client": "44.1.0", @@ -30862,10 +30925,10 @@ }, "packages/ui/atomic/create-atomic-component": { "name": "@coveo/create-atomic-component", - "version": "1.1.2", + "version": "1.2.15", "license": "Apache-2.0", "dependencies": { - "@coveo/create-atomic-component-project": "1.1.0" + "@coveo/create-atomic-component-project": "1.2.15" }, "bin": { "create-atomic-component": "index.js" @@ -30888,7 +30951,7 @@ }, "packages/ui/atomic/create-atomic-component-project": { "name": "@coveo/create-atomic-component-project", - "version": "1.1.0", + "version": "1.2.15", "license": "Apache-2.0", "bin": { "create-atomic-component-project": "index.js" @@ -30918,10 +30981,10 @@ }, "packages/ui/atomic/create-atomic-result-component": { "name": "@coveo/create-atomic-result-component", - "version": "1.1.2", + "version": "1.2.15", "license": "Apache-2.0", "dependencies": { - "@coveo/create-atomic-component-project": "1.1.0" + "@coveo/create-atomic-component-project": "1.2.15" }, "bin": { "create-atomic-result-component": "index.js" @@ -31197,7 +31260,7 @@ }, "packages/ui/atomic/health-check": { "name": "@coveo/atomic-component-health-check", - "version": "2.1.2", + "version": "2.2.15", "license": "Apache-2.0", "dependencies": { "chalk": "4.1.2", @@ -31221,7 +31284,7 @@ }, "packages/ui/atomic/template": { "name": "@coveo/create-atomic-template", - "version": "1.39.1", + "version": "1.40.0", "dependencies": { "@coveo/atomic": "2.25.2", "@coveo/headless": "2.13.1", @@ -31238,14 +31301,14 @@ }, "packages/ui/cra-template": { "name": "@coveo/cra-template", - "version": "1.37.0", + "version": "1.38.15", "license": "Apache-2.0", "dependencies": { "fs-extra": "11.1.1" }, "devDependencies": { "@coveo/headless": "latest", - "@coveo/search-token-server": "1.35.23", + "@coveo/search-token-server": "1.35.29", "@emotion/react": "11.10.8", "@emotion/styled": "11.10.8", "@mui/material": "5.12.2", @@ -31273,7 +31336,7 @@ }, "packages/ui/search-token-server": { "name": "@coveo/search-token-server", - "version": "1.35.23", + "version": "1.35.29", "license": "Apache-2.0", "dependencies": { "@coveo/platform-client": "44.1.0", diff --git a/package.json b/package.json index 5fb3f97ed4..97b34c3264 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cli-tools", "private": true, - "version": "1.0.0-18", + "version": "1.0.0-19", "author": "Coveo", "bin": { "coveo": "./bin/run" diff --git a/packages/cli-e2e/package.json b/packages/cli-e2e/package.json index b883f17f3c..b145657ca6 100644 --- a/packages/cli-e2e/package.json +++ b/packages/cli-e2e/package.json @@ -61,7 +61,7 @@ "@babel/core": "7.21.5", "@babel/preset-env": "7.21.5", "@babel/preset-typescript": "7.21.5", - "@coveo/cli": "2.6.2", + "@coveo/cli": "3.0.15", "@coveo/platform-client": "44.1.0", "abortcontroller-polyfill": "1.7.5", "async-retry": "1.3.3", diff --git a/packages/cli/commons/CHANGELOG.md b/packages/cli/commons/CHANGELOG.md index d15edcb9df..e4a3c86491 100644 --- a/packages/cli/commons/CHANGELOG.md +++ b/packages/cli/commons/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.7.15 (2023-10-27) + +### Features + +- add organization to event props ([#1325](https://github.com/coveo/cli/issues/1325)) ([3afcd0f](https://github.com/coveo/cli/commits/3afcd0f78112de9eae8f91218be3df01757f8d3e)) + # 2.6.0 (2023-07-26) ### Bug Fixes diff --git a/packages/cli/commons/package.json b/packages/cli/commons/package.json index 709787404b..5856dfb89d 100644 --- a/packages/cli/commons/package.json +++ b/packages/cli/commons/package.json @@ -1,6 +1,6 @@ { "name": "@coveo/cli-commons", - "version": "2.6.0", + "version": "2.7.15", "author": "Coveo", "description": "Common utils for @coveo/cli plugins", "license": "Apache-2.0", diff --git a/packages/cli/core/CHANGELOG.md b/packages/cli/core/CHANGELOG.md index 79659019d1..0136bf2778 100644 --- a/packages/cli/core/CHANGELOG.md +++ b/packages/cli/core/CHANGELOG.md @@ -1,3 +1,26 @@ +## 3.0.15 (2023-10-27) + +### Bug Fixes + +- only diff json files ([#1323](https://github.com/coveo/cli/issues/1323)) ([ae1361a](https://github.com/coveo/cli/commits/ae1361a4ca0f553103349ca436a309c61aa56732)) + +### Features + +- add organization to event props ([#1325](https://github.com/coveo/cli/issues/1325)) ([3afcd0f](https://github.com/coveo/cli/commits/3afcd0f78112de9eae8f91218be3df01757f8d3e)) +- **cli:** change node support to 18.18.1 ([#1332](https://github.com/coveo/cli/issues/1332)) ([54c6937](https://github.com/coveo/cli/commits/54c6937829685e1af20949f082b2de484fa1f6c6)) +- **cli:** change node support to only 18-20 ([#1335](https://github.com/coveo/cli/issues/1335)) ([3e65207](https://github.com/coveo/cli/commits/3e6520737650901d2b176fadc8e2e56441a8d4da)) +- **cli:** deprecate config:set region and environment ([#1331](https://github.com/coveo/cli/issues/1331)) ([341d5a7](https://github.com/coveo/cli/commits/341d5a70ab92c492ff653242dabf50f154192710)) +- **cli:** node 20.9.0 lts ([#1337](https://github.com/coveo/cli/issues/1337)) ([af1c3ac](https://github.com/coveo/cli/commits/af1c3ac1796bdfd534b5d037f3a42e23aa3ab225)) +- **cli:** use hidden prompt or stdin for auth:token command ([#1334](https://github.com/coveo/cli/issues/1334)) ([012b6a4](https://github.com/coveo/cli/commits/012b6a45adc474f1d10a8adf5a881eb9faf5e6e8)) + +### BREAKING CHANGES + +- **cli:** those flags are no longer supported by the cli and the + alternative is to re-execute a login flow with auth:login + +This change is part of the effort for the next major release of the CLI +(v3) + ## 2.6.2 (2023-08-24) ### Bug Fixes diff --git a/packages/cli/core/README.md b/packages/cli/core/README.md index 901b806d95..c5f6748eb5 100644 --- a/packages/cli/core/README.md +++ b/packages/cli/core/README.md @@ -23,7 +23,7 @@ $ npm install -g @coveo/cli $ coveo COMMAND running command... $ coveo (--version) -@coveo/cli/2.6.2 linux-x64 node-v18.17.1 +@coveo/cli/3.0.15 linux-x64 node-v20.9.0 $ coveo --help [COMMAND] USAGE $ coveo COMMAND @@ -85,6 +85,12 @@ The main config file of the Coveo CLI is stored in a JSON file in `configDir`. - [`coveo plugins:uninstall PLUGIN...`](#coveo-pluginsuninstall-plugin-1) - [`coveo plugins:uninstall PLUGIN...`](#coveo-pluginsuninstall-plugin-2) - [`coveo plugins:update`](#coveo-pluginsupdate) +- [`coveo source:catalog:add SOURCEID`](#coveo-sourcecatalogadd-sourceid) +- [`coveo source:catalog:new NAME`](#coveo-sourcecatalognew-name) +- [`coveo source:list`](#coveo-sourcelist) +- [`coveo source:push:add SOURCEID`](#coveo-sourcepushadd-sourceid) +- [`coveo source:push:delete SOURCEID`](#coveo-sourcepushdelete-sourceid) +- [`coveo source:push:new NAME`](#coveo-sourcepushnew-name) - [`coveo ui:create:angular NAME`](#coveo-uicreateangular-name) - [`coveo ui:create:atomic NAME`](#coveo-uicreateatomic-name) - [`coveo ui:create:react NAME`](#coveo-uicreatereact-name) @@ -149,7 +155,7 @@ EXAMPLES $ coveo atomic:component --type=result mySuperResultComponent ``` -_See code: [src/commands/atomic/component.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/atomic/component.ts)_ +_See code: [src/commands/atomic/component.ts](https://github.com/coveo/cli/blob/@coveo/cli@3.0.15/packages/cli/core/src/commands/atomic/component.ts)_ ## `coveo atomic:deploy` @@ -246,7 +252,7 @@ EXAMPLES $ coveo atomic:init --type=lib myCustomAtomicComponentsLibrary ``` -_See code: [src/commands/atomic/init.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/atomic/init.ts)_ +_See code: [src/commands/atomic/init.ts](https://github.com/coveo/cli/blob/@coveo/cli@3.0.15/packages/cli/core/src/commands/atomic/init.ts)_ ## `coveo auth:login` @@ -274,7 +280,7 @@ EXAMPLES $ coveo auth:login ``` -_See code: [src/commands/auth/login.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/auth/login.ts)_ +_See code: [src/commands/auth/login.ts](https://github.com/coveo/cli/blob/@coveo/cli@3.0.15/packages/cli/core/src/commands/auth/login.ts)_ ## `coveo auth:token` @@ -282,7 +288,7 @@ Log in to the Coveo Platform using an access token. ``` USAGE - $ coveo auth:token -t [-r US|us|EU|eu|AU|au|CA|ca] [-e dev|stg|hipaa|prod] + $ coveo auth:token [-r US|us|EU|eu|AU|au|CA|ca] [-e dev|stg|hipaa|prod] [-s] FLAGS -e, --environment=