Skip to content

Commit 7e4ac59

Browse files
committed
Consolidate lint and test configurations at root and add pre-release checks to workflow
- move linting to root of the monorepo, so that the same ruleset apply everywhere - lining doesn't work now in the packages, though report is correct when run from root [Changes] - run linter and type check in `.github/workflows/github-release.yml` - use node 22 and pnpm 12.17.0 - the same as in root - in release workflow, also run tests - we don't want to repeat jest config files. should just be in root ├── .eslintrc.json ├── .github │ ├── FUNDING.yml │ └── workflows │ ├── deploy-vscode-extension.yml │ └── github-release.yml ├── .nvmrc ├── apps │ ├── browser │ │ ├── .eslintrc.json │ │ └── package.json │ ├── editor │ │ ├── package.json │ │ ├── package.nls.bg.json │ │ ├── package.nls.cs.json │ │ ├── package.nls.de.json │ │ ├── package.nls.es.json │ │ ├── package.nls.fr.json │ │ ├── package.nls.hu.json │ │ ├── package.nls.it.json │ │ ├── package.nls.ja.json │ │ ├── package.nls.json │ │ ├── package.nls.ko.json │ │ ├── package.nls.pl.json │ │ ├── package.nls.pt-br.json │ │ ├── package.nls.ru.json │ │ ├── package.nls.tr.json │ │ ├── package.nls.zh-cn.json │ │ ├── package.nls.zh-tw.json │ │ └── src │ │ ├── services │ │ │ └── websocket-server-process.ts │ │ └── views │ │ └── prompt │ │ └── frontend │ │ └── i18n │ │ └── translations │ │ └── recent-donations.ts │ └── web │ └── package.json ├── jest.config.js ├── package.json └── packages ├── shared │ ├── package.json │ └── src │ └── utils │ └── extract-path-from-line-of-code │ └── extract-path-from-line-of-code.ts └── ui ├── package.json └── src ├── components │ └── editor │ ├── common │ │ ├── Textarea │ │ │ └── Textarea.tsx │ │ └── prompts │ │ ├── PromptField │ │ │ ├── components │ │ │ │ └── CompletedTasks │ │ │ │ └── CompletedTasks.tsx │ │ │ └── hooks │ │ │ └── use-handlers │ │ │ └── handle-paste.ts │ │ └── shared │ │ └── symbols │ │ └── use-symbol-deletion.ts │ └── prompt-view │ ├── RecentDonations │ │ ├── RecentDonations.stories.tsx │ │ └── RecentDonations.tsx │ ├── ResponsePreview │ │ └── ResponsePreview.stories.tsx │ └── Tabs │ └── Tabs.tsx └── types └── svg.d.ts
1 parent 56a0102 commit 7e4ac59

25 files changed

Lines changed: 137 additions & 386 deletions

File tree

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,20 @@
2727
"warn",
2828
{ "argsIgnorePattern": "^_" }
2929
],
30-
"react/prop-types": "off",
3130
"no-empty": "off",
31+
"react/prop-types": "off",
3232
"react/react-in-jsx-scope": "off",
3333
"@typescript-eslint/no-namespace": "off",
3434
"no-undef": "off",
3535
"no-constant-condition": ["error", { "checkLoops": false }]
3636
},
3737
"overrides": [
3838
{
39-
"files": ["webpack.config.js"],
39+
"files": ["webpack.config.js", "webpack.config.ts"],
4040
"env": {
4141
"node": true
4242
}
4343
}
44-
]
44+
],
45+
"ignorePatterns": ["node_modules/", "dist/", "out/"]
4546
}

‎.github/workflows/github-release.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,39 @@ permissions:
1212
contents: write
1313

1414
jobs:
15+
check:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '22'
26+
registry-url: 'https://registry.npmjs.org'
27+
28+
- name: Setup PNPM
29+
uses: pnpm/action-setup@v2
30+
with:
31+
version: 12.17.0
32+
run_install: false
33+
34+
- name: Install dependencies
35+
run: pnpm i
36+
37+
- name: Lint
38+
run: pnpm lint
39+
40+
- name: Type check
41+
run: npx tsc --noEmit
42+
43+
- name: Test
44+
run: pnpm test
45+
1546
release:
47+
needs: check
1648
runs-on: ubuntu-latest
1749

1850
steps:
@@ -63,6 +95,7 @@ jobs:
6395
target_commitish: ${{ github.sha }}
6496

6597
release-browser:
98+
needs: check
6699
runs-on: ubuntu-latest
67100

68101
steps:

‎apps/browser/.eslintrc.json‎

Lines changed: 0 additions & 42 deletions
This file was deleted.

‎apps/browser/package.json‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"name": "gemini-coder-connector",
33
"scripts": {
44
"build": "webpack --mode production && ts-node scripts/create-firefox-build.ts && ts-node scripts/create-zip-archives.ts",
5-
"lint": "eslint src --ext ts,tsx",
6-
"lint:fix": "eslint src --ext ts,tsx --fix",
75
"bump": "node scripts/bump.js"
86
},
97
"devDependencies": {
@@ -16,16 +14,11 @@
1614
"@types/react": "18.2.48",
1715
"@types/react-dom": "18.2.18",
1816
"@types/webextension-polyfill": "0.12.4",
19-
"@typescript-eslint/eslint-plugin": "8.54.0",
20-
"@typescript-eslint/parser": "8.54.0",
2117
"archiver": "6.0.1",
2218
"baseline-browser-mapping": "2.9.19",
2319
"clean-webpack-plugin": "4.0.0",
2420
"copy-webpack-plugin": "12.0.2",
2521
"css-loader": "6.8.1",
26-
"eslint": "8.57.1",
27-
"eslint-config-prettier": "10.1.8",
28-
"eslint-plugin-react": "7.37.5",
2922
"mini-css-extract-plugin": "2.9.4",
3023
"react-refresh": "0.17.0",
3124
"sass": "1.93.2",

‎apps/editor/jest.config.js‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎apps/editor/package.json‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
"vscode:prepublish": "rimraf out && npm run compile",
99
"compile": "webpack --config ./webpack.config.ts --mode production",
1010
"watch": "webpack --config ./webpack.config.ts --watch --mode development",
11-
"lint": "eslint src --ext ts,tsx",
12-
"lint:fix": "eslint src --ext ts,tsx --fix",
13-
"test": "jest",
14-
"test:watch": "jest --watch",
1511
"bump": "node scripts/bump.js"
1612
},
1713
"publisher": "robertpiosik",
@@ -1369,15 +1365,10 @@
13691365
"@types/vscode": "1.96.0",
13701366
"@types/ws": "8.18.1",
13711367
"@types/turndown": "5.0.5",
1372-
"@typescript-eslint/eslint-plugin": "7.18.0",
1373-
"@typescript-eslint/parser": "7.18.0",
13741368
"clean-webpack-plugin": "4.0.0",
13751369
"copy-webpack-plugin": "12.0.2",
13761370
"css-loader": "6.5.1",
1377-
"eslint": "8.57.1",
1378-
"eslint-config-prettier": "10.1.5",
13791371
"esbuild-loader": "4.2.2",
1380-
"eslint-plugin-react": "7.37.5",
13811372
"fork-ts-checker-webpack-plugin": "9.0.2",
13821373
"mini-css-extract-plugin": "2.9.2",
13831374
"sass-embedded": "1.89.2",

‎apps/editor/src/services/websocket-server-process.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as http from 'http'
33
import * as path from 'path'
44
import * as process from 'process'
55
import * as dotenv from 'dotenv'
6-
// eslint-disable-next-line @typescript-eslint/no-var-requires
6+
// eslint-disable-next-line @typescript-eslint/no-require-imports
77
const WebSocket = require('ws')
88
import { DEFAULT_PORT, CLIENT_TYPE } from '@shared/constants/websocket'
99

@@ -78,7 +78,7 @@ class WebSocketServer {
7878

7979
const {
8080
get_or_create_shared_token
81-
// eslint-disable-next-line @typescript-eslint/no-var-requires
81+
// eslint-disable-next-line @typescript-eslint/no-require-imports
8282
} = require('../utils/shared-token')
8383
const expected_token = get_or_create_shared_token()
8484

@@ -126,7 +126,7 @@ class WebSocketServer {
126126
if (challenge) {
127127
const {
128128
get_or_create_shared_token
129-
// eslint-disable-next-line @typescript-eslint/no-var-requires
129+
// eslint-disable-next-line @typescript-eslint/no-require-imports
130130
} = require('../utils/shared-token')
131131
const token = get_or_create_shared_token()
132132
const signature = crypto

‎apps/editor/src/views/prompt/frontend/i18n/translations/recent-donations.ts‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ export const recent_donations = {
1818
bg: 'Дарения'
1919
},
2020
'recent-donations.about': {
21-
en: 'Hey there! Donating is a great way to show your support for the project. Thank you!',
22-
pl: 'Cześć! Darowizna to świetny sposób, aby wesprzeć projekt. Dziękuję!',
23-
'zh-cn': '你好!捐款是展示你对该项目支持的好方法。谢谢!',
24-
ja: 'こんにちは!寄付はプロジェクトへの支援を示す素晴らしい方法です。ありがとうございます!',
25-
'zh-tw': '你好!捐款是展示你對該項目支持的好方法。謝謝!',
26-
de: 'Hallo! Eine Spende ist eine großartige Möglichkeit, Ihre Unterstützung für das Projekt zu zeigen. Danke!',
27-
es: '¡Hola! Donar es una gran manera de mostrar su apoyo al proyecto. ¡Gracias!',
28-
fr: 'Salut ! Faire un don est un excellent moyen de montrer votre soutien au projet. Merci !',
21+
en: 'Donating is a great way to show your support for the project. Thank you!',
22+
pl: 'Darowizna to świetny sposób, aby wesprzeć projekt. Dziękuję!',
23+
'zh-cn': '捐赠是支持项目的好方法。谢谢!',
24+
ja: '寄付はプロジェクトへの支援を示す素晴らしい方法です。ありがとうございます!',
25+
'zh-tw': '捐款是支持專案的好方法。謝謝!',
26+
de: 'Eine Spende ist eine großartige Möglichkeit, Ihre Unterstützung für das Projekt zu zeigen. Danke!',
27+
es: 'Donar es una excelente manera de mostrar tu apoyo al proyecto. ¡Gracias!',
28+
fr: 'Faire un don est un excellent moyen de montrer votre soutien au projet. Merci !',
2929
'pt-br':
30-
'Olá! Doar é uma ótima maneira de mostrar seu apoio ao projeto. Obrigado!',
31-
ru: 'Привет! Пожертвование - отличный способ поддержать проект. Спасибо!',
32-
ko: '안녕하세요! 기부는 프로젝트에 대한 지원을 보여주는 좋은 방법입니다. 감사합니다!',
33-
it: 'Ciao! Donare è un ottimo modo per mostrare il tuo supporto al progetto. Grazie!',
34-
tr: 'Merhaba! Bağış yapmak, projeye desteğinizi göstermenin harika bir yoludur. Teşekkürler!',
35-
cs: 'Ahoj! Darování je skvělý způsob, jak podpořit projekt. Děkuji!',
36-
hu: 'Szia! Az adományozás nagyszerű módja annak, hogy támogasd a projektet. Köszönöm!',
37-
bg: 'Здравейте! Дарението е чудесен начин да покажете подкрепата си за проекта. Благодаря!'
30+
'Doar é uma ótima maneira de mostrar seu apoio ao projeto. Obrigado!',
31+
ru: 'Пожертвование - отличный способ показать свою поддержку проекту. Спасибо!',
32+
ko: '기부는 프로젝트에 대한 지원을 보여주는 좋은 방법입니다. 감사합니다!',
33+
it: 'Donare è un ottimo modo per mostrare il tuo supporto al progetto. Grazie!',
34+
tr: 'Bağış yapmak, projeye desteğinizi göstermenin harika bir yoludur. Teşekkürler!',
35+
cs: 'Darování je skvělý způsob, jak ukázat svou podporu projektu. Děkuji!',
36+
hu: 'Az adományozás nagyszerű módja annak, hogy támogassa a projektet. Köszönöm!',
37+
bg: 'Дарението е чудесен начин да покажете подкрепата си за проекта. Благодаря!'
3838
},
3939
'recent-donations.platforms': {
4040
en: 'Platforms',

‎jest.config.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
12
module.exports = {
23
preset: 'ts-jest',
34
testEnvironment: 'node',
4-
testMatch: ['<rootDir>/apps/**/*.spec.ts', '<rootDir>/packages/**/*.spec.ts'],
5+
clearMocks: true,
6+
testMatch: [
7+
'<rootDir>/apps/**/*.spec.ts?(x)',
8+
'<rootDir>/packages/**/*.spec.ts?(x)'
9+
],
510
testPathIgnorePatterns: ['/node_modules/', '/out/', '/dist/'],
611
moduleNameMapper: {
712
'^@shared/(.*)$': '<rootDir>/packages/shared/src/$1',

‎package.json‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"packageManager": "pnpm@12.17.0+sha512.b8d223ebec04b580a89ed206daa71d1bccb6a1ee1d52efa95cc3b0db75271561df8f0d8e2c43add39c5ec08018af7a8a95108e7090f95a29f88727b7a40fd53d",
44
"devDependencies": {
55
"@types/jest": "29.5.14",
6+
"@typescript-eslint/eslint-plugin": "8.54.0",
7+
"@typescript-eslint/parser": "8.54.0",
8+
"eslint": "8.57.1",
9+
"eslint-config-prettier": "10.1.8",
10+
"eslint-plugin-react": "7.37.5",
611
"husky": "9.1.7",
712
"jest": "29.7.0",
813
"lint-staged": "15.2.10",
@@ -13,9 +18,14 @@
1318
"scripts": {
1419
"prepare": "husky",
1520
"test": "jest",
16-
"test:watch": "jest --watch"
21+
"test:watch": "jest --watch",
22+
"lint": "eslint . --ext ts,tsx",
23+
"lint:fix": "eslint . --ext ts,tsx --fix"
1724
},
1825
"lint-staged": {
26+
"*.{ts,tsx}": [
27+
"eslint --fix"
28+
],
1929
"*.{ts,tsx,json,css,scss,md}": [
2030
"prettier --write"
2131
]

0 commit comments

Comments
 (0)