├── .all-contributorsrc
├── .eslintignore
├── .eslintrc
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── PULL_REQUEST_TEMPLATE.md
├── actions
│ ├── build-cache
│ │ └── action.yml
│ └── install-deps
│ │ └── action.yml
├── dependabot.yml
└── workflows
│ └── build.yml
├── .gitignore
├── .npmrc
├── .prettierignore
├── .vscode
└── launch.json
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── Formula
└── auto.rb
├── LICENSE
├── README.md
├── auto.config.ts
├── auto.gif
├── docs
├── components
│ ├── get-started-button.js
│ ├── home.js
│ └── label.js
├── css
│ └── syntax-highlighting-overrides.css
├── generate-command-docs.js
├── next.config.js
├── pages
│ ├── _app.js
│ ├── _document.js
│ ├── blog.js
│ ├── blog
│ │ ├── both-worlds.mdx
│ │ ├── npm-canary-scope.mdx
│ │ ├── pr-in-progress.mdx
│ │ ├── using-shipit.mdx
│ │ ├── v8.mdx
│ │ └── why.mdx
│ ├── docs
│ │ ├── _sidebar.mdx
│ │ ├── build-platforms
│ │ │ ├── circleci.mdx
│ │ │ ├── github-actions.mdx
│ │ │ ├── jenkins.mdx
│ │ │ └── travis.mdx
│ │ ├── configuration
│ │ │ ├── autorc.mdx
│ │ │ ├── non-npm.mdx
│ │ │ ├── plugins.mdx
│ │ │ └── troubleshooting.mdx
│ │ ├── extras
│ │ │ ├── changelog.md
│ │ │ ├── create-labels.md
│ │ │ ├── label.md
│ │ │ ├── next.md
│ │ │ ├── release.md
│ │ │ ├── shipit.md
│ │ │ └── version.md
│ │ ├── index.mdx
│ │ ├── plugins
│ │ │ ├── changelog-hooks.mdx
│ │ │ ├── configuration-hooks.mdx
│ │ │ ├── hook-api-docs.mdx
│ │ │ ├── init-hooks.mdx
│ │ │ ├── log-parse-hooks.mdx
│ │ │ ├── release-lifecycle-hooks.mdx
│ │ │ ├── writing-plugins.mdx
│ │ │ └── writing-publishing-plugins.mdx
│ │ └── welcome
│ │ │ ├── getting-started.mdx
│ │ │ └── quick-merge.mdx
│ └── index.mdx
└── public
│ ├── add-label.png
│ ├── changelog-example.png
│ ├── complete-auto.png
│ ├── dark-logo-large.png
│ ├── dark-logo-small.png
│ ├── default-auto.png
│ ├── favicon-dark.png
│ ├── favicon.png
│ ├── hook-overview.png
│ ├── jenkins-next-branches.png
│ ├── light-logo-large.png
│ ├── light-logo-small.png
│ ├── logo-dark.svg
│ ├── logo-large-dark.png
│ ├── logo-large.png
│ ├── logo.svg
│ ├── manifest.json
│ ├── merge.png
│ ├── monochrome-logo-large.png
│ ├── monochrome-logo-small.png
│ ├── next-branch.png
│ ├── open-pr.png
│ ├── pr-to-pr.png
│ ├── readme-logo.png
│ └── release-example.png
├── formula-template.rb
├── lerna.json
├── os-project-logo.svg
├── package.json
├── packages
├── bot-list
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── cli
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── bundle.test.ts.snap
│ │ ├── args.test.ts
│ │ ├── bundle.test.ts
│ │ ├── config.test.ts
│ │ └── main.test.ts
│ ├── package.json
│ ├── scripts
│ │ └── inject-version.js
│ ├── src
│ │ ├── bin
│ │ │ └── auto.ts
│ │ ├── index.ts
│ │ ├── parse-args.ts
│ │ └── run.ts
│ └── tsconfig.json
├── core
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── __tests__
│ │ │ ├── __snapshots__
│ │ │ │ ├── auto.test.ts.snap
│ │ │ │ ├── changelog.test.ts.snap
│ │ │ │ ├── git.test.ts.snap
│ │ │ │ ├── log-parse.test.ts.snap
│ │ │ │ ├── match-sha-to-pr.test.ts.snap
│ │ │ │ ├── release.test.ts.snap
│ │ │ │ └── validate-config.test.ts.snap
│ │ │ ├── auto-canary-local.test.ts
│ │ │ ├── auto-ci-base-branch.test.ts
│ │ │ ├── auto-comment.test.ts
│ │ │ ├── auto-env.test.ts
│ │ │ ├── auto-git-user-in-ci.test.ts
│ │ │ ├── auto-in-pr-ci.test.ts
│ │ │ ├── auto-make-changelog.test.ts
│ │ │ ├── auto.test.ts
│ │ │ ├── changelog.test.ts
│ │ │ ├── config.test.ts
│ │ │ ├── determine-next-version.test.ts
│ │ │ ├── get-current-branch.test.ts
│ │ │ ├── get-remote.test.ts
│ │ │ ├── git.test.ts
│ │ │ ├── github-responses
│ │ │ │ ├── bad-credentials.json
│ │ │ │ └── pr-labels.json
│ │ │ ├── log-parse.test.ts
│ │ │ ├── major-version-branches.test.ts
│ │ │ ├── make-commit-from-msg.ts
│ │ │ ├── match-sha-to-pr.test.ts
│ │ │ ├── next.test.ts
│ │ │ ├── release.test.ts
│ │ │ ├── remote.test.ts
│ │ │ ├── semver.test.ts
│ │ │ └── validate-config.test.ts
│ │ ├── auto-args.ts
│ │ ├── auto.ts
│ │ ├── changelog.ts
│ │ ├── config.ts
│ │ ├── git.ts
│ │ ├── init.ts
│ │ ├── log-parse.ts
│ │ ├── match-sha-to-pr.ts
│ │ ├── plugins
│ │ │ ├── __tests__
│ │ │ │ └── filter-non-pull-request.test.ts
│ │ │ └── filter-non-pull-request.ts
│ │ ├── release.ts
│ │ ├── semver.ts
│ │ ├── types.ts
│ │ ├── utils
│ │ │ ├── __tests__
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── load-plugin.test.ts.snap
│ │ │ │ ├── exec-promise.test.ts
│ │ │ │ ├── get-lerna-packages.test.ts
│ │ │ │ ├── get-repository.test.ts
│ │ │ │ ├── load-plugin-canary.test.ts
│ │ │ │ ├── load-plugin-windows.test.ts
│ │ │ │ ├── load-plugin.test.ts
│ │ │ │ ├── test-plugin-malformed.js
│ │ │ │ ├── test-plugin.ts
│ │ │ │ ├── test.js
│ │ │ │ ├── try-require.test.ts
│ │ │ │ └── verify-auth.test.ts
│ │ │ ├── exec-promise.ts
│ │ │ ├── get-current-branch.ts
│ │ │ ├── get-lerna-packages.ts
│ │ │ ├── get-repository.ts
│ │ │ ├── git-reset.ts
│ │ │ ├── in-folder.ts
│ │ │ ├── is-binary.ts
│ │ │ ├── load-plugins.ts
│ │ │ ├── logger.ts
│ │ │ ├── make-hooks.ts
│ │ │ ├── omit.ts
│ │ │ ├── test-config
│ │ │ │ ├── package.json
│ │ │ │ ├── some-other-plugin.js
│ │ │ │ └── some-plugin.js
│ │ │ ├── try-require.ts
│ │ │ └── verify-auth.ts
│ │ └── validate-config.ts
│ └── tsconfig.json
└── package-json-utils
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ ├── index.test.ts
│ └── index.ts
│ └── tsconfig.json
├── patches
├── @atomictech+rehype-toc+3.1.2.patch
└── next-ignite+0.10.11.patch
├── plugins
├── all-contributors
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── all-contributors.test.ts.snap
│ │ └── all-contributors.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── brew
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── brew.test.ts.snap
│ │ └── brew.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── chrome
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── cocoapods
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── cocoapods.test.ts
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ └── utilities.ts
│ └── tsconfig.json
├── conventional-commits
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── conventional-commits.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── crates
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── crates.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── docker
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── docker.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── exec
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── exec.test.ts.snap
│ │ └── exec.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── first-time-contributor
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── first-time-contributor.test.ts.snap
│ │ └── first-time-contributor.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── gem
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── gem.test.ts.snap
│ │ └── gem.test.ts
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ └── utils.ts
│ └── tsconfig.json
├── gh-pages
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── gh-pages.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── git-tag
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── git-tag.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── gradle
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── gradle.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── jira
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── jira.test.ts.snap
│ │ └── jira.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── magic-zero
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── magic-zero.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── maven
│ ├── .snyk
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── maven.test.ts
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ ├── maven.ts
│ │ └── native-version-update.ts
│ └── tsconfig.json
├── microsoft-teams
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── index.test.ts.snap
│ │ └── index.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── npm
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ ├── monorepo-log.test.ts.snap
│ │ │ └── npm.test.ts.snap
│ │ ├── monorepo-log.test.ts
│ │ ├── npm-next.test.ts
│ │ ├── npm.test.ts
│ │ └── set-npm-token.test.ts
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ ├── set-npm-token.ts
│ │ └── utils.ts
│ └── tsconfig.json
├── omit-commits
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── omit-commits.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── omit-release-notes
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── omit-release-notes.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── pr-body-labels
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── pr-body-labels.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── protected-branch
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── protected-branch.test.ts
│ ├── doc
│ │ ├── branch-protection-1.png
│ │ └── branch-protection-2.png
│ ├── package.json
│ ├── src
│ │ ├── GitOperator.ts
│ │ └── index.ts
│ └── tsconfig.json
├── released
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── released-label.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── s3
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── s3.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── sbt
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── sbt.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── slack
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── slack.test.ts.snap
│ │ └── slack.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── twitter
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── twitter.test.ts.snap
│ │ └── twitter.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── upload-assets
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ ├── test-assets
│ │ │ ├── macos
│ │ │ ├── test-2.txt
│ │ │ └── test.txt
│ │ ├── upload-assets-ci.test.ts
│ │ └── upload-assets.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── version-file
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ │ └── version-file.test.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
└── vscode
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __tests__
│ └── vscode.test.ts
│ ├── package.json
│ ├── src
│ ├── index.ts
│ └── utils.ts
│ └── tsconfig.json
├── scripts
├── auto-update-curl-version.js
├── create-package.js
├── create-plugin.js
├── generate-cofingurable-args.js
├── jest-setup.js
├── template-package
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
└── template-plugin
│ ├── README.md
│ ├── __tests__
│ └── {{kebab}}.test.ts
│ ├── package.json
│ ├── src
│ └── index.ts
│ └── tsconfig.json
├── tsconfig.dev.json
├── tsconfig.json
├── typings
├── all-contributors.d.ts
├── dot-properties.d.ts
├── endent.d.ts
├── fromentries.d.ts
├── get-monorepo-packages.d.ts
├── import-cwd.d.ts
├── module-alias.d.ts
├── node-pom-parser.d.ts
├── parse-author.d.ts
├── requireg.d.ts
└── tweet-tweet.d.ts
└── yarn.lock
/.eslintignore:
--------------------------------------------------------------------------------
1 | **/node_modules
2 | **/dist
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ""
5 | labels: bug
6 | assignees: ""
7 | ---
8 |
9 | **Describe the bug**
10 |
11 |
12 |
13 | **To Reproduce**
14 |
15 |
16 |
17 |
18 |
19 | **Expected behavior**
20 |
21 |
22 |
23 | **Screenshots**
24 |
25 |
26 |
27 | **Environment information:**
28 |
29 |
30 |
31 | ```txt
32 |
33 | ```
34 |
35 | **Additional context**
36 |
37 |
38 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ""
5 | labels: enhancement
6 | assignees: ""
7 | ---
8 |
9 | **Is your feature request related to a problem? Please describe.**
10 |
11 |
12 |
13 | **Describe the solution you'd like**
14 |
15 |
16 |
17 | **Describe alternatives you've considered**
18 |
19 |
20 |
21 | **Additional context**
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | # What Changed
2 |
3 | ## Why
4 |
5 | Todo:
6 |
7 | - [ ] Add tests
8 | - [ ] Add docs
9 |
10 | ## Change Type
11 |
12 | Indicate the type of change your pull request is:
13 |
14 | - [ ] `documentation`
15 | - [ ] `patch`
16 | - [ ] `minor`
17 | - [ ] `major`
18 |
--------------------------------------------------------------------------------
/.github/actions/build-cache/action.yml:
--------------------------------------------------------------------------------
1 | name: "Build Cache"
2 | description: build cache
3 |
4 | runs:
5 | using: "composite"
6 | steps:
7 | - name: build cache
8 | uses: actions/cache@v3
9 | with:
10 | path: |
11 | node_modules
12 | packages/*/node_modules
13 | plugins/*/node_modules
14 | packages/*/dist
15 | plugins/*/dist
16 | */cli/binary
17 | key: ${{ github.run_id }}
18 | restore-keys: ${{ github.run_id }}
19 |
--------------------------------------------------------------------------------
/.github/actions/install-deps/action.yml:
--------------------------------------------------------------------------------
1 | name: "Setup"
2 | description: Setup action
3 |
4 | runs:
5 | using: "composite"
6 | steps:
7 | - name: Use nodejs
8 | uses: actions/setup-node@v3
9 | with:
10 | node-version: 16.18
11 |
12 | - name: restore workspace cache
13 | uses: actions/cache@v3
14 | id: node_modules
15 | with:
16 | path: |
17 | node_modules
18 | packages/*/node_modules
19 | key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock', 'patches/*.patch') }}
20 | restore-keys: |
21 | node-modules-${{ runner.os }}-
22 |
23 | - run: yarn install --frozen-lockfile --network-timeout 9000000
24 | if: steps.node_modules.outputs.cache-hit != 'true'
25 | shell: bash
26 |
27 | - name: restore pkg cache
28 | uses: actions/cache@v3
29 | id: pkg
30 | with:
31 | path: ~/.pkg-cache
32 | key: pkg-cache-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
33 | restore-keys: |
34 | pkg-cache-${{ runner.os }}-
35 |
36 | - name: Install pkg node binaries
37 | if: steps.pkg.outputs.cache-hit != 'true'
38 | shell: bash
39 | run: |
40 | yarn pkg-fetch -n node16 -p macos -a x64
41 | yarn pkg-fetch -n node16 -p win -a x64
42 | yarn pkg-fetch -n node16 -p linux -a x64
43 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: npm
4 | directory: "/"
5 | schedule:
6 | interval: weekly
7 | time: "13:00"
8 | open-pull-requests-limit: 10
9 | labels:
10 | - dependencies
11 | ignore:
12 | - dependency-name: log-symbols
13 | versions:
14 | - 4.1.0
15 | - dependency-name: jsdom
16 | versions:
17 | - 16.5.2
18 | - dependency-name: type-fest
19 | versions:
20 | - 1.0.1
21 | - dependency-name: eslint-config-xo
22 | versions:
23 | - 0.35.0
24 | - dependency-name: "@types/jsdom"
25 | versions:
26 | - 16.2.9
27 | - dependency-name: "@fortawesome/fontawesome-svg-core"
28 | versions:
29 | - 1.2.34
30 | - 1.2.35
31 | - dependency-name: next-ignite
32 | versions:
33 | - 0.10.7
34 | - 0.10.8
35 | - dependency-name: "@typescript-eslint/eslint-plugin"
36 | versions:
37 | - 4.15.2
38 | - 4.16.1
39 | - 4.17.0
40 | - dependency-name: eslint-plugin-jest
41 | versions:
42 | - 24.1.5
43 | - 24.1.9
44 | - 24.2.1
45 | - dependency-name: "@octokit/rest"
46 | versions:
47 | - 18.3.0
48 | - 18.3.1
49 | - 18.3.4
50 | - dependency-name: ts-jest
51 | versions:
52 | - 26.5.2
53 | - dependency-name: typescript
54 | versions:
55 | - 4.1.3
56 | - 4.2.2
57 | - dependency-name: eslint-plugin-jsdoc
58 | versions:
59 | - 32.2.0
60 | - dependency-name: vsce
61 | versions:
62 | - 1.85.1
63 | - dependency-name: "@types/node"
64 | versions:
65 | - 14.14.25
66 | - 14.14.26
67 | - 14.14.28
68 | - 14.14.31
69 | - dependency-name: eslint-config-prettier
70 | versions:
71 | - 7.2.0
72 | - dependency-name: "@typescript-eslint/parser"
73 | versions:
74 | - 4.14.2
75 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | registry=https://registry.yarnpkg.com
2 | package-lock = false
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | scripts/template-plugin/
2 | CHANGELOG.md
3 | coverage
4 | .next
5 | .mdx-data
6 | docs/out
7 | docs/generated
8 | dist/
9 | test-plugin-malformed.js
10 | lerna.json
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "type": "node",
6 | "request": "launch",
7 | "name": "Jest All",
8 | "program": "${workspaceFolder}/node_modules/.bin/jest",
9 | "args": ["--runInBand"],
10 | "console": "integratedTerminal",
11 | "internalConsoleOptions": "neverOpen",
12 | "disableOptimisticBPs": true,
13 | "windows": {
14 | "program": "${workspaceFolder}/node_modules/jest/bin/jest"
15 | }
16 | },
17 | {
18 | "type": "node",
19 | "request": "launch",
20 | "name": "Jest Current File",
21 | "program": "${workspaceFolder}/node_modules/.bin/jest",
22 | "args": ["${relativeFile}", "--coverage", "false"],
23 | "console": "integratedTerminal",
24 | "internalConsoleOptions": "neverOpen",
25 | "disableOptimisticBPs": true,
26 | "windows": {
27 | "program": "${workspaceFolder}/node_modules/jest/bin/jest"
28 | }
29 | }
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | Open source projects are “living.” Contributions in the form of issues and pull requests are welcomed and encouraged. When you contribute, you explicitly say you are part of the community and abide by its Code of Conduct.
2 |
3 | # The Code
4 |
5 | At Intuit, we foster a kind, respectful, harassment-free cooperative community. Our open source community works to:
6 |
7 | - Be kind and respectful;
8 | - Act as a global community;
9 | - Conduct ourselves professionally.
10 |
11 | As members of this community, we will not tolerate behaviors including, but not limited to:
12 |
13 | - Violent threats or language;
14 | - Discriminatory or derogatory jokes or language;
15 | - Public or private harassment of any kind;
16 | - Other conduct considered inappropriate in a professional setting.
17 |
18 | ## Reporting Concerns
19 |
20 | If you see someone violating the Code of Conduct please email TechOpenSource@intuit.com
21 |
22 | ## Scope
23 |
24 | This code of conduct applies to:
25 |
26 | All repos and communities for Intuit-managed projects, whether or not the text is included in a Intuit-managed project’s repository;
27 |
28 | Individuals or teams representing projects in official capacity, such as via official social media channels or at in-person meetups.
29 |
30 | ## Attribution
31 |
32 | This Code of Conduct is partly inspired by and based on those of Amazon, CocoaPods, GitHub, Microsoft, thoughtbot, and on the Contributor Covenant version 1.4.1.
33 |
--------------------------------------------------------------------------------
/Formula/auto.rb:
--------------------------------------------------------------------------------
1 | class Auto < Formula
2 | desc "Generate releases based on semantic version labels on pull requests."
3 | homepage "https://intuit.github.io/auto"
4 | url "https://github.com/intuit/auto/releases/download/v11.3.0/auto-macos.gz"
5 | version "v11.3.0"
6 | sha256 "c7527afe74d8469b3c52fb2c753cec7dbed5d9a7618fa9231697af0d76c00a77"
7 |
8 | def install
9 | libexec.install Dir["*"]
10 | bin.install libexec/"auto-macos"
11 | mv bin/"auto-macos", bin/"auto"
12 | end
13 |
14 | test do
15 | system bin/"auto", "--version"
16 | end
17 | end
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2018 Intuit
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19 | OR OTHER DEALINGS IN THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/auto.config.ts:
--------------------------------------------------------------------------------
1 | import { AutoRc } from "./packages/core";
2 |
3 | import { INpmConfig } from "./plugins/npm";
4 | import { IBrewPluginOptions } from "./plugins/brew";
5 | // import { IGhPagesPluginOptions } from "./plugins/gh-pages";
6 | import { IAllContributorsPluginOptions } from "./plugins/all-contributors";
7 |
8 | const npmOptions: INpmConfig = {
9 | exact: true,
10 | canaryScope: "@auto-canary",
11 | };
12 |
13 | const allContributorsOptions: IAllContributorsPluginOptions = {
14 | types: {
15 | plugin: "**/plugin/**/*",
16 | code: ["**/src/**/*", "**/package.json", "**/tsconfig.json"],
17 | },
18 | };
19 |
20 | const brewOptions: IBrewPluginOptions = {
21 | executable: "./packages/cli/binary/auto-macos.gz",
22 | name: "auto",
23 | };
24 |
25 | /** Auto configuration */
26 | export default function rc(): AutoRc {
27 | return {
28 | plugins: [
29 | [
30 | "protected-branch",
31 | {
32 | releaseTemporaryBranchPrefix: "protected-release-",
33 | requiredStatusChecks: ["WIP", "build", "test", "lint"],
34 | },
35 | ],
36 | [
37 | "upload-assets",
38 | [
39 | "./packages/cli/binary/auto-linux.gz",
40 | "./packages/cli/binary/auto-macos.gz",
41 | "./packages/cli/binary/auto-win.exe.gz",
42 | ],
43 | ],
44 | ["npm", npmOptions],
45 | "released",
46 | "first-time-contributor",
47 | "pr-body-labels",
48 | "./scripts/auto-update-curl-version.js",
49 | ["all-contributors", allContributorsOptions],
50 | ["brew", brewOptions],
51 | ],
52 | labels: [
53 | {
54 | name: "blog-post",
55 | changelogTitle: "📚 Blog Post",
56 | releaseType: "none",
57 | },
58 | ],
59 | };
60 | }
61 |
--------------------------------------------------------------------------------
/auto.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/auto.gif
--------------------------------------------------------------------------------
/docs/components/get-started-button.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | /** A button that routes the user to the getting started page */
4 | export const GetStarted = () => (
5 |
9 | Get Started 🎉
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/docs/components/label.js:
--------------------------------------------------------------------------------
1 | /** A GitHub style label */
2 | export const Label = ({ children, color, className }) => (
3 |
7 | {children}
8 |
9 | );
10 |
--------------------------------------------------------------------------------
/docs/css/syntax-highlighting-overrides.css:
--------------------------------------------------------------------------------
1 | .token.operator,
2 | .token.entity,
3 | .token.url,
4 | .language-css .token.string,
5 | .style .token.string {
6 | background: none;
7 | }
8 |
9 | * {
10 | text-shadow: none !important;
11 | }
12 |
13 | #ignite .toc ol li {
14 | list-style-type: disc;
15 | }
16 |
--------------------------------------------------------------------------------
/docs/next.config.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-var-requires */
2 | const toc = require("@atomictech/rehype-toc");
3 |
4 | const withIgnite = require("next-ignite/next")({
5 | repo: "intuit/auto",
6 | name: "auto",
7 | url: "https://intuit.github.io/auto",
8 | rehypePlugins: [[toc, { placeholder: "{{TOC}}" }]],
9 | });
10 |
11 | module.exports = withIgnite();
12 |
--------------------------------------------------------------------------------
/docs/pages/_app.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import App from "next/app";
3 | import { MDXProvider } from "@mdx-js/react";
4 | import { igniteComponents } from "next-ignite";
5 | import SimpleReactLightbox, { SRLWrapper } from "simple-react-lightbox";
6 | import { config } from "@fortawesome/fontawesome-svg-core";
7 | import "@fortawesome/fontawesome-svg-core/styles.css";
8 |
9 | import "next-ignite/dist/main.css";
10 | import "../css/syntax-highlighting-overrides.css";
11 |
12 | // Tell Font Awesome to skip adding the CSS automatically since it's being imported above
13 | config.autoAddCss = false;
14 |
15 | const components = {
16 | ...igniteComponents,
17 | img: (props) => {
18 | if (props.alt?.includes("Logo")) {
19 | return ;
20 | }
21 |
22 | return (
23 |
24 |
36 |
40 |
41 |
42 | );
43 | },
44 | };
45 |
46 | function MyApp({ Component, pageProps }) {
47 | return (
48 |
49 |
50 |
51 | );
52 | }
53 |
54 | export default MyApp;
55 |
--------------------------------------------------------------------------------
/docs/pages/_document.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Document, { Html, Head, Main, NextScript } from "next/document";
3 |
4 | class MyDocument extends Document {
5 | render() {
6 | return (
7 |
8 |
9 |
33 |
37 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | );
59 | }
60 | }
61 |
62 | export default MyDocument;
63 |
--------------------------------------------------------------------------------
/docs/pages/blog.js:
--------------------------------------------------------------------------------
1 | import { BlogIndex } from "next-ignite";
2 |
3 | /** The blog index */
4 | const Blog = () => ;
5 |
6 | export default Blog;
7 |
--------------------------------------------------------------------------------
/docs/pages/blog/both-worlds.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | image: https://images.unsplash.com/photo-1554916171-0cfab61e5607?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1200&h=600&fit=crop&ixid=eyJhcHBfaWQiOjF9
3 | title: Best of Both Worlds
4 | author: Andrew Lisowski
5 | email: lisowski54@gmail.com
6 | date: "Thu, 12 Mar 2020 23:00:02 -0700"
7 | ---
8 |
9 | One of the main goals we had when building auto was to ease the introduction to automated releases through using pull request labels.
10 |
11 | The main alternative to auto works in a slightly different way, [semantic-release](https://github.com/semantic-release/semantic-release) uses the [conventional commit spec](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) to calculate the next version. This is an awesome way to accomplish automated releases, but it is very strict and can create more work when accepting outside contribution. PR labels solve this problem beautifully, but...
12 |
13 |
18 |
19 | That's exactly why we made the [conventional-commits plugin](). It allows you to keep your conventional commit work flow but still get the benefits of PR labels based automation.
20 |
21 | To start using conventional commit style commit messages simply add the following to your auto config.
22 |
23 | ```json
24 | {
25 | "plugins": ["conventional-commits"]
26 | }
27 | ```
28 |
29 | Now you can enjoy the best of both worlds! :tada:
30 |
--------------------------------------------------------------------------------
/docs/pages/docs/build-platforms/circleci.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: CircleCI
3 | ---
4 |
5 | The following config declares the `release` job and uses it in the `build_and_release` workflow. The `release` job will run at the end of each build and either release:
6 |
7 | - a new `latest` version from `baseBranch`
8 | - a `canary` build from a pull request (if your package manager plugin implements them)
9 |
10 | ```yaml
11 | version: 2
12 |
13 | defaults: &defaults
14 | working_directory: ~/auto
15 | docker:
16 | - image: circleci/node:latest-browsers
17 |
18 | jobs:
19 | install: # your install job
20 |
21 | release:
22 | <<: *defaults
23 | steps:
24 | - attach_workspace:
25 | at: ~/auto
26 | - run:
27 | name: Release
28 | command: npx auto shipit
29 |
30 | workflows:
31 | version: 2
32 | build_and_release:
33 | jobs:
34 | - install
35 |
36 | - release:
37 | requires:
38 | - install
39 | ```
40 |
41 | ## Troubleshooting
42 |
43 | If you are having problems make sure you have done the following:
44 |
45 | - `GH_TOKEN` is set
46 | - Any other secrets for plugins are set (Ex; `NPM_TOKEN` with the NPM plugin)
47 |
48 | ### Problems pushing tags to github
49 |
50 | Go to Settings -> Checkout SSH Keys -> `Create and add YOUR_USERNAME user key`. This will create a key with the ability to push to github.
51 |
52 | ## Examples
53 |
54 | - [`auto`](https://github.com/intuit/auto/blob/main/.circleci/config.yml)
55 | - [`reaction`](https://github.com/artsy/reaction/blob/master/.circleci/config.yml)
56 |
--------------------------------------------------------------------------------
/docs/pages/docs/build-platforms/travis.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Travis CI
3 | ---
4 |
5 | The following config declares the `deploy` job that run on all branches. The job will either release:
6 |
7 | - a new `latest` version from `baseBranch`
8 | - a `canary` build from a pull request (if your package manager plugin implements them)
9 |
10 | **`.travis.yml`**
11 |
12 | ```yaml
13 | language: node_js
14 | node_js: "10"
15 |
16 | git:
17 | depth: false
18 |
19 | script:
20 | - yarn lint
21 | - yarn test
22 | - yarn build
23 |
24 | deploy:
25 | - provider: script
26 | script: if [ "$GH_TOKEN" != "false" ];then npx auto shipit; fi;
27 | skip-cleanup: true
28 | on:
29 | all_branches: true
30 | ```
31 |
32 | ## Troubleshooting
33 |
34 | If you are having problems make sure you have done the following:
35 |
36 | - `GH_TOKEN` is set
37 | - Any other secrets for plugins are set (Ex; `NPM_TOKEN` with the NPM plugin)
38 |
39 | ### Detached Head (Monorepo)
40 |
41 | Some plugins might use tools that require you to be on a branch.
42 | The default setup for travis leaves you in a "Detached Head" state, meaning the git HEAD pointer is not on a branch.
43 | To fix this add the following lines to your `.travis.yml`
44 |
45 | ```yaml
46 | before_deploy:
47 | - if [ "$TRAVIS_BRANCH" == "main" ];then
48 | git checkout main;
49 | fi;
50 | ```
51 |
52 | This code will ensure that your git HEAD is on `baseBranch` when creating a new release.
53 |
54 | ### Canary Deploy Failing on Forks
55 |
56 | By default Travis will not pass secrets to forks.
57 | Because of this canaries releases will fail.
58 | You can either:
59 |
60 | - Pass secrets to forks (insecure)
61 | - Only run shipit if secrets are available (recommended, in above config)
62 |
63 | ## Examples
64 |
65 | - [`relay-compiler-language-typescript`](https://github.com/relay-tools/relay-compiler-language-typescript/blob/master/.travis.yml)
66 |
--------------------------------------------------------------------------------
/docs/pages/docs/configuration/troubleshooting.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Troubleshooting
3 | ---
4 |
5 | ## Error: Can't find a GitHub token to use
6 |
7 | You must set a [`GH_TOKEN`](https://github.com/settings/tokens) for `auto` to work. If you publish to npm make sure to add your `NPM_TOKEN` while you're at it as well.
8 |
9 | ## Working directory not clean
10 |
11 | To version and publish you cannot have any changes in the git repo during publish. This means that if you build some files before release that aren't git-ignored `auto` will fail to continue. To fix this either add those `dist` files to your `.gitignore` or commit them somehow before the release.
12 |
13 | ## You cannot publish over the previously published versions
14 |
15 | If you've encountered any of these errors you'll probably run into this problem. If the whole release process doesn't complete you can end up in a state when `auto` published the new version, but doesn't push that back to github. To fix this just bump the version number to the "previously published version".
16 |
17 | ## How do I auto a fork of another repo?
18 |
19 | If auto doesn't find a last release it will default to the first commit for version calculation (and a log of other things). If you have forked a repo, you fork all the merge commit messages as well. This confuses `auto` since it will look for those pull requests in your fork and not the main one.
20 |
21 | To remedy this first tag your first commit in the fork with your first version. If the tags from the original repo are still in your repo you should just bump that version. This will let `auto` ignore all the old merge commits.
22 |
23 | > :warning: You must also match this new tag version in your package.json
24 |
25 | ```bash
26 | # Set head to last release and tag it with 2.10.1
27 | git tag v2.10.1
28 | ```
29 |
30 | Then on GitHub go to your project, click release, then draft a new release. Select the tag you just published and `publish release`. Now auto will be able to use the correct version and git log!
31 |
--------------------------------------------------------------------------------
/docs/pages/docs/extras/changelog.md:
--------------------------------------------------------------------------------
1 | > :warning: This should be run before you version your project so the `CHANGELOG.md` changes are committed before the release gets tagged.
2 |
3 | ## Changelog Titles
4 |
5 | You can customize the changelog titles and even add custom ones. To see configuration [go here](../configuration/autorc#changelog-titles).
6 |
7 | ## Additional Release notes
8 |
9 | Sometimes a PR title is just not enough to capture what a user should know about that PR. That's why we've included the ability to put extra release notes right in your PRs. All you have to do is add a `Release Notes` section in your PR.
10 |
11 | Take the following PR body:
12 |
13 | ```md
14 | # What Changed
15 |
16 | Change `shipit` behavior.
17 |
18 | ## Release Notes
19 |
20 | `auto shipit` will only ship to `latest` on the base branch ([which is configurable]()). If ran locally or from a PR it will create a `canary` release that doesn't interfere with your `latest` release.
21 | ```
22 |
23 | This will create a special section at the top of the changelog that collects all the additional release notes from merged PRs. Below is a sample of what it might look like.
24 |
25 | ---
26 |
27 | # v5.0.0 (Sat May 04 2019)
28 |
29 | ### Release Notes
30 |
31 | _From #371_
32 |
33 | `auto shipit` will only ship to `latest` on the base branch ([which is configurable]()). If ran locally or from a PR it will create a `canary` release that doesn't interfere with your `latest` release.
34 |
35 | ---
36 |
37 | #### 💥 Breaking Change
38 |
39 | - shipit will publish a canary locally when not on `baseBranch` [#371](https://github.com/intuit/auto/pull/371) ([@hipstersmoothie](https://github.com/hipstersmoothie))
40 |
41 | #### Authors: 1
42 |
43 | - Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
44 |
--------------------------------------------------------------------------------
/docs/pages/docs/extras/create-labels.md:
--------------------------------------------------------------------------------
1 | > :warning: For this to work you must have a \`GH_TOKEN\` set, ex: \`GH_TOKEN=YOUR_TOKEN auto create-labels\`
2 |
--------------------------------------------------------------------------------
/docs/pages/docs/extras/label.md:
--------------------------------------------------------------------------------
1 | ## Using in scripts
2 |
3 | The following will only run the test:visual script when the PR has has the
4 | Visual label.
5 |
6 | ```bash
7 | export PATH=$(npm bin):$PATH
8 |
9 | if auto label --pr $PR_NUMBER --exists Visual;
10 | then
11 | npm run test:visual
12 | fi
13 | ```
14 |
15 | ## Without PR Number
16 |
17 | Running `auto label` without the PR number will:
18 |
19 | - When run in `baseBranch` will get the labels for the last merged PR
20 | - When run for a PR in CI will use the PR's number
21 |
--------------------------------------------------------------------------------
/docs/pages/docs/extras/next.md:
--------------------------------------------------------------------------------
1 | ### Setting up Protected Branches
2 |
3 | You should make your pre-release branches protected on GitHub. This will prevent a bunch of unwanted behavior from happening.
4 |
5 | 1. Go to you project's setting on [GitHub](https://github.com)
6 | 2. Click `Branches`
7 | 3. Click `Add Rule`
8 | 4. Enter the name of your prerelease branch (ex: `next`)
9 | 5. Configure extra branch protection settings
10 | 6. (Optional) Set the base branch in GitHub to your prerelease branch (this ensure new PRs go to this branch)
11 |
--------------------------------------------------------------------------------
/docs/pages/docs/extras/release.md:
--------------------------------------------------------------------------------
1 | > :warning: Make sure you give the `GH_TOKEN` `repo` permission or `release` will fail!
2 |
3 | ## Usage
4 |
5 | ```json
6 | {
7 | "scripts": {
8 | "postpublish": "auto release"
9 | }
10 | }
11 | ```
12 |
13 | Make sure the branch/tag you're releasing is on github before running `auto release`.
14 | You will need to push the tags to github first:
15 |
16 | ```json
17 | {
18 | "scripts": {
19 | "postpublish": "git push --follow-tags --set-upstream origin $branch && auto release"
20 | }
21 | }
22 | ```
23 |
24 | ## Github Release Details
25 |
26 | The details / description published with the Github release will be identical to those generated by the `auto changelog` command.
27 | See information regarding the release note format [here](./changelog#changelog-titles).
28 |
--------------------------------------------------------------------------------
/docs/pages/docs/extras/version.md:
--------------------------------------------------------------------------------
1 | Useful in conjunction with `npm version` to auto-version releases.
2 |
3 | ## Configure Versioning Labels
4 |
5 | You can customize the versioning labels in the `.autorc`. To see configuration [go here](../configuration/autorc#labels).
6 |
--------------------------------------------------------------------------------
/docs/pages/docs/index.mdx:
--------------------------------------------------------------------------------
1 | import { GetStarted } from "../../components/get-started-button";
2 |
3 |
4 |
5 |
10 |
11 |
12 |
13 |
14 | > Automated releases powered by pull request labels
15 |
16 | Streamline your release workflow and publish constantly!
17 | `auto` is meant to be run in a continuous integration (CI) environment, but all the commands work locally as well.
18 |
19 | The two main problems auto is trying to solve are: release automation and pull request interaction.
20 | With the set of tools we provide you can automate every part of contribution!
21 |
22 |
23 |
24 | **Release Features:**
25 |
26 | - Calculate semantic version bumps from PRs
27 | - Publish [canaries](./docs/generated/canary) (test versions) directly from PRs or locally
28 | - Generate changelogs with fancy headers, authors, and [detailed release notes](./docs/generated/changelog#additional-release-notes)
29 | - Make GitHub releases
30 |
31 | **Pull Request Interaction Features:**
32 |
33 | - Get the labels for a PR
34 | - Set the status of a PR
35 | - Comment on a PR with markdown
36 | - Update the PR body with contextual build metadata
37 |
38 | ## Workflow
39 |
40 | `auto`'s main use is to automate the release process for your project.
41 | This can be broken down into three core steps:
42 |
43 | ```text
44 | pre: (optional) Check if new version
45 |
46 | 1. Generate CHANGELOG.md
47 | 2. Publish code
48 | 3. Generate github release notes
49 | ```
50 |
51 | `auto` makes no assumptions about your publishing process.
52 | Each tool is a function that can be run in isolation and only does one thing really well.
53 | For instance, you could just use `auto changelog` to generate the changelog and nothing else or use `auto version` to calculate just the `semver` bump.
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/docs/pages/docs/plugins/hook-api-docs.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hook APIs
3 | ---
4 |
5 | Plugins work by "hooking" into various parts of `auto` to control or add to its behavior.
6 |
7 | The categories of hooks available to plugins are:
8 |
9 | - [Init](./init-hooks) - Add functionality to `auto init`
10 | - [Configuration](./configuration-hooks) - Detect, modify and validate `auto`'s configuration
11 | - [Log Parser](./log-parse-hooks) - Extend how `auto` analyzes commits
12 | - [Changelog](./changelog-hooks) - Change how `auto` renders changelogs
13 | - [Release Lifecycle](./release-lifecycle-hooks) - Called during various release commands, these facilitate publishing the package
14 |
15 | The hooks that are called depends on the command is run.
16 | Some hooks are specific to a single command, such as the "Init" hooks, and others are called for every command.
17 |
18 | Here is a map of all the hooks and when they are called (open in new tab for more detail):
19 |
20 | 
21 |
22 | ## Plugin Ideas
23 |
24 | Having a plug-able release process means you can automate so many things.
25 | Here are a few ideas of what you could do.
26 |
27 | - `size-changelog`: Every time a `latest` release is made update a `size-changelog.md` with the bundle size
28 | - Use the `afterRelease` hook to communicate changes to consumers (ex: twitter or slack)
29 |
30 | The documentation for each hook also lists examples of how the hook is used in various parts of `auto` and its plugins.
31 |
--------------------------------------------------------------------------------
/docs/pages/docs/welcome/quick-merge.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Merging Quickly
3 | ---
4 |
5 | One caveat of `auto` is that you need to be mindful of merging multiple PRs at once.
6 | You **must not** merge a PR while another is publishing (ex: during `lerna publish`).
7 | While this window is small, it exists and you should know about it.
8 |
9 | `auto` works by looking at the `git` tree to calculate the version bump then makes commits for the `CHANGELOG.md` and the new version.
10 | If you merge a PR while another is publishing:
11 |
12 | - they might try to publish the same version number
13 | - one will try to push over the other's changes and fail
14 |
15 | > If you ensure that the last build on `baseBrach` has finished you shouldn't run into any problems!
16 |
17 | ### Beware Long Publishes
18 |
19 | `auto` will do the following before trying to `publish` and push its commits:
20 |
21 | - Check for commits on the remote
22 | - Run the platform specific `publish` step
23 |
24 | If your `publish` step runs a lengthy build, then the window for conflicts is extended.
25 | The recommended approach is to build your code before running `auto` so the window for errors stays small.
26 | This may make sense on some platforms and not others.
27 |
28 | > Example: When using the `npm` plugin don't use the script `prepublishOnly` to build your code
29 |
30 | ## With `skip-release`
31 |
32 | The one exception to this rule with when merging a bunch of PRs with `skip-release` labels.
33 |
34 | You still can't merge a PR that triggers a release and then merge a PR with `skip-release`.
35 | This will result in problem 3 from above.
36 |
37 | ```txt
38 | 1. Merge PR #4 "patch"
39 | 2. Merge PR #5 "skip-release"
40 |
41 | Result: #4 tries to push commits over #5 and fails
42 | ```
43 |
44 | But you can merge a bunch of PRs with `skip-release` then merge a PR that triggers a release.
45 |
46 | ```txt
47 | 1. Merge PR #4 "skip-release"
48 | 2. Merge PR #5 "skip-release"
49 | 3. Merge PR #7 "patch"
50 |
51 | Result: 1 "patch" released w/all PRs
52 | ```
53 |
54 | Because `skip-release` is present no commits are made and the release is fine!
55 |
--------------------------------------------------------------------------------
/docs/pages/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "nav-bar"
3 | ---
4 |
5 | import Home from "../components/home";
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/public/add-label.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/add-label.png
--------------------------------------------------------------------------------
/docs/public/changelog-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/changelog-example.png
--------------------------------------------------------------------------------
/docs/public/complete-auto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/complete-auto.png
--------------------------------------------------------------------------------
/docs/public/dark-logo-large.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/dark-logo-large.png
--------------------------------------------------------------------------------
/docs/public/dark-logo-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/dark-logo-small.png
--------------------------------------------------------------------------------
/docs/public/default-auto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/default-auto.png
--------------------------------------------------------------------------------
/docs/public/favicon-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/favicon-dark.png
--------------------------------------------------------------------------------
/docs/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/favicon.png
--------------------------------------------------------------------------------
/docs/public/hook-overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/hook-overview.png
--------------------------------------------------------------------------------
/docs/public/jenkins-next-branches.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/jenkins-next-branches.png
--------------------------------------------------------------------------------
/docs/public/light-logo-large.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/light-logo-large.png
--------------------------------------------------------------------------------
/docs/public/light-logo-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/light-logo-small.png
--------------------------------------------------------------------------------
/docs/public/logo-dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/public/logo-large-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/logo-large-dark.png
--------------------------------------------------------------------------------
/docs/public/logo-large.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/logo-large.png
--------------------------------------------------------------------------------
/docs/public/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "auto Docs",
3 | "short_name": "auto",
4 | "theme_color": "#7A0041",
5 | "background_color": "#fff",
6 | "dark_background_color": "#11151d",
7 | "description": "The documentation for using auto.",
8 | "display": "standalone",
9 | "orientation": "portrait"
10 | }
11 |
--------------------------------------------------------------------------------
/docs/public/merge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/merge.png
--------------------------------------------------------------------------------
/docs/public/monochrome-logo-large.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/monochrome-logo-large.png
--------------------------------------------------------------------------------
/docs/public/monochrome-logo-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/monochrome-logo-small.png
--------------------------------------------------------------------------------
/docs/public/next-branch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/next-branch.png
--------------------------------------------------------------------------------
/docs/public/open-pr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/open-pr.png
--------------------------------------------------------------------------------
/docs/public/pr-to-pr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/pr-to-pr.png
--------------------------------------------------------------------------------
/docs/public/readme-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/readme-logo.png
--------------------------------------------------------------------------------
/docs/public/release-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/docs/public/release-example.png
--------------------------------------------------------------------------------
/formula-template.rb:
--------------------------------------------------------------------------------
1 | class Auto < Formula
2 | desc "Generate releases based on semantic version labels on pull requests."
3 | homepage "https://intuit.github.io/auto"
4 | url "https://github.com/intuit/auto/releases/download/$VERSION/auto-macos.gz"
5 | version "$VERSION"
6 | sha256 "$SHA"
7 |
8 | def install
9 | libexec.install Dir["*"]
10 | bin.install libexec/"auto-macos"
11 | mv bin/"auto-macos", bin/"auto"
12 | end
13 |
14 | test do
15 | system bin/"auto", "--version"
16 | end
17 | end
--------------------------------------------------------------------------------
/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "11.3.0",
3 | "npmClient": "yarn",
4 | "packages": [
5 | "packages/*",
6 | "plugins/*"
7 | ],
8 | "$schema": "node_modules/lerna/schemas/lerna-schema.json"
9 | }
10 |
--------------------------------------------------------------------------------
/packages/bot-list/README.md:
--------------------------------------------------------------------------------
1 | # @auto-it/bot-list
2 |
3 | A list of bots for `auto` and it's plugins to ignore.
4 |
--------------------------------------------------------------------------------
/packages/bot-list/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/bot-list",
3 | "main": "dist/index.js",
4 | "description": "A list of bots for auto plugins to ignore",
5 | "version": "11.3.0",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "engines": {
23 | "node": ">=10.x"
24 | },
25 | "keywords": [
26 | "automation",
27 | "semantic",
28 | "release",
29 | "github",
30 | "labels",
31 | "automated",
32 | "continuos integration",
33 | "changelog",
34 | "cli"
35 | ],
36 | "scripts": {
37 | "build": "tsc -b",
38 | "start": "npm run build -- -w",
39 | "lint": "eslint src --ext .ts",
40 | "test": "jest --maxWorkers=2"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/packages/bot-list/src/index.ts:
--------------------------------------------------------------------------------
1 | export default [
2 | "dependabot-preview[bot]",
3 | "greenkeeper[bot]",
4 | "dependabot[bot]",
5 | "fossabot",
6 | "mergify[bot]",
7 | "renovate",
8 | "renovate-bot",
9 | "renovate[bot]",
10 | "renovate-pro[bot]",
11 | "renovate-approve",
12 | "invalid-email-address",
13 | "snyk-bot",
14 | ];
15 |
--------------------------------------------------------------------------------
/packages/bot-list/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/cli/__tests__/__snapshots__/bundle.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`bundle should function 1`] = `
4 | "
5 | create-labels
6 |
7 | Create your project's labels on github. If labels exist it will update them.
8 |
9 | Options
10 |
11 | -d, --dry-run Report what command will do but do not actually do anything
12 |
13 | Global Options
14 |
15 | -V, --version Display auto's version
16 | -v, --verbose Show some more logs. Pass -vv for very verbose logs.
17 | --repo string The repo to set the status on. Defaults to looking in
18 | the package definition for the platform
19 | --owner string The owner of the GitHub repo. Defaults to reading from
20 | the package definition for the platform
21 | --github-api string GitHub API to use
22 | --plugins string[] Plugins to load auto with. (defaults to just npm)
23 | -h, --help Display the help output
24 |
25 | Examples
26 |
27 | $ auto create-labels
28 |
29 | "
30 | `;
31 |
--------------------------------------------------------------------------------
/packages/cli/__tests__/bundle.test.ts:
--------------------------------------------------------------------------------
1 | import path from "path";
2 | import { execSync } from "child_process";
3 |
4 | test("bundle should function", () => {
5 | const type =
6 | (process.platform === "win32" && "win.exe") ||
7 | (process.platform === "darwin" && "macos") ||
8 | "linux";
9 | const zip = path.join(__dirname, `../binary/auto-${type}`);
10 | const binary = path.join(__dirname, "../auto");
11 |
12 | execSync(`gunzip -c ${zip} > ${binary}`);
13 | execSync(`chmod +x ${binary}`);
14 |
15 | expect(
16 | // Using this command because it is unlikely to change very much
17 | execSync(`${binary} create-labels --help`, {
18 | encoding: "utf8",
19 | })
20 | ).toMatchSnapshot();
21 |
22 | execSync(`rm ${binary}`);
23 | });
24 |
--------------------------------------------------------------------------------
/packages/cli/__tests__/config.test.ts:
--------------------------------------------------------------------------------
1 | import { globalOptions } from "@auto-it/core/dist/types";
2 | import { camelCase } from "change-case";
3 | import { commands } from "../src/parse-args";
4 |
5 | test.each(commands.map((c) => [c.name, c] as const))(
6 | "%s has correct config options",
7 | (name, command) => {
8 | const configOptions = globalOptions.props[name]?.props || {};
9 |
10 | expect.assertions(command.options?.filter((o) => o.config).length ?? 0);
11 |
12 | Object.keys(configOptions).forEach((option) => {
13 | expect(command.options.some((o) => camelCase(o.name) === option)).toBe(
14 | true
15 | );
16 | });
17 | }
18 | );
19 |
--------------------------------------------------------------------------------
/packages/cli/__tests__/main.test.ts:
--------------------------------------------------------------------------------
1 | import { runCli, execute } from "../src/run";
2 |
3 | process.env.GH_TOKEN = "XXXX";
4 |
5 | jest.mock("@octokit/rest");
6 | jest.mock("../../core/src/utils/verify-auth");
7 |
8 | test("throws error for unknown args", async () => {
9 | process.exit = jest.fn() as any;
10 | console.log = jest.fn() as any;
11 |
12 | // @ts-ignore
13 | await execute("foo", { foo: 123 });
14 |
15 | expect(process.exit).toHaveBeenCalledWith(1);
16 | });
17 |
18 | test("throws exits for caught error", async () => {
19 | console.log = jest.fn() as any;
20 | process.exit = jest.fn() as any;
21 |
22 | await runCli("foo", {});
23 |
24 | expect(process.exit).toHaveBeenCalledWith(1);
25 | });
26 |
--------------------------------------------------------------------------------
/packages/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "auto",
3 | "bin": "dist/bin/auto.js",
4 | "main": "dist/bin/index.js",
5 | "types": "dist/index.d.ts",
6 | "description": "CLI tools to help facilitate semantic versioning based on GitHub PR labels",
7 | "version": "11.3.0",
8 | "license": "MIT",
9 | "author": {
10 | "name": "Andrew Lisowski",
11 | "email": "lisowski54@gmail.com"
12 | },
13 | "pkg": {
14 | "scripts": "../../plugins/**/dist/**/*.js"
15 | },
16 | "publishConfig": {
17 | "registry": "https://registry.npmjs.org/",
18 | "access": "public"
19 | },
20 | "repository": {
21 | "type": "git",
22 | "url": "https://github.com/intuit/auto"
23 | },
24 | "files": [
25 | "dist"
26 | ],
27 | "engines": {
28 | "node": ">=10.x"
29 | },
30 | "keywords": [
31 | "automation",
32 | "semantic",
33 | "release",
34 | "github",
35 | "labels",
36 | "automated",
37 | "continuos integration",
38 | "changelog",
39 | "cli"
40 | ],
41 | "scripts": {
42 | "build": "tsc -b",
43 | "start": "npm run build -- -w",
44 | "lint": "eslint src --ext .ts",
45 | "test": "jest --maxWorkers=2",
46 | "bundle": "yarn inject-version && yarn package && yarn gzip",
47 | "inject-version": "node scripts/inject-version.js",
48 | "package": "rimraf binary && pkg . --out-path binary",
49 | "gzip": "ls binary/auto* | xargs gzip"
50 | },
51 | "dependencies": {
52 | "@auto-it/core": "link:../core",
53 | "@auto-it/npm": "link:../../plugins/npm",
54 | "@auto-it/released": "link:../../plugins/released",
55 | "@auto-it/version-file": "link:../../plugins/version-file",
56 | "await-to-js": "^3.0.0",
57 | "chalk": "^4.0.0",
58 | "command-line-application": "^0.10.1",
59 | "endent": "^2.1.0",
60 | "module-alias": "^2.2.2",
61 | "signale": "^1.4.0",
62 | "terminal-link": "^2.1.1",
63 | "tslib": "2.1.0"
64 | },
65 | "devDependencies": {
66 | "@types/signale": "^1.2.1",
67 | "pkg": "^5.8.0"
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/packages/cli/scripts/inject-version.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable import/no-extraneous-dependencies */
2 | /* eslint-disable @typescript-eslint/no-var-requires */
3 |
4 | const { execSync } = require("child_process");
5 | const path = require("path");
6 | const fs = require("fs");
7 | const dotenv = require("dotenv");
8 |
9 | dotenv.config({ path: path.join(__dirname, "../../../.env") });
10 |
11 | const autoPath = path.join(__dirname, "../dist/bin/auto.js");
12 |
13 | execSync(`chmod +x ${autoPath}`);
14 | const nextVersion = execSync(`${autoPath} shipit -dq`, {
15 | encoding: "utf-8",
16 | }).trim();
17 | const parseArgsPath = path.join(__dirname, "../dist/parse-args.js");
18 | const parseArgsContent = fs.readFileSync(parseArgsPath, { encoding: "utf-8" });
19 |
20 | fs.writeFileSync(
21 | parseArgsPath,
22 | parseArgsContent.replace(/process\.env\.AUTO_CLI_VERSION/, `"${nextVersion}"`)
23 | );
24 |
--------------------------------------------------------------------------------
/packages/cli/src/bin/auto.ts:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | import moduleAlias from "module-alias";
4 | import path from "path";
5 |
6 | try {
7 | // eslint-disable-next-line
8 | const json = require(path.join(__dirname, "../../package.json"));
9 |
10 | if (json.name.startsWith("@auto-canary")) {
11 | moduleAlias.addAliases({
12 | /** We want to rewrite all the imports for canary (ex: npm plugin requiring core) */
13 | "@auto-it": (fromPath: string, request: string) =>
14 | request.startsWith("@auto-it") &&
15 | // but we also want to be able to require official plugins from a canary
16 | !fromPath.endsWith("noop.js") &&
17 | // and don't want to override those plugins's imports
18 | !fromPath.includes("@auto-it")
19 | ? "@auto-canary"
20 | : "@auto-it",
21 | });
22 | }
23 | } catch (error) {}
24 |
25 | import chalk from "chalk";
26 | import parseArgs from "../parse-args";
27 | import { runCli } from "../run";
28 |
29 | const [command, args] = parseArgs();
30 |
31 | if (command && args) {
32 | runCli(command, args).catch((e: Error) => {
33 | console.error(chalk.redBright("Error: "), e.message);
34 | process.exit(1);
35 | });
36 | }
37 |
--------------------------------------------------------------------------------
/packages/cli/src/index.ts:
--------------------------------------------------------------------------------
1 | export { AutoRc } from "@auto-it/core";
2 | export * from "./parse-args";
3 | export { execute } from "./run";
4 |
--------------------------------------------------------------------------------
/packages/cli/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../core"
14 | },
15 | {
16 | "path": "../../plugins/npm"
17 | },
18 | {
19 | "path": "../../plugins/released"
20 | },
21 | {
22 | "path": "../../plugins/version-file"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/packages/core/README.md:
--------------------------------------------------------------------------------
1 | # @auto-it/core
2 |
3 | The node API for using auto.
4 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/__snapshots__/match-sha-to-pr.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`buildSearchQuery generates a valid query 1`] = `
4 | "{
5 | hash_abc123: search(query: \\"repo:Andrew/test abc123\\", type: ISSUE, first: 10) {
6 | edges {
7 | node {
8 | ... on PullRequest {
9 | number
10 | state
11 | body
12 | headRefName
13 | headRepositoryOwner {
14 | login
15 | }
16 | labels(first: 10) {
17 | edges {
18 | node {
19 | name
20 | }
21 | }
22 | }
23 | }
24 | }
25 | }
26 | }
27 |
28 | hash_3def78: search(query: \\"repo:Andrew/test 3def78\\", type: ISSUE, first: 10) {
29 | edges {
30 | node {
31 | ... on PullRequest {
32 | number
33 | state
34 | body
35 | headRefName
36 | headRepositoryOwner {
37 | login
38 | }
39 | labels(first: 10) {
40 | edges {
41 | node {
42 | name
43 | }
44 | }
45 | }
46 | }
47 | }
48 | }
49 | }
50 | rateLimit {
51 | limit
52 | cost
53 | remaining
54 | resetAt
55 | }
56 | }"
57 | `;
58 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/auto-ci-base-branch.test.ts:
--------------------------------------------------------------------------------
1 | import envCi from "env-ci";
2 | import { dummyLog } from "../utils/logger";
3 |
4 | jest.mock("env-ci");
5 |
6 | const envSpy = envCi as jest.Mock;
7 | envSpy.mockImplementation(() => ({
8 | isCi: true,
9 | branch: "main",
10 | }));
11 |
12 | import { Auto } from "../auto";
13 |
14 | const defaults = {
15 | baseBranch: "main",
16 | owner: "foo",
17 | repo: "bar",
18 | };
19 |
20 | jest.mock("@octokit/rest", () => {
21 | const Octokit = class MockOctokit {
22 | static plugin = () => Octokit;
23 |
24 | authenticate = () => undefined;
25 |
26 | search = {
27 | issuesAndPullRequests: () => ({ data: { items: [] } }),
28 | };
29 |
30 | repos = {
31 | get: jest.fn().mockReturnValue({}),
32 | };
33 |
34 | hook = {
35 | error: () => undefined,
36 | };
37 | };
38 |
39 | return { Octokit };
40 | });
41 |
42 | describe("Auto", () => {
43 | describe("pr-check", () => {
44 | jest.setTimeout(10 * 1000);
45 | let createStatus: jest.Mock;
46 |
47 | beforeEach(() => {
48 | createStatus = jest.fn();
49 | });
50 |
51 | const required = {
52 | url: "https://google.com",
53 | };
54 |
55 | test("should exit successfully if ran from main + CI", async () => {
56 | const auto = new Auto(defaults);
57 | const exit = jest.fn();
58 |
59 | envSpy.mockImplementationOnce(() => ({
60 | isCi: true,
61 | branch: "main",
62 | }));
63 |
64 | // @ts-ignore
65 | process.exit = exit;
66 | auto.logger = dummyLog();
67 | await auto.loadConfig();
68 | auto.git!.createStatus = createStatus;
69 |
70 | await auto.prCheck({ ...required });
71 | expect(exit).toHaveBeenCalledWith(0);
72 | });
73 | });
74 | });
75 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/auto-comment.test.ts:
--------------------------------------------------------------------------------
1 | import { Auto } from "../auto";
2 | import { dummyLog } from "../utils/logger";
3 |
4 | jest.mock("env-ci", () => () => ({ pr: 123 }));
5 |
6 | const defaults = {
7 | owner: "foo",
8 | repo: "bar",
9 | };
10 |
11 | process.env.GH_TOKEN = "XXXX";
12 |
13 | jest.mock("@octokit/rest", () => {
14 | const Octokit = class MockOctokit {
15 | static plugin = () => Octokit;
16 |
17 | authenticate = () => undefined;
18 |
19 | repos = {
20 | get: jest.fn().mockReturnValue({}),
21 | };
22 |
23 | hook = {
24 | error: () => undefined,
25 | };
26 | };
27 |
28 | return { Octokit };
29 | });
30 |
31 | describe("comment", () => {
32 | test("should find PR number from CI", async () => {
33 | const auto = new Auto(defaults);
34 | auto.logger = dummyLog();
35 | await auto.loadConfig();
36 |
37 | const createComment = jest.fn();
38 | auto.git!.createComment = createComment;
39 |
40 | await auto.comment({ message: "foo" });
41 | expect(createComment).toHaveBeenCalled();
42 | });
43 | });
44 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/auto-env.test.ts:
--------------------------------------------------------------------------------
1 | import { Auto } from "../auto";
2 |
3 | jest.mock("fs", () => ({
4 | read: () => undefined,
5 | readFileSync: () => 'FOO="test value"',
6 | closeSync: () => undefined,
7 | existsSync: () => true,
8 | readFile: () => undefined,
9 | ReadStream: function () {},
10 | WriteStream: function () {},
11 | writeFile: () => undefined,
12 | }));
13 |
14 | test("should load .env file and override and env vars that are already set", async () => {
15 | process.env.FOO = "old value";
16 |
17 | const auto = new Auto({
18 | owner: "foo",
19 | repo: "bar",
20 | });
21 |
22 | expect(auto).toBeDefined();
23 | expect(process.env.FOO).toBe("test value");
24 | });
25 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/auto-git-user-in-ci.test.ts:
--------------------------------------------------------------------------------
1 | import { Auto } from "../auto";
2 | import execPromise from "../utils/exec-promise";
3 |
4 | const exec = jest.fn();
5 | jest.mock("../utils/exec-promise");
6 | // @ts-ignore
7 | execPromise.mockImplementation(exec);
8 | exec.mockImplementation(() => {
9 | throw new Error();
10 | });
11 |
12 | jest.mock("env-ci", () => () => ({
13 | isCi: true,
14 | }));
15 |
16 | const defaults = {
17 | owner: "foo",
18 | repo: "bar",
19 | };
20 |
21 | test("parses string author in config", async () => {
22 | const auto = new Auto({ ...defaults, plugins: [] });
23 |
24 | // @ts-ignore
25 | auto.config = { author: "Andrew " };
26 |
27 | // @ts-ignore
28 | expect(await auto.getGitUser()).toStrictEqual({
29 | name: "Andrew",
30 | email: "andrew@mail.com",
31 | });
32 | });
33 |
34 | test("parses object author in config", async () => {
35 | const auto = new Auto({ ...defaults, plugins: [] });
36 | const author = {
37 | name: "Andrew",
38 | email: "andrew@mail.com",
39 | };
40 |
41 | // @ts-ignore
42 | auto.config = { author };
43 |
44 | // @ts-ignore
45 | expect(await auto.getGitUser()).toStrictEqual(author);
46 | });
47 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/determine-next-version.test.ts:
--------------------------------------------------------------------------------
1 | import { determineNextVersion } from "../auto";
2 | import SEMVER from "../semver";
3 |
4 | describe("determineNextVersion", () => {
5 | test("should make a incremented canary version", () => {
6 | expect(
7 | determineNextVersion("v3.0.0", "v3.2.0", SEMVER.patch, "canary.5b2e7d3")
8 | ).toBe("3.2.1-canary.5b2e7d3.0");
9 | });
10 |
11 | test("should make a incremented canary version without any previous release", () => {
12 | expect(
13 | determineNextVersion(
14 | "7dd0b07625203f69cd55d779d873f1adcffaa84a",
15 | "v3.2.0",
16 | SEMVER.patch,
17 | "canary.5b2e7d3"
18 | )
19 | ).toBe("3.2.1-canary.5b2e7d3.0");
20 | });
21 |
22 | test("should make a incremented canary version of latest", () => {
23 | expect(
24 | determineNextVersion("v4.0.0", "v3.2.0", SEMVER.patch, "canary.5b2e7d3")
25 | ).toBe("4.0.1-canary.5b2e7d3.0");
26 | });
27 |
28 | test("should make a incremented next version", () => {
29 | expect(determineNextVersion("1.0.0", "2.0.0-next.0", SEMVER.patch)).toBe(
30 | "2.0.0-next.1"
31 | );
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/get-current-branch.test.ts:
--------------------------------------------------------------------------------
1 | import { execSync } from "child_process";
2 | import { CiEnv } from "env-ci";
3 | import { getCurrentBranch } from "../auto";
4 |
5 | jest.mock('child_process')
6 |
7 | describe('getCurrentBranch', () => {
8 |
9 | beforeEach(() => {
10 | jest.clearAllMocks()
11 | })
12 |
13 | describe('when isPr', () => {
14 | it('returns pr branch from env ci when valid', () => {
15 | const env: Partial = {
16 | isPr: true,
17 | prBranch: 'my-pr-branch'
18 | }
19 | expect(getCurrentBranch(env)).toBe('my-pr-branch')
20 | });
21 |
22 | it('tries git command when PR is invalid', () => {
23 | const env: Partial = {
24 | isPr: true,
25 | prBranch: 'undefined'
26 | }
27 |
28 | getCurrentBranch(env);
29 |
30 | expect(execSync).toHaveBeenCalledWith("git symbolic-ref --short HEAD", {
31 | encoding: "utf8",
32 | stdio: "ignore",
33 | })
34 | });
35 | })
36 |
37 | describe('when not isPr', () => {
38 |
39 | it('returns pr branch from env ci when valid', () => {
40 | const env: Partial = {
41 | isPr: false,
42 | prBranch: 'my-pr-branch',
43 | branch: 'my-release-branch'
44 | }
45 |
46 | expect(getCurrentBranch(env)).toBe('my-release-branch');
47 |
48 | expect(execSync).not.toHaveBeenCalled()
49 | });
50 |
51 | it('tries git command when branch name is invalid', () => {
52 | const env: Partial = {
53 | isPr: false,
54 | prBranch: 'my-pr-branch',
55 | branch: undefined
56 | }
57 | getCurrentBranch(env);
58 |
59 | expect(execSync).toHaveBeenCalledWith("git symbolic-ref --short HEAD", {
60 | encoding: "utf8",
61 | stdio: "ignore",
62 | })
63 | });
64 | })
65 | })
--------------------------------------------------------------------------------
/packages/core/src/__tests__/github-responses/bad-credentials.json:
--------------------------------------------------------------------------------
1 | {
2 | "message": "Bad credentials",
3 | "documentation_url": "https://developer.github.com/enterprise/2.12/v3"
4 | }
5 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/github-responses/pr-labels.json:
--------------------------------------------------------------------------------
1 | {
2 | "data": [
3 | {
4 | "id": 683464,
5 | "url": "https://github.custom.com/api/v3/repos/adam/test/labels/foo",
6 | "name": "foo",
7 | "color": "fbca04",
8 | "default": false
9 | },
10 | {
11 | "id": 780541,
12 | "url": "https://github.custom.com/api/v3/repos/adam/test/labels/bar",
13 | "name": "bar",
14 | "color": "cc9cfc",
15 | "default": false
16 | }
17 | ],
18 | "status": 200,
19 | "headers": {},
20 | "meta": {}
21 | }
22 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/log-parse.test.ts:
--------------------------------------------------------------------------------
1 | import LogParse, { parsePR, parseSquashPR } from "../log-parse";
2 |
3 | import makeCommitFromMsg from "./make-commit-from-msg";
4 |
5 | describe("parsePR", () => {
6 | test("should do nothing without merge commit", () => {
7 | const commit = makeCommitFromMsg("Not a merge");
8 | expect(parsePR(commit)).toStrictEqual(commit);
9 | });
10 |
11 | test("should parse number base and comment", () => {
12 | const commit = makeCommitFromMsg(
13 | "Merge pull request #1234 from Another PR\nComments about the PR"
14 | );
15 |
16 | expect(parsePR(commit)).toStrictEqual({
17 | ...commit,
18 | pullRequest: {
19 | number: 1234,
20 | base: "Another PR",
21 | },
22 | subject: "Comments about the PR",
23 | });
24 | });
25 | });
26 |
27 | describe("parseSquashPR", () => {
28 | test("should do nothing squash merge commit", () => {
29 | const commit = makeCommitFromMsg("Not a squash");
30 | expect(parseSquashPR(commit)).toStrictEqual(commit);
31 | });
32 |
33 | test("should parse PR number and comment", () => {
34 | const commit = makeCommitFromMsg("Some Message (#1234)");
35 | expect(parseSquashPR(commit)).toStrictEqual({
36 | ...commit,
37 | pullRequest: {
38 | number: 1234,
39 | },
40 | subject: "Some Message",
41 | });
42 | });
43 | });
44 |
45 | describe("normalizeCommits", () => {
46 | test("should do nothing with normal commits", async () => {
47 | const logParse = new LogParse();
48 | const commits = [
49 | makeCommitFromMsg("First"),
50 | makeCommitFromMsg("Second"),
51 | makeCommitFromMsg("Third"),
52 | ];
53 |
54 | expect(await logParse.normalizeCommits(commits)).toMatchSnapshot();
55 | });
56 |
57 | test("should strip whitespace in subject", async () => {
58 | const logParse = new LogParse();
59 | const commits = [
60 | makeCommitFromMsg("First PR"),
61 | makeCommitFromMsg("Second\t PR"),
62 | ];
63 |
64 | expect(await logParse.normalizeCommits(commits)).toMatchSnapshot();
65 | });
66 | });
67 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/make-commit-from-msg.ts:
--------------------------------------------------------------------------------
1 | import { IExtendedCommit } from "../log-parse";
2 |
3 | /** Construct a dummy commit for testing. */
4 | const makeCommitFromMsg = (
5 | subject: string,
6 | options: {
7 | /** Name of the committer */
8 | name?: string;
9 | /** Hash of the commit */
10 | hash?: string;
11 | /** Email of the committer */
12 | email?: string;
13 | /** Labels on the commit */
14 | labels?: string[];
15 | /** Username of the committer */
16 | username?: string;
17 | /** Packages effected by the commit */
18 | packages?: string[];
19 | /** The type of user */
20 | type?: "Bot" | "User";
21 | /** PR info for the commit */
22 | pullRequest?: {
23 | /** PR number attached to commit */
24 | number: number;
25 | };
26 | /** Files included in commit */
27 | files?: string[];
28 | } = {}
29 | ): IExtendedCommit => ({
30 | hash: options.hash || "foo",
31 | labels: options.labels || [],
32 | authorName:
33 | options.name !== undefined && options.name !== null
34 | ? options.name
35 | : "Adam Dierkens",
36 | authorEmail: options.email || "adam@dierkens.com",
37 | files: options.files || [],
38 | authors: [
39 | {
40 | type: options.type,
41 | name:
42 | options.name !== undefined && options.name !== null
43 | ? options.name
44 | : "Adam Dierkens",
45 | email: options.email || "adam@dierkens.com",
46 | ...(options.username ? { username: options.username } : {}),
47 | },
48 | ],
49 | subject,
50 | pullRequest: options.pullRequest,
51 | });
52 |
53 | export default makeCommitFromMsg;
54 |
--------------------------------------------------------------------------------
/packages/core/src/__tests__/match-sha-to-pr.test.ts:
--------------------------------------------------------------------------------
1 | import { parse } from "graphql";
2 |
3 | import { buildSearchQuery } from "../match-sha-to-pr";
4 |
5 | describe("buildSearchQuery", () => {
6 | test("generates a valid query", () => {
7 | const query = buildSearchQuery("Andrew", "test", ["abc123", "3def78"]);
8 | expect(() => parse(query!)).not.toThrow();
9 | expect(query).toMatchSnapshot();
10 | });
11 |
12 | test("doesn't generate a query without commits", () => {
13 | const query = buildSearchQuery("Andrew", "test", []);
14 | expect(query).toBeUndefined();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/packages/core/src/plugins/filter-non-pull-request.ts:
--------------------------------------------------------------------------------
1 | import on from "await-to-js";
2 |
3 | import { Auto, IPlugin } from "../auto";
4 |
5 | /** Filter out PR numbers that might generate errors. */
6 | export default class FilterNonPullRequestPlugin implements IPlugin {
7 | /** The name of the plugin */
8 | name = "Filter Non Pull Request";
9 |
10 | /** Tap into auto plugin points. */
11 | apply(auto: Auto) {
12 | auto.hooks.onCreateLogParse.tap(this.name, (logParse) => {
13 | logParse.hooks.omitCommit.tapPromise(this.name, async (commit) => {
14 | if (commit.pullRequest?.number) {
15 | const { number: prNumber } = commit.pullRequest;
16 | const [err, info] = await on(auto.git!.getPr(prNumber));
17 |
18 | // Omit PRs that don't exist on the repo
19 | if (err?.message.includes("Not Found")) {
20 | return true;
21 | }
22 |
23 | if (err) {
24 | throw err;
25 | }
26 |
27 | if (!info) {
28 | throw new Error(`Could not find PR: ${prNumber}`);
29 | }
30 |
31 | // Omit issues
32 | if (!info.data.pull_request) {
33 | return true;
34 | }
35 | }
36 | });
37 | });
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/__snapshots__/load-plugin.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`listPlugins should get plugins from autorc 1`] = `
4 | Array [
5 | "Found the following plugins in your .autorc:
6 |
7 | - npm (@auto-it/npm)",
8 | ]
9 | `;
10 |
11 | exports[`listPlugins should get plugins from local module 1`] = `
12 | Array [
13 | "Found the following plugins in your .autorc:
14 |
15 | - npm (@auto-it/npm)",
16 | ]
17 | `;
18 |
19 | exports[`listPlugins should get plugins from local module 2`] = `
20 | Array [
21 | "Found the following plugins installed in your project:
22 |
23 | - npm (../some/folder/node_modules/@auto-it/npm)
24 | - released (../some/folder/node_modules/@auto-it/released)",
25 | ]
26 | `;
27 |
28 | exports[`listPlugins should get plugins from local module 3`] = `
29 | Array [
30 | "Found the following plugins globally installed in your environment:
31 |
32 | - npm (/some/folder/node_modules/@auto-it/npm)
33 | - released (/some/folder/node_modules/@auto-it/released)",
34 | ]
35 | `;
36 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/exec-promise.test.ts:
--------------------------------------------------------------------------------
1 | import exec from "../exec-promise";
2 |
3 | const warn = jest.fn();
4 | const error = jest.fn();
5 |
6 | jest.mock("../logger.ts", () => () => ({
7 | // @ts-ignore
8 | log: { warn: (...args) => warn(...args) },
9 | // @ts-ignore
10 | verbose: { error: (...args) => error(...args) },
11 | }));
12 |
13 | beforeEach(() => {
14 | jest.clearAllMocks();
15 | });
16 |
17 | test("resolves stdout", async () => {
18 | expect(await exec("echo", ["foo"])).toBe("foo");
19 | });
20 |
21 | test("filters out anything but strings", async () => {
22 | expect(await exec("echo", ["foo", false, undefined, "baz"])).toBe("foo baz");
23 | });
24 |
25 | test("fails correctly", async () => {
26 | expect.assertions(1);
27 | return expect(exec("false")).rejects.toMatchInlineSnapshot(
28 | `[Error: Running command 'false' with args [] failed]`
29 | );
30 | });
31 |
32 | test("fails correctly with GH_TOKEN", async () => {
33 | process.env.GH_TOKEN = "1234567890";
34 | expect.assertions(1);
35 | return expect(
36 | exec("false", [process.env.GH_TOKEN])
37 | ).rejects.toMatchInlineSnapshot(
38 | `[Error: Running command 'false' with args [****7890] failed]`
39 | );
40 | });
41 |
42 | test("appends stdout and stderr", async () => {
43 | expect.assertions(1);
44 | return expect(
45 | exec("echo", ["foo", "&&", ">&2", "echo", '"this error"', "&&", "false"])
46 | ).rejects.toMatchInlineSnapshot(`
47 | [Error: Running command 'echo' with args [foo, &&, >&2, echo, "this error", &&, false] failed
48 |
49 | foo
50 |
51 |
52 | this error
53 | ]
54 | `);
55 | });
56 |
57 | test("prints stderr when exec exits without a code", async () => {
58 | jest.spyOn(console, "log").mockImplementation();
59 | await exec('>&2 echo "this error"');
60 |
61 | return expect(warn).toHaveBeenCalledWith("this error\n");
62 | });
63 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/get-lerna-packages.test.ts:
--------------------------------------------------------------------------------
1 | import endent from "endent";
2 | import execPromise from "../exec-promise";
3 | import getLernaPackages from "../get-lerna-packages";
4 |
5 | const exec = jest.fn();
6 | jest.mock("../exec-promise");
7 | // @ts-ignore
8 | execPromise.mockImplementation(exec);
9 |
10 | test("it shouldn't included version-less packages", async () => {
11 | exec.mockReturnValue(endent`
12 | /dir/a:a:0.3.0--canary.32.d54a0c4.0
13 | /dir/b:b:MISSING:PRIVATE
14 | `);
15 | expect(await getLernaPackages()).toStrictEqual([
16 | {
17 | name: "a",
18 | path: "/dir/a",
19 | version: "0.3.0--canary.32.d54a0c4.0",
20 | },
21 | ]);
22 | });
23 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/get-repository.test.ts:
--------------------------------------------------------------------------------
1 | import execPromise from "../exec-promise";
2 | import getRepository from "../get-repository";
3 |
4 | const execSpy = execPromise as jest.Mock;
5 | // @ts-ignore
6 | jest.mock("../exec-promise.ts");
7 |
8 | describe("getRepository", () => {
9 | test("should do nothing without a configured remote", async () => {
10 | execSpy.mockReturnValueOnce(Promise.resolve(""));
11 | expect(await getRepository()).toBeUndefined();
12 | });
13 |
14 | test("should do nothing if parsing origin fails", async () => {
15 | execSpy.mockReturnValueOnce(Promise.resolve("foo"));
16 | expect(await getRepository()).toBeUndefined();
17 | });
18 |
19 | test("should return owner/repo if possible", async () => {
20 | execSpy.mockReturnValueOnce(Promise.resolve("foo/bar"));
21 | expect(await getRepository()).toStrictEqual({
22 | owner: "foo",
23 | repo: "bar",
24 | });
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/load-plugin-canary.test.ts:
--------------------------------------------------------------------------------
1 | import { loadPlugin } from "../load-plugins";
2 | import { dummyLog } from "../logger";
3 |
4 | const logger = dummyLog();
5 |
6 | jest.mock(
7 | "@auto-canary/baz",
8 | () => ({
9 | default: class {
10 | name = "baz";
11 | },
12 | }),
13 | {
14 | virtual: true,
15 | }
16 | );
17 |
18 | describe("loadPlugins", () => {
19 | test("should load canary plugins", () => {
20 | expect(loadPlugin(["baz", {}], logger)?.name).toBe("baz");
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/load-plugin-windows.test.ts:
--------------------------------------------------------------------------------
1 | import { loadPlugin } from "../load-plugins";
2 | import { dummyLog } from "../logger";
3 |
4 | const logger = dummyLog();
5 |
6 | jest.mock(
7 | "C:\\plugins\\filter-non-pull-request.js",
8 | () => ({
9 | default: class {
10 | name = "foo";
11 | },
12 | }),
13 | {
14 | virtual: true,
15 | }
16 | );
17 |
18 | describe("loadPlugins", () => {
19 | test("should load official plugins", () => {
20 | expect(
21 | loadPlugin(["C:\\plugins\\filter-non-pull-request.js", {}], logger)?.name
22 | ).toBe("foo");
23 | });
24 | });
25 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/test-plugin-malformed.js:
--------------------------------------------------------------------------------
1 | module.expss Test {
2 | /** The name of the plugin */
3 | name = 'foo';
4 |
5 | /** The options of the plugin */
6 | config: {};
7 |
8 | /** Initialize the plugin with it's options */
9 | constructor(config: {}) {
10 | this.config = config;
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/test-plugin.ts:
--------------------------------------------------------------------------------
1 | interface TestOptions {
2 | /** Test property */
3 | foo: string;
4 | }
5 |
6 | module.exports = class Test {
7 | /** The name of the plugin */
8 | name = "foo";
9 |
10 | /** The options of the plugin */
11 | config: TestOptions;
12 |
13 | /** Initialize the plugin with it's options */
14 | constructor(config: TestOptions) {
15 | this.config = config;
16 | }
17 | };
18 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/test.js:
--------------------------------------------------------------------------------
1 | module.exports = "success";
2 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/try-require.test.ts:
--------------------------------------------------------------------------------
1 | import path from "path";
2 | import tryRequire from "../try-require";
3 |
4 | jest.mock("test", () => "success", {
5 | virtual: true,
6 | });
7 |
8 | jest.mock("npm", () => "success", {
9 | virtual: true,
10 | });
11 |
12 | describe("try require", () => {
13 | test("should fall back to normal require", async () => {
14 | expect(tryRequire("test")).toBe("success");
15 | });
16 |
17 | test("should not fall back to normal require for npm", async () => {
18 | expect(tryRequire("npm")).not.toBe("success");
19 | });
20 |
21 | test("should return nothing if not found", async () => {
22 | expect(tryRequire("foobar")).toBeUndefined();
23 | });
24 |
25 | test("should require from a directory", async () => {
26 | expect(
27 | tryRequire("./__tests__/test", path.resolve(path.join(__dirname, "..")))
28 | ).toBe("success");
29 | });
30 | });
31 |
--------------------------------------------------------------------------------
/packages/core/src/utils/__tests__/verify-auth.test.ts:
--------------------------------------------------------------------------------
1 | import verifyAuth from "../verify-auth";
2 | import childProcess from "child_process";
3 |
4 | const spawn = childProcess.spawn as jest.Mock;
5 | jest.mock("child_process");
6 |
7 | describe("verify-auth", () => {
8 | test("should handle error", async () => {
9 | spawn.mockImplementationOnce(() => ({
10 | stderr: { on: () => {} },
11 | kill: () => {},
12 | on: () => {
13 | throw new Error();
14 | },
15 | }));
16 | expect(await verifyAuth("origin", "main")).toBe(false);
17 | });
18 |
19 | test("should verify auth when we can push to remote", async () => {
20 | spawn.mockImplementationOnce(() => ({
21 | stderr: { on: () => {} },
22 | kill: () => {},
23 | on: (_: string, cb: () => void) => cb(),
24 | }));
25 | expect(await verifyAuth("origin", "main")).toBe(true);
26 | });
27 |
28 | test("should not verify auth when we can't push to remote", async () => {
29 | spawn.mockImplementationOnce(() => ({
30 | stderr: {
31 | on: (_: string, cb: (data: string) => void) =>
32 | cb("fatal: could not read Username"),
33 | },
34 | kill: () => {},
35 | on: (_: string, cb: () => void) => cb(),
36 | }));
37 | expect(await verifyAuth("bad", "main")).toBe(false);
38 | });
39 | });
40 |
--------------------------------------------------------------------------------
/packages/core/src/utils/get-current-branch.ts:
--------------------------------------------------------------------------------
1 | import envCi, { CiEnv } from "env-ci";
2 | import { execSync } from "child_process";
3 |
4 | const defaultCiEnvironment = envCi();
5 |
6 | /**
7 | * Validates that the given branch name should be returned by environment context
8 | */
9 | const isValidBranch = (branch: string | undefined) => typeof branch === "string" && branch !== "undefined"
10 |
11 | /** Get the current branch the git repo is set to */
12 | export function getCurrentBranch(env: Partial = defaultCiEnvironment) {
13 | const isPR = "isPr" in env && env.isPr;
14 | let branch: string | undefined;
15 | // env-ci sets branch to target branch (ex: main) in some CI services.
16 | // so we should make sure we aren't in a PR just to be safe
17 |
18 | if (isPR && "prBranch" in env && isValidBranch(env.prBranch)) {
19 | branch = env.prBranch;
20 | } else if(isValidBranch(env.branch)) {
21 | branch = env.branch;
22 | }
23 |
24 | if (!branch) {
25 | try {
26 | branch = execSync("git symbolic-ref --short HEAD", {
27 | encoding: "utf8",
28 | stdio: "ignore",
29 | });
30 | } catch (error) {}
31 | }
32 |
33 | return branch;
34 | }
35 |
--------------------------------------------------------------------------------
/packages/core/src/utils/get-lerna-packages.ts:
--------------------------------------------------------------------------------
1 | import execPromise from "./exec-promise";
2 |
3 | export interface LernaPackage {
4 | /** Path to package */
5 | path: string;
6 | /** Name of package */
7 | name: string;
8 | /** Version of package */
9 | version: string;
10 | }
11 |
12 | /** Get all of the packages in the lerna monorepo */
13 | export default async function getLernaPackages() {
14 | const packages: LernaPackage[] = [];
15 | const response = await execPromise("npx", ["lerna", "ls", "-pla"]);
16 |
17 | response.split("\n").forEach((packageInfo) => {
18 | const [packagePath, name, version] = packageInfo.split(":");
19 |
20 | if (version !== "MISSING") {
21 | packages.push({ path: packagePath, name, version });
22 | }
23 | });
24 |
25 | return packages;
26 | }
27 |
--------------------------------------------------------------------------------
/packages/core/src/utils/get-repository.ts:
--------------------------------------------------------------------------------
1 | import parseGitHubUrl from "parse-github-url";
2 | import on from "await-to-js";
3 |
4 | import execPromise from "./exec-promise";
5 |
6 | /**
7 | * Get the owner and repo from the configure remote "origin"
8 | */
9 | export default async function getRepository() {
10 | const [, origin] = await on(
11 | execPromise("git", ["remote", "get-url", "origin"])
12 | );
13 |
14 | if (origin) {
15 | const info =
16 | parseGitHubUrl(origin) || ({} as Record);
17 | const { name, owner } = info;
18 |
19 | if (name && owner) {
20 | return { repo: name, owner };
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/core/src/utils/git-reset.ts:
--------------------------------------------------------------------------------
1 | import execPromise from "./exec-promise";
2 |
3 | /** Reset all git changes */
4 | export const gitReset = async () =>
5 | execPromise("git", ["reset", "--hard", "HEAD"]);
6 |
--------------------------------------------------------------------------------
/packages/core/src/utils/in-folder.ts:
--------------------------------------------------------------------------------
1 | import path from "path";
2 |
3 | /** Check if one path is within a parent path */
4 | const inFolder = (parent: string, child: string) => {
5 | const relative = path.relative(parent, child);
6 |
7 | return Boolean(!relative?.startsWith("..") && !path.isAbsolute(relative));
8 | };
9 |
10 | export default inFolder;
11 |
--------------------------------------------------------------------------------
/packages/core/src/utils/is-binary.ts:
--------------------------------------------------------------------------------
1 | /** Determine if auto is installed as a binary */
2 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
3 | export default () => (process as any).pkg;
4 |
--------------------------------------------------------------------------------
/packages/core/src/utils/logger.ts:
--------------------------------------------------------------------------------
1 | import signale from "signale";
2 |
3 | export type LogLevel = undefined | "verbose" | "veryVerbose" | "quiet";
4 |
5 | export interface ILogger {
6 | /** The level at which to log messages */
7 | logLevel?: LogLevel;
8 | /** The default logger. Always on */
9 | log: signale.Signale;
10 | /** The verbose log. Has more debug logs */
11 | verbose: signale.Signale;
12 | /** The very verbose log. Has all debug logs */
13 | veryVerbose: signale.Signale;
14 | }
15 |
16 | /** Create a dummy logger for testing. */
17 | export function dummyLog(): ILogger {
18 | return {
19 | log: new signale.Signale({ disabled: true }),
20 | verbose: new signale.Signale({ disabled: true }),
21 | veryVerbose: new signale.Signale({ disabled: true }),
22 | };
23 | }
24 |
25 | const logger: ILogger = {
26 | log: new signale.Signale(),
27 | verbose: new signale.Signale(),
28 | veryVerbose: new signale.Signale(),
29 | };
30 |
31 | /** Turn the logs on an off */
32 | function toggleLogs(
33 | options: Record, boolean>
34 | ) {
35 | Object.entries(options).forEach(([level, enabled]) => {
36 | if (enabled) {
37 | // @ts-ignore
38 | logger[level].enable();
39 | } else {
40 | // @ts-ignore
41 | logger[level].disable();
42 | }
43 | });
44 | }
45 |
46 | /** Set the log level */
47 | export function setLogLevel(newLogLevel: LogLevel) {
48 | logger.logLevel = newLogLevel;
49 |
50 | if (logger.logLevel === "verbose") {
51 | toggleLogs({ log: true, verbose: true, veryVerbose: false });
52 | } else if (logger.logLevel === "veryVerbose") {
53 | toggleLogs({ log: true, verbose: true, veryVerbose: true });
54 | } else if (logger.logLevel === "quiet") {
55 | toggleLogs({ log: false, verbose: false, veryVerbose: false });
56 | } else {
57 | toggleLogs({ log: true, verbose: false, veryVerbose: false });
58 | }
59 | }
60 |
61 | /** Create a logger the the given log level. */
62 | export default function createLog(): ILogger {
63 | return logger;
64 | }
65 |
--------------------------------------------------------------------------------
/packages/core/src/utils/omit.ts:
--------------------------------------------------------------------------------
1 | import fromEntries from "fromentries";
2 |
3 | /** Omit properties from an object */
4 | export const omit = (
5 | obj: Props,
6 | keys: Prop[]
7 | ) =>
8 | fromEntries(
9 | Object.entries(obj).filter(([key]) => !keys.includes(key as Prop))
10 | ) as Omit;
11 |
--------------------------------------------------------------------------------
/packages/core/src/utils/test-config/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "auto": {
3 | "plugins": [
4 | "./some-other-plugin.js",
5 | [
6 | "./some-plugin.js",
7 | {
8 | "foo": "bar"
9 | }
10 | ]
11 | ]
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/core/src/utils/test-config/some-other-plugin.js:
--------------------------------------------------------------------------------
1 | module.exports = class TestPlugin {
2 | /** */
3 | constructor() {
4 | this.name = "test-2";
5 | }
6 |
7 | /**
8 | * Tap into auto plugin points.
9 | */
10 | apply() {
11 | /** */
12 | }
13 | };
14 |
--------------------------------------------------------------------------------
/packages/core/src/utils/test-config/some-plugin.js:
--------------------------------------------------------------------------------
1 | module.exports = class TestPlugin {
2 | /** */
3 | constructor() {
4 | this.name = "test-1";
5 | }
6 |
7 | /**
8 | * Tap into auto plugin points.
9 | */
10 | apply() {
11 | /** */
12 | }
13 | };
14 |
--------------------------------------------------------------------------------
/packages/core/src/utils/try-require.ts:
--------------------------------------------------------------------------------
1 | import importCwd from "import-cwd";
2 | import requireg from "requireg";
3 | import importFrom from "import-from";
4 | import createLog from "./logger";
5 |
6 | const logger = createLog();
7 |
8 | /** Try to require something either from the CWD or the regular way */
9 | export default function tryRequire(tryPath: string, from?: string) {
10 | try {
11 | // Require from CWD
12 | return importCwd(tryPath);
13 | } catch (error) {
14 | // if we try to actually require npm we will import something that is the actual npm API
15 | // not the plugin that we want
16 | if (tryPath === "npm") {
17 | return;
18 | }
19 |
20 | // If a plugin has any errors we want to inform the user
21 | if (error.code !== "MODULE_NOT_FOUND") {
22 | throw error;
23 | }
24 |
25 | try {
26 | // Require from __dirname and then common global package places. Needed for npx and global installs
27 | return requireg(tryPath);
28 | } catch (error) {
29 | logger.veryVerbose.warn(error.message);
30 | }
31 |
32 | if (from) {
33 | try {
34 | // For loading plugins specified in a configuration (yarn 2)
35 | return importFrom(from, tryPath);
36 | } catch (error) {
37 | logger.veryVerbose.warn({ from, tryPath, error });
38 | }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/packages/core/src/utils/verify-auth.ts:
--------------------------------------------------------------------------------
1 | import { spawn } from "child_process";
2 |
3 | /**
4 | *
5 | */
6 | export default function verifyAuth(remote: string, branch: string) {
7 | return new Promise((resolve) => {
8 | let timeout: NodeJS.Timeout | null = null;
9 |
10 | /** Clear the timeout timeout */
11 | const clear = () => {
12 | if (timeout) {
13 | clearTimeout(timeout);
14 | }
15 | };
16 |
17 | try {
18 | const child = spawn(
19 | `git push --dry-run --no-verify ${remote} HEAD:${branch} -q`,
20 | {
21 | cwd: process.cwd(),
22 | env: process.env,
23 | detached: true,
24 | shell: true,
25 | }
26 | );
27 |
28 | timeout = setTimeout(() => {
29 | // Kill the spawned process and it's children
30 | process.kill(-child.pid);
31 | resolve(false);
32 | }, 5 * 1000);
33 |
34 | let err = "";
35 |
36 | child.stderr.on("data", (data) => {
37 | err += data.toString();
38 | });
39 |
40 | child.on("exit", () => {
41 | clear();
42 | resolve(
43 | !err.startsWith("fatal: could not read Username") &&
44 | !err.startsWith("ssh_askpass") &&
45 | !err.includes("fatal")
46 | );
47 | });
48 | } catch (error) {
49 | clear();
50 | resolve(false);
51 | }
52 | });
53 | }
54 |
--------------------------------------------------------------------------------
/packages/core/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/bot-list"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/package-json-utils/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # v10.16.8 (Wed Feb 24 2021)
2 |
3 | #### 🐛 Bug Fix
4 |
5 | - upgrade prettier ([@hipstersmoothie](https://github.com/hipstersmoothie))
6 |
7 | #### 🔩 Dependency Updates
8 |
9 | - Bump @octokit/rest from 18.1.0 to 18.2.0 [#1823](https://github.com/intuit/auto/pull/1823) ([@dependabot-preview[bot]](https://github.com/dependabot-preview[bot]) [@hipstersmoothie](https://github.com/hipstersmoothie))
10 | - Bump type-fest from 0.20.2 to 0.21.1 [#1825](https://github.com/intuit/auto/pull/1825) ([@dependabot-preview[bot]](https://github.com/dependabot-preview[bot]))
11 | - Bump eslint-config-prettier from 6.15.0 to 8.0.0 [#1822](https://github.com/intuit/auto/pull/1822) ([@dependabot-preview[bot]](https://github.com/dependabot-preview[bot]) [@hipstersmoothie](https://github.com/hipstersmoothie))
12 | - Bump aws-cli-js from 2.0.6 to 2.1.0 [#1808](https://github.com/intuit/auto/pull/1808) ([@dependabot-preview[bot]](https://github.com/dependabot-preview[bot]))
13 | - Bump fp-ts from 2.9.3 to 2.9.5 [#1810](https://github.com/intuit/auto/pull/1810) ([@dependabot-preview[bot]](https://github.com/dependabot-preview[bot]))
14 |
15 | #### Authors: 2
16 |
17 | - [@dependabot-preview[bot]](https://github.com/dependabot-preview[bot])
18 | - Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
19 |
20 | ---
21 |
22 | # v10.5.0 (Mon Dec 21 2020)
23 |
24 | #### 🚀 Enhancement
25 |
26 | - VSCode marketplace publishing plugin [#1696](https://github.com/intuit/auto/pull/1696) ([@hipstersmoothie](https://github.com/hipstersmoothie))
27 |
28 | #### 🐛 Bug Fix
29 |
30 | - fix and add tests ([@hipstersmoothie](https://github.com/hipstersmoothie))
31 | - factor out package.json utils into a package ([@hipstersmoothie](https://github.com/hipstersmoothie))
32 |
33 | #### Authors: 1
34 |
35 | - Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
36 |
--------------------------------------------------------------------------------
/packages/package-json-utils/README.md:
--------------------------------------------------------------------------------
1 | # @auto-it/package-json-utils
2 |
3 | Shared utilities for parsing information from a package.json
4 |
--------------------------------------------------------------------------------
/packages/package-json-utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/package-json-utils",
3 | "main": "dist/index.js",
4 | "types": "dist/index.d.ts",
5 | "description": "Shared utilities for parsing information from a package.json",
6 | "version": "11.3.0",
7 | "license": "MIT",
8 | "author": {
9 | "name": "Andrew Lisowski",
10 | "email": "lisowski54@gmail.com"
11 | },
12 | "publishConfig": {
13 | "registry": "https://registry.npmjs.org/",
14 | "access": "public"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "https://github.com/intuit/auto"
19 | },
20 | "files": [
21 | "dist"
22 | ],
23 | "engines": {
24 | "node": ">=10.x"
25 | },
26 | "keywords": [
27 | "automation",
28 | "semantic",
29 | "release",
30 | "github",
31 | "labels",
32 | "automated",
33 | "continuos integration",
34 | "changelog",
35 | "cli"
36 | ],
37 | "scripts": {
38 | "build": "tsc -b",
39 | "start": "npm run build -- -w",
40 | "lint": "eslint src --ext .ts",
41 | "test": "jest --maxWorkers=2"
42 | },
43 | "dependencies": {
44 | "parse-author": "^2.0.0",
45 | "parse-github-url": "1.0.2"
46 | },
47 | "devDependencies": {
48 | "@types/parse-github-url": "1.0.0"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/packages/package-json-utils/src/index.test.ts:
--------------------------------------------------------------------------------
1 | import { loadPackageJson, getRepo } from ".";
2 |
3 | const packageJsonSpy = loadPackageJson as jest.Mock;
4 | jest.mock("../src/utils");
5 |
6 | test("should return nothing without a repo", async () => {
7 | packageJsonSpy.mockReturnValueOnce({});
8 | expect(await getRepo()).toBeUndefined();
9 | });
10 |
11 | test("should return nothing without an owner", async () => {
12 | packageJsonSpy.mockReturnValueOnce({
13 | repository: { url: "fake.com" },
14 | });
15 |
16 | expect(await getRepo()).toBeUndefined();
17 | });
18 |
19 | test("should return nothing without an package name", async () => {
20 | packageJsonSpy.mockReturnValueOnce({
21 | repository: { url: "fake.com" },
22 | });
23 |
24 | expect(await getRepo()).toBeUndefined();
25 | });
26 |
27 | test("should correctly parse package info", async () => {
28 | packageJsonSpy.mockReturnValueOnce({
29 | version: "1.0.0",
30 | repository: { url: "https://github.com/black-panther/operation-foo" },
31 | });
32 |
33 | expect(await getRepo()).toStrictEqual({
34 | repo: "operation-foo",
35 | owner: "black-panther",
36 | });
37 | });
38 |
39 | test("should correctly parse package info - string", async () => {
40 | packageJsonSpy.mockReturnValueOnce({
41 | version: "1.0.0",
42 | repository: "black-panther/operation-foo",
43 | });
44 |
45 | expect(await getRepo()).toStrictEqual({
46 | repo: "operation-foo",
47 | owner: "black-panther",
48 | });
49 | });
50 |
--------------------------------------------------------------------------------
/packages/package-json-utils/src/index.ts:
--------------------------------------------------------------------------------
1 | import * as fs from "fs";
2 | import path from "path";
3 | import { promisify } from "util";
4 | import parseGitHubUrl from "parse-github-url";
5 | import parseAuthor from "parse-author";
6 |
7 | const readFile = promisify(fs.readFile);
8 |
9 | /** Load and parse the root package json for the project */
10 | export async function loadPackageJson(root = "./"): Promise {
11 | return JSON.parse(await readFile(path.join(root, "package.json"), "utf-8"));
12 | }
13 |
14 | export interface IRepoConfig {
15 | /** Owner of the repo (or GitHub user) */
16 | owner: string;
17 | /** The project */
18 | repo: string;
19 | }
20 |
21 | /** Try to the the owner/repo from the package.json */
22 | export async function getRepo(): Promise {
23 | const { repository } = await loadPackageJson();
24 |
25 | if (!repository) {
26 | return;
27 | }
28 |
29 | const { owner, name } =
30 | parseGitHubUrl(
31 | typeof repository === "string" ? repository : repository.url
32 | ) || {};
33 |
34 | if (!owner || !name) {
35 | return;
36 | }
37 |
38 | return {
39 | repo: name,
40 | owner,
41 | };
42 | }
43 |
44 | /** Get the author from a package.json */
45 | export async function getAuthor() {
46 | const packageJson = await loadPackageJson();
47 |
48 | if (!packageJson.author) {
49 | return;
50 | }
51 |
52 | const { author } = packageJson;
53 |
54 | if (typeof author === "string") {
55 | return parseAuthor(author);
56 | }
57 |
58 | return author;
59 | }
60 |
--------------------------------------------------------------------------------
/packages/package-json-utils/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/patches/@atomictech+rehype-toc+3.1.2.patch:
--------------------------------------------------------------------------------
1 | diff --git a/node_modules/@atomictech/rehype-toc/lib/create-toc.js b/node_modules/@atomictech/rehype-toc/lib/create-toc.js
2 | index b576955..fbec54f 100644
3 | --- a/node_modules/@atomictech/rehype-toc/lib/create-toc.js
4 | +++ b/node_modules/@atomictech/rehype-toc/lib/create-toc.js
5 | @@ -120,7 +120,7 @@ function createListItem(heading, options) {
6 | properties: {
7 | className: options_1.buildClass(options.cssClasses.link, heading.tagName),
8 | // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
9 | - href: `#${heading.properties?.id || ""}`,
10 | + href: `#${(heading.properties && heading.properties.id) || ""}`,
11 | },
12 | children: [
13 | {
14 |
--------------------------------------------------------------------------------
/plugins/all-contributors/__tests__/__snapshots__/all-contributors.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`All Contributors Plugin beforeShipit should comment confirming extra contributions 1`] = `
4 | "# Extra Contributions
5 |
6 | The following contributions will be added to all-contributors (as well as any code contributions) when this PR is released :tada::
7 |
8 | - @andrew - design, doc"
9 | `;
10 |
11 | exports[`All Contributors Plugin beforeShipit should warn about unknown contribution types - no valid 1`] = `
12 | "# Extra Contributions
13 |
14 | No valid contribution types found!
15 |
16 | ## Unknown Contribution Types
17 |
18 | We found some unknown contribution types in your PR body!
19 | These contributions will not be counted and you should fix them.
20 |
21 | - \`design123\`,- \`doc456\`"
22 | `;
23 |
24 | exports[`All Contributors Plugin beforeShipit should warn about unknown contribution types - some valid 1`] = `
25 | "# Extra Contributions
26 |
27 | The following contributions will be added to all-contributors (as well as any code contributions) when this PR is released :tada::
28 |
29 | - @adam - doc
30 |
31 | ## Unknown Contribution Types
32 |
33 | We found some unknown contribution types in your PR body!
34 | These contributions will not be counted and you should fix them.
35 |
36 | - \`design123\`,- \`doc456\`"
37 | `;
38 |
39 | exports[`All Contributors Plugin beforeShipit should warn about unknown contribution types 1`] = `
40 | "# Extra Contributions
41 |
42 | The following contributions will be added to all-contributors (as well as any code contributions) when this PR is released :tada::
43 |
44 | - @andrew - doc
45 |
46 | ## Unknown Contribution Types
47 |
48 | We found some unknown contribution types in your PR body!
49 | These contributions will not be counted and you should fix them.
50 |
51 | - \`design123\`"
52 | `;
53 |
--------------------------------------------------------------------------------
/plugins/all-contributors/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/all-contributors",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Automatically add contributors as changelogs are produced.",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "all-contributors"
32 | ],
33 | "scripts": {
34 | "build": "tsc -b",
35 | "start": "npm run build -- -w",
36 | "lint": "eslint src --ext .ts",
37 | "test": "jest --maxWorkers=2 --config ../../package.json"
38 | },
39 | "dependencies": {
40 | "@auto-it/bot-list": "link:../../packages/bot-list",
41 | "@auto-it/core": "link:../../packages/core",
42 | "@octokit/rest": "^18.12.0",
43 | "all-contributors-cli": "6.19.0",
44 | "anymatch": "^3.1.1",
45 | "await-to-js": "^3.0.0",
46 | "endent": "^2.1.0",
47 | "env-ci": "^5.0.1",
48 | "fp-ts": "^2.5.3",
49 | "fromentries": "^1.2.0",
50 | "io-ts": "^2.1.2",
51 | "tslib": "2.1.0"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/plugins/all-contributors/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | },
15 | {
16 | "path": "../../packages/bot-list"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/plugins/brew/__tests__/__snapshots__/brew.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Brew Plugin should validate it's configuration 1`] = `
4 | Array [
5 | Object {
6 | "expectedType": "\\"string\\"",
7 | "path": "brew.executable",
8 | "value": undefined,
9 | },
10 | ]
11 | `;
12 |
--------------------------------------------------------------------------------
/plugins/brew/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/brew",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Automate the creation of Homebrew formulae.",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "fp-ts": "^2.5.3",
41 | "io-ts": "^2.1.2",
42 | "tslib": "2.1.0"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/plugins/brew/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/chrome/README.md:
--------------------------------------------------------------------------------
1 | # Chrome Web Store
2 |
3 | This plugin allows you to automate the publishing of chrome extensions
4 |
5 | > Example Repo: [here](https://github.com/hipstersmoothie/auto-chrome)
6 |
7 | ## Prerequisites
8 |
9 | To publish to the chrome web store you will need the following secrets set in your environment. See [here](https://github.com/DrewML/chrome-webstore-upload/blob/master/How%20to%20generate%20Google%20API%20keys.md) for a guide one how to get these values.
10 |
11 | - `CLIENT_ID`
12 | - `CLIENT_SECRET`
13 | - `REFRESH_TOKEN`
14 |
15 | ## Installation
16 |
17 | This plugin is not included with the `auto` CLI installed via NPM. To install:
18 |
19 | ```bash
20 | npm i --save-dev @auto-it/chrome
21 | # or
22 | yarn add -D @auto-it/chrome
23 | ```
24 |
25 | > WARNING: You can only use one "package manager" at a time!
26 | > Mixing them will lead to undesired results.
27 |
28 | ## Usage
29 |
30 | You must first pack/zip your plugin before running `auto`.
31 |
32 | These environment variables tell `auto` what to publish.
33 |
34 | - EXTENSION_ID - your chrome extensions unique ID (REQUIRED)
35 | - EXTENSION_BUILD - Path to either a zip file, or a directory to be zip. defaults to `extension.zip`
36 |
37 | Or you can set these values in the autorc:
38 |
39 | ```json
40 | {
41 | "plugins": [
42 | [
43 | "chrome",
44 | {
45 | "id": "1234",
46 | "build": "path/to/zip/or/folder",
47 | "manifest": "path/tp/manifest.json"
48 | }
49 | ]
50 | ]
51 | }
52 | ```
53 |
54 | > :warning: You must have a manifest.json for this plugin to work.
55 |
--------------------------------------------------------------------------------
/plugins/chrome/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/chrome",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Chrome publishing plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "chrome",
32 | "web store"
33 | ],
34 | "scripts": {
35 | "build": "tsc -b",
36 | "start": "npm run build -- -w",
37 | "lint": "eslint src --ext .ts",
38 | "test": "jest --maxWorkers=2 --config ../../package.json"
39 | },
40 | "dependencies": {
41 | "@auto-it/core": "link:../../packages/core",
42 | "chrome-webstore-upload-cli": "^1.2.0",
43 | "fp-ts": "^2.5.3",
44 | "io-ts": "^2.1.2",
45 | "semver": "^7.0.0",
46 | "tslib": "2.1.0"
47 | },
48 | "devDependencies": {
49 | "@types/semver": "^7.1.0"
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/plugins/chrome/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/cocoapods/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/cocoapods",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Use auto to version your cocoapod",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "fp-ts": "^2.5.3",
41 | "io-ts": "^2.1.2",
42 | "semver": "^7.1.3",
43 | "tslib": "2.1.0"
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/plugins/cocoapods/src/utilities.ts:
--------------------------------------------------------------------------------
1 | import path from "path";
2 | import fs from "fs";
3 |
4 | /**
5 | * Retrieves the contents of the podspec file
6 | *
7 | * @param podspecPath - The relative path to the podspec file
8 | * @returns A string that is the contents of the file
9 | */
10 | export function getPodspecContents(podspecPath: string): string {
11 | return fs.readFileSync(path.join(process.cwd(), podspecPath)).toString();
12 | }
13 |
14 | /**
15 | * Write the podspec file contents
16 | *
17 | * @param podspecPath - The relative path to the podspec file
18 | * @param contents - The contents to write to the podspec path
19 | */
20 | export function writePodspecContents(podspecPath: string, contents: string) {
21 | fs.writeFileSync(path.join(process.cwd(), podspecPath), contents);
22 | }
23 |
--------------------------------------------------------------------------------
/plugins/cocoapods/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/conventional-commits/README.md:
--------------------------------------------------------------------------------
1 | # Conventional Commits Plugin
2 |
3 | Parse [conventional commit messages](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) and use them to calculate the version. This plugin will omit the PR HEAD if it isn't labeled and has a commit with a conventional-commit commit message.
4 |
5 | The default behavior extends the [conventional commits spec](https://www.conventionalcommits.org/en/v1.0.0/#summary):
6 |
7 | - Type `fix:` => `patch`
8 | - Type `feat:` => `minor`
9 | - Type `BREAKING:` => `major`
10 | - A `!` in the type indicated a breaking change
11 | - `BREAKING CHANGE` in the footer indicates a breaking change
12 | - All other types are considered `skip-release`
13 |
14 | ## Installation
15 |
16 | This plugin is not included with the `auto` CLI installed via NPM. To install:
17 |
18 | ```bash
19 | npm i --save-dev @auto-it/conventional-commits
20 | # or
21 | yarn add -D @auto-it/conventional-commits
22 | ```
23 |
24 | ## Usage
25 |
26 | ```json
27 | {
28 | "plugins": [
29 | "npm",
30 | "conventional-commits"
31 | // other plugins
32 | ]
33 | }
34 | ```
35 |
36 | ## Options
37 |
38 | ### `preset`
39 |
40 | You can use any [conventional-changelog preset](https://www.npmjs.com/search?q=conventional-changelog%20preset%20) with this plugin.
41 | Using a preset will completely override this plugin's default behavior with whatever the preset defines.
42 |
43 | ```json
44 | {
45 | "plugins": [
46 | "npm",
47 | ["conventional-commits", { "preset": "angular" }]
48 | // other plugins
49 | ]
50 | }
51 | ```
52 |
53 | ### `defaultReleaseType`
54 |
55 | The default release type to apply when the conventional commit isn't "fix", "feat" or "breaking" (ex: "chore:").
56 | Defaults to `skip`.
57 |
58 | ```json
59 | {
60 | "plugins": [
61 | "npm",
62 | ["conventional-commits", { "defaultReleaseType": "patch" }]
63 | // other plugins
64 | ]
65 | }
66 | ```
67 |
--------------------------------------------------------------------------------
/plugins/conventional-commits/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/conventional-commits",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Conventional commit plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "conventional commits"
32 | ],
33 | "scripts": {
34 | "build": "tsc -b",
35 | "start": "npm run build -- -w",
36 | "lint": "eslint src --ext .ts",
37 | "test": "jest --maxWorkers=2 --config ../../package.json"
38 | },
39 | "dependencies": {
40 | "@auto-it/core": "link:../../packages/core",
41 | "array.prototype.flatmap": "^1.2.2",
42 | "conventional-changelog-core": "^4.2.0",
43 | "conventional-changelog-preset-loader": "^2.3.4",
44 | "conventional-commits-parser": "^3.1.0",
45 | "endent": "^2.1.0",
46 | "fp-ts": "^2.5.3",
47 | "io-ts": "^2.1.2",
48 | "tslib": "2.1.0"
49 | },
50 | "devDependencies": {
51 | "@types/conventional-changelog-core": "^4.1.1",
52 | "@types/conventional-changelog-preset-loader": "^2.3.1",
53 | "@types/conventional-commits-parser": "^3.0.0"
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/plugins/conventional-commits/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/crates/README.md:
--------------------------------------------------------------------------------
1 | # Crates Plugin
2 |
3 | Deploy Rust crates to [crates.io](https://crates.io/).
4 |
5 | ## Installation
6 |
7 | This plugin is not included with the `auto` CLI installed via NPM. To install:
8 |
9 | ```bash
10 | npm i --save-dev @auto-it/crates
11 | # or
12 | yarn add -D @auto-it/crates
13 | ```
14 |
15 | > WARNING: You can only use one "package manager" at a time!
16 | > Mixing them will lead to undesired results.
17 |
18 | ## Usage
19 |
20 | ```json
21 | {
22 | "plugins": ["crates"]
23 | }
24 | ```
25 |
26 | ## Crates Project Configuration
27 |
28 | This plugin handles incrementing the crate version, but it requires that your crate be ready for publishing. You can view [the publishing reference](https://doc.rust-lang.org/cargo/reference/publishing.html) for more information on that process.
29 |
30 | When ran on a machine with `~/cargo/credentials`, that file will automatically be used by Cargo. For machines that do not have this file (like CI builds), the `CARGO_REGISTRY_TOKEN` environment variable is expected for Cargo's publish command as per the [publish options](https://doc.rust-lang.org/cargo/commands/cargo-publish.html#cargo_publish_options).
31 |
--------------------------------------------------------------------------------
/plugins/crates/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/crates",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Deploy Rust crates to crates.io",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "rust",
32 | "crates.io"
33 | ],
34 | "scripts": {
35 | "build": "tsc -b",
36 | "start": "npm run build -- -w",
37 | "lint": "eslint src --ext .ts",
38 | "test": "jest --maxWorkers=2 --config ../../package.json"
39 | },
40 | "dependencies": {
41 | "@auto-it/core": "link:../../packages/core",
42 | "env-ci": "^5.0.1",
43 | "semver": "^7.0.0",
44 | "toml": "^3.0.0",
45 | "tslib": "2.1.0",
46 | "user-home": "^2.0.0"
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/plugins/crates/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/docker/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/docker",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Facilitates publishing built images to a Docker Registry.",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "docker"
32 | ],
33 | "scripts": {
34 | "build": "tsc -b",
35 | "start": "npm run build -- -w",
36 | "lint": "eslint src --ext .ts",
37 | "test": "jest --maxWorkers=2 --config ../../package.json"
38 | },
39 | "dependencies": {
40 | "@auto-it/core": "link:../../packages/core",
41 | "fp-ts": "^2.5.3",
42 | "io-ts": "^2.1.2",
43 | "semver": "^7.0.0",
44 | "tslib": "2.1.0"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/plugins/docker/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/exec/README.md:
--------------------------------------------------------------------------------
1 | # Exec Plugin
2 |
3 | Tap into hooks and run scripts on the terminal.
4 |
5 | [Read more about the available hooks.](https://intuit.github.io/auto/docs/plugins/hook-api-docs)
6 |
7 | ## Installation
8 |
9 | This plugin is not included with the `auto` CLI installed via NPM. To install:
10 |
11 | ```bash
12 | npm i --save-dev @auto-it/exec
13 | # or
14 | yarn add -D @auto-it/exec
15 | ```
16 |
17 | ## Usage
18 |
19 | Here is an example of replacing the `npm` plugins with a light-weight version.
20 |
21 | All args to a hook are exposed on the process in environment variables.
22 | The format looks like `$ARG_0`, `$ARG_1`, and so on.
23 | Please look at the docs for [writing plugins](https://intuit.github.io/auto/docs/plugins/writing-plugins) for more detail on what's available.
24 |
25 | ```json
26 | {
27 | "plugins": [
28 | [
29 | "exec",
30 | {
31 | "version": "npm version $ARG_0",
32 | "publish": "npm publish && git push --tags",
33 | "afterRelease": "yarn docs && push-dir --dir=docs --branch=gh-pages"
34 | }
35 | ]
36 | // other plugins
37 | ]
38 | }
39 | ```
40 |
41 | > :warning: If you are tapping into a waterfall or bail hook you will need to return some value (ex: JSON or a boolean). Please refer to the documentation and return the right thing!
42 |
--------------------------------------------------------------------------------
/plugins/exec/__tests__/__snapshots__/exec.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Exec Plugin should warn about invalid config 1`] = `
4 | Array [
5 | "\\"exec\\"
6 |
7 | Found unknown configuration keys: notAHook
8 | ",
9 | ]
10 | `;
11 |
--------------------------------------------------------------------------------
/plugins/exec/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/exec",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Tap into select hooks and run a command on the terminal",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "endent": "^2.1.0",
41 | "fp-ts": "^2.5.3",
42 | "fromentries": "^1.2.0",
43 | "io-ts": "^2.1.2",
44 | "tslib": "2.1.0"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/plugins/exec/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/first-time-contributor/README.md:
--------------------------------------------------------------------------------
1 | # First Time Contributor Plugin
2 |
3 | Thank first time contributors for their work right in your release notes.
4 |
5 | ## Installation
6 |
7 | This plugin is not included with the `auto` CLI installed via NPM. To install:
8 |
9 | ```bash
10 | npm i --save-dev @auto-it/first-time-contributor
11 | # or
12 | yarn add -D @auto-it/first-time-contributor
13 | ```
14 |
15 | ## Usage
16 |
17 | Simply add the plugins to your auto configuration.
18 |
19 | ```json
20 | {
21 | "plugins": ["first-time-contributor"]
22 | }
23 | ```
24 |
--------------------------------------------------------------------------------
/plugins/first-time-contributor/__tests__/__snapshots__/first-time-contributor.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`First Time Contributor Plugin should exclude a past contributor 1`] = `
4 | Array [
5 | ":tada: This release contains work from a new contributor! :tada:
6 |
7 | Thank you, Jeff ([@Jeff](https://github.com/Jeff)), for all your work!",
8 | ]
9 | `;
10 |
11 | exports[`First Time Contributor Plugin should exclude a past contributor by username 1`] = `
12 | Array [
13 | ":tada: This release contains work from a new contributor! :tada:
14 |
15 | Thank you, Jeff123 ([@Jeff123](https://github.com/Jeff123)), for all your work!",
16 | ]
17 | `;
18 |
19 | exports[`First Time Contributor Plugin should exclude bots 1`] = `Array []`;
20 |
21 | exports[`First Time Contributor Plugin should include a username if it exists 1`] = `
22 | Array [
23 | ":tada: This release contains work from new contributors! :tada:
24 |
25 | Thanks for all your work!
26 |
27 | :heart: Jeff ([@jeff-the-snake](https://github.com/jeff-the-snake))
28 |
29 | :heart: Andrew ([@hipstersmoothie](https://github.com/hipstersmoothie))",
30 | ]
31 | `;
32 |
33 | exports[`First Time Contributor Plugin should include all authors with no past contributors 1`] = `
34 | Array [
35 | ":tada: This release contains work from new contributors! :tada:
36 |
37 | Thanks for all your work!
38 |
39 | :heart: Jeff ([@Jeff](https://github.com/Jeff))
40 |
41 | :heart: Andrew ([@Andrew](https://github.com/Andrew))",
42 | ]
43 | `;
44 |
45 | exports[`First Time Contributor Plugin should include only username if no name exists 1`] = `
46 | Array [
47 | ":tada: This release contains work from a new contributor! :tada:
48 |
49 | Thank you, [@jeff-the-snake](https://github.com/jeff-the-snake), for all your work!",
50 | ]
51 | `;
52 |
53 | exports[`First Time Contributor Plugin should not include past contributors 1`] = `Array []`;
54 |
--------------------------------------------------------------------------------
/plugins/first-time-contributor/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/first-time-contributor",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Thank first time contributors for their work right in your release notes.",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/bot-list": "link:../../packages/bot-list",
40 | "@auto-it/core": "link:../../packages/core",
41 | "array.prototype.flatmap": "^1.2.2",
42 | "endent": "^2.1.0",
43 | "tslib": "2.1.0",
44 | "url-join": "^4.0.0"
45 | },
46 | "devDependencies": {
47 | "@octokit/rest": "^18.12.0",
48 | "@types/array.prototype.flatmap": "^1.2.0"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/plugins/first-time-contributor/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/gem/README.md:
--------------------------------------------------------------------------------
1 | # Gem Plugin
2 |
3 | A plugin that automates publishing ruby gems.
4 |
5 | ## Prerequisites
6 |
7 | To publish to your gem you will need you your environment authenticated.
8 | You can either create a `~/.gem/credentials` yourself or provide `RUBYGEMS_API_KEY` as an environment variable.
9 |
10 | This plugin also looks in your `.gemspec` and `lib/**/version.rb` for a version.
11 | `auto` will use this value and keep it up to date.
12 |
13 | ## Installation
14 |
15 | This plugin is not included with the `auto` CLI installed via NPM. To install:
16 |
17 | ```bash
18 | npm i --save-dev @auto-it/gem
19 | # or
20 | yarn add -D @auto-it/gem
21 | ```
22 |
23 | > WARNING: You can only use one "package manager" at a time!
24 | > Mixing them will lead to undesired results.
25 |
26 | ## Usage
27 |
28 | ```json
29 | {
30 | "plugins": ["gem"]
31 | }
32 | ```
33 |
34 | ## Options
35 |
36 | ### Release Command
37 |
38 | When `auto` publishes your gem it does it by running a command.
39 | The default for this is `bundle exec rake release`.
40 |
41 | The following is an example of using [gem-release](https://github.com/svenfuchs/gem-release) to publish the gem.
42 |
43 | > Make sure to tag and push in this command!
44 |
45 | **.autorc:**
46 |
47 | ```json
48 | {
49 | "plugins": [
50 | [
51 | "gem",
52 | {
53 | "releaseCommand": "gem release --tag --push"
54 | }
55 | ]
56 | ]
57 | }
58 | ```
59 |
--------------------------------------------------------------------------------
/plugins/gem/__tests__/__snapshots__/gem.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Gem Plugin validateConfig validates invalid configuration 1`] = `
4 | Array [
5 | "\\"gem\\"
6 |
7 | Found unknown configuration keys: command
8 | ",
9 | ]
10 | `;
11 |
--------------------------------------------------------------------------------
/plugins/gem/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/gem",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "endent": "^2.1.0",
41 | "env-ci": "^5.0.1",
42 | "fast-glob": "^3.1.1",
43 | "fp-ts": "^2.5.3",
44 | "io-ts": "^2.1.2",
45 | "parse-github-url": "1.0.2",
46 | "semver": "^7.0.0",
47 | "tslib": "2.1.0"
48 | },
49 | "devDependencies": {
50 | "jest-when": "^3.2.1"
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/plugins/gem/src/utils.ts:
--------------------------------------------------------------------------------
1 | import * as fs from "fs";
2 | import { promisify } from "util";
3 |
4 | export const mkdir = promisify(fs.mkdir);
5 | export const readFile = promisify(fs.readFile);
6 | export const writeFile = promisify(fs.writeFile);
7 |
--------------------------------------------------------------------------------
/plugins/gem/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/gh-pages/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/gh-pages",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Automate publishing to your gh-pages documentation website",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "endent": "^2.1.0",
41 | "fp-ts": "^2.5.3",
42 | "io-ts": "^2.1.2",
43 | "push-dir": "^0.4.1",
44 | "tslib": "2.1.0"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/plugins/gh-pages/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/git-tag/README.md:
--------------------------------------------------------------------------------
1 | # Git Tag Plugin
2 |
3 | Manage your projects version through just a git tag.
4 | This plugin is loaded by default when `auto` is installed through the binaries released on GitHub.
5 |
6 | If you're using this plugin you aren't releasing your code to any platform (npm, maven, etc). Instead you version calculations is done entirely though git tags.
7 |
8 | This plugin only:
9 |
10 | 1. gets last git tag
11 | 2. bump it to new version
12 | 3. create new tags
13 | 4. push to github
14 |
15 | It will not:
16 |
17 | 1. Publish to a specific platform
18 | 2. Use any platform specific project information (ex: `author` or `repo` from a `package.json`)
19 |
20 | ## Installation
21 |
22 | This plugin is not included with the `auto` CLI installed via NPM. To install:
23 |
24 | ```bash
25 | npm i --save-dev @auto-it/git-tag
26 | # or
27 | yarn add -D @auto-it/git-tag
28 | ```
29 |
30 | > WARNING: You can only use one "package manager" at a time!
31 | > Mixing them will lead to undesired results.
32 |
33 | ## Usage
34 |
35 | Simply add the plugins to your auto configuration.
36 |
37 | ```json
38 | {
39 | "plugins": ["git-tag"]
40 | }
41 | ```
42 |
43 | ## Canary Releases
44 |
45 | This plugin does not support canaries.
46 | For canary support try using [the upload-assets plugin](./upload-assets)
47 |
--------------------------------------------------------------------------------
/plugins/git-tag/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/git-tag",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Manage your projects version through just a git tag",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "semver": "^7.0.0",
41 | "tslib": "2.1.0"
42 | },
43 | "devDependencies": {
44 | "@types/semver": "^7.1.0"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/plugins/git-tag/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/gradle/README.md:
--------------------------------------------------------------------------------
1 | # Gradle Plugin
2 |
3 | Release a Java project using [gradle](https://gradle.org/).
4 |
5 | - supports both `-snapshot` and `-snapshot`-less versioning
6 |
7 | ## Installation
8 |
9 | This plugin is not included with the `auto` CLI installed via NPM. To install:
10 |
11 | ```bash
12 | npm i --save-dev @auto-it/gradle
13 | # or
14 | yarn add -D @auto-it/gradle
15 | ```
16 |
17 | > WARNING: You can only use one "package manager" at a time!
18 | > Mixing them will lead to undesired results.
19 |
20 | ## Usage
21 |
22 | ```json
23 | {
24 | "plugins": [
25 | [
26 | "gradle",
27 | {
28 | // An optional gradle binary cmd/path relative to your project
29 | // @default /usr/bin/gradle
30 | "gradleCommand": "./gradlew",
31 |
32 | // An optional gradle argument list -- IE any gradle option allowed for the version
33 | // of gradle you're using
34 | // @default []
35 | "gradleOptions": ["-P someProp=someVal"]
36 | }
37 | ]
38 | // other plugins
39 | ]
40 | }
41 | ```
42 |
43 | ## Gradle Project Configuration
44 |
45 | This plugin uses the [gradle release plugin](https://github.com/researchgate/gradle-release) to update the version. Make sure the the latest `gradle-release-plugin` is in your `build.gradle`.
46 |
47 | ```groovy
48 | plugins {
49 | id 'net.researchgate.release' version '2.6.0' // gradle release plugin
50 | }
51 | ```
52 |
53 | ### Publish
54 |
55 | This plugin will also call the `publish` task with the release version, if configured in your project.
56 |
57 | ### Configure `snapshotSuffix`
58 |
59 | This plugin will use the `snapshotSuffix` in `gradle.properties` or `build.gradle` if configured.
60 |
61 | ### Build After Version Bump Automatically
62 |
63 | This plugin will run a release build to create release artifacts.
64 |
--------------------------------------------------------------------------------
/plugins/gradle/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/gradle",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "A plugin that calls gradle-release-plugin with versioning information.",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Brandon Miller",
9 | "email": "unknownerror404@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "fp-ts": "^2.5.3",
41 | "io-ts": "^2.1.2",
42 | "semver": "^7.0.0",
43 | "tslib": "2.1.0"
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/plugins/gradle/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/jira/README.md:
--------------------------------------------------------------------------------
1 | # Jira Plugin
2 |
3 | Include links to Jira stories in your changelogs.
4 |
5 | This plugin will create links to Jira stories using the following syntax in a pull request title:
6 |
7 | ```txt
8 | JIRA-123: My pull request title
9 | [JIRA-123]: My pull request title
10 | ```
11 |
12 | ## Installation
13 |
14 | This plugin is not included with the `auto` CLI installed via NPM. To install:
15 |
16 | ```bash
17 | npm i --save-dev @auto-it/jira
18 | # or
19 | yarn add -D @auto-it/jira
20 | ```
21 |
22 | ## Usage
23 |
24 | To use the plugin include it in your `.autorc`
25 |
26 | ```json
27 | {
28 | "plugins": [
29 | ["jira", { "url": "https://url-to-your-jira.com" }],
30 | // or
31 | ["jira", "https://url-to-your-jira.com"]
32 | ]
33 | }
34 | ```
35 |
--------------------------------------------------------------------------------
/plugins/jira/__tests__/__snapshots__/jira.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`should create note for JIRA commits 1`] = `
4 | "#### 💥 Breaking Change
5 |
6 | - [PLAYA-5052](https://jira.custom.com/browse/PLAYA-5052): Some Feature [#12345](https://github.custom.com/foobar/auto/pull/12345) (adam@dierkens.com)
7 |
8 | #### 🐛 Bug Fix
9 |
10 | - Third (adam@dierkens.com)
11 |
12 | #### 🏠 Internal
13 |
14 | - Some Feature [#1234](https://github.custom.com/foobar/auto/pull/1234) (adam@dierkens.com)
15 |
16 | #### Authors: 1
17 |
18 | - Adam Dierkens (adam@dierkens.com)"
19 | `;
20 |
21 | exports[`should create note for jira commits without PR title 1`] = `
22 | "#### 🐛 Bug Fix
23 |
24 | - [PLAYA-5052](https://jira.custom.com/browse/PLAYA-5052) (adam@dierkens.com)
25 |
26 | #### Authors: 1
27 |
28 | - Adam Dierkens (adam@dierkens.com)"
29 | `;
30 |
--------------------------------------------------------------------------------
/plugins/jira/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/jira",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Jira plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "jira",
31 | "changelog"
32 | ],
33 | "scripts": {
34 | "build": "tsc -b",
35 | "start": "npm run build -- -w",
36 | "lint": "eslint src --ext .ts",
37 | "test": "jest --maxWorkers=2 --config ../../package.json"
38 | },
39 | "dependencies": {
40 | "@auto-it/core": "link:../../packages/core",
41 | "enquirer": "^2.3.4",
42 | "fp-ts": "^2.5.3",
43 | "io-ts": "^2.1.2",
44 | "tslib": "2.1.0",
45 | "url-join": "^4.0.0"
46 | },
47 | "devDependencies": {
48 | "@types/url-join": "^4.0.0"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/plugins/jira/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/magic-zero/README.md:
--------------------------------------------------------------------------------
1 | # Magic-Zero Plugin
2 |
3 | A plugin that closely adheres to semver versioning for 0.0.x and 0.x.y releases.
4 |
5 | In the default `auto` experience the `patch`, `minor`, and `major` only increment the corresponding digit in the version.
6 | The rules for incrementing version `< 1.0.0` are not as intuitive or [agreed upon](https://github.com/semver/semver/issues/221).
7 | This plugin adds a new label (`graduate`) and changes `auto`'s behavior to do the following:
8 |
9 | **0.0.x:**
10 |
11 | _Starting version:_ `0.0.1`
12 |
13 | `patch` => `0.0.2`
14 | `minor` => `0.0.2`
15 | `major` => `0.0.2`
16 | `graduate` => `0.1.0`
17 |
18 | **0.x.y:**
19 |
20 | _Starting version:_ `0.1.0`
21 |
22 | `patch` => `0.1.1`
23 | `minor` => `0.1.1`
24 | `major` => `0.2.0`
25 | `graduate` => `1.0.0`
26 |
27 | Once you're project is `>= 1.0.0` this plugin effectively does nothing.
28 |
29 | ## Installation
30 |
31 | This plugin is not included with the `auto` CLI installed via NPM. To install:
32 |
33 | ```bash
34 | npm i --save-dev @auto-it/magic-zero
35 | # or
36 | yarn add -D @auto-it/magic-zero
37 | ```
38 |
39 | ## Usage
40 |
41 | ```json
42 | {
43 | "plugins": [
44 | "magic-zero"
45 | // other plugins
46 | ]
47 | }
48 | ```
49 |
50 | ## Options
51 |
52 | ### `label`
53 |
54 | The label to graduate a version to the next left 0 digit.
55 |
56 | ```json
57 | {
58 | "plugins": [
59 | ["magic-zero", { "label": "super major" }]
60 | // other plugins
61 | ]
62 | }
63 | ```
64 |
65 | If you want to customize the label color/description you must define the label in your `.autorc`.
66 |
67 | ```json
68 | {
69 | "plugins": [
70 | ["magic-zero", { "label": "super major" }]
71 | // other plugins
72 | ],
73 | "labels": [
74 | {
75 | "name": "super major",
76 | "description": "Graduate a version to the next left 0 digit",
77 | "releaseType": "major",
78 | "color": "#000"
79 | }
80 | ]
81 | }
82 | ```
83 |
--------------------------------------------------------------------------------
/plugins/magic-zero/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/magic-zero",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "A plugin that closely adheres to semver versioning for 0.0.x and 0.x.y releases",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "fp-ts": "^2.5.3",
41 | "io-ts": "^2.1.2",
42 | "semver": "^7.0.0",
43 | "tslib": "2.1.0"
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/plugins/magic-zero/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/maven/.snyk:
--------------------------------------------------------------------------------
1 | # Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
2 | version: v1.16.0
3 | ignore: {}
4 | # patches apply the minimum changes required to fix a vulnerability
5 | patch:
6 | SNYK-JS-LODASH-567746:
7 | - jsdom > request-promise-native > request-promise-core > lodash:
8 | patched: '2020-06-24T16:26:03.144Z'
9 |
--------------------------------------------------------------------------------
/plugins/maven/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/maven",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Maven publishing plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "released",
32 | "comment"
33 | ],
34 | "scripts": {
35 | "build": "tsc -b",
36 | "start": "npm run build -- -w",
37 | "lint": "eslint src --ext .ts",
38 | "test": "jest --maxWorkers=2 --config ../../package.json"
39 | },
40 | "dependencies": {
41 | "@auto-it/core": "link:../../packages/core",
42 | "fast-glob": "^3.1.1",
43 | "fp-ts": "^2.5.3",
44 | "io-ts": "^2.1.2",
45 | "jsdom": "^16.2.2",
46 | "parse-github-url": "^1.0.2",
47 | "pom-parser": "^1.1.1",
48 | "prettier": "^2.0.5",
49 | "semver": "^7.0.0",
50 | "tslib": "^2.0.0"
51 | },
52 | "devDependencies": {
53 | "@types/jest": "^26.0.7",
54 | "@types/jsdom": "^16.2.3",
55 | "@types/prettier": "^2.0.1",
56 | "ts-jest": "^26.1.3"
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/plugins/maven/src/maven.ts:
--------------------------------------------------------------------------------
1 | import { Auto, execPromise } from "@auto-it/core";
2 | import { IMavenPluginOptions } from "./index";
3 |
4 | const mavenDefaults = {
5 | mavenCommand: "/usr/bin/mvn",
6 | mavenOptions: [],
7 | mavenReleaseGoals: ["deploy", "site-deploy"],
8 | };
9 |
10 | /** executes a maven command with all the options */
11 | async function executeMaven(options: IMavenPluginOptions, goals: string[]) {
12 | const settingsParams = [
13 | options?.mavenSettings ? `-s=${options.mavenSettings}` : "",
14 | options?.mavenUsername ? `-Dusername=${options.mavenUsername}` : "",
15 | options?.mavenPassword ? `-Dpassword=${options.mavenPassword}` : "",
16 | ];
17 |
18 | return execPromise(options.mavenCommand || mavenDefaults.mavenCommand, [
19 | ...(options.mavenOptions || mavenDefaults.mavenOptions),
20 | ...goals,
21 | ...settingsParams,
22 | ]);
23 | }
24 |
25 | /** execute the built in release goals */
26 | export async function executeReleaseGoals(options: IMavenPluginOptions) {
27 | return executeMaven(
28 | options,
29 | options.mavenReleaseGoals || mavenDefaults.mavenReleaseGoals
30 | );
31 | }
32 |
33 | /** Update the pom with maven */
34 | export async function updatePoms(
35 | version: string,
36 | options: IMavenPluginOptions,
37 | auto: Auto,
38 | message: string
39 | ) {
40 | auto.logger.verbose.info(
41 | `Using the versions-maven-plugin to set version = ${version}`
42 | );
43 |
44 | await executeMaven(options, [
45 | "versions:set",
46 | "-DgenerateBackupPoms=false",
47 | `-DnewVersion=${version}`,
48 | ]);
49 |
50 | await execPromise("git", ["commit", "-am", message, "--no-verify"]);
51 | }
52 |
--------------------------------------------------------------------------------
/plugins/maven/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/microsoft-teams/README.md:
--------------------------------------------------------------------------------
1 | # Microsoft-Teams Plugin
2 |
3 | Post your release notes to a Microsoft teams channel.
4 |
5 | ## Installation
6 |
7 | This plugin is not included with the `auto` CLI installed via NPM. To install:
8 |
9 | ```bash
10 | npm i --save-dev @auto-it/microsoft-teams
11 | # or
12 | yarn add -D @auto-it/microsoft-teams
13 | ```
14 |
15 | ## Usage
16 |
17 | To use the plugin include it in your `.autorc`.
18 | To generate incoming webhook in microsoft teams, checkout [this blog](https://medium.com/@ankush.kumar133/get-started-with-microsoft-team-connectors-incoming-webhook-a330657993e7).
19 |
20 | ```json
21 | {
22 | "plugins": [
23 | ["microsoft-teams", { "url": "https://url-to-your-hook.com" }],
24 | // or
25 | ["microsoft-teams", "https://url-to-your-hook.com"],
26 | // or
27 | [
28 | "microsoft-teams",
29 | { "url": "https://url-to-your--hook.com" }
30 | ]
31 | // Below: Uses microsoft-teams hook set in process.env.MICROSOFT_TEAMS_WEBHOOK_URL
32 | "microsoft-teams"
33 | ]
34 | }
35 | ```
36 |
--------------------------------------------------------------------------------
/plugins/microsoft-teams/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/microsoft-teams",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Microsoft Teams plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Mukul Chaware",
9 | "email": "mukul.chaware13@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "microsoft-teams"
32 | ],
33 | "scripts": {
34 | "build": "tsc -b",
35 | "start": "npm run build -- -w",
36 | "lint": "eslint src --ext .ts",
37 | "test": "jest --maxWorkers=2 --config ../../package.json"
38 | },
39 | "dependencies": {
40 | "@auto-it/core": "link:../../packages/core",
41 | "fp-ts": "^2.5.3",
42 | "https-proxy-agent": "^5.0.0",
43 | "io-ts": "^2.1.2",
44 | "node-fetch": "2.6.7",
45 | "tslib": "2.1.0"
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/plugins/microsoft-teams/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/npm/__tests__/__snapshots__/npm.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`canary don't force publish canaries 1`] = `
4 | Object {
5 | "details": ":sparkles: Test out this PR locally via:
6 |
7 | \`\`\`bash
8 | npm install @foobar/lib@1.1.0.canary
9 | # or
10 | yarn add @foobar/lib@1.1.0.canary
11 | \`\`\`",
12 | "newVersion": "Canary Versions",
13 | }
14 | `;
15 |
--------------------------------------------------------------------------------
/plugins/npm/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/npm",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "NPM publishing plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "npm",
32 | "lerna"
33 | ],
34 | "scripts": {
35 | "build": "tsc -b",
36 | "start": "npm run build -- -w",
37 | "lint": "eslint src --ext .ts",
38 | "test": "jest --maxWorkers=2 --config ../../package.json"
39 | },
40 | "dependencies": {
41 | "@auto-it/core": "link:../../packages/core",
42 | "@auto-it/package-json-utils": "link:../../packages/package-json-utils",
43 | "await-to-js": "^3.0.0",
44 | "endent": "^2.1.0",
45 | "env-ci": "^5.0.1",
46 | "fp-ts": "^2.5.3",
47 | "get-monorepo-packages": "^1.1.0",
48 | "io-ts": "^2.1.2",
49 | "registry-url": "^5.1.0",
50 | "semver": "^7.0.0",
51 | "tslib": "2.1.0",
52 | "typescript-memoize": "^1.0.0-alpha.3",
53 | "url-join": "^4.0.0",
54 | "user-home": "^2.0.0"
55 | },
56 | "devDependencies": {
57 | "@octokit/rest": "^18.12.0",
58 | "@types/env-ci": "^3.1.0",
59 | "@types/semver": "^7.1.0",
60 | "@types/url-join": "^4.0.0",
61 | "@types/user-home": "^2.0.0"
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/plugins/npm/src/utils.ts:
--------------------------------------------------------------------------------
1 | import * as fs from "fs";
2 | import { promisify } from "util";
3 |
4 | export const readFile = promisify(fs.readFile);
5 | export const writeFile = promisify(fs.writeFile);
6 |
7 | /** Check if the project is a monorepo */
8 | export const isMonorepo = () => fs.existsSync("lerna.json");
9 |
10 | /** Parse the lerna.json file. */
11 | export const getLernaJson = () => {
12 | try {
13 | return JSON.parse(fs.readFileSync("lerna.json", "utf8"));
14 | } catch (error) {
15 | return {};
16 | }
17 | };
18 |
--------------------------------------------------------------------------------
/plugins/npm/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | },
15 | {
16 | "path": "../../packages/package-json-utils"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/plugins/omit-commits/README.md:
--------------------------------------------------------------------------------
1 | # Omit Commits Plugin
2 |
3 | Filter certain commits out of the changelog and version calculation.
4 |
5 | ## Installation
6 |
7 | This plugin is not included with the `auto` CLI installed via NPM. To install:
8 |
9 | ```bash
10 | npm i --save-dev @auto-it/omit-commits
11 | # or
12 | yarn add -D @auto-it/omit-commits
13 | ```
14 |
15 | ## Usage
16 |
17 | Yarn can omit by most any field available on a commit. Each options accepts either a string or an array of strings.
18 |
19 | ```json
20 | {
21 | "plugins": [
22 | [
23 | "omit-commits",
24 | {
25 | // By usernames
26 | "username": ["pdbf", "ghost"],
27 | // By name
28 | "name": "Adam",
29 | // By emails
30 | "email": ["foo@gmail.com", "doesnt-exits@yahoo.com"],
31 | // By presence of string in subject
32 | "subject": ["WIP", "SPIKE"],
33 | // By labels
34 | "labels": "grunt-work"
35 | }
36 | ]
37 | ]
38 | }
39 | ```
40 |
--------------------------------------------------------------------------------
/plugins/omit-commits/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/omit-commits",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Omit commits plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "filter",
32 | "omit"
33 | ],
34 | "scripts": {
35 | "build": "tsc -b",
36 | "start": "npm run build -- -w",
37 | "lint": "eslint src --ext .ts",
38 | "test": "jest --maxWorkers=2 --config ../../package.json"
39 | },
40 | "dependencies": {
41 | "@auto-it/core": "link:../../packages/core",
42 | "fp-ts": "^2.5.3",
43 | "io-ts": "^2.1.2",
44 | "tslib": "2.1.0"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/plugins/omit-commits/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/omit-release-notes/README.md:
--------------------------------------------------------------------------------
1 | # Omit Release Notes Plugin
2 |
3 | Filter PRs with release notes that shouldn't make it into a release. By default `auto` will not include and `Release Notes` from [renovate](https://renovatebot.com/) PRs. This plugin allows you to omit more PRs from effecting you releases.
4 |
5 | ## Installation
6 |
7 | This plugin is not included with the `auto` CLI installed via NPM. To install:
8 |
9 | ```bash
10 | npm i --save-dev @auto-it/omit-release-notes
11 | # or
12 | yarn add -D @auto-it/omit-release-notes
13 | ```
14 |
15 | ## Usage
16 |
17 | Yarn can omit by most any field available on a PR. Each options accepts either a string or an array of strings.
18 |
19 | ```json
20 | {
21 | "plugins": [
22 | [
23 | "omit-release-notes",
24 | {
25 | // By usernames
26 | "username": ["pdbf", "ghost"],
27 | // By name
28 | "name": "Adam",
29 | // By emails
30 | "email": ["foo@gmail.com", "doesnt-exits@yahoo.com"],
31 | // By labels
32 | "labels": "grunt-work"
33 | }
34 | ]
35 | ]
36 | }
37 | ```
38 |
--------------------------------------------------------------------------------
/plugins/omit-release-notes/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/omit-release-notes",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Omit release notes plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "filter",
32 | "omit"
33 | ],
34 | "scripts": {
35 | "build": "tsc -b",
36 | "start": "npm run build -- -w",
37 | "lint": "eslint src --ext .ts",
38 | "test": "jest --maxWorkers=2 --config ../../package.json"
39 | },
40 | "dependencies": {
41 | "@auto-it/core": "link:../../packages/core",
42 | "fp-ts": "^2.5.3",
43 | "io-ts": "^2.1.2",
44 | "tslib": "2.1.0"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/plugins/omit-release-notes/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/pr-body-labels/README.md:
--------------------------------------------------------------------------------
1 | # Pr-Body-Labels Plugin
2 |
3 | Allow outside contributors to indicate what semver label should be applied to the Pull Request.
4 | If you run `auto pr-check` from your CI this plugin will look at the PR body to find what label to apply.
5 |
6 | ## Installation
7 |
8 | This plugin is not included with the `auto` CLI installed via NPM. To install:
9 |
10 | ```bash
11 | npm i --save-dev @auto-it/pr-body-labels
12 | # or
13 | yarn add -D @auto-it/pr-body-labels
14 | ```
15 |
16 | ## Usage
17 |
18 | ```json
19 | {
20 | "plugins": [
21 | ["pr-body-labels"]
22 | // other plugins
23 | ]
24 | }
25 | ```
26 |
27 | Then something like the following to your `.github/PULL_REQUEST_TEMPLATE.md`.
28 | The only part of this that really matters is a markdown checkbox + one of your labels.
29 | You control what labels an outside contributor can apply through the PR body.
30 | This example only exposes the semantic versioning labels but you can include any label in your project.
31 |
32 | ```md
33 | ## Change Type
34 |
35 | Indicate the type of change your pull request is:
36 |
37 | - [ ] `patch`
38 | - [ ] `minor`
39 | - [ ] `major`
40 | ```
41 |
42 | ## Options
43 |
44 | ### `disabledLabels`
45 |
46 | Labels the user cannot apply through the PR.
47 |
48 | ```json
49 | {
50 | "plugins": [["pr-body-labels", { "disabledLabels": ["release"] }]]
51 | }
52 | ```
53 |
54 | ### `removeStaleLabels`
55 |
56 | When using the plugin it will use the checklist in your PR body as the source of truth. This means that manually added label that are present in the pr-body will be removed when `pr-check` runs again. To disable this behavior use the `removeStaleLabels` option.
57 |
58 | ```json
59 | {
60 | "plugins": [["pr-body-labels", { "removeStaleLabels": false }]]
61 | }
62 | ```
63 |
--------------------------------------------------------------------------------
/plugins/pr-body-labels/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/pr-body-labels",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Allow outside contributors to indicate what semver label should be applied to the Pull Request",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "fp-ts": "^2.5.3",
41 | "io-ts": "^2.1.2",
42 | "tslib": "2.1.0"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/plugins/pr-body-labels/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/protected-branch/doc/branch-protection-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/plugins/protected-branch/doc/branch-protection-1.png
--------------------------------------------------------------------------------
/plugins/protected-branch/doc/branch-protection-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/plugins/protected-branch/doc/branch-protection-2.png
--------------------------------------------------------------------------------
/plugins/protected-branch/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/protected-branch",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Handle Github branch protections",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "@octokit/rest": "^18.12.0",
41 | "fp-ts": "^2.5.3",
42 | "io-ts": "^2.1.2",
43 | "tslib": "1.10.0"
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/plugins/protected-branch/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/released/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/released",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Released plugin for auto. Comments with version + extra",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "released",
32 | "comment"
33 | ],
34 | "scripts": {
35 | "build": "tsc -b",
36 | "start": "npm run build -- -w",
37 | "lint": "eslint src --ext .ts",
38 | "test": "jest --maxWorkers=2 --config ../../package.json"
39 | },
40 | "dependencies": {
41 | "@auto-it/bot-list": "link:../../packages/bot-list",
42 | "@auto-it/core": "link:../../packages/core",
43 | "deepmerge": "^4.0.0",
44 | "fp-ts": "^2.5.3",
45 | "io-ts": "^2.1.2",
46 | "tslib": "2.1.0"
47 | },
48 | "devDependencies": {
49 | "@octokit/rest": "^18.12.0"
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/plugins/released/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/s3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/s3",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Post your built artifacts to s3",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "aws-cli-js": "^2.0.6",
41 | "fp-ts": "^2.5.3",
42 | "io-ts": "^2.1.2",
43 | "tslib": "^2.0.0"
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/plugins/s3/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/sbt/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/sbt",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Publish Scala projects with sbt",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Alexey Alekhin",
9 | "email": "laughedelic@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "scala",
32 | "sbt"
33 | ],
34 | "scripts": {
35 | "build": "tsc -b",
36 | "start": "npm run build -- -w",
37 | "lint": "eslint src --ext .ts",
38 | "test": "jest --maxWorkers=2 --config ../../package.json"
39 | },
40 | "dependencies": {
41 | "@auto-it/core": "link:../../packages/core",
42 | "fp-ts": "^2.5.3",
43 | "io-ts": "^2.1.2",
44 | "semver": "^7.0.0",
45 | "strip-ansi": "^7.0.1",
46 | "tslib": "1.10.0"
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/plugins/sbt/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/slack/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/slack",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Slack plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "slack"
32 | ],
33 | "scripts": {
34 | "build": "tsc -b",
35 | "start": "npm run build -- -w",
36 | "lint": "eslint src --ext .ts",
37 | "test": "jest --maxWorkers=2 --config ../../package.json"
38 | },
39 | "dependencies": {
40 | "@atomist/slack-messages": "^1.2.2",
41 | "@auto-it/core": "link:../../packages/core",
42 | "@octokit/rest": "^18.12.0",
43 | "fp-ts": "^2.5.3",
44 | "https-proxy-agent": "^5.0.0",
45 | "io-ts": "^2.1.2",
46 | "node-fetch": "2.6.7",
47 | "tslib": "2.1.0"
48 | },
49 | "devDependencies": {
50 | "@types/node-fetch": "2.6.1",
51 | "@types/url-join": "^4.0.0"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/plugins/slack/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/twitter/README.md:
--------------------------------------------------------------------------------
1 | # Twitter Plugin
2 |
3 | Post tweets after a release is made.
4 |
5 | ## Prerequisites
6 |
7 | To post tweets to twitter you need the following secrets set in your environment:
8 |
9 | - `TWITTER_ACCESS_TOKEN`
10 | - `TWITTER_ACCESS_TOKEN_SECRET`
11 | - `TWITTER_CONSUMER_KEY`
12 | - `TWITTER_CONSUMER_KEY_SECRET`
13 |
14 | ## Installation
15 |
16 | This plugin is not included with the `auto` CLI installed via NPM. To install:
17 |
18 | ```bash
19 | npm i --save-dev @auto-it/twitter
20 | # or
21 | yarn add -D @auto-it/twitter
22 | ```
23 |
24 | ## Usage
25 |
26 | Simply supply the names of the account to filter
27 |
28 | ```json
29 | {
30 | "plugins": [
31 | [
32 | "twitter",
33 | {
34 | /* options */
35 | }
36 | ]
37 | ]
38 | }
39 | ```
40 |
41 | ## Options
42 |
43 | ### Message
44 |
45 | You can configure the message posted to twitter. The `message` option should use the following special tokens to create a tweet.
46 |
47 | - `%release` - The version bump (major, minor, patch)
48 | - `%package` - The name of the package
49 | - `%notes` - Your release notes truncated to fit in the tweet
50 | - `%link` - A link to your the release on GitHub
51 | - `%version` - The latest version number
52 |
53 | Default:
54 |
55 | ```txt
56 | A new %release version of %package was released!
57 |
58 | %notes
59 |
60 | %link
61 | ```
62 |
63 | ```json
64 | {
65 | "plugins": [
66 | ["twitter", { "message": "v%version of %package was released!\n\n%link" }]
67 | ]
68 | }
69 | ```
70 |
71 | ### Threshold
72 |
73 | By default the `twitter` plugin will only tweet if the version difference between the latest and the last release is greater than a `minor`.
74 |
75 | ```json
76 | {
77 | "plugins": [["twitter", { "threshold": "major" }]]
78 | }
79 | ```
80 |
--------------------------------------------------------------------------------
/plugins/twitter/__tests__/__snapshots__/twitter.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Twitter Plugin should be able to configure message 1`] = `
4 | "v1.1.0 of Test-Repo was released!
5 |
6 | https://foo.com"
7 | `;
8 |
9 | exports[`Twitter Plugin should handle long release notes 1`] = `
10 | "A new minor version of Test-Repo was released!
11 |
12 | 🐛 Bug Fix
13 |
14 | - fix jira PR titles without additional subject
15 | - split off useless hash from version
16 |
17 | 📝 Documentation
18 |
19 | - update docs for canary
20 |
21 | 🔩 Dependency Updates
22 | …
23 |
24 | https://foo.com"
25 | `;
26 |
27 | exports[`Twitter Plugin should post correct message 1`] = `
28 | "A new minor version of Test-Repo was released!
29 |
30 | 🐛 Bug Fix
31 |
32 | - fix jira PR titles without additional subject
33 |
34 | 📝 Documentation
35 |
36 | - update docs for canary
37 |
38 | https://foo.com"
39 | `;
40 |
--------------------------------------------------------------------------------
/plugins/twitter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/twitter",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Twitter plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "tweet",
32 | "twitter"
33 | ],
34 | "scripts": {
35 | "build": "tsc -b",
36 | "start": "npm run build -- -w",
37 | "lint": "eslint src --ext .ts",
38 | "test": "jest --maxWorkers=2 --config ../../package.json"
39 | },
40 | "dependencies": {
41 | "@auto-it/core": "link:../../packages/core",
42 | "@types/twitter-text": "^3.1.0",
43 | "endent": "^2.1.0",
44 | "fp-ts": "^2.5.3",
45 | "io-ts": "^2.1.2",
46 | "semver": "^7.0.0",
47 | "tslib": "2.1.0",
48 | "tweet-tweet": "^1.0.4",
49 | "twitter-text": "^3.0.0"
50 | },
51 | "devDependencies": {
52 | "@types/semver": "^7.1.0"
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/plugins/twitter/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/upload-assets/README.md:
--------------------------------------------------------------------------------
1 | # Upload Assets Plugin
2 |
3 | Upload assets to the release.
4 | Good for executables and extra downloadable files.
5 | Also supports canaries!
6 |
7 | > NOTE: For canaries to work this plugin must be listed before any other publishing plugin.
8 |
9 | ## Installation
10 |
11 | This plugin is not included with the `auto` CLI installed via NPM. To install:
12 |
13 | ```bash
14 | npm i --save-dev @auto-it/upload-assets
15 | # or
16 | yarn add -D @auto-it/upload-assets
17 | ```
18 |
19 | ## Usage
20 |
21 | Simply supply the paths to the assets to add to the release.
22 |
23 | ```json
24 | {
25 | "plugins": [
26 | ["upload-assets", { "assets": ["./path/to/file"] }],
27 | // or
28 | ["upload-assets", ["./path/to/file"]],
29 | // or use globs to upload multiple things
30 | ["upload-assets", ["./path/**/to/*.file"]]
31 | ]
32 | }
33 | ```
34 |
35 | ## Options
36 |
37 | ### `maxCanaryAssets`
38 |
39 | Max number of assets to keep in the canary release.
40 |
41 | ```json
42 | {
43 | "plugins": [
44 | [
45 | "upload-assets",
46 | {
47 | "assets": ["./path/to/file"],
48 | "maxAssets": 100
49 | }
50 | ]
51 | ]
52 | }
53 | ```
54 |
--------------------------------------------------------------------------------
/plugins/upload-assets/__tests__/test-assets/test-2.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/plugins/upload-assets/__tests__/test-assets/test-2.txt
--------------------------------------------------------------------------------
/plugins/upload-assets/__tests__/test-assets/test.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/plugins/upload-assets/__tests__/test-assets/test.txt
--------------------------------------------------------------------------------
/plugins/upload-assets/__tests__/upload-assets-ci.test.ts:
--------------------------------------------------------------------------------
1 | import envCi from "env-ci";
2 |
3 | jest.mock("env-ci");
4 |
5 | const envSpy = envCi as jest.Mock;
6 | envSpy.mockImplementation(() => ({
7 | isCi: true,
8 | pr: 123,
9 | }));
10 |
11 | import Auto, { SEMVER } from "@auto-it/core";
12 | import { makeHooks } from "@auto-it/core/dist/utils/make-hooks";
13 | import path from "path";
14 |
15 | import { dummyLog } from "@auto-it/core/dist/utils/logger";
16 | import UploadAssets from "../src";
17 | import endent from "endent";
18 |
19 | const options = {
20 | owner: "test",
21 | repo: "repo",
22 | };
23 |
24 | jest.spyOn(console, "log").mockImplementation();
25 |
26 | describe("Upload Assets Plugin", () => {
27 | test("should add to pr body for pull requests", async () => {
28 | const plugin = new UploadAssets([
29 | path.join(__dirname, "./test-assets/macos"),
30 | ]);
31 | const hooks = makeHooks();
32 | const uploadReleaseAsset = jest.fn().mockImplementation(({ name }) =>
33 | Promise.resolve({
34 | data: { id: 2, name, browser_download_url: `http://${name}` },
35 | })
36 | );
37 | const createRelease = jest.fn().mockResolvedValue({ data: { id: 1 } });
38 | const addToPrBody = jest.fn();
39 |
40 | plugin.apply(({
41 | hooks,
42 | logger: dummyLog(),
43 | prefixRelease: (v) => v,
44 | git: {
45 | options,
46 | getFirstCommit: () => "abc",
47 | addToPrBody,
48 | github: {
49 | repos: { uploadReleaseAsset, createRelease },
50 | paginate: jest.fn().mockResolvedValue([]),
51 | },
52 | },
53 | } as unknown) as Auto);
54 |
55 | await hooks.canary.promise({
56 | canaryIdentifier: "canary.123",
57 | bump: SEMVER.patch,
58 | });
59 |
60 | expect(addToPrBody).toHaveBeenCalledWith(
61 | endent`
62 | :baby_chick: Download canary assets:
63 |
64 | [macos-canary.123](http://macos-canary.123)
65 | `,
66 | 123,
67 | "canary-assets"
68 | );
69 | });
70 | });
71 |
--------------------------------------------------------------------------------
/plugins/upload-assets/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/upload-assets",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Upload assets plugin for auto",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog",
31 | "upload",
32 | "assets"
33 | ],
34 | "scripts": {
35 | "build": "tsc -b",
36 | "start": "npm run build -- -w",
37 | "lint": "eslint src --ext .ts",
38 | "test": "jest --maxWorkers=2 --config ../../package.json"
39 | },
40 | "dependencies": {
41 | "@auto-it/core": "link:../../packages/core",
42 | "endent": "^2.1.0",
43 | "fast-glob": "^3.1.1",
44 | "file-type": "^16.0.0",
45 | "fp-ts": "^2.5.3",
46 | "io-ts": "^2.1.2",
47 | "terminal-link": "^2.1.1",
48 | "tslib": "2.1.0"
49 | },
50 | "devDependencies": {
51 | "@octokit/rest": "^18.12.0"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/plugins/upload-assets/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/version-file/README.md:
--------------------------------------------------------------------------------
1 | # Version File Plugin
2 |
3 | For managing versions in a repository that maintains the version primarily in a flat file.
4 | Agnostic to the primary language of the repository.
5 | Optional input for a release script to call during the publish/canary/next hooks.
6 |
7 | ## Installation
8 |
9 | This plugin is included with the `auto` CLI so you do not have to install it. To install if you are using the `auto` API directly:
10 |
11 | ```bash
12 | npm i --save-dev @auto-it/version-file
13 | # or
14 | yarn add -D @auto-it/version-file
15 | ```
16 |
17 | ## Options
18 |
19 | - versionFile (optional, default="VERSION"): Path to where the version is stored in the repository. It should be a file containing just the semver.
20 | - publishScript: (optional, default=None): Path to script that runs the publish actions in your repository. If not supplied nothing will be called. If supplied will be called during the `publish`,`canary` and `next` hooks with the arguments defined in `publishScriptReleaseTypeArgs` for that release type.
21 | - publishScriptReleaseTypeArgs: (optional, default=```{
22 | "publish": ["release"],
23 | "canary": ["snapshot"],
24 | "next": ["snapshot"]
25 | }```): Mapping of arguments to pass to the `publishScript` for each release type (`publish`, `canary`, `next`)
26 |
27 | ## Usage
28 |
29 | ### With default options
30 | ```json
31 | {
32 | "plugins": [
33 | "version-file"
34 | // other plugins
35 | ]
36 | }
37 | ```
38 | ### With optional arguments
39 | ```json
40 | {
41 | "plugins": [
42 | "version-file", {"versionFile": "./tools/Version.txt", "publishScript":"./tools/publish.sh", "publishScriptReleaseTypeArgs": {
43 | "publish": ["release"], // (default)
44 | "canary": ["snapshot"],
45 | "next": ["some", "other", "args"],
46 | }}
47 | ]
48 | }
49 |
--------------------------------------------------------------------------------
/plugins/version-file/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/version-file",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Ketan Reddy",
9 | "email": "ketan@ketanreddy.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "fp-ts": "^2.5.3",
41 | "io-ts": "^2.1.2",
42 | "semver": "^7.0.0",
43 | "tslib": "1.10.0"
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/plugins/version-file/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/vscode/README.md:
--------------------------------------------------------------------------------
1 | # Vscode Plugin
2 |
3 | Publish a vscode extension.
4 |
5 | ## Installation
6 |
7 | This plugin is not included with the `auto` CLI installed via NPM. To install:
8 |
9 | ```bash
10 | npm i --save-dev @auto-it/vscode
11 | # or
12 | yarn add -D @auto-it/vscode
13 | ```
14 |
15 | ## Usage
16 |
17 | ```json
18 | {
19 | "plugins": [
20 | "vscode"
21 | // other plugins
22 | ]
23 | }
24 | ```
25 |
26 | ## Setup
27 |
28 | 1. [Create an organization for your extension](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/create-organization?view=azure-devops)
29 | 2. [Create a personal access token](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#get-a-personal-access-token) and store the token in your `.env` file as `VSCE_TOKEN` and add the same variable to your CI
30 | 3. [Create a publisher for your extension](https://aka.ms/vscode-create-publisher) and set the `publisher` in your `package.json`
31 |
32 | That's it!
33 |
34 | [Learn more about creating a great looking extension.](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#marketplace-integration)
35 |
36 | ## Options
37 |
38 | ### baseContentUrl
39 |
40 | Prepend all relative links in README.md with this url.
41 |
42 | ```json
43 | {
44 | "plugins": [
45 | [
46 | "vscode",
47 | { "baseContentUrl": "https://github.com/my-username/my-repo/tree/main" }
48 | ]
49 | // other plugins
50 | ]
51 | }
52 | ```
53 |
54 | ### baseImagesUrl
55 |
56 | Prepend all relative image links in README.md with this url.
57 |
58 | ```json
59 | {
60 | "plugins": [
61 | // other plugins
62 | [
63 | "vscode",
64 | {
65 | "baseContentUrl": "https://raw.githubusercontent.com/my-username/my-repo/main/"
66 | }
67 | ]
68 | ]
69 | }
70 | ```
71 |
--------------------------------------------------------------------------------
/plugins/vscode/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/vscode",
3 | "version": "11.3.0",
4 | "main": "dist/index.js",
5 | "description": "Publish an vscode extension",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "@auto-it/package-json-utils": "link:../../packages/package-json-utils",
41 | "fp-ts": "^2.5.3",
42 | "io-ts": "^2.1.2",
43 | "semver": "^7.0.0",
44 | "tslib": "2.1.0",
45 | "vsce": "^1.83.0"
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/plugins/vscode/src/utils.ts:
--------------------------------------------------------------------------------
1 | import * as fs from "fs";
2 | import path from "path";
3 | import { promisify } from "util";
4 |
5 | export const readFile = promisify(fs.readFile);
6 | export const writeFile = promisify(fs.writeFile);
7 |
8 | /** Load and parse the root package json for the project */
9 | export async function loadPackageJson(root = "./"): Promise {
10 | return JSON.parse(await readFile(path.join(root, "package.json"), "utf-8"));
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/vscode/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/scripts/auto-update-curl-version.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable jsdoc/no-types, @typescript-eslint/no-var-requires */
2 |
3 | const fs = require("fs");
4 | const path = require("path");
5 | const { inc } = require("semver");
6 | const { execSync } = require("child_process");
7 |
8 | const filename = path.join(
9 | __dirname,
10 | "../docs/pages/docs/configuration/non-npm.mdx"
11 | );
12 |
13 | module.exports = class TestPlugin {
14 | /** Initialize */
15 | constructor() {
16 | this.name = "update-curl-version";
17 | }
18 |
19 | /**
20 | * Tap into auto plugin points.
21 | *
22 | * @param {import('@auto-it/core').default} auto - An instance of auto
23 | */
24 | apply(auto) {
25 | auto.hooks.beforeCommitChangelog.tap(this.name, ({ lastRelease, bump }) => {
26 | const nonNpmDocs = fs.readFileSync(filename, { encoding: "utf8" });
27 |
28 | fs.writeFileSync(
29 | filename,
30 | nonNpmDocs.replace(
31 | /(download\/v)(\d+\.\d+\.\d+)(\/auto-linux\.gz)/,
32 | `$1${inc(lastRelease, bump)}$3`
33 | )
34 | );
35 |
36 | // Add the file so that when the changelog is committed this docs update is included
37 | execSync(`git add ${filename}`);
38 | });
39 | }
40 | };
41 |
--------------------------------------------------------------------------------
/scripts/create-package.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const copy = require("copy-template-dir");
4 | const path = require("path");
5 | const log = require("signale");
6 | const fs = require("fs");
7 | const changeCase = require("change-case");
8 | const { titleCase } = require("title-case");
9 | const [, , name, description] = process.argv;
10 |
11 | const { version } = JSON.parse(
12 | fs.readFileSync(path.join(__dirname, "../lerna.json"), "utf8")
13 | );
14 | const inDir = path.join(__dirname, "./template-package");
15 | const kebab = changeCase.paramCase(name);
16 | const outDir = path.join(__dirname, "../packages", kebab);
17 | const TSCONFIG = path.join(__dirname, "../tsconfig.dev.json");
18 |
19 | fs.mkdirSync(outDir);
20 |
21 | const vars = {
22 | description,
23 | version,
24 | title: titleCase(name),
25 | kebab,
26 | pascal: changeCase.pascalCase(name),
27 | };
28 |
29 | copy(inDir, outDir, vars, (err, createdFiles) => {
30 | if (err) {
31 | throw err;
32 | }
33 |
34 | createdFiles.forEach((filePath) =>
35 | log.info(`Created ${path.relative(outDir, filePath)}`)
36 | );
37 | log.success(`Created @auto-it/${kebab} package!`);
38 | });
39 |
40 | fs.readFile(TSCONFIG, "utf8", (err, data) => {
41 | if (err) {
42 | throw err;
43 | }
44 |
45 | const json = JSON.parse(data);
46 |
47 | json.references.push({
48 | path: `packages/${kebab}`,
49 | });
50 |
51 | fs.writeFileSync(TSCONFIG, JSON.stringify(json, null, 2));
52 | log.success(`Updated tsconfig.dev.json!`);
53 | });
54 |
--------------------------------------------------------------------------------
/scripts/create-plugin.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const copy = require("copy-template-dir");
4 | const path = require("path");
5 | const log = require("signale");
6 | const fs = require("fs");
7 | const changeCase = require("change-case");
8 | const { titleCase } = require("title-case");
9 | const [, , name, description] = process.argv;
10 |
11 | const { version } = JSON.parse(
12 | fs.readFileSync(path.join(__dirname, "../lerna.json"), "utf8")
13 | );
14 | const inDir = path.join(__dirname, "./template-plugin");
15 | const kebab = changeCase.paramCase(name);
16 | const outDir = path.join(__dirname, "../plugins", kebab);
17 | const TSCONFIG = path.join(__dirname, "../tsconfig.dev.json");
18 |
19 | fs.mkdirSync(outDir);
20 |
21 | const vars = {
22 | description,
23 | version,
24 | title: titleCase(name),
25 | kebab,
26 | pascal: changeCase.pascalCase(name),
27 | };
28 |
29 | copy(inDir, outDir, vars, (err, createdFiles) => {
30 | if (err) {
31 | throw err;
32 | }
33 |
34 | createdFiles.forEach((filePath) =>
35 | log.info(`Created ${path.relative(outDir, filePath)}`)
36 | );
37 | log.success(`Created @auto-it/${kebab} plugin!`);
38 | });
39 |
40 | fs.readFile(TSCONFIG, "utf8", (err, data) => {
41 | if (err) {
42 | throw err;
43 | }
44 |
45 | const json = JSON.parse(data);
46 |
47 | json.references.push({
48 | path: `plugins/${kebab}`,
49 | });
50 |
51 | fs.writeFileSync(TSCONFIG, JSON.stringify(json, null, 2));
52 | log.success(`Updated tsconfig.dev.json!`);
53 | });
54 |
--------------------------------------------------------------------------------
/scripts/generate-cofingurable-args.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const fs = require("fs");
4 | const path = require("path");
5 | const { camelCase } = require("change-case");
6 | const endent = require("endent").default;
7 | const glob = require("fast-glob");
8 | const docs = require("command-line-docs").default;
9 | const { commands } = require("../packages/cli/dist/parse-args");
10 |
11 | commands.forEach((command) => {
12 | const configOptions = (command.options || []).filter(
13 | (option) => option.config
14 | );
15 |
16 | if (!configOptions.length) {
17 | return;
18 | }
19 |
20 | console.log(endent`
21 | ${command.name} has the following configurable option:
22 |
23 | ${configOptions.map((o) => `- \`${o.name}\``).join("\n")}\n\n\n
24 | `);
25 | console.log();
26 | console.log();
27 | });
28 |
--------------------------------------------------------------------------------
/scripts/jest-setup.js:
--------------------------------------------------------------------------------
1 | require("mock-fs");
2 |
3 | jest.mock('requireg', () => require);
--------------------------------------------------------------------------------
/scripts/template-package/README.md:
--------------------------------------------------------------------------------
1 | # @auto-it/{{kebab}}
2 |
3 | {{description}}
4 |
--------------------------------------------------------------------------------
/scripts/template-package/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/{{kebab}}",
3 | "main": "dist/index.js",
4 | "description": "{{description}}",
5 | "version": "{{version}}",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "engines": {
23 | "node": ">=10.x"
24 | },
25 | "keywords": [
26 | "automation",
27 | "semantic",
28 | "release",
29 | "github",
30 | "labels",
31 | "automated",
32 | "continuos integration",
33 | "changelog",
34 | "cli"
35 | ],
36 | "scripts": {
37 | "build": "tsc -b",
38 | "start": "npm run build -- -w",
39 | "lint": "eslint src --ext .ts",
40 | "test": "jest --maxWorkers=2"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/scripts/template-package/src/index.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intuit/auto/27b93e34871e1fa99e9807d17e0854d6bc22f34d/scripts/template-package/src/index.ts
--------------------------------------------------------------------------------
/scripts/template-package/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/scripts/template-plugin/README.md:
--------------------------------------------------------------------------------
1 | # {{title}} Plugin
2 |
3 | {{description}}
4 |
5 | ## Installation
6 |
7 | This plugin is not included with the `auto` CLI installed via NPM. To install:
8 |
9 | ```bash
10 | npm i --save-dev @auto-it/{{kebab}}
11 | # or
12 | yarn add -D @auto-it/{{kebab}}
13 | ```
14 |
15 | ## Usage
16 |
17 | ```json
18 | {
19 | "plugins": [
20 | "{{kebab}}"
21 | // other plugins
22 | ]
23 | }
24 | ```
25 |
--------------------------------------------------------------------------------
/scripts/template-plugin/__tests__/{{kebab}}.test.ts:
--------------------------------------------------------------------------------
1 | import Auto from '@auto-it/core';
2 | import {{pascal}} from '../src';
3 |
4 | describe('{{title}} Plugin', () => {
5 | test('should do something', async () => {
6 | });
7 | });
8 |
--------------------------------------------------------------------------------
/scripts/template-plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@auto-it/{{kebab}}",
3 | "version": "{{version}}",
4 | "main": "dist/index.js",
5 | "description": "{{description}}",
6 | "license": "MIT",
7 | "author": {
8 | "name": "Andrew Lisowski",
9 | "email": "lisowski54@gmail.com"
10 | },
11 | "publishConfig": {
12 | "registry": "https://registry.npmjs.org/",
13 | "access": "public"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "https://github.com/intuit/auto"
18 | },
19 | "files": [
20 | "dist"
21 | ],
22 | "keywords": [
23 | "automation",
24 | "semantic",
25 | "release",
26 | "github",
27 | "labels",
28 | "automated",
29 | "continuos integration",
30 | "changelog"
31 | ],
32 | "scripts": {
33 | "build": "tsc -b",
34 | "start": "npm run build -- -w",
35 | "lint": "eslint src --ext .ts",
36 | "test": "jest --maxWorkers=2 --config ../../package.json"
37 | },
38 | "dependencies": {
39 | "@auto-it/core": "link:../../packages/core",
40 | "fp-ts": "^2.5.3",
41 | "io-ts": "^2.1.2",
42 | "tslib": "1.10.0"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/scripts/template-plugin/src/index.ts:
--------------------------------------------------------------------------------
1 | import { Auto, IPlugin, validatePluginConfiguration } from '@auto-it/core';
2 | import * as t from "io-ts";
3 |
4 | const pluginOptions = t.partial({
5 | });
6 |
7 | export type I{{pascal}}PluginOptions = t.TypeOf;
8 |
9 | /** {{description}} */
10 | export default class {{pascal}}Plugin implements IPlugin {
11 | /** The name of the plugin */
12 | name = '{{kebab}}';
13 |
14 | /** The options of the plugin */
15 | readonly options: I{{pascal}}PluginOptions;
16 |
17 | /** Initialize the plugin with it's options */
18 | constructor(options: I{{pascal}}PluginOptions) {
19 | this.options = options;
20 | }
21 |
22 | /** Tap into auto plugin points. */
23 | apply(auto: Auto) {
24 | auto.hooks.validateConfig.tapPromise(this.name, async (name, options) => {
25 | // If it's a string thats valid config
26 | if (name === this.name && typeof options !== "string") {
27 | return validatePluginConfiguration(this.name, pluginOptions, options);
28 | }
29 | });
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/scripts/template-plugin/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": ["src/**/*", "../../typings/**/*"],
4 |
5 | "compilerOptions": {
6 | "outDir": "./dist",
7 | "rootDir": "./src",
8 | "composite": true
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "../../packages/core"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/tsconfig.dev.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": [],
3 | "include": [],
4 | "references": [
5 | {
6 | "path": "packages/cli"
7 | },
8 | {
9 | "path": "plugins/chrome"
10 | },
11 | {
12 | "path": "plugins/crates"
13 | },
14 | {
15 | "path": "plugins/conventional-commits"
16 | },
17 | {
18 | "path": "plugins/first-time-contributor"
19 | },
20 | {
21 | "path": "plugins/git-tag"
22 | },
23 | {
24 | "path": "plugins/jira"
25 | },
26 | {
27 | "path": "plugins/gradle"
28 | },
29 | {
30 | "path": "plugins/maven"
31 | },
32 | {
33 | "path": "plugins/npm"
34 | },
35 | {
36 | "path": "plugins/omit-commits"
37 | },
38 | {
39 | "path": "plugins/omit-release-notes"
40 | },
41 | {
42 | "path": "plugins/released"
43 | },
44 | {
45 | "path": "plugins/slack"
46 | },
47 | {
48 | "path": "plugins/twitter"
49 | },
50 | {
51 | "path": "plugins/upload-assets"
52 | },
53 | {
54 | "path": "plugins/all-contributors"
55 | },
56 | {
57 | "path": "plugins/gh-pages"
58 | },
59 | {
60 | "path": "plugins/exec"
61 | },
62 | {
63 | "path": "plugins/cocoapods"
64 | },
65 | {
66 | "path": "plugins/brew"
67 | },
68 | {
69 | "path": "plugins/gem"
70 | },
71 | {
72 | "path": "plugins/docker"
73 | },
74 | {
75 | "path": "plugins/pr-body-labels"
76 | },
77 | {
78 | "path": "plugins/microsoft-teams"
79 | },
80 | {
81 | "path": "plugins/vscode"
82 | },
83 | {
84 | "path": "packages/package-json-utils"
85 | },
86 | {
87 | "path": "plugins/magic-zero"
88 | },
89 | {
90 | "path": "plugins/s3"
91 | },
92 | {
93 | "path": "plugins/sbt"
94 | },
95 | {
96 | "path": "plugins/version-file"
97 | },
98 | {
99 | "path": "plugins/protected-branch"
100 | }
101 | ]
102 | }
103 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs", // Resolve modules the node way
4 | "lib": ["dom", "es2017"], // Use newest ecma script features
5 | /* Outputs: */
6 | "sourceMap": true,
7 | "declaration": true,
8 | "declarationMap": true,
9 | "target": "es2017", // Target Node 10.x
10 | "importHelpers": true, // Use tslib for helper code
11 | /* Syntax: */
12 | "strict": true,
13 | "downlevelIteration": true,
14 | "resolveJsonModule": true,
15 | "allowSyntheticDefaultImports": true,
16 | "esModuleInterop": true,
17 | "experimentalDecorators": true,
18 | "noUnusedLocals": true
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/typings/all-contributors.d.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-explicit-any */
2 |
3 | declare module "all-contributors-cli/dist/contributors" {
4 | function addContributor(
5 | config: any,
6 | username: string,
7 | newContributions: string
8 | ): Promise<{
9 | /** The updated contributors */
10 | contributors: any;
11 | }>;
12 |
13 | export = addContributor;
14 | }
15 |
16 | declare module "all-contributors-cli/dist/generate" {
17 | function generateReadme(
18 | config: any,
19 | contributors: any,
20 | readMe: string
21 | ): Promise;
22 |
23 | export = generateReadme;
24 | }
25 |
--------------------------------------------------------------------------------
/typings/dot-properties.d.ts:
--------------------------------------------------------------------------------
1 | declare module "dot-properties" {
2 | export function parse(file: string): { version?: string };
3 | }
4 |
--------------------------------------------------------------------------------
/typings/endent.d.ts:
--------------------------------------------------------------------------------
1 | declare module "endent" {
2 | function endent(literals: string): string;
3 | function endent(
4 | literals: TemplateStringsArray,
5 | ...placeholders: any[]
6 | ): string;
7 |
8 | export = endent;
9 | }
10 |
--------------------------------------------------------------------------------
/typings/fromentries.d.ts:
--------------------------------------------------------------------------------
1 | declare module "fromentries" {
2 | export default function fromEntries(
3 | entries: Iterable
4 | ): { [k in PropertyKey]: T };
5 | }
6 |
--------------------------------------------------------------------------------
/typings/import-cwd.d.ts:
--------------------------------------------------------------------------------
1 | declare module "import-cwd" {
2 | function importCwd(path: string): any;
3 | export = importCwd;
4 | }
5 |
--------------------------------------------------------------------------------
/typings/module-alias.d.ts:
--------------------------------------------------------------------------------
1 | declare module "module-alias";
2 |
--------------------------------------------------------------------------------
/typings/node-pom-parser.d.ts:
--------------------------------------------------------------------------------
1 | declare module "pom-parser" {
2 | interface IDeveloper {
3 | name: string;
4 | email: string;
5 | }
6 |
7 | interface IScm {
8 | connection: string;
9 | url: string;
10 | tag: string;
11 | }
12 |
13 | export interface IPom {
14 | pomXml: string;
15 | pomObject: {
16 | project: {
17 | version?: string;
18 | scm: IScm | IScm[];
19 | developers?: {
20 | developer?: IDeveloper | IDeveloper[];
21 | };
22 | };
23 | };
24 | }
25 |
26 | export function parse(
27 | options: { filePath: string },
28 | cb: (err: Error, pom: IPom) => void
29 | ): void;
30 | }
31 |
--------------------------------------------------------------------------------
/typings/parse-author.d.ts:
--------------------------------------------------------------------------------
1 | declare module "parse-author" {
2 | function parseAuthor(author: string): IAuthor;
3 | export = parseAuthor;
4 | }
5 |
--------------------------------------------------------------------------------
/typings/requireg.d.ts:
--------------------------------------------------------------------------------
1 | declare module "requireg" {
2 | function requireg(path: string, onlyGlobal?: boolean): void;
3 |
4 | export default requireg;
5 | }
6 |
--------------------------------------------------------------------------------
/typings/tweet-tweet.d.ts:
--------------------------------------------------------------------------------
1 | declare module "tweet-tweet" {
2 | interface IOptions {
3 | consumerKey: string;
4 | consumerSecret: string;
5 | accessToken: string;
6 | accessTokenSecret: string;
7 | }
8 |
9 | function postTweet(
10 | tweet: string,
11 | cb: (err: Error, response: any) => void
12 | ): void;
13 |
14 | function twitter(options: IOptions): typeof postTweet;
15 |
16 | export default twitter;
17 | }
18 |
--------------------------------------------------------------------------------