├── .github ├── dependabot.yml ├── renovate.json ├── settings.yml ├── update-endpoints.yml └── workflows │ ├── release.yml │ └── test.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── README.md ├── bin ├── commands │ └── run.js ├── octoherd.js └── run.js ├── index.d.ts ├── index.js ├── lib ├── generated │ └── endpoints.js ├── octokit-plugin-cache.js ├── octokit-plugin-request-confirm.js ├── octokit-plugin-request-log.js ├── resolve-repositories.js └── run-script-against-repositories.js ├── package-lock.json ├── package.json ├── scripts └── generate-endpoints.js ├── tests ├── resolve-repositories.test.js └── smoke.test.js └── version.js /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "npm" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | # https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot 8 | - package-ecosystem: "npm" 9 | directory: "/" 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "github>octoherd/.github" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | _extends: .github 2 | repository: 3 | name: cli 4 | description: CLI to run a octoherd scripts on one or multiple repositories 5 | -------------------------------------------------------------------------------- /.github/update-endpoints.yml: -------------------------------------------------------------------------------- 1 | name: Update Prettier 2 | on: 3 | repository_dispatch: 4 | types: 5 | - octokit/openapi release 6 | workflow_dispatch: {} 7 | jobs: 8 | update_prettier: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - uses: actions/setup-node@v2 13 | with: 14 | version: 12 15 | - uses: actions/cache@v2 16 | with: 17 | path: ~/.npm 18 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} 19 | restore-keys: | 20 | ${{ runner.os }}-node- 21 | - run: npm ci 22 | - run: npm install @octokit/openapi@latest 23 | - run: node scripts/generate-endpoints.js 24 | - uses: gr2m/create-or-update-pull-request-action@v1.x 25 | env: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | with: 28 | title: "Enpoints updated" 29 | body: "An update to `@octokit/openapi` resulted in an update to `lib/generated/endpoints.js`" 30 | branch: ${{ github.ref }} 31 | commit-message: "build: endpoints updated" 32 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | "on": 3 | push: 4 | branches: 5 | - main 6 | - next 7 | - beta 8 | - "*.x" 9 | jobs: 10 | release: 11 | name: release 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 15 | - uses: actions/setup-node@v4 16 | with: 17 | node-version: lts/* 18 | cache: npm 19 | - run: npm ci 20 | - run: npm i semantic-release-plugin-update-version-in-files 21 | - run: npx semantic-release --debug 22 | env: 23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }} 25 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | "on": 3 | pull_request: 4 | types: 5 | - opened 6 | - synchronize 7 | jobs: 8 | test_matrix: 9 | runs-on: ubuntu-latest 10 | strategy: 11 | matrix: 12 | node: 13 | - 18 14 | - 20 15 | name: Node ${{ matrix.node }} 16 | steps: 17 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 18 | - uses: actions/setup-node@v4 19 | with: 20 | node-version: ${{ matrix.node }} 21 | cache: npm 22 | - run: npm ci 23 | - run: npm test 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | - Using welcoming and inclusive language 18 | - Being respectful of differing viewpoints and experiences 19 | - Gracefully accepting constructive criticism 20 | - Focusing on what is best for the community 21 | - Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | - The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | - Trolling, insulting/derogatory comments, and personal or political attacks 28 | - Public or private harassment 29 | - Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | - Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at opensource+coc@martynus.net. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [https://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: https://contributor-covenant.org 74 | [version]: https://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2020 Gregor Martynus 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Octoherd CLI 2 | 3 | > CLI to run a custom script on one or multiple repositories 4 | 5 | ## Usage 6 | 7 | ``` 8 | Usage: octoherd run -S path/to/script.js [options] 9 | 10 | Options: 11 | --help Show help [boolean] 12 | -S, --octoherd-script Path to *.js script. Must be an ES Module. [string] [required] 13 | -T, --octoherd-token Requires the "public_repo" scope for public repositories, "rep 14 | o" scope for private repositories. Creates an OAuth token if n 15 | ot set. [string] 16 | -R, --octoherd-repos One or multiple repositories in the form of 'repo-owner/repo-n 17 | ame'. 'repo-owner/*' will find all repositories for one owner. 18 | '*' will find all repositories the user has access to. 19 | To exclude a repository use '!repo-owner/repo'. Will prompt 20 | for repositories if not set. [array] 21 | --octoherd-cache Cache responses for debugging. Creates a ./cache folder if fla 22 | g is set. Override by passing custom path [string] 23 | --octoherd-debug Show debug logs [boolean] [default: false] 24 | --octoherd-bypass-confirms Bypass prompts to confirm mutating requests 25 | [boolean] [default: false] 26 | --octoherd-base-url When using with GitHub Enterprise Server, set to the root URL 27 | of the API. For example, if your GitHub Enterprise Server's h 28 | ostname is github.acme-inc.com, then set to https://github.ac 29 | me-inc.com/api/v3. [string] 30 | --version Show version number [boolean] 31 | 32 | Examples: 33 | octoherd run -S path/to/script.js Minimal usage example 34 | octoherd run -S path/to/script.js -T $TOKEN -R Pass token and repos as CLI flags 35 | octoherd/cli 36 | octoherd run -S path/to/script.js -T $TOKEN -R Avoid prompts for token and repos 37 | octoherd/cli 38 | octoherd run -S path/to/script.js -T $TOKEN -R Avoid any prompts 39 | octoherd/cli --octoherd-bypass-confirms 40 | octoherd run -S path/to/script.js -T $TOKEN -R Will fetch all repositories except repo-owner/hello-world 41 | 'repo-owner/*' -R '!repo-owner/hello-world 42 | octoherd run -S path/to/script.js Run octoherd script against GHES 43 | --octoherd-base-url 44 | https://github.acme-inc.com/api/v3 45 | ``` 46 | 47 | The `script` must export a `script` function which takes three parameters: 48 | 49 | ```js 50 | export async function script(octokit, repository, options) { 51 | // do something here 52 | } 53 | ``` 54 | 55 | - `octokit` is an instance of [`octokit.js`'s Octokit](https://github.com/octokit/octokit.js) 56 | - `repository` is the response data of [`GET /repos/{owner}/{repo}`](https://developer.github.com/v3/repos/#get-a-repository) 57 | - `options` are all options passed to the CLI which are not used by `octoherd`. 58 | 59 | ## Examples 60 | 61 | - https://github.com/topics/octoherd-script 62 | 63 | ## Similar projects 64 | 65 | - [NerdWalletOSS/shepherd](https://github.com/NerdWalletOSS/shepherd) - A utility for applying code changes across many repositories. 66 | - [FormidableLabs/multibot](https://github.com/FormidableLabs/multibot) - A friendly multi-repository robot 67 | 68 | ## License 69 | 70 | [ISC](LICENSE.md) 71 | -------------------------------------------------------------------------------- /bin/commands/run.js: -------------------------------------------------------------------------------- 1 | import { resolve } from "path"; 2 | 3 | import chalk from "chalk"; 4 | import { VERSION as OctokitVersion } from "@octoherd/octokit"; 5 | 6 | import { VERSION } from "../../version.js"; 7 | 8 | const VERSIONS = ` 9 | @octoherd/cli: v${VERSION} 10 | @octoherd/octokit: v${OctokitVersion} 11 | Node.js: ${process.version}, ${process.platform} ${process.arch}`.trim(); 12 | 13 | /** @type { {[key: string]: import("yargs").Options} } */ 14 | const options = { 15 | "octoherd-script": { 16 | description: "Path to *.js script. Must be an ES Module.", 17 | demandOption: true, 18 | type: "string", 19 | alias: "S", 20 | }, 21 | "octoherd-token": { 22 | description: 23 | 'Requires the "public_repo" scope for public repositories, "repo" scope for private repositories. Creates an OAuth token if not set.', 24 | type: "string", 25 | alias: "T", 26 | }, 27 | "octoherd-repos": { 28 | description: 29 | "One or multiple repositories in the form of 'repo-owner/repo-name'. 'repo-owner/*' will find all repositories for one owner. '*' will find all repositories the user has access to. To exclude a repository use '!repo-owner/repo'. Will prompt for repositories if not set.", 30 | type: "string", 31 | array: true, 32 | alias: "R", 33 | }, 34 | "octoherd-cache": { 35 | description: 36 | "Cache responses for debugging. Creates a ./cache folder if flag is set. Override by passing custom path", 37 | type: "string", 38 | }, 39 | "octoherd-debug": { 40 | description: "Show debug logs", 41 | type: "boolean", 42 | default: false, 43 | }, 44 | "octoherd-bypass-confirms": { 45 | description: "Bypass prompts to confirm mutating requests", 46 | type: "boolean", 47 | default: false, 48 | }, 49 | "octoherd-base-url": { 50 | description: "When using with GitHub Enterprise Server, set to the root URL of the API. For example, if your GitHub Enterprise Server's hostname is github.acme-inc.com, then set to https://github.acme-inc.com/api/v3.", 51 | type: "string", 52 | } 53 | }; 54 | 55 | /** @type import('yargs').CommandModule */ 56 | const runCommand = { 57 | command: "run", 58 | describe: "", 59 | builder: (yargs) => 60 | yargs 61 | .wrap(96) 62 | .usage("Usage: octoherd run -S path/to/script.js [options]") 63 | .example([ 64 | ["octoherd run -S path/to/script.js", "Minimal usage example"], 65 | [ 66 | "octoherd run -S path/to/script.js -T $TOKEN -R octoherd/cli", 67 | "Pass token and repos as CLI flags", 68 | ], 69 | [ 70 | "octoherd run -S path/to/script.js -T $TOKEN -R octoherd/cli", 71 | "Avoid prompts for token and repos", 72 | ], 73 | [ 74 | "octoherd run -S path/to/script.js -T $TOKEN -R octoherd/cli --octoherd-bypass-confirms", 75 | "Avoid any prompts", 76 | ], 77 | [ 78 | "octoherd run -S path/to/script.js --octoherd-base-url https://github.acme-inc.com/api/v3", 79 | "Run octoherd script against GHES", 80 | ], 81 | ]) 82 | .options(options) 83 | .version(VERSIONS) 84 | .coerce("octoherd-script", async (script) => { 85 | if (!script) return; 86 | 87 | if (typeof script === "function") return script; 88 | 89 | let scriptModule; 90 | const path = resolve(process.cwd(), script); 91 | 92 | try { 93 | scriptModule = await import(path); 94 | } catch (error) { 95 | if (error.code === 'ERR_MODULE_NOT_FOUND') { 96 | throw new Error( 97 | `[octoherd] ${path} does not exist` 98 | ); 99 | } 100 | 101 | const err = new Error( 102 | `[octoherd] ${error}\n at ${path}` 103 | ) 104 | throw err; 105 | } 106 | 107 | if (!scriptModule.script) { 108 | throw new Error(`[octoherd] no "script" exported at ${path}`); 109 | } 110 | 111 | return scriptModule.script; 112 | }), 113 | handler: () => { 114 | console.log( 115 | `\n${chalk.bold("Running @octoherd/cli v%s")} ${chalk.gray( 116 | "(@octoherd/octokit v%s, Node.js: %s, %s %s)" 117 | )}\n`, 118 | VERSION, 119 | OctokitVersion, 120 | process.version, 121 | process.platform, 122 | process.arch 123 | ); 124 | }, 125 | }; 126 | 127 | export default runCommand; 128 | -------------------------------------------------------------------------------- /bin/octoherd.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import yargs from "yargs"; 4 | import { hideBin } from "yargs/helpers"; 5 | 6 | import chalk from "chalk"; 7 | 8 | import { octoherd } from "../index.js"; 9 | import { VERSION } from "../version.js"; 10 | import runCommand from "./commands/run.js"; 11 | 12 | const EPILOG = chalk.gray(`Questions? Ideas? Feedback? 13 | https://github.com/octoherd/octoherd/discussions 14 | 15 | Copyright 2020-${new Date().getFullYear()} Octoherd Contributors`); 16 | 17 | const argv = await yargs(hideBin(process.argv)) 18 | .command(runCommand) 19 | .demandCommand() 20 | .version(VERSION) 21 | .epilog(EPILOG).argv; 22 | 23 | try { 24 | await octoherd(argv); 25 | } catch (error) { 26 | console.error(error); 27 | process.exit(1); 28 | } 29 | -------------------------------------------------------------------------------- /bin/run.js: -------------------------------------------------------------------------------- 1 | import yargs from "yargs"; 2 | import { hideBin } from "yargs/helpers"; 3 | 4 | import { octoherd } from "../index.js"; 5 | import runCommand from "./commands/run.js"; 6 | 7 | /** 8 | * Function is used by Octoherd Script modules to provide a dedicated CLI binary 9 | * 10 | * import { script } from "./script.js"; 11 | * import { run } from "@octoherd/cli/run"; 12 | * run(script); 13 | * 14 | * @param {function} script Octoherd Script function 15 | */ 16 | export async function run(script) { 17 | const argv = await yargs(["run", ...hideBin(process.argv)]) 18 | .command(runCommand) 19 | .default("octoherd-script", () => script).argv; 20 | 21 | try { 22 | await octoherd(argv); 23 | } catch (error) { 24 | console.error(error); 25 | process.exit(1); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | import { octoherd } from "./index.js"; 2 | import { components } from "@octokit/openapi-types"; 3 | 4 | export { Octokit } from "@octoherd/octokit"; 5 | export type Repository = components["schemas"]["repository"]; 6 | 7 | export type OctoherdOptions = { 8 | /** The Octoherd Script function */ 9 | octoherdScript: Function; 10 | /** Personal Access Token: Requires the "public_repo" scope for public repositories, "repo" scope for private repositories. */ 11 | octoherdToken: string; 12 | /** Array of repository names in the form of "repo-owner/repo-name". To match all repositories for an owner, pass "repo-owner/*" */ 13 | octoherdRepos: string[]; 14 | /** Cache responses for debugging */ 15 | octoherdCache: boolean; 16 | /** Bypass confirmation prompts for mutating requests */ 17 | octoherdBypassConfirms: boolean; 18 | 19 | /** `octoherdScript` may accept its own options */ 20 | [key: string]: unknown; 21 | }; 22 | 23 | /** 24 | * Find all releases in a GitHub repository or organization after a specified date 25 | */ 26 | export async function octoherd(options: OctoherdOptions): void; 27 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { appendFileSync } from "fs"; 2 | 3 | import { Octokit } from "@octoherd/octokit"; 4 | import { createOAuthDeviceAuth } from "@octokit/auth-oauth-device"; 5 | import chalk from "chalk"; 6 | import { temporaryFile } from "tempy"; 7 | import clipboardy from "clipboardy"; 8 | import enquirer from "enquirer"; 9 | 10 | import { cache as octokitCachePlugin } from "./lib/octokit-plugin-cache.js"; 11 | import { requestLog } from "./lib/octokit-plugin-request-log.js"; 12 | import { requestConfirm } from "./lib/octokit-plugin-request-confirm.js"; 13 | import { runScriptAgainstRepositories } from "./lib/run-script-against-repositories.js"; 14 | import { VERSION } from "./version.js"; 15 | 16 | export { Octokit } from "@octoherd/octokit"; 17 | 18 | const levelColor = { 19 | debug: chalk.bgGray.black, 20 | info: chalk.bgGreen.black, 21 | warn: chalk.bgYellow.black, 22 | error: chalk.bgRed.white.bold, 23 | }; 24 | 25 | /** 26 | * @param {import(".").OctoherdOptions} options 27 | */ 28 | export async function octoherd(options) { 29 | const { 30 | octoherdToken, 31 | octoherdCache = false, 32 | octoherdScript, 33 | octoherdRepos, 34 | octoherdBypassConfirms, 35 | octoherdBaseUrl, 36 | ...userOptions 37 | } = options; 38 | 39 | const tmpLogFile = temporaryFile({ extension: "ndjson.log" }); 40 | 41 | const plugins = [requestLog, requestConfirm]; 42 | if (typeof octoherdCache === "string") plugins.push(octokitCachePlugin); 43 | const CliOctokit = Octokit.plugin(...plugins); 44 | 45 | const authOptions = octoherdToken 46 | ? { auth: octoherdToken } 47 | : { 48 | authStrategy: createOAuthDeviceAuth, 49 | auth: { 50 | // Octoherd's OAuth App 51 | clientId: "e93735961b3b72ca5c02", 52 | clientType: "oauth-app", 53 | scopes: ["repo"], 54 | async onVerification({ verification_uri, user_code }) { 55 | console.log("Open %s", verification_uri); 56 | 57 | await clipboardy.write(user_code); 58 | console.log("Paste code: %s (copied to your clipboard)", user_code); 59 | 60 | console.log( 61 | `\n${chalk.gray( 62 | "To avoid this prompt, pass a token with --octoherd-token or -T" 63 | )}\n` 64 | ); 65 | 66 | const prompt = new enquirer.Input({ 67 | message: "Press when ready", 68 | }); 69 | 70 | await prompt.run(); 71 | }, 72 | }, 73 | }; 74 | 75 | const octokit = new CliOctokit({ 76 | ...authOptions, 77 | userAgent: ["octoherd-cli", VERSION].join("/"), 78 | baseUrl: octoherdBaseUrl, 79 | octoherd: { 80 | cache: octoherdCache, 81 | bypassConfirms: octoherdBypassConfirms, 82 | onLogMessage(level, message, additionalData) { 83 | // ignore the `octoherd` property in meta data 84 | const { octoherd, ...meta } = additionalData; 85 | let additionalDataString = JSON.stringify(meta); 86 | 87 | if (additionalDataString.length > 300) { 88 | additionalDataString = additionalDataString.slice(0, 295) + " … }"; 89 | } 90 | 91 | console.log( 92 | levelColor[level](" " + level.toUpperCase() + " "), 93 | Object.keys(meta).length 94 | ? `${message} ${chalk.gray(additionalDataString)}` 95 | : message 96 | ); 97 | }, 98 | onLogData(data) { 99 | appendFileSync(tmpLogFile, JSON.stringify(data) + "\n"); 100 | }, 101 | }, 102 | }); 103 | 104 | // trigger OAuth Device Flow before loading repositories 105 | // It's not necessary, but a better UX 106 | await octokit.auth({ type: "oauth-user" }); 107 | 108 | const state = { 109 | log: console, 110 | octokit, 111 | script: octoherdScript, 112 | userOptions, 113 | octoherdReposPassedAsFlag: !!octoherdRepos, 114 | }; 115 | 116 | await runScriptAgainstRepositories(state, octoherdRepos); 117 | 118 | console.log(""); 119 | console.log(chalk.gray("-".repeat(80))); 120 | console.log(""); 121 | console.log(`Log file written to ${tmpLogFile}`); 122 | 123 | if ("octoherdCache" in options) { 124 | console.log( 125 | "Request cache written to %s", 126 | options.octoherdCache || "./cache" 127 | ); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /lib/octokit-plugin-cache.js: -------------------------------------------------------------------------------- 1 | import { URL } from "url"; 2 | import { dirname, join } from "path"; 3 | 4 | import { mkdirp } from "mkdirp"; 5 | import jsonfile from "jsonfile"; 6 | 7 | export function cache(octokit, { octoherd: { cache } }) { 8 | octokit.hook.wrap("request", async (request, options) => { 9 | if (options.method !== "GET") { 10 | return request(options); 11 | } 12 | 13 | const { url } = octokit.request.endpoint.parse(options); 14 | 15 | const { pathname, searchParams } = new URL(url); 16 | const page = searchParams.get("page"); 17 | const basePath = cache || "./cache"; 18 | const cachePath = join( 19 | basePath, 20 | `${pathname}${page ? `-page-${page}` : ""}.json` 21 | ); 22 | 23 | try { 24 | return jsonfile.readFileSync(cachePath); 25 | } catch (error) { 26 | const response = await request(options); 27 | 28 | mkdirp.sync(dirname(cachePath)); 29 | jsonfile.writeFileSync(cachePath, response); 30 | return response; 31 | } 32 | }); 33 | } 34 | -------------------------------------------------------------------------------- /lib/octokit-plugin-request-confirm.js: -------------------------------------------------------------------------------- 1 | // import Confirm from "prompt-confirm"; 2 | import enquirer from "enquirer"; 3 | import chalk from "chalk"; 4 | 5 | import { ENDPOINTS } from "./generated/endpoints.js"; 6 | 7 | export function requestConfirm(octokit, { octoherd }) { 8 | const allowAll = { 9 | "*": false, 10 | }; 11 | octokit.hook.wrap("request", async (request, options) => { 12 | const isMutatingRequest = ["POST", "PUT", "PATCH", "DELETE"].includes( 13 | options.method 14 | ); 15 | const { 16 | method, 17 | url, 18 | headers, 19 | mediaType, 20 | request: requestOptions, 21 | baseUrl, 22 | ...parameters 23 | } = options; 24 | const route = `${method} ${url}`; 25 | 26 | const { name, documentationUrl } = ENDPOINTS[route] || {}; 27 | 28 | if (baseUrl !== "https://api.github.com") return request(options); 29 | if (octoherd.bypassConfirms) return request(options); 30 | if (!isMutatingRequest) return request(options); 31 | if (allowAll["*"]) return request(options); 32 | if (allowAll[route]) return request(options); 33 | 34 | const parameterPadding = 35 | Math.max(5, ...Object.keys(parameters).map((p) => p.length)) + 1; 36 | 37 | const choices = [ 38 | "yes", 39 | "no", 40 | { name: "yes_endpoint", message: `yes, for all "${route}" requests` }, 41 | { name: "yes_all", message: "yes, for all requests" }, 42 | ]; 43 | const prompt = new enquirer.Select({ 44 | name: "allow", 45 | message: 46 | `Do you want to allow the following request: 47 | 48 | ${name ? chalk.bold(name) : chalk.yellow("")} 49 | ${"route:".padEnd(parameterPadding)} ${route} 50 | ${Object.entries(parameters) 51 | .map(([key, value]) => ` ${(key + ":").padEnd(parameterPadding)} ${value}`) 52 | .join("\n")} 53 | 54 | ${documentationUrl || ""}`.trim() + "\n", 55 | choices, 56 | }); 57 | const allow = await prompt.run(); 58 | 59 | if (allow === "no") { 60 | const error = new Error(`"${route}" canceled`); 61 | error.cancel = true; 62 | throw error; 63 | } 64 | 65 | if (allow === "yes_all") { 66 | allowAll["*"] = true; 67 | } 68 | 69 | if (allow === "yes_endpoint") { 70 | allowAll[route] = true; 71 | } 72 | 73 | return request(options); 74 | }); 75 | } 76 | -------------------------------------------------------------------------------- /lib/octokit-plugin-request-log.js: -------------------------------------------------------------------------------- 1 | export function requestLog(octokit) { 2 | octokit.hook.wrap("request", async (request, options) => { 3 | const start = Date.now(); 4 | const requestOptions = octokit.request.endpoint.parse(options); 5 | const path = requestOptions.url.replace(options.baseUrl, ""); 6 | 7 | return request(options) 8 | .then((response) => { 9 | const time = Date.now() - start; 10 | octokit.log.debug( 11 | { request: { ...options, time } }, 12 | `${requestOptions.method} ${path} - ${response.status} in ${time}ms` 13 | ); 14 | return response; 15 | }) 16 | 17 | .catch((error) => { 18 | const time = Date.now() - start; 19 | 20 | octokit.log.debug( 21 | { request: { ...options, time } }, 22 | `${requestOptions.method} ${path} - ${error.status} in ${time}ms` 23 | ); 24 | throw error; 25 | }); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /lib/resolve-repositories.js: -------------------------------------------------------------------------------- 1 | export async function resolveRepositories(state, repositories) { 2 | const ignoreRepositories = repositories.reduce((memo, fullName) => { 3 | if (fullName.startsWith('!')) { 4 | memo.push(fullName.slice(1)) 5 | } 6 | return memo; 7 | }, []); 8 | 9 | const repositoriesWithStars = repositories.filter((fullName) => { 10 | return /^[a-z0-9_.-]+\/(\*|[a-z0-9_.-]+\*|\*[a-z0-9_.-]+|[a-z0-9_.-]+\*[a-z0-9_.-]+)$/i.test( 11 | fullName 12 | ) && !fullName.startsWith('!'); 13 | }); 14 | 15 | const repositoriesWithoutStars = repositories.filter((fullName) => { 16 | return !/\*/i.test(fullName) && !fullName.startsWith('!'); 17 | }); 18 | const allRepositories = !!repositories.find((name) => name === "*"); 19 | 20 | const resolvedRepositories = []; 21 | 22 | for (const name of repositoriesWithoutStars) { 23 | const [owner, repo] = name.split("/"); 24 | try { 25 | const { data } = await state.octokit.request("/repos/{owner}/{repo}", { 26 | owner, 27 | repo, 28 | }); 29 | resolvedRepositories.push(data); 30 | } catch (error) { 31 | if (error.status !== 404) throw error; 32 | 33 | state.octokit.log.warn(`Repository ${owner}/${repo} could not be found`); 34 | } 35 | process.stdout.write("."); 36 | } 37 | 38 | for (const name of repositoriesWithStars) { 39 | const [owner, repoPattern] = name.split("/"); 40 | const isOrg = await state.octokit 41 | .request("HEAD /orgs/:org", { 42 | org: owner, 43 | }) 44 | .then( 45 | () => true, 46 | () => false 47 | ); 48 | const paginateReposRoute = isOrg 49 | ? // https://docs.github.com/en/rest/reference/repos#list-organization-repositories 50 | "GET /orgs/{owner}/repos" 51 | : // https://docs.github.com/en/rest/reference/repos#list-repositories-for-the-authenticated-user 52 | "GET /user/repos"; 53 | 54 | for await (const response of state.octokit.paginate.iterator( 55 | paginateReposRoute, 56 | { 57 | ...(isOrg ? { owner } : { affiliation: "owner" }), 58 | per_page: 100, 59 | } 60 | )) { 61 | let selectedRepositories = response.data; 62 | 63 | if (repoPattern !== "*") { 64 | const repoRegex = new RegExp(`^${repoPattern.replace(/\*/g, ".*")}$`); 65 | selectedRepositories = selectedRepositories.filter((repo) => 66 | repoRegex.test(repo.name) 67 | ); 68 | } 69 | 70 | resolvedRepositories.push(...selectedRepositories); 71 | process.stdout.write("."); 72 | } 73 | } 74 | 75 | if (allRepositories) { 76 | for await (const response of state.octokit.paginate.iterator( 77 | "GET /user/repos", 78 | { 79 | per_page: 100, 80 | } 81 | )) { 82 | resolvedRepositories.push(...response.data); 83 | process.stdout.write("."); 84 | } 85 | } 86 | 87 | process.stdout.write("\n"); 88 | 89 | function includesRepository(list, repo) { 90 | return list.some((x) => x.toLowerCase() === repo.full_name.toLowerCase()) 91 | } 92 | 93 | // return array with unique repositories based by id (https://stackoverflow.com/a/56757215) 94 | return resolvedRepositories 95 | .filter((repo, index, repoList) => repoList.findIndex(v2 => (v2.id === repo.id)) === index) 96 | .filter(repo => !includesRepository(ignoreRepositories, repo)) 97 | } 98 | -------------------------------------------------------------------------------- /lib/run-script-against-repositories.js: -------------------------------------------------------------------------------- 1 | import enquirer from "enquirer"; 2 | import chalk from "chalk"; 3 | 4 | import { resolveRepositories } from "./resolve-repositories.js"; 5 | 6 | export async function runScriptAgainstRepositories(state, octoherdRepos = []) { 7 | if (!state.octoherdReposPassedAsFlag) { 8 | console.log(""); 9 | const prompt = new enquirer.List({ 10 | message: "Enter repositories", 11 | separator: / +/, 12 | hint: 13 | "e.g. octoherd/cli. Use a * to load all repositories for an owner, e.g. octoherd/*. Enter nothing to exit", 14 | validate(input) { 15 | const values = typeof input === "string" ? [input] : input; 16 | 17 | const invalid = values.find((value) => { 18 | if (value.trim() === "*") return; 19 | 20 | if (/^!?[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.*-]+$/.test(value.trim())) { 21 | return; 22 | } 23 | 24 | return true; 25 | }); 26 | 27 | if (!invalid) return true; 28 | 29 | return ( 30 | chalk.red(`"${invalid}" is not a valid repository name.`) + 31 | chalk.gray(" The format is /") 32 | ); 33 | }, 34 | }); 35 | 36 | octoherdRepos = await prompt.run(); 37 | 38 | if (!state.reposNoticeShown) { 39 | console.log( 40 | `${chalk.gray( 41 | "To avoid this prompt in future, pass repositories with --octoherd-repos or -R" 42 | )}\n` 43 | ); 44 | } 45 | state.reposNoticeShown = true; 46 | } 47 | 48 | if (octoherdRepos.length === 0) return; 49 | 50 | try { 51 | state.octokit.log.info("Loading repositories ..."); 52 | const repositories = await resolveRepositories(state, octoherdRepos); 53 | 54 | for (const repository of repositories) { 55 | state.octokit.log.info( 56 | { octoherd: true }, 57 | "Running on %s ...", 58 | repository.full_name 59 | ); 60 | 61 | try { 62 | const { id, owner, name } = repository; 63 | state.octokit.log.setContext({ repository: { id, owner, name } }); 64 | await state.script(state.octokit, repository, state.userOptions); 65 | } catch (error) { 66 | if (!error.cancel) throw error; 67 | state.octokit.log.debug(error.message); 68 | } 69 | } 70 | } catch (error) { 71 | state.octokit.log.error(error); 72 | process.exitCode = 1; 73 | } 74 | 75 | await runScriptAgainstRepositories(state); 76 | } 77 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@octoherd/cli", 3 | "version": "0.0.0-development", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "@octoherd/cli", 9 | "version": "0.0.0-development", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@octoherd/octokit": "^5.0.0", 13 | "@octokit/auth-oauth-device": "^8.0.0", 14 | "@octokit/openapi-types": "^25.0.0", 15 | "chalk": "^5.0.0", 16 | "clipboardy": "^4.0.0", 17 | "enquirer": "^2.3.6", 18 | "jsonfile": "^6.0.1", 19 | "mkdirp": "^3.0.0", 20 | "tempy": "^3.0.0", 21 | "yargs": "^18.0.0" 22 | }, 23 | "bin": { 24 | "octoherd": "bin/octoherd.js" 25 | }, 26 | "devDependencies": { 27 | "@octokit/openapi": "^19.0.0", 28 | "prettier": "^3.0.0", 29 | "simple-mock": "^0.8.0", 30 | "uvu": "^0.5.1" 31 | } 32 | }, 33 | "node_modules/@isaacs/cliui": { 34 | "version": "8.0.2", 35 | "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", 36 | "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", 37 | "license": "ISC", 38 | "dependencies": { 39 | "string-width": "^5.1.2", 40 | "string-width-cjs": "npm:string-width@^4.2.0", 41 | "strip-ansi": "^7.0.1", 42 | "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", 43 | "wrap-ansi": "^8.1.0", 44 | "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" 45 | }, 46 | "engines": { 47 | "node": ">=12" 48 | } 49 | }, 50 | "node_modules/@isaacs/cliui/node_modules/ansi-regex": { 51 | "version": "6.1.0", 52 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", 53 | "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", 54 | "license": "MIT", 55 | "engines": { 56 | "node": ">=12" 57 | }, 58 | "funding": { 59 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 60 | } 61 | }, 62 | "node_modules/@isaacs/cliui/node_modules/strip-ansi": { 63 | "version": "7.1.0", 64 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 65 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 66 | "license": "MIT", 67 | "dependencies": { 68 | "ansi-regex": "^6.0.1" 69 | }, 70 | "engines": { 71 | "node": ">=12" 72 | }, 73 | "funding": { 74 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 75 | } 76 | }, 77 | "node_modules/@octoherd/octokit": { 78 | "version": "5.0.1", 79 | "resolved": "https://registry.npmjs.org/@octoherd/octokit/-/octokit-5.0.1.tgz", 80 | "integrity": "sha512-CE868kHaeGU9DuryIkSo0/5UAtU8ftLJbQI+uZ5ERwEMcqs8S4IJPjznh9Lam6Pmscsk1pe5Xd5lUvrQue8dHg==", 81 | "license": "ISC", 82 | "dependencies": { 83 | "@octokit/core": "^6.1.2", 84 | "@octokit/plugin-paginate-rest": "^12.0.0", 85 | "@octokit/plugin-retry": "^7.0.0", 86 | "@octokit/plugin-throttling": "^10.0.0", 87 | "quick-format-unescaped": "^4.0.1", 88 | "semantic-release-plugin-update-version-in-files": "^2.0.0" 89 | }, 90 | "engines": { 91 | "node": ">= 18" 92 | } 93 | }, 94 | "node_modules/@octokit/auth-oauth-device": { 95 | "version": "8.0.1", 96 | "resolved": "https://registry.npmjs.org/@octokit/auth-oauth-device/-/auth-oauth-device-8.0.1.tgz", 97 | "integrity": "sha512-TOqId/+am5yk9zor0RGibmlqn4V0h8vzjxlw/wYr3qzkQxl8aBPur384D1EyHtqvfz0syeXji4OUvKkHvxk/Gw==", 98 | "license": "MIT", 99 | "dependencies": { 100 | "@octokit/oauth-methods": "^6.0.0", 101 | "@octokit/request": "^10.0.2", 102 | "@octokit/types": "^14.0.0", 103 | "universal-user-agent": "^7.0.0" 104 | }, 105 | "engines": { 106 | "node": ">= 20" 107 | } 108 | }, 109 | "node_modules/@octokit/auth-token": { 110 | "version": "5.1.2", 111 | "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-5.1.2.tgz", 112 | "integrity": "sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw==", 113 | "license": "MIT", 114 | "engines": { 115 | "node": ">= 18" 116 | } 117 | }, 118 | "node_modules/@octokit/core": { 119 | "version": "6.1.5", 120 | "resolved": "https://registry.npmjs.org/@octokit/core/-/core-6.1.5.tgz", 121 | "integrity": "sha512-vvmsN0r7rguA+FySiCsbaTTobSftpIDIpPW81trAmsv9TGxg3YCujAxRYp/Uy8xmDgYCzzgulG62H7KYUFmeIg==", 122 | "license": "MIT", 123 | "dependencies": { 124 | "@octokit/auth-token": "^5.0.0", 125 | "@octokit/graphql": "^8.2.2", 126 | "@octokit/request": "^9.2.3", 127 | "@octokit/request-error": "^6.1.8", 128 | "@octokit/types": "^14.0.0", 129 | "before-after-hook": "^3.0.2", 130 | "universal-user-agent": "^7.0.0" 131 | }, 132 | "engines": { 133 | "node": ">= 18" 134 | } 135 | }, 136 | "node_modules/@octokit/core/node_modules/@octokit/endpoint": { 137 | "version": "10.1.4", 138 | "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.4.tgz", 139 | "integrity": "sha512-OlYOlZIsfEVZm5HCSR8aSg02T2lbUWOsCQoPKfTXJwDzcHQBrVBGdGXb89dv2Kw2ToZaRtudp8O3ZIYoaOjKlA==", 140 | "license": "MIT", 141 | "dependencies": { 142 | "@octokit/types": "^14.0.0", 143 | "universal-user-agent": "^7.0.2" 144 | }, 145 | "engines": { 146 | "node": ">= 18" 147 | } 148 | }, 149 | "node_modules/@octokit/core/node_modules/@octokit/request": { 150 | "version": "9.2.3", 151 | "resolved": "https://registry.npmjs.org/@octokit/request/-/request-9.2.3.tgz", 152 | "integrity": "sha512-Ma+pZU8PXLOEYzsWf0cn/gY+ME57Wq8f49WTXA8FMHp2Ps9djKw//xYJ1je8Hm0pR2lU9FUGeJRWOtxq6olt4w==", 153 | "license": "MIT", 154 | "dependencies": { 155 | "@octokit/endpoint": "^10.1.4", 156 | "@octokit/request-error": "^6.1.8", 157 | "@octokit/types": "^14.0.0", 158 | "fast-content-type-parse": "^2.0.0", 159 | "universal-user-agent": "^7.0.2" 160 | }, 161 | "engines": { 162 | "node": ">= 18" 163 | } 164 | }, 165 | "node_modules/@octokit/core/node_modules/fast-content-type-parse": { 166 | "version": "2.0.1", 167 | "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-2.0.1.tgz", 168 | "integrity": "sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==", 169 | "funding": [ 170 | { 171 | "type": "github", 172 | "url": "https://github.com/sponsors/fastify" 173 | }, 174 | { 175 | "type": "opencollective", 176 | "url": "https://opencollective.com/fastify" 177 | } 178 | ], 179 | "license": "MIT" 180 | }, 181 | "node_modules/@octokit/endpoint": { 182 | "version": "11.0.0", 183 | "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.0.tgz", 184 | "integrity": "sha512-hoYicJZaqISMAI3JfaDr1qMNi48OctWuOih1m80bkYow/ayPw6Jj52tqWJ6GEoFTk1gBqfanSoI1iY99Z5+ekQ==", 185 | "license": "MIT", 186 | "dependencies": { 187 | "@octokit/types": "^14.0.0", 188 | "universal-user-agent": "^7.0.2" 189 | }, 190 | "engines": { 191 | "node": ">= 20" 192 | } 193 | }, 194 | "node_modules/@octokit/graphql": { 195 | "version": "8.2.2", 196 | "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-8.2.2.tgz", 197 | "integrity": "sha512-Yi8hcoqsrXGdt0yObxbebHXFOiUA+2v3n53epuOg1QUgOB6c4XzvisBNVXJSl8RYA5KrDuSL2yq9Qmqe5N0ryA==", 198 | "license": "MIT", 199 | "dependencies": { 200 | "@octokit/request": "^9.2.3", 201 | "@octokit/types": "^14.0.0", 202 | "universal-user-agent": "^7.0.0" 203 | }, 204 | "engines": { 205 | "node": ">= 18" 206 | } 207 | }, 208 | "node_modules/@octokit/graphql/node_modules/@octokit/endpoint": { 209 | "version": "10.1.4", 210 | "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.4.tgz", 211 | "integrity": "sha512-OlYOlZIsfEVZm5HCSR8aSg02T2lbUWOsCQoPKfTXJwDzcHQBrVBGdGXb89dv2Kw2ToZaRtudp8O3ZIYoaOjKlA==", 212 | "license": "MIT", 213 | "dependencies": { 214 | "@octokit/types": "^14.0.0", 215 | "universal-user-agent": "^7.0.2" 216 | }, 217 | "engines": { 218 | "node": ">= 18" 219 | } 220 | }, 221 | "node_modules/@octokit/graphql/node_modules/@octokit/request": { 222 | "version": "9.2.3", 223 | "resolved": "https://registry.npmjs.org/@octokit/request/-/request-9.2.3.tgz", 224 | "integrity": "sha512-Ma+pZU8PXLOEYzsWf0cn/gY+ME57Wq8f49WTXA8FMHp2Ps9djKw//xYJ1je8Hm0pR2lU9FUGeJRWOtxq6olt4w==", 225 | "license": "MIT", 226 | "dependencies": { 227 | "@octokit/endpoint": "^10.1.4", 228 | "@octokit/request-error": "^6.1.8", 229 | "@octokit/types": "^14.0.0", 230 | "fast-content-type-parse": "^2.0.0", 231 | "universal-user-agent": "^7.0.2" 232 | }, 233 | "engines": { 234 | "node": ">= 18" 235 | } 236 | }, 237 | "node_modules/@octokit/graphql/node_modules/fast-content-type-parse": { 238 | "version": "2.0.1", 239 | "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-2.0.1.tgz", 240 | "integrity": "sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==", 241 | "funding": [ 242 | { 243 | "type": "github", 244 | "url": "https://github.com/sponsors/fastify" 245 | }, 246 | { 247 | "type": "opencollective", 248 | "url": "https://opencollective.com/fastify" 249 | } 250 | ], 251 | "license": "MIT" 252 | }, 253 | "node_modules/@octokit/oauth-authorization-url": { 254 | "version": "8.0.0", 255 | "resolved": "https://registry.npmjs.org/@octokit/oauth-authorization-url/-/oauth-authorization-url-8.0.0.tgz", 256 | "integrity": "sha512-7QoLPRh/ssEA/HuHBHdVdSgF8xNLz/Bc5m9fZkArJE5bb6NmVkDm3anKxXPmN1zh6b5WKZPRr3697xKT/yM3qQ==", 257 | "license": "MIT", 258 | "engines": { 259 | "node": ">= 20" 260 | } 261 | }, 262 | "node_modules/@octokit/oauth-methods": { 263 | "version": "6.0.0", 264 | "resolved": "https://registry.npmjs.org/@octokit/oauth-methods/-/oauth-methods-6.0.0.tgz", 265 | "integrity": "sha512-Q8nFIagNLIZgM2odAraelMcDssapc+lF+y3OlcIPxyAU+knefO8KmozGqfnma1xegRDP4z5M73ABsamn72bOcA==", 266 | "license": "MIT", 267 | "dependencies": { 268 | "@octokit/oauth-authorization-url": "^8.0.0", 269 | "@octokit/request": "^10.0.2", 270 | "@octokit/request-error": "^7.0.0", 271 | "@octokit/types": "^14.0.0" 272 | }, 273 | "engines": { 274 | "node": ">= 20" 275 | } 276 | }, 277 | "node_modules/@octokit/oauth-methods/node_modules/@octokit/request-error": { 278 | "version": "7.0.0", 279 | "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.0.0.tgz", 280 | "integrity": "sha512-KRA7VTGdVyJlh0cP5Tf94hTiYVVqmt2f3I6mnimmaVz4UG3gQV/k4mDJlJv3X67iX6rmN7gSHCF8ssqeMnmhZg==", 281 | "license": "MIT", 282 | "dependencies": { 283 | "@octokit/types": "^14.0.0" 284 | }, 285 | "engines": { 286 | "node": ">= 20" 287 | } 288 | }, 289 | "node_modules/@octokit/openapi": { 290 | "version": "19.1.0", 291 | "resolved": "https://registry.npmjs.org/@octokit/openapi/-/openapi-19.1.0.tgz", 292 | "integrity": "sha512-geiTDyEF3/QEFcb41IlIhl070NlqUStxiZycbSCmUn17Vrc7F+tHyDc34kavqprVe6I5z+2/SQQj9gz1w7UsVA==", 293 | "dev": true, 294 | "license": "MIT", 295 | "engines": { 296 | "node": ">=18" 297 | } 298 | }, 299 | "node_modules/@octokit/openapi-types": { 300 | "version": "25.1.0", 301 | "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz", 302 | "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==", 303 | "license": "MIT" 304 | }, 305 | "node_modules/@octokit/plugin-paginate-rest": { 306 | "version": "12.0.0", 307 | "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-12.0.0.tgz", 308 | "integrity": "sha512-MPd6WK1VtZ52lFrgZ0R2FlaoiWllzgqFHaSZxvp72NmoDeZ0m8GeJdg4oB6ctqMTYyrnDYp592Xma21mrgiyDA==", 309 | "license": "MIT", 310 | "dependencies": { 311 | "@octokit/types": "^14.0.0" 312 | }, 313 | "engines": { 314 | "node": ">= 18" 315 | }, 316 | "peerDependencies": { 317 | "@octokit/core": ">=6" 318 | } 319 | }, 320 | "node_modules/@octokit/plugin-retry": { 321 | "version": "7.2.1", 322 | "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-7.2.1.tgz", 323 | "integrity": "sha512-wUc3gv0D6vNHpGxSaR3FlqJpTXGWgqmk607N9L3LvPL4QjaxDgX/1nY2mGpT37Khn+nlIXdljczkRnNdTTV3/A==", 324 | "license": "MIT", 325 | "dependencies": { 326 | "@octokit/request-error": "^6.1.8", 327 | "@octokit/types": "^14.0.0", 328 | "bottleneck": "^2.15.3" 329 | }, 330 | "engines": { 331 | "node": ">= 18" 332 | }, 333 | "peerDependencies": { 334 | "@octokit/core": ">=6" 335 | } 336 | }, 337 | "node_modules/@octokit/plugin-throttling": { 338 | "version": "10.0.0", 339 | "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-10.0.0.tgz", 340 | "integrity": "sha512-Kuq5/qs0DVYTHZuBAzCZStCzo2nKvVRo/TDNhCcpC2TKiOGz/DisXMCvjt3/b5kr6SCI1Y8eeeJTHBxxpFvZEg==", 341 | "license": "MIT", 342 | "dependencies": { 343 | "@octokit/types": "^14.0.0", 344 | "bottleneck": "^2.15.3" 345 | }, 346 | "engines": { 347 | "node": ">= 18" 348 | }, 349 | "peerDependencies": { 350 | "@octokit/core": "^6.1.3" 351 | } 352 | }, 353 | "node_modules/@octokit/request": { 354 | "version": "10.0.2", 355 | "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.2.tgz", 356 | "integrity": "sha512-iYj4SJG/2bbhh+iIpFmG5u49DtJ4lipQ+aPakjL9OKpsGY93wM8w06gvFbEQxcMsZcCvk5th5KkIm2m8o14aWA==", 357 | "license": "MIT", 358 | "dependencies": { 359 | "@octokit/endpoint": "^11.0.0", 360 | "@octokit/request-error": "^7.0.0", 361 | "@octokit/types": "^14.0.0", 362 | "fast-content-type-parse": "^3.0.0", 363 | "universal-user-agent": "^7.0.2" 364 | }, 365 | "engines": { 366 | "node": ">= 20" 367 | } 368 | }, 369 | "node_modules/@octokit/request-error": { 370 | "version": "6.1.8", 371 | "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.8.tgz", 372 | "integrity": "sha512-WEi/R0Jmq+IJKydWlKDmryPcmdYSVjL3ekaiEL1L9eo1sUnqMJ+grqmC9cjk7CA7+b2/T397tO5d8YLOH3qYpQ==", 373 | "license": "MIT", 374 | "dependencies": { 375 | "@octokit/types": "^14.0.0" 376 | }, 377 | "engines": { 378 | "node": ">= 18" 379 | } 380 | }, 381 | "node_modules/@octokit/request/node_modules/@octokit/request-error": { 382 | "version": "7.0.0", 383 | "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.0.0.tgz", 384 | "integrity": "sha512-KRA7VTGdVyJlh0cP5Tf94hTiYVVqmt2f3I6mnimmaVz4UG3gQV/k4mDJlJv3X67iX6rmN7gSHCF8ssqeMnmhZg==", 385 | "license": "MIT", 386 | "dependencies": { 387 | "@octokit/types": "^14.0.0" 388 | }, 389 | "engines": { 390 | "node": ">= 20" 391 | } 392 | }, 393 | "node_modules/@octokit/types": { 394 | "version": "14.1.0", 395 | "resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz", 396 | "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", 397 | "license": "MIT", 398 | "dependencies": { 399 | "@octokit/openapi-types": "^25.1.0" 400 | } 401 | }, 402 | "node_modules/@pkgjs/parseargs": { 403 | "version": "0.11.0", 404 | "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", 405 | "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", 406 | "license": "MIT", 407 | "optional": true, 408 | "engines": { 409 | "node": ">=14" 410 | } 411 | }, 412 | "node_modules/ansi-colors": { 413 | "version": "4.1.3", 414 | "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", 415 | "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", 416 | "license": "MIT", 417 | "engines": { 418 | "node": ">=6" 419 | } 420 | }, 421 | "node_modules/ansi-regex": { 422 | "version": "5.0.1", 423 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 424 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 425 | "license": "MIT", 426 | "engines": { 427 | "node": ">=8" 428 | } 429 | }, 430 | "node_modules/ansi-styles": { 431 | "version": "6.2.1", 432 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", 433 | "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", 434 | "license": "MIT", 435 | "engines": { 436 | "node": ">=12" 437 | }, 438 | "funding": { 439 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 440 | } 441 | }, 442 | "node_modules/balanced-match": { 443 | "version": "1.0.2", 444 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 445 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 446 | "license": "MIT" 447 | }, 448 | "node_modules/before-after-hook": { 449 | "version": "3.0.2", 450 | "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-3.0.2.tgz", 451 | "integrity": "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==", 452 | "license": "Apache-2.0" 453 | }, 454 | "node_modules/bottleneck": { 455 | "version": "2.19.5", 456 | "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", 457 | "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", 458 | "license": "MIT" 459 | }, 460 | "node_modules/brace-expansion": { 461 | "version": "2.0.1", 462 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 463 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 464 | "license": "MIT", 465 | "dependencies": { 466 | "balanced-match": "^1.0.0" 467 | } 468 | }, 469 | "node_modules/chalk": { 470 | "version": "5.4.1", 471 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", 472 | "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", 473 | "license": "MIT", 474 | "engines": { 475 | "node": "^12.17.0 || ^14.13 || >=16.0.0" 476 | }, 477 | "funding": { 478 | "url": "https://github.com/chalk/chalk?sponsor=1" 479 | } 480 | }, 481 | "node_modules/clipboardy": { 482 | "version": "4.0.0", 483 | "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-4.0.0.tgz", 484 | "integrity": "sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==", 485 | "license": "MIT", 486 | "dependencies": { 487 | "execa": "^8.0.1", 488 | "is-wsl": "^3.1.0", 489 | "is64bit": "^2.0.0" 490 | }, 491 | "engines": { 492 | "node": ">=18" 493 | }, 494 | "funding": { 495 | "url": "https://github.com/sponsors/sindresorhus" 496 | } 497 | }, 498 | "node_modules/cliui": { 499 | "version": "9.0.1", 500 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", 501 | "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", 502 | "license": "ISC", 503 | "dependencies": { 504 | "string-width": "^7.2.0", 505 | "strip-ansi": "^7.1.0", 506 | "wrap-ansi": "^9.0.0" 507 | }, 508 | "engines": { 509 | "node": ">=20" 510 | } 511 | }, 512 | "node_modules/cliui/node_modules/ansi-regex": { 513 | "version": "6.1.0", 514 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", 515 | "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", 516 | "license": "MIT", 517 | "engines": { 518 | "node": ">=12" 519 | }, 520 | "funding": { 521 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 522 | } 523 | }, 524 | "node_modules/cliui/node_modules/emoji-regex": { 525 | "version": "10.4.0", 526 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", 527 | "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", 528 | "license": "MIT" 529 | }, 530 | "node_modules/cliui/node_modules/string-width": { 531 | "version": "7.2.0", 532 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", 533 | "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", 534 | "license": "MIT", 535 | "dependencies": { 536 | "emoji-regex": "^10.3.0", 537 | "get-east-asian-width": "^1.0.0", 538 | "strip-ansi": "^7.1.0" 539 | }, 540 | "engines": { 541 | "node": ">=18" 542 | }, 543 | "funding": { 544 | "url": "https://github.com/sponsors/sindresorhus" 545 | } 546 | }, 547 | "node_modules/cliui/node_modules/strip-ansi": { 548 | "version": "7.1.0", 549 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 550 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 551 | "license": "MIT", 552 | "dependencies": { 553 | "ansi-regex": "^6.0.1" 554 | }, 555 | "engines": { 556 | "node": ">=12" 557 | }, 558 | "funding": { 559 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 560 | } 561 | }, 562 | "node_modules/cliui/node_modules/wrap-ansi": { 563 | "version": "9.0.0", 564 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", 565 | "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", 566 | "license": "MIT", 567 | "dependencies": { 568 | "ansi-styles": "^6.2.1", 569 | "string-width": "^7.0.0", 570 | "strip-ansi": "^7.1.0" 571 | }, 572 | "engines": { 573 | "node": ">=18" 574 | }, 575 | "funding": { 576 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 577 | } 578 | }, 579 | "node_modules/color-convert": { 580 | "version": "2.0.1", 581 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 582 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 583 | "license": "MIT", 584 | "dependencies": { 585 | "color-name": "~1.1.4" 586 | }, 587 | "engines": { 588 | "node": ">=7.0.0" 589 | } 590 | }, 591 | "node_modules/color-name": { 592 | "version": "1.1.4", 593 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 594 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 595 | "license": "MIT" 596 | }, 597 | "node_modules/cross-spawn": { 598 | "version": "7.0.6", 599 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", 600 | "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", 601 | "license": "MIT", 602 | "dependencies": { 603 | "path-key": "^3.1.0", 604 | "shebang-command": "^2.0.0", 605 | "which": "^2.0.1" 606 | }, 607 | "engines": { 608 | "node": ">= 8" 609 | } 610 | }, 611 | "node_modules/crypto-random-string": { 612 | "version": "4.0.0", 613 | "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", 614 | "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", 615 | "license": "MIT", 616 | "dependencies": { 617 | "type-fest": "^1.0.1" 618 | }, 619 | "engines": { 620 | "node": ">=12" 621 | }, 622 | "funding": { 623 | "url": "https://github.com/sponsors/sindresorhus" 624 | } 625 | }, 626 | "node_modules/crypto-random-string/node_modules/type-fest": { 627 | "version": "1.4.0", 628 | "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", 629 | "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", 630 | "license": "(MIT OR CC0-1.0)", 631 | "engines": { 632 | "node": ">=10" 633 | }, 634 | "funding": { 635 | "url": "https://github.com/sponsors/sindresorhus" 636 | } 637 | }, 638 | "node_modules/debug": { 639 | "version": "4.4.1", 640 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", 641 | "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", 642 | "license": "MIT", 643 | "dependencies": { 644 | "ms": "^2.1.3" 645 | }, 646 | "engines": { 647 | "node": ">=6.0" 648 | }, 649 | "peerDependenciesMeta": { 650 | "supports-color": { 651 | "optional": true 652 | } 653 | } 654 | }, 655 | "node_modules/dequal": { 656 | "version": "2.0.3", 657 | "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", 658 | "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", 659 | "dev": true, 660 | "license": "MIT", 661 | "engines": { 662 | "node": ">=6" 663 | } 664 | }, 665 | "node_modules/diff": { 666 | "version": "5.2.0", 667 | "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", 668 | "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", 669 | "dev": true, 670 | "license": "BSD-3-Clause", 671 | "engines": { 672 | "node": ">=0.3.1" 673 | } 674 | }, 675 | "node_modules/eastasianwidth": { 676 | "version": "0.2.0", 677 | "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", 678 | "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", 679 | "license": "MIT" 680 | }, 681 | "node_modules/emoji-regex": { 682 | "version": "9.2.2", 683 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", 684 | "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", 685 | "license": "MIT" 686 | }, 687 | "node_modules/enquirer": { 688 | "version": "2.4.1", 689 | "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", 690 | "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", 691 | "license": "MIT", 692 | "dependencies": { 693 | "ansi-colors": "^4.1.1", 694 | "strip-ansi": "^6.0.1" 695 | }, 696 | "engines": { 697 | "node": ">=8.6" 698 | } 699 | }, 700 | "node_modules/escalade": { 701 | "version": "3.2.0", 702 | "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", 703 | "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", 704 | "license": "MIT", 705 | "engines": { 706 | "node": ">=6" 707 | } 708 | }, 709 | "node_modules/execa": { 710 | "version": "8.0.1", 711 | "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", 712 | "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", 713 | "license": "MIT", 714 | "dependencies": { 715 | "cross-spawn": "^7.0.3", 716 | "get-stream": "^8.0.1", 717 | "human-signals": "^5.0.0", 718 | "is-stream": "^3.0.0", 719 | "merge-stream": "^2.0.0", 720 | "npm-run-path": "^5.1.0", 721 | "onetime": "^6.0.0", 722 | "signal-exit": "^4.1.0", 723 | "strip-final-newline": "^3.0.0" 724 | }, 725 | "engines": { 726 | "node": ">=16.17" 727 | }, 728 | "funding": { 729 | "url": "https://github.com/sindresorhus/execa?sponsor=1" 730 | } 731 | }, 732 | "node_modules/fast-content-type-parse": { 733 | "version": "3.0.0", 734 | "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz", 735 | "integrity": "sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==", 736 | "funding": [ 737 | { 738 | "type": "github", 739 | "url": "https://github.com/sponsors/fastify" 740 | }, 741 | { 742 | "type": "opencollective", 743 | "url": "https://opencollective.com/fastify" 744 | } 745 | ], 746 | "license": "MIT" 747 | }, 748 | "node_modules/foreground-child": { 749 | "version": "3.3.1", 750 | "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", 751 | "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", 752 | "license": "ISC", 753 | "dependencies": { 754 | "cross-spawn": "^7.0.6", 755 | "signal-exit": "^4.0.1" 756 | }, 757 | "engines": { 758 | "node": ">=14" 759 | }, 760 | "funding": { 761 | "url": "https://github.com/sponsors/isaacs" 762 | } 763 | }, 764 | "node_modules/get-caller-file": { 765 | "version": "2.0.5", 766 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 767 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", 768 | "license": "ISC", 769 | "engines": { 770 | "node": "6.* || 8.* || >= 10.*" 771 | } 772 | }, 773 | "node_modules/get-east-asian-width": { 774 | "version": "1.3.0", 775 | "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz", 776 | "integrity": "sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==", 777 | "license": "MIT", 778 | "engines": { 779 | "node": ">=18" 780 | }, 781 | "funding": { 782 | "url": "https://github.com/sponsors/sindresorhus" 783 | } 784 | }, 785 | "node_modules/get-stream": { 786 | "version": "8.0.1", 787 | "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", 788 | "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", 789 | "license": "MIT", 790 | "engines": { 791 | "node": ">=16" 792 | }, 793 | "funding": { 794 | "url": "https://github.com/sponsors/sindresorhus" 795 | } 796 | }, 797 | "node_modules/glob": { 798 | "version": "10.4.5", 799 | "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", 800 | "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", 801 | "license": "ISC", 802 | "dependencies": { 803 | "foreground-child": "^3.1.0", 804 | "jackspeak": "^3.1.2", 805 | "minimatch": "^9.0.4", 806 | "minipass": "^7.1.2", 807 | "package-json-from-dist": "^1.0.0", 808 | "path-scurry": "^1.11.1" 809 | }, 810 | "bin": { 811 | "glob": "dist/esm/bin.mjs" 812 | }, 813 | "funding": { 814 | "url": "https://github.com/sponsors/isaacs" 815 | } 816 | }, 817 | "node_modules/graceful-fs": { 818 | "version": "4.2.11", 819 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", 820 | "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", 821 | "license": "ISC", 822 | "optional": true 823 | }, 824 | "node_modules/human-signals": { 825 | "version": "5.0.0", 826 | "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", 827 | "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", 828 | "license": "Apache-2.0", 829 | "engines": { 830 | "node": ">=16.17.0" 831 | } 832 | }, 833 | "node_modules/is-docker": { 834 | "version": "3.0.0", 835 | "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", 836 | "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", 837 | "license": "MIT", 838 | "bin": { 839 | "is-docker": "cli.js" 840 | }, 841 | "engines": { 842 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" 843 | }, 844 | "funding": { 845 | "url": "https://github.com/sponsors/sindresorhus" 846 | } 847 | }, 848 | "node_modules/is-fullwidth-code-point": { 849 | "version": "3.0.0", 850 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 851 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", 852 | "license": "MIT", 853 | "engines": { 854 | "node": ">=8" 855 | } 856 | }, 857 | "node_modules/is-inside-container": { 858 | "version": "1.0.0", 859 | "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", 860 | "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", 861 | "license": "MIT", 862 | "dependencies": { 863 | "is-docker": "^3.0.0" 864 | }, 865 | "bin": { 866 | "is-inside-container": "cli.js" 867 | }, 868 | "engines": { 869 | "node": ">=14.16" 870 | }, 871 | "funding": { 872 | "url": "https://github.com/sponsors/sindresorhus" 873 | } 874 | }, 875 | "node_modules/is-stream": { 876 | "version": "3.0.0", 877 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", 878 | "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", 879 | "license": "MIT", 880 | "engines": { 881 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" 882 | }, 883 | "funding": { 884 | "url": "https://github.com/sponsors/sindresorhus" 885 | } 886 | }, 887 | "node_modules/is-wsl": { 888 | "version": "3.1.0", 889 | "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", 890 | "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", 891 | "license": "MIT", 892 | "dependencies": { 893 | "is-inside-container": "^1.0.0" 894 | }, 895 | "engines": { 896 | "node": ">=16" 897 | }, 898 | "funding": { 899 | "url": "https://github.com/sponsors/sindresorhus" 900 | } 901 | }, 902 | "node_modules/is64bit": { 903 | "version": "2.0.0", 904 | "resolved": "https://registry.npmjs.org/is64bit/-/is64bit-2.0.0.tgz", 905 | "integrity": "sha512-jv+8jaWCl0g2lSBkNSVXdzfBA0npK1HGC2KtWM9FumFRoGS94g3NbCCLVnCYHLjp4GrW2KZeeSTMo5ddtznmGw==", 906 | "license": "MIT", 907 | "dependencies": { 908 | "system-architecture": "^0.1.0" 909 | }, 910 | "engines": { 911 | "node": ">=18" 912 | }, 913 | "funding": { 914 | "url": "https://github.com/sponsors/sindresorhus" 915 | } 916 | }, 917 | "node_modules/isexe": { 918 | "version": "2.0.0", 919 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 920 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 921 | "license": "ISC" 922 | }, 923 | "node_modules/jackspeak": { 924 | "version": "3.4.3", 925 | "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", 926 | "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", 927 | "license": "BlueOak-1.0.0", 928 | "dependencies": { 929 | "@isaacs/cliui": "^8.0.2" 930 | }, 931 | "funding": { 932 | "url": "https://github.com/sponsors/isaacs" 933 | }, 934 | "optionalDependencies": { 935 | "@pkgjs/parseargs": "^0.11.0" 936 | } 937 | }, 938 | "node_modules/jsonfile": { 939 | "version": "6.1.0", 940 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", 941 | "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", 942 | "license": "MIT", 943 | "dependencies": { 944 | "universalify": "^2.0.0" 945 | }, 946 | "optionalDependencies": { 947 | "graceful-fs": "^4.1.6" 948 | } 949 | }, 950 | "node_modules/kleur": { 951 | "version": "4.1.5", 952 | "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", 953 | "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", 954 | "dev": true, 955 | "license": "MIT", 956 | "engines": { 957 | "node": ">=6" 958 | } 959 | }, 960 | "node_modules/lru-cache": { 961 | "version": "10.4.3", 962 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", 963 | "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", 964 | "license": "ISC" 965 | }, 966 | "node_modules/merge-stream": { 967 | "version": "2.0.0", 968 | "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", 969 | "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", 970 | "license": "MIT" 971 | }, 972 | "node_modules/mimic-fn": { 973 | "version": "4.0.0", 974 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", 975 | "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", 976 | "license": "MIT", 977 | "engines": { 978 | "node": ">=12" 979 | }, 980 | "funding": { 981 | "url": "https://github.com/sponsors/sindresorhus" 982 | } 983 | }, 984 | "node_modules/minimatch": { 985 | "version": "9.0.5", 986 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", 987 | "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", 988 | "license": "ISC", 989 | "dependencies": { 990 | "brace-expansion": "^2.0.1" 991 | }, 992 | "engines": { 993 | "node": ">=16 || 14 >=14.17" 994 | }, 995 | "funding": { 996 | "url": "https://github.com/sponsors/isaacs" 997 | } 998 | }, 999 | "node_modules/minipass": { 1000 | "version": "7.1.2", 1001 | "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", 1002 | "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", 1003 | "license": "ISC", 1004 | "engines": { 1005 | "node": ">=16 || 14 >=14.17" 1006 | } 1007 | }, 1008 | "node_modules/mkdirp": { 1009 | "version": "3.0.1", 1010 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", 1011 | "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", 1012 | "license": "MIT", 1013 | "bin": { 1014 | "mkdirp": "dist/cjs/src/bin.js" 1015 | }, 1016 | "engines": { 1017 | "node": ">=10" 1018 | }, 1019 | "funding": { 1020 | "url": "https://github.com/sponsors/isaacs" 1021 | } 1022 | }, 1023 | "node_modules/mri": { 1024 | "version": "1.2.0", 1025 | "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", 1026 | "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", 1027 | "dev": true, 1028 | "license": "MIT", 1029 | "engines": { 1030 | "node": ">=4" 1031 | } 1032 | }, 1033 | "node_modules/ms": { 1034 | "version": "2.1.3", 1035 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 1036 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 1037 | "license": "MIT" 1038 | }, 1039 | "node_modules/npm-run-path": { 1040 | "version": "5.3.0", 1041 | "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", 1042 | "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", 1043 | "license": "MIT", 1044 | "dependencies": { 1045 | "path-key": "^4.0.0" 1046 | }, 1047 | "engines": { 1048 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" 1049 | }, 1050 | "funding": { 1051 | "url": "https://github.com/sponsors/sindresorhus" 1052 | } 1053 | }, 1054 | "node_modules/npm-run-path/node_modules/path-key": { 1055 | "version": "4.0.0", 1056 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", 1057 | "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", 1058 | "license": "MIT", 1059 | "engines": { 1060 | "node": ">=12" 1061 | }, 1062 | "funding": { 1063 | "url": "https://github.com/sponsors/sindresorhus" 1064 | } 1065 | }, 1066 | "node_modules/onetime": { 1067 | "version": "6.0.0", 1068 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", 1069 | "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", 1070 | "license": "MIT", 1071 | "dependencies": { 1072 | "mimic-fn": "^4.0.0" 1073 | }, 1074 | "engines": { 1075 | "node": ">=12" 1076 | }, 1077 | "funding": { 1078 | "url": "https://github.com/sponsors/sindresorhus" 1079 | } 1080 | }, 1081 | "node_modules/package-json-from-dist": { 1082 | "version": "1.0.1", 1083 | "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", 1084 | "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", 1085 | "license": "BlueOak-1.0.0" 1086 | }, 1087 | "node_modules/path-key": { 1088 | "version": "3.1.1", 1089 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 1090 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 1091 | "license": "MIT", 1092 | "engines": { 1093 | "node": ">=8" 1094 | } 1095 | }, 1096 | "node_modules/path-scurry": { 1097 | "version": "1.11.1", 1098 | "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", 1099 | "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", 1100 | "license": "BlueOak-1.0.0", 1101 | "dependencies": { 1102 | "lru-cache": "^10.2.0", 1103 | "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" 1104 | }, 1105 | "engines": { 1106 | "node": ">=16 || 14 >=14.18" 1107 | }, 1108 | "funding": { 1109 | "url": "https://github.com/sponsors/isaacs" 1110 | } 1111 | }, 1112 | "node_modules/prettier": { 1113 | "version": "3.5.3", 1114 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", 1115 | "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", 1116 | "dev": true, 1117 | "license": "MIT", 1118 | "bin": { 1119 | "prettier": "bin/prettier.cjs" 1120 | }, 1121 | "engines": { 1122 | "node": ">=14" 1123 | }, 1124 | "funding": { 1125 | "url": "https://github.com/prettier/prettier?sponsor=1" 1126 | } 1127 | }, 1128 | "node_modules/quick-format-unescaped": { 1129 | "version": "4.0.4", 1130 | "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", 1131 | "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", 1132 | "license": "MIT" 1133 | }, 1134 | "node_modules/sade": { 1135 | "version": "1.8.1", 1136 | "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", 1137 | "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", 1138 | "dev": true, 1139 | "license": "MIT", 1140 | "dependencies": { 1141 | "mri": "^1.1.0" 1142 | }, 1143 | "engines": { 1144 | "node": ">=6" 1145 | } 1146 | }, 1147 | "node_modules/semantic-release-plugin-update-version-in-files": { 1148 | "version": "2.0.0", 1149 | "resolved": "https://registry.npmjs.org/semantic-release-plugin-update-version-in-files/-/semantic-release-plugin-update-version-in-files-2.0.0.tgz", 1150 | "integrity": "sha512-ovpBKjkygkbiTH0CG+vJb62O+eGFoI7PM5KCVuuy2I5Xaj5t9JzmwMtAAls3Ie+R06IQu556P4gIKjJ9FIDJZQ==", 1151 | "license": "ISC", 1152 | "dependencies": { 1153 | "debug": "^4.1.1", 1154 | "glob": "^10.0.0" 1155 | }, 1156 | "engines": { 1157 | "node": ">=18" 1158 | } 1159 | }, 1160 | "node_modules/shebang-command": { 1161 | "version": "2.0.0", 1162 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 1163 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 1164 | "license": "MIT", 1165 | "dependencies": { 1166 | "shebang-regex": "^3.0.0" 1167 | }, 1168 | "engines": { 1169 | "node": ">=8" 1170 | } 1171 | }, 1172 | "node_modules/shebang-regex": { 1173 | "version": "3.0.0", 1174 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 1175 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 1176 | "license": "MIT", 1177 | "engines": { 1178 | "node": ">=8" 1179 | } 1180 | }, 1181 | "node_modules/signal-exit": { 1182 | "version": "4.1.0", 1183 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", 1184 | "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", 1185 | "license": "ISC", 1186 | "engines": { 1187 | "node": ">=14" 1188 | }, 1189 | "funding": { 1190 | "url": "https://github.com/sponsors/isaacs" 1191 | } 1192 | }, 1193 | "node_modules/simple-mock": { 1194 | "version": "0.8.0", 1195 | "resolved": "https://registry.npmjs.org/simple-mock/-/simple-mock-0.8.0.tgz", 1196 | "integrity": "sha512-rakKnocwPH9KPjOsmtMwJwKDmZIYyDeCz0bQYAdeB9h27SMpS5BS+0hDSzhAlvmzA3o7I9ck2NgqjcHpjIcwmA==", 1197 | "dev": true, 1198 | "license": "MIT" 1199 | }, 1200 | "node_modules/string-width": { 1201 | "version": "5.1.2", 1202 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", 1203 | "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", 1204 | "license": "MIT", 1205 | "dependencies": { 1206 | "eastasianwidth": "^0.2.0", 1207 | "emoji-regex": "^9.2.2", 1208 | "strip-ansi": "^7.0.1" 1209 | }, 1210 | "engines": { 1211 | "node": ">=12" 1212 | }, 1213 | "funding": { 1214 | "url": "https://github.com/sponsors/sindresorhus" 1215 | } 1216 | }, 1217 | "node_modules/string-width-cjs": { 1218 | "name": "string-width", 1219 | "version": "4.2.3", 1220 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 1221 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 1222 | "license": "MIT", 1223 | "dependencies": { 1224 | "emoji-regex": "^8.0.0", 1225 | "is-fullwidth-code-point": "^3.0.0", 1226 | "strip-ansi": "^6.0.1" 1227 | }, 1228 | "engines": { 1229 | "node": ">=8" 1230 | } 1231 | }, 1232 | "node_modules/string-width-cjs/node_modules/emoji-regex": { 1233 | "version": "8.0.0", 1234 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 1235 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 1236 | "license": "MIT" 1237 | }, 1238 | "node_modules/string-width/node_modules/ansi-regex": { 1239 | "version": "6.1.0", 1240 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", 1241 | "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", 1242 | "license": "MIT", 1243 | "engines": { 1244 | "node": ">=12" 1245 | }, 1246 | "funding": { 1247 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 1248 | } 1249 | }, 1250 | "node_modules/string-width/node_modules/strip-ansi": { 1251 | "version": "7.1.0", 1252 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 1253 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 1254 | "license": "MIT", 1255 | "dependencies": { 1256 | "ansi-regex": "^6.0.1" 1257 | }, 1258 | "engines": { 1259 | "node": ">=12" 1260 | }, 1261 | "funding": { 1262 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 1263 | } 1264 | }, 1265 | "node_modules/strip-ansi": { 1266 | "version": "6.0.1", 1267 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 1268 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 1269 | "license": "MIT", 1270 | "dependencies": { 1271 | "ansi-regex": "^5.0.1" 1272 | }, 1273 | "engines": { 1274 | "node": ">=8" 1275 | } 1276 | }, 1277 | "node_modules/strip-ansi-cjs": { 1278 | "name": "strip-ansi", 1279 | "version": "6.0.1", 1280 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 1281 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 1282 | "license": "MIT", 1283 | "dependencies": { 1284 | "ansi-regex": "^5.0.1" 1285 | }, 1286 | "engines": { 1287 | "node": ">=8" 1288 | } 1289 | }, 1290 | "node_modules/strip-final-newline": { 1291 | "version": "3.0.0", 1292 | "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", 1293 | "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", 1294 | "license": "MIT", 1295 | "engines": { 1296 | "node": ">=12" 1297 | }, 1298 | "funding": { 1299 | "url": "https://github.com/sponsors/sindresorhus" 1300 | } 1301 | }, 1302 | "node_modules/system-architecture": { 1303 | "version": "0.1.0", 1304 | "resolved": "https://registry.npmjs.org/system-architecture/-/system-architecture-0.1.0.tgz", 1305 | "integrity": "sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==", 1306 | "license": "MIT", 1307 | "engines": { 1308 | "node": ">=18" 1309 | }, 1310 | "funding": { 1311 | "url": "https://github.com/sponsors/sindresorhus" 1312 | } 1313 | }, 1314 | "node_modules/temp-dir": { 1315 | "version": "3.0.0", 1316 | "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", 1317 | "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", 1318 | "license": "MIT", 1319 | "engines": { 1320 | "node": ">=14.16" 1321 | } 1322 | }, 1323 | "node_modules/tempy": { 1324 | "version": "3.1.0", 1325 | "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", 1326 | "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", 1327 | "license": "MIT", 1328 | "dependencies": { 1329 | "is-stream": "^3.0.0", 1330 | "temp-dir": "^3.0.0", 1331 | "type-fest": "^2.12.2", 1332 | "unique-string": "^3.0.0" 1333 | }, 1334 | "engines": { 1335 | "node": ">=14.16" 1336 | }, 1337 | "funding": { 1338 | "url": "https://github.com/sponsors/sindresorhus" 1339 | } 1340 | }, 1341 | "node_modules/type-fest": { 1342 | "version": "2.19.0", 1343 | "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", 1344 | "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", 1345 | "license": "(MIT OR CC0-1.0)", 1346 | "engines": { 1347 | "node": ">=12.20" 1348 | }, 1349 | "funding": { 1350 | "url": "https://github.com/sponsors/sindresorhus" 1351 | } 1352 | }, 1353 | "node_modules/unique-string": { 1354 | "version": "3.0.0", 1355 | "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", 1356 | "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", 1357 | "license": "MIT", 1358 | "dependencies": { 1359 | "crypto-random-string": "^4.0.0" 1360 | }, 1361 | "engines": { 1362 | "node": ">=12" 1363 | }, 1364 | "funding": { 1365 | "url": "https://github.com/sponsors/sindresorhus" 1366 | } 1367 | }, 1368 | "node_modules/universal-user-agent": { 1369 | "version": "7.0.3", 1370 | "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.3.tgz", 1371 | "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==", 1372 | "license": "ISC" 1373 | }, 1374 | "node_modules/universalify": { 1375 | "version": "2.0.1", 1376 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", 1377 | "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", 1378 | "license": "MIT", 1379 | "engines": { 1380 | "node": ">= 10.0.0" 1381 | } 1382 | }, 1383 | "node_modules/uvu": { 1384 | "version": "0.5.6", 1385 | "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", 1386 | "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==", 1387 | "dev": true, 1388 | "license": "MIT", 1389 | "dependencies": { 1390 | "dequal": "^2.0.0", 1391 | "diff": "^5.0.0", 1392 | "kleur": "^4.0.3", 1393 | "sade": "^1.7.3" 1394 | }, 1395 | "bin": { 1396 | "uvu": "bin.js" 1397 | }, 1398 | "engines": { 1399 | "node": ">=8" 1400 | } 1401 | }, 1402 | "node_modules/which": { 1403 | "version": "2.0.2", 1404 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 1405 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 1406 | "license": "ISC", 1407 | "dependencies": { 1408 | "isexe": "^2.0.0" 1409 | }, 1410 | "bin": { 1411 | "node-which": "bin/node-which" 1412 | }, 1413 | "engines": { 1414 | "node": ">= 8" 1415 | } 1416 | }, 1417 | "node_modules/wrap-ansi": { 1418 | "version": "8.1.0", 1419 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", 1420 | "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", 1421 | "license": "MIT", 1422 | "dependencies": { 1423 | "ansi-styles": "^6.1.0", 1424 | "string-width": "^5.0.1", 1425 | "strip-ansi": "^7.0.1" 1426 | }, 1427 | "engines": { 1428 | "node": ">=12" 1429 | }, 1430 | "funding": { 1431 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 1432 | } 1433 | }, 1434 | "node_modules/wrap-ansi-cjs": { 1435 | "name": "wrap-ansi", 1436 | "version": "7.0.0", 1437 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 1438 | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 1439 | "license": "MIT", 1440 | "dependencies": { 1441 | "ansi-styles": "^4.0.0", 1442 | "string-width": "^4.1.0", 1443 | "strip-ansi": "^6.0.0" 1444 | }, 1445 | "engines": { 1446 | "node": ">=10" 1447 | }, 1448 | "funding": { 1449 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 1450 | } 1451 | }, 1452 | "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { 1453 | "version": "4.3.0", 1454 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 1455 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 1456 | "license": "MIT", 1457 | "dependencies": { 1458 | "color-convert": "^2.0.1" 1459 | }, 1460 | "engines": { 1461 | "node": ">=8" 1462 | }, 1463 | "funding": { 1464 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 1465 | } 1466 | }, 1467 | "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { 1468 | "version": "8.0.0", 1469 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 1470 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 1471 | "license": "MIT" 1472 | }, 1473 | "node_modules/wrap-ansi-cjs/node_modules/string-width": { 1474 | "version": "4.2.3", 1475 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 1476 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 1477 | "license": "MIT", 1478 | "dependencies": { 1479 | "emoji-regex": "^8.0.0", 1480 | "is-fullwidth-code-point": "^3.0.0", 1481 | "strip-ansi": "^6.0.1" 1482 | }, 1483 | "engines": { 1484 | "node": ">=8" 1485 | } 1486 | }, 1487 | "node_modules/wrap-ansi/node_modules/ansi-regex": { 1488 | "version": "6.1.0", 1489 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", 1490 | "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", 1491 | "license": "MIT", 1492 | "engines": { 1493 | "node": ">=12" 1494 | }, 1495 | "funding": { 1496 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 1497 | } 1498 | }, 1499 | "node_modules/wrap-ansi/node_modules/strip-ansi": { 1500 | "version": "7.1.0", 1501 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 1502 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 1503 | "license": "MIT", 1504 | "dependencies": { 1505 | "ansi-regex": "^6.0.1" 1506 | }, 1507 | "engines": { 1508 | "node": ">=12" 1509 | }, 1510 | "funding": { 1511 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 1512 | } 1513 | }, 1514 | "node_modules/y18n": { 1515 | "version": "5.0.8", 1516 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", 1517 | "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", 1518 | "license": "ISC", 1519 | "engines": { 1520 | "node": ">=10" 1521 | } 1522 | }, 1523 | "node_modules/yargs": { 1524 | "version": "18.0.0", 1525 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", 1526 | "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", 1527 | "license": "MIT", 1528 | "dependencies": { 1529 | "cliui": "^9.0.1", 1530 | "escalade": "^3.1.1", 1531 | "get-caller-file": "^2.0.5", 1532 | "string-width": "^7.2.0", 1533 | "y18n": "^5.0.5", 1534 | "yargs-parser": "^22.0.0" 1535 | }, 1536 | "engines": { 1537 | "node": "^20.19.0 || ^22.12.0 || >=23" 1538 | } 1539 | }, 1540 | "node_modules/yargs-parser": { 1541 | "version": "22.0.0", 1542 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", 1543 | "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", 1544 | "license": "ISC", 1545 | "engines": { 1546 | "node": "^20.19.0 || ^22.12.0 || >=23" 1547 | } 1548 | }, 1549 | "node_modules/yargs/node_modules/ansi-regex": { 1550 | "version": "6.1.0", 1551 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", 1552 | "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", 1553 | "license": "MIT", 1554 | "engines": { 1555 | "node": ">=12" 1556 | }, 1557 | "funding": { 1558 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 1559 | } 1560 | }, 1561 | "node_modules/yargs/node_modules/emoji-regex": { 1562 | "version": "10.4.0", 1563 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", 1564 | "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", 1565 | "license": "MIT" 1566 | }, 1567 | "node_modules/yargs/node_modules/string-width": { 1568 | "version": "7.2.0", 1569 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", 1570 | "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", 1571 | "license": "MIT", 1572 | "dependencies": { 1573 | "emoji-regex": "^10.3.0", 1574 | "get-east-asian-width": "^1.0.0", 1575 | "strip-ansi": "^7.1.0" 1576 | }, 1577 | "engines": { 1578 | "node": ">=18" 1579 | }, 1580 | "funding": { 1581 | "url": "https://github.com/sponsors/sindresorhus" 1582 | } 1583 | }, 1584 | "node_modules/yargs/node_modules/strip-ansi": { 1585 | "version": "7.1.0", 1586 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 1587 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 1588 | "license": "MIT", 1589 | "dependencies": { 1590 | "ansi-regex": "^6.0.1" 1591 | }, 1592 | "engines": { 1593 | "node": ">=12" 1594 | }, 1595 | "funding": { 1596 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 1597 | } 1598 | } 1599 | } 1600 | } 1601 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@octoherd/cli", 3 | "publishConfig": { 4 | "access": "public" 5 | }, 6 | "type": "module", 7 | "version": "0.0.0-development", 8 | "description": "CLI to run a custom script on one or multiple repositories", 9 | "exports": { 10 | ".": "./index.js", 11 | "./run": "./bin/run.js" 12 | }, 13 | "bin": { 14 | "octoherd": "bin/octoherd.js" 15 | }, 16 | "types": "index.d.ts", 17 | "dependencies": { 18 | "@octoherd/octokit": "^5.0.0", 19 | "@octokit/auth-oauth-device": "^8.0.0", 20 | "@octokit/openapi-types": "^25.0.0", 21 | "chalk": "^5.0.0", 22 | "clipboardy": "^4.0.0", 23 | "enquirer": "^2.3.6", 24 | "jsonfile": "^6.0.1", 25 | "mkdirp": "^3.0.0", 26 | "tempy": "^3.0.0", 27 | "yargs": "^18.0.0" 28 | }, 29 | "devDependencies": { 30 | "@octokit/openapi": "^19.0.0", 31 | "prettier": "^3.0.0", 32 | "simple-mock": "^0.8.0", 33 | "uvu": "^0.5.1" 34 | }, 35 | "scripts": { 36 | "test": "uvu tests" 37 | }, 38 | "keywords": [ 39 | "github", 40 | "repository", 41 | "maintenance", 42 | "cli" 43 | ], 44 | "author": "Gregor Martynus (https://twitter.com/gr2m)", 45 | "license": "ISC", 46 | "repository": "github:octoherd/cli", 47 | "release": { 48 | "plugins": [ 49 | "@semantic-release/commit-analyzer", 50 | "@semantic-release/release-notes-generator", 51 | "@semantic-release/github", 52 | "@semantic-release/npm", 53 | [ 54 | "semantic-release-plugin-update-version-in-files", 55 | { 56 | "files": [ 57 | "version.js" 58 | ] 59 | } 60 | ] 61 | ] 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /scripts/generate-endpoints.js: -------------------------------------------------------------------------------- 1 | import { writeFile } from "fs/promises"; 2 | 3 | import prettier from "prettier"; 4 | import OpenAPI from "@octokit/openapi"; 5 | 6 | const spec = OpenAPI.schemas["api.github.com.deref"]; 7 | 8 | const ENDPOINTS = {}; 9 | const PATH = "lib/generated/endpoints.js"; 10 | 11 | for (const [path, methods] of Object.entries(spec.paths)) { 12 | for (const [method, operation] of Object.entries(methods)) { 13 | ENDPOINTS[`${method.toUpperCase()} ${path}`] = { 14 | name: operation.summary, 15 | documentationUrl: operation.externalDocs?.url, 16 | }; 17 | } 18 | } 19 | 20 | await writeFile( 21 | PATH, 22 | prettier.format(`export const ENDPOINTS = ${JSON.stringify(ENDPOINTS)}`, { 23 | parser: "babel", 24 | }) 25 | ); 26 | console.log("%s updated", PATH); 27 | -------------------------------------------------------------------------------- /tests/resolve-repositories.test.js: -------------------------------------------------------------------------------- 1 | import { resolveRepositories } from "../lib/resolve-repositories.js"; 2 | import { Octokit } from "@octoherd/octokit"; 3 | import { suite } from "uvu"; 4 | import { equal } from "uvu/assert"; 5 | import simple from "simple-mock"; 6 | 7 | const resolveRepos = suite("resolve-repositories"); 8 | const withOrg = suite('when GitHub account is an Organization: "@octoherd"'); 9 | const withUser = suite('when GitHub account is a User: "@gr2m"'); 10 | 11 | withOrg("when single repository exists", async () => { 12 | const org = "octoherd"; 13 | const repo = "cli"; 14 | const octokit = new Octokit({ 15 | auth: "randomToken", 16 | }); 17 | 18 | const mockedResponse = { id: 1, name: repo }; 19 | const repositories = [`${org}/${repo}`]; 20 | 21 | simple.mock(octokit, "request").resolveWith({ data: mockedResponse }); 22 | 23 | const resolvedRepos = await resolveRepositories( 24 | { 25 | log: console, 26 | octokit, 27 | }, 28 | repositories 29 | ); 30 | 31 | equal(resolvedRepos, [mockedResponse]); 32 | }); 33 | 34 | withOrg("when requesting the same repository twice", async () => { 35 | const org = "octoherd"; 36 | const repo = "cli"; 37 | const octokit = new Octokit({ 38 | auth: "randomToken", 39 | }); 40 | 41 | const mockedResponse = { id: 1, name: repo }; 42 | const repositories = [`${org}/${repo}`, `${org}/${repo}`]; 43 | 44 | simple.mock(octokit, "request").resolveWith({ data: mockedResponse }); 45 | 46 | const resolvedRepos = await resolveRepositories( 47 | { 48 | log: console, 49 | octokit, 50 | }, 51 | repositories 52 | ); 53 | 54 | equal(resolvedRepos, [mockedResponse]); 55 | }); 56 | 57 | withOrg("when requesting all repositories where one repository is ignored", async () => { 58 | const octokit = new Octokit({ auth: "randomToken" }); 59 | 60 | const repositories = ['octoherd/*', '!octoherd/cli']; 61 | 62 | const mockedResponse = [ 63 | { id: 1, name: "cli", full_name: 'octoherd/cli' }, 64 | { id: 2, name: "octokit", full_name: 'octoherd/octokit' }, 65 | { id: 3, name: "octoherd", full_name: 'octoherd/octoherd' }, 66 | ]; 67 | 68 | simple.mock(octokit, "request").resolveWith({ data: undefined }); 69 | 70 | simple.mock(octokit.paginate, "iterator").returnWith({ 71 | async *[Symbol.asyncIterator]() { 72 | yield { data: mockedResponse }; 73 | }, 74 | }); 75 | 76 | const resolvedRepos = await resolveRepositories( 77 | { 78 | log: console, 79 | octokit, 80 | }, 81 | repositories 82 | ); 83 | 84 | equal(resolvedRepos, [ 85 | { id: 2, name: "octokit", full_name: 'octoherd/octokit' }, 86 | { id: 3, name: "octoherd", full_name: 'octoherd/octoherd' }, 87 | ]); 88 | }); 89 | 90 | withOrg("when one of the requested repositories is ignored", async () => { 91 | const octokit = new Octokit({ auth: "randomToken" }); 92 | 93 | const repositories = ['!octoherd/cli', 'octoherd/octokit']; 94 | 95 | const mockedResponse = [ 96 | { id: 1, name: "cli", full_name: 'octoherd/cli' }, 97 | { id: 2, name: "octokit", full_name: 'octoherd/octokit' }, 98 | ]; 99 | 100 | simple.mock(octokit, "request").resolveWith({ data: mockedResponse[0] }); 101 | simple.mock(octokit, "request").resolveWith({ data: mockedResponse[1] }); 102 | 103 | const resolvedRepos = await resolveRepositories( 104 | { 105 | log: console, 106 | octokit, 107 | }, 108 | repositories 109 | ); 110 | 111 | equal(resolvedRepos, [ 112 | { id: 2, name: "octokit", full_name: 'octoherd/octokit' }, 113 | ]); 114 | }); 115 | 116 | withOrg("when requested repository is ignored", async () => { 117 | const org = "octoherd"; 118 | const repo = "cli"; 119 | const octokit = new Octokit({ 120 | auth: "randomToken", 121 | }); 122 | 123 | const mockedResponse = { id: 1, name: repo }; 124 | const repositories = [`!${org}/${repo.toUpperCase()}`]; 125 | 126 | simple.mock(octokit, "request").resolveWith({ data: mockedResponse }); 127 | 128 | const resolvedRepos = await resolveRepositories( 129 | { 130 | log: console, 131 | octokit, 132 | }, 133 | repositories 134 | ); 135 | 136 | equal(resolvedRepos, []); 137 | }); 138 | 139 | withOrg("when requesting all the repositories", async () => { 140 | const org = "octoherd"; 141 | const repo = "*"; 142 | const octokit = new Octokit({ auth: "randomToken" }); 143 | 144 | const repositories = [`${org}/${repo}`]; 145 | 146 | const mockedResponse = [ 147 | { id: 1, name: "cli" }, 148 | { id: 2, name: "octoherd" }, 149 | { id: 3, name: ".github" }, 150 | { id: 4, name: "octokit" }, 151 | { id: 5, name: "script-close-renovate-dashboard-issues" }, 152 | { id: 6, name: "script-create-repositories-from-script-folders" }, 153 | { id: 7, name: "script-find-releases" }, 154 | { id: 8, name: "script-remove-dependabot" }, 155 | { id: 9, name: "script-remove-required-ci-check" }, 156 | { id: 10, name: "script-setup-renovate" }, 157 | { id: 11, name: "script-star-or-unstar" }, 158 | { id: 12, name: "script-sync-branch-protections" }, 159 | { id: 13, name: "script-add-octoherd-cli-to-script" }, 160 | { id: 14, name: "script-hello-world" }, 161 | { id: 15, name: "create-octoherd-script }" }, 162 | ]; 163 | 164 | simple.mock(octokit, "request").resolveWith(undefined); 165 | 166 | simple.mock(octokit.paginate, "iterator").returnWith({ 167 | async *[Symbol.asyncIterator]() { 168 | yield { data: mockedResponse }; 169 | }, 170 | }); 171 | 172 | const resolvedRepos = await resolveRepositories( 173 | { 174 | log: console, 175 | octokit, 176 | }, 177 | repositories 178 | ); 179 | 180 | equal(resolvedRepos, mockedResponse); 181 | }); 182 | 183 | withOrg( 184 | "when requesting all the repositories with pattern at end", 185 | async () => { 186 | const org = "octoherd"; 187 | const repo = "script-*"; 188 | const octokit = new Octokit({ 189 | auth: process.env.GITHUB_TOKEN, 190 | }); 191 | 192 | const repositories = [`${org}/${repo}`]; 193 | 194 | const scriptRepos = [ 195 | { id: 1, name: "script-close-renovate-dashboard-issues" }, 196 | { id: 2, name: "script-create-repositories-from-script-folders" }, 197 | { id: 3, name: "script-find-releases" }, 198 | { id: 4, name: "script-remove-dependabot" }, 199 | { id: 5, name: "script-remove-required-ci-check" }, 200 | { id: 6, name: "script-setup-renovate" }, 201 | { id: 7, name: "script-star-or-unstar" }, 202 | { id: 8, name: "script-sync-branch-protections" }, 203 | { id: 9, name: "script-add-octoherd-cli-to-script" }, 204 | { id: 10, name: "script-hello-world" }, 205 | ]; 206 | 207 | const nonScriptRepos = [ 208 | { id: 11, name: "cli" }, 209 | { id: 12, name: "octoherd" }, 210 | { id: 13, name: ".github" }, 211 | { id: 14, name: "octokit" }, 212 | { id: 15, name: "create-octoherd-script }" }, 213 | ]; 214 | 215 | simple.mock(octokit, "request").resolveWith(undefined); 216 | 217 | simple.mock(octokit.paginate, "iterator").returnWith({ 218 | async *[Symbol.asyncIterator]() { 219 | yield { data: [...scriptRepos, ...nonScriptRepos] }; 220 | }, 221 | }); 222 | 223 | const resolvedRepos = await resolveRepositories( 224 | { 225 | log: console, 226 | octokit, 227 | }, 228 | repositories 229 | ); 230 | 231 | equal(resolvedRepos, scriptRepos); 232 | } 233 | ); 234 | 235 | withOrg( 236 | "when requesting all the repositories with pattern at end", 237 | async () => { 238 | const org = "octoherd"; 239 | const repo = "*-test"; 240 | const octokit = new Octokit({ 241 | auth: process.env.GITHUB_TOKEN, 242 | }); 243 | 244 | const repositories = [`${org}/${repo}`]; 245 | 246 | const testRepos = [ 247 | { id: 1, name: "one-test" }, 248 | { id: 2, name: "two-test" }, 249 | { id: 3, name: "three-test" }, 250 | ]; 251 | 252 | const nonTestRepos = [{ id: 4, name: "foo" }, { id: 5, name: "bar" }]; 253 | 254 | simple.mock(octokit, "request").resolveWith(undefined); 255 | 256 | simple.mock(octokit.paginate, "iterator").returnWith({ 257 | async *[Symbol.asyncIterator]() { 258 | yield { data: [...testRepos, ...nonTestRepos] }; 259 | }, 260 | }); 261 | 262 | const resolvedRepos = await resolveRepositories( 263 | { 264 | log: console, 265 | octokit, 266 | }, 267 | repositories 268 | ); 269 | 270 | equal(resolvedRepos, testRepos); 271 | } 272 | ); 273 | withOrg( 274 | "when requesting all the repositories with pattern in the middle", 275 | async () => { 276 | const org = "octoherd"; 277 | const repo = "middle-*-test"; 278 | const octokit = new Octokit({ 279 | auth: process.env.GITHUB_TOKEN, 280 | }); 281 | 282 | const repositories = [`${org}/${repo}`]; 283 | 284 | const testRepos = [ 285 | { id: 1, name: "middle-one-test" }, 286 | { id: 2, name: "middle-two-test" }, 287 | { id: 3, name: "middle-three-test" }, 288 | ]; 289 | 290 | const nonTestRepos = [{ id: 4, name: "foo" }, { id: 5, name: "bar" }]; 291 | 292 | simple.mock(octokit, "request").resolveWith(undefined); 293 | 294 | simple.mock(octokit.paginate, "iterator").returnWith({ 295 | async *[Symbol.asyncIterator]() { 296 | yield { data: [...testRepos, ...nonTestRepos] }; 297 | }, 298 | }); 299 | 300 | const resolvedRepos = await resolveRepositories( 301 | { 302 | log: console, 303 | octokit, 304 | }, 305 | repositories 306 | ); 307 | 308 | equal(resolvedRepos, testRepos); 309 | } 310 | ); 311 | 312 | withUser("when single repository exists", async () => { 313 | const owner = "gr2m"; 314 | const repo = "squash-commit-app"; 315 | const octokit = new Octokit({ 316 | auth: process.env.GITHUB_TOKEN, 317 | }); 318 | 319 | const repositories = [`${owner}/${repo}`]; 320 | 321 | const mockedResponse = { name: repo }; 322 | 323 | simple.mock(octokit, "request").resolveWith({ data: mockedResponse }); 324 | 325 | const resolvedRepos = await resolveRepositories( 326 | { 327 | log: console, 328 | octokit, 329 | }, 330 | repositories 331 | ); 332 | 333 | equal(resolvedRepos, [mockedResponse]); 334 | }); 335 | 336 | withUser("when requesting the same repository twice", async () => { 337 | const owner = "gr2m"; 338 | const repo = "squash-commit-app"; 339 | const octokit = new Octokit({ 340 | auth: process.env.GITHUB_TOKEN, 341 | }); 342 | 343 | const repositories = [`${owner}/${repo}`, `${owner}/${repo}`]; 344 | 345 | const mockedResponse = { id: 1, name: repo }; 346 | 347 | simple.mock(octokit, "request").resolveWith({ data: mockedResponse }); 348 | 349 | const resolvedRepos = await resolveRepositories( 350 | { 351 | log: console, 352 | octokit, 353 | }, 354 | repositories 355 | ); 356 | 357 | equal(resolvedRepos, [mockedResponse]); 358 | }); 359 | 360 | withUser("when requesting all the repositories", async () => { 361 | const owner = "octokitbot"; 362 | const repo = "*"; 363 | const octokit = new Octokit({ 364 | auth: process.env.GITHUB_TOKEN, 365 | }); 366 | 367 | const repositories = [`${owner}/${repo}`]; 368 | 369 | const mockedResponse = [{ id: 1, name: "repo1" }, { id: 2, name: "repo2" }]; 370 | 371 | simple.mock(octokit, "request").rejectWith(undefined); 372 | 373 | simple.mock(octokit.paginate, "iterator").returnWith({ 374 | async *[Symbol.asyncIterator]() { 375 | yield { data: mockedResponse }; 376 | }, 377 | }); 378 | 379 | const resolvedRepos = await resolveRepositories( 380 | { 381 | log: console, 382 | octokit, 383 | }, 384 | repositories 385 | ); 386 | 387 | equal(resolvedRepos, mockedResponse); 388 | }); 389 | 390 | withUser("when requesting all repositories where one repository is ignored", async () => { 391 | const octokit = new Octokit({ auth: "randomToken" }); 392 | 393 | const repositories = ['*', '!gr2m/two']; 394 | 395 | const mockedResponse = [ 396 | { id: 1, name: "one", full_name: 'gr2m/one' }, 397 | { id: 2, name: "two", full_name: 'gr2m/two' }, 398 | { id: 3, name: "three", full_name: 'gr2m/three' }, 399 | ]; 400 | 401 | simple.mock(octokit, "request").resolveWith({ data: undefined }); 402 | 403 | simple.mock(octokit.paginate, "iterator").returnWith({ 404 | async *[Symbol.asyncIterator]() { 405 | yield { data: mockedResponse }; 406 | }, 407 | }); 408 | 409 | const resolvedRepos = await resolveRepositories( 410 | { 411 | log: console, 412 | octokit, 413 | }, 414 | repositories 415 | ); 416 | 417 | equal(resolvedRepos, [ 418 | { id: 1, name: "one", full_name: 'gr2m/one' }, 419 | { id: 3, name: "three", full_name: 'gr2m/three' }, 420 | ]); 421 | }); 422 | 423 | resolveRepos("resolve-repositories", () => { 424 | withOrg.run(); 425 | withUser.run(); 426 | }); 427 | 428 | resolveRepos.after.each(() => { 429 | nock.cleanAll(); 430 | }); 431 | 432 | resolveRepos.run(); 433 | -------------------------------------------------------------------------------- /tests/smoke.test.js: -------------------------------------------------------------------------------- 1 | import { suite } from "uvu"; 2 | import { equal } from "uvu/assert"; 3 | 4 | import * as CLI from "../index.js"; 5 | 6 | const smokeTest = suite("smoke"); 7 | 8 | smokeTest("exports octoherd function", () => { 9 | equal(typeof CLI.octoherd, "function"); 10 | }); 11 | 12 | smokeTest("exports Octokit contructor", () => { 13 | equal(typeof CLI.Octokit, "function"); 14 | }); 15 | 16 | smokeTest.run(); 17 | -------------------------------------------------------------------------------- /version.js: -------------------------------------------------------------------------------- 1 | // value replaced before publish to npm 2 | export const VERSION = "0.0.0-development"; 3 | --------------------------------------------------------------------------------