Skip to content

Commit b06bb20

Browse files
authored
Move all HTTP proxy agent related modules to a monorepo (TooTallNate#143)
Converts this repository into a monorepo, containing the following npm packages: * agent-base * data-uri-to-buffer * degenerator * get-uri * https-proxy-agent * http-proxy-agent * pac-proxy-agent * pac-resolver * proxy * proxy-agent * socks-proxy-agent Why? Mainly for ease of maintenance. It's difficult to monitor 10+ repositories and keep their configurations in sync. Additionally: * Uses Turborepo * All packages have been converted to TypeScript * Common issue tracker for all related packages * Common eslint configuration * Shared GH Actions setup * Test changes for sub-packages against dependent parent packages
1 parent d0d80cc commit b06bb20

File tree

160 files changed

+29525
-704
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+29525
-704
lines changed

.eslintrc.js

+15-85
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,16 @@
11
module.exports = {
2-
'extends': [
3-
'airbnb',
4-
'prettier'
5-
],
6-
'parser': '@typescript-eslint/parser',
7-
'parserOptions': {
8-
'ecmaVersion': 2018,
9-
'sourceType': 'module',
10-
'modules': true
11-
},
12-
'plugins': [
13-
'@typescript-eslint'
14-
],
15-
'settings': {
16-
'import/resolver': {
17-
'typescript': {
18-
}
19-
}
20-
},
21-
'rules': {
22-
'quotes': [
23-
2,
24-
'single',
25-
{
26-
'allowTemplateLiterals': true
27-
}
28-
],
29-
'class-methods-use-this': 0,
30-
'consistent-return': 0,
31-
'func-names': 0,
32-
'global-require': 0,
33-
'guard-for-in': 0,
34-
'import/no-duplicates': 0,
35-
'import/no-dynamic-require': 0,
36-
'import/no-extraneous-dependencies': 0,
37-
'import/prefer-default-export': 0,
38-
'lines-between-class-members': 0,
39-
'no-await-in-loop': 0,
40-
'no-bitwise': 0,
41-
'no-console': 0,
42-
'no-continue': 0,
43-
'no-control-regex': 0,
44-
'no-empty': 0,
45-
'no-loop-func': 0,
46-
'no-nested-ternary': 0,
47-
'no-param-reassign': 0,
48-
'no-plusplus': 0,
49-
'no-restricted-globals': 0,
50-
'no-restricted-syntax': 0,
51-
'no-shadow': 0,
52-
'no-underscore-dangle': 0,
53-
'no-use-before-define': 0,
54-
'prefer-const': 0,
55-
'prefer-destructuring': 0,
56-
'camelcase': 0,
57-
'no-unused-vars': 0, // in favor of '@typescript-eslint/no-unused-vars'
58-
// 'indent': 0 // in favor of '@typescript-eslint/indent'
59-
'@typescript-eslint/no-unused-vars': 'warn',
60-
// '@typescript-eslint/indent': ['error', 2] // this might conflict with a lot ongoing changes
61-
'@typescript-eslint/no-array-constructor': 'error',
62-
'@typescript-eslint/adjacent-overload-signatures': 'error',
63-
'@typescript-eslint/class-name-casing': 'error',
64-
'@typescript-eslint/interface-name-prefix': 'error',
65-
'@typescript-eslint/no-empty-interface': 'error',
66-
'@typescript-eslint/no-inferrable-types': 'error',
67-
'@typescript-eslint/no-misused-new': 'error',
68-
'@typescript-eslint/no-namespace': 'error',
69-
'@typescript-eslint/no-non-null-assertion': 'error',
70-
'@typescript-eslint/no-parameter-properties': 'error',
71-
'@typescript-eslint/no-triple-slash-reference': 'error',
72-
'@typescript-eslint/prefer-namespace-keyword': 'error',
73-
'@typescript-eslint/type-annotation-spacing': 'error',
74-
// '@typescript-eslint/array-type': 'error',
75-
// '@typescript-eslint/ban-types': 'error',
76-
// '@typescript-eslint/explicit-function-return-type': 'warn',
77-
// '@typescript-eslint/explicit-member-accessibility': 'error',
78-
// '@typescript-eslint/member-delimiter-style': 'error',
79-
// '@typescript-eslint/no-angle-bracket-type-assertion': 'error',
80-
// '@typescript-eslint/no-explicit-any': 'warn',
81-
// '@typescript-eslint/no-object-literal-type-assertion': 'error',
82-
// '@typescript-eslint/no-use-before-define': 'error',
83-
// '@typescript-eslint/no-var-requires': 'error',
84-
// '@typescript-eslint/prefer-interface': 'error'
85-
}
86-
}
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
plugins: ['@typescript-eslint'],
5+
env: {
6+
node: true,
7+
},
8+
// This tells ESLint to load the config from the package `eslint-config-custom`
9+
extends: [
10+
'turbo',
11+
'prettier',
12+
'eslint:recommended',
13+
'plugin:@typescript-eslint/eslint-recommended',
14+
'plugin:@typescript-eslint/recommended',
15+
],
16+
};

.github/workflows/test.yml

+27-26
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
name: Node CI
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
tags:
8-
- '!*'
9-
pull_request:
3+
on: [push]
104

115
jobs:
126
build:
@@ -15,32 +9,39 @@ jobs:
159
strategy:
1610
matrix:
1711
os: [ubuntu-latest, macos-latest, windows-latest]
18-
node-version: [6.x, 8.x, 10.x, 12.x, 14.x]
12+
node-version: [14.x, 16.x, 18.x, 20.x]
13+
fail-fast: false
1914

2015
runs-on: ${{ matrix.os }}
2116

2217
steps:
23-
- uses: actions/checkout@v1
24-
18+
- uses: actions/checkout@v3
19+
- uses: pnpm/action-setup@v2
20+
with:
21+
version: 7.32.2
2522
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v1
23+
uses: actions/setup-node@v3
2724
with:
2825
node-version: ${{ matrix.node-version }}
26+
cache: 'pnpm'
27+
- run: pnpm install --frozen-lockfile
28+
- run: pnpm build
29+
- run: pnpm test
2930

30-
- name: Print Node.js Version
31-
run: node --version
32-
33-
- name: Install Dependencies
34-
run: npm install
35-
env:
36-
CI: true
31+
lint:
32+
name: Lint
3733

38-
- name: Run "build" step
39-
run: npm run build --if-present
40-
env:
41-
CI: true
34+
runs-on: ubuntu-latest
4235

43-
- name: Run tests
44-
run: npm test
45-
env:
46-
CI: true
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: pnpm/action-setup@v2
39+
with:
40+
version: 7.32.2
41+
- name: Use Node.js 20.x
42+
uses: actions/setup-node@v3
43+
with:
44+
node-version: 20.x
45+
cache: 'pnpm'
46+
- run: pnpm install --frozen-lockfile
47+
- run: pnpm lint

.gitignore

+26-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1-
/node_modules
2-
/yarn.lock
3-
/?.?s
4-
/dist
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
?.?s
4+
dist
5+
6+
# dependencies
7+
node_modules
8+
.pnp
9+
.pnp.js
10+
11+
# testing
12+
coverage
13+
14+
# misc
15+
.DS_Store
16+
17+
# debug
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
22+
# turbo
23+
.turbo
24+
25+
# vercel
26+
.vercel

.npmignore

-3
This file was deleted.

package.json

+13-50
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,19 @@
11
{
2-
"name": "https-proxy-agent",
3-
"version": "5.0.1",
4-
"description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS",
5-
"main": "dist/index",
6-
"types": "dist/index",
7-
"files": [
8-
"dist"
9-
],
2+
"private": true,
3+
"name": "proxy-agent-monorepo",
104
"scripts": {
11-
"prebuild": "rimraf dist",
12-
"build": "tsc",
13-
"test": "mocha --reporter spec",
14-
"test-lint": "eslint src --ext .js,.ts",
15-
"prepublishOnly": "npm run build"
16-
},
17-
"repository": {
18-
"type": "git",
19-
"url": "git://github.com/TooTallNate/node-https-proxy-agent.git"
20-
},
21-
"keywords": [
22-
"https",
23-
"proxy",
24-
"endpoint",
25-
"agent"
26-
],
27-
"author": "Nathan Rajlich <[email protected]> (http://n8.io/)",
28-
"license": "MIT",
29-
"bugs": {
30-
"url": "https://github.com/TooTallNate/node-https-proxy-agent/issues"
31-
},
32-
"dependencies": {
33-
"agent-base": "6",
34-
"debug": "4"
5+
"build": "turbo run build",
6+
"lint": "turbo run lint",
7+
"test": "turbo run test",
8+
"format": "prettier --write \"**/*.{ts,tsx,md}\""
359
},
3610
"devDependencies": {
37-
"@types/debug": "4",
38-
"@types/node": "^12.12.11",
39-
"@typescript-eslint/eslint-plugin": "1.6.0",
40-
"@typescript-eslint/parser": "1.1.0",
41-
"eslint": "5.16.0",
42-
"eslint-config-airbnb": "17.1.0",
43-
"eslint-config-prettier": "4.1.0",
44-
"eslint-import-resolver-typescript": "1.1.1",
45-
"eslint-plugin-import": "2.16.0",
46-
"eslint-plugin-jsx-a11y": "6.2.1",
47-
"eslint-plugin-react": "7.12.4",
48-
"mocha": "^6.2.2",
49-
"proxy": "1",
50-
"rimraf": "^3.0.0",
51-
"typescript": "^3.5.3"
52-
},
53-
"engines": {
54-
"node": ">= 6"
11+
"@typescript-eslint/eslint-plugin": "^5.59.1",
12+
"@typescript-eslint/parser": "^5.59.1",
13+
"eslint": "^7.32.0",
14+
"eslint-config-prettier": "^8.8.0",
15+
"eslint-config-turbo": "^1.9.3",
16+
"prettier": "^2.5.1",
17+
"turbo": "latest"
5518
}
5619
}

0 commit comments

Comments
 (0)