WordPress / WordPress/block-development-examples

_bin CLI: no type-checking, dead npm hook that breaks table regeneration, docs describing nonexistent automation

Open
#154 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
334
Forks
52
PR merge metrics
No merged PRs in 30d

Description

Problem

The _bin/ TypeScript CLI maintains the README examples table and the dates metadata, but nothing keeps it healthy:

  • No type-checking anywhere. It runs via ts-node (which skips type checks), .eslintrc ignores _bin/**/* entirely, and no script or workflow runs tsc --noEmit_bin/README.md itself admits types are left to the editor. A type error ships silently until someone runs the command.
  • Dead npm hook: "postcreate-example:new" in root package.json never fires — npm's post-hook for the create-example script would be named postcreate-example. The intended "install + regenerate the README table after scaffolding" step silently doesn't happen, which is one likely source of _data/README drift (#152).
  • Docs describe things that don't exist: _bin/README.md references a CHANGELOG.md and a GitHub Action update-dates.yml; neither exists in the repo. dates:update is manual-only despite the docs claiming automation.
  • Unpinned scaffold: create-example invokes @wordpress/create-block@latest, so newly scaffolded examples drift from the repo's toolchain baseline.
  • Dead constant: _bin/src/constants.ts exports PROJECT_FOLDER_NAME = 'bde-fork' (a leftover developer-local fork name) that nothing references.
Proposed fix
  1. Add a "typecheck": "tsc --noEmit -p _bin/tsconfig.json" script and wire it into static-linting.yml (eslint coverage for _bin deliberately skipped — tsc gives most of the value without TS-parser config work).
  2. Rename the hook to postcreate-example so table regeneration actually runs after scaffolding.
  3. Fix _bin/README.md: remove the CHANGELOG.md reference and document dates:update as a manual maintainer step (no update-dates.yml automation — the repo's change velocity doesn't justify a bot PR loop).
  4. Pin the @wordpress/create-block version in create-example to match the repo's wp-scripts baseline (see #150 PR 2).
  5. Delete the dead PROJECT_FOLDER_NAME constant.
Out of scope
  • _data content fixes (#152); devDependency pruning (#153).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with package.json, _bin/tsconfig.json, static-linting.yml, _bin/README.md, and _bin/src/constants.ts. Check the existing create-example script, linting workflow, CLI documentation, and constant references before making the requested maintenance changes. Done means type-checking is wired into CI, the hook and scaffold version are corrected, stale documentation is removed, and the unused constant is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript, typescript, wordpress
Domain
ci-cd, cli, documentation, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.