diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 0000000..e5b6d8d --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,8 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in +[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..4211287 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://unpkg.com/@changesets/config/schema.json", + "changelog": [ + "@changesets/changelog-github", + { + "repo": "prettier/prettier-eslint-cli" + } + ], + "commit": false, + "fixed": [], + "linked": [], + "access": "public", + "baseBranch": "master", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8957c80..847bfee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,23 +7,32 @@ on: jobs: release: + name: Release runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: actions/checkout@v3 with: + # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - - uses: actions/setup-node@v3 + - name: Setup Node.js LTS + uses: actions/setup-node@v3 with: - node-version: 16 - - - run: npm i + node-version: lts/* - - run: npm start build + - name: Install Dependencies + run: npm i - - name: Release + - name: Create Release Pull Request or Publish to npm + uses: changesets/action@v1 + with: + # This expects you to have a script called release which does a build for your packages and calls changeset publish + publish: npm run release + # this expects you to have a npm script called version that runs some logic and then calls `changeset version`. + version: npm run version + commit: 'chore: release prettier-eslint-cli' + title: 'chore: release prettier-eslint-cli' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release diff --git a/.nvmrc b/.nvmrc index 431076a..2a4e4ab 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.16.0 +16.17.0 diff --git a/package.json b/package.json index c4e83d6..150438c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prettier-eslint-cli", - "version": "0.0.0-development", + "version": "7.0.1", "description": "CLI for prettier-eslint", "main": "dist/no-main.js", "engines": { @@ -13,6 +13,10 @@ "build": "nps build", "lint": "nps lint", "prepare": "patch-package && simple-git-hooks", + "prerelease": "nps build", + "release": "clean-pkg-json && changeset release", + "version": "changeset version", + "postversion": "jest -u", "start": "nps", "test": "nps test" }, @@ -59,7 +63,10 @@ "@babel/core": "^7.18.10", "@babel/node": "^7.18.10", "@babel/preset-env": "^7.18.10", + "@changesets/changelog-github": "^0.4.6", + "@changesets/cli": "^2.24.3", "all-contributors-cli": "^6.20.0", + "clean-pkg-json": "^1.0.1", "eslint-config-kentcdodds": "^20.3.1", "eslint-plugin-node-dependencies": "^0.8.0", "jest": "^28.1.3", @@ -70,7 +77,6 @@ "patch-package": "^6.4.7", "pify": "^5.0.0", "rimraf": "^3.0.2", - "semantic-release": "^17.4.7", "simple-git-hooks": "^2.8.0", "spawn-command": "0.0.2-1", "strip-indent": "^3.0.0", diff --git a/test/tests/__snapshots__/cli.spec.js.snap b/test/tests/__snapshots__/cli.spec.js.snap index de14e58..b51dd89 100644 --- a/test/tests/__snapshots__/cli.spec.js.snap +++ b/test/tests/__snapshots__/cli.spec.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`prettier-eslint --version: stdout: --version 1`] = ` -"0.0.0-development +"7.0.1 " `;