Skip to content

Repository files navigation

@btravstack/config

Shared configuration packages for btravstack repositories. Each repo used to hand-copy a near-identical tools/tsconfig, tools/typedoc, oxlint, oxfmt, commitlint, and lefthook setup; this monorepo publishes them once, under the same @btravstack npm scope as @btravstack/theme.

Every package is consumed via native config inheritance (extends), not a build step — they ship static config files, so there is nothing to compile.

Packages

PackageWhat it sharesInheritance
@btravstack/tsconfigStrict TS base (strict + exactOptionalPropertyTypes + noUncheckedIndexedAccess + noPropertyAccessFromIndexSignature …, NodeNext, ES2022)tsconfig.jsonextends
@btravstack/typedocTypeDoc markdown base (markdown plugin, table formats)typedoc.jsonextends
@btravstack/oxlintoxlint rules (no-explicit-any, type-only definitions).oxlintrc.jsonextends
@btravstack/oxfmtoxfmt settingscopy-template — oxfmt has no extends
@btravstack/commitlintConventional-commits presetcommitlint.config.jsextends
@btravstack/lefthookpre-commit / commit-msg hookslefthook.ymlextends

Consuming from a btravstack repo

Install the packages you need (they belong in devDependencies), then wire each one up:

tsconfig — in a package's tsconfig.json:

{ "extends": "@btravstack/tsconfig/base.json" }

typedoc — in typedoc.json (bring your own typedoc-plugin-markdown):

{ "extends": "@btravstack/typedoc/base.json", "entryPoints": ["src/index.ts"] }

oxlint — oxlint resolves extends by file path, so point at the file in node_modules (the same style already used for $schema):

{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"extends": ["./node_modules/@btravstack/oxlint/base.json"],
}

oxfmt — oxfmt has no extends; copy @btravstack/oxfmt/base.json into your .oxfmtrc.json and add repo-specific ignorePatterns.

commitlint — in commitlint.config.js:

exportdefault{extends: ["@btravstack/commitlint"]};

lefthook — in lefthook.yml:

extends:
- node_modules/@btravstack/lefthook/lefthook.yml

First-party packages skip the supply-chain maturity delay: add @btravstack/* to minimumReleaseAgeExclude in the consumer's pnpm-workspace.yaml, next to @btravstack/theme.

Development

pnpm install
pnpm test# validate every shipped config parses/loads
pnpm lint
pnpm format

Releases flow through changesets and npm Trusted Publishing (OIDC — no NPM_TOKEN). Add a changeset with pnpm changeset; merging the generated "release packages" PR publishes.

Reusable GitHub workflows

Two reusable workflows live under .github/workflows so consumer repos stop hand-copying CI/release YAML:

  • ci-reusable.yml — one job that runs the whole gate after a single install (format → lint → typecheck → knip → test → build → audit → optional changeset check). Inputs: knip, changeset, security-audit, test-command, node-version-file.
  • release-reusable.yml — changesets + npm Trusted Publishing. Takes a RELEASE_PAT secret.

Consume them from thin caller workflows:

# .github/workflows/ci.ymlname: CIon:
push: { branches: [main] }pull_request: { branches: [main] }jobs:
ci:
uses: btravstack/config/.github/workflows/ci-reusable.yml@mainwith:
changeset: true # contract repos that enforce changesets
# .github/workflows/release.ymlname: Releaseon:
workflow_run: { workflows: ["CI"], types: [completed], branches: [main] }jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}uses: btravstack/config/.github/workflows/release-reusable.yml@mainsecrets:
RELEASE_PAT: ${{ secrets.RELEASE_PAT }}

Repo-specific jobs (bundle-size, integration tests, docs deploy) stay in the caller's own workflow file alongside the uses: call.

License

MIT © Benoit Travers

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages