Skip to content

Commit

Permalink
Introduce changesets for npm version management (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
kachkaev committed Jul 7, 2022
1 parent 9d1bb3a commit 9c38dcd
Show file tree
Hide file tree
Showing 10 changed files with 879 additions and 91 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 5 additions & 0 deletions .changeset/block-template-private-true.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"block-template": patch
---

Add `"private": true` to all three template `package.json` files
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "blockprotocol/blockprotocol" }
],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
if: ${{ github.event.inputs.confirmation }}
runs-on: ubuntu-20.04
steps:
- run: echo "https://registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
name: Configure NPM token

- uses: actions/checkout@v2
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'blockprotocol/blockprotocol'
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@1.3.0
with:
publish: yarn changesets publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"devDependencies": {
"@babel/eslint-parser": "7.17.0",
"@babel/preset-react": "^7.16.7",
"@changesets/cli": "^2.23.0",
"@types/fs-extra": "^9.0.13",
"@types/wait-on": "5.3.1",
"@typescript-eslint/eslint-plugin": "5.21.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "custom-element-block",
"version": "0.0.0",
"private": true,
"description": "Block Protocol block template for a custom element-based block",
"keywords": [
"blockprotocol",
Expand Down
1 change: 1 addition & 0 deletions packages/block-template/templates/html/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "html-block",
"version": "0.0.0",
"private": true,
"description": "Block Protocol block template for an html-based block",
"keywords": [
"blockprotocol",
Expand Down
1 change: 1 addition & 0 deletions packages/block-template/templates/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "block-template-react",
"version": "0.0.0",
"private": true,
"description": "Block Protocol template for a React-based block",
"keywords": [
"blockprotocol",
Expand Down

0 comments on commit 9c38dcd

Please sign in to comment.