Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write auto configuration in TypeScript #1875

Merged
merged 2 commits into from
Mar 13, 2021
Merged

Conversation

hipstersmoothie
Copy link
Collaborator

@hipstersmoothie hipstersmoothie commented Mar 13, 2021

Release notes

You can now author you auto configuration in TypeScript 🎉

This makes it a bit easier to validate your configuration as you write it. All of the options come with jsDoc so you can get documentation super easy.

You can even pull in the options types for plugins!

import { AutoRc } from "auto";

import { INpmConfig } from "@auto-it/core";
import { IAllContributorsPluginOptions } from "@auto-it/all-contributors";

const npmOptions: INpmConfig = {
  exact: true,
  canaryScope: "@auto-canary",
};

const allContributorsOptions: IAllContributorsPluginOptions = {
  types: {
    plugin: "**/plugin/**/*",
    code: ["**/src/**/*", "**/package.json", "**/tsconfig.json"],
  },
};

/** Auto configuration */
export default function rc(): AutoRc {
  return {
    plugins: [
      "released",
      ["npm", npmOptions],
      ["all-contributors", allContributorsOptions],
    ],
    labels: [
      {
        name: "blog-post",
        changelogTitle: "📚 Blog Post",
        releaseType: "none",
      },
    ],
  };
}

Why

The more validation of configuration the better!

Todo:

  • Add docs

Change Type

Indicate the type of change your pull request is:

  • documentation
  • patch
  • minor
  • major

🐤 Download canary assets:

auto-linux--canary.1875.23019.gz
auto-macos--canary.1875.23019.gz
auto-win.exe--canary.1875.23019.gz

📦 Published PR as canary version: under canary scope @auto-canary@10.20.0--canary.1875.23019.0

✨ Test out this PR locally via:

npm install @auto-canary/bot-list@10.20.0--canary.1875.23019.0
npm install @auto-canary/auto@10.20.0--canary.1875.23019.0
npm install @auto-canary/core@10.20.0--canary.1875.23019.0
npm install @auto-canary/package-json-utils@10.20.0--canary.1875.23019.0
npm install @auto-canary/all-contributors@10.20.0--canary.1875.23019.0
npm install @auto-canary/brew@10.20.0--canary.1875.23019.0
npm install @auto-canary/chrome@10.20.0--canary.1875.23019.0
npm install @auto-canary/cocoapods@10.20.0--canary.1875.23019.0
npm install @auto-canary/conventional-commits@10.20.0--canary.1875.23019.0
npm install @auto-canary/crates@10.20.0--canary.1875.23019.0
npm install @auto-canary/docker@10.20.0--canary.1875.23019.0
npm install @auto-canary/exec@10.20.0--canary.1875.23019.0
npm install @auto-canary/first-time-contributor@10.20.0--canary.1875.23019.0
npm install @auto-canary/gem@10.20.0--canary.1875.23019.0
npm install @auto-canary/gh-pages@10.20.0--canary.1875.23019.0
npm install @auto-canary/git-tag@10.20.0--canary.1875.23019.0
npm install @auto-canary/gradle@10.20.0--canary.1875.23019.0
npm install @auto-canary/jira@10.20.0--canary.1875.23019.0
npm install @auto-canary/magic-zero@10.20.0--canary.1875.23019.0
npm install @auto-canary/maven@10.20.0--canary.1875.23019.0
npm install @auto-canary/microsoft-teams@10.20.0--canary.1875.23019.0
npm install @auto-canary/npm@10.20.0--canary.1875.23019.0
npm install @auto-canary/omit-commits@10.20.0--canary.1875.23019.0
npm install @auto-canary/omit-release-notes@10.20.0--canary.1875.23019.0
npm install @auto-canary/pr-body-labels@10.20.0--canary.1875.23019.0
npm install @auto-canary/released@10.20.0--canary.1875.23019.0
npm install @auto-canary/s3@10.20.0--canary.1875.23019.0
npm install @auto-canary/slack@10.20.0--canary.1875.23019.0
npm install @auto-canary/twitter@10.20.0--canary.1875.23019.0
npm install @auto-canary/upload-assets@10.20.0--canary.1875.23019.0
npm install @auto-canary/vscode@10.20.0--canary.1875.23019.0
# or 
yarn add @auto-canary/bot-list@10.20.0--canary.1875.23019.0
yarn add @auto-canary/auto@10.20.0--canary.1875.23019.0
yarn add @auto-canary/core@10.20.0--canary.1875.23019.0
yarn add @auto-canary/package-json-utils@10.20.0--canary.1875.23019.0
yarn add @auto-canary/all-contributors@10.20.0--canary.1875.23019.0
yarn add @auto-canary/brew@10.20.0--canary.1875.23019.0
yarn add @auto-canary/chrome@10.20.0--canary.1875.23019.0
yarn add @auto-canary/cocoapods@10.20.0--canary.1875.23019.0
yarn add @auto-canary/conventional-commits@10.20.0--canary.1875.23019.0
yarn add @auto-canary/crates@10.20.0--canary.1875.23019.0
yarn add @auto-canary/docker@10.20.0--canary.1875.23019.0
yarn add @auto-canary/exec@10.20.0--canary.1875.23019.0
yarn add @auto-canary/first-time-contributor@10.20.0--canary.1875.23019.0
yarn add @auto-canary/gem@10.20.0--canary.1875.23019.0
yarn add @auto-canary/gh-pages@10.20.0--canary.1875.23019.0
yarn add @auto-canary/git-tag@10.20.0--canary.1875.23019.0
yarn add @auto-canary/gradle@10.20.0--canary.1875.23019.0
yarn add @auto-canary/jira@10.20.0--canary.1875.23019.0
yarn add @auto-canary/magic-zero@10.20.0--canary.1875.23019.0
yarn add @auto-canary/maven@10.20.0--canary.1875.23019.0
yarn add @auto-canary/microsoft-teams@10.20.0--canary.1875.23019.0
yarn add @auto-canary/npm@10.20.0--canary.1875.23019.0
yarn add @auto-canary/omit-commits@10.20.0--canary.1875.23019.0
yarn add @auto-canary/omit-release-notes@10.20.0--canary.1875.23019.0
yarn add @auto-canary/pr-body-labels@10.20.0--canary.1875.23019.0
yarn add @auto-canary/released@10.20.0--canary.1875.23019.0
yarn add @auto-canary/s3@10.20.0--canary.1875.23019.0
yarn add @auto-canary/slack@10.20.0--canary.1875.23019.0
yarn add @auto-canary/twitter@10.20.0--canary.1875.23019.0
yarn add @auto-canary/upload-assets@10.20.0--canary.1875.23019.0
yarn add @auto-canary/vscode@10.20.0--canary.1875.23019.0

@adierkens adierkens added the minor Increment the minor version when merged label Mar 13, 2021
@codecov
Copy link

codecov bot commented Mar 13, 2021

Codecov Report

Merging #1875 (47ea37f) into main (06b5722) will increase coverage by 0.00%.
The diff coverage is 87.50%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1875   +/-   ##
=======================================
  Coverage   80.18%   80.18%           
=======================================
  Files          64       65    +1     
  Lines        5157     5163    +6     
  Branches     1207     1208    +1     
=======================================
+ Hits         4135     4140    +5     
- Misses        687      688    +1     
  Partials      335      335           
Impacted Files Coverage Δ
packages/cli/src/index.ts 0.00% <0.00%> (ø)
packages/core/src/auto.ts 77.88% <100.00%> (+0.02%) ⬆️
packages/core/src/config.ts 91.39% <100.00%> (+0.38%) ⬆️
packages/core/src/types.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86e294f...47ea37f. Read the comment docs.

@hipstersmoothie hipstersmoothie merged commit e23a9f2 into main Mar 13, 2021
@hipstersmoothie hipstersmoothie deleted the ts-configuration branch March 13, 2021 21:07
@adierkens
Copy link
Collaborator

🚀 PR was released in v10.20.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants