@weapp-tailwindcss/shared 2.0.4 → 2.0.5

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.
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/extractors/split.ts
2
+ // src/extractors/split.ts
3
3
  const validateFilterRE = /[\w\u00A0-\uFFFF%-?]/;
4
4
  function isValidSelector(selector = "") {
5
5
  return validateFilterRE.test(selector);
@@ -60,7 +60,6 @@ function splitCandidateTokens(code) {
60
60
  function splitCode(code, _allowDoubleQuotes = false) {
61
61
  return splitCandidateTokens(code);
62
62
  }
63
- //#endregion
64
63
  exports.isValidSelector = isValidSelector;
65
64
  exports.splitCandidateTokens = splitCandidateTokens;
66
65
  exports.splitCode = splitCode;
@@ -0,0 +1,4 @@
1
+ export declare const validateFilterRE: RegExp;
2
+ export declare function isValidSelector(selector?: string): selector is string;
3
+ export declare function splitCandidateTokens(code: string): string[];
4
+ export declare function splitCode(code: string, _allowDoubleQuotes?: boolean): string[];
@@ -1,6 +1,4 @@
1
- //#region src/extractors/split.d.ts
2
1
  export declare const validateFilterRE: RegExp;
3
2
  export declare function isValidSelector(selector?: string): selector is string;
4
3
  export declare function splitCandidateTokens(code: string): string[];
5
- export declare function splitCode(code: string, _allowDoubleQuotes?: boolean): string[];
6
- //#endregion
4
+ export declare function splitCode(code: string, _allowDoubleQuotes?: boolean): string[];
@@ -1,4 +1,4 @@
1
- //#region src/extractors/split.ts
1
+ // src/extractors/split.ts
2
2
  const validateFilterRE = /[\w\u00A0-\uFFFF%-?]/;
3
3
  function isValidSelector(selector = "") {
4
4
  return validateFilterRE.test(selector);
@@ -59,5 +59,4 @@ function splitCandidateTokens(code) {
59
59
  function splitCode(code, _allowDoubleQuotes = false) {
60
60
  return splitCandidateTokens(code);
61
61
  }
62
- //#endregion
63
62
  export { isValidSelector, splitCandidateTokens, splitCode, validateFilterRE };
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
2
+ const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
3
3
  let defu = require("defu");
4
4
  let get_value = require("get-value");
5
5
  get_value = require_rolldown_runtime.__toESM(get_value, 1);
6
6
  let set_value = require("set-value");
7
7
  set_value = require_rolldown_runtime.__toESM(set_value, 1);
8
- //#region src/index.ts
8
+ // src/index.ts
9
9
  const HTTP_PATTERN = /^https?:\/\//i;
10
10
  const CLEAN_URL_REGEXP = /[?#].*$/;
11
11
  const BACKSLASH_RE = /\\/g;
@@ -74,7 +74,6 @@ const defuOverrideArray = (0, defu.createDefu)((obj, key, value) => {
74
74
  return true;
75
75
  }
76
76
  });
77
- //#endregion
78
77
  exports.cleanUrl = cleanUrl;
79
78
  Object.defineProperty(exports, "defu", {
80
79
  enumerable: true,
@@ -84,7 +83,12 @@ Object.defineProperty(exports, "defu", {
84
83
  });
85
84
  exports.defuOverrideArray = defuOverrideArray;
86
85
  exports.ensurePosix = ensurePosix;
87
- exports.getValue = get_value.default;
86
+ Object.defineProperty(exports, "getValue", {
87
+ enumerable: true,
88
+ get: function() {
89
+ return get_value.default;
90
+ }
91
+ });
88
92
  exports.groupBy = groupBy;
89
93
  exports.isHttp = isHttp;
90
94
  exports.isMap = isMap;
@@ -94,5 +98,10 @@ exports.normalizeRelativeImport = normalizeRelativeImport;
94
98
  exports.normalizeRoot = normalizeRoot;
95
99
  exports.regExpTest = regExpTest;
96
100
  exports.removeExt = removeExt;
97
- exports.setValue = set_value.default;
101
+ Object.defineProperty(exports, "setValue", {
102
+ enumerable: true,
103
+ get: function() {
104
+ return set_value.default;
105
+ }
106
+ });
98
107
  exports.toArray = toArray;
@@ -0,0 +1,19 @@
1
+ import getValue from "get-value";
2
+ import setValue from "set-value";
3
+ import { defu } from "defu";
4
+ export declare function isRegexp(value: unknown): value is RegExp;
5
+ export declare function isMap<T = unknown, K = unknown>(value: unknown): value is Map<T, K>;
6
+ export declare function isHttp(target: string): boolean;
7
+ export declare function cleanUrl(url: string): string;
8
+ export declare function toArray<T>(value: T | T[] | null | undefined): Array<NonNullable<T>>;
9
+ export declare function ensurePosix(value: string): string;
10
+ export declare function normalizeRoot(root: string): string;
11
+ export declare function normalizeRelativeImport(target: string): string;
12
+ export declare function regExpTest(arr: (string | RegExp)[], str: string, options?: {
13
+ exact?: boolean;
14
+ }): boolean;
15
+ export declare function noop(): void;
16
+ export declare function groupBy<T>(arr: T[], cb: (arg: T) => string): Record<string, T[]>;
17
+ export declare function removeExt(file: string): string;
18
+ export declare const defuOverrideArray: import("defu").DefuFn;
19
+ export { defu, getValue, setValue };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { defu } from "defu";
2
2
  import getValue from "get-value";
3
3
  import setValue from "set-value";
4
- //#region src/index.d.ts
5
4
  export declare function isRegexp(value: unknown): value is RegExp;
6
5
  export declare function isMap<T = unknown, K = unknown>(value: unknown): value is Map<T, K>;
7
6
  export declare function isHttp(target: string): boolean;
@@ -17,5 +16,4 @@ export declare function noop(): void;
17
16
  export declare function groupBy<T>(arr: T[], cb: (arg: T) => string): Record<string, T[]>;
18
17
  export declare function removeExt(file: string): string;
19
18
  export declare const defuOverrideArray: import("defu").DefuFn;
20
- //#endregion
21
19
  export { defu, getValue, setValue };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createDefu, defu } from "defu";
2
2
  import getValue from "get-value";
3
3
  import setValue from "set-value";
4
- //#region src/index.ts
4
+ // src/index.ts
5
5
  const HTTP_PATTERN = /^https?:\/\//i;
6
6
  const CLEAN_URL_REGEXP = /[?#].*$/;
7
7
  const BACKSLASH_RE = /\\/g;
@@ -70,5 +70,4 @@ const defuOverrideArray = createDefu((obj, key, value) => {
70
70
  return true;
71
71
  }
72
72
  });
73
- //#endregion
74
73
  export { cleanUrl, defu, defuOverrideArray, ensurePosix, getValue, groupBy, isHttp, isMap, isRegexp, noop, normalizeRelativeImport, normalizeRoot, regExpTest, removeExt, setValue, toArray };
package/dist/node.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
2
+ const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
3
3
  let node_crypto = require("node:crypto");
4
4
  node_crypto = require_rolldown_runtime.__toESM(node_crypto, 1);
5
5
  let pathe = require("pathe");
6
6
  pathe = require_rolldown_runtime.__toESM(pathe, 1);
7
- //#region src/node.ts
7
+ // src/node.ts
8
8
  function md5(input) {
9
9
  return node_crypto.default.createHash("md5").update(input).digest("hex");
10
10
  }
@@ -19,6 +19,5 @@ function removeAllExtensions(filePath) {
19
19
  const dir = pathe.default.dirname(filePath);
20
20
  return dir === "." ? baseName : pathe.default.join(dir, baseName);
21
21
  }
22
- //#endregion
23
22
  exports.md5 = md5;
24
23
  exports.removeAllExtensions = removeAllExtensions;
@@ -0,0 +1,3 @@
1
+ import crypto from "node:crypto";
2
+ export declare function md5(input: crypto.BinaryLike): string;
3
+ export declare function removeAllExtensions(filePath: string): string;
package/dist/node.d.ts CHANGED
@@ -1,5 +1,3 @@
1
1
  import crypto from "node:crypto";
2
- //#region src/node.d.ts
3
2
  export declare function md5(input: crypto.BinaryLike): string;
4
- export declare function removeAllExtensions(filePath: string): string;
5
- //#endregion
3
+ export declare function removeAllExtensions(filePath: string): string;
package/dist/node.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import crypto from "node:crypto";
2
2
  import path from "pathe";
3
- //#region src/node.ts
3
+ // src/node.ts
4
4
  function md5(input) {
5
5
  return crypto.createHash("md5").update(input).digest("hex");
6
6
  }
@@ -15,5 +15,4 @@ function removeAllExtensions(filePath) {
15
15
  const dir = path.dirname(filePath);
16
16
  return dir === "." ? baseName : path.join(dir, baseName);
17
17
  }
18
- //#endregion
19
18
  export { md5, removeAllExtensions };
@@ -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
  Object.defineProperty(exports, "__toESM", {
24
23
  enumerable: true,
25
24
  get: function() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/shared",
3
3
  "type": "module",
4
- "version": "2.0.4",
4
+ "version": "2.0.5",
5
5
  "description": "Shared utilities for the cross-platform weapp-tailwindcss toolchain. weapp-tailwindcss 跨端工具链的共享工具。",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -18,19 +18,34 @@
18
18
  "sideEffects": false,
19
19
  "exports": {
20
20
  ".": {
21
- "types": "./dist/index.d.ts",
22
- "import": "./dist/index.js",
23
- "require": "./dist/index.cjs"
21
+ "import": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "require": {
26
+ "types": "./dist/index.d.cts",
27
+ "default": "./dist/index.cjs"
28
+ }
24
29
  },
25
30
  "./extractors": {
26
- "types": "./dist/extractors.d.ts",
27
- "import": "./dist/extractors.js",
28
- "require": "./dist/extractors.cjs"
31
+ "import": {
32
+ "types": "./dist/extractors.d.ts",
33
+ "default": "./dist/extractors.js"
34
+ },
35
+ "require": {
36
+ "types": "./dist/extractors.d.cts",
37
+ "default": "./dist/extractors.cjs"
38
+ }
29
39
  },
30
40
  "./node": {
31
- "types": "./dist/node.d.ts",
32
- "import": "./dist/node.js",
33
- "require": "./dist/node.cjs"
41
+ "import": {
42
+ "types": "./dist/node.d.ts",
43
+ "default": "./dist/node.js"
44
+ },
45
+ "require": {
46
+ "types": "./dist/node.d.cts",
47
+ "default": "./dist/node.cjs"
48
+ }
34
49
  }
35
50
  },
36
51
  "main": "./dist/index.cjs",
@@ -43,6 +58,7 @@
43
58
  "node": "^20.19.0 || >=22.12.0"
44
59
  },
45
60
  "dependencies": {
61
+ "@types/set-value": "^4.0.3",
46
62
  "defu": "^6.1.7",
47
63
  "get-value": "^4.1.0",
48
64
  "pathe": "^2.0.3",