@weapp-tailwindcss/cli 5.6.2 → 5.7.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/bin.cjs CHANGED
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env node
2
- const require_src = require("./src-B_MUyzMv.cjs");
2
+ const require_src = require("./src-BTR_jS9-.cjs");
3
3
  let node_process = require("node:process");
4
4
  node_process = require_src.__toESM(node_process, 1);
5
- //#region src/bin.ts
5
+ // src/bin.ts
6
6
  node_process.default.title = "node (@weapp-tailwindcss/cli)";
7
7
  require_src.runCli().then((exitCode) => {
8
8
  node_process.default.exitCode = exitCode;
9
9
  });
10
- //#endregion
package/dist/bin.js CHANGED
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { t as runCli } from "./src-BFXk_Uvz.js";
2
+ import { t as runCli } from "./src-BkFkHtC-.js";
3
3
  import process from "node:process";
4
- //#region src/bin.ts
4
+ // src/bin.ts
5
5
  process.title = "node (@weapp-tailwindcss/cli)";
6
6
  runCli().then((exitCode) => {
7
7
  process.exitCode = exitCode;
8
8
  });
9
- //#endregion
10
9
  export {};
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_src = require("./src-B_MUyzMv.cjs");
2
+ const require_src = require("./src-BTR_jS9-.cjs");
3
3
  exports.runCli = require_src.runCli;
package/dist/index.d.ts CHANGED
@@ -1,3 +1 @@
1
- //#region src/index.d.ts
2
- export declare function runCli(argv?: string[]): Promise<string | number>;
3
- //#endregion
1
+ export declare function runCli(argv?: string[]): Promise<string | number>;
package/dist/index.js CHANGED
@@ -1,2 +1 @@
1
- import { t as runCli } from "./src-BFXk_Uvz.js";
2
- export { runCli };
1
+ export { t as runCli } from "./src-BkFkHtC-.js";
@@ -1,4 +1,4 @@
1
- //#region \0rolldown/runtime.js
1
+ // \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -19,7 +19,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
19
19
  value: mod,
20
20
  enumerable: true
21
21
  }) : target, mod));
22
- //#endregion
23
22
  let node_process = require("node:process");
24
23
  node_process = __toESM(node_process, 1);
25
24
  let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
@@ -41,7 +40,7 @@ let fast_glob = require("fast-glob");
41
40
  fast_glob = __toESM(fast_glob, 1);
42
41
  let node_readline = require("node:readline");
43
42
  let node_module = require("node:module");
44
- //#region src/build/paths.ts
43
+ // src/build/paths.ts
45
44
  /** 按文件系统路径语义解析,不把 Windows 路径当作 POSIX 路径拼接。 */
46
45
  function resolveFilePath(file, cwd, paths = node_path.default) {
47
46
  return paths.resolve(cwd, file);
@@ -88,8 +87,7 @@ function isBuildOutput(file, outputs) {
88
87
  const identity = identify(file);
89
88
  return outputs.some((output) => identical(identity, identify(output)));
90
89
  }
91
- //#endregion
92
- //#region src/build/args.ts
90
+ // src/build/args.ts
93
91
  function value(argv, index, flag) {
94
92
  const item = argv[index];
95
93
  return (item?.startsWith(`${flag}=`) ? item.slice(flag.length + 1) : void 0) ?? argv[index + 1];
@@ -176,8 +174,7 @@ function parseBuildArgs(argv) {
176
174
  target
177
175
  };
178
176
  }
179
- //#endregion
180
- //#region src/build/watch-lifecycle.ts
177
+ // src/build/watch-lifecycle.ts
181
178
  /** 统一管理等待与停止,停止只唤醒循环,由调用方等待在途构建及清理完成。 */
182
179
  function createWatchLifecycle() {
183
180
  let stopped = false;
@@ -212,8 +209,7 @@ function createWatchLifecycle() {
212
209
  }
213
210
  };
214
211
  }
215
- //#endregion
216
- //#region src/build/watch.ts
212
+ // src/build/watch.ts
217
213
  var NativeWatcherError = class extends Error {};
218
214
  function report(error) {
219
215
  node_process.default.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
@@ -341,8 +337,7 @@ async function watchWithNativeWatcher(options, lifecycle) {
341
337
  await Promise.all([...subscriptions.values()].map((subscription) => subscription.unsubscribe()));
342
338
  }
343
339
  }
344
- //#endregion
345
- //#region src/canonicalize.ts
340
+ // src/canonicalize.ts
346
341
  function splitCandidates(input) {
347
342
  const result = [];
348
343
  let token = "";
@@ -438,8 +433,7 @@ async function runCanonicalize(argv) {
438
433
  node_process.default.stdout.write(`${output}\n`);
439
434
  return 0;
440
435
  }
441
- //#endregion
442
- //#region src/build.ts
436
+ // src/build.ts
443
437
  const DEFAULT_INPUT = "@import \"tailwindcss\";";
444
438
  async function drainStdin() {
445
439
  const chunks = [];
@@ -541,15 +535,12 @@ async function runTailwindCli(rawArgv) {
541
535
  if (rawArgv[0] === "canonicalize") return runCanonicalize(rawArgv.slice(1));
542
536
  return runBuild(rawArgv[0] === "build" ? rawArgv.slice(1) : rawArgv);
543
537
  }
544
- //#endregion
545
- //#region package.json
546
- var version = "5.6.2";
547
- //#endregion
548
- //#region src/constants.ts
538
+ // package.json
539
+ var version = "5.7.0";
540
+ // src/constants.ts
549
541
  const WEAPP_TW_REQUIRED_NODE_VERSION_RANGE = "^22.18.0 || >=24.11.0";
550
542
  const WEAPP_TW_VERSION = version;
551
- //#endregion
552
- //#region src/context.ts
543
+ // src/context.ts
553
544
  function formatOutputPath(target, baseDir) {
554
545
  const root = baseDir ?? node_process.default.cwd();
555
546
  const relative = node_path.default.relative(root, target);
@@ -557,8 +548,7 @@ function formatOutputPath(target, baseDir) {
557
548
  if (relative.startsWith("..")) return node_path.default.normalize(target);
558
549
  return relative.startsWith(".") ? relative : `.${node_path.default.sep}${relative}`;
559
550
  }
560
- //#endregion
561
- //#region src/doctor/constants.ts
551
+ // src/doctor/constants.ts
562
552
  const CONFIG_FILES = {
563
553
  tailwind: [
564
554
  "tailwind.config.js",
@@ -589,8 +579,7 @@ const FRAMEWORK_DEPS = [
589
579
  ["@mpxjs/core", "MPX"],
590
580
  ["remax", "Remax"]
591
581
  ];
592
- //#endregion
593
- //#region src/doctor/semantics.ts
582
+ // src/doctor/semantics.ts
594
583
  function readConfigText(cwd, file) {
595
584
  if (!file) return;
596
585
  try {
@@ -673,8 +662,7 @@ const SUPPORTED_GENERATOR_TARGETS = /* @__PURE__ */ new Set([
673
662
  "weapp",
674
663
  "app"
675
664
  ]);
676
- //#endregion
677
- //#region src/doctor.ts
665
+ // src/doctor.ts
678
666
  function tryReadJson(file) {
679
667
  try {
680
668
  return JSON.parse((0, node_fs.readFileSync)(file, "utf8"));
@@ -1020,8 +1008,7 @@ function formatDoctorReport(report) {
1020
1008
  }
1021
1009
  return lines.join("\n");
1022
1010
  }
1023
- //#endregion
1024
- //#region src/helpers/options/parse.ts
1011
+ // src/helpers/options/parse.ts
1025
1012
  function readStringOption(flag, value) {
1026
1013
  if (value == null) return;
1027
1014
  if (typeof value !== "string") throw new TypeError(`Option "--${flag}" expects a string value.`);
@@ -1052,15 +1039,13 @@ function toBoolean(value, fallback) {
1052
1039
  if (value == null) return fallback;
1053
1040
  return Boolean(value);
1054
1041
  }
1055
- //#endregion
1056
- //#region src/helpers/options/resolve.ts
1042
+ // src/helpers/options/resolve.ts
1057
1043
  function resolveCliCwd(value) {
1058
1044
  const raw = readStringOption("cwd", value);
1059
1045
  if (!raw) return;
1060
1046
  return node_path.default.isAbsolute(raw) ? node_path.default.normalize(raw) : node_path.default.resolve(node_process.default.cwd(), raw);
1061
1047
  }
1062
- //#endregion
1063
- //#region src/helpers.ts
1048
+ // src/helpers.ts
1064
1049
  async function ensureDir(dir) {
1065
1050
  await (0, node_fs_promises.mkdir)(dir, { recursive: true });
1066
1051
  }
@@ -1080,8 +1065,7 @@ function commandAction(handler) {
1080
1065
  }
1081
1066
  };
1082
1067
  }
1083
- //#endregion
1084
- //#region src/mount-options.ts
1068
+ // src/mount-options.ts
1085
1069
  const PATCH_COMMAND_OBSOLETE_NOTICE = "提示:weapp-tailwindcss@5 已由构建运行时接管 Tailwind CSS 处理,weapp-tw patch 已无需执行;请移除 package.json 中的 postinstall 钩子。";
1086
1070
  const obsoletePatchCommands = [
1087
1071
  "extract",
@@ -1194,8 +1178,7 @@ async function generateVscodeIntellisenseEntry(options) {
1194
1178
  cssEntryPath
1195
1179
  };
1196
1180
  }
1197
- //#endregion
1198
- //#region src/index.ts
1181
+ // src/index.ts
1199
1182
  function parseLegacyArgs(argv) {
1200
1183
  const options = {};
1201
1184
  const positional = [];
@@ -1331,7 +1314,6 @@ async function runCli(argv = node_process.default.argv.slice(2)) {
1331
1314
  })();
1332
1315
  return node_process.default.exitCode ?? 0;
1333
1316
  }
1334
- //#endregion
1335
1317
  Object.defineProperty(exports, "__toESM", {
1336
1318
  enumerable: true,
1337
1319
  get: function() {
@@ -12,7 +12,7 @@ import { createHash } from "node:crypto";
12
12
  import * as parcelWatcher from "@parcel/watcher";
13
13
  import fg from "fast-glob";
14
14
  import { createInterface } from "node:readline";
15
- //#region src/build/paths.ts
15
+ // src/build/paths.ts
16
16
  /** 按文件系统路径语义解析,不把 Windows 路径当作 POSIX 路径拼接。 */
17
17
  function resolveFilePath(file, cwd, paths = path) {
18
18
  return paths.resolve(cwd, file);
@@ -59,8 +59,7 @@ function isBuildOutput(file, outputs) {
59
59
  const identity = identify(file);
60
60
  return outputs.some((output) => identical(identity, identify(output)));
61
61
  }
62
- //#endregion
63
- //#region src/build/args.ts
62
+ // src/build/args.ts
64
63
  function value(argv, index, flag) {
65
64
  const item = argv[index];
66
65
  return (item?.startsWith(`${flag}=`) ? item.slice(flag.length + 1) : void 0) ?? argv[index + 1];
@@ -147,8 +146,7 @@ function parseBuildArgs(argv) {
147
146
  target
148
147
  };
149
148
  }
150
- //#endregion
151
- //#region src/build/watch-lifecycle.ts
149
+ // src/build/watch-lifecycle.ts
152
150
  /** 统一管理等待与停止,停止只唤醒循环,由调用方等待在途构建及清理完成。 */
153
151
  function createWatchLifecycle() {
154
152
  let stopped = false;
@@ -183,8 +181,7 @@ function createWatchLifecycle() {
183
181
  }
184
182
  };
185
183
  }
186
- //#endregion
187
- //#region src/build/watch.ts
184
+ // src/build/watch.ts
188
185
  var NativeWatcherError = class extends Error {};
189
186
  function report(error) {
190
187
  process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
@@ -312,8 +309,7 @@ async function watchWithNativeWatcher(options, lifecycle) {
312
309
  await Promise.all([...subscriptions.values()].map((subscription) => subscription.unsubscribe()));
313
310
  }
314
311
  }
315
- //#endregion
316
- //#region src/canonicalize.ts
312
+ // src/canonicalize.ts
317
313
  function splitCandidates(input) {
318
314
  const result = [];
319
315
  let token = "";
@@ -409,8 +405,7 @@ async function runCanonicalize(argv) {
409
405
  process.stdout.write(`${output}\n`);
410
406
  return 0;
411
407
  }
412
- //#endregion
413
- //#region src/build.ts
408
+ // src/build.ts
414
409
  const DEFAULT_INPUT = "@import \"tailwindcss\";";
415
410
  async function drainStdin() {
416
411
  const chunks = [];
@@ -512,15 +507,12 @@ async function runTailwindCli(rawArgv) {
512
507
  if (rawArgv[0] === "canonicalize") return runCanonicalize(rawArgv.slice(1));
513
508
  return runBuild(rawArgv[0] === "build" ? rawArgv.slice(1) : rawArgv);
514
509
  }
515
- //#endregion
516
- //#region package.json
517
- var version = "5.6.2";
518
- //#endregion
519
- //#region src/constants.ts
510
+ // package.json
511
+ var version = "5.7.0";
512
+ // src/constants.ts
520
513
  const WEAPP_TW_REQUIRED_NODE_VERSION_RANGE = "^22.18.0 || >=24.11.0";
521
514
  const WEAPP_TW_VERSION = version;
522
- //#endregion
523
- //#region src/context.ts
515
+ // src/context.ts
524
516
  function formatOutputPath(target, baseDir) {
525
517
  const root = baseDir ?? process.cwd();
526
518
  const relative = path.relative(root, target);
@@ -528,8 +520,7 @@ function formatOutputPath(target, baseDir) {
528
520
  if (relative.startsWith("..")) return path.normalize(target);
529
521
  return relative.startsWith(".") ? relative : `.${path.sep}${relative}`;
530
522
  }
531
- //#endregion
532
- //#region src/doctor/constants.ts
523
+ // src/doctor/constants.ts
533
524
  const CONFIG_FILES = {
534
525
  tailwind: [
535
526
  "tailwind.config.js",
@@ -560,8 +551,7 @@ const FRAMEWORK_DEPS = [
560
551
  ["@mpxjs/core", "MPX"],
561
552
  ["remax", "Remax"]
562
553
  ];
563
- //#endregion
564
- //#region src/doctor/semantics.ts
554
+ // src/doctor/semantics.ts
565
555
  function readConfigText(cwd, file) {
566
556
  if (!file) return;
567
557
  try {
@@ -644,8 +634,7 @@ const SUPPORTED_GENERATOR_TARGETS = /* @__PURE__ */ new Set([
644
634
  "weapp",
645
635
  "app"
646
636
  ]);
647
- //#endregion
648
- //#region src/doctor.ts
637
+ // src/doctor.ts
649
638
  function tryReadJson(file) {
650
639
  try {
651
640
  return JSON.parse(readFileSync(file, "utf8"));
@@ -991,8 +980,7 @@ function formatDoctorReport(report) {
991
980
  }
992
981
  return lines.join("\n");
993
982
  }
994
- //#endregion
995
- //#region src/helpers/options/parse.ts
983
+ // src/helpers/options/parse.ts
996
984
  function readStringOption(flag, value) {
997
985
  if (value == null) return;
998
986
  if (typeof value !== "string") throw new TypeError(`Option "--${flag}" expects a string value.`);
@@ -1023,15 +1011,13 @@ function toBoolean(value, fallback) {
1023
1011
  if (value == null) return fallback;
1024
1012
  return Boolean(value);
1025
1013
  }
1026
- //#endregion
1027
- //#region src/helpers/options/resolve.ts
1014
+ // src/helpers/options/resolve.ts
1028
1015
  function resolveCliCwd(value) {
1029
1016
  const raw = readStringOption("cwd", value);
1030
1017
  if (!raw) return;
1031
1018
  return path.isAbsolute(raw) ? path.normalize(raw) : path.resolve(process.cwd(), raw);
1032
1019
  }
1033
- //#endregion
1034
- //#region src/helpers.ts
1020
+ // src/helpers.ts
1035
1021
  async function ensureDir(dir) {
1036
1022
  await mkdir(dir, { recursive: true });
1037
1023
  }
@@ -1051,8 +1037,7 @@ function commandAction(handler) {
1051
1037
  }
1052
1038
  };
1053
1039
  }
1054
- //#endregion
1055
- //#region src/mount-options.ts
1040
+ // src/mount-options.ts
1056
1041
  const PATCH_COMMAND_OBSOLETE_NOTICE = "提示:weapp-tailwindcss@5 已由构建运行时接管 Tailwind CSS 处理,weapp-tw patch 已无需执行;请移除 package.json 中的 postinstall 钩子。";
1057
1042
  const obsoletePatchCommands = [
1058
1043
  "extract",
@@ -1165,8 +1150,7 @@ async function generateVscodeIntellisenseEntry(options) {
1165
1150
  cssEntryPath
1166
1151
  };
1167
1152
  }
1168
- //#endregion
1169
- //#region src/index.ts
1153
+ // src/index.ts
1170
1154
  function parseLegacyArgs(argv) {
1171
1155
  const options = {};
1172
1156
  const positional = [];
@@ -1302,5 +1286,4 @@ async function runCli(argv = process.argv.slice(2)) {
1302
1286
  })();
1303
1287
  return process.exitCode ?? 0;
1304
1288
  }
1305
- //#endregion
1306
1289
  export { runCli as t };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/cli",
3
3
  "type": "module",
4
- "version": "5.6.2",
4
+ "version": "5.7.0",
5
5
  "description": "Cross-platform Tailwind CSS CLI for Web and mini-program builds. 面向 Web 与小程序构建的跨端 Tailwind CSS CLI。",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -50,12 +50,12 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@parcel/watcher": "^2.6.0",
53
- "@weapp-tailwindcss/engine": "0.1.5",
53
+ "@weapp-tailwindcss/engine": "0.1.7",
54
54
  "@weapp-tailwindcss/logger": "2.0.4",
55
55
  "fast-glob": "^3.3.3",
56
56
  "lightningcss": "^1.33.0",
57
- "semver": "~7.8.5",
58
- "weapp-tailwindcss": "5.6.2"
57
+ "semver": "~7.8.6",
58
+ "weapp-tailwindcss": "5.7.0"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "tsdown",