build: normalize typetest script presence across client release group#27345
build: normalize typetest script presence across client release group#27345jatgarg wants to merge 6 commits into
Conversation
Output of `pnpm exec flub typetests -g client --normalize`. Reconciles each package's `typetests:gen` script presence with its `typeValidation.disabled` state: - Removes the stale `typetests:gen` script from 10 packages whose `typeValidation.disabled` is already `true` (sequence-deprecated, ink, legacy-dds, attributor, fluid-telemetry, dds-interceptions, tree-agent and its variants, type-factory). - Adds the missing `typetests:gen` script to 2 packages whose type tests are enabled (fluid-framework, presence-definitions). This unblocks the `fluid-build-tasks-tsc` policy check, which enforces that the `tsc` task depend on `typetests:gen` whenever the script exists. Prior drift had left disabled packages with stale scripts (policy fail) and enabled packages without the script (silent skip during release type-test runs). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (2119 lines, 17 files), I've queued these reviewers:
How this works
|
…itions Output of `pnpm exec flub typetests --disable --normalize --reset` applied to fluid-framework and presence-definitions. Follow-up to the prior normalize commit on this branch, which added typetests:gen scripts to these two packages on the assumption type tests were viable. In practice neither package can generate type tests against the current published baseline: - fluid-framework: flub's default entrypoint is "legacy/alpha", which is not exported by fluid-framework@2.92.0 (the current -previous) or any later published version. - @fluid-internal/presence-definitions: typeValidation.entrypoint is "beta", but the current package's exports map has no "./beta" entrypoint, so flub's emitted import of "@fluid-internal/presence-definitions/beta" fails to resolve at tsc time. Without typetests:gen scripts and -previous deps these packages no longer trip the fluid-build-tasks-tsc policy (which requires tsc to depend on typetests:gen when both exist and there is no build:test script). Matches the 2.92.1 precedent from PR microsoft#26930. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Removes orphan `fluid-framework@2.92.0` and `@fluidframework/presence@2.92.0` entries from pnpm-lock.yaml that are no longer referenced after disabling type tests for fluid-framework and presence-definitions in the previous commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After disabling type tests for @fluid-internal/presence-definitions in the prior commit, the previously-generated validatePresenceDefinitionsPrevious.generated.ts still tried to import from "@fluid-internal/presence-definitions-previous/beta" — which no longer resolves because the -previous dep was removed. tsc on src/test/tsconfig.json failed as a result. flub deletes the generated file when typetests:gen runs against a disabled package, but no typetests:gen run happened on this branch (disabling removed the script). Removing the stale file manually. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| } | ||
| }, | ||
| "typeValidation": { | ||
| "entrypoint": "beta", |
There was a problem hiding this comment.
@jason-ha : This seems odd. I see the "typetests:gen-disabled": "flub generate typetests --dir . -v" script above.
Is this intended to actually be enabled?
Now that there is a release of it, we could enable this, and test against that?
There was a problem hiding this comment.
@jatgarg Loking at the entry points that do exist, I think this should target public
| }, | ||
| "typeValidation": { | ||
| "broken": {} | ||
| "disabled": true |
There was a problem hiding this comment.
I think this one should target legacy, which I think should actually work (we don't have legacy beta, so we can't target that, so its either beta or legacy, and I think legacy makes more sense). Both of those include public, which for sure should be included.
…ypoint
The previous commit disabled type tests for presence-definitions
because the "beta" entrypoint setting did not resolve on the current
side — current @fluid-internal/presence-definitions only exports ".",
"./internal", and "./internal/workspace*".
The "." (public) entrypoint exposes the package's full type surface
on both sides:
- Current @fluid-internal/presence-definitions exports lib/index.d.ts
(Attendee, Presence, LatestMap, LatestMapRaw, NotificationsManager,
StatesWorkspace, AttendeeStatus, the Latest/LatestValue type
family, BroadcastControls, internal type utility re-exports).
- Previous @fluid-internal/presence-definitions@2.101.0 has the same
"." entrypoint with the same surface.
Switch to entrypoint: "public", restore the typetests:gen script and
-previous devDependency (pointing at the just-released 2.101.0 of
the renamed package), and regenerate the validation file. Full build
verified.
fluid-framework remains disabled — it would require adding test-build
infrastructure (src/test/tsconfig.{json,cjs.json} + build:test* scripts)
that the package has never had.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fluid-framework was disabled in PR microsoft#26930 because flub's default "legacy/alpha" entrypoint did not exist in any published version, and the package lacked the test-compilation infrastructure that other type-tested packages in the repo have. Add the missing infrastructure (modeled after presence-definitions): - src/test/tsconfig.json (ESM) and src/test/tsconfig.cjs.json (CJS), to compile generated type-test files - build:test, build:test:esm, build:test:cjs scripts - typetests:gen script - fluid-framework-previous devDependency at npm:fluid-framework@2.101.0 Set typeValidation.entrypoint to "public" — exists on both current and 2.101.0 baseline as the "." export. Regenerate the validation file against the 2.101.0 baseline. With build:test now in place, the fluid-build-tasks-tsc policy is satisfied without needing a hand-coded cross-package dep list. Full build verified (1295 tasks, 54.8s). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Description
Output of
pnpm exec flub typetests -g client --normalize. Reconciles each package'stypetests:genscript presence with itstypeValidation.disabledstate:Removes the stale
typetests:genscript from 10 packages whosetypeValidation.disabledis alreadytrue(sequence-deprecated, ink, legacy-dds, attributor, fluid-telemetry, dds-interceptions, tree-agent and its variants, type-factory).fluid-framework: no version of the package exposes flub's default "legacy/alpha" entrypoint; it's an aggregator and constituent packages already provide
type-test coverage.
@fluid-internal/presence-definitions: test against "./public" entrypoint.