diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 000000000..fce1c2654 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..f15df0b46 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + + - name: Enable Corepack + run: corepack enable + + - name: Install dependencies + run: yarn --immutable + + - name: Get changeset status + id: get-changeset-status + run: | + yarn changeset status --output .changeset/status.json + new_version=$(jq -r '.releases[0].newVersion' < .changeset/status.json) + rm -v .changeset/status.json + echo "new-version=${new_version}" >> "$GITHUB_OUTPUT" + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + commit: Release ${{ steps.get-changeset-status.outputs.new-version }} + title: Release ${{ steps.get-changeset-status.outputs.new-version }} + publish: yarn release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index beb98804e..e77a7d149 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,25 @@ To fix this issue, you need to use dynamic imports for the PDF component (to ind + ); ``` +## Contributing + +When making changes to this project, please follow these steps: + +1. Make your code changes +2. Create a changeset to document your changes: + ```bash + yarn changeset + ``` +3. Commit your changes and the changeset +4. When ready to release a new version: + ```bash + yarn new-version + ``` +5. To publish the new version: + ```bash + yarn release + ``` + ## 🙏 Thanks Thanks to the developers of the following dependencies that we're using: diff --git a/package.json b/package.json index 8be26ce40..5b6ef2471 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,11 @@ "prepack": "yarn clean && yarn build", "test": "yarn lint && yarn tsc && yarn format", "tsc": "tsc", - "watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & nodemon --watch src --ext css --exec \"yarn copy-styles\"" + "watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & nodemon --watch src --ext css --exec \"yarn copy-styles\"", + "new-snapshot": "yarn build && changeset version --snapshot", + "new-version": "yarn build && changeset version", + "release": "yarn build && changeset publish", + "release-snapshot": "yarn build && changeset publish --tag snapshot" }, "dependencies": { "@wojtekmaj/react-hooks": "1.17.2", @@ -44,6 +48,7 @@ "react-window": "1.8.9" }, "devDependencies": { + "@changesets/cli": "^2.27.1", "@types/lodash": "^4.14.195", "@types/lodash.debounce": "^4.0.7", "@types/node": "*", diff --git a/src/view/PdfOptionsBar.tsx b/src/view/PdfOptionsBar.tsx index 0b0d61584..a4075a6ca 100644 --- a/src/view/PdfOptionsBar.tsx +++ b/src/view/PdfOptionsBar.tsx @@ -61,7 +61,7 @@ const PDFOptionsBar: React.FC = ({ return (
-
File ID: {file.id}
+
File ID: {file.id}