@weapp-tailwindcss/cli 4.0.0-alpha.9 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,163 +1,4 @@
1
- import { WatchOptions } from 'gulp';
2
- import { Settings } from 'gulp-typescript';
3
- import { Result } from 'postcss-load-config';
4
- import { Options } from 'sass';
5
- import { UserDefinedOptions } from 'weapp-tailwindcss';
6
- import { FSWatcher } from 'fs-extra';
7
- import { Command } from 'commander';
8
- import * as cosmiconfig from 'cosmiconfig';
9
-
10
- declare class GlobsSet {
11
- includeSet: Set<string>;
12
- excludeSet: Set<string>;
13
- constructor();
14
- isExcludeGlob(value: string): boolean;
15
- addSingle(value: string): Set<string>;
16
- add(...value: string[] | string[][]): void;
17
- dump(): string[];
18
- dumpIgnored(): string[];
19
- }
20
-
21
- declare enum AssetType {
22
- JavaScript = "javascript",
23
- Json = "json",
24
- Css = "css",
25
- Html = "html"
26
- }
27
-
28
- interface GulpLessOptions {
29
- modifyVars?: object | undefined;
30
- paths?: string[] | undefined;
31
- plugins?: any[] | undefined;
32
- relativeUrls?: boolean | undefined;
33
- }
34
- interface GulpSassOptions extends Options<'sync'> {
35
- errLogToConsole?: boolean | undefined;
36
- onSuccess?: ((css: string) => any) | undefined;
37
- onError?: ((err: Error) => any) | undefined;
38
- sync?: boolean | undefined;
39
- }
40
- interface BuildOptions {
41
- /**
42
- * @group 0.重要配置
43
- * @description 传递给 `weapp-tailwindcss` 的选项, [参考配置](/docs/api/interfaces/UserDefinedOptions)
44
- */
45
- weappTailwindcssOptions: UserDefinedOptions;
46
- /**
47
- * @group 1.打包配置
48
- * @default `dist`
49
- * @description 输出目录
50
- */
51
- outDir: string;
52
- /**
53
- * @group 1.打包配置
54
- * @default `process.cwd()`
55
- * @description 根目录
56
- */
57
- root: string;
58
- /**
59
- * @group 3.一般配置
60
- * @default `true`
61
- * @description build 的时候是否清除
62
- */
63
- clean: boolean;
64
- /**
65
- * @group 1.打包配置
66
- * @default `.`
67
- * @description src 目录,相对路径,通常用于原生 typescript 项目
68
- */
69
- src: string;
70
- /**
71
- * @group 1.打包配置
72
- * @description 排除的文件目录
73
- */
74
- exclude: string[] | ((type: AssetType) => string[]);
75
- /**
76
- * @group 1.打包配置
77
- * @description 包括的文件目录
78
- */
79
- include: string[] | ((type: AssetType) => string[]);
80
- /**
81
- * @group 1.打包配置
82
- * @description 包括的文件后缀分类
83
- */
84
- extensions: {
85
- javascript?: string[];
86
- html?: string[];
87
- css?: string[];
88
- json?: string[];
89
- };
90
- /**
91
- * @group 1.打包配置
92
- * @description postcss 配置,默认会去请求 `root` 下的 `postcss.config.js`
93
- */
94
- postcssOptions?: Partial<Omit<Result, 'file'>>;
95
- /**
96
- * @group 2.编译支持
97
- * @description 预处理配置,支持 sass 和 less,需要传入来开启编译
98
- * @description 启用 sass 需要安装 sass, less 同样
99
- */
100
- preprocessorOptions?: {
101
- sass?: boolean | GulpSassOptions;
102
- less?: boolean | GulpLessOptions;
103
- };
104
- /**
105
- * @group 1.打包配置
106
- * @description weapp-tw dev 的 watch 配置
107
- */
108
- watchOptions: WatchOptions;
109
- /**
110
- * @group 2.编译支持
111
- * @description typescript 的编译配置,默认不传为不编译 ts
112
- * @description 需要安装 typescript
113
- */
114
- typescriptOptions: boolean | {
115
- settings?: Settings;
116
- tsConfigFileName?: string;
117
- };
118
- /**
119
- * @group 2.编译支持
120
- * @description 扩展 cli 里默认的 gulp 文件流处理方式
121
- * 第一个参数为原型注册的内置插件, 第二个参数为处理的文件类型
122
- * 返回一个新的插件数组为取代原先的处理流程,返回 undefined 为使用默认处理流程
123
- */
124
- gulpChain: (plugins: any[], type: AssetType) => any[] | undefined;
125
- }
126
- type UserConfig = Partial<BuildOptions>;
127
-
128
- declare function createBuilder(options?: Partial<BuildOptions>): Promise<{
129
- watcher: FSWatcher | undefined;
130
- build(): Promise</*elided*/ any>;
131
- watch(): Promise</*elided*/ any>;
132
- globsSet: GlobsSet;
133
- clean: () => Promise<void>;
134
- }>;
135
- declare function build(options?: Partial<BuildOptions>): Promise<{
136
- watcher: FSWatcher | undefined;
137
- build(): Promise</*elided*/ any>;
138
- watch(): Promise</*elided*/ any>;
139
- globsSet: GlobsSet;
140
- clean: () => Promise<void>;
141
- }>;
142
- declare function watch(options?: Partial<BuildOptions>): Promise<{
143
- watcher: FSWatcher | undefined;
144
- build(): Promise</*elided*/ any>;
145
- watch(): Promise</*elided*/ any>;
146
- globsSet: GlobsSet;
147
- clean: () => Promise<void>;
148
- }>;
149
-
150
- declare function createCli(): Command;
151
-
152
- interface WeappTwCosmiconfigResult {
153
- config: BuildOptions;
154
- filepath: string;
155
- isEmpty?: boolean;
156
- }
157
- declare function createConfigLoader(root: string): {
158
- search: (searchFrom?: string) => WeappTwCosmiconfigResult | undefined;
159
- load: (filepath: string) => cosmiconfig.CosmiconfigResult;
160
- };
161
- declare function defineConfig(options: Partial<BuildOptions>): Partial<BuildOptions>;
162
-
163
- export { type UserConfig, build, createBuilder, createCli, createConfigLoader, defineConfig, watch };
1
+ //#region src/index.d.ts
2
+ declare function runCli(argv?: string[]): Promise<string | number>;
3
+ //#endregion
4
+ export { runCli };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import { t as runCli } from "./src-CiuzVG0J.js";
2
+ export { runCli };