Skip to content

Commit

Permalink
feat(cli): change node support to only 18-20 (#1335)
Browse files Browse the repository at this point in the history
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:
<!-- Did you write unit tests for your feature? If not, explains why?
-->
- [X] Functionnal Tests:
<!-- Did you write functionnal tests for your feature? If not, explains
why? -->
- [ ] Manual Tests:
<!-- How did you test your changeset?  -->

---------

Co-authored-by: Louis Bompart <[email protected]>
  • Loading branch information
olamothe and louis-bompart authored Oct 18, 2023
1 parent 012b6a4 commit 3e65207
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/actions/e2e-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-20.04', 'windows-latest']
node: ['18', '20']
spec:
[
'angular.specs.ts',
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18.1
20.8.0
2 changes: 1 addition & 1 deletion packages/cli/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/core/src/commands/ui/create/angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/core/src/commands/ui/create/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.coveo.com/headless> and <https://reactjs.org/>.';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/core/src/commands/ui/create/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.coveo.com/headless> and <https://vuejs.org/>.';

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/core/src/lib/atomic/createAtomicProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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-', '/');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/source/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/cra-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"license": "Apache-2.0",
"engines": {
"node": ">=18.18.1"
"node": "^18.18.1 || ^20.8.1"
},
"files": [
"template",
Expand Down
8 changes: 2 additions & 6 deletions scripts/cleaning/delete-api-keys.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require('isomorphic-fetch');
require('abortcontroller-polyfill');

const {homedir} = require('os');
const {join} = require('path');
const {config} = require('dotenv');
Expand All @@ -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';
}

Expand Down
7 changes: 2 additions & 5 deletions scripts/cleaning/delete-orgs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require('isomorphic-fetch');
require('abortcontroller-polyfill');

const {homedir} = require('os');
const {join} = require('path');
const {config} = require('dotenv');
Expand All @@ -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/);
}

Expand Down

0 comments on commit 3e65207

Please sign in to comment.