From 3ec4ccfb8e19032068fd34c24929179a5237f0ca Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 11 Jun 2019 00:27:44 +0200 Subject: [PATCH] simplify release-it tasks, add changelog --- README.md | 10 +++++----- package.json | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d6af1f8..001f19e 100644 --- a/README.md +++ b/README.md @@ -77,9 +77,9 @@ redirect_from: Plugin does not require to be configured but some additional customization options are available: -| Option | Default | Description | -|---|---|---| -| query | `allMarkdownRemark` | Modify the query being used to get the frontmatter data. E.g. if you use MDX, set `allMdx` here. | +| Option | Default | Description | +| ------ | ------------------- | ------------------------------------------------------------------------------------------------ | +| query | `allMarkdownRemark` | Modify the query being used to get the frontmatter data. E.g. if you use MDX, set `allMdx` here. | Add options to the plugins's configuration object in `gatsby-config.js` like so: @@ -107,8 +107,8 @@ npm run build # publishing to npm & GitHub releases # uses https://github.com/webpro/release-it npm run release -npm run release-minor -npm run release-major +npm run release minor +npm run release major ``` ## License diff --git a/package.json b/package.json index 873de95..e8118f0 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,9 @@ "build": "babel src --out-dir . --ignore __tests__", "start": "babel -w src --out-dir . --ignore __tests__", "test": "eslint ./src/**/*.js", - "release": "./node_modules/release-it/bin/release-it.js --src.tagName='v%s' --github.release --npm.publish --non-interactive", - "release-minor": "./node_modules/release-it/bin/release-it.js minor --src.tagName='v%s' --github.release --npm.publish --non-interactive", - "release-major": "./node_modules/release-it/bin/release-it.js major --src.tagName='v%s' --github.release --npm.publish --non-interactive", "format": "prettier --write 'src/**/*.{js,jsx}'", + "release": "release-it --non-interactive", + "changelog": "auto-changelog -p", "prepublishOnly": "cross-env NODE_ENV=production npm run build" }, "browserslist": [ @@ -24,6 +23,7 @@ "@babel/cli": "^7.4.4", "@babel/core": "^7.4.5", "@babel/preset-env": "^7.4.5", + "auto-changelog": "^1.13.0", "chalk": "^2.4.2", "cross-env": "^5.2.0", "eslint": "^5.16.0", @@ -47,5 +47,20 @@ "gatsby", "gatsby-plugin", "redirect" - ] + ], + "release-it": { + "scripts": { + "beforeStart": "npm test", + "beforeStage": "npm run changelog" + }, + "git": { + "tagName": "v${version}" + }, + "github": { + "release": true + }, + "npm": { + "publish": true + } + } }