@modern-js/plugin-tailwindcss 0.0.0-next-20221211034006 → 0.0.0-next-20221211140544
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 +53 -48
- package/dist/js/modern/cli.js +5 -24
- package/dist/js/modern/design-token/cli/index.js +3 -1
- package/dist/js/modern/design-token/runtime/plugin.js +3 -1
- package/dist/js/node/cli.js +5 -24
- package/dist/js/node/design-token/cli/index.js +3 -1
- package/dist/js/node/design-token/runtime/plugin.js +3 -1
- package/dist/js/treeshaking/cli.js +6 -24
- package/dist/types/types.d.ts +2 -2
- package/package.json +11 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# @modern-js/plugin-tailwindcss
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-20221211140544
|
|
4
4
|
|
|
5
5
|
### Major Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- dda38c9c3: chore: v2
|
|
8
8
|
|
|
9
9
|
### Minor Changes
|
|
10
10
|
|
|
11
|
-
-
|
|
11
|
+
- 92f0eade3: feat:
|
|
12
12
|
|
|
13
13
|
1. add style config and add new hook
|
|
14
14
|
2. add dts alias logic
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
4. 添加日志逻辑
|
|
25
25
|
5. 添加 skipDeps 配置
|
|
26
26
|
|
|
27
|
-
-
|
|
27
|
+
- 92f0eade3: feat:
|
|
28
28
|
|
|
29
29
|
1. core: 增加 test 函数
|
|
30
30
|
2. module plugins: 增加 `babel`, `mainField`, `target` 插件
|
|
@@ -40,51 +40,56 @@
|
|
|
40
40
|
|
|
41
41
|
### Patch Changes
|
|
42
42
|
|
|
43
|
-
-
|
|
43
|
+
- d6546ad91: add buildConfig style in module-tools-v2 and remove tools
|
|
44
44
|
在 module-tools-v2 里新增 buildConfig style 并删除 tools
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
- Updated dependencies [
|
|
50
|
-
- Updated dependencies [
|
|
51
|
-
- Updated dependencies [
|
|
52
|
-
- Updated dependencies [
|
|
53
|
-
- Updated dependencies [
|
|
54
|
-
- Updated dependencies [
|
|
55
|
-
- Updated dependencies [
|
|
56
|
-
- Updated dependencies [
|
|
57
|
-
- Updated dependencies [
|
|
58
|
-
- Updated dependencies [
|
|
59
|
-
- Updated dependencies [
|
|
60
|
-
- Updated dependencies [
|
|
61
|
-
- Updated dependencies [
|
|
62
|
-
- Updated dependencies [
|
|
63
|
-
- Updated dependencies [
|
|
64
|
-
- Updated dependencies [
|
|
65
|
-
- Updated dependencies [
|
|
66
|
-
- Updated dependencies [
|
|
67
|
-
- Updated dependencies [
|
|
68
|
-
- Updated dependencies [
|
|
69
|
-
- Updated dependencies [
|
|
70
|
-
- Updated dependencies [
|
|
71
|
-
- Updated dependencies [
|
|
72
|
-
- Updated dependencies [
|
|
73
|
-
- Updated dependencies [
|
|
74
|
-
- Updated dependencies [
|
|
75
|
-
- Updated dependencies [
|
|
76
|
-
- Updated dependencies [
|
|
77
|
-
- Updated dependencies [
|
|
78
|
-
- Updated dependencies [
|
|
79
|
-
- Updated dependencies [
|
|
80
|
-
- Updated dependencies [
|
|
81
|
-
- Updated dependencies [
|
|
82
|
-
- Updated dependencies [
|
|
83
|
-
- Updated dependencies [
|
|
84
|
-
- Updated dependencies [
|
|
85
|
-
- Updated dependencies [
|
|
86
|
-
|
|
87
|
-
|
|
45
|
+
- 67472ca1c: fix: move babel-plugin-marcos to plugin-tailwindcss
|
|
46
|
+
|
|
47
|
+
fix: 将 babel-plugin-marcos 依赖移动到 plugin-tailwindcss 中
|
|
48
|
+
|
|
49
|
+
- Updated dependencies [2344eb26e]
|
|
50
|
+
- Updated dependencies [a11fcf8b5]
|
|
51
|
+
- Updated dependencies [e7ce0636d]
|
|
52
|
+
- Updated dependencies [b18fa8f3e]
|
|
53
|
+
- Updated dependencies [7879e8f71]
|
|
54
|
+
- Updated dependencies [50d4675e5]
|
|
55
|
+
- Updated dependencies [c9e800d39]
|
|
56
|
+
- Updated dependencies [6604f1b8b]
|
|
57
|
+
- Updated dependencies [6aca87501]
|
|
58
|
+
- Updated dependencies [fda836fe8]
|
|
59
|
+
- Updated dependencies [3e57f2bd5]
|
|
60
|
+
- Updated dependencies [2e6031955]
|
|
61
|
+
- Updated dependencies [fbf5eed5a]
|
|
62
|
+
- Updated dependencies [a2509bfbd]
|
|
63
|
+
- Updated dependencies [a7c68832b]
|
|
64
|
+
- Updated dependencies [425e57092]
|
|
65
|
+
- Updated dependencies [e4357f185]
|
|
66
|
+
- Updated dependencies [4369648ae]
|
|
67
|
+
- Updated dependencies [92f0eade3]
|
|
68
|
+
- Updated dependencies [92c099446]
|
|
69
|
+
- Updated dependencies [edd1cfb1a]
|
|
70
|
+
- Updated dependencies [cc971eabf]
|
|
71
|
+
- Updated dependencies [5b9049f2e]
|
|
72
|
+
- Updated dependencies [6bda14ed7]
|
|
73
|
+
- Updated dependencies [92004d190]
|
|
74
|
+
- Updated dependencies [b8bbe036c]
|
|
75
|
+
- Updated dependencies [40ed5874c]
|
|
76
|
+
- Updated dependencies [60d537863]
|
|
77
|
+
- Updated dependencies [d5a31df78]
|
|
78
|
+
- Updated dependencies [dda38c9c3]
|
|
79
|
+
- Updated dependencies [8b8e1bb57]
|
|
80
|
+
- Updated dependencies [3bbea92b2]
|
|
81
|
+
- Updated dependencies [b710adb84]
|
|
82
|
+
- Updated dependencies [18aaf4224]
|
|
83
|
+
- Updated dependencies [34702d5d4]
|
|
84
|
+
- Updated dependencies [fcace5b5b]
|
|
85
|
+
- Updated dependencies [ea7cf0625]
|
|
86
|
+
- Updated dependencies [bbe4c4ab6]
|
|
87
|
+
- Updated dependencies [e4558a0bc]
|
|
88
|
+
- Updated dependencies [abf3421a7]
|
|
89
|
+
- Updated dependencies [543be9558]
|
|
90
|
+
- Updated dependencies [14b712da8]
|
|
91
|
+
- @modern-js/runtime@0.0.0-next-20221211140544
|
|
92
|
+
- @modern-js/utils@0.0.0-next-20221211140544
|
|
88
93
|
|
|
89
94
|
## 2.0.0-beta.3
|
|
90
95
|
|
package/dist/js/modern/cli.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
1
|
import path from 'path';
|
|
5
2
|
import { PLUGIN_SCHEMAS, fs, CONFIG_CACHE_DIR, globby, nanoid, slash } from '@modern-js/utils';
|
|
6
3
|
import DesignTokenPlugin from "./design-token/cli";
|
|
@@ -66,34 +63,18 @@ export default (({
|
|
|
66
63
|
config.postcssOptions.plugins = [require('tailwindcss')(tailwindConfig)];
|
|
67
64
|
}
|
|
68
65
|
},
|
|
69
|
-
babel(
|
|
70
|
-
|
|
66
|
+
babel(_, {
|
|
67
|
+
addPlugins
|
|
68
|
+
}) {
|
|
71
69
|
if (notHaveTwinMacro) {
|
|
72
70
|
return;
|
|
73
71
|
}
|
|
74
|
-
|
|
72
|
+
addPlugins([[require.resolve('babel-plugin-macros'), {
|
|
75
73
|
twin: {
|
|
76
74
|
preset: supportCssInJsLibrary,
|
|
77
75
|
config: internalTwConfigPath
|
|
78
76
|
}
|
|
79
|
-
};
|
|
80
|
-
(_config$plugins = config.plugins) === null || _config$plugins === void 0 ? void 0 : _config$plugins.some(plugin => {
|
|
81
|
-
if (Array.isArray(plugin) && plugin[0]) {
|
|
82
|
-
const pluginTarget = plugin[0];
|
|
83
|
-
let pluginOptions = plugin[1];
|
|
84
|
-
if (typeof pluginTarget === 'string' &&
|
|
85
|
-
// TODO: use babel chain
|
|
86
|
-
slash(pluginTarget).includes('compiled/babel-plugin-macros')) {
|
|
87
|
-
if (pluginOptions) {
|
|
88
|
-
pluginOptions = _objectSpread(_objectSpread({}, pluginOptions), twinConfig);
|
|
89
|
-
} else {
|
|
90
|
-
plugin.push(twinConfig);
|
|
91
|
-
}
|
|
92
|
-
return true;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return false;
|
|
96
|
-
});
|
|
77
|
+
}]]);
|
|
97
78
|
}
|
|
98
79
|
}
|
|
99
80
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
2
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
6
|
import { lazyImport, PLUGIN_SCHEMAS, createRuntimeExportsUtils } from '@modern-js/utils';
|
|
5
7
|
export default (({
|
|
6
8
|
pluginName
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
2
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
6
|
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
5
7
|
import React, { useContext } from 'react';
|
|
6
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
package/dist/js/node/cli.js
CHANGED
|
@@ -10,9 +10,6 @@ var _cli = _interopRequireDefault(require("./design-token/cli"));
|
|
|
10
10
|
var _tailwind = require("./tailwind");
|
|
11
11
|
var _utils2 = require("./utils");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
13
|
const supportCssInJsLibrary = 'styled-components';
|
|
17
14
|
const getRandomTwConfigFileName = internalDirectory => {
|
|
18
15
|
return (0, _utils.slash)(_path.default.join(internalDirectory, `tailwind.config.${Date.now()}.${(0, _utils.nanoid)()}.js`));
|
|
@@ -74,34 +71,18 @@ var _default = ({
|
|
|
74
71
|
config.postcssOptions.plugins = [require('tailwindcss')(tailwindConfig)];
|
|
75
72
|
}
|
|
76
73
|
},
|
|
77
|
-
babel(
|
|
78
|
-
|
|
74
|
+
babel(_, {
|
|
75
|
+
addPlugins
|
|
76
|
+
}) {
|
|
79
77
|
if (notHaveTwinMacro) {
|
|
80
78
|
return;
|
|
81
79
|
}
|
|
82
|
-
|
|
80
|
+
addPlugins([[require.resolve('babel-plugin-macros'), {
|
|
83
81
|
twin: {
|
|
84
82
|
preset: supportCssInJsLibrary,
|
|
85
83
|
config: internalTwConfigPath
|
|
86
84
|
}
|
|
87
|
-
};
|
|
88
|
-
(_config$plugins = config.plugins) === null || _config$plugins === void 0 ? void 0 : _config$plugins.some(plugin => {
|
|
89
|
-
if (Array.isArray(plugin) && plugin[0]) {
|
|
90
|
-
const pluginTarget = plugin[0];
|
|
91
|
-
let pluginOptions = plugin[1];
|
|
92
|
-
if (typeof pluginTarget === 'string' &&
|
|
93
|
-
// TODO: use babel chain
|
|
94
|
-
(0, _utils.slash)(pluginTarget).includes('compiled/babel-plugin-macros')) {
|
|
95
|
-
if (pluginOptions) {
|
|
96
|
-
pluginOptions = _objectSpread(_objectSpread({}, pluginOptions), twinConfig);
|
|
97
|
-
} else {
|
|
98
|
-
plugin.push(twinConfig);
|
|
99
|
-
}
|
|
100
|
-
return true;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return false;
|
|
104
|
-
});
|
|
85
|
+
}]]);
|
|
105
86
|
}
|
|
106
87
|
}
|
|
107
88
|
};
|
|
@@ -7,7 +7,9 @@ exports.default = void 0;
|
|
|
7
7
|
var _utils = require("@modern-js/utils");
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
13
|
var _default = ({
|
|
12
14
|
pluginName
|
|
13
15
|
} = {
|
|
@@ -12,7 +12,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
14
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
18
|
const DesignTokenContext = /*#__PURE__*/_react.default.createContext({});
|
|
17
19
|
exports.DesignTokenContext = DesignTokenContext;
|
|
18
20
|
const useDesignTokens = () => (0, _react.useContext)(DesignTokenContext);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
3
|
import path from 'path';
|
|
5
4
|
import { PLUGIN_SCHEMAS, fs, CONFIG_CACHE_DIR, globby, nanoid, slash } from '@modern-js/utils';
|
|
@@ -72,40 +71,23 @@ export default (function () {
|
|
|
72
71
|
config.postcssOptions.plugins = [require('tailwindcss')(tailwindConfig)];
|
|
73
72
|
}
|
|
74
73
|
},
|
|
75
|
-
babel: function babel(
|
|
76
|
-
var
|
|
74
|
+
babel: function babel(_, _ref2) {
|
|
75
|
+
var addPlugins = _ref2.addPlugins;
|
|
77
76
|
if (notHaveTwinMacro) {
|
|
78
77
|
return;
|
|
79
78
|
}
|
|
80
|
-
|
|
79
|
+
addPlugins([[require.resolve('babel-plugin-macros'), {
|
|
81
80
|
twin: {
|
|
82
81
|
preset: supportCssInJsLibrary,
|
|
83
82
|
config: internalTwConfigPath
|
|
84
83
|
}
|
|
85
|
-
};
|
|
86
|
-
(_config$plugins = config.plugins) === null || _config$plugins === void 0 ? void 0 : _config$plugins.some(function (plugin) {
|
|
87
|
-
if (Array.isArray(plugin) && plugin[0]) {
|
|
88
|
-
var pluginTarget = plugin[0];
|
|
89
|
-
var pluginOptions = plugin[1];
|
|
90
|
-
if (typeof pluginTarget === 'string' &&
|
|
91
|
-
// TODO: use babel chain
|
|
92
|
-
slash(pluginTarget).includes('compiled/babel-plugin-macros')) {
|
|
93
|
-
if (pluginOptions) {
|
|
94
|
-
pluginOptions = _objectSpread(_objectSpread({}, pluginOptions), twinConfig);
|
|
95
|
-
} else {
|
|
96
|
-
plugin.push(twinConfig);
|
|
97
|
-
}
|
|
98
|
-
return true;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return false;
|
|
102
|
-
});
|
|
84
|
+
}]]);
|
|
103
85
|
}
|
|
104
86
|
}
|
|
105
87
|
};
|
|
106
88
|
},
|
|
107
|
-
beforeBuildTask: function beforeBuildTask(
|
|
108
|
-
var config =
|
|
89
|
+
beforeBuildTask: function beforeBuildTask(_ref3) {
|
|
90
|
+
var config = _ref3.config;
|
|
109
91
|
var modernConfig = api.useResolvedConfigContext();
|
|
110
92
|
var designSystem = modernConfig.designSystem;
|
|
111
93
|
var tailwindConfig = getTailwindConfig(config.style.tailwindCss, designSystem, {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type DesignSystem = Record<string, any> & {
|
|
2
2
|
supportStyledComponents?: boolean;
|
|
3
3
|
};
|
|
4
|
-
export
|
|
4
|
+
export type Tailwind = Record<string, any> | ((options: Record<string, any>) => Record<string, any> | void);
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.0-next-
|
|
14
|
+
"version": "0.0.0-next-20221211140544",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -44,8 +44,9 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@babel/runtime": "^7.18.0",
|
|
47
|
+
"babel-plugin-macros": "3.1.0",
|
|
47
48
|
"hoist-non-react-statics": "^3.3.2",
|
|
48
|
-
"@modern-js/utils": "0.0.0-next-
|
|
49
|
+
"@modern-js/utils": "0.0.0-next-20221211140544"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@types/jest": "^27",
|
|
@@ -56,17 +57,17 @@
|
|
|
56
57
|
"jest": "^27",
|
|
57
58
|
"react": "^18",
|
|
58
59
|
"postcss": "^8.4.14",
|
|
59
|
-
"@modern-js/core": "0.0.0-next-
|
|
60
|
-
"@modern-js/module-tools-v2": "0.0.0-next-
|
|
61
|
-
"@modern-js/runtime": "0.0.0-next-
|
|
62
|
-
"@modern-js/types": "0.0.0-next-
|
|
63
|
-
"@scripts/build": "0.0.0-next-
|
|
64
|
-
"@modern-js/app-tools": "0.0.0-next-
|
|
65
|
-
"@scripts/jest-config": "0.0.0-next-
|
|
60
|
+
"@modern-js/core": "0.0.0-next-20221211140544",
|
|
61
|
+
"@modern-js/module-tools-v2": "0.0.0-next-20221211140544",
|
|
62
|
+
"@modern-js/runtime": "0.0.0-next-20221211140544",
|
|
63
|
+
"@modern-js/types": "0.0.0-next-20221211140544",
|
|
64
|
+
"@scripts/build": "0.0.0-next-20221211140544",
|
|
65
|
+
"@modern-js/app-tools": "0.0.0-next-20221211140544",
|
|
66
|
+
"@scripts/jest-config": "0.0.0-next-20221211140544"
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
68
69
|
"tailwindcss": "^2.0.4",
|
|
69
|
-
"@modern-js/runtime": "
|
|
70
|
+
"@modern-js/runtime": "0.0.0-next-20221211140544"
|
|
70
71
|
},
|
|
71
72
|
"peerDependenciesMeta": {
|
|
72
73
|
"@modern-js/runtime": {
|