chore: deprecate legacy Builder API#3758
Conversation
Adds @deprecated JSDoc tags to all public exports in: - @fresh/core/dev (Builder, BuildOptions, ResolvedBuildConfig, etc.) - @fresh/plugin-tailwind (tailwind function, TailwindPluginOptions) - @fresh/plugin-tailwind-v3 (all exports) Also marks the --builder flag in @fresh/init as deprecated in help text and prints a warning when it's used. Closes #3635 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
lunadogbot
left a comment
There was a problem hiding this comment.
Scope is clean: JSDoc @deprecated on Builder, the five re-exported types, both Tailwind tailwind() entrypoints, and a runtime warning + help-text marker for --builder in @fresh/init. Lockfile untouched. Closes #3635. CI green; the failing deploy/deno/fresh preview is unrelated to a docstring/console-warn change and the sibling deploy/deno/denoland-fresh deploy is green.
One thing worth a follow-up: www/dev.ts:3 and packages/init/src/init.ts:559 still import { Builder } from "fresh/dev", so the docs site and the init scaffolder will themselves emit deprecation warnings in IDEs after this lands. The init.ts import is required by the --builder codegen path so that one can stay; www/ is the natural candidate to migrate next (or // deno-lint-ignore deprecation if migration is deferred).
- nit: the runtime warning at
packages/init/src/init.ts:148says "Use Vite instead (the default)" but doesn't point at the migration docs — a link would save users a search. - nit: the test-plan items in the PR body are unchecked; worth running
deno run -A jsr:@fresh/init --builder .once before merging to confirm the warning renders the way you want.
Summary
@deprecatedJSDoc tags to all public exports from@fresh/core/dev(Builder, BuildOptions, ResolvedBuildConfig, OnTransformArgs, OnTransformOptions, TransformFn)@deprecatedJSDoc tags to@fresh/plugin-tailwindand@fresh/plugin-tailwind-v3exports--builderflag in@fresh/inithelp text to show "(Deprecated)"--builderflag is used during initAll deprecation notices point users to the Vite plugin as the replacement.
Closes #3635
Test plan
Builder,BuildOptions, etc. when imported fromfresh/devdeno run -A jsr:@fresh/init --builder .and verify deprecation warning is printed🤖 Generated with Claude Code