BREAKING(core): remove FreshBuilder interface (#2935)
Once can just use `Builder` for typing. --------- Co-authored-by: Marvin Hagemeister <marvin@deno.com>
This commit is contained in:
co-authored by
Marvin Hagemeister
parent
958b9528cc
commit
83da608504
@@ -1,10 +1,10 @@
|
||||
import type { TailwindPluginOptions } from "./types.ts";
|
||||
import { initTailwind } from "./compiler.ts";
|
||||
import type { FreshBuilder } from "fresh/dev";
|
||||
import type { Builder } from "fresh/dev";
|
||||
import type { App } from "fresh";
|
||||
|
||||
export function tailwind<T>(
|
||||
builder: FreshBuilder,
|
||||
builder: Builder,
|
||||
app: App<T>,
|
||||
options: TailwindPluginOptions = {},
|
||||
): void {
|
||||
|
||||
+4
-13
@@ -35,24 +35,15 @@ export interface BuildOptions {
|
||||
target?: string | string[];
|
||||
}
|
||||
|
||||
export interface FreshBuilder {
|
||||
onTransformStaticFile(
|
||||
options: OnTransformOptions,
|
||||
callback: TransformFn,
|
||||
): void;
|
||||
build<T>(app: App<T>, options?: BuildOptions): Promise<void>;
|
||||
listen<T>(app: App<T>, options?: ListenOptions & BuildOptions): Promise<void>;
|
||||
}
|
||||
|
||||
export class Builder implements FreshBuilder {
|
||||
export class Builder {
|
||||
#transformer = new FreshFileTransformer(fsAdapter);
|
||||
#addedInternalTransforms = false;
|
||||
#options: { target: string | string[] };
|
||||
#options: Required<BuildOptions>;
|
||||
#chunksReady = Promise.withResolvers<void>();
|
||||
|
||||
constructor(options: BuildOptions = {}) {
|
||||
constructor(options?: BuildOptions) {
|
||||
this.#options = {
|
||||
target: options.target ?? ["chrome99", "firefox99", "safari15"],
|
||||
target: options?.target ?? ["chrome99", "firefox99", "safari15"],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
export { Builder, type FreshBuilder } from "./builder.ts";
|
||||
export { Builder } from "./builder.ts";
|
||||
export {
|
||||
type OnTransformArgs,
|
||||
type OnTransformOptions,
|
||||
|
||||
Reference in New Issue
Block a user