@weapp-tailwindcss/cli 0.0.0-alpha.5 → 0.0.0-alpha.7

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.cts CHANGED
@@ -3,6 +3,8 @@ import { FSWatcher } from 'fs-extra';
3
3
  import { UserDefinedOptions } from 'weapp-tailwindcss';
4
4
  import { WatchOptions } from 'gulp';
5
5
  import { Result } from 'postcss-load-config';
6
+ import { Options } from 'sass';
7
+ import { Settings } from 'gulp-typescript';
6
8
  import * as cosmiconfig from 'cosmiconfig';
7
9
 
8
10
  declare function createCli(): Command;
@@ -14,6 +16,18 @@ declare enum AssetType {
14
16
  Html = "html"
15
17
  }
16
18
 
19
+ interface GulpLessOptions {
20
+ modifyVars?: object | undefined;
21
+ paths?: string[] | undefined;
22
+ plugins?: any[] | undefined;
23
+ relativeUrls?: boolean | undefined;
24
+ }
25
+ interface GulpSassOptions extends Options<'sync'> {
26
+ errLogToConsole?: boolean | undefined;
27
+ onSuccess?: ((css: string) => any) | undefined;
28
+ onError?: ((err: Error) => any) | undefined;
29
+ sync?: boolean | undefined;
30
+ }
17
31
  interface BuildOptions {
18
32
  weappTailwindcssOptions: UserDefinedOptions;
19
33
  outDir: string;
@@ -23,21 +37,30 @@ interface BuildOptions {
23
37
  exclude: string[] | ((type: AssetType) => string[]);
24
38
  include: string[] | ((type: AssetType) => string[]);
25
39
  extensions: {
26
- javascript: string[];
27
- html: string[];
28
- css: string[];
29
- json: string[];
40
+ javascript?: string[];
41
+ html?: string[];
42
+ css?: string[];
43
+ json?: string[];
30
44
  };
31
45
  postcssOptions?: Partial<Omit<Result, 'file'>>;
46
+ preprocessorOptions?: {
47
+ sass?: boolean | GulpSassOptions;
48
+ less?: boolean | GulpLessOptions;
49
+ };
32
50
  watchOptions: WatchOptions;
51
+ typescriptOptions: boolean | {
52
+ settings?: Settings;
53
+ tsConfigFileName?: string;
54
+ };
33
55
  }
56
+ type UserConfig = Partial<BuildOptions>;
34
57
 
35
- declare function createBuilder(options?: Partial<BuildOptions>): {
58
+ declare function createBuilder(options?: Partial<BuildOptions>): Promise<{
36
59
  watcher: FSWatcher | undefined;
37
60
  build(): Promise<any>;
38
61
  watch(): any;
39
62
  globsSet: Set<string>;
40
- };
63
+ }>;
41
64
  declare function build(options?: Partial<BuildOptions>): Promise<{
42
65
  watcher: FSWatcher | undefined;
43
66
  build(): Promise<any>;
@@ -52,7 +75,7 @@ declare function watch(options?: Partial<BuildOptions>): Promise<{
52
75
  }>;
53
76
 
54
77
  type WeappTwCosmiconfigResult = {
55
- config: UserConfig;
78
+ config: BuildOptions;
56
79
  filepath: string;
57
80
  isEmpty?: boolean;
58
81
  };
@@ -60,13 +83,6 @@ declare function createConfigLoader(root: string): {
60
83
  search: (searchFrom?: string) => WeappTwCosmiconfigResult | undefined;
61
84
  load: (filepath: string) => cosmiconfig.CosmiconfigResult;
62
85
  };
63
- type UserConfig = {
64
- outDir?: string;
65
- root?: string;
66
- srcDir?: string;
67
- weappTailwindcssOptions?: UserDefinedOptions;
68
- clean?: boolean;
69
- };
70
- declare function defineConfig(options: UserConfig): UserConfig;
86
+ declare function defineConfig(options: Partial<BuildOptions>): Partial<BuildOptions>;
71
87
 
72
88
  export { type UserConfig, build, createBuilder, createCli, createConfigLoader, defineConfig, watch };
package/dist/index.d.mts CHANGED
@@ -3,6 +3,8 @@ import { FSWatcher } from 'fs-extra';
3
3
  import { UserDefinedOptions } from 'weapp-tailwindcss';
4
4
  import { WatchOptions } from 'gulp';
5
5
  import { Result } from 'postcss-load-config';
6
+ import { Options } from 'sass';
7
+ import { Settings } from 'gulp-typescript';
6
8
  import * as cosmiconfig from 'cosmiconfig';
7
9
 
8
10
  declare function createCli(): Command;
@@ -14,6 +16,18 @@ declare enum AssetType {
14
16
  Html = "html"
15
17
  }
16
18
 
19
+ interface GulpLessOptions {
20
+ modifyVars?: object | undefined;
21
+ paths?: string[] | undefined;
22
+ plugins?: any[] | undefined;
23
+ relativeUrls?: boolean | undefined;
24
+ }
25
+ interface GulpSassOptions extends Options<'sync'> {
26
+ errLogToConsole?: boolean | undefined;
27
+ onSuccess?: ((css: string) => any) | undefined;
28
+ onError?: ((err: Error) => any) | undefined;
29
+ sync?: boolean | undefined;
30
+ }
17
31
  interface BuildOptions {
18
32
  weappTailwindcssOptions: UserDefinedOptions;
19
33
  outDir: string;
@@ -23,21 +37,30 @@ interface BuildOptions {
23
37
  exclude: string[] | ((type: AssetType) => string[]);
24
38
  include: string[] | ((type: AssetType) => string[]);
25
39
  extensions: {
26
- javascript: string[];
27
- html: string[];
28
- css: string[];
29
- json: string[];
40
+ javascript?: string[];
41
+ html?: string[];
42
+ css?: string[];
43
+ json?: string[];
30
44
  };
31
45
  postcssOptions?: Partial<Omit<Result, 'file'>>;
46
+ preprocessorOptions?: {
47
+ sass?: boolean | GulpSassOptions;
48
+ less?: boolean | GulpLessOptions;
49
+ };
32
50
  watchOptions: WatchOptions;
51
+ typescriptOptions: boolean | {
52
+ settings?: Settings;
53
+ tsConfigFileName?: string;
54
+ };
33
55
  }
56
+ type UserConfig = Partial<BuildOptions>;
34
57
 
35
- declare function createBuilder(options?: Partial<BuildOptions>): {
58
+ declare function createBuilder(options?: Partial<BuildOptions>): Promise<{
36
59
  watcher: FSWatcher | undefined;
37
60
  build(): Promise<any>;
38
61
  watch(): any;
39
62
  globsSet: Set<string>;
40
- };
63
+ }>;
41
64
  declare function build(options?: Partial<BuildOptions>): Promise<{
42
65
  watcher: FSWatcher | undefined;
43
66
  build(): Promise<any>;
@@ -52,7 +75,7 @@ declare function watch(options?: Partial<BuildOptions>): Promise<{
52
75
  }>;
53
76
 
54
77
  type WeappTwCosmiconfigResult = {
55
- config: UserConfig;
78
+ config: BuildOptions;
56
79
  filepath: string;
57
80
  isEmpty?: boolean;
58
81
  };
@@ -60,13 +83,6 @@ declare function createConfigLoader(root: string): {
60
83
  search: (searchFrom?: string) => WeappTwCosmiconfigResult | undefined;
61
84
  load: (filepath: string) => cosmiconfig.CosmiconfigResult;
62
85
  };
63
- type UserConfig = {
64
- outDir?: string;
65
- root?: string;
66
- srcDir?: string;
67
- weappTailwindcssOptions?: UserDefinedOptions;
68
- clean?: boolean;
69
- };
70
- declare function defineConfig(options: UserConfig): UserConfig;
86
+ declare function defineConfig(options: Partial<BuildOptions>): Partial<BuildOptions>;
71
87
 
72
88
  export { type UserConfig, build, createBuilder, createCli, createConfigLoader, defineConfig, watch };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ import { FSWatcher } from 'fs-extra';
3
3
  import { UserDefinedOptions } from 'weapp-tailwindcss';
4
4
  import { WatchOptions } from 'gulp';
5
5
  import { Result } from 'postcss-load-config';
6
+ import { Options } from 'sass';
7
+ import { Settings } from 'gulp-typescript';
6
8
  import * as cosmiconfig from 'cosmiconfig';
7
9
 
8
10
  declare function createCli(): Command;
@@ -14,6 +16,18 @@ declare enum AssetType {
14
16
  Html = "html"
15
17
  }
16
18
 
19
+ interface GulpLessOptions {
20
+ modifyVars?: object | undefined;
21
+ paths?: string[] | undefined;
22
+ plugins?: any[] | undefined;
23
+ relativeUrls?: boolean | undefined;
24
+ }
25
+ interface GulpSassOptions extends Options<'sync'> {
26
+ errLogToConsole?: boolean | undefined;
27
+ onSuccess?: ((css: string) => any) | undefined;
28
+ onError?: ((err: Error) => any) | undefined;
29
+ sync?: boolean | undefined;
30
+ }
17
31
  interface BuildOptions {
18
32
  weappTailwindcssOptions: UserDefinedOptions;
19
33
  outDir: string;
@@ -23,21 +37,30 @@ interface BuildOptions {
23
37
  exclude: string[] | ((type: AssetType) => string[]);
24
38
  include: string[] | ((type: AssetType) => string[]);
25
39
  extensions: {
26
- javascript: string[];
27
- html: string[];
28
- css: string[];
29
- json: string[];
40
+ javascript?: string[];
41
+ html?: string[];
42
+ css?: string[];
43
+ json?: string[];
30
44
  };
31
45
  postcssOptions?: Partial<Omit<Result, 'file'>>;
46
+ preprocessorOptions?: {
47
+ sass?: boolean | GulpSassOptions;
48
+ less?: boolean | GulpLessOptions;
49
+ };
32
50
  watchOptions: WatchOptions;
51
+ typescriptOptions: boolean | {
52
+ settings?: Settings;
53
+ tsConfigFileName?: string;
54
+ };
33
55
  }
56
+ type UserConfig = Partial<BuildOptions>;
34
57
 
35
- declare function createBuilder(options?: Partial<BuildOptions>): {
58
+ declare function createBuilder(options?: Partial<BuildOptions>): Promise<{
36
59
  watcher: FSWatcher | undefined;
37
60
  build(): Promise<any>;
38
61
  watch(): any;
39
62
  globsSet: Set<string>;
40
- };
63
+ }>;
41
64
  declare function build(options?: Partial<BuildOptions>): Promise<{
42
65
  watcher: FSWatcher | undefined;
43
66
  build(): Promise<any>;
@@ -52,7 +75,7 @@ declare function watch(options?: Partial<BuildOptions>): Promise<{
52
75
  }>;
53
76
 
54
77
  type WeappTwCosmiconfigResult = {
55
- config: UserConfig;
78
+ config: BuildOptions;
56
79
  filepath: string;
57
80
  isEmpty?: boolean;
58
81
  };
@@ -60,13 +83,6 @@ declare function createConfigLoader(root: string): {
60
83
  search: (searchFrom?: string) => WeappTwCosmiconfigResult | undefined;
61
84
  load: (filepath: string) => cosmiconfig.CosmiconfigResult;
62
85
  };
63
- type UserConfig = {
64
- outDir?: string;
65
- root?: string;
66
- srcDir?: string;
67
- weappTailwindcssOptions?: UserDefinedOptions;
68
- clean?: boolean;
69
- };
70
- declare function defineConfig(options: UserConfig): UserConfig;
86
+ declare function defineConfig(options: Partial<BuildOptions>): Partial<BuildOptions>;
71
87
 
72
88
  export { type UserConfig, build, createBuilder, createCli, createConfigLoader, defineConfig, watch };