tailwindcss-patch 7.1.0 → 7.1.2
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/{chunk-MRFFSSEO.mjs → chunk-5PNNXDLA.mjs} +54 -22
- package/dist/{chunk-T7FU63AY.js → chunk-WNQ2OYR4.js} +47 -15
- package/dist/cli.js +8 -8
- package/dist/cli.mjs +2 -2
- package/dist/index.d.mts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +15 -15
|
@@ -94,7 +94,7 @@ var logger = createConsola();
|
|
|
94
94
|
var logger_default = logger;
|
|
95
95
|
|
|
96
96
|
// src/core/cache.ts
|
|
97
|
-
import process from "
|
|
97
|
+
import process from "process";
|
|
98
98
|
import fs from "fs-extra";
|
|
99
99
|
import path from "pathe";
|
|
100
100
|
|
|
@@ -142,26 +142,26 @@ var CacheManager = class {
|
|
|
142
142
|
strategy: "merge"
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
write(data) {
|
|
146
146
|
try {
|
|
147
147
|
const { filename } = this.options;
|
|
148
|
-
|
|
148
|
+
fs.outputJSONSync(filename, [...data]);
|
|
149
149
|
return filename;
|
|
150
150
|
} catch (error) {
|
|
151
151
|
logger_default.error(error);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
read() {
|
|
155
155
|
const { filename } = this.options;
|
|
156
|
-
const isExisted =
|
|
156
|
+
const isExisted = fs.existsSync(filename);
|
|
157
157
|
try {
|
|
158
158
|
if (isExisted) {
|
|
159
|
-
const data =
|
|
159
|
+
const data = fs.readJSONSync(filename);
|
|
160
160
|
return new Set(data ?? []);
|
|
161
161
|
}
|
|
162
162
|
} catch {
|
|
163
163
|
try {
|
|
164
|
-
isExisted &&
|
|
164
|
+
isExisted && fs.removeSync(filename);
|
|
165
165
|
} catch (error) {
|
|
166
166
|
logger_default.error(error);
|
|
167
167
|
}
|
|
@@ -171,7 +171,7 @@ var CacheManager = class {
|
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
// src/defaults.ts
|
|
174
|
-
import process2 from "
|
|
174
|
+
import process2 from "process";
|
|
175
175
|
function getDefaultPatchOptions() {
|
|
176
176
|
return {
|
|
177
177
|
packageName: "tailwindcss",
|
|
@@ -731,7 +731,7 @@ function monkeyPatchForSupportingCustomUnitV4(rootDir, options) {
|
|
|
731
731
|
}
|
|
732
732
|
|
|
733
733
|
// src/core/runtime.ts
|
|
734
|
-
import { createRequire } from "
|
|
734
|
+
import { createRequire } from "module";
|
|
735
735
|
import path4 from "pathe";
|
|
736
736
|
import { gte } from "semver";
|
|
737
737
|
var require2 = createRequire(import.meta.url);
|
|
@@ -780,14 +780,14 @@ function internalPatch(pkgJsonPath, options) {
|
|
|
780
780
|
}
|
|
781
781
|
|
|
782
782
|
// src/core/patcher.ts
|
|
783
|
-
import { createRequire as createRequire3 } from "
|
|
784
|
-
import process5 from "
|
|
783
|
+
import { createRequire as createRequire3 } from "module";
|
|
784
|
+
import process5 from "process";
|
|
785
785
|
import fs4 from "fs-extra";
|
|
786
786
|
import { getPackageInfoSync } from "local-pkg";
|
|
787
787
|
import path6 from "pathe";
|
|
788
788
|
|
|
789
789
|
// src/core/candidates.ts
|
|
790
|
-
import process3 from "
|
|
790
|
+
import process3 from "process";
|
|
791
791
|
function importNode() {
|
|
792
792
|
return import("@tailwindcss/node");
|
|
793
793
|
}
|
|
@@ -829,8 +829,8 @@ async function extractValidCandidates(options) {
|
|
|
829
829
|
}
|
|
830
830
|
|
|
831
831
|
// src/core/postcss.ts
|
|
832
|
-
import { createRequire as createRequire2 } from "
|
|
833
|
-
import process4 from "
|
|
832
|
+
import { createRequire as createRequire2 } from "module";
|
|
833
|
+
import process4 from "process";
|
|
834
834
|
import path5 from "pathe";
|
|
835
835
|
import postcss from "postcss";
|
|
836
836
|
import { loadConfig } from "tailwindcss-config";
|
|
@@ -1005,6 +1005,18 @@ var TailwindcssPatcher = class {
|
|
|
1005
1005
|
}
|
|
1006
1006
|
return classSet;
|
|
1007
1007
|
}
|
|
1008
|
+
getClassCacheSetV3() {
|
|
1009
|
+
const classSet = /* @__PURE__ */ new Set();
|
|
1010
|
+
const classCaches = this.getClassCaches();
|
|
1011
|
+
for (const classCacheMap of classCaches) {
|
|
1012
|
+
const keys = classCacheMap.keys();
|
|
1013
|
+
for (const key of keys) {
|
|
1014
|
+
const v = key.toString();
|
|
1015
|
+
this.filter?.(v) && classSet.add(v);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
return classSet;
|
|
1019
|
+
}
|
|
1008
1020
|
/**
|
|
1009
1021
|
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
|
|
1010
1022
|
*/
|
|
@@ -1014,7 +1026,7 @@ var TailwindcssPatcher = class {
|
|
|
1014
1026
|
if (cacheStrategy === "overwrite") {
|
|
1015
1027
|
set.size > 0 && this.setCache(set);
|
|
1016
1028
|
} else if (cacheStrategy === "merge") {
|
|
1017
|
-
const cacheSet =
|
|
1029
|
+
const cacheSet = this.getCache();
|
|
1018
1030
|
if (cacheSet) {
|
|
1019
1031
|
for (const x of cacheSet) {
|
|
1020
1032
|
set.add(x);
|
|
@@ -1024,7 +1036,24 @@ var TailwindcssPatcher = class {
|
|
|
1024
1036
|
}
|
|
1025
1037
|
return set;
|
|
1026
1038
|
}
|
|
1027
|
-
|
|
1039
|
+
getClassSetV3() {
|
|
1040
|
+
const cacheStrategy = this.cacheOptions.strategy ?? "merge";
|
|
1041
|
+
const set = this.getClassCacheSetV3();
|
|
1042
|
+
if (cacheStrategy === "overwrite") {
|
|
1043
|
+
set.size > 0 && this.setCache(set);
|
|
1044
|
+
} else if (cacheStrategy === "merge") {
|
|
1045
|
+
const cacheSet = this.getCache();
|
|
1046
|
+
if (cacheSet) {
|
|
1047
|
+
for (const x of cacheSet) {
|
|
1048
|
+
set.add(x);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
this.setCache(set);
|
|
1052
|
+
}
|
|
1053
|
+
return set;
|
|
1054
|
+
}
|
|
1055
|
+
async extract(options) {
|
|
1056
|
+
const { write } = defu(options, { write: true });
|
|
1028
1057
|
const { output, tailwindcss } = this.patchOptions;
|
|
1029
1058
|
if (output && tailwindcss) {
|
|
1030
1059
|
const { filename, loose } = output;
|
|
@@ -1034,15 +1063,18 @@ var TailwindcssPatcher = class {
|
|
|
1034
1063
|
majorVersion: this.majorVersion
|
|
1035
1064
|
});
|
|
1036
1065
|
}
|
|
1037
|
-
const
|
|
1066
|
+
const classSet = await this.getClassSet();
|
|
1038
1067
|
if (filename) {
|
|
1039
|
-
const classList = [...
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1068
|
+
const classList = [...classSet];
|
|
1069
|
+
if (write) {
|
|
1070
|
+
await fs4.outputJSON(filename, classList, {
|
|
1071
|
+
spaces: loose ? 2 : void 0
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1043
1074
|
return {
|
|
1044
1075
|
filename,
|
|
1045
|
-
classList
|
|
1076
|
+
classList,
|
|
1077
|
+
classSet
|
|
1046
1078
|
};
|
|
1047
1079
|
}
|
|
1048
1080
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;// ../../node_modules/.pnpm/tsup@8.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;// ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.4.2_postcss@8.5.6_tsx@4.20.3_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/cjs_shims.js
|
|
2
2
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
3
3
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
4
4
|
|
|
@@ -146,26 +146,26 @@ var CacheManager = class {
|
|
|
146
146
|
strategy: "merge"
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
write(data) {
|
|
150
150
|
try {
|
|
151
151
|
const { filename } = this.options;
|
|
152
|
-
|
|
152
|
+
_fsextra2.default.outputJSONSync(filename, [...data]);
|
|
153
153
|
return filename;
|
|
154
154
|
} catch (error) {
|
|
155
155
|
logger_default.error(error);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
read() {
|
|
159
159
|
const { filename } = this.options;
|
|
160
|
-
const isExisted =
|
|
160
|
+
const isExisted = _fsextra2.default.existsSync(filename);
|
|
161
161
|
try {
|
|
162
162
|
if (isExisted) {
|
|
163
|
-
const data =
|
|
163
|
+
const data = _fsextra2.default.readJSONSync(filename);
|
|
164
164
|
return new Set(_nullishCoalesce(data, () => ( [])));
|
|
165
165
|
}
|
|
166
166
|
} catch (e2) {
|
|
167
167
|
try {
|
|
168
|
-
isExisted &&
|
|
168
|
+
isExisted && _fsextra2.default.removeSync(filename);
|
|
169
169
|
} catch (error) {
|
|
170
170
|
logger_default.error(error);
|
|
171
171
|
}
|
|
@@ -1009,6 +1009,18 @@ var TailwindcssPatcher = (_class = class {
|
|
|
1009
1009
|
}
|
|
1010
1010
|
return classSet;
|
|
1011
1011
|
}
|
|
1012
|
+
getClassCacheSetV3() {
|
|
1013
|
+
const classSet = /* @__PURE__ */ new Set();
|
|
1014
|
+
const classCaches = this.getClassCaches();
|
|
1015
|
+
for (const classCacheMap of classCaches) {
|
|
1016
|
+
const keys = classCacheMap.keys();
|
|
1017
|
+
for (const key of keys) {
|
|
1018
|
+
const v = key.toString();
|
|
1019
|
+
_optionalChain([this, 'access', _50 => _50.filter, 'optionalCall', _51 => _51(v)]) && classSet.add(v);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
return classSet;
|
|
1023
|
+
}
|
|
1012
1024
|
/**
|
|
1013
1025
|
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
|
|
1014
1026
|
*/
|
|
@@ -1018,7 +1030,7 @@ var TailwindcssPatcher = (_class = class {
|
|
|
1018
1030
|
if (cacheStrategy === "overwrite") {
|
|
1019
1031
|
set.size > 0 && this.setCache(set);
|
|
1020
1032
|
} else if (cacheStrategy === "merge") {
|
|
1021
|
-
const cacheSet =
|
|
1033
|
+
const cacheSet = this.getCache();
|
|
1022
1034
|
if (cacheSet) {
|
|
1023
1035
|
for (const x of cacheSet) {
|
|
1024
1036
|
set.add(x);
|
|
@@ -1028,7 +1040,24 @@ var TailwindcssPatcher = (_class = class {
|
|
|
1028
1040
|
}
|
|
1029
1041
|
return set;
|
|
1030
1042
|
}
|
|
1031
|
-
|
|
1043
|
+
getClassSetV3() {
|
|
1044
|
+
const cacheStrategy = _nullishCoalesce(this.cacheOptions.strategy, () => ( "merge"));
|
|
1045
|
+
const set = this.getClassCacheSetV3();
|
|
1046
|
+
if (cacheStrategy === "overwrite") {
|
|
1047
|
+
set.size > 0 && this.setCache(set);
|
|
1048
|
+
} else if (cacheStrategy === "merge") {
|
|
1049
|
+
const cacheSet = this.getCache();
|
|
1050
|
+
if (cacheSet) {
|
|
1051
|
+
for (const x of cacheSet) {
|
|
1052
|
+
set.add(x);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
this.setCache(set);
|
|
1056
|
+
}
|
|
1057
|
+
return set;
|
|
1058
|
+
}
|
|
1059
|
+
async extract(options) {
|
|
1060
|
+
const { write } = defu(options, { write: true });
|
|
1032
1061
|
const { output, tailwindcss } = this.patchOptions;
|
|
1033
1062
|
if (output && tailwindcss) {
|
|
1034
1063
|
const { filename, loose } = output;
|
|
@@ -1038,15 +1067,18 @@ var TailwindcssPatcher = (_class = class {
|
|
|
1038
1067
|
majorVersion: this.majorVersion
|
|
1039
1068
|
});
|
|
1040
1069
|
}
|
|
1041
|
-
const
|
|
1070
|
+
const classSet = await this.getClassSet();
|
|
1042
1071
|
if (filename) {
|
|
1043
|
-
const classList = [...
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1072
|
+
const classList = [...classSet];
|
|
1073
|
+
if (write) {
|
|
1074
|
+
await _fsextra2.default.outputJSON(filename, classList, {
|
|
1075
|
+
spaces: loose ? 2 : void 0
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1047
1078
|
return {
|
|
1048
1079
|
filename,
|
|
1049
|
-
classList
|
|
1080
|
+
classList,
|
|
1081
|
+
classSet
|
|
1050
1082
|
};
|
|
1051
1083
|
}
|
|
1052
1084
|
}
|
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkWNQ2OYR4js = require('./chunk-WNQ2OYR4.js');
|
|
8
8
|
|
|
9
9
|
// src/cli.ts
|
|
10
10
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -16,26 +16,26 @@ function init() {
|
|
|
16
16
|
}
|
|
17
17
|
var cli = _cac2.default.call(void 0, );
|
|
18
18
|
cli.command("install", "patch install").action(() => {
|
|
19
|
-
const twPatcher = new (0,
|
|
20
|
-
patch:
|
|
19
|
+
const twPatcher = new (0, _chunkWNQ2OYR4js.TailwindcssPatcher)({
|
|
20
|
+
patch: _chunkWNQ2OYR4js.getPatchOptions.call(void 0, )
|
|
21
21
|
});
|
|
22
22
|
twPatcher.patch();
|
|
23
23
|
});
|
|
24
24
|
cli.command("init").action(async () => {
|
|
25
25
|
await init();
|
|
26
|
-
|
|
26
|
+
_chunkWNQ2OYR4js.logger_default.success(`\u2728 ${_config.CONFIG_NAME}.config.ts initialized!`);
|
|
27
27
|
});
|
|
28
28
|
cli.command("extract").option("--css [file]", "css file entries").action(async (options) => {
|
|
29
29
|
const { config } = await _config.getConfig.call(void 0, );
|
|
30
30
|
const file = options.css;
|
|
31
31
|
if (config) {
|
|
32
|
-
const twPatcher = new (0,
|
|
32
|
+
const twPatcher = new (0, _chunkWNQ2OYR4js.TailwindcssPatcher)(
|
|
33
33
|
{
|
|
34
|
-
patch:
|
|
34
|
+
patch: _chunkWNQ2OYR4js.defuOverrideArray.call(void 0,
|
|
35
35
|
config.patch,
|
|
36
36
|
{
|
|
37
37
|
resolve: {
|
|
38
|
-
paths: [
|
|
38
|
+
paths: [_chunkWNQ2OYR4js.importMetaUrl]
|
|
39
39
|
},
|
|
40
40
|
tailwindcss: {
|
|
41
41
|
v4: {
|
|
@@ -47,7 +47,7 @@ cli.command("extract").option("--css [file]", "css file entries").action(async (
|
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
49
|
const p = await twPatcher.extract();
|
|
50
|
-
p &&
|
|
50
|
+
p && _chunkWNQ2OYR4js.logger_default.success(`\u2728 tailwindcss-patch extract success! file path: ${p.filename}, classList length: ${p.classList.length}`);
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
cli.help();
|
package/dist/cli.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
defuOverrideArray,
|
|
4
4
|
getPatchOptions,
|
|
5
5
|
logger_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5PNNXDLA.mjs";
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
|
-
import process from "
|
|
9
|
+
import process from "process";
|
|
10
10
|
import { CONFIG_NAME, getConfig, initConfig } from "@tailwindcss-mangle/config";
|
|
11
11
|
import cac from "cac";
|
|
12
12
|
function init() {
|
package/dist/index.d.mts
CHANGED
|
@@ -97,8 +97,8 @@ declare class CacheManager {
|
|
|
97
97
|
getOptions(options?: CacheOptions): Required<CacheOptions> & {
|
|
98
98
|
filename: string;
|
|
99
99
|
};
|
|
100
|
-
write(data: Set<string>):
|
|
101
|
-
read():
|
|
100
|
+
write(data: Set<string>): string | undefined;
|
|
101
|
+
read(): Set<string>;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
interface ExtractValidCandidatesOption {
|
|
@@ -108,6 +108,9 @@ interface ExtractValidCandidatesOption {
|
|
|
108
108
|
}
|
|
109
109
|
declare function extractValidCandidates(options?: ExtractValidCandidatesOption): Promise<string[]>;
|
|
110
110
|
|
|
111
|
+
interface PatchExtractOptions {
|
|
112
|
+
write?: boolean;
|
|
113
|
+
}
|
|
111
114
|
declare class TailwindcssPatcher {
|
|
112
115
|
rawOptions: TailwindcssPatcherOptions;
|
|
113
116
|
cacheOptions: InternalCacheOptions;
|
|
@@ -118,18 +121,21 @@ declare class TailwindcssPatcher {
|
|
|
118
121
|
majorVersion?: number;
|
|
119
122
|
filter?: (className: string) => boolean;
|
|
120
123
|
constructor(options?: TailwindcssPatcherOptions);
|
|
121
|
-
setCache(set: Set<string>):
|
|
122
|
-
getCache():
|
|
124
|
+
setCache(set: Set<string>): string | undefined;
|
|
125
|
+
getCache(): Set<string>;
|
|
123
126
|
getContexts(): TailwindcssRuntimeContext[];
|
|
124
127
|
getClassCaches(): TailwindcssClassCache[];
|
|
125
128
|
getClassCacheSet(): Promise<Set<string>>;
|
|
129
|
+
getClassCacheSetV3(): Set<string>;
|
|
126
130
|
/**
|
|
127
131
|
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
|
|
128
132
|
*/
|
|
129
133
|
getClassSet(): Promise<Set<string>>;
|
|
130
|
-
|
|
134
|
+
getClassSetV3(): Set<string>;
|
|
135
|
+
extract(options?: PatchExtractOptions): Promise<{
|
|
131
136
|
filename: string;
|
|
132
137
|
classList: string[];
|
|
138
|
+
classSet: Set<string>;
|
|
133
139
|
} | undefined>;
|
|
134
140
|
extractValidCandidates: typeof extractValidCandidates;
|
|
135
141
|
}
|
|
@@ -155,4 +161,4 @@ declare function internalPatch(pkgJsonPath: string, options: InternalPatchOption
|
|
|
155
161
|
|
|
156
162
|
declare const logger: consola.ConsolaInstance;
|
|
157
163
|
|
|
158
|
-
export { CacheManager, type CacheOptions, type CacheStrategy, type DeepRequired, type ILengthUnitsPatchOptions, type InternalCacheOptions, type InternalPatchOptions, type PatchOptions, type TailwindcssClassCache, TailwindcssPatcher, type TailwindcssPatcherOptions, type TailwindcssRuntimeContext, getCacheOptions, internalPatch, logger, monkeyPatchForExposingContextV2, monkeyPatchForExposingContextV3, monkeyPatchForSupportingCustomUnitV3, monkeyPatchForSupportingCustomUnitV4 };
|
|
164
|
+
export { CacheManager, type CacheOptions, type CacheStrategy, type DeepRequired, type ILengthUnitsPatchOptions, type InternalCacheOptions, type InternalPatchOptions, type PatchExtractOptions, type PatchOptions, type TailwindcssClassCache, TailwindcssPatcher, type TailwindcssPatcherOptions, type TailwindcssRuntimeContext, getCacheOptions, internalPatch, logger, monkeyPatchForExposingContextV2, monkeyPatchForExposingContextV3, monkeyPatchForSupportingCustomUnitV3, monkeyPatchForSupportingCustomUnitV4 };
|
package/dist/index.d.ts
CHANGED
|
@@ -97,8 +97,8 @@ declare class CacheManager {
|
|
|
97
97
|
getOptions(options?: CacheOptions): Required<CacheOptions> & {
|
|
98
98
|
filename: string;
|
|
99
99
|
};
|
|
100
|
-
write(data: Set<string>):
|
|
101
|
-
read():
|
|
100
|
+
write(data: Set<string>): string | undefined;
|
|
101
|
+
read(): Set<string>;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
interface ExtractValidCandidatesOption {
|
|
@@ -108,6 +108,9 @@ interface ExtractValidCandidatesOption {
|
|
|
108
108
|
}
|
|
109
109
|
declare function extractValidCandidates(options?: ExtractValidCandidatesOption): Promise<string[]>;
|
|
110
110
|
|
|
111
|
+
interface PatchExtractOptions {
|
|
112
|
+
write?: boolean;
|
|
113
|
+
}
|
|
111
114
|
declare class TailwindcssPatcher {
|
|
112
115
|
rawOptions: TailwindcssPatcherOptions;
|
|
113
116
|
cacheOptions: InternalCacheOptions;
|
|
@@ -118,18 +121,21 @@ declare class TailwindcssPatcher {
|
|
|
118
121
|
majorVersion?: number;
|
|
119
122
|
filter?: (className: string) => boolean;
|
|
120
123
|
constructor(options?: TailwindcssPatcherOptions);
|
|
121
|
-
setCache(set: Set<string>):
|
|
122
|
-
getCache():
|
|
124
|
+
setCache(set: Set<string>): string | undefined;
|
|
125
|
+
getCache(): Set<string>;
|
|
123
126
|
getContexts(): TailwindcssRuntimeContext[];
|
|
124
127
|
getClassCaches(): TailwindcssClassCache[];
|
|
125
128
|
getClassCacheSet(): Promise<Set<string>>;
|
|
129
|
+
getClassCacheSetV3(): Set<string>;
|
|
126
130
|
/**
|
|
127
131
|
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
|
|
128
132
|
*/
|
|
129
133
|
getClassSet(): Promise<Set<string>>;
|
|
130
|
-
|
|
134
|
+
getClassSetV3(): Set<string>;
|
|
135
|
+
extract(options?: PatchExtractOptions): Promise<{
|
|
131
136
|
filename: string;
|
|
132
137
|
classList: string[];
|
|
138
|
+
classSet: Set<string>;
|
|
133
139
|
} | undefined>;
|
|
134
140
|
extractValidCandidates: typeof extractValidCandidates;
|
|
135
141
|
}
|
|
@@ -155,4 +161,4 @@ declare function internalPatch(pkgJsonPath: string, options: InternalPatchOption
|
|
|
155
161
|
|
|
156
162
|
declare const logger: consola.ConsolaInstance;
|
|
157
163
|
|
|
158
|
-
export { CacheManager, type CacheOptions, type CacheStrategy, type DeepRequired, type ILengthUnitsPatchOptions, type InternalCacheOptions, type InternalPatchOptions, type PatchOptions, type TailwindcssClassCache, TailwindcssPatcher, type TailwindcssPatcherOptions, type TailwindcssRuntimeContext, getCacheOptions, internalPatch, logger, monkeyPatchForExposingContextV2, monkeyPatchForExposingContextV3, monkeyPatchForSupportingCustomUnitV3, monkeyPatchForSupportingCustomUnitV4 };
|
|
164
|
+
export { CacheManager, type CacheOptions, type CacheStrategy, type DeepRequired, type ILengthUnitsPatchOptions, type InternalCacheOptions, type InternalPatchOptions, type PatchExtractOptions, type PatchOptions, type TailwindcssClassCache, TailwindcssPatcher, type TailwindcssPatcherOptions, type TailwindcssRuntimeContext, getCacheOptions, internalPatch, logger, monkeyPatchForExposingContextV2, monkeyPatchForExposingContextV3, monkeyPatchForSupportingCustomUnitV3, monkeyPatchForSupportingCustomUnitV4 };
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkWNQ2OYR4js = require('./chunk-WNQ2OYR4.js');
|
|
12
12
|
|
|
13
13
|
// src/index.ts
|
|
14
14
|
var _config = require('@tailwindcss-mangle/config');
|
|
@@ -23,4 +23,4 @@ var _config = require('@tailwindcss-mangle/config');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
exports.CacheManager =
|
|
26
|
+
exports.CacheManager = _chunkWNQ2OYR4js.CacheManager; exports.TailwindcssPatcher = _chunkWNQ2OYR4js.TailwindcssPatcher; exports.defineConfig = _config.defineConfig; exports.getCacheOptions = _chunkWNQ2OYR4js.getCacheOptions; exports.internalPatch = _chunkWNQ2OYR4js.internalPatch; exports.logger = _chunkWNQ2OYR4js.logger_default; exports.monkeyPatchForExposingContextV2 = _chunkWNQ2OYR4js.monkeyPatchForExposingContextV2; exports.monkeyPatchForExposingContextV3 = _chunkWNQ2OYR4js.monkeyPatchForExposingContextV3; exports.monkeyPatchForSupportingCustomUnitV3 = _chunkWNQ2OYR4js.monkeyPatchForSupportingCustomUnitV3; exports.monkeyPatchForSupportingCustomUnitV4 = _chunkWNQ2OYR4js.monkeyPatchForSupportingCustomUnitV4;
|
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
monkeyPatchForExposingContextV3,
|
|
9
9
|
monkeyPatchForSupportingCustomUnitV3,
|
|
10
10
|
monkeyPatchForSupportingCustomUnitV4
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5PNNXDLA.mjs";
|
|
12
12
|
|
|
13
13
|
// src/index.ts
|
|
14
14
|
import { defineConfig } from "@tailwindcss-mangle/config";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss-patch",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"description": "patch tailwindcss for exposing context and extract classes",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,28 +50,28 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@babel/generator": "^7.
|
|
54
|
-
"@babel/parser": "^7.
|
|
55
|
-
"@babel/traverse": "^7.
|
|
56
|
-
"@babel/types": "^7.
|
|
53
|
+
"@babel/generator": "^7.28.0",
|
|
54
|
+
"@babel/parser": "^7.28.0",
|
|
55
|
+
"@babel/traverse": "^7.28.0",
|
|
56
|
+
"@babel/types": "^7.28.1",
|
|
57
57
|
"cac": "^6.7.14",
|
|
58
58
|
"consola": "^3.4.2",
|
|
59
59
|
"fs-extra": "^11.3.0",
|
|
60
60
|
"local-pkg": "^1.1.1",
|
|
61
61
|
"pathe": "^2.0.3",
|
|
62
|
-
"postcss": "^8.5.
|
|
63
|
-
"semver": "^7.7.
|
|
62
|
+
"postcss": "^8.5.6",
|
|
63
|
+
"semver": "^7.7.2",
|
|
64
64
|
"tailwindcss-config": "^1.0.0",
|
|
65
|
-
"@tailwindcss-mangle/config": "^5.1.
|
|
65
|
+
"@tailwindcss-mangle/config": "^5.1.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@tailwindcss/node": "^4.1.
|
|
69
|
-
"@tailwindcss/oxide": "^4.1.
|
|
70
|
-
"@tailwindcss/postcss": "^4.1.
|
|
71
|
-
"@tailwindcss/vite": "^4.1.
|
|
72
|
-
"tailwindcss": "^4.1.
|
|
73
|
-
"tailwindcss-3": "npm:tailwindcss@^3",
|
|
74
|
-
"tailwindcss-4": "npm:tailwindcss@^4.1.
|
|
68
|
+
"@tailwindcss/node": "^4.1.11",
|
|
69
|
+
"@tailwindcss/oxide": "^4.1.11",
|
|
70
|
+
"@tailwindcss/postcss": "^4.1.11",
|
|
71
|
+
"@tailwindcss/vite": "^4.1.11",
|
|
72
|
+
"tailwindcss": "^4.1.11",
|
|
73
|
+
"tailwindcss-3": "npm:tailwindcss@^3.4.17",
|
|
74
|
+
"tailwindcss-4": "npm:tailwindcss@^4.1.11"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"dev": "tsup --watch --sourcemap",
|