@modern-js/plugin-tailwindcss 2.32.0 → 2.32.1
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/CHANGELOG.md +12 -0
- package/dist/cjs/design-token/cli/index.js +1 -2
- package/dist/cjs/tailwind.js +6 -20
- package/dist/esm/design-token/cli/index.js +1 -2
- package/dist/esm/tailwind.js +7 -24
- package/dist/esm-node/design-token/cli/index.js +1 -2
- package/dist/esm-node/tailwind.js +7 -21
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @modern-js/plugin-tailwindcss
|
2
2
|
|
3
|
+
## 2.32.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 5e04e3e: refactor(tailwindcss): allow to use tailwind theme config
|
8
|
+
|
9
|
+
refactor(tailwindcss): 支持使用 tailwind theme 配置
|
10
|
+
|
11
|
+
- Updated dependencies [90e053a]
|
12
|
+
- @modern-js/runtime@2.32.1
|
13
|
+
- @modern-js/utils@2.32.1
|
14
|
+
|
3
15
|
## 2.32.0
|
4
16
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/tailwind.js
CHANGED
@@ -10,21 +10,10 @@ Object.defineProperty(exports, "getTailwindConfig", {
|
|
10
10
|
});
|
11
11
|
const _utils = require("@modern-js/utils");
|
12
12
|
const _lodash = require("@modern-js/utils/lodash");
|
13
|
-
const
|
14
|
-
const
|
15
|
-
|
16
|
-
|
17
|
-
let notAllowKey = "";
|
18
|
-
const ret = Object.keys(tailwindConfig).some((key) => notAllowExistKeys.includes(key) && (notAllowKey = key));
|
19
|
-
return [
|
20
|
-
ret,
|
21
|
-
notAllowKey
|
22
|
-
];
|
23
|
-
};
|
24
|
-
const getPureDesignSystemConfig = (designSystemConfig) => {
|
25
|
-
const pureDesignSystemConfig = (0, _lodash.cloneDeep)(designSystemConfig);
|
26
|
-
delete pureDesignSystemConfig.supportStyledComponents;
|
27
|
-
return pureDesignSystemConfig;
|
13
|
+
const getPureDesignSystemConfig = (config) => {
|
14
|
+
const pureConfig = (0, _lodash.cloneDeep)(config);
|
15
|
+
delete pureConfig.supportStyledComponents;
|
16
|
+
return pureConfig;
|
28
17
|
};
|
29
18
|
const getTailwindConfig = (tailwindVersion, tailwindcss, designSystem, option = {}) => {
|
30
19
|
const purgeConfig = (0, _lodash.merge)({
|
@@ -43,11 +32,8 @@ const getTailwindConfig = (tailwindVersion, tailwindcss, designSystem, option =
|
|
43
32
|
};
|
44
33
|
const tailwindConfig = (0, _utils.applyOptionsChain)(defaultTailwindConfig, tailwindcss || {});
|
45
34
|
const designSystemConfig = getPureDesignSystemConfig(designSystem !== null && designSystem !== void 0 ? designSystem : {});
|
46
|
-
|
47
|
-
|
48
|
-
_utils.logger.error(`should not exist '${key}' on tools.tailwindcss, please remove it`);
|
49
|
-
process.exit(0);
|
35
|
+
if (designSystemConfig && Object.keys(designSystemConfig).length > 0) {
|
36
|
+
tailwindConfig.theme = designSystemConfig;
|
50
37
|
}
|
51
|
-
tailwindConfig.theme = designSystemConfig || {};
|
52
38
|
return tailwindConfig;
|
53
39
|
};
|
package/dist/esm/tailwind.js
CHANGED
@@ -1,23 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
import { applyOptionsChain, logger } from "@modern-js/utils";
|
1
|
+
import { applyOptionsChain } from "@modern-js/utils";
|
3
2
|
import { merge, cloneDeep } from "@modern-js/utils/lodash";
|
4
|
-
var
|
5
|
-
var
|
6
|
-
|
7
|
-
|
8
|
-
var notAllowKey = "";
|
9
|
-
var ret = Object.keys(tailwindConfig).some(function(key) {
|
10
|
-
return notAllowExistKeys.includes(key) && (notAllowKey = key);
|
11
|
-
});
|
12
|
-
return [
|
13
|
-
ret,
|
14
|
-
notAllowKey
|
15
|
-
];
|
16
|
-
};
|
17
|
-
var getPureDesignSystemConfig = function(designSystemConfig) {
|
18
|
-
var pureDesignSystemConfig = cloneDeep(designSystemConfig);
|
19
|
-
delete pureDesignSystemConfig.supportStyledComponents;
|
20
|
-
return pureDesignSystemConfig;
|
3
|
+
var getPureDesignSystemConfig = function(config) {
|
4
|
+
var pureConfig = cloneDeep(config);
|
5
|
+
delete pureConfig.supportStyledComponents;
|
6
|
+
return pureConfig;
|
21
7
|
};
|
22
8
|
var getTailwindConfig = function(tailwindVersion, tailwindcss, designSystem) {
|
23
9
|
var option = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
@@ -37,12 +23,9 @@ var getTailwindConfig = function(tailwindVersion, tailwindcss, designSystem) {
|
|
37
23
|
};
|
38
24
|
var tailwindConfig = applyOptionsChain(defaultTailwindConfig, tailwindcss || {});
|
39
25
|
var designSystemConfig = getPureDesignSystemConfig(designSystem !== null && designSystem !== void 0 ? designSystem : {});
|
40
|
-
|
41
|
-
|
42
|
-
logger.error("should not exist '".concat(key, "' on tools.tailwindcss, please remove it"));
|
43
|
-
process.exit(0);
|
26
|
+
if (designSystemConfig && Object.keys(designSystemConfig).length > 0) {
|
27
|
+
tailwindConfig.theme = designSystemConfig;
|
44
28
|
}
|
45
|
-
tailwindConfig.theme = designSystemConfig || {};
|
46
29
|
return tailwindConfig;
|
47
30
|
};
|
48
31
|
export { getTailwindConfig };
|
@@ -1,20 +1,9 @@
|
|
1
|
-
import { applyOptionsChain
|
1
|
+
import { applyOptionsChain } from "@modern-js/utils";
|
2
2
|
import { merge, cloneDeep } from "@modern-js/utils/lodash";
|
3
|
-
const
|
4
|
-
const
|
5
|
-
|
6
|
-
|
7
|
-
let notAllowKey = "";
|
8
|
-
const ret = Object.keys(tailwindConfig).some((key) => notAllowExistKeys.includes(key) && (notAllowKey = key));
|
9
|
-
return [
|
10
|
-
ret,
|
11
|
-
notAllowKey
|
12
|
-
];
|
13
|
-
};
|
14
|
-
const getPureDesignSystemConfig = (designSystemConfig) => {
|
15
|
-
const pureDesignSystemConfig = cloneDeep(designSystemConfig);
|
16
|
-
delete pureDesignSystemConfig.supportStyledComponents;
|
17
|
-
return pureDesignSystemConfig;
|
3
|
+
const getPureDesignSystemConfig = (config) => {
|
4
|
+
const pureConfig = cloneDeep(config);
|
5
|
+
delete pureConfig.supportStyledComponents;
|
6
|
+
return pureConfig;
|
18
7
|
};
|
19
8
|
const getTailwindConfig = (tailwindVersion, tailwindcss, designSystem, option = {}) => {
|
20
9
|
const purgeConfig = merge({
|
@@ -33,12 +22,9 @@ const getTailwindConfig = (tailwindVersion, tailwindcss, designSystem, option =
|
|
33
22
|
};
|
34
23
|
const tailwindConfig = applyOptionsChain(defaultTailwindConfig, tailwindcss || {});
|
35
24
|
const designSystemConfig = getPureDesignSystemConfig(designSystem !== null && designSystem !== void 0 ? designSystem : {});
|
36
|
-
|
37
|
-
|
38
|
-
logger.error(`should not exist '${key}' on tools.tailwindcss, please remove it`);
|
39
|
-
process.exit(0);
|
25
|
+
if (designSystemConfig && Object.keys(designSystemConfig).length > 0) {
|
26
|
+
tailwindConfig.theme = designSystemConfig;
|
40
27
|
}
|
41
|
-
tailwindConfig.theme = designSystemConfig || {};
|
42
28
|
return tailwindConfig;
|
43
29
|
};
|
44
30
|
export { getTailwindConfig };
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.32.
|
18
|
+
"version": "2.32.1",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -49,7 +49,7 @@
|
|
49
49
|
"babel-plugin-macros": "3.1.0",
|
50
50
|
"hoist-non-react-statics": "^3.3.2",
|
51
51
|
"@swc/helpers": "0.5.1",
|
52
|
-
"@modern-js/utils": "2.32.
|
52
|
+
"@modern-js/utils": "2.32.1"
|
53
53
|
},
|
54
54
|
"devDependencies": {
|
55
55
|
"@types/jest": "^29",
|
@@ -59,17 +59,17 @@
|
|
59
59
|
"jest": "^29",
|
60
60
|
"react": "^18",
|
61
61
|
"postcss": "8.4.27",
|
62
|
-
"@modern-js/core": "2.32.
|
63
|
-
"@modern-js/module-tools": "2.32.
|
64
|
-
"@modern-js/runtime": "2.32.
|
65
|
-
"@modern-js/types": "2.32.
|
66
|
-
"@modern-js/app-tools": "2.32.
|
67
|
-
"@scripts/
|
68
|
-
"@scripts/
|
62
|
+
"@modern-js/core": "2.32.1",
|
63
|
+
"@modern-js/module-tools": "2.32.1",
|
64
|
+
"@modern-js/runtime": "2.32.1",
|
65
|
+
"@modern-js/types": "2.32.1",
|
66
|
+
"@modern-js/app-tools": "2.32.1",
|
67
|
+
"@scripts/build": "2.32.1",
|
68
|
+
"@scripts/jest-config": "2.32.1"
|
69
69
|
},
|
70
70
|
"peerDependencies": {
|
71
71
|
"tailwindcss": ">= 2.0.0 || >= 3.0.0",
|
72
|
-
"@modern-js/runtime": "^2.32.
|
72
|
+
"@modern-js/runtime": "^2.32.1"
|
73
73
|
},
|
74
74
|
"peerDependenciesMeta": {
|
75
75
|
"@modern-js/runtime": {
|