@weapp-tailwindcss/cli 1.0.1 → 1.0.3
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/README.md +5 -1
- package/dist/index.cjs +146 -112
- package/dist/index.d.cts +10 -3
- package/dist/index.d.mts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.mjs +143 -110
- package/package.json +33 -29
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const process = require('node:process');
|
|
3
4
|
const commander = require('commander');
|
|
4
5
|
const path = require('node:path');
|
|
5
6
|
const fs = require('fs-extra');
|
|
@@ -19,6 +20,7 @@ const cosmiconfig = require('cosmiconfig');
|
|
|
19
20
|
|
|
20
21
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
21
22
|
|
|
23
|
+
const process__default = /*#__PURE__*/_interopDefaultCompat(process);
|
|
22
24
|
const path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
23
25
|
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
24
26
|
const gulp__default = /*#__PURE__*/_interopDefaultCompat(gulp$1);
|
|
@@ -88,10 +90,48 @@ function createDefu(merger) {
|
|
|
88
90
|
}
|
|
89
91
|
const defu = createDefu();
|
|
90
92
|
|
|
91
|
-
const version = "1.0.
|
|
93
|
+
const version = "1.0.3";
|
|
92
94
|
|
|
93
95
|
const debug = createDebug__default("weapp-tw-cli");
|
|
94
96
|
|
|
97
|
+
const defaultJavascriptExtensions = ["js"];
|
|
98
|
+
const defaultTypescriptExtensions = ["ts"];
|
|
99
|
+
const defaultWxsExtensions = ["wxs"];
|
|
100
|
+
const defaultNodeModulesDirs = [
|
|
101
|
+
"**/node_modules/**",
|
|
102
|
+
"**/miniprogram_npm/**",
|
|
103
|
+
"**/project.config.json/**",
|
|
104
|
+
"**/project.private.config.json/**",
|
|
105
|
+
"**/package.json/**",
|
|
106
|
+
"postcss.config.js",
|
|
107
|
+
"tailwind.config.js",
|
|
108
|
+
"weapp-tw.config.js"
|
|
109
|
+
];
|
|
110
|
+
function noop() {
|
|
111
|
+
}
|
|
112
|
+
function getDefaultOptions(options, postcssOptionsFromConfig) {
|
|
113
|
+
return {
|
|
114
|
+
outDir: "dist",
|
|
115
|
+
weappTailwindcssOptions: {},
|
|
116
|
+
clean: true,
|
|
117
|
+
src: "",
|
|
118
|
+
exclude: [...defaultNodeModulesDirs],
|
|
119
|
+
include: ["**/*.{png,jpg,jpeg,gif,svg,webp}"],
|
|
120
|
+
extensions: {
|
|
121
|
+
javascript: [...defaultJavascriptExtensions, ...defaultTypescriptExtensions, ...defaultWxsExtensions],
|
|
122
|
+
html: ["wxml"],
|
|
123
|
+
css: ["wxss", "less", "sass", "scss"],
|
|
124
|
+
json: ["json"]
|
|
125
|
+
},
|
|
126
|
+
watchOptions: {
|
|
127
|
+
cwd: options?.root,
|
|
128
|
+
events: ["add", "change", "unlink", "ready"]
|
|
129
|
+
},
|
|
130
|
+
postcssOptions: postcssOptionsFromConfig,
|
|
131
|
+
gulpChain: noop
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
95
135
|
var __defProp = Object.defineProperty;
|
|
96
136
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
97
137
|
var __publicField = (obj, key, value) => {
|
|
@@ -130,6 +170,10 @@ class GlobsSet {
|
|
|
130
170
|
}
|
|
131
171
|
}
|
|
132
172
|
|
|
173
|
+
function isStream(stream, { checkOpen = true } = {}) {
|
|
174
|
+
return stream !== null && typeof stream === "object" && (stream.writable || stream.readable || !checkOpen || stream.writable === void 0 && stream.readable === void 0) && typeof stream.pipe === "function";
|
|
175
|
+
}
|
|
176
|
+
|
|
133
177
|
var AssetType = /* @__PURE__ */ ((AssetType2) => {
|
|
134
178
|
AssetType2["JavaScript"] = "javascript";
|
|
135
179
|
AssetType2["Json"] = "json";
|
|
@@ -506,7 +550,6 @@ function promisify(task) {
|
|
|
506
550
|
}
|
|
507
551
|
});
|
|
508
552
|
}
|
|
509
|
-
|
|
510
553
|
function isSassLang(lang) {
|
|
511
554
|
return lang === "scss" || lang === "sass";
|
|
512
555
|
}
|
|
@@ -516,6 +559,17 @@ function isLessLang(lang) {
|
|
|
516
559
|
function isTsLang(lang) {
|
|
517
560
|
return lang === "ts";
|
|
518
561
|
}
|
|
562
|
+
|
|
563
|
+
function normalizePlugin(plugin) {
|
|
564
|
+
if (isStream(plugin)) {
|
|
565
|
+
return plugin;
|
|
566
|
+
} else if (typeof plugin === "function") {
|
|
567
|
+
return plugin.apply(plugin);
|
|
568
|
+
} else if (Array.isArray(plugin)) {
|
|
569
|
+
const [fn, ...args] = plugin;
|
|
570
|
+
return fn.apply(fn, args);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
519
573
|
async function getTasks(options) {
|
|
520
574
|
let { typescriptOptions } = options;
|
|
521
575
|
const {
|
|
@@ -527,12 +581,20 @@ async function getTasks(options) {
|
|
|
527
581
|
exclude,
|
|
528
582
|
include,
|
|
529
583
|
postcssOptions,
|
|
530
|
-
preprocessorOptions
|
|
584
|
+
preprocessorOptions,
|
|
585
|
+
gulpChain
|
|
531
586
|
} = options;
|
|
532
587
|
const globsSet = new GlobsSet();
|
|
533
|
-
const base = srcBase ? srcBase
|
|
588
|
+
const base = srcBase ? `${srcBase}/` : "";
|
|
534
589
|
const enableSass = Boolean(preprocessorOptions?.sass);
|
|
535
590
|
const enableLess = Boolean(preprocessorOptions?.less);
|
|
591
|
+
function resolvePipes(plugins, type) {
|
|
592
|
+
const newPlugins = gulpChain(plugins, type);
|
|
593
|
+
if (newPlugins === void 0) {
|
|
594
|
+
return plugins;
|
|
595
|
+
}
|
|
596
|
+
return newPlugins.map((x) => normalizePlugin(x)).filter((x) => x);
|
|
597
|
+
}
|
|
536
598
|
if (typescriptOptions === true) {
|
|
537
599
|
typescriptOptions = {
|
|
538
600
|
tsConfigFileName: "tsconfig.json"
|
|
@@ -547,18 +609,18 @@ async function getTasks(options) {
|
|
|
547
609
|
sass = createSass__default(sassLib);
|
|
548
610
|
}
|
|
549
611
|
const { transformJs, transformWxml, transformWxss } = gulp.createPlugins(weappTailwindcssOptions);
|
|
612
|
+
const outDirGlobs = [`!${outDir}/**/*`, `!./${outDir}/**/*`];
|
|
550
613
|
function getGlobs(type) {
|
|
551
614
|
const globs = [];
|
|
552
615
|
if (typeof include === "function") {
|
|
553
616
|
globs.push(...include(type).map((x) => x));
|
|
554
617
|
}
|
|
555
618
|
if (typeof exclude === "function") {
|
|
556
|
-
globs.push(...exclude(type).map((x) =>
|
|
619
|
+
globs.push(...exclude(type).map((x) => `!${x}`));
|
|
557
620
|
} else if (Array.isArray(exclude)) {
|
|
558
|
-
globs.push(...exclude.map((x) =>
|
|
621
|
+
globs.push(...exclude.map((x) => `!${x}`));
|
|
559
622
|
}
|
|
560
|
-
globs.push(
|
|
561
|
-
globs.push(`!./${outDir}/**/*`);
|
|
623
|
+
globs.push(...outDirGlobs);
|
|
562
624
|
return globs;
|
|
563
625
|
}
|
|
564
626
|
function getJsTasks() {
|
|
@@ -579,29 +641,28 @@ async function getTasks(options) {
|
|
|
579
641
|
}
|
|
580
642
|
return function JsTask() {
|
|
581
643
|
let chain = gulp__default.src([src, ...globs], { cwd, since: gulp__default.lastRun(JsTask) });
|
|
644
|
+
const pipes = [];
|
|
582
645
|
if (loadTs) {
|
|
583
|
-
|
|
646
|
+
pipes.push(gulpTs());
|
|
584
647
|
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
)
|
|
604
|
-
);
|
|
648
|
+
pipes.push(transformJs({
|
|
649
|
+
babelParserOptions: !enableTs && isTs ? {
|
|
650
|
+
plugins: ["typescript"]
|
|
651
|
+
} : void 0
|
|
652
|
+
}));
|
|
653
|
+
pipes.push(gulpif__default(
|
|
654
|
+
loadTs,
|
|
655
|
+
rename__default({
|
|
656
|
+
extname: ".js"
|
|
657
|
+
})
|
|
658
|
+
));
|
|
659
|
+
pipes.push(gulp__default.dest(outDir, {
|
|
660
|
+
cwd
|
|
661
|
+
}));
|
|
662
|
+
for (const p of resolvePipes(pipes, assetType)) {
|
|
663
|
+
chain = chain.pipe(p);
|
|
664
|
+
}
|
|
665
|
+
return promisify(chain);
|
|
605
666
|
};
|
|
606
667
|
});
|
|
607
668
|
}
|
|
@@ -613,13 +674,14 @@ async function getTasks(options) {
|
|
|
613
674
|
const src = `${base}**/*.${x}`;
|
|
614
675
|
globsSet.add(src);
|
|
615
676
|
return function JsonTask() {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
)
|
|
622
|
-
|
|
677
|
+
const pipes = [gulp__default.dest(outDir, {
|
|
678
|
+
cwd
|
|
679
|
+
})];
|
|
680
|
+
let chain = gulp__default.src([src, ...globs], { cwd, since: gulp__default.lastRun(JsonTask) });
|
|
681
|
+
for (const p of resolvePipes(pipes, assetType)) {
|
|
682
|
+
chain = chain.pipe(p);
|
|
683
|
+
}
|
|
684
|
+
return promisify(chain);
|
|
623
685
|
};
|
|
624
686
|
});
|
|
625
687
|
}
|
|
@@ -634,33 +696,32 @@ async function getTasks(options) {
|
|
|
634
696
|
const loadLess = enableLess && isLessLang(x);
|
|
635
697
|
return function CssTask() {
|
|
636
698
|
let chain = gulp__default.src([src, ...globs], { cwd, since: gulp__default.lastRun(CssTask) });
|
|
699
|
+
const pipes = [];
|
|
637
700
|
if (loadSass) {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
).on("error", sass.logError)
|
|
643
|
-
);
|
|
701
|
+
pipes.push(sass.sync(
|
|
702
|
+
// @ts-ignore
|
|
703
|
+
typeof preprocessorOptions?.sass === "boolean" ? void 0 : preprocessorOptions?.sass
|
|
704
|
+
).on("error", sass.logError));
|
|
644
705
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
);
|
|
706
|
+
pipes.push(gulpif__default(
|
|
707
|
+
loadLess,
|
|
708
|
+
less__default(typeof preprocessorOptions?.less === "boolean" ? void 0 : preprocessorOptions?.less)
|
|
709
|
+
));
|
|
710
|
+
pipes.push(gulpif__default(Boolean(postcssOptions), postcssrc__default(postcssOptions?.plugins, postcssOptions?.options)));
|
|
711
|
+
pipes.push(transformWxss());
|
|
712
|
+
pipes.push(gulpif__default(
|
|
713
|
+
loadSass || loadLess,
|
|
714
|
+
rename__default({
|
|
715
|
+
extname: ".wxss"
|
|
716
|
+
})
|
|
717
|
+
));
|
|
718
|
+
pipes.push(gulp__default.dest(outDir, {
|
|
719
|
+
cwd
|
|
720
|
+
}));
|
|
721
|
+
for (const p of resolvePipes(pipes, assetType)) {
|
|
722
|
+
chain = chain.pipe(p);
|
|
723
|
+
}
|
|
724
|
+
return promisify(chain);
|
|
664
725
|
};
|
|
665
726
|
});
|
|
666
727
|
}
|
|
@@ -672,12 +733,15 @@ async function getTasks(options) {
|
|
|
672
733
|
const src = `${base}**/*.${x}`;
|
|
673
734
|
globsSet.add(src);
|
|
674
735
|
return function HtmlTask() {
|
|
736
|
+
let chain = gulp__default.src([src, ...globs], { cwd, since: gulp__default.lastRun(HtmlTask) });
|
|
737
|
+
const pipes = [transformWxml(), gulp__default.dest(outDir, {
|
|
738
|
+
cwd
|
|
739
|
+
})];
|
|
740
|
+
for (const p of resolvePipes(pipes, assetType)) {
|
|
741
|
+
chain = chain.pipe(p);
|
|
742
|
+
}
|
|
675
743
|
return promisify(
|
|
676
|
-
|
|
677
|
-
gulp__default.dest(outDir, {
|
|
678
|
-
cwd
|
|
679
|
-
})
|
|
680
|
-
)
|
|
744
|
+
chain
|
|
681
745
|
);
|
|
682
746
|
};
|
|
683
747
|
});
|
|
@@ -688,13 +752,14 @@ async function getTasks(options) {
|
|
|
688
752
|
return `${base}${x}`;
|
|
689
753
|
});
|
|
690
754
|
globsSet.add(globs);
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
)
|
|
697
|
-
|
|
755
|
+
let chain = gulp__default.src([...globs, ...outDirGlobs], { cwd, since: gulp__default.lastRun(copyOthers) });
|
|
756
|
+
const pipes = [gulp__default.dest(outDir, {
|
|
757
|
+
cwd
|
|
758
|
+
})];
|
|
759
|
+
for (const p of pipes) {
|
|
760
|
+
chain = chain.pipe(p);
|
|
761
|
+
}
|
|
762
|
+
return promisify(chain);
|
|
698
763
|
}
|
|
699
764
|
}
|
|
700
765
|
return {
|
|
@@ -708,44 +773,13 @@ async function getTasks(options) {
|
|
|
708
773
|
};
|
|
709
774
|
}
|
|
710
775
|
|
|
711
|
-
const defaultJavascriptExtensions = ["js"];
|
|
712
|
-
const defaultTypescriptExtensions = ["ts"];
|
|
713
|
-
const defaultWxsExtensions = ["wxs"];
|
|
714
|
-
const defaultNodeModulesDirs = [
|
|
715
|
-
"**/node_modules/**",
|
|
716
|
-
"**/miniprogram_npm/**",
|
|
717
|
-
"**/project.config.json/**",
|
|
718
|
-
"**/project.private.config.json/**",
|
|
719
|
-
"**/package.json/**",
|
|
720
|
-
"postcss.config.js",
|
|
721
|
-
"tailwind.config.js",
|
|
722
|
-
"weapp-tw.config.js"
|
|
723
|
-
];
|
|
724
776
|
async function createBuilder(options) {
|
|
725
777
|
let postcssOptionsFromConfig;
|
|
726
778
|
try {
|
|
727
779
|
postcssOptionsFromConfig = await loadPostcssConfig__default({ cwd: options?.root });
|
|
728
780
|
} catch {
|
|
729
781
|
}
|
|
730
|
-
const opt = defu(options,
|
|
731
|
-
outDir: "dist",
|
|
732
|
-
weappTailwindcssOptions: {},
|
|
733
|
-
clean: true,
|
|
734
|
-
src: "",
|
|
735
|
-
exclude: [...defaultNodeModulesDirs],
|
|
736
|
-
include: ["**/*.{png,jpg,jpeg,gif,svg,webp}"],
|
|
737
|
-
extensions: {
|
|
738
|
-
javascript: [...defaultJavascriptExtensions, ...defaultTypescriptExtensions, ...defaultWxsExtensions],
|
|
739
|
-
html: ["wxml"],
|
|
740
|
-
css: ["wxss", "less", "sass", "scss"],
|
|
741
|
-
json: ["json"]
|
|
742
|
-
},
|
|
743
|
-
watchOptions: {
|
|
744
|
-
cwd: options?.root,
|
|
745
|
-
events: ["add", "change", "unlink", "ready"]
|
|
746
|
-
},
|
|
747
|
-
postcssOptions: postcssOptionsFromConfig
|
|
748
|
-
});
|
|
782
|
+
const opt = defu(options, getDefaultOptions(options, postcssOptionsFromConfig));
|
|
749
783
|
const { copyOthers, getCssTasks, getHtmlTasks, getJsTasks, getJsonTasks, globsSet } = await getTasks(opt);
|
|
750
784
|
const tasks = {
|
|
751
785
|
css: getCssTasks(),
|
|
@@ -774,7 +808,7 @@ async function createBuilder(options) {
|
|
|
774
808
|
if (clean) {
|
|
775
809
|
debug("del start");
|
|
776
810
|
const { deleteAsync } = await import('del');
|
|
777
|
-
const patterns = [outDir
|
|
811
|
+
const patterns = [`${outDir}/**`];
|
|
778
812
|
await deleteAsync(patterns, { cwd, ignore: defaultNodeModulesDirs });
|
|
779
813
|
debug("del end");
|
|
780
814
|
}
|
|
@@ -797,16 +831,16 @@ async function createBuilder(options) {
|
|
|
797
831
|
cb(error);
|
|
798
832
|
}
|
|
799
833
|
});
|
|
800
|
-
watcher.on("change",
|
|
834
|
+
watcher.on("change", (path2) => {
|
|
801
835
|
console.log(`${pc__default.green("changed")} ${path2}`);
|
|
802
836
|
});
|
|
803
|
-
watcher.on("add",
|
|
837
|
+
watcher.on("add", (path2) => {
|
|
804
838
|
console.log(`${pc__default.green("add")} ${path2}`);
|
|
805
839
|
});
|
|
806
|
-
watcher.on("unlink",
|
|
840
|
+
watcher.on("unlink", (path2) => {
|
|
807
841
|
console.log(`${pc__default.green("remove")} ${path2}`);
|
|
808
842
|
});
|
|
809
|
-
watcher.on("ready", async
|
|
843
|
+
watcher.on("ready", async () => {
|
|
810
844
|
const meta = await localPkg.getPackageInfo("weapp-tailwindcss");
|
|
811
845
|
let weappTwVersionStr = "";
|
|
812
846
|
if (meta) {
|
|
@@ -917,7 +951,7 @@ function updatePackageJson(options) {
|
|
|
917
951
|
function initConfig(options) {
|
|
918
952
|
const { lang, root } = defu(options, {
|
|
919
953
|
lang: "js",
|
|
920
|
-
root:
|
|
954
|
+
root: process__default.cwd()
|
|
921
955
|
});
|
|
922
956
|
const configFilename = `weapp-tw.config.${lang ?? "js"}`;
|
|
923
957
|
const configPath = path__default.resolve(root, configFilename);
|
|
@@ -954,7 +988,7 @@ module.exports = config
|
|
|
954
988
|
}
|
|
955
989
|
|
|
956
990
|
function createCli() {
|
|
957
|
-
const cwd =
|
|
991
|
+
const cwd = process__default.cwd();
|
|
958
992
|
const program = new commander.Command();
|
|
959
993
|
const configLoader = createConfigLoader(cwd);
|
|
960
994
|
const userDefinedConfig = configLoader.search(cwd);
|
package/dist/index.d.cts
CHANGED
|
@@ -110,13 +110,20 @@ interface BuildOptions {
|
|
|
110
110
|
watchOptions: WatchOptions;
|
|
111
111
|
/**
|
|
112
112
|
* @group 2.编译支持
|
|
113
|
-
* @description typescript
|
|
113
|
+
* @description typescript 的编译配置,默认不传为不编译 ts
|
|
114
114
|
* @description 需要安装 typescript
|
|
115
115
|
*/
|
|
116
116
|
typescriptOptions: boolean | {
|
|
117
117
|
settings?: Settings;
|
|
118
118
|
tsConfigFileName?: string;
|
|
119
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* @group 2.编译支持
|
|
122
|
+
* @description 扩展 cli 里默认的 gulp 文件流处理方式
|
|
123
|
+
* 第一个参数为原型注册的内置插件, 第二个参数为处理的文件类型
|
|
124
|
+
* 返回一个新的插件数组为取代原先的处理流程,返回 undefined 为使用默认处理流程
|
|
125
|
+
*/
|
|
126
|
+
gulpChain: (plugins: any[], type: AssetType) => any[] | undefined;
|
|
120
127
|
}
|
|
121
128
|
type UserConfig = Partial<BuildOptions>;
|
|
122
129
|
|
|
@@ -139,11 +146,11 @@ declare function watch(options?: Partial<BuildOptions>): Promise<{
|
|
|
139
146
|
globsSet: GlobsSet;
|
|
140
147
|
}>;
|
|
141
148
|
|
|
142
|
-
|
|
149
|
+
interface WeappTwCosmiconfigResult {
|
|
143
150
|
config: BuildOptions;
|
|
144
151
|
filepath: string;
|
|
145
152
|
isEmpty?: boolean;
|
|
146
|
-
}
|
|
153
|
+
}
|
|
147
154
|
declare function createConfigLoader(root: string): {
|
|
148
155
|
search: (searchFrom?: string) => WeappTwCosmiconfigResult | undefined;
|
|
149
156
|
load: (filepath: string) => cosmiconfig.CosmiconfigResult;
|
package/dist/index.d.mts
CHANGED
|
@@ -110,13 +110,20 @@ interface BuildOptions {
|
|
|
110
110
|
watchOptions: WatchOptions;
|
|
111
111
|
/**
|
|
112
112
|
* @group 2.编译支持
|
|
113
|
-
* @description typescript
|
|
113
|
+
* @description typescript 的编译配置,默认不传为不编译 ts
|
|
114
114
|
* @description 需要安装 typescript
|
|
115
115
|
*/
|
|
116
116
|
typescriptOptions: boolean | {
|
|
117
117
|
settings?: Settings;
|
|
118
118
|
tsConfigFileName?: string;
|
|
119
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* @group 2.编译支持
|
|
122
|
+
* @description 扩展 cli 里默认的 gulp 文件流处理方式
|
|
123
|
+
* 第一个参数为原型注册的内置插件, 第二个参数为处理的文件类型
|
|
124
|
+
* 返回一个新的插件数组为取代原先的处理流程,返回 undefined 为使用默认处理流程
|
|
125
|
+
*/
|
|
126
|
+
gulpChain: (plugins: any[], type: AssetType) => any[] | undefined;
|
|
120
127
|
}
|
|
121
128
|
type UserConfig = Partial<BuildOptions>;
|
|
122
129
|
|
|
@@ -139,11 +146,11 @@ declare function watch(options?: Partial<BuildOptions>): Promise<{
|
|
|
139
146
|
globsSet: GlobsSet;
|
|
140
147
|
}>;
|
|
141
148
|
|
|
142
|
-
|
|
149
|
+
interface WeappTwCosmiconfigResult {
|
|
143
150
|
config: BuildOptions;
|
|
144
151
|
filepath: string;
|
|
145
152
|
isEmpty?: boolean;
|
|
146
|
-
}
|
|
153
|
+
}
|
|
147
154
|
declare function createConfigLoader(root: string): {
|
|
148
155
|
search: (searchFrom?: string) => WeappTwCosmiconfigResult | undefined;
|
|
149
156
|
load: (filepath: string) => cosmiconfig.CosmiconfigResult;
|
package/dist/index.d.ts
CHANGED
|
@@ -110,13 +110,20 @@ interface BuildOptions {
|
|
|
110
110
|
watchOptions: WatchOptions;
|
|
111
111
|
/**
|
|
112
112
|
* @group 2.编译支持
|
|
113
|
-
* @description typescript
|
|
113
|
+
* @description typescript 的编译配置,默认不传为不编译 ts
|
|
114
114
|
* @description 需要安装 typescript
|
|
115
115
|
*/
|
|
116
116
|
typescriptOptions: boolean | {
|
|
117
117
|
settings?: Settings;
|
|
118
118
|
tsConfigFileName?: string;
|
|
119
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* @group 2.编译支持
|
|
122
|
+
* @description 扩展 cli 里默认的 gulp 文件流处理方式
|
|
123
|
+
* 第一个参数为原型注册的内置插件, 第二个参数为处理的文件类型
|
|
124
|
+
* 返回一个新的插件数组为取代原先的处理流程,返回 undefined 为使用默认处理流程
|
|
125
|
+
*/
|
|
126
|
+
gulpChain: (plugins: any[], type: AssetType) => any[] | undefined;
|
|
120
127
|
}
|
|
121
128
|
type UserConfig = Partial<BuildOptions>;
|
|
122
129
|
|
|
@@ -139,11 +146,11 @@ declare function watch(options?: Partial<BuildOptions>): Promise<{
|
|
|
139
146
|
globsSet: GlobsSet;
|
|
140
147
|
}>;
|
|
141
148
|
|
|
142
|
-
|
|
149
|
+
interface WeappTwCosmiconfigResult {
|
|
143
150
|
config: BuildOptions;
|
|
144
151
|
filepath: string;
|
|
145
152
|
isEmpty?: boolean;
|
|
146
|
-
}
|
|
153
|
+
}
|
|
147
154
|
declare function createConfigLoader(root: string): {
|
|
148
155
|
search: (searchFrom?: string) => WeappTwCosmiconfigResult | undefined;
|
|
149
156
|
load: (filepath: string) => cosmiconfig.CosmiconfigResult;
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
1
2
|
import { Command } from 'commander';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import fs, { ensureDirSync } from 'fs-extra';
|
|
@@ -71,10 +72,48 @@ function createDefu(merger) {
|
|
|
71
72
|
}
|
|
72
73
|
const defu = createDefu();
|
|
73
74
|
|
|
74
|
-
const version = "1.0.
|
|
75
|
+
const version = "1.0.3";
|
|
75
76
|
|
|
76
77
|
const debug = createDebug("weapp-tw-cli");
|
|
77
78
|
|
|
79
|
+
const defaultJavascriptExtensions = ["js"];
|
|
80
|
+
const defaultTypescriptExtensions = ["ts"];
|
|
81
|
+
const defaultWxsExtensions = ["wxs"];
|
|
82
|
+
const defaultNodeModulesDirs = [
|
|
83
|
+
"**/node_modules/**",
|
|
84
|
+
"**/miniprogram_npm/**",
|
|
85
|
+
"**/project.config.json/**",
|
|
86
|
+
"**/project.private.config.json/**",
|
|
87
|
+
"**/package.json/**",
|
|
88
|
+
"postcss.config.js",
|
|
89
|
+
"tailwind.config.js",
|
|
90
|
+
"weapp-tw.config.js"
|
|
91
|
+
];
|
|
92
|
+
function noop() {
|
|
93
|
+
}
|
|
94
|
+
function getDefaultOptions(options, postcssOptionsFromConfig) {
|
|
95
|
+
return {
|
|
96
|
+
outDir: "dist",
|
|
97
|
+
weappTailwindcssOptions: {},
|
|
98
|
+
clean: true,
|
|
99
|
+
src: "",
|
|
100
|
+
exclude: [...defaultNodeModulesDirs],
|
|
101
|
+
include: ["**/*.{png,jpg,jpeg,gif,svg,webp}"],
|
|
102
|
+
extensions: {
|
|
103
|
+
javascript: [...defaultJavascriptExtensions, ...defaultTypescriptExtensions, ...defaultWxsExtensions],
|
|
104
|
+
html: ["wxml"],
|
|
105
|
+
css: ["wxss", "less", "sass", "scss"],
|
|
106
|
+
json: ["json"]
|
|
107
|
+
},
|
|
108
|
+
watchOptions: {
|
|
109
|
+
cwd: options?.root,
|
|
110
|
+
events: ["add", "change", "unlink", "ready"]
|
|
111
|
+
},
|
|
112
|
+
postcssOptions: postcssOptionsFromConfig,
|
|
113
|
+
gulpChain: noop
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
78
117
|
var __defProp = Object.defineProperty;
|
|
79
118
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
80
119
|
var __publicField = (obj, key, value) => {
|
|
@@ -113,6 +152,10 @@ class GlobsSet {
|
|
|
113
152
|
}
|
|
114
153
|
}
|
|
115
154
|
|
|
155
|
+
function isStream(stream, { checkOpen = true } = {}) {
|
|
156
|
+
return stream !== null && typeof stream === "object" && (stream.writable || stream.readable || !checkOpen || stream.writable === void 0 && stream.readable === void 0) && typeof stream.pipe === "function";
|
|
157
|
+
}
|
|
158
|
+
|
|
116
159
|
var AssetType = /* @__PURE__ */ ((AssetType2) => {
|
|
117
160
|
AssetType2["JavaScript"] = "javascript";
|
|
118
161
|
AssetType2["Json"] = "json";
|
|
@@ -489,7 +532,6 @@ function promisify(task) {
|
|
|
489
532
|
}
|
|
490
533
|
});
|
|
491
534
|
}
|
|
492
|
-
|
|
493
535
|
function isSassLang(lang) {
|
|
494
536
|
return lang === "scss" || lang === "sass";
|
|
495
537
|
}
|
|
@@ -499,6 +541,17 @@ function isLessLang(lang) {
|
|
|
499
541
|
function isTsLang(lang) {
|
|
500
542
|
return lang === "ts";
|
|
501
543
|
}
|
|
544
|
+
|
|
545
|
+
function normalizePlugin(plugin) {
|
|
546
|
+
if (isStream(plugin)) {
|
|
547
|
+
return plugin;
|
|
548
|
+
} else if (typeof plugin === "function") {
|
|
549
|
+
return plugin.apply(plugin);
|
|
550
|
+
} else if (Array.isArray(plugin)) {
|
|
551
|
+
const [fn, ...args] = plugin;
|
|
552
|
+
return fn.apply(fn, args);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
502
555
|
async function getTasks(options) {
|
|
503
556
|
let { typescriptOptions } = options;
|
|
504
557
|
const {
|
|
@@ -510,12 +563,20 @@ async function getTasks(options) {
|
|
|
510
563
|
exclude,
|
|
511
564
|
include,
|
|
512
565
|
postcssOptions,
|
|
513
|
-
preprocessorOptions
|
|
566
|
+
preprocessorOptions,
|
|
567
|
+
gulpChain
|
|
514
568
|
} = options;
|
|
515
569
|
const globsSet = new GlobsSet();
|
|
516
|
-
const base = srcBase ? srcBase
|
|
570
|
+
const base = srcBase ? `${srcBase}/` : "";
|
|
517
571
|
const enableSass = Boolean(preprocessorOptions?.sass);
|
|
518
572
|
const enableLess = Boolean(preprocessorOptions?.less);
|
|
573
|
+
function resolvePipes(plugins, type) {
|
|
574
|
+
const newPlugins = gulpChain(plugins, type);
|
|
575
|
+
if (newPlugins === void 0) {
|
|
576
|
+
return plugins;
|
|
577
|
+
}
|
|
578
|
+
return newPlugins.map((x) => normalizePlugin(x)).filter((x) => x);
|
|
579
|
+
}
|
|
519
580
|
if (typescriptOptions === true) {
|
|
520
581
|
typescriptOptions = {
|
|
521
582
|
tsConfigFileName: "tsconfig.json"
|
|
@@ -530,18 +591,18 @@ async function getTasks(options) {
|
|
|
530
591
|
sass = createSass(sassLib);
|
|
531
592
|
}
|
|
532
593
|
const { transformJs, transformWxml, transformWxss } = createPlugins(weappTailwindcssOptions);
|
|
594
|
+
const outDirGlobs = [`!${outDir}/**/*`, `!./${outDir}/**/*`];
|
|
533
595
|
function getGlobs(type) {
|
|
534
596
|
const globs = [];
|
|
535
597
|
if (typeof include === "function") {
|
|
536
598
|
globs.push(...include(type).map((x) => x));
|
|
537
599
|
}
|
|
538
600
|
if (typeof exclude === "function") {
|
|
539
|
-
globs.push(...exclude(type).map((x) =>
|
|
601
|
+
globs.push(...exclude(type).map((x) => `!${x}`));
|
|
540
602
|
} else if (Array.isArray(exclude)) {
|
|
541
|
-
globs.push(...exclude.map((x) =>
|
|
603
|
+
globs.push(...exclude.map((x) => `!${x}`));
|
|
542
604
|
}
|
|
543
|
-
globs.push(
|
|
544
|
-
globs.push(`!./${outDir}/**/*`);
|
|
605
|
+
globs.push(...outDirGlobs);
|
|
545
606
|
return globs;
|
|
546
607
|
}
|
|
547
608
|
function getJsTasks() {
|
|
@@ -562,29 +623,28 @@ async function getTasks(options) {
|
|
|
562
623
|
}
|
|
563
624
|
return function JsTask() {
|
|
564
625
|
let chain = gulp.src([src, ...globs], { cwd, since: gulp.lastRun(JsTask) });
|
|
626
|
+
const pipes = [];
|
|
565
627
|
if (loadTs) {
|
|
566
|
-
|
|
628
|
+
pipes.push(gulpTs());
|
|
567
629
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
)
|
|
587
|
-
);
|
|
630
|
+
pipes.push(transformJs({
|
|
631
|
+
babelParserOptions: !enableTs && isTs ? {
|
|
632
|
+
plugins: ["typescript"]
|
|
633
|
+
} : void 0
|
|
634
|
+
}));
|
|
635
|
+
pipes.push(gulpif(
|
|
636
|
+
loadTs,
|
|
637
|
+
rename({
|
|
638
|
+
extname: ".js"
|
|
639
|
+
})
|
|
640
|
+
));
|
|
641
|
+
pipes.push(gulp.dest(outDir, {
|
|
642
|
+
cwd
|
|
643
|
+
}));
|
|
644
|
+
for (const p of resolvePipes(pipes, assetType)) {
|
|
645
|
+
chain = chain.pipe(p);
|
|
646
|
+
}
|
|
647
|
+
return promisify(chain);
|
|
588
648
|
};
|
|
589
649
|
});
|
|
590
650
|
}
|
|
@@ -596,13 +656,14 @@ async function getTasks(options) {
|
|
|
596
656
|
const src = `${base}**/*.${x}`;
|
|
597
657
|
globsSet.add(src);
|
|
598
658
|
return function JsonTask() {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
)
|
|
605
|
-
|
|
659
|
+
const pipes = [gulp.dest(outDir, {
|
|
660
|
+
cwd
|
|
661
|
+
})];
|
|
662
|
+
let chain = gulp.src([src, ...globs], { cwd, since: gulp.lastRun(JsonTask) });
|
|
663
|
+
for (const p of resolvePipes(pipes, assetType)) {
|
|
664
|
+
chain = chain.pipe(p);
|
|
665
|
+
}
|
|
666
|
+
return promisify(chain);
|
|
606
667
|
};
|
|
607
668
|
});
|
|
608
669
|
}
|
|
@@ -617,33 +678,32 @@ async function getTasks(options) {
|
|
|
617
678
|
const loadLess = enableLess && isLessLang(x);
|
|
618
679
|
return function CssTask() {
|
|
619
680
|
let chain = gulp.src([src, ...globs], { cwd, since: gulp.lastRun(CssTask) });
|
|
681
|
+
const pipes = [];
|
|
620
682
|
if (loadSass) {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
).on("error", sass.logError)
|
|
626
|
-
);
|
|
683
|
+
pipes.push(sass.sync(
|
|
684
|
+
// @ts-ignore
|
|
685
|
+
typeof preprocessorOptions?.sass === "boolean" ? void 0 : preprocessorOptions?.sass
|
|
686
|
+
).on("error", sass.logError));
|
|
627
687
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
);
|
|
688
|
+
pipes.push(gulpif(
|
|
689
|
+
loadLess,
|
|
690
|
+
less(typeof preprocessorOptions?.less === "boolean" ? void 0 : preprocessorOptions?.less)
|
|
691
|
+
));
|
|
692
|
+
pipes.push(gulpif(Boolean(postcssOptions), postcssrc(postcssOptions?.plugins, postcssOptions?.options)));
|
|
693
|
+
pipes.push(transformWxss());
|
|
694
|
+
pipes.push(gulpif(
|
|
695
|
+
loadSass || loadLess,
|
|
696
|
+
rename({
|
|
697
|
+
extname: ".wxss"
|
|
698
|
+
})
|
|
699
|
+
));
|
|
700
|
+
pipes.push(gulp.dest(outDir, {
|
|
701
|
+
cwd
|
|
702
|
+
}));
|
|
703
|
+
for (const p of resolvePipes(pipes, assetType)) {
|
|
704
|
+
chain = chain.pipe(p);
|
|
705
|
+
}
|
|
706
|
+
return promisify(chain);
|
|
647
707
|
};
|
|
648
708
|
});
|
|
649
709
|
}
|
|
@@ -655,12 +715,15 @@ async function getTasks(options) {
|
|
|
655
715
|
const src = `${base}**/*.${x}`;
|
|
656
716
|
globsSet.add(src);
|
|
657
717
|
return function HtmlTask() {
|
|
718
|
+
let chain = gulp.src([src, ...globs], { cwd, since: gulp.lastRun(HtmlTask) });
|
|
719
|
+
const pipes = [transformWxml(), gulp.dest(outDir, {
|
|
720
|
+
cwd
|
|
721
|
+
})];
|
|
722
|
+
for (const p of resolvePipes(pipes, assetType)) {
|
|
723
|
+
chain = chain.pipe(p);
|
|
724
|
+
}
|
|
658
725
|
return promisify(
|
|
659
|
-
|
|
660
|
-
gulp.dest(outDir, {
|
|
661
|
-
cwd
|
|
662
|
-
})
|
|
663
|
-
)
|
|
726
|
+
chain
|
|
664
727
|
);
|
|
665
728
|
};
|
|
666
729
|
});
|
|
@@ -671,13 +734,14 @@ async function getTasks(options) {
|
|
|
671
734
|
return `${base}${x}`;
|
|
672
735
|
});
|
|
673
736
|
globsSet.add(globs);
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
)
|
|
680
|
-
|
|
737
|
+
let chain = gulp.src([...globs, ...outDirGlobs], { cwd, since: gulp.lastRun(copyOthers) });
|
|
738
|
+
const pipes = [gulp.dest(outDir, {
|
|
739
|
+
cwd
|
|
740
|
+
})];
|
|
741
|
+
for (const p of pipes) {
|
|
742
|
+
chain = chain.pipe(p);
|
|
743
|
+
}
|
|
744
|
+
return promisify(chain);
|
|
681
745
|
}
|
|
682
746
|
}
|
|
683
747
|
return {
|
|
@@ -691,44 +755,13 @@ async function getTasks(options) {
|
|
|
691
755
|
};
|
|
692
756
|
}
|
|
693
757
|
|
|
694
|
-
const defaultJavascriptExtensions = ["js"];
|
|
695
|
-
const defaultTypescriptExtensions = ["ts"];
|
|
696
|
-
const defaultWxsExtensions = ["wxs"];
|
|
697
|
-
const defaultNodeModulesDirs = [
|
|
698
|
-
"**/node_modules/**",
|
|
699
|
-
"**/miniprogram_npm/**",
|
|
700
|
-
"**/project.config.json/**",
|
|
701
|
-
"**/project.private.config.json/**",
|
|
702
|
-
"**/package.json/**",
|
|
703
|
-
"postcss.config.js",
|
|
704
|
-
"tailwind.config.js",
|
|
705
|
-
"weapp-tw.config.js"
|
|
706
|
-
];
|
|
707
758
|
async function createBuilder(options) {
|
|
708
759
|
let postcssOptionsFromConfig;
|
|
709
760
|
try {
|
|
710
761
|
postcssOptionsFromConfig = await loadPostcssConfig({ cwd: options?.root });
|
|
711
762
|
} catch {
|
|
712
763
|
}
|
|
713
|
-
const opt = defu(options,
|
|
714
|
-
outDir: "dist",
|
|
715
|
-
weappTailwindcssOptions: {},
|
|
716
|
-
clean: true,
|
|
717
|
-
src: "",
|
|
718
|
-
exclude: [...defaultNodeModulesDirs],
|
|
719
|
-
include: ["**/*.{png,jpg,jpeg,gif,svg,webp}"],
|
|
720
|
-
extensions: {
|
|
721
|
-
javascript: [...defaultJavascriptExtensions, ...defaultTypescriptExtensions, ...defaultWxsExtensions],
|
|
722
|
-
html: ["wxml"],
|
|
723
|
-
css: ["wxss", "less", "sass", "scss"],
|
|
724
|
-
json: ["json"]
|
|
725
|
-
},
|
|
726
|
-
watchOptions: {
|
|
727
|
-
cwd: options?.root,
|
|
728
|
-
events: ["add", "change", "unlink", "ready"]
|
|
729
|
-
},
|
|
730
|
-
postcssOptions: postcssOptionsFromConfig
|
|
731
|
-
});
|
|
764
|
+
const opt = defu(options, getDefaultOptions(options, postcssOptionsFromConfig));
|
|
732
765
|
const { copyOthers, getCssTasks, getHtmlTasks, getJsTasks, getJsonTasks, globsSet } = await getTasks(opt);
|
|
733
766
|
const tasks = {
|
|
734
767
|
css: getCssTasks(),
|
|
@@ -757,7 +790,7 @@ async function createBuilder(options) {
|
|
|
757
790
|
if (clean) {
|
|
758
791
|
debug("del start");
|
|
759
792
|
const { deleteAsync } = await import('del');
|
|
760
|
-
const patterns = [outDir
|
|
793
|
+
const patterns = [`${outDir}/**`];
|
|
761
794
|
await deleteAsync(patterns, { cwd, ignore: defaultNodeModulesDirs });
|
|
762
795
|
debug("del end");
|
|
763
796
|
}
|
|
@@ -780,16 +813,16 @@ async function createBuilder(options) {
|
|
|
780
813
|
cb(error);
|
|
781
814
|
}
|
|
782
815
|
});
|
|
783
|
-
watcher.on("change",
|
|
816
|
+
watcher.on("change", (path2) => {
|
|
784
817
|
console.log(`${pc.green("changed")} ${path2}`);
|
|
785
818
|
});
|
|
786
|
-
watcher.on("add",
|
|
819
|
+
watcher.on("add", (path2) => {
|
|
787
820
|
console.log(`${pc.green("add")} ${path2}`);
|
|
788
821
|
});
|
|
789
|
-
watcher.on("unlink",
|
|
822
|
+
watcher.on("unlink", (path2) => {
|
|
790
823
|
console.log(`${pc.green("remove")} ${path2}`);
|
|
791
824
|
});
|
|
792
|
-
watcher.on("ready", async
|
|
825
|
+
watcher.on("ready", async () => {
|
|
793
826
|
const meta = await getPackageInfo("weapp-tailwindcss");
|
|
794
827
|
let weappTwVersionStr = "";
|
|
795
828
|
if (meta) {
|
package/package.json
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-tailwindcss/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "The cli of weapp-tailwindcss",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"weapp",
|
|
7
|
-
"tailwindcss",
|
|
8
|
-
"cli",
|
|
9
|
-
"plugin"
|
|
10
|
-
],
|
|
11
5
|
"author": "SonOfMagic <qq1324318532@gmail.com>",
|
|
12
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://weapp-tw.icebreaker.top/docs/quick-start/native/install",
|
|
13
8
|
"bugs": {
|
|
14
9
|
"url": "https://github.com/sonofmagic/weapp-tailwindcss/issues"
|
|
15
10
|
},
|
|
16
|
-
"
|
|
11
|
+
"keywords": [
|
|
12
|
+
"weapp",
|
|
13
|
+
"tailwindcss",
|
|
14
|
+
"cli",
|
|
15
|
+
"plugin",
|
|
16
|
+
"gulp",
|
|
17
|
+
"native"
|
|
18
|
+
],
|
|
17
19
|
"sideEffects": false,
|
|
18
|
-
"type": "commonjs",
|
|
19
20
|
"exports": {
|
|
20
21
|
".": {
|
|
21
22
|
"types": "./dist/index.d.ts",
|
|
@@ -29,10 +30,27 @@
|
|
|
29
30
|
"files": [
|
|
30
31
|
"dist"
|
|
31
32
|
],
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"less": "*",
|
|
35
|
+
"sass": "*",
|
|
36
|
+
"typescript": "*",
|
|
37
|
+
"weapp-tailwindcss": "3.2.1"
|
|
38
|
+
},
|
|
39
|
+
"peerDependenciesMeta": {
|
|
40
|
+
"less": {
|
|
41
|
+
"optional": true
|
|
42
|
+
},
|
|
43
|
+
"sass": {
|
|
44
|
+
"optional": true
|
|
45
|
+
},
|
|
46
|
+
"typescript": {
|
|
47
|
+
"optional": true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
32
50
|
"dependencies": {
|
|
33
|
-
"commander": "^12.
|
|
51
|
+
"commander": "^12.1.0",
|
|
34
52
|
"cosmiconfig": "^9.0.0",
|
|
35
|
-
"debug": "4.3.
|
|
53
|
+
"debug": "4.3.5",
|
|
36
54
|
"del": "^7.1.0",
|
|
37
55
|
"fs-extra": "^11.2.0",
|
|
38
56
|
"gulp": "^4.0.2",
|
|
@@ -45,31 +63,17 @@
|
|
|
45
63
|
"gulp-sass": "^5.1.0",
|
|
46
64
|
"gulp-typescript": "6.0.0-alpha.1",
|
|
47
65
|
"local-pkg": "^0.5.0",
|
|
48
|
-
"picocolors": "^1.0.
|
|
66
|
+
"picocolors": "^1.0.1",
|
|
49
67
|
"postcss": "^8.4.38",
|
|
50
68
|
"postcss-load-config": "^5.1.0"
|
|
51
69
|
},
|
|
52
|
-
"peerDependencies": {
|
|
53
|
-
"less": "*",
|
|
54
|
-
"sass": "*",
|
|
55
|
-
"typescript": "*",
|
|
56
|
-
"weapp-tailwindcss": "3.2.0"
|
|
57
|
-
},
|
|
58
|
-
"peerDependenciesMeta": {
|
|
59
|
-
"less": {
|
|
60
|
-
"optional": true
|
|
61
|
-
},
|
|
62
|
-
"sass": {
|
|
63
|
-
"optional": true
|
|
64
|
-
},
|
|
65
|
-
"typescript": {
|
|
66
|
-
"optional": true
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
70
|
"publishConfig": {
|
|
70
71
|
"access": "public",
|
|
71
72
|
"registry": "https://registry.npmjs.org"
|
|
72
73
|
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"tailwindcss": "^3.4.3"
|
|
76
|
+
},
|
|
73
77
|
"scripts": {
|
|
74
78
|
"dev": "unbuild --sourcemap",
|
|
75
79
|
"build": "unbuild",
|