Skip to content

build: per-package format scripts flag generated lib/ files and fail #957

Open

Description

@bpowers

pnpm -C src/server run needs-format fails on a clean tree, and the diagram package's version reports dozens of false positives.
The per-package needs-format and format scripts glob '**/*.ts' '**/*.tsx', which picks up generated .d.ts files under each package's gitignored lib/ directory (prettier does not read .gitignore, and the repo has no .prettierignore).
The server package also has no .tsx files, so prettier exits 2 with No files matching the pattern were found: "**/*.tsx".

Why it matters

Low.
Neither the pre-commit hook nor CI uses these scripts: both run the root pnpm js-needs-format, which already filters out lib/ directories.
The per-package scripts are just broken shortcuts that mislead whoever runs them.
src/app and src/notebook-widget use the same globs and would break the same way if they ever emit .ts files into a build directory.

Fix

Delete the needs-format and format scripts from the packages that glob **/*.ts (server, diagram, app, notebook-widget), and point people at the root pnpm js-needs-format / pnpm js-format.
Alternative: keep them, but scope the globs to source directories the way src/core and src/engine already do, and add --no-error-on-unmatched-pattern.

Pointers

  • src/server/package.json, src/diagram/package.json, src/app/package.json, src/notebook-widget/package.json (needs-format, format)
  • root package.json (js-needs-format, js-format)

Activity

  1. added
    bug
    on Jul 13, 2026
  2. changed the title [-]server: needs-format/format scripts are broken -- glob generated lib/ output and error on a non-matching tsx pattern[/-] [+]build: per-package needs-format/format prettier scripts glob generated lib/ output (server, diagram); server also errors on a non-matching tsx pattern[/+] on Jul 13, 2026
  3. added
    ci
    on Oct 12, 2026
  4. changed the title [-]build: per-package needs-format/format prettier scripts glob generated lib/ output (server, diagram); server also errors on a non-matching tsx pattern[/-] [+]build: per-package format scripts flag generated lib/ files and fail[/+] on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugci

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions