tailwindcss-patch 6.0.2 → 6.0.3
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.
|
@@ -57,24 +57,22 @@ var CacheManager = class {
|
|
|
57
57
|
const { filename } = this.options;
|
|
58
58
|
await fs.outputJSON(filename, [...data]);
|
|
59
59
|
return filename;
|
|
60
|
-
} catch {
|
|
61
|
-
logger_default.error(
|
|
60
|
+
} catch (error) {
|
|
61
|
+
logger_default.error(error);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
async read() {
|
|
65
65
|
const { filename } = this.options;
|
|
66
|
+
const isExisted = await fs.exists(filename);
|
|
66
67
|
try {
|
|
67
|
-
if (
|
|
68
|
+
if (isExisted) {
|
|
68
69
|
const data = await fs.readJSON(filename);
|
|
69
70
|
return new Set(data);
|
|
70
71
|
}
|
|
71
|
-
} catch {
|
|
72
|
-
logger_default.error(`
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
} catch {
|
|
76
|
-
logger_default.error(`delete cache file fail! path:${filename}`);
|
|
77
|
-
}
|
|
72
|
+
} catch (error) {
|
|
73
|
+
logger_default.error(`path:${filename}`);
|
|
74
|
+
logger_default.error(error);
|
|
75
|
+
isExisted && await fs.remove(filename);
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
78
|
};
|
|
@@ -910,7 +908,7 @@ var TailwindcssPatcher = class {
|
|
|
910
908
|
const { output, tailwindcss } = options ?? {};
|
|
911
909
|
if (output && tailwindcss) {
|
|
912
910
|
const { filename, loose } = output;
|
|
913
|
-
if (this.majorVersion === 3) {
|
|
911
|
+
if (this.majorVersion === 3 || this.majorVersion === 2) {
|
|
914
912
|
await processTailwindcss({
|
|
915
913
|
...tailwindcss,
|
|
916
914
|
majorVersion: this.majorVersion
|
|
@@ -61,24 +61,22 @@ var CacheManager = class {
|
|
|
61
61
|
const { filename } = this.options;
|
|
62
62
|
await _fsextra2.default.outputJSON(filename, [...data]);
|
|
63
63
|
return filename;
|
|
64
|
-
} catch (
|
|
65
|
-
logger_default.error(
|
|
64
|
+
} catch (error) {
|
|
65
|
+
logger_default.error(error);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
async read() {
|
|
69
69
|
const { filename } = this.options;
|
|
70
|
+
const isExisted = await _fsextra2.default.exists(filename);
|
|
70
71
|
try {
|
|
71
|
-
if (
|
|
72
|
+
if (isExisted) {
|
|
72
73
|
const data = await _fsextra2.default.readJSON(filename);
|
|
73
74
|
return new Set(data);
|
|
74
75
|
}
|
|
75
|
-
} catch (
|
|
76
|
-
logger_default.error(`
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
} catch (e4) {
|
|
80
|
-
logger_default.error(`delete cache file fail! path:${filename}`);
|
|
81
|
-
}
|
|
76
|
+
} catch (error) {
|
|
77
|
+
logger_default.error(`path:${filename}`);
|
|
78
|
+
logger_default.error(error);
|
|
79
|
+
isExisted && await _fsextra2.default.remove(filename);
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
82
|
};
|
|
@@ -658,7 +656,7 @@ function internalPatch(pkgJsonPath, options) {
|
|
|
658
656
|
Object.assign(_nullishCoalesce(result, () => ( {})), monkeyPatchForSupportingCustomUnit(twDir, defu(options.applyPatches.extendLengthUnits === true ? void 0 : options.applyPatches.extendLengthUnits, {
|
|
659
657
|
overwrite: options.overwrite
|
|
660
658
|
})));
|
|
661
|
-
} catch (
|
|
659
|
+
} catch (e2) {
|
|
662
660
|
}
|
|
663
661
|
}
|
|
664
662
|
return result;
|
|
@@ -914,7 +912,7 @@ var TailwindcssPatcher = (_class = class {
|
|
|
914
912
|
const { output, tailwindcss } = _nullishCoalesce(options, () => ( {}));
|
|
915
913
|
if (output && tailwindcss) {
|
|
916
914
|
const { filename, loose } = output;
|
|
917
|
-
if (this.majorVersion === 3) {
|
|
915
|
+
if (this.majorVersion === 3 || this.majorVersion === 2) {
|
|
918
916
|
await processTailwindcss({
|
|
919
917
|
...tailwindcss,
|
|
920
918
|
majorVersion: this.majorVersion
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkAT6RYKKSjs = require('./chunk-AT6RYKKS.js');
|
|
6
6
|
|
|
7
7
|
// src/cli.ts
|
|
8
8
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -14,21 +14,21 @@ function init() {
|
|
|
14
14
|
}
|
|
15
15
|
var cli = _cac2.default.call(void 0, );
|
|
16
16
|
cli.command("install", "patch install").action(() => {
|
|
17
|
-
const twPatcher = new (0,
|
|
18
|
-
patch:
|
|
17
|
+
const twPatcher = new (0, _chunkAT6RYKKSjs.TailwindcssPatcher)({
|
|
18
|
+
patch: _chunkAT6RYKKSjs.getPatchOptions.call(void 0, )
|
|
19
19
|
});
|
|
20
20
|
twPatcher.patch();
|
|
21
21
|
});
|
|
22
22
|
cli.command("init").action(async () => {
|
|
23
23
|
await init();
|
|
24
|
-
|
|
24
|
+
_chunkAT6RYKKSjs.logger_default.success(`\u2728 ${_config.CONFIG_NAME}.config.ts initialized!`);
|
|
25
25
|
});
|
|
26
26
|
cli.command("extract").action(async () => {
|
|
27
27
|
const { config } = await _config.getConfig.call(void 0, );
|
|
28
28
|
if (config) {
|
|
29
|
-
const twPatcher = new (0,
|
|
29
|
+
const twPatcher = new (0, _chunkAT6RYKKSjs.TailwindcssPatcher)();
|
|
30
30
|
const p = await twPatcher.extract(config.patch);
|
|
31
|
-
|
|
31
|
+
_chunkAT6RYKKSjs.logger_default.success(`\u2728 tailwindcss-patch extract success! file path: ${p}`);
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
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 _chunkAT6RYKKSjs = require('./chunk-AT6RYKKS.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 = _chunkAT6RYKKSjs.CacheManager; exports.TailwindcssPatcher = _chunkAT6RYKKSjs.TailwindcssPatcher; exports.defineConfig = _config.defineConfig; exports.getCacheOptions = _chunkAT6RYKKSjs.getCacheOptions; exports.internalPatch = _chunkAT6RYKKSjs.internalPatch; exports.logger = _chunkAT6RYKKSjs.logger_default; exports.monkeyPatchForExposingContextV2 = _chunkAT6RYKKSjs.monkeyPatchForExposingContextV2; exports.monkeyPatchForExposingContextV3 = _chunkAT6RYKKSjs.monkeyPatchForExposingContextV3; exports.monkeyPatchForSupportingCustomUnit = _chunkAT6RYKKSjs.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-5K6TRQY5.mjs";
|
|
11
11
|
|
|
12
12
|
// src/index.ts
|
|
13
13
|
import { defineConfig } from "@tailwindcss-mangle/config";
|