Skip to content

Commit d631caf

Browse files
committed
chore: configure changesets
1 parent 95b3d15 commit d631caf

File tree

8 files changed

+630
-12
lines changed

8 files changed

+630
-12
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": ["@changesets/changelog-github", { "repo": "pizzajsdev/template-monorepo-lib" }],
4+
"baseBranch": "main",
5+
"commit": false,
6+
"access": "public",
7+
"updateInternalDependencies": "patch",
8+
"ignore": ["!@pizzajsdev/*"],
9+
"fixed": [],
10+
"linked": []
11+
}

.github/workflows/quality-check.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
name: Check code quality
22

3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
39
env:
410
APP_CI: true
511
APP_ENV: development
612
NODE_VERSION: 22.14.0
713
PNPM_VERSION: 10.7.0
814

9-
on:
10-
workflow_dispatch:
11-
push:
12-
branches:
13-
- main
14-
1515
concurrency:
1616
group: qualityCheck-${{ github.ref }}
1717
cancel-in-progress: true
@@ -25,6 +25,7 @@ jobs:
2525

2626
- name: 'Setup project'
2727
uses: ./.github/actions/setup-project
28+
# NODE_AUTH_TOKEN is needed to install private Github packages
2829
env:
2930
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3031

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
APP_CI: true
10+
APP_ENV: development
11+
NODE_VERSION: 22.14.0
12+
PNPM_VERSION: 10.7.0
13+
14+
concurrency: ${{ github.workflow }}-${{ github.ref }}
15+
16+
jobs:
17+
release:
18+
permissions:
19+
contents: write
20+
id-token: write
21+
issues: read
22+
pull-requests: write
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 20
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: ./.github/actions/setup-project
28+
# NODE_AUTH_TOKEN is needed to install private Github packages
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
- name: 'Lint'
32+
run: pnpm lint
33+
- name: 'Run tests'
34+
run: pnpm test
35+
- name: Create Release Pull Request or Publish to package registry
36+
# https://github.com/changesets/action
37+
uses: changesets/action@v1
38+
with:
39+
# this expects you to have a script called release which does a build for your packages and calls changeset publish
40+
publish: pnpm run release
41+
version: pnpm run version-packages
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
# this project is configured to use the Github Package Registry, to use npm you need to use a token generated in npmjs.com
45+
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ This stack uses:
88
- Bundler: tsup + esbuild
99
- Package manager: pnpm
1010
- Testing: vitest
11-
- Linting and formatting: stricter tsconfig rules, prettier, sort-package-json, publint
11+
- Linting and formatting:
12+
- tsconfig with stricter rules, including `erasableSyntaxOnly`
13+
- prettier
14+
- sort-package-json
15+
- publint
1216
- Circular dependency detection: madge
17+
- Release management: changesets + Github Actions
18+
- Package Registry: Github
1319

1420
## Features
1521

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@
55
"scripts": {
66
"build": "pnpm -r run build",
77
"dev": "pnpm -r --parallel run dev",
8-
"format": "bun run --bun prettier --write README.md .github/ ./packages && bun run format:pkg",
8+
"format": "pnpm format:prettier && pnpm format:pkg",
99
"format:pkg": "bun run --bun sort-package-json package.json packages/*/package.json",
10-
"lint": "bun run --run typecheck && bun run --run lint:prettier && bun run lint:madge",
10+
"format:prettier": "bun run --bun prettier --write README.md .github/ ./packages",
11+
"lint": "pnpm typecheck && pnpm lint:prettier && pnpm lint:madge",
1112
"lint:madge": "bun run --bun madge --circular --extensions ts,tsx packages/",
1213
"lint:prettier": "bun run --bun prettier --check README.md .github/ ./packages",
13-
"prepare": "bun run format:pkg",
14+
"prepare": "pnpm format:pkg",
15+
"release": "pnpm run build && changeset publish",
1416
"test": "vitest --run",
1517
"test:watch": "vitest",
1618
"typecheck": "pnpm -r run typecheck",
1719
"update-deps": "pnpm -r up --latest --save",
18-
"postupdate-deps": "pnpm install && echo 'Installed dependencies again to apply overrides.'"
20+
"postupdate-deps": "pnpm install && echo 'Installed dependencies again to apply any pnpm overrides.'",
21+
"version-packages": "changeset version && pnpm format"
1922
},
2023
"devDependencies": {
24+
"@changesets/cli": "^2.28.1",
2125
"madge": "^8.0.0",
2226
"prettier": "^3.5.3",
2327
"sort-package-json": "^3.0.0",

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@pizzajs/demo-pkg",
2+
"name": "@pizzajsdev/demo-pkg",
33
"version": "0.0.1",
44
"description": "Demo package",
55
"homepage": "https://github.com/pizzajsdev/template-monorepo-libs#readme",

0 commit comments

Comments
 (0)