Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions packages/fresh/src/dev/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ export type ResolvedBuildConfig = Required<Omit<BuildOptions, "sourceMap">> & {
sourceMap?: FreshBundleOptions["sourceMap"];
};

/**
* @deprecated Use the Vite plugin (`@fresh/plugin-vite`) instead.
* The Builder class will be removed in a future version of Fresh.
*/
// deno-lint-ignore no-explicit-any
export class Builder<State = any> {
#transformer: FileTransformer;
Expand Down
35 changes: 25 additions & 10 deletions packages/fresh/src/dev/mod.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
export {
Builder,
type BuildOptions,
type ResolvedBuildConfig,
} from "./builder.ts";
export {
type OnTransformArgs,
type OnTransformOptions,
type TransformFn,
} from "./file_transformer.ts";
/**
* @deprecated Use the Vite plugin (`@fresh/plugin-vite`) instead.
* The Builder API will be removed in a future version of Fresh.
*/
export { Builder } from "./builder.ts";
/**
* @deprecated Use the Vite plugin (`@fresh/plugin-vite`) instead.
*/
export type { BuildOptions } from "./builder.ts";
/**
* @deprecated Use the Vite plugin (`@fresh/plugin-vite`) instead.
*/
export type { ResolvedBuildConfig } from "./builder.ts";
/**
* @deprecated Use the Vite plugin (`@fresh/plugin-vite`) instead.
*/
export type { OnTransformArgs } from "./file_transformer.ts";
/**
* @deprecated Use the Vite plugin (`@fresh/plugin-vite`) instead.
*/
export type { OnTransformOptions } from "./file_transformer.ts";
/**
* @deprecated Use the Vite plugin (`@fresh/plugin-vite`) instead.
*/
export type { TransformFn } from "./file_transformer.ts";
13 changes: 12 additions & 1 deletion packages/init/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ ${colors.rgb8("OPTIONS:", 3)}
${colors.rgb8("--tailwind", 2)} Use Tailwind for styling
${colors.rgb8("--vscode", 2)} Setup project for VS Code
${colors.rgb8("--docker", 2)} Setup Project to use Docker
${colors.rgb8("--builder", 2)} Setup with builder instead of vite
${
colors.rgb8("--builder", 2)
} (Deprecated) Setup with builder instead of vite
${colors.rgb8("--help, -h", 2)} Show this help message
`;

Expand Down Expand Up @@ -141,6 +143,15 @@ export async function initProject(

const useVite = !flags.builder;

if (flags.builder) {
console.log(
"\n%cWarning:%c The --builder flag is deprecated. The Builder API will be removed in a future version of Fresh. Use Vite instead (the default).",
"color: yellow; font-weight: bold",
"",
);
console.log();
}

const useDocker = flags.docker;
let useTailwind = flags.tailwind || false;
if (flags.tailwind == null) {
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-tailwindcss-v3/src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import cssnano from "cssnano";
import autoprefixer from "autoprefixer";
import * as path from "@std/path";

/**
* @deprecated Use the Vite plugin with `@tailwindcss/vite` instead.
*/
export interface AutoprefixerOptions {
/** environment for `Browserslist` */
env?: string;
Expand Down Expand Up @@ -46,10 +49,17 @@ export interface AutoprefixerOptions {
ignoreUnknownVersions?: boolean;
}

/**
* @deprecated Use the Vite plugin with `@tailwindcss/vite` instead.
*/
export interface TailwindPluginOptions {
autoprefixer?: AutoprefixerOptions;
}

/**
* @deprecated Use the Vite plugin with `@tailwindcss/vite` instead.
* This plugin is only compatible with the legacy Builder API.
*/
export function tailwind(
builder: Builder,
options: TailwindPluginOptions = {},
Expand Down
8 changes: 7 additions & 1 deletion packages/plugin-tailwindcss/src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ import twPostcss from "@tailwindcss/postcss";
import postcss from "postcss";
import type { TailwindPluginOptions } from "./types.ts";

// Re-export types for public API
/**
* @deprecated Use the Vite plugin with `@tailwindcss/vite` instead.
*/
export type { TailwindPluginOptions } from "./types.ts";

/**
* @deprecated Use the Vite plugin with `@tailwindcss/vite` instead.
* This plugin is only compatible with the legacy Builder API.
*/
export function tailwind(
builder: Builder,
options: TailwindPluginOptions = {},
Expand Down
Loading