From 6168e1b63b4c37418bc142b8fe408b621750f11b Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Thu, 11 Feb 2021 11:02:06 -0800 Subject: [PATCH] update docs to always have latest default labels --- docs/components/defaultLabelsRenderer.js | 31 ++++++++++++++ docs/pages/docs/configuration/autorc.mdx | 51 ++---------------------- package.json | 1 + yarn.lock | 17 +++++--- 4 files changed, 46 insertions(+), 54 deletions(-) create mode 100644 docs/components/defaultLabelsRenderer.js diff --git a/docs/components/defaultLabelsRenderer.js b/docs/components/defaultLabelsRenderer.js new file mode 100644 index 000000000..d4f23b288 --- /dev/null +++ b/docs/components/defaultLabelsRenderer.js @@ -0,0 +1,31 @@ +import { igniteComponents } from "next-ignite"; +// eslint-disable-next-line import/no-extraneous-dependencies +import { defaultLabels } from "@auto-it/core/dist/semver"; +import Highlight, { defaultProps } from "prism-react-renderer"; + +/** Render the current default labels in a details element */ +export const DefaultLabelRenderer = () => ( +
+ Click here to see the default label configuration + + + {({ className, style, tokens, getLineProps, getTokenProps }) => ( + + + {tokens.map((line, i) => ( +
+ {line.map((token, key) => ( + + ))} +
+ ))} +
+
+ )} +
+
+); diff --git a/docs/pages/docs/configuration/autorc.mdx b/docs/pages/docs/configuration/autorc.mdx index d3a8c13ab..1a4715b56 100644 --- a/docs/pages/docs/configuration/autorc.mdx +++ b/docs/pages/docs/configuration/autorc.mdx @@ -2,6 +2,8 @@ title: \`auto\` Configuration File --- +import { DefaultLabelRenderer } from "../../../components/defaultLabelsRenderer"; + `auto` uses [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) to find your config. This means you can define this file a variety of ways. `cosmiconfig` will start at the root of your project and start to search up the directory tree for the following: @@ -196,54 +198,7 @@ To customize your project's labels use the `labels` section in your `.autorc`. } ``` -
Click here to see the default label configuration - -```json -[ - { - name: "major", - changelogTitle: "💥 Breaking Change", - description: "Increment the major version when merged", - releaseType: "major", - }, - { - name: "minor", - changelogTitle: "🚀 Enhancement", - description: "Increment the minor version when merged", - releaseType: "minor", - }, - { - name: "patch", - changelogTitle: "🐛 Bug Fix", - description: "Increment the patch version when merged", - releaseType: "patch", - }, - { - name: "skip-release", - description: "Preserve the current version when merged", - releaseType: "skip", - }, - { - name: "release", - description: "Create a release when this pr is merged", - releaseType: "release", - }, - { - name: "internal", - changelogTitle: "🏠 Internal", - description: "Changes only affect the internal API", - releaseType: "none", - }, - { - name: "documentation", - changelogTitle: "📝 Documentation", - description: "Changes only affect the documentation", - releaseType: "none", - }, -]; -``` - -
+ #### Label Customization diff --git a/package.json b/package.json index 354acd215..c60db2081 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "lint-staged": "^10.0.7", "next-ignite": "^0.9.16", "prettier": "^2.0.1", + "prism-react-renderer": "^1.1.1", "push-dir": "^0.4.1", "rimraf": "^3.0.0", "simple-react-lightbox": "^3.1.2-3", diff --git a/yarn.lock b/yarn.lock index c5235bee0..57b1c3427 100644 --- a/yarn.lock +++ b/yarn.lock @@ -59,10 +59,10 @@ integrity sha512-TYiuOxy5Pf9ORn94X/ujl7PY9opIh+l6NzRAV8EBLpIv3IC9gmEoev4wmmyP7Q33J0/nGjqxAaZcq/n2SZrYaQ== "@auto-it/bot-list@link:packages/bot-list": - version "10.13.4" + version "10.16.1" "@auto-it/core@link:packages/core": - version "10.13.4" + version "10.16.1" dependencies: "@auto-it/bot-list" "link:packages/bot-list" "@octokit/plugin-enterprise-compatibility" "^1.2.2" @@ -102,7 +102,7 @@ url-join "^4.0.0" "@auto-it/npm@link:plugins/npm": - version "10.13.4" + version "10.16.1" dependencies: "@auto-it/core" "link:packages/core" "@auto-it/package-json-utils" "link:packages/package-json-utils" @@ -119,13 +119,13 @@ user-home "^2.0.0" "@auto-it/package-json-utils@link:packages/package-json-utils": - version "10.13.4" + version "10.16.1" dependencies: parse-author "^2.0.0" parse-github-url "1.0.2" "@auto-it/released@link:plugins/released": - version "10.13.4" + version "10.16.1" dependencies: "@auto-it/bot-list" "link:packages/bot-list" "@auto-it/core" "link:packages/core" @@ -135,7 +135,7 @@ tslib "2.0.3" "@auto-it/slack@link:plugins/slack": - version "10.13.4" + version "10.16.1" dependencies: "@atomist/slack-messages" "~1.2.0" "@auto-it/core" "link:packages/core" @@ -12557,6 +12557,11 @@ pretty-ms@^7.0.0: dependencies: parse-ms "^2.1.0" +prism-react-renderer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-1.1.1.tgz#1c1be61b1eb9446a146ca7a50b7bcf36f2a70a44" + integrity sha512-MgMhSdHuHymNRqD6KM3eGS0PNqgK9q4QF5P0yoQQvpB6jNjeSAi3jcSAz0Sua/t9fa4xDOMar9HJbLa08gl9ug== + prismjs@~1.17.0: version "1.17.1" resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.17.1.tgz#e669fcbd4cdd873c35102881c33b14d0d68519be"