Skip to content

refactor: migrate configuration system from JSON Schema to QuickType #1140

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 28 commits into
base: main
Choose a base branch
from
Open
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
80f2736
feat: create zod schema for config
fabiovincenzi Apr 29, 2025
29d4562
refactor: migrate config loader to Zod
fabiovincenzi Apr 29, 2025
a865d65
refactor: integrate Zod-based loader and pass config to services
fabiovincenzi Apr 29, 2025
5a4e068
Merge branch 'main' into config
fabiovincenzi May 2, 2025
0fe5e0a
chore: ignore jsonschema in unused deps check
fabiovincenzi May 2, 2025
9758a5b
Merge branch 'config' of https://github.com/fabiovincenzi/git-proxy i…
fabiovincenzi May 2, 2025
6663aa4
Merge branch 'main' into config
JamieSlome May 6, 2025
29b26a3
Merge branch 'main' into config
fabiovincenzi May 20, 2025
c08da33
Merge branch 'main' into config
fabiovincenzi May 20, 2025
fa83356
Merge branch 'main' into config
fabiovincenzi May 20, 2025
6f84652
fix: fix config schema
fabiovincenzi May 21, 2025
7642274
feat: migrate configuration system from JSON Schema validation to Qui…
fabiovincenzi Jul 17, 2025
0acdd16
chore: merge main
fabiovincenzi Jul 17, 2025
795dc45
fix: fix failing tests
fabiovincenzi Jul 17, 2025
0262b61
chore: remove unused deps
fabiovincenzi Jul 17, 2025
1eaff43
fix: fix types checks errors
fabiovincenzi Jul 17, 2025
1a0e295
feat: add banner on top of auto-generated types
fabiovincenzi Jul 21, 2025
04d912e
test: add tests for proxy
fabiovincenzi Jul 21, 2025
2fb1f3c
test: increase tes coverage
fabiovincenzi Jul 21, 2025
cec5819
test: increase tes coverage
fabiovincenzi Jul 21, 2025
499570c
test: increase test coverage for generated config
fabiovincenzi Jul 21, 2025
ba40989
test: increase test coverage for config
fabiovincenzi Jul 21, 2025
098db65
test: increase test coverage
fabiovincenzi Jul 21, 2025
5f7aace
test: increase test coverage
fabiovincenzi Jul 21, 2025
4a9f533
Merge branch 'main' into config
fabiovincenzi Jul 21, 2025
a2b8968
refactor: remove unused variables
fabiovincenzi Jul 21, 2025
b53f096
Merge branch 'main' into pr/fabiovincenzi/1140
fabiovincenzi Aug 14, 2025
b96ee9f
chore: remove unused jsonschema dependency
fabiovincenzi Aug 14, 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
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@
"react": {
"version": "detect"
}
}
},
"ignorePatterns": ["src/config/generated/config.ts"]
}
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: '22.x'
- name: 'Run depcheck'
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,history,@types/domutils"
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,@types/sinon,quicktype,history,@types/domutils"
echo $?
if [[ $? == 1 ]]; then
echo "Unused dependencies or devDependencies found"
Expand Down
8 changes: 8 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@
},
"required": ["enabled", "key", "cert"]
},
"sslKeyPemPath": {
"description": "Legacy: Path to SSL private key file (use tls.key instead)",
"type": "string"
},
"sslCertPemPath": {
"description": "Legacy: Path to SSL certificate file (use tls.cert instead)",
"type": "string"
},
"configurationSources": {
"enabled": { "type": "boolean" },
"reloadIntervalSeconds": { "type": "number" },
Expand Down
4 changes: 1 addition & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import * as fs from 'fs';
import { configFile, setConfigFile, validate } from './src/config/file';
import { initUserConfig } from './src/config';
import proxy from './src/proxy';
import service from './src/service';

Expand All @@ -30,8 +29,7 @@ const argv = yargs(hideBin(process.argv))
.strict()
.parseSync();

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

if (argv.v) {
if (!fs.existsSync(configFile)) {
Expand Down
Loading
Loading