Skip to content

refactor(ts): migrate config module to use TS and ESM #31

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 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
71a5e6f
chore(deps): update dependency @finos/git-proxy to ^1.9.3 - git-proxy…
renovate[bot] Mar 26, 2025
5ceba0c
Merge pull request #956 from finos/renovate/git-proxy-plugin-samples-…
JamieSlome Mar 26, 2025
1f313ea
fix(deps): update dependency axios to ^1.8.4 - git-proxy-cli - packag…
renovate[bot] Mar 26, 2025
83e814b
Merge pull request #958 from finos/renovate/git-proxy-cli-manager
JamieSlome Mar 26, 2025
1321ab2
Merge remote-tracking branch 'upstream/main' into refactor-config-mod…
jescalada Apr 2, 2025
4a07b20
fix(ts): port over import/test fixes from `proxy` refactor PR
jescalada Apr 2, 2025
707ac3b
fix(ts): fix ci issues
jescalada Apr 2, 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": "off", // 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
2 changes: 1 addition & 1 deletion .github/workflows/unused-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
node-version: '18.x'
- name: 'Run depcheck'
run: |
npx depcheck --skip-missing --ignores="@babel/*,@commitlint/*,eslint,eslint-*,husky,mocha,concurrently,nyc,prettier"
npx depcheck --skip-missing --ignores="@babel/*,@commitlint/*,concurrently,eslint,eslint-*,husky,mocha,nyc,prettier,ts-mocha,ts-node,tsconfig-paths,tsx,typescript,vite-tsconfig-paths"
echo $?
if [[ $? == 1 ]]; then
echo "Unused dependencies or devDependencies found"
Expand Down
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 node
/* 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