@weapp-tailwindcss/cli 0.0.0-alpha.9 → 1.0.1

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 CHANGED
@@ -88,7 +88,7 @@ function createDefu(merger) {
88
88
  }
89
89
  const defu = createDefu();
90
90
 
91
- const version = "0.0.0-alpha.9";
91
+ const version = "1.0.1";
92
92
 
93
93
  const debug = createDebug__default("weapp-tw-cli");
94
94
 
@@ -518,7 +518,17 @@ function isTsLang(lang) {
518
518
  }
519
519
  async function getTasks(options) {
520
520
  let { typescriptOptions } = options;
521
- const { root: cwd, weappTailwindcssOptions, outDir, src: srcBase, extensions, exclude, include, postcssOptions, preprocessorOptions } = options;
521
+ const {
522
+ root: cwd,
523
+ weappTailwindcssOptions,
524
+ outDir,
525
+ src: srcBase,
526
+ extensions,
527
+ exclude,
528
+ include,
529
+ postcssOptions,
530
+ preprocessorOptions
531
+ } = options;
522
532
  const globsSet = new GlobsSet();
523
533
  const base = srcBase ? srcBase + "/" : "";
524
534
  const enableSass = Boolean(preprocessorOptions?.sass);
@@ -562,7 +572,10 @@ async function getTasks(options) {
562
572
  const loadTs = enableTs && isTs;
563
573
  let gulpTs;
564
574
  if (enableTs && typeof typescriptOptions !== "boolean") {
565
- gulpTs = typescript__default.createProject(typescriptOptions.tsConfigFileName ?? "tsconfig.json", typeof typescriptOptions === "boolean" ? {} : typescriptOptions);
575
+ gulpTs = typescript__default.createProject(
576
+ typescriptOptions.tsConfigFileName ?? "tsconfig.json",
577
+ typeof typescriptOptions === "boolean" ? {} : typescriptOptions
578
+ );
566
579
  }
567
580
  return function JsTask() {
568
581
  let chain = gulp__default.src([src, ...globs], { cwd, since: gulp__default.lastRun(JsTask) });
@@ -630,7 +643,12 @@ async function getTasks(options) {
630
643
  );
631
644
  }
632
645
  return promisify(
633
- chain.pipe(gulpif__default(loadLess, less__default(typeof preprocessorOptions?.less === "boolean" ? void 0 : preprocessorOptions?.less))).pipe(gulpif__default(Boolean(postcssOptions), postcssrc__default(postcssOptions?.plugins, postcssOptions?.options))).pipe(transformWxss()).pipe(
646
+ chain.pipe(
647
+ gulpif__default(
648
+ loadLess,
649
+ less__default(typeof preprocessorOptions?.less === "boolean" ? void 0 : preprocessorOptions?.less)
650
+ )
651
+ ).pipe(gulpif__default(Boolean(postcssOptions), postcssrc__default(postcssOptions?.plugins, postcssOptions?.options))).pipe(transformWxss()).pipe(
634
652
  gulpif__default(
635
653
  loadSass || loadLess,
636
654
  rename__default({
@@ -715,6 +733,7 @@ async function createBuilder(options) {
715
733
  clean: true,
716
734
  src: "",
717
735
  exclude: [...defaultNodeModulesDirs],
736
+ include: ["**/*.{png,jpg,jpeg,gif,svg,webp}"],
718
737
  extensions: {
719
738
  javascript: [...defaultJavascriptExtensions, ...defaultTypescriptExtensions, ...defaultWxsExtensions],
720
739
  html: ["wxml"],
@@ -766,7 +785,9 @@ async function createBuilder(options) {
766
785
  watch() {
767
786
  fs.ensureDirSync(path__default.resolve(cwd, outDir));
768
787
  const dumps = globsSet.dump();
769
- const arr = (Array.isArray(watchOptions.ignored) ? watchOptions.ignored : [watchOptions.ignored]).filter(Boolean);
788
+ const arr = (Array.isArray(watchOptions.ignored) ? watchOptions.ignored : [watchOptions.ignored]).filter(
789
+ Boolean
790
+ );
770
791
  watchOptions.ignored = [...globsSet.dumpIgnored(), ...arr];
771
792
  const watcher = gulp__default.watch(dumps, watchOptions, async (cb) => {
772
793
  try {
@@ -791,7 +812,9 @@ async function createBuilder(options) {
791
812
  if (meta) {
792
813
  weappTwVersionStr = `(${pc__default.blue(pc__default.underline(meta.version))})`;
793
814
  }
794
- console.log(`${pc__default.bold(`${pc__default.green("weapp")}-${pc__default.blue("tailwindcss")}`)}${weappTwVersionStr} ${pc__default.cyan("cli")}(${pc__default.blue(pc__default.underline(version))}) is ready!`);
815
+ console.log(
816
+ `${pc__default.bold(`${pc__default.green("weapp")}-${pc__default.blue("tailwindcss")}`)}${weappTwVersionStr} ${pc__default.cyan("cli")}(${pc__default.blue(pc__default.underline(version))}) is ready!`
817
+ );
795
818
  });
796
819
  this.watcher = watcher;
797
820
  return this;
@@ -846,7 +869,9 @@ function updateProjectConfig(options) {
846
869
  set(projectConfig, "srcMiniprogramRoot", "dist/");
847
870
  set(projectConfig, "setting.packNpmManually", true);
848
871
  if (Array.isArray(get(projectConfig, "setting.packNpmRelationList"))) {
849
- const x = projectConfig.setting.packNpmRelationList.find((x2) => x2.packageJsonPath === "./package.json" && x2.miniprogramNpmDistDir === "./dist");
872
+ const x = projectConfig.setting.packNpmRelationList.find(
873
+ (x2) => x2.packageJsonPath === "./package.json" && x2.miniprogramNpmDistDir === "./dist"
874
+ );
850
875
  if (!x) {
851
876
  projectConfig.setting.packNpmRelationList.push({
852
877
  packageJsonPath: "./package.json",
@@ -890,7 +915,10 @@ function updatePackageJson(options) {
890
915
  }
891
916
  }
892
917
  function initConfig(options) {
893
- const { lang, root } = defu(options, { lang: "js", root: process.cwd() });
918
+ const { lang, root } = defu(options, {
919
+ lang: "js",
920
+ root: process.cwd()
921
+ });
894
922
  const configFilename = `weapp-tw.config.${lang ?? "js"}`;
895
923
  const configPath = path__default.resolve(root, configFilename);
896
924
  const tsconfigPath = path__default.resolve(root, "tsconfig.json");
package/dist/index.mjs CHANGED
@@ -71,7 +71,7 @@ function createDefu(merger) {
71
71
  }
72
72
  const defu = createDefu();
73
73
 
74
- const version = "0.0.0-alpha.9";
74
+ const version = "1.0.1";
75
75
 
76
76
  const debug = createDebug("weapp-tw-cli");
77
77
 
@@ -501,7 +501,17 @@ function isTsLang(lang) {
501
501
  }
502
502
  async function getTasks(options) {
503
503
  let { typescriptOptions } = options;
504
- const { root: cwd, weappTailwindcssOptions, outDir, src: srcBase, extensions, exclude, include, postcssOptions, preprocessorOptions } = options;
504
+ const {
505
+ root: cwd,
506
+ weappTailwindcssOptions,
507
+ outDir,
508
+ src: srcBase,
509
+ extensions,
510
+ exclude,
511
+ include,
512
+ postcssOptions,
513
+ preprocessorOptions
514
+ } = options;
505
515
  const globsSet = new GlobsSet();
506
516
  const base = srcBase ? srcBase + "/" : "";
507
517
  const enableSass = Boolean(preprocessorOptions?.sass);
@@ -545,7 +555,10 @@ async function getTasks(options) {
545
555
  const loadTs = enableTs && isTs;
546
556
  let gulpTs;
547
557
  if (enableTs && typeof typescriptOptions !== "boolean") {
548
- gulpTs = typescript.createProject(typescriptOptions.tsConfigFileName ?? "tsconfig.json", typeof typescriptOptions === "boolean" ? {} : typescriptOptions);
558
+ gulpTs = typescript.createProject(
559
+ typescriptOptions.tsConfigFileName ?? "tsconfig.json",
560
+ typeof typescriptOptions === "boolean" ? {} : typescriptOptions
561
+ );
549
562
  }
550
563
  return function JsTask() {
551
564
  let chain = gulp.src([src, ...globs], { cwd, since: gulp.lastRun(JsTask) });
@@ -613,7 +626,12 @@ async function getTasks(options) {
613
626
  );
614
627
  }
615
628
  return promisify(
616
- chain.pipe(gulpif(loadLess, less(typeof preprocessorOptions?.less === "boolean" ? void 0 : preprocessorOptions?.less))).pipe(gulpif(Boolean(postcssOptions), postcssrc(postcssOptions?.plugins, postcssOptions?.options))).pipe(transformWxss()).pipe(
629
+ chain.pipe(
630
+ gulpif(
631
+ loadLess,
632
+ less(typeof preprocessorOptions?.less === "boolean" ? void 0 : preprocessorOptions?.less)
633
+ )
634
+ ).pipe(gulpif(Boolean(postcssOptions), postcssrc(postcssOptions?.plugins, postcssOptions?.options))).pipe(transformWxss()).pipe(
617
635
  gulpif(
618
636
  loadSass || loadLess,
619
637
  rename({
@@ -698,6 +716,7 @@ async function createBuilder(options) {
698
716
  clean: true,
699
717
  src: "",
700
718
  exclude: [...defaultNodeModulesDirs],
719
+ include: ["**/*.{png,jpg,jpeg,gif,svg,webp}"],
701
720
  extensions: {
702
721
  javascript: [...defaultJavascriptExtensions, ...defaultTypescriptExtensions, ...defaultWxsExtensions],
703
722
  html: ["wxml"],
@@ -749,7 +768,9 @@ async function createBuilder(options) {
749
768
  watch() {
750
769
  ensureDirSync(path.resolve(cwd, outDir));
751
770
  const dumps = globsSet.dump();
752
- const arr = (Array.isArray(watchOptions.ignored) ? watchOptions.ignored : [watchOptions.ignored]).filter(Boolean);
771
+ const arr = (Array.isArray(watchOptions.ignored) ? watchOptions.ignored : [watchOptions.ignored]).filter(
772
+ Boolean
773
+ );
753
774
  watchOptions.ignored = [...globsSet.dumpIgnored(), ...arr];
754
775
  const watcher = gulp.watch(dumps, watchOptions, async (cb) => {
755
776
  try {
@@ -774,7 +795,9 @@ async function createBuilder(options) {
774
795
  if (meta) {
775
796
  weappTwVersionStr = `(${pc.blue(pc.underline(meta.version))})`;
776
797
  }
777
- console.log(`${pc.bold(`${pc.green("weapp")}-${pc.blue("tailwindcss")}`)}${weappTwVersionStr} ${pc.cyan("cli")}(${pc.blue(pc.underline(version))}) is ready!`);
798
+ console.log(
799
+ `${pc.bold(`${pc.green("weapp")}-${pc.blue("tailwindcss")}`)}${weappTwVersionStr} ${pc.cyan("cli")}(${pc.blue(pc.underline(version))}) is ready!`
800
+ );
778
801
  });
779
802
  this.watcher = watcher;
780
803
  return this;
@@ -829,7 +852,9 @@ function updateProjectConfig(options) {
829
852
  set(projectConfig, "srcMiniprogramRoot", "dist/");
830
853
  set(projectConfig, "setting.packNpmManually", true);
831
854
  if (Array.isArray(get(projectConfig, "setting.packNpmRelationList"))) {
832
- const x = projectConfig.setting.packNpmRelationList.find((x2) => x2.packageJsonPath === "./package.json" && x2.miniprogramNpmDistDir === "./dist");
855
+ const x = projectConfig.setting.packNpmRelationList.find(
856
+ (x2) => x2.packageJsonPath === "./package.json" && x2.miniprogramNpmDistDir === "./dist"
857
+ );
833
858
  if (!x) {
834
859
  projectConfig.setting.packNpmRelationList.push({
835
860
  packageJsonPath: "./package.json",
@@ -873,7 +898,10 @@ function updatePackageJson(options) {
873
898
  }
874
899
  }
875
900
  function initConfig(options) {
876
- const { lang, root } = defu(options, { lang: "js", root: process.cwd() });
901
+ const { lang, root } = defu(options, {
902
+ lang: "js",
903
+ root: process.cwd()
904
+ });
877
905
  const configFilename = `weapp-tw.config.${lang ?? "js"}`;
878
906
  const configPath = path.resolve(root, configFilename);
879
907
  const tsconfigPath = path.resolve(root, "tsconfig.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/cli",
3
- "version": "0.0.0-alpha.9",
3
+ "version": "1.0.1",
4
4
  "description": "The cli of weapp-tailwindcss",
5
5
  "keywords": [
6
6
  "weapp",
@@ -47,13 +47,13 @@
47
47
  "local-pkg": "^0.5.0",
48
48
  "picocolors": "^1.0.0",
49
49
  "postcss": "^8.4.38",
50
- "postcss-load-config": "^5.0.3"
50
+ "postcss-load-config": "^5.1.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "less": "*",
54
54
  "sass": "*",
55
55
  "typescript": "*",
56
- "weapp-tailwindcss": "3.2.0-alpha.10"
56
+ "weapp-tailwindcss": "3.2.0"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "less": {