Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ jobs:
- name: MCP index up to date
run: pnpm run gen:mcp:check

# The plugin reads its deprecation and text-alias metadata from a
# committed table generated off the same extractor as the API docs, so a
# stale one lints against props that have moved. Placed beside the other
# generated-artefact gates so they fail together rather than a build
# apart; it runs after install because the extractor resolves the
# library the same way gen:mcp:check does.
- name: ESLint plugin metadata up to date
run: pnpm run gen:eslint-meta:check

# House-convention gates (listings, docs sections, SCSS pattern,
# stories, inline-style ratchet). Error messages name the file and fix.
- name: Conformance checks
Expand Down Expand Up @@ -139,6 +148,7 @@ jobs:
create-bestax/coverage
bestax-migrate/coverage
bestax-mcp/coverage
eslint-plugin/coverage
retention-days: 7

- name: Archive Bundle Stats
Expand Down Expand Up @@ -354,6 +364,29 @@ jobs:
git log -1 --show-signature
pnpm exec semantic-release

# After Semantic Release (bulma-ui), which is load-bearing rather than
# tidy: the plugin declares @allxsmith/bestax-bulma in runtime
# dependencies, and pnpm publish resolves workspace:^ against
# bulma-ui/package.json at pack time. Run before that step in a release
# bumping both and the published range is computed from the version
# bulma-ui had on the way in — so a consumer resolving it can land on a
# version predating whatever that release added, which for the plugin
# means the ./constants subpath it imports.
#
# Every step here shares the constraint of preceding the MCP restamp
# below: none of them is guarded, so a failure in any one skips it and
# leaves main carrying a stale index (#521). This adds one more step
# that can do that rather than a new way for it to happen.
- name: Semantic Release (eslint-plugin)
working-directory: eslint-plugin
env:
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git log -1 --show-signature
pnpm exec semantic-release

# A bulma-ui release bumps bulma-ui/package.json, and gen-mcp-index.mjs
# stamps that version into the COMMITTED bestax-mcp/data/catalog.json
# (`generatedFrom.version`). Nothing above regenerates it, so main was
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/supply-chain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ jobs:
slug: bestax-migrate
- package: bestax-mcp
slug: bestax-mcp
- package: '@allxsmith/eslint-plugin-bestax'
slug: allxsmith-eslint-plugin-bestax

steps:
# Rule 10: a new job ships at `block`. The jobs in this file that carry
Expand Down Expand Up @@ -318,7 +320,7 @@ jobs:
# self-evidently the scan container instead of a phantom dependency.
#
# WHICH VERSION gets installed is decided by consumer-sbom-meta.mjs
# (#530 item 1), not by resolving `latest` for all four legs as this
# (#530 item 1), not by resolving `latest` for every leg as this
# step used to.
#
# For the ONE package a release names, `release.tag_name` is `<pkg>@X.Y.Z`
Expand Down
8 changes: 5 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pnpm format # prettier --write (format:check to verify; covers md/mdx to
pnpm gen:catalog # regenerate the skills component catalog (CI fails if stale)
pnpm gen:mcp # regenerate the MCP server's data index (CI fails if stale)
pnpm gen:skills # regenerate the skill install rosters (conformance fails if stale)
pnpm gen:eslint-meta # regenerate the ESLint plugin's metadata (in `pnpm all`; no CI step yet)
pnpm gen:eslint-meta # regenerate the ESLint plugin's metadata (CI fails if stale)
pnpm gen # every generator (api docs, catalog, MCP index, skill rosters, eslint metadata)
pnpm docs # Docusaurus dev server :3000
pnpm storybook # Storybook dev server :6006
Expand All @@ -60,8 +60,10 @@ Enforced by CI (`.github/workflows/ci.yml`):

- Coverage thresholds from the jest configs: **bulma-ui 99%** (all metrics);
every other jest package 95% (78% branches). `docs` has no jest suite.
- Stale skill catalog fails (`gen:catalog:check`) and a stale MCP index fails
(`gen:mcp:check`); build, typecheck, lint, format, audit.
- A stale generated artefact fails its own step: the skill catalog
(`gen:catalog:check`), the MCP index (`gen:mcp:check`) and the ESLint
plugin's metadata (`gen:eslint-meta:check`). Plus build, typecheck, lint,
format, audit.
- **Tests and stories are type-checked too**, by a second project
(`bulma-ui/tsconfig.test.json`, script `typecheck:tests`) — `tsconfig.json` excludes
them because it is also the build's program. ts-jest transpiles rather than checks
Expand Down
3 changes: 2 additions & 1 deletion eslint-plugin/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ color="primary" />` became `<Box color="bogus" textColor="primary" />`,

- **`src/generated/` is generated.** `pnpm gen:eslint-meta` writes it from the
library's TSDoc via `scripts/gen-eslint-meta.mjs`; `gen:eslint-meta:check`
regenerates and diffs, and runs in `pnpm all`. Never hand-edit it, and never
regenerates and diffs, and runs in CI as well as `pnpm all`. Never
hand-edit it, and never
hand-maintain a second copy of what it holds.
- **The preset must declare `files`.** A flat config object without it inherits
ESLint's default `**/*.{js,mjs,cjs}` set, and since every rule here visits
Expand Down
32 changes: 31 additions & 1 deletion eslint-plugin/release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,36 @@ export default {
author: 'Alex Smith <asmith62378@gmail.com>',
},
],
'@semantic-release/github',
[
'@semantic-release/github',
{
// The other four configs pass this plugin bare. This one does not,
// and the difference is the first release rather than the package.
//
// With no `@allxsmith/eslint-plugin-bestax@*` tag there is no
// `lastRelease`, so the first run's commit range is the whole
// repository history. The scope in `releaseRules` above does not
// narrow it — those rules decide the release TYPE, not which commits
// land in `context.commits` — which the repo demonstrates on itself:
// bestax-migrate's own changelog carries `**bulma-ui:**` entries.
//
// Left bare, `@semantic-release/github` then walks that range for
// associated PRs and issues and, on each, posts "This PR is included
// in version 1.0.0" and adds a `released` label. Every one of those
// is a false claim about a PR that predates this package, it is not
// reversible, and each is a comment event in a repository with
// comment-triggered automation. The first releases of the other three
// packages did exactly that — PR #300 carries four such notices, two
// of them from 1.0.0 releases of packages it has nothing to do with.
//
// Precedent for the noise is not a reason to add more of it, and the
// asymmetry decides it: not commenting can be undone later, whereas
// commenting on the whole history cannot. Restoring the default is a
// one-line change once a tag exists and the range is bounded to this
// package's own commits — #706 tracks that.
successComment: false,
releasedLabels: false,
},
],
],
};
2 changes: 1 addition & 1 deletion eslint-plugin/src/generated/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated by scripts/gen-eslint-meta.mjs from the library's TSDoc.
// Do not edit by hand — run `pnpm gen:eslint-meta`, which `pnpm all` runs.
// Do not edit by hand — run `pnpm gen:eslint-meta`. CI fails on a stale one.

/** What a deprecated prop should become, and why it was deprecated. */
export interface Deprecation {
Expand Down
5 changes: 3 additions & 2 deletions scripts/consumer-sbom-meta.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ export function forLog(value) {
*
* Split on the LAST `@`, not the first: `@allxsmith/bestax-bulma@5.12.0` has
* two, and splitting on the first yields the empty package name and
* `allxsmith/bestax-bulma@5.12.0` as a version. Three of the four packages are
* unscoped and would hide this bug completely.
* `allxsmith/bestax-bulma@5.12.0` as a version. Most of the packages here are
* unscoped and would hide this bug completely, so the scoped ones are the
* only legs that exercise it.
*
* Returns null for anything that is not `<name>@<version>` rather than
* throwing: a tag this cannot parse is not an error, it is a release this job
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen-eslint-meta.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export function render({ deprecated, textAlias }) {
});

return `// Generated by scripts/gen-eslint-meta.mjs from the library's TSDoc.
// Do not edit by hand — run \`pnpm gen:eslint-meta\`, which \`pnpm all\` runs.
// Do not edit by hand — run \`pnpm gen:eslint-meta\`. CI fails on a stale one.

/** What a deprecated prop should become, and why it was deprecated. */
export interface Deprecation {
Expand Down
Loading