Skip to content

Commit

Permalink
Separate configuration files to unblock deploying to production (#767)
Browse files Browse the repository at this point in the history
* chore: introduce prettierignore for d.ts files

* chore: upgrade release.yml Node version

* chore: update tsconfig.test.json to provide global jest types
  • Loading branch information
ijemmao authored Feb 27, 2024
1 parent f587d5b commit befeb36
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 31 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ module.exports = {
node: true,
jest: true,
},
ignorePatterns: ['**/functions/*.js', '**/node_modules/'],
ignorePatterns: [
'**/functions/*.js',
'**/node_modules/',
'**/__tests__/**/*.ts',
'**/__tests__/**/*.tsx',
],
// Prettier plugin should be the last to always override preceding plugins
extends: ['next', 'airbnb', 'plugin:cypress/recommended', 'prettier'],
parserOptions: {
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ jobs:
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Install Project Dependencies
run: |
rm -rf ./node_modules; yarn install
npm install -g firebase-tools
- name: Build Server
run: |
yarn install
yarn build
- name: Test Server Build Process
run: yarn test:build
- name: Test Backend
run: yarn jest:backend
- name: Test Frontend
run: yarn jest:frontend
# - name: Test API Homepage
# run: yarn cypress:ci
1 change: 0 additions & 1 deletion __tests__/api-json.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import isEqual from 'lodash/isEqual';
import { expect } from '@jest/globals';
import { NO_PROVIDED_TERM } from '../src/shared/constants/errorMessages';
import { searchTerm } from './shared/commands';

Expand Down
1 change: 0 additions & 1 deletion __tests__/api-mongo.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import mongoose from 'mongoose';
import { expect } from '@jest/globals';
import { forEach, has, isEqual, uniqBy, some, every } from 'lodash';
import stringSimilarity from 'string-similarity';
import diacriticless from 'diacriticless';
Expand Down
1 change: 0 additions & 1 deletion __tests__/developers.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from '@jest/globals';
import { createDeveloper, getExample, getExamples, getWord, getWords } from './shared/commands';
import { developerData, malformedDeveloperData, wordId, exampleId } from './__mocks__/documentData';

Expand Down
1 change: 0 additions & 1 deletion __tests__/examples.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { forEach, has, isEqual } from 'lodash';
import { expect } from '@jest/globals';
import { getExamples, getExample, getExamplesV2, getExampleV2 } from './shared/commands';
import {
MAIN_KEY,
Expand Down
1 change: 0 additions & 1 deletion __tests__/homepage.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from '@jest/globals';
import { getLocalUrlRoute } from './shared/commands';
import { SITE_TITLE, DOCS_SITE_TITLE } from './shared/constants';

Expand Down
1 change: 0 additions & 1 deletion __tests__/nsibidi_characters.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from '@jest/globals';
import { getNsibidiCharactersV2 } from './shared/commands';

describe('MongoDB Nsibidi Characters', () => {
Expand Down
1 change: 0 additions & 1 deletion __tests__/parse.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from '@jest/globals';
import fs from 'fs';
import { keys } from 'lodash';
import replaceAbbreviations from '../src/shared/utils/replaceAbbreviations';
Expand Down
11 changes: 0 additions & 11 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@
},
"main": "index.js",
"dependencies": {
"@babel/cli": "^7.11.6",
"@babel/core": "^7.12.3",
"@babel/node": "^7.10.5",
"@babel/plugin-syntax-jsx": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.11.5",
"@babel/preset-env": "^7.12.1",
"@babel/preset-react": "^7.12.7",
"@babel/preset-typescript": "^7.21.5",
"@babel/runtime": "^7.20.6",
"@chakra-ui/icons": "^1.1.1",
"@chakra-ui/react": "^1.7.4",
"@emotion/react": "^11",
Expand Down Expand Up @@ -89,7 +80,6 @@
"yarn": "^1.22.10"
},
"devDependencies": {
"@babel/preset-typescript": "^7.21.5",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@semantic-release/changelog": "^5.0.1",
Expand All @@ -101,7 +91,6 @@
"@types/react": "^18.2.11",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"babel-loader": "^8.1.0",
"cross-env": "^7.0.2",
"cypress": "^6.0.0",
"eslint": "8.34.0",
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
"yarn": "^1.22.10"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.23.0",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@semantic-release/changelog": "^5.0.1",
Expand All @@ -158,6 +157,7 @@
"@types/compression": "^1.7.2",
"@types/express-rate-limit": "^6.0.0",
"@types/jest": "^29.5.8",
"@types/mocha": "^10.0.6",
"@types/morgan": "^1.9.4",
"@types/node": "^20.3.0",
"@types/react": "^18.2.11",
Expand All @@ -169,13 +169,12 @@
"@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"babel-loader": "^8.1.0",
"cross-env": "^7.0.2",
"cypress": "^12.14.0",
"eslint": "8.34.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-next": "13.1.6",
"eslint-config-next": "^14.1.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-cypress": "2.12.1",
"eslint-plugin-import": "2.27.5",
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/Input/Input.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { expect } from '@jest/globals';
import { render } from '@testing-library/react';
import TestContext from '../components/TestContext';
import Input from '../../pages/components/Input/Input';
Expand Down
1 change: 0 additions & 1 deletion src/controllers/__tests__/examples.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from '@jest/globals';
import { exampleFixture } from '../../__tests__/shared/fixtures';
import { convertExamplePronunciations } from '../examples';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from '@jest/globals';
import Version from '../../../shared/constants/Version';
import WordClass from '../../../shared/constants/WordClass';
import { definitionFixture, wordFixture } from '../../../__tests__/shared/fixtures';
Expand Down
1 change: 0 additions & 1 deletion src/shared/utils/__tests__/createRegExp.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable max-len */
import { expect } from '@jest/globals';
import createRegExp, { removeSpecialCharacters } from '../createRegExp';

describe('createRegExp', () => {
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"env.d.ts"
],
"exclude": [
"node_modules"
"node_modules",
"./**/__tests__/**/*.ts",
"./**/__tests__/**/*.tsx"
]
}
3 changes: 2 additions & 1 deletion tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"jsx": "react"
}
},
"exclude": ["node_modules",],
}

0 comments on commit befeb36

Please sign in to comment.