tailwindcss-patch 6.0.8 → 6.0.9
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,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.3.6_jiti@2.4.2_postcss@8.5.
|
|
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.3_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
|
|
|
@@ -805,10 +805,12 @@ var TailwindcssPatcher = (_class = class {
|
|
|
805
805
|
}
|
|
806
806
|
this.packageInfo = packageInfo;
|
|
807
807
|
this.patch = () => {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
808
|
+
if (this.majorVersion === 3 || this.majorVersion === 2) {
|
|
809
|
+
try {
|
|
810
|
+
return internalPatch(_optionalChain([this, 'access', _32 => _32.packageInfo, 'optionalAccess', _33 => _33.packageJsonPath]), this.patchOptions);
|
|
811
|
+
} catch (error) {
|
|
812
|
+
logger_default.error(`patch tailwindcss failed: ${error.message}`);
|
|
813
|
+
}
|
|
812
814
|
}
|
|
813
815
|
};
|
|
814
816
|
}
|
|
@@ -847,7 +849,7 @@ var TailwindcssPatcher = (_class = class {
|
|
|
847
849
|
}
|
|
848
850
|
async getClassCacheSet() {
|
|
849
851
|
const classSet = /* @__PURE__ */ new Set();
|
|
850
|
-
const {
|
|
852
|
+
const { tailwindcss } = this.patchOptions;
|
|
851
853
|
if (this.majorVersion === 4) {
|
|
852
854
|
const { v4 } = _nullishCoalesce(tailwindcss, () => ( {}));
|
|
853
855
|
if (Array.isArray(_optionalChain([v4, 'optionalAccess', _34 => _34.cssEntries]))) {
|
|
@@ -801,10 +801,12 @@ var TailwindcssPatcher = class {
|
|
|
801
801
|
}
|
|
802
802
|
this.packageInfo = packageInfo;
|
|
803
803
|
this.patch = () => {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
804
|
+
if (this.majorVersion === 3 || this.majorVersion === 2) {
|
|
805
|
+
try {
|
|
806
|
+
return internalPatch(this.packageInfo?.packageJsonPath, this.patchOptions);
|
|
807
|
+
} catch (error) {
|
|
808
|
+
logger_default.error(`patch tailwindcss failed: ${error.message}`);
|
|
809
|
+
}
|
|
808
810
|
}
|
|
809
811
|
};
|
|
810
812
|
}
|
|
@@ -843,7 +845,7 @@ var TailwindcssPatcher = class {
|
|
|
843
845
|
}
|
|
844
846
|
async getClassCacheSet() {
|
|
845
847
|
const classSet = /* @__PURE__ */ new Set();
|
|
846
|
-
const {
|
|
848
|
+
const { tailwindcss } = this.patchOptions;
|
|
847
849
|
if (this.majorVersion === 4) {
|
|
848
850
|
const { v4 } = tailwindcss ?? {};
|
|
849
851
|
if (Array.isArray(v4?.cssEntries)) {
|
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkMMFOI5KYjs = require('./chunk-MMFOI5KY.js');
|
|
8
8
|
|
|
9
9
|
// src/cli.ts
|
|
10
10
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -16,29 +16,29 @@ 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, _chunkMMFOI5KYjs.TailwindcssPatcher)({
|
|
20
|
+
patch: _chunkMMFOI5KYjs.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
|
+
_chunkMMFOI5KYjs.logger_default.success(`\u2728 ${_config.CONFIG_NAME}.config.ts initialized!`);
|
|
27
27
|
});
|
|
28
28
|
cli.command("extract").action(async () => {
|
|
29
29
|
const { config } = await _config.getConfig.call(void 0, );
|
|
30
30
|
if (config) {
|
|
31
|
-
const twPatcher = new (0,
|
|
31
|
+
const twPatcher = new (0, _chunkMMFOI5KYjs.TailwindcssPatcher)(
|
|
32
32
|
{
|
|
33
|
-
patch:
|
|
33
|
+
patch: _chunkMMFOI5KYjs.defuOverrideArray.call(void 0, config.patch, {
|
|
34
34
|
resolve: {
|
|
35
|
-
paths: [
|
|
35
|
+
paths: [_chunkMMFOI5KYjs.importMetaUrl]
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
const p = await twPatcher.extract();
|
|
41
|
-
p &&
|
|
41
|
+
p && _chunkMMFOI5KYjs.logger_default.success(`\u2728 tailwindcss-patch extract success! file path: ${p.filename}, classList length: ${p.classList.length}`);
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
cli.help();
|
package/dist/cli.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkMMFOI5KYjs = require('./chunk-MMFOI5KY.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 = _chunkMMFOI5KYjs.CacheManager; exports.TailwindcssPatcher = _chunkMMFOI5KYjs.TailwindcssPatcher; exports.defineConfig = _config.defineConfig; exports.getCacheOptions = _chunkMMFOI5KYjs.getCacheOptions; exports.internalPatch = _chunkMMFOI5KYjs.internalPatch; exports.logger = _chunkMMFOI5KYjs.logger_default; exports.monkeyPatchForExposingContextV2 = _chunkMMFOI5KYjs.monkeyPatchForExposingContextV2; exports.monkeyPatchForExposingContextV3 = _chunkMMFOI5KYjs.monkeyPatchForExposingContextV3; exports.monkeyPatchForSupportingCustomUnit = _chunkMMFOI5KYjs.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-QPUWFRNR.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.9",
|
|
4
4
|
"description": "patch tailwindcss for exposing context and extract classes",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,16 +59,16 @@
|
|
|
59
59
|
"fs-extra": "^11.3.0",
|
|
60
60
|
"local-pkg": "^1.0.0",
|
|
61
61
|
"pathe": "^2.0.3",
|
|
62
|
-
"postcss": "^8.5.
|
|
62
|
+
"postcss": "^8.5.3",
|
|
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.4"
|
|
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.8",
|
|
69
|
+
"@tailwindcss/oxide": "^4.0.8",
|
|
70
|
+
"@tailwindcss/postcss": "^4.0.8",
|
|
71
|
+
"@tailwindcss/vite": "^4.0.8",
|
|
72
72
|
"tailwindcss": "^4.0.6",
|
|
73
73
|
"tailwindcss-3": "npm:tailwindcss@^3",
|
|
74
74
|
"tailwindcss-4": "npm:tailwindcss@^4.0.6"
|