-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5c044d1
Showing
27 changed files
with
4,510 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"access": "public", | ||
"baseBranch": "main", | ||
"changelog": [ | ||
"@changesets/changelog-github", | ||
{ "repo": "wevm/http-proxy-pool" } | ||
], | ||
"commit": false, | ||
"fixed": [], | ||
"ignore": ["site"], | ||
"linked": [], | ||
"updateInternalDependencies": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'monthly' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Close Issue | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
close-issues: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Needs Reproduction | ||
uses: actions-cool/issues-helper@v3 | ||
with: | ||
actions: 'close-issues' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
labels: 'M: Needs Reproduction' | ||
inactive-day: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Label Issue | ||
|
||
on: | ||
issues: | ||
types: [labeled] | ||
|
||
jobs: | ||
reply-labeled: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Label needs reproduction | ||
if: github.event.label.name == 'Needs Reproduction' | ||
uses: peter-evans/close-issue@v3 | ||
with: | ||
close-reason: not_planned | ||
comment: | | ||
Hello @${{ github.event.issue.user.login }}. | ||
Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using [StackBlitz](https://stackblitz.com), [TypeScript Playground](https://www.typescriptlang.org/play) (for type issues), or a separate minimal GitHub repository. | ||
Minimal reproductions are required as they save us a lot of time reproducing your config & environment, and trying to reproduce your issue. See [Why reproductions are required](https://antfu.me/posts/why-reproductions-are-required). | ||
Please reopen this issue when a reproduction is added. | ||
issue-number: ${{ github.event.issue.number }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Pull request | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify: | ||
name: Verify | ||
uses: ./.github/workflows/verify.yml | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Main | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify: | ||
name: Verify | ||
uses: ./.github/workflows/verify.yml | ||
secrets: inherit | ||
|
||
changesets: | ||
name: Changesets | ||
needs: verify | ||
permissions: | ||
contents: write | ||
id-token: write | ||
issues: write | ||
repository-projects: write | ||
deployments: write | ||
packages: write | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Install dependencies | ||
uses: wevm/actions/.github/actions/pnpm | ||
|
||
- name: Create version pull request or publish to npm | ||
uses: changesets/action@v1 | ||
with: | ||
title: 'chore: version packages' | ||
commit: 'chore: version packages' | ||
publish: pnpm changeset:release | ||
version: pnpm changeset:version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Publish Prerelease | ||
if: steps.changesets.outputs.published != 'true' | ||
continue-on-error: true | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN" | ||
git reset --hard origin/main | ||
pnpm clean | ||
pnpm changeset version --no-git-tag --snapshot canary | ||
pnpm changeset publish --no-git-tag --snapshot canary --tag canary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Prune NPM tags | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
prune: | ||
name: Prune NPM tags | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .npmrc file | ||
uses: actions/setup-node@v4 | ||
with: | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Prune tags | ||
run: cd src && npm view --json | jq -r '.["dist-tags"] | to_entries | .[] | select(.key != "latest") | .key' | xargs -I % npm dist-tag rm frog % | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Verify | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
uses: wevm/actions/.github/actions/pnpm | ||
|
||
- name: Lint code | ||
run: pnpm lint | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
commit_message: 'chore: format' | ||
commit_user_name: 'github-actions[bot]' | ||
commit_user_email: 'github-actions[bot]@users.noreply.github.com' | ||
|
||
types: | ||
name: Types | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
uses: wevm/actions/.github/actions/pnpm | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Check types | ||
run: pnpm typecheck | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
uses: wevm/actions/.github/actions/pnpm | ||
|
||
- name: Run tests | ||
run: pnpm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.map | ||
.DS_Store | ||
.env | ||
_lib | ||
coverage | ||
node_modules | ||
tsconfig.*.tsbuildinfo | ||
tsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
auto-install-peers=false | ||
link-workspace-packages=deep | ||
provenance=true | ||
strict-peer-dependencies=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["biomejs.biome"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.formatOnSave": true, | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports.biome": "explicit" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024-present weth, LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# http-proxy-pool | ||
|
||
```ts | ||
import { createProxyPool } from 'http-proxy-pool' | ||
import { alto, anvil } from 'http-proxy-pool/instances/ethereum' | ||
|
||
const executionPool = createProxyPool({ | ||
instance: anvil({ | ||
// ... | ||
forkRpcUrl: 'https://cloudflare-eth.com' | ||
}), | ||
port: 8545, | ||
}) | ||
|
||
await executionPool.start() | ||
// Instances started at: | ||
// "http://localhost:8545/1" | ||
// "http://localhost:8545/2" | ||
// "http://localhost:8545/3" | ||
// "http://localhost:8545/n" | ||
|
||
const bundlerPool = createProxyPool({ | ||
instance: ({ id }) => alto({ | ||
// ... | ||
executionRpcUrl: `${executionPool.hostname}/${id}` | ||
}), | ||
port: 4337, | ||
}) | ||
|
||
await bundlerPool.start() | ||
// Instances started at: | ||
// "http://localhost:4337/1" (executionRpcUrl: "http://localhost:8545/1") | ||
// "http://localhost:4337/2" (executionRpcUrl: "http://localhost:8545/2") | ||
// "http://localhost:4337/3" (executionRpcUrl: "http://localhost:8545/3") | ||
// "http://localhost:4337/n" (executionRpcUrl: "http://localhost:8545/n") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", | ||
"files": { | ||
"ignore": [ | ||
"coverage", | ||
"node_modules", | ||
"src/_lib", | ||
"tsconfig.json", | ||
"tsconfig.*.json" | ||
] | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 2 | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"quoteStyle": "single", | ||
"trailingComma": "all", | ||
"semicolons": "asNeeded" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "http-proxy-pool", | ||
"scripts": { | ||
"build": "pnpm clean && tsc --project ./tsconfig.build.json", | ||
"changeset": "changeset", | ||
"changeset:release": "pnpm build && changeset publish", | ||
"changeset:version": "changeset version && pnpm install --lockfile-only && bun .scripts/postversion.ts", | ||
"clean": "rimraf src/_lib src/tsconfig.build.tsbuildinfo", | ||
"lint": "biome check . --apply", | ||
"postinstall": "pnpm build", | ||
"test": "vitest", | ||
"test:cov": "vitest --coverage", | ||
"typecheck": "tsc --noEmit" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.7.3", | ||
"@changesets/changelog-github": "^0.5.0", | ||
"@changesets/cli": "^2.27.3", | ||
"@vitest/coverage-v8": "^1.6.0", | ||
"rimraf": "^5.0.7", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.6.0" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
Oops, something went wrong.