Skip to content

refactor(ts): refactor db module to use TS and ESM #27

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 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
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
32edbf4
Merge branch 'main' into ts-and-esm-refactor-db-module
JamieSlome Mar 24, 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
478703b
Merge remote-tracking branch 'upstream/main' into ts-and-esm-refactor…
jescalada Mar 28, 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
20 changes: 16 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,13 @@
"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-require-imports": "off",
"@typescript-eslint/no-explicit-any": "off"
},
"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

27 changes: 15 additions & 12 deletions index.js → index.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
#!/usr/bin/env node
#!/usr/bin/env tsx
/* eslint-disable max-len */
const argv = require('yargs/yargs')(process.argv.slice(2))
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import * as fs from 'fs';
import config 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().argv;
.strict()
.parseSync();

const config = require('./src/config/file');
config.configFile = argv.c ? argv.c : undefined;

if (argv.v) {
const fs = require('fs');

if (!fs.existsSync(config.configFile)) {
if (!fs.existsSync(config.configFile as string)) {
console.error(
`Config file ${config.configFile} doesn't exist, nothing to validate! Did you forget -c/--config?`,
);
Expand All @@ -38,11 +45,7 @@ if (argv.v) {

config.validate();

const proxy = require('./src/proxy');
const service = require('./src/service');

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

module.exports.proxy = proxy;
module.exports.service = service;
export { proxy, service };
Loading
Loading