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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
.turbo/
dist
dist-ssr
coverage
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Use Node and pnpm versions declared in [package.json](package.json). Install dependencies with `pnpm install`, then run `pnpm dev` for the playground.

Turborepo runs workspace builds, typechecks, development and preview servers, and documentation browser tests. All Turbo task caching is disabled; every invocation executes its selected tasks. Build dependencies run before their consumers, while independent tasks can run in parallel.

Use `pnpm build` for all libraries and applications, or `pnpm build:packages` for libraries only. Select a workspace directly with `pnpm exec turbo run build --filter=@react-fabrio/ui`; this also builds its dependencies. `pnpm typecheck` checks all workspaces, integration examples, E2E tests and the root Node configuration without requiring a build first. `pnpm dev` starts only the playground, and `pnpm docs:dev` starts only documentation. Server arguments pass through, for example `pnpm dev --host 127.0.0.1 --port 4173 --strictPort`.

Vitest, coverage, lint, formatting, React Doctor and playground E2E tests keep their existing runners. `pnpm test` runs Vitest; `pnpm docs:test` runs documentation browser tests against an existing documentation build. CI continues to cache pnpm dependencies only.

## Workflow

Read the [glossary](GLOSSARY.md), [architecture](apps/docs/content/architecture.md), and [relevant domain references](apps/docs/content/index.md). Keep changes in the owning package and update the reference that defines the changed contract. Add meaningful behavior tests for document fidelity, permissions, output correctness or customer workflows; avoid tests that duplicate implementation details.
Expand Down
12 changes: 9 additions & 3 deletions apps/docs/content/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ The CI workflow publishes the five library packages from `packages/` with one sh

## Configure npm access

Add an Actions secret named `NPM_TOKEN` in the GitHub repository. Use an npm granular access token with permission to publish every package in the `@react-fabrio` scope, including creating the packages for the first release. The token must support unattended publication under the npm account's two-factor authentication policy. Renew it before it expires.
For the first publication, add an Actions secret named `NPM_TOKEN` in the GitHub repository. Use an npm granular access token with **Read and write (publish and stage)** permission for the `@react-fabrio` scope, including creating the packages, and explicitly enable **Bypass two-factor authentication**. A token that passes `npm whoami` can still fail publication with `ERR_PNPM_OTP_NON_INTERACTIVE` when this option is disabled. Renew it before it expires. See [npm access token configuration](https://docs.npmjs.com/creating-and-viewing-access-tokens/).

The workflow supplies this secret as `NODE_AUTH_TOKEN` through the registry configuration created by `actions/setup-node`. GitHub tags and releases use the job's `GITHUB_TOKEN` with `contents: write`. No separate GitHub token is needed.

For subsequent publications, configure a [Trusted Publisher](https://docs.npmjs.com/trusted-publishers/) on each of the five npm packages: GitHub owner `Imunal`, repository `react-fabrio`, workflow filename `ci.yml`, and no environment name (the publish job does not use an environment). Allow direct publishing. The publish job grants `id-token: write`, allowing pnpm to authenticate through OIDC. After all packages use trusted publishing, remove `NPM_TOKEN`. Granting the workflow permission alone does not configure trust on npm.

Semantic-release does not run `npm whoami` as a precondition because that command does not validate OIDC publication access. npm checks publication access when pnpm publishes. Local `pnpm release` cannot use the GitHub runner's OIDC identity and needs a valid npm token or interactive authentication.

## Choose commit messages

Semantic-release uses Conventional Commits to determine the next version:
Expand All @@ -28,16 +32,18 @@ Use these conventions in the final commit message on `main`, including the squas

The `publish` job runs automatically for pushes to `main` after `validate`, `e2e` and `docs` pass. Pull requests and manual workflow dispatches do not publish. Release jobs run one at a time.

The job installs the locked dependencies and builds the library packages. Its separate **Publish packages and create GitHub release** step runs `pnpm release`. Semantic-release checks registry and GitHub access, analyzes commits and generates release notes. When a release is needed, it sets every public library package to the new version, creates the tag and publishes through pnpm. A GitHub release follows successful npm publication.
The job installs the locked dependencies and builds the library packages. Its separate **Publish packages and create GitHub release** step runs `pnpm release`. Semantic-release checks GitHub access, analyzes commits and generates release notes. When a release is needed, it sets every public library package to the new version, creates the tag and publishes through pnpm. A GitHub release follows successful npm publication.

Workspace dependencies become registry versions during packing. The optional Three peer uses `workspace:^`, so its published range follows the release version too. Version changes happen in the CI checkout and are not committed back to the repository; tags and published manifests record the released versions.

`pnpm release:dry-run` previews the release decision and notes without publishing or changing versions. It still checks remote access and requires registry authentication and a GitHub token. Use a checkout of `main` with full Git history.
`pnpm release:dry-run` previews the release decision and notes without publishing or changing versions. It still checks GitHub access and requires a GitHub token; it does not validate npm publication access. Use a checkout of `main` with full Git history.

## Recover from a partial publication

If publication fails after the tag was created, inspect the job logs and npm before retrying. Semantic-release may see the existing tag and decide there is no new release.

This also applies to the failed `v1.0.0` publication: correcting authentication and rerunning semantic-release does not finish that tagged version. Follow the recovery steps below with version `1.0.0`; use a token with **Bypass two-factor authentication** when recovering locally.

To finish that release, use a clean checkout of its tag, install dependencies and run the preparation script with that tag's version, for example `node scripts/prepare-release.mjs 1.2.3`. Build the packages, then rerun the pnpm publish command from [release.config.mjs](../../../release.config.mjs) with valid registry credentials. Recursive publishing skips package versions already on npm. After all five versions are available, create the missing GitHub release using the notes from the failed run.

Do not remove a tag or reuse a version to change files that have already reached npm.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"license": "MIT",
"type": "module",
"scripts": {
"dev": "pnpm --filter playground dev",
"build": "pnpm -r --if-present build",
"build:packages": "pnpm --filter './packages/**' -r build",
"typecheck": "pnpm -r --if-present typecheck && tsc -p tests/tsconfig.json && tsc -p e2e/tsconfig.json && tsc -p tsconfig.node.json",
"dev": "turbo run dev --filter=playground --",
"build": "turbo run build --",
"build:packages": "turbo run build --filter='./packages/**' --",
"typecheck": "turbo run typecheck && tsc -p tests/tsconfig.json && tsc -p e2e/tsconfig.json && tsc -p tsconfig.node.json",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:e2e": "pnpm build:packages && playwright test --config e2e/playwright.config.ts",
Expand All @@ -17,12 +17,12 @@
"react-doctor": "react-doctor --project @react-fabrio/docs,playground,@react-fabrio/react,@react-fabrio/ui --yes --blocking error --no-telemetry",
"format": "oxfmt .",
"format:check": "oxfmt . --check",
"preview": "pnpm --filter playground preview",
"preview": "turbo run preview --filter=playground --",
"prepare": "lefthook install",
"docs:dev": "pnpm --filter @react-fabrio/docs dev",
"docs:build": "pnpm --filter @react-fabrio/docs build",
"docs:preview": "pnpm --filter @react-fabrio/docs preview",
"docs:test": "pnpm --filter @react-fabrio/docs test",
"docs:dev": "turbo run dev --filter=@react-fabrio/docs --",
"docs:build": "turbo run build --filter=@react-fabrio/docs --",
"docs:preview": "turbo run preview --filter=@react-fabrio/docs --",
"docs:test": "turbo run test --filter=@react-fabrio/docs --",
"release": "semantic-release",
"release:dry-run": "semantic-release --dry-run"
},
Expand All @@ -40,6 +40,7 @@
"oxlint": "^1.88.0",
"react-doctor": "^0.9.18",
"semantic-release": "^25.0.9",
"turbo": "2.11.10",
"typescript": "~7.0.2",
"vite": "^8.3.4",
"vitest": "^5.0.5"
Expand Down
64 changes: 64 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://turborepo.dev/schema.json",
"envMode": "loose",
"tasks": {
"build": {
"dependsOn": ["^build"],
"cache": false
},
"typecheck": {
"cache": false
},
"dev": {
"cache": false,
"persistent": true
},
"preview": {
"cache": false,
"persistent": true
},
"test": {
"cache": false
}
}
}
Loading