Skip to content

Commit

Permalink
Node v20, package updates
Browse files Browse the repository at this point in the history
  • Loading branch information
RISCfuture committed Feb 16, 2024
1 parent e842fd1 commit eee3509
Show file tree
Hide file tree
Showing 72 changed files with 10,810 additions and 11,757 deletions.
99 changes: 69 additions & 30 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,96 @@
module.exports = {
root: true,
env: {
node: true
node: true,
},
plugins: ['vuejs-accessibility'],
extends: [
'@vue/airbnb',
'@vue/typescript/recommended',
'plugin:vue/essential',
'plugin:vuejs-accessibility/recommended'
'plugin:vue/vue3-recommended',
'plugin:vuejs-accessibility/recommended',
],
parserOptions: {
parser: '@typescript-eslint/parser', // the typescript-parser for eslint, instead of tslint
ecmaVersion: 2020,
ecmaVersion: 2021,
ecmaFeatures: {
jsx: false
}
jsx: false,
},
},
rules: {
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'angle-bracket' }],
'@typescript-eslint/no-non-null-assertion': 'off',
'arrow-parens': ['error', 'as-needed'],
'comma-dangle': ['error', 'never'],
'dot-location': ['error', 'object'],
'implicit-arrow-linebreak': 'off',
'import/no-named-default': 'off',
'import/order': ['error', { groups: ['builtin', 'external', 'parent', 'sibling', 'index'] }],
'import/extensions': 'off',
'max-classes-per-file': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-plusplus': 'off',
'no-shadow': 'off',
'no-useless-constructor': 'off',
'vue/no-multiple-template-root': 'off',
'vue/no-v-html': 'off',
'vue/script-indent': ['error', 2, { baseIndent: 1 }],
'vuejs-accessibility/click-events-have-key-events': 'off',
semi: ['error', 'never']
'vuejs-accessibility/no-static-element-interactions': 'off',
semi: ['error', 'never'],
},
overrides: [
{
files: ['*.vue'],
rules: {
indent: 'off',
'class-methods-use-this': 'off'
}
},
},
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
files: ['src/**/*.ts'],
extends: [
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
parserOptions: {
project: true,
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
}
},
{
files: ['tests/unit/**/*.ts'],
plugins: ['chai-expect', 'chai-friendly', 'mocha'],
env: {
mocha: true
mocha: true,
},
extends: [
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
parserOptions: {
project: true,
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
}
}
]
},
{
files: ['tests/unit/**/*.spec.ts'],
rules: {
'no-unused-expressions': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
{
files: ['tests/e2e/**/*.ts'],
plugins: ['cypress'],
env: {
'cypress/globals': true,
},
extends: [
'plugin:cypress/recommended',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
},
parserOptions: {
project: true,
},
},
],
settings: {
'import/resolver': {
typescript: {},
},
},
}
39 changes: 30 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,55 @@ on:
branches: [master]

jobs:
test:
name: Tests
unit:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- name: Enable Corepack
run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20.x
- name: Install dependencies
run: yarn install
- name: Run unit tests
run: yarn ci:unit
- name: Run e2e tests
run: yarn ci:e2e
run: yarn test:unit
e2e:
name: E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Enable Corepack
run: corepack enable
- uses: cypress-io/github-action@v6
with:
build: yarn build
start: yarn serve
record: true
wait-on: http://localhost:8080
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
lint:
name: Linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- name: Enable Corepack
run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20.x
- name: Install dependencies
run: yarn install
- name: Run ESLint
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v4
- name: Enable Corepack
run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20.x
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Upload
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: "dist/"
- name: Notify Bugsnag
uses: psprings/[email protected]
with:
apiKey: ${{ secrets.BUGSNAG_API_KEY }}
appVersion: ${{ github.sha }}
releaseStage: production

# Deployment job
deploy:
Expand All @@ -55,4 +64,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@

/tests/e2e/videos/
/tests/e2e/screenshots/

# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v20
1 change: 0 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"stylelint-config-recommended-vue/scss"
],
"rules": {
"function-parentheses-space-inside": "never-single-line",
"max-nesting-depth": null,
"selector-max-id": null
}
Expand Down
873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.4.1.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.1.0.cjs

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions .yarnrc

This file was deleted.

7 changes: 1 addition & 6 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
nodeLinker: node-modules

packageExtensions:
stylelint-config-recommended-vue@*:
dependencies:
stylelint-config-recommended: ^6

yarnPath: .yarn/releases/yarn-3.4.1.cjs
yarnPath: .yarn/releases/yarn-4.1.0.cjs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Unit tests are powered by Mocha using Chai's `expect` syntax. A `fixtures.ts`
file contains example survey responses that can be used for testing.

Cypress tests are written in TypeScript. To prevent Mocha/Chai's globals from
interfering with Cypress's globals, a custom `tsconfig.json` and `index.d.ts`
interfering with Cypress's globals, a custom `tsconfig.json` and `cypress.d.ts`
have been placed in the `test/e2e` directory to isolate the Cypress namespace.

`test/e2e/plugins/index.js` has been modified to add a Webpack preprocessor that
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['@vue/cli-plugin-babel/preset']
presets: ['@vue/cli-plugin-babel/preset'],
}
18 changes: 18 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineConfig } from 'cypress'

export default defineConfig({
projectId: '69ff82',
fixturesFolder: 'tests/e2e/fixtures',
screenshotsFolder: 'tests/e2e/screenshots',
videosFolder: 'tests/e2e/videos',
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./tests/e2e/plugins/index.js')(on, config)
},
baseUrl: 'http://localhost:8080',
specPattern: 'tests/e2e/specs/**/*.{js,jsx,ts,tsx}',
supportFile: 'tests/e2e/support/index.js'
}
})
5 changes: 0 additions & 5 deletions cypress.json

This file was deleted.

Loading

0 comments on commit eee3509

Please sign in to comment.