diff --git a/.circleci/config.yml b/.circleci/config.yml index 0dcca1d322b..557ed0cb508 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,59 +1,33 @@ version: 2.1 +orbs: + node: circleci/node@5.2.0 + browser-tools: circleci/browser-tools@1.3.0 executors: pw-focal-development: docker: - - image: mcr.microsoft.com/playwright:v1.39.0-focal + - image: mcr.microsoft.com/playwright:v1.42.1-focal environment: NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed - PERCY_POSTINSTALL_BROWSER: "true" # Needed to store the percy browser in cache deps - PERCY_LOGLEVEL: "debug" # Enable DEBUG level logging for Percy (Issue: https://github.com/nasa/openmct/issues/5742) + PERCY_POSTINSTALL_BROWSER: 'true' # Needed to store the percy browser in cache deps + PERCY_LOGLEVEL: 'debug' # Enable DEBUG level logging for Percy (Issue: https://github.com/nasa/openmct/issues/5742) + PERCY_PARALLEL_TOTAL: 2 ubuntu: machine: image: ubuntu-2204:current docker_layer_caching: true -parameters: - BUST_CACHE: - description: "Set this with the CircleCI UI Trigger Workflow button (boolean = true) to bust the cache!" - default: false - type: boolean commands: build_and_install: - description: "All steps used to build and install. Will use cache if found" + description: 'All steps used to build and install.' parameters: node-version: type: string steps: - checkout - - restore_cache_cmd: - node-version: << parameters.node-version >> - node/install: node-version: << parameters.node-version >> - - run: npm install --no-audit --progress=false - restore_cache_cmd: - description: "Custom command for restoring cache with the ability to bust cache. When BUST_CACHE is set to true, jobs will not restore cache" - parameters: - node-version: - type: string - steps: - - when: - condition: - equal: [false, << pipeline.parameters.BUST_CACHE >>] - steps: - - restore_cache: - key: deps--{{ arch }}--{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} - save_cache_cmd: - description: "Custom command for saving cache." - parameters: - node-version: - type: string - steps: - - save_cache: - key: deps--{{ arch }}--{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} - paths: - - ~/.npm - - node_modules + - node/install-packages generate_and_store_version_and_filesystem_artifacts: - description: "Track important packages and files" + description: 'Track important packages and files' steps: - run: | [[ $EUID -ne 0 ]] && (sudo mkdir -p /tmp/artifacts && sudo chmod 777 /tmp/artifacts) || (mkdir -p /tmp/artifacts && chmod 777 /tmp/artifacts) @@ -64,16 +38,13 @@ commands: - store_artifacts: path: /tmp/artifacts/ generate_e2e_code_cov_report: - description: "Generate e2e code coverage artifacts and publish to codecov.io. Needed to that we can ignore the exit code status of the npm run test" + description: 'Generate e2e code coverage artifacts and publish to codecov.io. Needed to that we can ignore the exit code status of the npm run test' parameters: suite: type: string steps: - run: npm run cov:e2e:report || true - run: npm run cov:e2e:<>:publish -orbs: - node: circleci/node@5.1.0 - browser-tools: circleci/browser-tools@1.3.0 jobs: npm-audit: parameters: @@ -111,8 +82,6 @@ jobs: TESTFILES=$(circleci tests glob "src/**/*Spec.js") echo "$TESTFILES" | circleci tests run --command="xargs npm run test" --verbose - run: npm run cov:unit:publish - - save_cache_cmd: - node-version: <> - store_test_results: path: dist/reports/tests/ - store_artifacts: @@ -133,7 +102,7 @@ jobs: node-version: lts/hydrogen - when: #Only install chrome-beta when running the 'full' suite to save $$$ condition: - equal: ["full", <>] + equal: ['full', <>] steps: - run: npx playwright install chrome-beta - run: @@ -190,7 +159,7 @@ jobs: steps: - build_and_install: node-version: lts/hydrogen - - run: npx playwright@1.39.0 install #Necessary for bare ubuntu machine + - run: npx playwright@1.42.1 install #Necessary for bare ubuntu machine - run: | export $(cat src/plugins/persistence/couch/.env.ci | xargs) docker-compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach @@ -252,14 +221,15 @@ jobs: equal: [42, 42] # Always run codecov reports regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2 steps: - generate_and_store_version_and_filesystem_artifacts - visual-a11y-tests: + visual-a11y: parameters: suite: type: string # ci or full executor: pw-focal-development + parallelism: 2 steps: - build_and_install: - node-version: lts/hydrogen + node-version: lts/iron - run: npm run test:e2e:visual:<> - store_test_results: path: test-results/results.xml @@ -286,8 +256,8 @@ workflows: name: e2e-stable suite: stable - e2e-mobile - - visual-a11y-tests: - name: visual-a11y-test-ci + - visual-a11y: + name: visual-a11y-ci suite: ci the-nightly: #These jobs do not run on PRs, but against master at night @@ -306,13 +276,13 @@ workflows: - e2e-mobile - perf-test - mem-test - - visual-a11y-tests: - name: visual-a11y-test-nightly + - visual-a11y: + name: visual-a11y-nightly suite: full - e2e-couchdb triggers: - schedule: - cron: "0 0 * * *" + cron: '0 0 * * *' filters: branches: only: diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e29c5879252..6df907f782a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,10 +1,13 @@ const LEGACY_FILES = ['example/**']; -module.exports = { +/** @type {import('eslint').Linter.Config} */ +const config = { env: { browser: true, - es6: true, + es2024: true, jasmine: true, - amd: true + node: true, + worker: true, + serviceworker: true }, globals: { _: 'readonly' @@ -23,10 +26,11 @@ module.exports = { parser: '@babel/eslint-parser', requireConfigFile: false, allowImportExportEverywhere: true, - ecmaVersion: 2015, + ecmaVersion: 'latest', ecmaFeatures: { impliedStrict: true - } + }, + sourceType: 'module' }, rules: { 'simple-import-sort/imports': 'warn', @@ -152,7 +156,7 @@ module.exports = { cases: { pascalCase: true }, - ignore: ['^.*\\.js$'] + ignore: ['^.*\\.(js|cjs|mjs)$'] } ], 'vue/first-attribute-linebreak': 'error', @@ -179,3 +183,5 @@ module.exports = { } ] }; + +module.exports = config; diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 34ab10e6a93..444d552e91b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -17,7 +17,6 @@ Closes