Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/build_test_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
Expand All @@ -35,12 +37,11 @@ jobs:
yarn test

- name: Release on npm
if: |
github.event_name != 'pull_request' &&
!startsWith(github.event.head_commit.message, 'chore')
if: github.event_name != 'pull_request'
env:
GIT_AUTHOR_NAME: Florian Imdahl
GIT_AUTHOR_EMAIL: ffflorian@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export GIT_COMMITTER_NAME="${GIT_AUTHOR_NAME}"
export GIT_COMMITTER_EMAIL="${GIT_AUTHOR_EMAIL}"
Expand Down
3 changes: 3 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@ffflorian/semantic-release-config"
}
39 changes: 27 additions & 12 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This file contains knowledge and conventions for AI agents working in this repos

## Project Overview

This is a Yarn workspaces monorepo managed by [Lerna](https://lerna.js.org/), containing multiple independently published Node.js/TypeScript packages by [Florian Imdahl](https://github.com/ffflorian).
This is a yarn workspaces monorepo managed by [multi-semantic-release](https://github.com/qiwi/multi-semantic-release), containing multiple independently published Node.js/TypeScript packages by [Florian Imdahl](https://github.com/ffflorian).

- **License**: GPL-3.0
- **Node.js requirement**: >= 18.0 (CI uses Node.js 24.x)
- **Package manager**: Yarn 4.12.0 (Berry)
- **Package manager**: yarn 4.12.0 (Berry)

## Packages

Expand Down Expand Up @@ -60,18 +60,24 @@ yarn workspace @ffflorian/<package-name> add -D <dep>

### Per-package scripts

Each package supports `build`, `clean`, and `test` scripts run via Lerna.
Each package supports `build`, `clean`, and `test` scripts run via `yarn workspaces foreach`.

## Tooling

- **Build**: TypeScript (`tsc`) via per-package `tsconfig.build.json`
- **Bundler**: Vite (used in some packages)
- **Testing**: Vitest
- **Bundler**: vite (used in some packages)
- **Testing**: vitest
- **Linting**: oxlint + ESLint with `@ffflorian/eslint-config`, run in that order
- **Formatting**: Prettier with `@ffflorian/prettier-config`
- **Git hooks**: Lefthook (`lefthook.yml`) — runs prettier, oxlint, and eslint with auto-fix on staged files before commit
- **Versioning**: Lerna independent versioning with conventional commits
- **Publishing**: Lerna publishes to npm registry; only allowed from `main` branch
- **Formatting**: prettier with `@ffflorian/prettier-config`
- **Git hooks**: lefthook (`lefthook.yml`) — runs prettier, oxlint, and eslint with auto-fix on staged files before commit
- **Versioning**: Independent versioning via conventional commits
- **Publishing**: `multi-semantic-release` (dhoulb) publishes to npm; only packages whose files changed are released. Private packages are excluded via `--ignore-private-packages`. Only allowed from `main` branch.
- **Cross-repo deps**: When a package in this repo depends on another package in this repo, use `*` as the version — multi-semantic-release replaces it with the correct version at publish time.
- **Release config**: Root `.releaserc.json` extends `@ffflorian/semantic-release-config`

## Dependencies

**Always use pinned (exact) versions in `package.json`.** Do not use `^`, `~`, or other range specifiers for dependencies. This is enforced by `defaultSemverRangePrefix: ''` in `.yarnrc.yml`.

## Commit Messages

Expand All @@ -89,7 +95,8 @@ ci: CI/CD configuration changes
```

- Do **not** include references to Claude or AI tools in commit messages or PR descriptions.
- Lerna uses conventional commits to determine version bumps and generate changelogs.
- `multi-semantic-release` uses conventional commits to determine version bumps and generate changelogs.
- Only packages with commits touching their own directory are released — unrelated packages are never published.

## Branch Naming

Expand All @@ -111,7 +118,8 @@ GitHub Actions workflow (`.github/workflows/build_test_publish.yml`):

1. Runs on pushes and PRs to `main`
2. Steps: install (`yarn --immutable`), build, lint, test
3. On push to `main` (non-`chore` commits): publishes changed packages to npm via `yarn release`
3. On push to `main`: runs `yarn release` (`multi-semantic-release`) which publishes only changed packages to npm
4. Requires `GITHUB_TOKEN` and OIDC for npm auth; checkout uses `fetch-depth: 0` for full git history

## Code Style

Expand All @@ -124,7 +132,14 @@ GitHub Actions workflow (`.github/workflows/build_test_publish.yml`):

## Before Committing

Always run `yarn fix` before committing to auto-fix linting and formatting errors:
After implementing any change, always run build and tests to verify correctness:

```sh
yarn build:ts
yarn test
```

Then run `yarn fix` to auto-fix linting and formatting errors before committing:

```sh
yarn fix
Expand Down
17 changes: 0 additions & 17 deletions lerna.json

This file was deleted.

14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"@evilmartians/lefthook": "2.1.4",
"@ffflorian/eslint-config": "0.13.7",
"@ffflorian/prettier-config": "0.6.7",
"@ffflorian/semantic-release-config": "0.10.7",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"@types/node": "~24",
"eslint": "10.1.0",
"eslint-import-resolver-typescript": "4.4.4",
Expand All @@ -14,9 +17,10 @@
"eslint-plugin-perfectionist": "5.7.0",
"globals": "17.4.0",
"jiti": "2.6.1",
"lerna": "9.0.7",
"multi-semantic-release": "3.1.0",
"oxlint": "1.56.0",
"prettier": "3.8.1",
"semantic-release": "25.0.3",
"typescript": "6.0.2",
"typescript-eslint": "8.57.1",
"vite": "8.0.1",
Expand All @@ -31,8 +35,8 @@
"prettier": "@ffflorian/prettier-config",
"private": true,
"scripts": {
"build:ts": "lerna run build --concurrency 4",
"clean": "lerna run clean",
"build:ts": "yarn workspaces foreach --all --parallel --topological --exclude node-packages run build",
"clean": "yarn workspaces foreach --all --parallel --exclude node-packages run clean",
"dist": "yarn clean && yarn build:ts",
"fix": "yarn fix:ts && yarn fix:other",
"fix:other": "yarn prettier --write",
Expand All @@ -43,9 +47,9 @@
"lint:ts:eslint": "eslint packages/",
"lint:ts:oxlint": "oxlint --ignore-path .gitignore packages/",
"prettier": "prettier .",
"release": "lerna publish",
"release": "multi-semantic-release --ignore-private-packages",
"test": "yarn test:all",
"test:all": "lerna run test --concurrency 4"
"test:all": "yarn workspaces foreach --all --parallel --exclude node-packages run test"
},
"workspaces": [
"packages/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/my-timezone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"bin": "dist/cli.js",
"dependencies": {
"commander": "14.0.3",
"ntpclient": "1.16.1"
"ntpclient": "*"
},
"description": "Get the exact time based on your location.",
"devDependencies": {
Expand Down
Loading
Loading