@weapp-tailwindcss/cli 1.0.7 → 1.0.9-alpha.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.cjs +30 -12
- package/dist/index.d.cts +6 -3
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.mjs +31 -13
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -88,7 +88,7 @@ function createDefu(merger) {
|
|
|
88
88
|
}
|
|
89
89
|
const defu = createDefu();
|
|
90
90
|
|
|
91
|
-
const version = "1.0.
|
|
91
|
+
const version = "1.0.9-alpha.0";
|
|
92
92
|
|
|
93
93
|
const debug = createDebug__default("weapp-tw-cli");
|
|
94
94
|
|
|
@@ -829,23 +829,29 @@ async function createBuilder(options) {
|
|
|
829
829
|
}
|
|
830
830
|
debug("run tasks end");
|
|
831
831
|
}
|
|
832
|
-
const { clean, outDir, root: cwd, watchOptions } = opt;
|
|
832
|
+
const { clean: clean2, outDir, root: cwd, watchOptions } = opt;
|
|
833
|
+
async function doClean() {
|
|
834
|
+
debug("del start");
|
|
835
|
+
const { deleteAsync } = await import('del');
|
|
836
|
+
const patterns = [`${outDir}/**`];
|
|
837
|
+
await deleteAsync(patterns, { cwd, ignore: defaultNodeModulesDirs });
|
|
838
|
+
debug("del end");
|
|
839
|
+
}
|
|
833
840
|
return {
|
|
834
841
|
watcher: void 0,
|
|
835
842
|
async build() {
|
|
836
|
-
if (
|
|
837
|
-
|
|
838
|
-
const { deleteAsync } = await import('del');
|
|
839
|
-
const patterns = [`${outDir}/**`];
|
|
840
|
-
await deleteAsync(patterns, { cwd, ignore: defaultNodeModulesDirs });
|
|
841
|
-
debug("del end");
|
|
843
|
+
if (clean2) {
|
|
844
|
+
await doClean();
|
|
842
845
|
}
|
|
843
|
-
fs.
|
|
846
|
+
await fs.ensureDir(path__default.resolve(cwd, outDir));
|
|
844
847
|
await runTasks();
|
|
845
848
|
return this;
|
|
846
849
|
},
|
|
847
|
-
watch() {
|
|
848
|
-
|
|
850
|
+
async watch() {
|
|
851
|
+
if (clean2) {
|
|
852
|
+
await doClean();
|
|
853
|
+
}
|
|
854
|
+
await fs.ensureDir(path__default.resolve(cwd, outDir));
|
|
849
855
|
const dumps = globsSet.dump();
|
|
850
856
|
const arr = (Array.isArray(watchOptions.ignored) ? watchOptions.ignored : [watchOptions.ignored]).filter(
|
|
851
857
|
Boolean
|
|
@@ -881,7 +887,8 @@ async function createBuilder(options) {
|
|
|
881
887
|
this.watcher = watcher;
|
|
882
888
|
return this;
|
|
883
889
|
},
|
|
884
|
-
globsSet
|
|
890
|
+
globsSet,
|
|
891
|
+
clean: doClean
|
|
885
892
|
};
|
|
886
893
|
}
|
|
887
894
|
async function build(options) {
|
|
@@ -892,6 +899,10 @@ async function watch(options) {
|
|
|
892
899
|
const builder = await createBuilder(options);
|
|
893
900
|
return await builder.watch();
|
|
894
901
|
}
|
|
902
|
+
async function clean(options) {
|
|
903
|
+
const builder = await createBuilder(options);
|
|
904
|
+
return await builder.clean();
|
|
905
|
+
}
|
|
895
906
|
|
|
896
907
|
function createConfigLoader(root) {
|
|
897
908
|
const explorer = cosmiconfig.cosmiconfigSync("weapp-tw");
|
|
@@ -1039,6 +1050,13 @@ function createCli() {
|
|
|
1039
1050
|
root: cwd
|
|
1040
1051
|
});
|
|
1041
1052
|
});
|
|
1053
|
+
program.command("clean").action(async () => {
|
|
1054
|
+
await clean(
|
|
1055
|
+
defu(userDefinedConfig?.config, {
|
|
1056
|
+
root: cwd
|
|
1057
|
+
})
|
|
1058
|
+
);
|
|
1059
|
+
});
|
|
1042
1060
|
return program;
|
|
1043
1061
|
}
|
|
1044
1062
|
|
package/dist/index.d.cts
CHANGED
|
@@ -130,20 +130,23 @@ type UserConfig = Partial<BuildOptions>;
|
|
|
130
130
|
declare function createBuilder(options?: Partial<BuildOptions>): Promise<{
|
|
131
131
|
watcher: FSWatcher | undefined;
|
|
132
132
|
build(): Promise<any>;
|
|
133
|
-
watch(): any
|
|
133
|
+
watch(): Promise<any>;
|
|
134
134
|
globsSet: GlobsSet;
|
|
135
|
+
clean: () => Promise<void>;
|
|
135
136
|
}>;
|
|
136
137
|
declare function build(options?: Partial<BuildOptions>): Promise<{
|
|
137
138
|
watcher: FSWatcher | undefined;
|
|
138
139
|
build(): Promise<any>;
|
|
139
|
-
watch(): any
|
|
140
|
+
watch(): Promise<any>;
|
|
140
141
|
globsSet: GlobsSet;
|
|
142
|
+
clean: () => Promise<void>;
|
|
141
143
|
}>;
|
|
142
144
|
declare function watch(options?: Partial<BuildOptions>): Promise<{
|
|
143
145
|
watcher: FSWatcher | undefined;
|
|
144
146
|
build(): Promise<any>;
|
|
145
|
-
watch(): any
|
|
147
|
+
watch(): Promise<any>;
|
|
146
148
|
globsSet: GlobsSet;
|
|
149
|
+
clean: () => Promise<void>;
|
|
147
150
|
}>;
|
|
148
151
|
|
|
149
152
|
interface WeappTwCosmiconfigResult {
|
package/dist/index.d.mts
CHANGED
|
@@ -130,20 +130,23 @@ type UserConfig = Partial<BuildOptions>;
|
|
|
130
130
|
declare function createBuilder(options?: Partial<BuildOptions>): Promise<{
|
|
131
131
|
watcher: FSWatcher | undefined;
|
|
132
132
|
build(): Promise<any>;
|
|
133
|
-
watch(): any
|
|
133
|
+
watch(): Promise<any>;
|
|
134
134
|
globsSet: GlobsSet;
|
|
135
|
+
clean: () => Promise<void>;
|
|
135
136
|
}>;
|
|
136
137
|
declare function build(options?: Partial<BuildOptions>): Promise<{
|
|
137
138
|
watcher: FSWatcher | undefined;
|
|
138
139
|
build(): Promise<any>;
|
|
139
|
-
watch(): any
|
|
140
|
+
watch(): Promise<any>;
|
|
140
141
|
globsSet: GlobsSet;
|
|
142
|
+
clean: () => Promise<void>;
|
|
141
143
|
}>;
|
|
142
144
|
declare function watch(options?: Partial<BuildOptions>): Promise<{
|
|
143
145
|
watcher: FSWatcher | undefined;
|
|
144
146
|
build(): Promise<any>;
|
|
145
|
-
watch(): any
|
|
147
|
+
watch(): Promise<any>;
|
|
146
148
|
globsSet: GlobsSet;
|
|
149
|
+
clean: () => Promise<void>;
|
|
147
150
|
}>;
|
|
148
151
|
|
|
149
152
|
interface WeappTwCosmiconfigResult {
|
package/dist/index.d.ts
CHANGED
|
@@ -130,20 +130,23 @@ type UserConfig = Partial<BuildOptions>;
|
|
|
130
130
|
declare function createBuilder(options?: Partial<BuildOptions>): Promise<{
|
|
131
131
|
watcher: FSWatcher | undefined;
|
|
132
132
|
build(): Promise<any>;
|
|
133
|
-
watch(): any
|
|
133
|
+
watch(): Promise<any>;
|
|
134
134
|
globsSet: GlobsSet;
|
|
135
|
+
clean: () => Promise<void>;
|
|
135
136
|
}>;
|
|
136
137
|
declare function build(options?: Partial<BuildOptions>): Promise<{
|
|
137
138
|
watcher: FSWatcher | undefined;
|
|
138
139
|
build(): Promise<any>;
|
|
139
|
-
watch(): any
|
|
140
|
+
watch(): Promise<any>;
|
|
140
141
|
globsSet: GlobsSet;
|
|
142
|
+
clean: () => Promise<void>;
|
|
141
143
|
}>;
|
|
142
144
|
declare function watch(options?: Partial<BuildOptions>): Promise<{
|
|
143
145
|
watcher: FSWatcher | undefined;
|
|
144
146
|
build(): Promise<any>;
|
|
145
|
-
watch(): any
|
|
147
|
+
watch(): Promise<any>;
|
|
146
148
|
globsSet: GlobsSet;
|
|
149
|
+
clean: () => Promise<void>;
|
|
147
150
|
}>;
|
|
148
151
|
|
|
149
152
|
interface WeappTwCosmiconfigResult {
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import fs, {
|
|
4
|
+
import fs, { ensureDir } from 'fs-extra';
|
|
5
5
|
import gulp from 'gulp';
|
|
6
6
|
import loadPostcssConfig from 'postcss-load-config';
|
|
7
7
|
import pc from 'picocolors';
|
|
@@ -71,7 +71,7 @@ function createDefu(merger) {
|
|
|
71
71
|
}
|
|
72
72
|
const defu = createDefu();
|
|
73
73
|
|
|
74
|
-
const version = "1.0.
|
|
74
|
+
const version = "1.0.9-alpha.0";
|
|
75
75
|
|
|
76
76
|
const debug = createDebug("weapp-tw-cli");
|
|
77
77
|
|
|
@@ -812,23 +812,29 @@ async function createBuilder(options) {
|
|
|
812
812
|
}
|
|
813
813
|
debug("run tasks end");
|
|
814
814
|
}
|
|
815
|
-
const { clean, outDir, root: cwd, watchOptions } = opt;
|
|
815
|
+
const { clean: clean2, outDir, root: cwd, watchOptions } = opt;
|
|
816
|
+
async function doClean() {
|
|
817
|
+
debug("del start");
|
|
818
|
+
const { deleteAsync } = await import('del');
|
|
819
|
+
const patterns = [`${outDir}/**`];
|
|
820
|
+
await deleteAsync(patterns, { cwd, ignore: defaultNodeModulesDirs });
|
|
821
|
+
debug("del end");
|
|
822
|
+
}
|
|
816
823
|
return {
|
|
817
824
|
watcher: void 0,
|
|
818
825
|
async build() {
|
|
819
|
-
if (
|
|
820
|
-
|
|
821
|
-
const { deleteAsync } = await import('del');
|
|
822
|
-
const patterns = [`${outDir}/**`];
|
|
823
|
-
await deleteAsync(patterns, { cwd, ignore: defaultNodeModulesDirs });
|
|
824
|
-
debug("del end");
|
|
826
|
+
if (clean2) {
|
|
827
|
+
await doClean();
|
|
825
828
|
}
|
|
826
|
-
|
|
829
|
+
await ensureDir(path.resolve(cwd, outDir));
|
|
827
830
|
await runTasks();
|
|
828
831
|
return this;
|
|
829
832
|
},
|
|
830
|
-
watch() {
|
|
831
|
-
|
|
833
|
+
async watch() {
|
|
834
|
+
if (clean2) {
|
|
835
|
+
await doClean();
|
|
836
|
+
}
|
|
837
|
+
await ensureDir(path.resolve(cwd, outDir));
|
|
832
838
|
const dumps = globsSet.dump();
|
|
833
839
|
const arr = (Array.isArray(watchOptions.ignored) ? watchOptions.ignored : [watchOptions.ignored]).filter(
|
|
834
840
|
Boolean
|
|
@@ -864,7 +870,8 @@ async function createBuilder(options) {
|
|
|
864
870
|
this.watcher = watcher;
|
|
865
871
|
return this;
|
|
866
872
|
},
|
|
867
|
-
globsSet
|
|
873
|
+
globsSet,
|
|
874
|
+
clean: doClean
|
|
868
875
|
};
|
|
869
876
|
}
|
|
870
877
|
async function build(options) {
|
|
@@ -875,6 +882,10 @@ async function watch(options) {
|
|
|
875
882
|
const builder = await createBuilder(options);
|
|
876
883
|
return await builder.watch();
|
|
877
884
|
}
|
|
885
|
+
async function clean(options) {
|
|
886
|
+
const builder = await createBuilder(options);
|
|
887
|
+
return await builder.clean();
|
|
888
|
+
}
|
|
878
889
|
|
|
879
890
|
function createConfigLoader(root) {
|
|
880
891
|
const explorer = cosmiconfigSync("weapp-tw");
|
|
@@ -1022,6 +1033,13 @@ function createCli() {
|
|
|
1022
1033
|
root: cwd
|
|
1023
1034
|
});
|
|
1024
1035
|
});
|
|
1036
|
+
program.command("clean").action(async () => {
|
|
1037
|
+
await clean(
|
|
1038
|
+
defu(userDefinedConfig?.config, {
|
|
1039
|
+
root: cwd
|
|
1040
|
+
})
|
|
1041
|
+
);
|
|
1042
|
+
});
|
|
1025
1043
|
return program;
|
|
1026
1044
|
}
|
|
1027
1045
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-tailwindcss/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9-alpha.0",
|
|
4
4
|
"description": "The cli of weapp-tailwindcss",
|
|
5
5
|
"author": "SonOfMagic <qq1324318532@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"less": "*",
|
|
39
39
|
"sass": "*",
|
|
40
40
|
"typescript": "*",
|
|
41
|
-
"weapp-tailwindcss": "3.
|
|
41
|
+
"weapp-tailwindcss": "3.4.1-alpha.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"less": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"commander": "^12.1.0",
|
|
56
56
|
"cosmiconfig": "^9.0.0",
|
|
57
|
-
"debug": "4.3.
|
|
57
|
+
"debug": "4.3.6",
|
|
58
58
|
"del": "^7.1.0",
|
|
59
59
|
"fs-extra": "^11.2.0",
|
|
60
60
|
"gulp": "^4.0.2",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"gulp-typescript": "6.0.0-alpha.1",
|
|
68
68
|
"local-pkg": "^0.5.0",
|
|
69
69
|
"picocolors": "^1.0.1",
|
|
70
|
-
"postcss": "^8.4.
|
|
70
|
+
"postcss": "^8.4.41",
|
|
71
71
|
"postcss-load-config": "^6.0.1",
|
|
72
72
|
"postcss-scss": "^4.0.9"
|
|
73
73
|
},
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"registry": "https://registry.npmjs.org"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"tailwindcss": "^3.4.
|
|
79
|
+
"tailwindcss": "^3.4.8"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
82
|
"dev": "unbuild --sourcemap",
|