diff --git a/auto.config.ts b/auto.config.ts index 0a3c909bd..3c9150559 100644 --- a/auto.config.ts +++ b/auto.config.ts @@ -5,6 +5,28 @@ import { IBrewPluginOptions } from "./plugins/brew"; import { IGhPagesPluginOptions } from "./plugins/gh-pages"; import { IAllContributorsPluginOptions } from "./plugins/all-contributors"; +const npmOptions: INpmConfig = { + exact: true, + canaryScope: "@auto-canary", +}; + +const allContributorsOptions: IAllContributorsPluginOptions = { + types: { + plugin: "**/plugin/**/*", + code: ["**/src/**/*", "**/package.json", "**/tsconfig.json"], + }, +}; + +const brewOptions: IBrewPluginOptions = { + executable: "./packages/cli/binary/auto-macos.gz", + name: "auto", +}; + +const ghPagesOptions: IGhPagesPluginOptions = { + buildCommand: "yarn docs:build", + dir: "docs/out", +}; + /** Auto configuration */ export default function rc(): AutoRc { return { @@ -17,40 +39,14 @@ export default function rc(): AutoRc { "./packages/cli/binary/auto-win.exe.gz", ], ], - [ - "npm", - { - exact: true, - canaryScope: "@auto-canary", - } as INpmConfig, - ], + ["npm", npmOptions], "released", "first-time-contributor", "pr-body-labels", "./scripts/auto-update-curl-version.js", - [ - "all-contributors", - { - types: { - plugin: "**/plugin/**/*", - code: ["**/src/**/*", "**/package.json", "**/tsconfig.json"], - }, - } as IAllContributorsPluginOptions, - ], - [ - "brew", - { - executable: "./packages/cli/binary/auto-macos.gz", - name: "auto", - } as IBrewPluginOptions, - ], - [ - "gh-pages", - { - buildCommand: "yarn docs:build", - dir: "docs/out", - } as IGhPagesPluginOptions, - ], + ["all-contributors", allContributorsOptions], + ["brew", brewOptions], + ["gh-pages", ghPagesOptions], ], labels: [ { diff --git a/docs/pages/docs/configuration/autorc.mdx b/docs/pages/docs/configuration/autorc.mdx index 6c63ea605..0d8eaeba5 100644 --- a/docs/pages/docs/configuration/autorc.mdx +++ b/docs/pages/docs/configuration/autorc.mdx @@ -34,27 +34,25 @@ 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", - { - exact: true, - canaryScope: "@auto-canary", - } as INpmConfig, - ], - [ - "all-contributors", - { - types: { - plugin: "**/plugin/**/*", - code: ["**/src/**/*", "**/package.json", "**/tsconfig.json"], - }, - } as IAllContributorsPluginOptions, - ], + ["npm", npmOptions], + ["all-contributors", allContributorsOptions], ], labels: [ {