@windicss/plugin-utils
Advanced tools
Comparing version 0.9.11 to 0.10.0
@@ -1,3 +0,3 @@ | ||
import { Config } from 'windicss/types/interfaces'; | ||
export { Config as WindiCssOptions } from 'windicss/types/interfaces'; | ||
import { FullConfig } from 'windicss/types/interfaces'; | ||
export { FullConfig as WindiCssOptions } from 'windicss/types/interfaces'; | ||
import WindiCssProcessor from 'windicss'; | ||
@@ -13,2 +13,4 @@ import { generateCompletions } from 'windicss/utils'; | ||
declare function defineConfig(config: FullConfig): FullConfig; | ||
interface TransformerOptions { | ||
@@ -29,5 +31,7 @@ include?: RegExp[]; | ||
*/ | ||
config?: Config | string; | ||
config?: FullConfig | string; | ||
/** | ||
* Safe class names to be always included. | ||
* | ||
* @deprecated define this field in the windicss.config.ts instead | ||
*/ | ||
@@ -37,2 +41,4 @@ safelist?: string | (string | string[])[]; | ||
* Class names to be always excluded. | ||
* | ||
* @deprecated define this field in the windicss.config.ts instead | ||
*/ | ||
@@ -43,2 +49,3 @@ blocklist?: string | (string | string[])[]; | ||
* | ||
* @deprecated define this field in the windicss.config.ts instead | ||
* @default true | ||
@@ -49,6 +56,16 @@ */ | ||
* Enable all the preflight regardless the template | ||
* | ||
* @deprecated | ||
*/ | ||
enableAll?: boolean; | ||
/** | ||
* Enable all the preflight regardless the template | ||
* | ||
* @deprecated define this field in the windicss.config.ts instead | ||
*/ | ||
includeAll?: boolean; | ||
/** | ||
* Safelist to always included | ||
* | ||
* @deprecated define this field in the windicss.config.ts instead | ||
*/ | ||
@@ -58,2 +75,4 @@ safelist?: string | (string | string[])[]; | ||
* Blocklist to always excluded | ||
* | ||
* @deprecated define this field in the windicss.config.ts instead | ||
*/ | ||
@@ -67,2 +86,3 @@ blocklist?: string | (string | string[])[]; | ||
* @default true | ||
* @deprecated define this field in the windicss.config.ts instead | ||
*/ | ||
@@ -72,2 +92,3 @@ includeBase?: boolean; | ||
* @default true | ||
* @deprecated define this field in the windicss.config.ts instead | ||
*/ | ||
@@ -77,2 +98,3 @@ includeGlobal?: boolean; | ||
* @default true | ||
* @deprecated define this field in the windicss.config.ts instead | ||
*/ | ||
@@ -166,3 +188,3 @@ includePlugin?: boolean; | ||
*/ | ||
onOptionsResolved?: (options: ResolvedOptions) => ResolvedOptions | void; | ||
onOptionsResolved?: (options: ResolvedOptions) => ResolvedOptions | void | Promise<ResolvedOptions | void>; | ||
/** | ||
@@ -172,3 +194,3 @@ * Callback when the windi config is resolved. Not to be confused with the options which are the top level way to | ||
*/ | ||
onConfigResolved?: (config: Config, configFilePath?: string) => Config | void; | ||
onConfigResolved?: (config: FullConfig, configFilePath?: string) => FullConfig | void | Promise<FullConfig | void>; | ||
} | ||
@@ -198,4 +220,8 @@ interface WindiPluginUtilsOptions { | ||
interface ResolvedOptions { | ||
config: string | Config | undefined; | ||
scan: boolean; | ||
config: FullConfig; | ||
configFilePath: string | undefined; | ||
enableScan: boolean; | ||
enablePreflight: boolean; | ||
transformCSS: boolean | 'pre' | 'auto' | 'post'; | ||
transformGroups: boolean; | ||
scanOptions: { | ||
@@ -209,3 +235,2 @@ fileExtensions: string[]; | ||
}; | ||
preflight: boolean; | ||
preflightOptions: { | ||
@@ -215,10 +240,12 @@ includeBase: boolean; | ||
includePlugin: boolean; | ||
includeAll: boolean; | ||
/** | ||
* @deprecated use includeAll | ||
*/ | ||
enableAll: boolean; | ||
safelist: Set<string>; | ||
blocklist: Set<string>; | ||
alias: Record<string, TagNames>; | ||
alias: Record<string, string>; | ||
}; | ||
root: string; | ||
transformCSS: boolean | 'pre' | 'auto' | 'post'; | ||
transformGroups: boolean; | ||
sortUtilities: boolean; | ||
@@ -232,8 +259,8 @@ safelist: Set<string>; | ||
} | ||
declare function resolveOptions(options?: UserOptions | ResolvedOptions): ResolvedOptions; | ||
declare function defineConfig(config: Config): Config; | ||
declare function toArray<T>(v: T | T[]): T[]; | ||
declare function flattenArray<T>(v: T | (T | T[])[]): T[]; | ||
declare type Arrayable<T> = T | T[]; | ||
declare type NestedArrayable<T> = T | (T | T[])[]; | ||
declare function toArray<T>(v: Arrayable<T>): T[]; | ||
declare function flattenArray<T>(v: NestedArrayable<T>): T[]; | ||
declare function mergeArrays<T>(...args: (NestedArrayable<T> | undefined)[]): T[]; | ||
declare function slash(str: string): string; | ||
@@ -251,4 +278,3 @@ declare function kebabCase(str: string): string; | ||
declare function createUtils(userOptions?: UserOptions | ResolvedOptions, utilsOptions?: WindiPluginUtilsOptions): { | ||
options: ResolvedOptions; | ||
init: () => void; | ||
init: () => Promise<WindiCssProcessor>; | ||
extractFile: (code: string, id?: string | undefined, applyGroupTransform?: boolean) => boolean; | ||
@@ -266,4 +292,2 @@ generateCSS: () => Promise<string>; | ||
scan: () => Promise<void>; | ||
files: string[]; | ||
globs: string[]; | ||
classesGenerated: Set<string>; | ||
@@ -281,2 +305,5 @@ classesPending: Set<string>; | ||
}; | ||
readonly options: ResolvedOptions; | ||
readonly files: string[]; | ||
readonly globs: string[]; | ||
readonly processor: WindiCssProcessor; | ||
@@ -289,2 +316,11 @@ readonly scanned: boolean; | ||
export { CompletionsResult, PugTransformer, ResolvedOptions, TagNames, Transformer, TransformerFunction, TransformerOptions, UserOptions, WindiPluginUtils, WindiPluginUtilsOptions, configureFiles, createUtils, defaultAlias, defineConfig, exclude, flattenArray, htmlTags, include, kebabCase, preflightTags, resolveOptions, slash, toArray, transformGroups, transformGroupsWithSourcemap }; | ||
declare function isResolvedOptions(options: UserOptions | ResolvedOptions): options is ResolvedOptions; | ||
declare function getDefaultTransformers(): TransformerFunction[]; | ||
declare function resolveOptions(options?: UserOptions | ResolvedOptions, utilsOptions?: WindiPluginUtilsOptions, loadConfigFile?: boolean): Promise<ResolvedOptions>; | ||
declare function loadConfiguration(options: UserOptions, utilsOptions: WindiPluginUtilsOptions): Promise<{ | ||
error: Error | undefined; | ||
resolved: FullConfig; | ||
configFilePath: string | undefined; | ||
}>; | ||
export { Arrayable, CompletionsResult, NestedArrayable, PugTransformer, ResolvedOptions, TagNames, Transformer, TransformerFunction, TransformerOptions, UserOptions, WindiPluginUtils, WindiPluginUtilsOptions, configureFiles, createUtils, defaultAlias, defineConfig, exclude, flattenArray, getDefaultTransformers, htmlTags, include, isResolvedOptions, kebabCase, loadConfiguration, mergeArrays, preflightTags, resolveOptions, slash, toArray, transformGroups, transformGroupsWithSourcemap }; |
{ | ||
"name": "@windicss/plugin-utils", | ||
"description": "Common utils for building integrations of Windi CSS", | ||
"version": "0.9.11", | ||
"version": "0.10.0", | ||
"main": "dist/index.js", | ||
@@ -34,3 +34,3 @@ "module": "dist/index.mjs", | ||
"sucrase": "^3.17.1", | ||
"windicss": "^2.5.4" | ||
"windicss": "^2.5.5" | ||
}, | ||
@@ -37,0 +37,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
4235441
129501
Updatedwindicss@^2.5.5