From e7f69f5f912c813b576dd4fcac532e72ddecf94a Mon Sep 17 00:00:00 2001 From: Jan Buchar Date: Wed, 18 Mar 2026 15:20:48 +0100 Subject: [PATCH] ci: Set up automated checks and npm publishing --- .github/scripts/before-beta-release.js | 36 +++ .github/workflows/_check_code.yaml | 78 +++++ .github/workflows/_tests.yaml | 35 +++ .../workflows/_update_release_metadata.yaml | 86 ++++++ .github/workflows/manual_publish_to_npm.yaml | 51 ++++ .github/workflows/manual_release_stable.yaml | 80 +++++ .github/workflows/on_master.yaml | 56 ++++ .github/workflows/on_pull_request.yaml | 25 ++ package-lock.json | 284 +++++++++++++++++- package.json | 5 +- 10 files changed, 720 insertions(+), 16 deletions(-) create mode 100644 .github/scripts/before-beta-release.js create mode 100644 .github/workflows/_check_code.yaml create mode 100644 .github/workflows/_tests.yaml create mode 100644 .github/workflows/_update_release_metadata.yaml create mode 100644 .github/workflows/manual_publish_to_npm.yaml create mode 100644 .github/workflows/manual_release_stable.yaml create mode 100644 .github/workflows/on_master.yaml create mode 100644 .github/workflows/on_pull_request.yaml diff --git a/.github/scripts/before-beta-release.js b/.github/scripts/before-beta-release.js new file mode 100644 index 0000000..560d8d5 --- /dev/null +++ b/.github/scripts/before-beta-release.js @@ -0,0 +1,36 @@ +/* eslint-disable no-console */ +import { execSync } from 'node:child_process'; +import { readFileSync, writeFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const PKG_JSON_PATH = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'package.json'); + +const pkgJson = JSON.parse(readFileSync(PKG_JSON_PATH, 'utf8')); + +const PACKAGE_NAME = pkgJson.name; +const VERSION = pkgJson.version; + +const nextVersion = addBetaSuffixToVersion(VERSION); +console.log(`before-deploy: Setting version to ${nextVersion}`); +pkgJson.version = nextVersion; + +writeFileSync(PKG_JSON_PATH, `${JSON.stringify(pkgJson, null, 2)}\n`); + +function addBetaSuffixToVersion(version) { + const versionString = execSync(`npm show ${PACKAGE_NAME} versions --json`, { encoding: 'utf8' }); + const versions = JSON.parse(versionString); + + if (versions.some((v) => v === version)) { + console.error( + `before-deploy: A release with version ${version} already exists. Please increment version accordingly.`, + ); + process.exit(1); + } + + const prereleaseNumbers = versions + .filter((v) => v.startsWith(version) && v.includes('-')) + .map((v) => Number(v.match(/\.(\d+)$/)[1])); + const lastPrereleaseNumber = Math.max(-1, ...prereleaseNumbers); + return `${version}-beta.${lastPrereleaseNumber + 1}`; +} diff --git a/.github/workflows/_check_code.yaml b/.github/workflows/_check_code.yaml new file mode 100644 index 0000000..57ba949 --- /dev/null +++ b/.github/workflows/_check_code.yaml @@ -0,0 +1,78 @@ +name: Code checks + +on: + workflow_call: + workflow_dispatch: + +permissions: + contents: read + +jobs: + actions_lint_check: + name: Actions lint check + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Run actionlint + uses: rhysd/actionlint@v1.7.11 + + spell_check: + name: Spell check + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Check spelling with typos + uses: crate-ci/typos@v1 + + lint_check: + name: Lint check + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + cache: 'npm' + cache-dependency-path: 'package-lock.json' + - name: Install dependencies + run: npm ci + - name: Lint + run: npm run lint + + type_check: + name: Type check + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + cache: 'npm' + cache-dependency-path: 'package-lock.json' + - name: Install dependencies + run: npm ci + - name: Type check + run: npm run type-check + + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + cache: 'npm' + cache-dependency-path: 'package-lock.json' + - name: Install dependencies + run: npm ci + - name: Build + run: npm run build diff --git a/.github/workflows/_tests.yaml b/.github/workflows/_tests.yaml new file mode 100644 index 0000000..4ac93f2 --- /dev/null +++ b/.github/workflows/_tests.yaml @@ -0,0 +1,35 @@ +name: Tests + +on: + workflow_dispatch: + workflow_call: + +permissions: + contents: read + +jobs: + unit_tests: + name: Unit tests (Node.js ${{ matrix.node-version }}) + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node-version: [18, 20, 22, 24] + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: 'package-lock.json' + + - name: Install dependencies + run: npm ci + + - name: Unit tests + run: npm test diff --git a/.github/workflows/_update_release_metadata.yaml b/.github/workflows/_update_release_metadata.yaml new file mode 100644 index 0000000..6703734 --- /dev/null +++ b/.github/workflows/_update_release_metadata.yaml @@ -0,0 +1,86 @@ +name: Update release metadata + +on: + workflow_call: + inputs: + release_type: + description: Release type + type: string + default: auto + custom_version: + description: The custom version to bump to (only for "custom" type) + type: string + default: '' + outputs: + version_number: + description: The version number for the release + value: ${{ jobs.release_metadata.outputs.version_number }} + tag_name: + description: The tag name for the release + value: ${{ jobs.release_metadata.outputs.tag_name }} + changelog: + description: The full changelog content + value: ${{ jobs.release_metadata.outputs.changelog }} + release_notes: + description: The release notes for this version + value: ${{ jobs.release_metadata.outputs.release_notes }} + changelog_commitish: + description: The commit SHA after changelog update + value: ${{ jobs.update_changelog.outputs.changelog_commitish }} + +permissions: + contents: write + +jobs: + release_metadata: + name: Prepare release metadata + runs-on: ubuntu-latest + outputs: + version_number: ${{ steps.release_metadata.outputs.version_number }} + tag_name: ${{ steps.release_metadata.outputs.tag_name }} + changelog: ${{ steps.release_metadata.outputs.changelog }} + release_notes: ${{ steps.release_metadata.outputs.release_notes }} + steps: + - uses: apify/workflows/git-cliff-release@main + name: Prepare release metadata + id: release_metadata + with: + release_type: ${{ inputs.release_type }} + custom_version: ${{ inputs.custom_version }} + existing_changelog_path: CHANGELOG.md + token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} + + update_changelog: + needs: [release_metadata] + name: Update changelog + runs-on: ubuntu-latest + outputs: + changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }} + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} + + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + + - name: Update package version + run: npm version --no-git-tag-version --allow-same-version ${{ needs.release_metadata.outputs.version_number }} + + - name: Update changelog + uses: DamianReeves/write-file-action@master + with: + path: CHANGELOG.md + write-mode: overwrite + contents: ${{ needs.release_metadata.outputs.changelog }} + + - name: Commit changes + id: commit + uses: EndBug/add-and-commit@v9 + with: + author_name: Apify Release Bot + author_email: noreply@apify.com + message: 'chore(release): Update changelog and package version [skip ci]' diff --git a/.github/workflows/manual_publish_to_npm.yaml b/.github/workflows/manual_publish_to_npm.yaml new file mode 100644 index 0000000..b4a2619 --- /dev/null +++ b/.github/workflows/manual_publish_to_npm.yaml @@ -0,0 +1,51 @@ +name: NPM publish + +on: + workflow_dispatch: + inputs: + ref: + description: Git ref to publish (branch, tag, or commit SHA) + required: true + type: string + tag: + description: NPM dist-tag + required: true + type: choice + default: latest + options: + - latest + - beta + +permissions: + id-token: write + contents: read + +jobs: + npm_publish: + name: NPM publish + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref }} + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + cache-dependency-path: 'package-lock.json' + - name: Update npm + run: npm install -g npm@latest + - name: Install dependencies + run: npm ci + - name: Bump pre-release version + if: ${{ inputs.tag == 'beta' }} + run: node ./.github/scripts/before-beta-release.js + - name: Build + run: npm run build + - name: Publish + run: npm publish --provenance --tag ${{ inputs.tag }} + env: + NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }} diff --git a/.github/workflows/manual_release_stable.yaml b/.github/workflows/manual_release_stable.yaml new file mode 100644 index 0000000..0382e19 --- /dev/null +++ b/.github/workflows/manual_release_stable.yaml @@ -0,0 +1,80 @@ +name: Stable release + +on: + workflow_dispatch: + inputs: + release_type: + description: Release type + required: true + type: choice + default: auto + options: + - auto + - custom + - patch + - minor + - major + custom_version: + description: The custom version to bump to (only for "custom" type) + required: false + type: string + default: '' + +concurrency: + group: release + cancel-in-progress: false + +permissions: + contents: read + +jobs: + code_checks: + name: Code checks + uses: ./.github/workflows/_check_code.yaml + + tests: + name: Tests + uses: ./.github/workflows/_tests.yaml + + release_metadata: + name: Update release metadata + needs: [code_checks, tests] + permissions: + contents: write + uses: ./.github/workflows/_update_release_metadata.yaml + secrets: inherit + with: + release_type: ${{ inputs.release_type }} + custom_version: ${{ inputs.custom_version }} + + github_release: + name: GitHub release + needs: [release_metadata] + runs-on: ubuntu-latest + permissions: + contents: write + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: GitHub release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ needs.release_metadata.outputs.tag_name }} + name: ${{ needs.release_metadata.outputs.version_number }} + target_commitish: ${{ needs.release_metadata.outputs.changelog_commitish }} + body: ${{ needs.release_metadata.outputs.release_notes }} + + npm_publish: + name: NPM publish + needs: [release_metadata] + runs-on: ubuntu-latest + steps: + - name: Execute publish workflow + uses: apify/workflows/execute-workflow@main + with: + workflow: manual_publish_to_npm.yaml + inputs: > + { + "ref": "${{ needs.release_metadata.outputs.changelog_commitish }}", + "tag": "latest" + } diff --git a/.github/workflows/on_master.yaml b/.github/workflows/on_master.yaml new file mode 100644 index 0000000..37f81c5 --- /dev/null +++ b/.github/workflows/on_master.yaml @@ -0,0 +1,56 @@ +name: CI (master) + +on: + push: + branches: + - master + tags-ignore: + - '**' + +concurrency: + group: release + cancel-in-progress: false + +permissions: + contents: read + +jobs: + code_checks: + name: Code checks + uses: ./.github/workflows/_check_code.yaml + + tests: + if: "!startsWith(github.event.head_commit.message, 'docs')" + name: Tests + uses: ./.github/workflows/_tests.yaml + + release_metadata: + if: >- + startsWith(github.event.head_commit.message, 'feat') || + startsWith(github.event.head_commit.message, 'fix') || + startsWith(github.event.head_commit.message, 'perf') || + startsWith(github.event.head_commit.message, 'refactor') || + startsWith(github.event.head_commit.message, 'style') + name: Update pre-release metadata + needs: [code_checks, tests] + permissions: + contents: write + uses: ./.github/workflows/_update_release_metadata.yaml + secrets: inherit + with: + release_type: prerelease + + npm_publish: + name: NPM publish + needs: [release_metadata] + runs-on: ubuntu-latest + steps: + - name: Execute publish workflow + uses: apify/workflows/execute-workflow@main + with: + workflow: manual_publish_to_npm.yaml + inputs: > + { + "ref": "${{ needs.release_metadata.outputs.changelog_commitish }}", + "tag": "beta" + } diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml new file mode 100644 index 0000000..508a16c --- /dev/null +++ b/.github/workflows/on_pull_request.yaml @@ -0,0 +1,25 @@ +name: CI (PR) + +on: + pull_request: + +permissions: + contents: read + pull-requests: read + +jobs: + pr_title_check: + name: PR title check + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v6.1.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + code_checks: + name: Code checks + uses: ./.github/workflows/_check_code.yaml + + tests: + name: Tests + uses: ./.github/workflows/_tests.yaml diff --git a/package-lock.json b/package-lock.json index abab045..865cb36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "apify-test-tools", - "version": "0.5.5", + "version": "0.5.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "apify-test-tools", - "version": "0.5.5", + "version": "0.5.6", "license": "ISC", "dependencies": { "@apify/consts": "^2.43.0", "@slack/web-api": "^7.9.2", - "apify-client": "^2.12.6", + "apify-client": "^2.22.2", "yargs": "^18.0.0" }, "bin": { @@ -36,9 +36,9 @@ } }, "node_modules/@apify/consts": { - "version": "2.47.0", - "resolved": "https://registry.npmjs.org/@apify/consts/-/consts-2.47.0.tgz", - "integrity": "sha512-VFVrNn/S3bLPrS3v9x7Td5b8YtxPbrepuXLWu27n06T34qQeogysbnAWIBNnTQ59qRKlxrAeFR4ezI+fRXTMNQ==", + "version": "2.51.1", + "resolved": "https://registry.npmjs.org/@apify/consts/-/consts-2.51.1.tgz", + "integrity": "sha512-QV16f41BjmE7uYQgB+JeS5bhbEdFvP8eF1R5LiKlvGkERckSlMl1JIIaW1b/XwJdp3bEBKBGPtNlvYa06wyhwg==", "license": "Apache-2.0" }, "node_modules/@apify/eslint-config": { @@ -1208,6 +1208,12 @@ "npm": ">= 8.6.0" } }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "license": "MIT" + }, "node_modules/@tybys/wasm-util": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", @@ -1909,6 +1915,15 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1962,12 +1977,12 @@ } }, "node_modules/apify-client": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/apify-client/-/apify-client-2.20.0.tgz", - "integrity": "sha512-oEMTImVVRZ5n8JkFV6dgbBFL3Xqz+GTwjUCjn/hwSNkow31Q8VNGk4qYDfRjkoqNQJ3ZirhtCwTnhkSXn1Tf+g==", + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/apify-client/-/apify-client-2.22.2.tgz", + "integrity": "sha512-fqBi84kmbpsU7Rcmr3Oq0dxAcQls0sBnDeVCX5nWohvK0ELRk1pcaLjqp1CGtwyUGyQ9ZpWjEoi+QXxGY/92tw==", "license": "Apache-2.0", "dependencies": { - "@apify/consts": "^2.42.0", + "@apify/consts": "^2.50.0", "@apify/log": "^2.2.6", "@apify/utilities": "^2.23.2", "@crawlee/types": "^3.3.0", @@ -1976,6 +1991,7 @@ "axios": "^1.6.7", "content-type": "^1.0.5", "ow": "^0.28.2", + "proxy-agent": "^6.5.0", "tslib": "^2.5.0", "type-fest": "^4.0.0" } @@ -2177,6 +2193,18 @@ "node": ">=12" } }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/ast-types-flow": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", @@ -2263,6 +2291,15 @@ "dev": true, "license": "MIT" }, + "node_modules/basic-ftp": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.0.tgz", + "integrity": "sha512-VoMINM2rqJwJgfdHq6RiUudKt2BV+FY5ZFezP/ypmwayk68+NzzAQy4XXLlqsGD4MCzq3DrmNFD/uUmBJuGoXw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/brace-expansion": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", @@ -2516,6 +2553,15 @@ "dev": true, "license": "BSD-2-Clause" }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/data-view-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", @@ -2574,7 +2620,6 @@ "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -2641,6 +2686,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -2956,6 +3015,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, "node_modules/eslint": { "version": "8.57.1", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", @@ -3478,6 +3558,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/esquery": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", @@ -3508,7 +3601,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -3528,7 +3620,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" @@ -3889,6 +3980,20 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "node_modules/get-uri": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz", + "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==", + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -4125,6 +4230,32 @@ "node": ">= 0.4" } }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -4196,6 +4327,15 @@ "node": ">= 0.4" } }, + "node_modules/ip-address": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", + "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, "node_modules/is-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", @@ -4831,6 +4971,15 @@ "dev": true, "license": "MIT" }, + "node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", @@ -4925,7 +5074,6 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, "license": "MIT" }, "node_modules/nanoid": { @@ -4970,6 +5118,15 @@ "dev": true, "license": "MIT" }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -5246,6 +5403,38 @@ "node": ">=8" } }, + "node_modules/pac-proxy-agent": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz", + "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==", + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.6", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5404,6 +5593,25 @@ "react-is": "^16.13.1" } }, + "node_modules/proxy-agent": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.6", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.1.0", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -5869,6 +6077,54 @@ "node": ">=8" } }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.7", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", + "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==", + "license": "MIT", + "dependencies": { + "ip-address": "^10.0.1", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", diff --git a/package.json b/package.json index 4bd066e..ff35955 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,9 @@ "start": "npm run dist/bin/main.js", "start:dev": "GITHUB_WORKSPACE=local-clone tsx bin/main.ts", "build": "tsc && chmod +x ./dist/bin/main.js", - "lint": "eslint ./src --ext .ts", - "lint:fix": "eslint ./src --ext .ts --fix", + "lint": "eslint ./bin ./lib ./test ./index.ts --ext .ts", + "lint:fix": "eslint ./bin ./lib ./test ./index.ts --ext .ts --fix", + "type-check": "tsc --noEmit", "test": "vitest run" }, "author": "oklinov",