Skip to content

Commit

Permalink
chore: Align tooling with team standards (#244)
Browse files Browse the repository at this point in the history
* chore: Setup husky and update pre-commit hook to use pretty-quick

* chore: Remove pre-push hook

Not part of the team's norms. Let CI run our tests

* lint should only be run against src and tests

* Remove unnecessary @typescript-eslint/* packages

Already included in typescript-eslint

* chore: Update eslint and config to module js

* fix lint errors

* chore: Update jest config to team standards

* chore: Remove explicit babel deps

Long migrated to tsc

* ci: Don't install husky in ci

* ci: Downgrade python to 3.11 for gsutil compat

* ci: Use firefox for integration tests

Workaround current issue of using chrome 130+ with testcafe

* Pin tests to chrome 129

Workaround an issue with testcafe + chrome 130+
  • Loading branch information
mhan83 authored Oct 18, 2024
1 parent 2bf31fa commit 3c8aad3
Show file tree
Hide file tree
Showing 23 changed files with 475 additions and 340 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:
- name: Install Dependencies
if: ${{ steps.prep.outputs.tag_name == '' }}
run: npm ci
env:
HUSKY: 0

- name: Build Bundle
if: ${{ steps.prep.outputs.tag_name == '' }}
Expand Down Expand Up @@ -155,6 +157,8 @@ jobs:
- name: Install Dependencies
run: npm ci --production
env:
HUSKY: 0
if: ${{ steps.prep.outputs.asset_id == '' }}

- name: Bundle Directory
Expand Down Expand Up @@ -231,6 +235,8 @@ jobs:
- name: Install Dependencies
run: npm ci --production
env:
HUSKY: 0
if: ${{ steps.prep.outputs.asset_id == '' }}

- name: Setup ffmpeg
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:

- name: Install Dependencies
run: npm ci
env:
HUSKY: 0

- name: Build
run: npm run build
Expand Down Expand Up @@ -61,7 +63,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.11"

- name: Google Cloud Login
id: 'auth'
Expand All @@ -80,6 +82,8 @@ jobs:
run: npm version --no-git-tag-version 1.0.0

- run: npm ci --production
env:
HUSKY: 0
- run: npm run build

- name: Setup ffmpeg
Expand Down Expand Up @@ -120,7 +124,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.11'

- name: Google Cloud Login
id: 'auth'
Expand All @@ -138,6 +142,8 @@ jobs:

- name: Install Dependencies
run: npm ci --production
env:
HUSKY: 0

- name: Build
run: npm run build
Expand Down
4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx pretty-quick --staged --pattern "**/*.{js,ts,mjs,cjs}"
npm run lint
4 changes: 0 additions & 4 deletions .husky/pre-push

This file was deleted.

3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

12 changes: 6 additions & 6 deletions eslint.config.js → eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const ts = require('typescript-eslint');
const js = require('@eslint/js');
const prettier = require('eslint-config-prettier');
const jest = require('eslint-plugin-jest');
import ts from 'typescript-eslint';
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';
import jest from 'eslint-plugin-jest';

module.exports = ts.config(
export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
prettier,
Expand All @@ -13,7 +13,7 @@ module.exports = ts.config(
{
files: ['**/*.*js', '**/*.*ts'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'no-undef': 'warn',
},
Expand Down
5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ const config = {
testMatch: ['**/tests/unit/**/*.[jt]s?(x)'],
collectCoverageFrom: ['src/**/*.ts'],
collectCoverage: true,
preset: 'ts-jest',
transformIgnorePatterns: [
'/node_modules/(?!(axios)/)', // Uses module import statements, which aren't supported by jest, so it has to be transformed by babel.
],
transform: { '^.+\\.ts?$': 'ts-jest' },
};

module.exports = config;
Loading

0 comments on commit 3c8aad3

Please sign in to comment.