Skip to content

refactor(ts): refactor proxy to TS #960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 51 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
522d3f7
feat: add TypeScript support and configure tsconfig
fabiovincenzi Feb 17, 2025
62b8d55
refactor(ts): change file db module to TS and ESM
jescalada Feb 24, 2025
c3ffd78
refactor(ts): change mongo db module to use TS and ESM
jescalada Feb 24, 2025
b1abc41
refactor(ts): change db module to use TS and ESM
jescalada Feb 24, 2025
91e8a4f
refactor(ts): add missing type defs and config for ts
jescalada Feb 24, 2025
33c27a1
refactor(ts): change config module to use TS and ESM
jescalada Mar 3, 2025
1c7a6b1
refactor(ts): refactor src/config imports
jescalada Mar 3, 2025
9b6f674
refactor(ts): update linter config for ts files
jescalada Mar 3, 2025
fdf3f10
chore(ts): add typescript and vite to ignored dependencies
jescalada Mar 3, 2025
d6f9e0d
chore(ts): bump node version for CI tests
jescalada Mar 3, 2025
d478edd
chore(ts): attempt to fix failing CLI tests
jescalada Mar 5, 2025
ab6c6c5
refactor(ts): migrate src/proxy/actions files to TS and ESM
jescalada Mar 7, 2025
9c81ae3
fix(ts): fix TS error
jescalada Mar 7, 2025
86837bc
fix(ts): remove invalid mocha config
jescalada Mar 12, 2025
530a789
fix(ts): add ts-mocha and tsx to fix test and runtime errors
jescalada Mar 12, 2025
3e8793f
Merge branch 'main' into ts-and-esm-refactor-db-module
jescalada Mar 12, 2025
c7773f3
fix(ts): add missing change to mongo/pushes
jescalada Mar 12, 2025
fb48a2f
refactor(ts): add TS linter
jescalada Mar 13, 2025
81d5e89
fix(ts): fix TS linter issues
jescalada Mar 13, 2025
2dfb6ce
fix(ts): fix CLI TS linter issues
jescalada Mar 13, 2025
1d61486
feat(ts): add TypeScript support, configuration, and missing type def…
fabiovincenzi Feb 17, 2025
c24ddf0
chore(ts): add typescript and vite to ignored dependencies
fabiovincenzi Mar 10, 2025
ee741e0
chore: remove lodash dependency
fabiovincenzi Mar 10, 2025
e316a95
feat(tsx): switch from ts-node to tsx and update dependencies
fabiovincenzi Mar 10, 2025
bdffb67
Merge branch 'main' into typescript-setup
fabiovincenzi Mar 20, 2025
44e0ba0
Merge remote-tracking branch 'fabio/typescript-setup' into ts-and-esm…
jescalada Mar 21, 2025
cebe41d
fix(ts): fix merge issues with OIDC and TS changes
jescalada Mar 21, 2025
12f1d16
fix(ts): attempt to fix plugin test issues
jescalada Mar 21, 2025
b26ee22
fix(ts): add ts-mocha, ts-node to ignored dependencies
jescalada Mar 21, 2025
7b67b00
fix(deps): set vite to 4.5.5 to pass license check
jescalada Mar 21, 2025
0730e5f
Merge branch 'ts-and-esm-refactor-db-module' into refactor-proxy-modu…
jescalada Mar 23, 2025
8d81399
chore(ts): add documentation for Action.ts
jescalada Mar 23, 2025
d1160fe
chore(test): add fix for flaky tests
jescalada Mar 23, 2025
8a78bae
refactor(ts): refactor pre-processor files
jescalada Mar 25, 2025
f7c3cda
refactor(ts): add Commit interface and Action commitData
jescalada Mar 25, 2025
aa2993a
refactor(ts): refactor check processors to ts
jescalada Mar 26, 2025
e3ee26a
refactor(ts): refactor parsePush action into TS
jescalada Mar 27, 2025
263f3cb
refactor(ts): refactor scanDiff into TS
jescalada Mar 27, 2025
3d0a486
refactor(ts): refactor remaining actions into TS
jescalada Mar 27, 2025
0d4d874
refactor(ts): refactor remaining proxy files, fix imports and type is…
jescalada Mar 27, 2025
c9f4db9
fix(ts): fix failing tests and type errors
jescalada Mar 28, 2025
56f3202
Merge remote-tracking branch 'upstream/main' into refactor-proxy-modu…
jescalada Mar 28, 2025
33d1ec9
fix(ts): fix linter errors
jescalada Mar 28, 2025
7108307
fix: revert ci.yml node to v18
jescalada Mar 30, 2025
c008381
fix(ts): add proper typing to chain module and fix minor issues
jescalada Mar 31, 2025
90a8cab
refactor(ts): refactor plugin module to TS and fix tests
jescalada Mar 31, 2025
31e5cae
fix(ts): remove "as any" in chain.ts
jescalada Mar 31, 2025
cecfc7f
chore: add eslint-plugin-typescript to devDependencies
jescalada Apr 2, 2025
333ca27
Merge remote-tracking branch 'origin/main' into refactor-proxy-module…
jescalada Apr 7, 2025
5c9aff2
refactor(ts): refactor actions/autoActions into TS
jescalada Apr 7, 2025
5f3de0a
chore: set linter to warn on explicit 'any'
jescalada Apr 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parser": "@babel/eslint-parser",
"parser": "@typescript-eslint/parser",
"env": {
"node": true,
"browser": true,
Expand All @@ -9,13 +9,23 @@
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"google",
"prettier",
"plugin:json/recommended"
],
"overrides": [],
"overrides": [
{
"files": ["test/**/*.js", "**/*.json"],
"parser": "espree",
"rules": {
"@typescript-eslint/no-unused-expressions": "off"
}
}
],
"parserOptions": {
"project": "./tsconfig.json",
"requireConfigFile": false,
"ecmaVersion": 12,
"sourceType": "module",
Expand All @@ -27,11 +37,15 @@
"presets": ["@babel/preset-react"]
}
},
"plugins": ["react", "prettier"],
"plugins": ["@typescript-eslint", "react", "prettier"],
"rules": {
"react/prop-types": "off",
"require-jsdoc": "off",
"no-async-promise-executor": "off"
"no-async-promise-executor": "off",
"@typescript-eslint/no-explicit-any": "warn", // temporary until TS refactor is complete
"@typescript-eslint/no-unused-vars": "off", // temporary until TS refactor is complete
"@typescript-eslint/no-require-imports": "off", // prevents error on old "require" imports
"@typescript-eslint/no-unused-expressions": "off" // prevents error on test "expect" expressions
},
"settings": {
"react": {
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/unused-dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: 'Unused Dependencies'
on: [pull_request]

permissions:
contents: read
permissions:
contents: read

jobs:
unused-dependecies:
Expand All @@ -20,11 +20,10 @@ jobs:
with:
node-version: '18.x'
- name: 'Run depcheck'
run: |
npx depcheck --skip-missing --ignores="@babel/*,@commitlint/*,eslint,eslint-*,husky,mocha,concurrently,nyc,prettier"
run: |
npx depcheck --skip-missing --ignores="tsx,@babel/*,@commitlint/*,eslint,eslint-*,husky,mocha,ts-mocha,ts-node,concurrently,nyc,prettier,typescript,tsconfig-paths,vite-tsconfig-paths"
echo $?
if [[ $? == 1 ]]; then
echo "Unused dependencies or devDependencies found"
exit 1
fi

48 changes: 0 additions & 48 deletions index.js

This file was deleted.

51 changes: 51 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env tsx
/* eslint-disable max-len */
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import * as fs from 'fs';
import { configFile, setConfigFile, validate } from './src/config/file';
import proxy from './src/proxy';
import service from './src/service';

const argv = yargs(hideBin(process.argv))
.usage('Usage: $0 [options]')
.options({
validate: {
description:
'Check the proxy.config.json file in the current working directory for validation errors.',
required: false,
alias: 'v',
type: 'boolean',
},
config: {
description: 'Path to custom git-proxy configuration file.',
default: 'proxy.config.json',
required: false,
alias: 'c',
type: 'string',
},
})
.strict()
.parseSync();

setConfigFile(argv.c as string || "");

if (argv.v) {
if (!fs.existsSync(configFile)) {
console.error(
`Config file ${configFile} doesn't exist, nothing to validate! Did you forget -c/--config?`,
);
process.exit(1);
}

validate();
console.log(`${configFile} is valid`);
process.exit(0);
}

validate();

proxy.start();
service.start();

export { proxy, service };
Loading
Loading