tailwindcss-patch 6.0.5 → 6.0.7
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-OTEJWDA3.mjs → chunk-4NIV24YC.mjs} +91 -85
- package/dist/{chunk-PWCT7HFH.js → chunk-7LD7UWYL.js} +94 -87
- package/dist/cli.js +17 -7
- package/dist/cli.mjs +13 -4
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
|
@@ -1,85 +1,3 @@
|
|
|
1
|
-
// src/logger.ts
|
|
2
|
-
import { createConsola } from "consola";
|
|
3
|
-
var logger = createConsola();
|
|
4
|
-
var logger_default = logger;
|
|
5
|
-
|
|
6
|
-
// src/core/cache.ts
|
|
7
|
-
import process from "node:process";
|
|
8
|
-
import fs from "fs-extra";
|
|
9
|
-
import path from "pathe";
|
|
10
|
-
|
|
11
|
-
// src/constants.ts
|
|
12
|
-
var pkgName = "tailwindcss-patch";
|
|
13
|
-
|
|
14
|
-
// src/core/cache.ts
|
|
15
|
-
function getCacheOptions(options) {
|
|
16
|
-
let cache;
|
|
17
|
-
switch (typeof options) {
|
|
18
|
-
case "undefined": {
|
|
19
|
-
cache = {
|
|
20
|
-
enable: false
|
|
21
|
-
};
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
case "boolean": {
|
|
25
|
-
cache = {
|
|
26
|
-
enable: options
|
|
27
|
-
};
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
case "object": {
|
|
31
|
-
cache = { ...options, enable: true };
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return cache;
|
|
36
|
-
}
|
|
37
|
-
var CacheManager = class {
|
|
38
|
-
options;
|
|
39
|
-
constructor(options = {}) {
|
|
40
|
-
this.options = this.getOptions(options);
|
|
41
|
-
}
|
|
42
|
-
getOptions(options = {}) {
|
|
43
|
-
const cwd = options.cwd ?? process.cwd();
|
|
44
|
-
const dir = options.dir ?? path.resolve(cwd, "node_modules/.cache", pkgName);
|
|
45
|
-
const file = options.file ?? "index.json";
|
|
46
|
-
const filename = path.resolve(dir, file);
|
|
47
|
-
return {
|
|
48
|
-
cwd,
|
|
49
|
-
dir,
|
|
50
|
-
file,
|
|
51
|
-
filename,
|
|
52
|
-
strategy: "merge"
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
async write(data) {
|
|
56
|
-
try {
|
|
57
|
-
const { filename } = this.options;
|
|
58
|
-
await fs.outputJSON(filename, [...data]);
|
|
59
|
-
return filename;
|
|
60
|
-
} catch (error) {
|
|
61
|
-
logger_default.error(error);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
async read() {
|
|
65
|
-
const { filename } = this.options;
|
|
66
|
-
const isExisted = await fs.exists(filename);
|
|
67
|
-
try {
|
|
68
|
-
if (isExisted) {
|
|
69
|
-
const data = await fs.readJSON(filename);
|
|
70
|
-
return new Set(data);
|
|
71
|
-
}
|
|
72
|
-
} catch (error) {
|
|
73
|
-
logger_default.error(`path:${filename}`);
|
|
74
|
-
logger_default.error(error);
|
|
75
|
-
isExisted && await fs.remove(filename);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
// src/defaults.ts
|
|
81
|
-
import process2 from "node:process";
|
|
82
|
-
|
|
83
1
|
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
84
2
|
function isPlainObject(value) {
|
|
85
3
|
if (value === null || typeof value !== "object") {
|
|
@@ -170,7 +88,91 @@ var preserveClassNamesMap = preserveClassNames.reduce((acc, cur) => {
|
|
|
170
88
|
}, {});
|
|
171
89
|
var acceptChars = [..."abcdefghijklmnopqrstuvwxyz"];
|
|
172
90
|
|
|
91
|
+
// src/logger.ts
|
|
92
|
+
import { createConsola } from "consola";
|
|
93
|
+
var logger = createConsola();
|
|
94
|
+
var logger_default = logger;
|
|
95
|
+
|
|
96
|
+
// src/core/cache.ts
|
|
97
|
+
import process from "node:process";
|
|
98
|
+
import fs from "fs-extra";
|
|
99
|
+
import path from "pathe";
|
|
100
|
+
|
|
101
|
+
// src/constants.ts
|
|
102
|
+
var pkgName = "tailwindcss-patch";
|
|
103
|
+
|
|
104
|
+
// src/core/cache.ts
|
|
105
|
+
function getCacheOptions(options) {
|
|
106
|
+
let cache;
|
|
107
|
+
switch (typeof options) {
|
|
108
|
+
case "undefined": {
|
|
109
|
+
cache = {
|
|
110
|
+
enable: false
|
|
111
|
+
};
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
case "boolean": {
|
|
115
|
+
cache = {
|
|
116
|
+
enable: options
|
|
117
|
+
};
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
case "object": {
|
|
121
|
+
cache = { ...options, enable: true };
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return cache;
|
|
126
|
+
}
|
|
127
|
+
var CacheManager = class {
|
|
128
|
+
options;
|
|
129
|
+
constructor(options = {}) {
|
|
130
|
+
this.options = this.getOptions(options);
|
|
131
|
+
}
|
|
132
|
+
getOptions(options = {}) {
|
|
133
|
+
const cwd = options.cwd ?? process.cwd();
|
|
134
|
+
const dir = options.dir ?? path.resolve(cwd, "node_modules/.cache", pkgName);
|
|
135
|
+
const file = options.file ?? "index.json";
|
|
136
|
+
const filename = path.resolve(dir, file);
|
|
137
|
+
return {
|
|
138
|
+
cwd,
|
|
139
|
+
dir,
|
|
140
|
+
file,
|
|
141
|
+
filename,
|
|
142
|
+
strategy: "merge"
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
async write(data) {
|
|
146
|
+
try {
|
|
147
|
+
const { filename } = this.options;
|
|
148
|
+
await fs.outputJSON(filename, [...data]);
|
|
149
|
+
return filename;
|
|
150
|
+
} catch (error) {
|
|
151
|
+
logger_default.error(error);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async read() {
|
|
155
|
+
const { filename } = this.options;
|
|
156
|
+
const isExisted = await fs.exists(filename);
|
|
157
|
+
try {
|
|
158
|
+
if (isExisted) {
|
|
159
|
+
const data = await fs.readJSON(filename);
|
|
160
|
+
return new Set(data ?? []);
|
|
161
|
+
}
|
|
162
|
+
} catch (error) {
|
|
163
|
+
logger_default.error(error);
|
|
164
|
+
try {
|
|
165
|
+
isExisted && await fs.remove(filename);
|
|
166
|
+
} catch (error2) {
|
|
167
|
+
logger_default.error(error2);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return /* @__PURE__ */ new Set();
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
|
|
173
174
|
// src/defaults.ts
|
|
175
|
+
import process2 from "node:process";
|
|
174
176
|
function getDefaultPatchOptions() {
|
|
175
177
|
return {
|
|
176
178
|
packageName: "tailwindcss",
|
|
@@ -917,8 +919,8 @@ var TailwindcssPatcher = class {
|
|
|
917
919
|
}
|
|
918
920
|
return set;
|
|
919
921
|
}
|
|
920
|
-
async extract(
|
|
921
|
-
const { output, tailwindcss } =
|
|
922
|
+
async extract() {
|
|
923
|
+
const { output, tailwindcss } = this.patchOptions;
|
|
922
924
|
if (output && tailwindcss) {
|
|
923
925
|
const { filename, loose } = output;
|
|
924
926
|
if (this.majorVersion === 3 || this.majorVersion === 2) {
|
|
@@ -933,7 +935,10 @@ var TailwindcssPatcher = class {
|
|
|
933
935
|
await fs4.outputJSON(filename, classList, {
|
|
934
936
|
spaces: loose ? 2 : void 0
|
|
935
937
|
});
|
|
936
|
-
return
|
|
938
|
+
return {
|
|
939
|
+
filename,
|
|
940
|
+
classList
|
|
941
|
+
};
|
|
937
942
|
}
|
|
938
943
|
}
|
|
939
944
|
}
|
|
@@ -941,6 +946,7 @@ var TailwindcssPatcher = class {
|
|
|
941
946
|
};
|
|
942
947
|
|
|
943
948
|
export {
|
|
949
|
+
defuOverrideArray,
|
|
944
950
|
logger_default,
|
|
945
951
|
getCacheOptions,
|
|
946
952
|
CacheManager,
|
|
@@ -1,89 +1,7 @@
|
|
|
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.3.6_jiti@2.4.2_postcss@8.5.2_tsx@4.19.
|
|
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.3.6_jiti@2.4.2_postcss@8.5.2_tsx@4.19.3_typescript@5.7.3_yaml@2.7.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
|
|
|
5
|
-
// src/logger.ts
|
|
6
|
-
var _consola = require('consola');
|
|
7
|
-
var logger = _consola.createConsola.call(void 0, );
|
|
8
|
-
var logger_default = logger;
|
|
9
|
-
|
|
10
|
-
// src/core/cache.ts
|
|
11
|
-
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
12
|
-
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
13
|
-
var _pathe = require('pathe'); var _pathe2 = _interopRequireDefault(_pathe);
|
|
14
|
-
|
|
15
|
-
// src/constants.ts
|
|
16
|
-
var pkgName = "tailwindcss-patch";
|
|
17
|
-
|
|
18
|
-
// src/core/cache.ts
|
|
19
|
-
function getCacheOptions(options) {
|
|
20
|
-
let cache;
|
|
21
|
-
switch (typeof options) {
|
|
22
|
-
case "undefined": {
|
|
23
|
-
cache = {
|
|
24
|
-
enable: false
|
|
25
|
-
};
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
case "boolean": {
|
|
29
|
-
cache = {
|
|
30
|
-
enable: options
|
|
31
|
-
};
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
case "object": {
|
|
35
|
-
cache = { ...options, enable: true };
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return cache;
|
|
40
|
-
}
|
|
41
|
-
var CacheManager = class {
|
|
42
|
-
|
|
43
|
-
constructor(options = {}) {
|
|
44
|
-
this.options = this.getOptions(options);
|
|
45
|
-
}
|
|
46
|
-
getOptions(options = {}) {
|
|
47
|
-
const cwd = _nullishCoalesce(options.cwd, () => ( _process2.default.cwd()));
|
|
48
|
-
const dir = _nullishCoalesce(options.dir, () => ( _pathe2.default.resolve(cwd, "node_modules/.cache", pkgName)));
|
|
49
|
-
const file = _nullishCoalesce(options.file, () => ( "index.json"));
|
|
50
|
-
const filename = _pathe2.default.resolve(dir, file);
|
|
51
|
-
return {
|
|
52
|
-
cwd,
|
|
53
|
-
dir,
|
|
54
|
-
file,
|
|
55
|
-
filename,
|
|
56
|
-
strategy: "merge"
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
async write(data) {
|
|
60
|
-
try {
|
|
61
|
-
const { filename } = this.options;
|
|
62
|
-
await _fsextra2.default.outputJSON(filename, [...data]);
|
|
63
|
-
return filename;
|
|
64
|
-
} catch (error) {
|
|
65
|
-
logger_default.error(error);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
async read() {
|
|
69
|
-
const { filename } = this.options;
|
|
70
|
-
const isExisted = await _fsextra2.default.exists(filename);
|
|
71
|
-
try {
|
|
72
|
-
if (isExisted) {
|
|
73
|
-
const data = await _fsextra2.default.readJSON(filename);
|
|
74
|
-
return new Set(data);
|
|
75
|
-
}
|
|
76
|
-
} catch (error) {
|
|
77
|
-
logger_default.error(`path:${filename}`);
|
|
78
|
-
logger_default.error(error);
|
|
79
|
-
isExisted && await _fsextra2.default.remove(filename);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
// src/defaults.ts
|
|
85
|
-
|
|
86
|
-
|
|
87
5
|
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
88
6
|
function isPlainObject(value) {
|
|
89
7
|
if (value === null || typeof value !== "object") {
|
|
@@ -174,7 +92,91 @@ var preserveClassNamesMap = preserveClassNames.reduce((acc, cur) => {
|
|
|
174
92
|
}, {});
|
|
175
93
|
var acceptChars = [..."abcdefghijklmnopqrstuvwxyz"];
|
|
176
94
|
|
|
95
|
+
// src/logger.ts
|
|
96
|
+
var _consola = require('consola');
|
|
97
|
+
var logger = _consola.createConsola.call(void 0, );
|
|
98
|
+
var logger_default = logger;
|
|
99
|
+
|
|
100
|
+
// src/core/cache.ts
|
|
101
|
+
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
102
|
+
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
103
|
+
var _pathe = require('pathe'); var _pathe2 = _interopRequireDefault(_pathe);
|
|
104
|
+
|
|
105
|
+
// src/constants.ts
|
|
106
|
+
var pkgName = "tailwindcss-patch";
|
|
107
|
+
|
|
108
|
+
// src/core/cache.ts
|
|
109
|
+
function getCacheOptions(options) {
|
|
110
|
+
let cache;
|
|
111
|
+
switch (typeof options) {
|
|
112
|
+
case "undefined": {
|
|
113
|
+
cache = {
|
|
114
|
+
enable: false
|
|
115
|
+
};
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
case "boolean": {
|
|
119
|
+
cache = {
|
|
120
|
+
enable: options
|
|
121
|
+
};
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
case "object": {
|
|
125
|
+
cache = { ...options, enable: true };
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return cache;
|
|
130
|
+
}
|
|
131
|
+
var CacheManager = class {
|
|
132
|
+
|
|
133
|
+
constructor(options = {}) {
|
|
134
|
+
this.options = this.getOptions(options);
|
|
135
|
+
}
|
|
136
|
+
getOptions(options = {}) {
|
|
137
|
+
const cwd = _nullishCoalesce(options.cwd, () => ( _process2.default.cwd()));
|
|
138
|
+
const dir = _nullishCoalesce(options.dir, () => ( _pathe2.default.resolve(cwd, "node_modules/.cache", pkgName)));
|
|
139
|
+
const file = _nullishCoalesce(options.file, () => ( "index.json"));
|
|
140
|
+
const filename = _pathe2.default.resolve(dir, file);
|
|
141
|
+
return {
|
|
142
|
+
cwd,
|
|
143
|
+
dir,
|
|
144
|
+
file,
|
|
145
|
+
filename,
|
|
146
|
+
strategy: "merge"
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
async write(data) {
|
|
150
|
+
try {
|
|
151
|
+
const { filename } = this.options;
|
|
152
|
+
await _fsextra2.default.outputJSON(filename, [...data]);
|
|
153
|
+
return filename;
|
|
154
|
+
} catch (error) {
|
|
155
|
+
logger_default.error(error);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
async read() {
|
|
159
|
+
const { filename } = this.options;
|
|
160
|
+
const isExisted = await _fsextra2.default.exists(filename);
|
|
161
|
+
try {
|
|
162
|
+
if (isExisted) {
|
|
163
|
+
const data = await _fsextra2.default.readJSON(filename);
|
|
164
|
+
return new Set(_nullishCoalesce(data, () => ( [])));
|
|
165
|
+
}
|
|
166
|
+
} catch (error) {
|
|
167
|
+
logger_default.error(error);
|
|
168
|
+
try {
|
|
169
|
+
isExisted && await _fsextra2.default.remove(filename);
|
|
170
|
+
} catch (error2) {
|
|
171
|
+
logger_default.error(error2);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return /* @__PURE__ */ new Set();
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
177
178
|
// src/defaults.ts
|
|
179
|
+
|
|
178
180
|
function getDefaultPatchOptions() {
|
|
179
181
|
return {
|
|
180
182
|
packageName: "tailwindcss",
|
|
@@ -921,8 +923,8 @@ var TailwindcssPatcher = (_class = class {
|
|
|
921
923
|
}
|
|
922
924
|
return set;
|
|
923
925
|
}
|
|
924
|
-
async extract(
|
|
925
|
-
const { output, tailwindcss } =
|
|
926
|
+
async extract() {
|
|
927
|
+
const { output, tailwindcss } = this.patchOptions;
|
|
926
928
|
if (output && tailwindcss) {
|
|
927
929
|
const { filename, loose } = output;
|
|
928
930
|
if (this.majorVersion === 3 || this.majorVersion === 2) {
|
|
@@ -937,7 +939,10 @@ var TailwindcssPatcher = (_class = class {
|
|
|
937
939
|
await _fsextra2.default.outputJSON(filename, classList, {
|
|
938
940
|
spaces: loose ? 2 : void 0
|
|
939
941
|
});
|
|
940
|
-
return
|
|
942
|
+
return {
|
|
943
|
+
filename,
|
|
944
|
+
classList
|
|
945
|
+
};
|
|
941
946
|
}
|
|
942
947
|
}
|
|
943
948
|
}
|
|
@@ -954,4 +959,6 @@ var TailwindcssPatcher = (_class = class {
|
|
|
954
959
|
|
|
955
960
|
|
|
956
961
|
|
|
957
|
-
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
exports.importMetaUrl = importMetaUrl; exports.defuOverrideArray = defuOverrideArray; exports.logger_default = logger_default; exports.getCacheOptions = getCacheOptions; exports.CacheManager = CacheManager; exports.getPatchOptions = getPatchOptions; exports.monkeyPatchForExposingContextV3 = monkeyPatchForExposingContextV3; exports.monkeyPatchForExposingContextV2 = monkeyPatchForExposingContextV2; exports.monkeyPatchForSupportingCustomUnit = monkeyPatchForSupportingCustomUnit; exports.internalPatch = internalPatch; exports.TailwindcssPatcher = TailwindcssPatcher;
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunk7LD7UWYLjs = require('./chunk-7LD7UWYL.js');
|
|
6
8
|
|
|
7
9
|
// src/cli.ts
|
|
8
10
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -14,21 +16,29 @@ function init() {
|
|
|
14
16
|
}
|
|
15
17
|
var cli = _cac2.default.call(void 0, );
|
|
16
18
|
cli.command("install", "patch install").action(() => {
|
|
17
|
-
const twPatcher = new (0,
|
|
18
|
-
patch:
|
|
19
|
+
const twPatcher = new (0, _chunk7LD7UWYLjs.TailwindcssPatcher)({
|
|
20
|
+
patch: _chunk7LD7UWYLjs.getPatchOptions.call(void 0, )
|
|
19
21
|
});
|
|
20
22
|
twPatcher.patch();
|
|
21
23
|
});
|
|
22
24
|
cli.command("init").action(async () => {
|
|
23
25
|
await init();
|
|
24
|
-
|
|
26
|
+
_chunk7LD7UWYLjs.logger_default.success(`\u2728 ${_config.CONFIG_NAME}.config.ts initialized!`);
|
|
25
27
|
});
|
|
26
28
|
cli.command("extract").action(async () => {
|
|
27
29
|
const { config } = await _config.getConfig.call(void 0, );
|
|
28
30
|
if (config) {
|
|
29
|
-
const twPatcher = new (0,
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const twPatcher = new (0, _chunk7LD7UWYLjs.TailwindcssPatcher)(
|
|
32
|
+
{
|
|
33
|
+
patch: _chunk7LD7UWYLjs.defuOverrideArray.call(void 0, config.patch, {
|
|
34
|
+
resolve: {
|
|
35
|
+
paths: [_chunk7LD7UWYLjs.importMetaUrl]
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
const p = await twPatcher.extract();
|
|
41
|
+
p && _chunk7LD7UWYLjs.logger_default.success(`\u2728 tailwindcss-patch extract success! file path: ${p.filename}, classList length: ${p.classList.length}`);
|
|
32
42
|
}
|
|
33
43
|
});
|
|
34
44
|
cli.help();
|
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TailwindcssPatcher,
|
|
3
|
+
defuOverrideArray,
|
|
3
4
|
getPatchOptions,
|
|
4
5
|
logger_default
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4NIV24YC.mjs";
|
|
6
7
|
|
|
7
8
|
// src/cli.ts
|
|
8
9
|
import process from "node:process";
|
|
@@ -26,9 +27,17 @@ cli.command("init").action(async () => {
|
|
|
26
27
|
cli.command("extract").action(async () => {
|
|
27
28
|
const { config } = await getConfig();
|
|
28
29
|
if (config) {
|
|
29
|
-
const twPatcher = new TailwindcssPatcher(
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const twPatcher = new TailwindcssPatcher(
|
|
31
|
+
{
|
|
32
|
+
patch: defuOverrideArray(config.patch, {
|
|
33
|
+
resolve: {
|
|
34
|
+
paths: [import.meta.url]
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
const p = await twPatcher.extract();
|
|
40
|
+
p && logger_default.success(`\u2728 tailwindcss-patch extract success! file path: ${p.filename}, classList length: ${p.classList.length}`);
|
|
32
41
|
}
|
|
33
42
|
});
|
|
34
43
|
cli.help();
|
package/dist/index.d.mts
CHANGED
|
@@ -105,7 +105,7 @@ declare class CacheManager {
|
|
|
105
105
|
filename: string;
|
|
106
106
|
};
|
|
107
107
|
write(data: Set<string>): Promise<string | undefined>;
|
|
108
|
-
read(): Promise<Set<string
|
|
108
|
+
read(): Promise<Set<string>>;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
interface ExtractValidCandidatesOption {
|
|
@@ -126,7 +126,7 @@ declare class TailwindcssPatcher {
|
|
|
126
126
|
filter?: (className: string) => boolean;
|
|
127
127
|
constructor(options?: TailwindcssPatcherOptions);
|
|
128
128
|
setCache(set: Set<string>): Promise<string | undefined> | undefined;
|
|
129
|
-
getCache(): Promise<Set<string
|
|
129
|
+
getCache(): Promise<Set<string>>;
|
|
130
130
|
getContexts(): TailwindcssRuntimeContext[];
|
|
131
131
|
getClassCaches(): TailwindcssClassCache[];
|
|
132
132
|
getClassCacheSet(): Promise<Set<string>>;
|
|
@@ -134,7 +134,10 @@ declare class TailwindcssPatcher {
|
|
|
134
134
|
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
|
|
135
135
|
*/
|
|
136
136
|
getClassSet(): Promise<Set<string>>;
|
|
137
|
-
extract(
|
|
137
|
+
extract(): Promise<{
|
|
138
|
+
filename: string;
|
|
139
|
+
classList: string[];
|
|
140
|
+
} | undefined>;
|
|
138
141
|
extractValidCandidates: typeof extractValidCandidates;
|
|
139
142
|
}
|
|
140
143
|
|
package/dist/index.d.ts
CHANGED
|
@@ -105,7 +105,7 @@ declare class CacheManager {
|
|
|
105
105
|
filename: string;
|
|
106
106
|
};
|
|
107
107
|
write(data: Set<string>): Promise<string | undefined>;
|
|
108
|
-
read(): Promise<Set<string
|
|
108
|
+
read(): Promise<Set<string>>;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
interface ExtractValidCandidatesOption {
|
|
@@ -126,7 +126,7 @@ declare class TailwindcssPatcher {
|
|
|
126
126
|
filter?: (className: string) => boolean;
|
|
127
127
|
constructor(options?: TailwindcssPatcherOptions);
|
|
128
128
|
setCache(set: Set<string>): Promise<string | undefined> | undefined;
|
|
129
|
-
getCache(): Promise<Set<string
|
|
129
|
+
getCache(): Promise<Set<string>>;
|
|
130
130
|
getContexts(): TailwindcssRuntimeContext[];
|
|
131
131
|
getClassCaches(): TailwindcssClassCache[];
|
|
132
132
|
getClassCacheSet(): Promise<Set<string>>;
|
|
@@ -134,7 +134,10 @@ declare class TailwindcssPatcher {
|
|
|
134
134
|
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
|
|
135
135
|
*/
|
|
136
136
|
getClassSet(): Promise<Set<string>>;
|
|
137
|
-
extract(
|
|
137
|
+
extract(): Promise<{
|
|
138
|
+
filename: string;
|
|
139
|
+
classList: string[];
|
|
140
|
+
} | undefined>;
|
|
138
141
|
extractValidCandidates: typeof extractValidCandidates;
|
|
139
142
|
}
|
|
140
143
|
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk7LD7UWYLjs = require('./chunk-7LD7UWYL.js');
|
|
11
11
|
|
|
12
12
|
// src/index.ts
|
|
13
13
|
var _config = require('@tailwindcss-mangle/config');
|
|
@@ -21,4 +21,4 @@ var _config = require('@tailwindcss-mangle/config');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
exports.CacheManager =
|
|
24
|
+
exports.CacheManager = _chunk7LD7UWYLjs.CacheManager; exports.TailwindcssPatcher = _chunk7LD7UWYLjs.TailwindcssPatcher; exports.defineConfig = _config.defineConfig; exports.getCacheOptions = _chunk7LD7UWYLjs.getCacheOptions; exports.internalPatch = _chunk7LD7UWYLjs.internalPatch; exports.logger = _chunk7LD7UWYLjs.logger_default; exports.monkeyPatchForExposingContextV2 = _chunk7LD7UWYLjs.monkeyPatchForExposingContextV2; exports.monkeyPatchForExposingContextV3 = _chunk7LD7UWYLjs.monkeyPatchForExposingContextV3; exports.monkeyPatchForSupportingCustomUnit = _chunk7LD7UWYLjs.monkeyPatchForSupportingCustomUnit;
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
monkeyPatchForExposingContextV2,
|
|
8
8
|
monkeyPatchForExposingContextV3,
|
|
9
9
|
monkeyPatchForSupportingCustomUnit
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4NIV24YC.mjs";
|
|
11
11
|
|
|
12
12
|
// src/index.ts
|
|
13
13
|
import { defineConfig } from "@tailwindcss-mangle/config";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss-patch",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.7",
|
|
4
4
|
"description": "patch tailwindcss for exposing context and extract classes",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
"postcss": "^8.5.2",
|
|
63
63
|
"semver": "^7.7.1",
|
|
64
64
|
"tailwindcss-config": "^1.0.0",
|
|
65
|
-
"@tailwindcss-mangle/config": "^5.0.
|
|
65
|
+
"@tailwindcss-mangle/config": "^5.0.3"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@tailwindcss/node": "^4.0.
|
|
69
|
-
"@tailwindcss/oxide": "^4.0.
|
|
70
|
-
"@tailwindcss/postcss": "^4.0.
|
|
71
|
-
"@tailwindcss/vite": "^4.0.
|
|
68
|
+
"@tailwindcss/node": "^4.0.7",
|
|
69
|
+
"@tailwindcss/oxide": "^4.0.7",
|
|
70
|
+
"@tailwindcss/postcss": "^4.0.7",
|
|
71
|
+
"@tailwindcss/vite": "^4.0.7",
|
|
72
72
|
"tailwindcss": "^4.0.6",
|
|
73
73
|
"tailwindcss-3": "npm:tailwindcss@^3",
|
|
74
74
|
"tailwindcss-4": "npm:tailwindcss@^4.0.6"
|