diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..4d234ad --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,17 @@ +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +permissions: + pull-requests: read + +# https://github.com/amannn/action-semantic-pull-request +jobs: + title-check: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + requireScope: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ef85f4d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +name: 'Code Integration Checks' +on: ['push'] +jobs: + integration-checks: + runs-on: ubuntu-latest + name: Code Integration Checks + steps: + - name: Check out + uses: actions/checkout@v3 + - name: Set up node + uses: actions/setup-node@v3 + with: + node-version: 22 + cache: 'yarn' + registry-url: 'https://registry.npmjs.org' + - name: Install + run: yarn install --immutable + - name: Check Code Formatting + if: always() + run: yarn check:formatting + - name: Check Types + if: always() + run: yarn check:types + - name: Lint + if: always() + run: yarn lint + - name: Test + if: always() + run: yarn test + - name: Build + if: always() + run: yarn build +# TODO test build output: https://github.com/sep2/immer-yjs/issues/18 +# - name: Test Build Output +# if: always() +# run: yarn workspace test-app test diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..78f38f5 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +.pnp.cjs +.pnp.loader.mjs diff --git a/package.json b/package.json index ae408cb..ce9caa8 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ "publish": "yarn workspace immer-yjs npm publish", "release": "yarn workspace immer-yjs release", "lint": "eslint --ext .js,.ts --ignore-path .gitignore --fix packages", - "format": "prettier . --write" + "format": "prettier . --write", + "check:formatting": "prettier . --check", + "check:types": "yarn workspace immer-yjs check:types" }, "devDependencies": { "@types/node": "^17.0.21", diff --git a/packages/immer-yjs/package.json b/packages/immer-yjs/package.json index 2a6085a..9db470e 100644 --- a/packages/immer-yjs/package.json +++ b/packages/immer-yjs/package.json @@ -25,7 +25,8 @@ "build": "tsc && vite build", "test": "NODE_NO_WARNINGS=1 vitest", "coverage": "vitest run --coverage", - "release": "standard-version" + "release": "standard-version", + "check:types": "tsc --noEmit" }, "peerDependencies": { "immer": "^9.0.12",