@modern-js/plugin-tailwindcss 0.0.0-next-20221210182423 → 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 +8 -3
- package/dist/js/modern/cli.js +5 -26
- package/dist/js/node/cli.js +5 -26
- package/dist/js/treeshaking/cli.js +6 -24
- package/package.json +11 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
|
|
43
43
|
- d6546ad91: add buildConfig style in module-tools-v2 and remove tools
|
|
44
44
|
在 module-tools-v2 里新增 buildConfig style 并删除 tools
|
|
45
|
+
- 67472ca1c: fix: move babel-plugin-marcos to plugin-tailwindcss
|
|
46
|
+
|
|
47
|
+
fix: 将 babel-plugin-marcos 依赖移动到 plugin-tailwindcss 中
|
|
48
|
+
|
|
45
49
|
- Updated dependencies [2344eb26e]
|
|
46
50
|
- Updated dependencies [a11fcf8b5]
|
|
47
51
|
- Updated dependencies [e7ce0636d]
|
|
@@ -56,6 +60,7 @@
|
|
|
56
60
|
- Updated dependencies [2e6031955]
|
|
57
61
|
- Updated dependencies [fbf5eed5a]
|
|
58
62
|
- Updated dependencies [a2509bfbd]
|
|
63
|
+
- Updated dependencies [a7c68832b]
|
|
59
64
|
- Updated dependencies [425e57092]
|
|
60
65
|
- Updated dependencies [e4357f185]
|
|
61
66
|
- Updated dependencies [4369648ae]
|
|
@@ -83,8 +88,8 @@
|
|
|
83
88
|
- Updated dependencies [abf3421a7]
|
|
84
89
|
- Updated dependencies [543be9558]
|
|
85
90
|
- Updated dependencies [14b712da8]
|
|
86
|
-
- @modern-js/runtime@0.0.0-next-
|
|
87
|
-
- @modern-js/utils@0.0.0-next-
|
|
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,8 +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) { 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); }
|
|
6
1
|
import path from 'path';
|
|
7
2
|
import { PLUGIN_SCHEMAS, fs, CONFIG_CACHE_DIR, globby, nanoid, slash } from '@modern-js/utils';
|
|
8
3
|
import DesignTokenPlugin from "./design-token/cli";
|
|
@@ -68,34 +63,18 @@ export default (({
|
|
|
68
63
|
config.postcssOptions.plugins = [require('tailwindcss')(tailwindConfig)];
|
|
69
64
|
}
|
|
70
65
|
},
|
|
71
|
-
babel(
|
|
72
|
-
|
|
66
|
+
babel(_, {
|
|
67
|
+
addPlugins
|
|
68
|
+
}) {
|
|
73
69
|
if (notHaveTwinMacro) {
|
|
74
70
|
return;
|
|
75
71
|
}
|
|
76
|
-
|
|
72
|
+
addPlugins([[require.resolve('babel-plugin-macros'), {
|
|
77
73
|
twin: {
|
|
78
74
|
preset: supportCssInJsLibrary,
|
|
79
75
|
config: internalTwConfigPath
|
|
80
76
|
}
|
|
81
|
-
};
|
|
82
|
-
(_config$plugins = config.plugins) === null || _config$plugins === void 0 ? void 0 : _config$plugins.some(plugin => {
|
|
83
|
-
if (Array.isArray(plugin) && plugin[0]) {
|
|
84
|
-
const pluginTarget = plugin[0];
|
|
85
|
-
let pluginOptions = plugin[1];
|
|
86
|
-
if (typeof pluginTarget === 'string' &&
|
|
87
|
-
// TODO: use babel chain
|
|
88
|
-
slash(pluginTarget).includes('compiled/babel-plugin-macros')) {
|
|
89
|
-
if (pluginOptions) {
|
|
90
|
-
pluginOptions = _objectSpread(_objectSpread({}, pluginOptions), twinConfig);
|
|
91
|
-
} else {
|
|
92
|
-
plugin.push(twinConfig);
|
|
93
|
-
}
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return false;
|
|
98
|
-
});
|
|
77
|
+
}]]);
|
|
99
78
|
}
|
|
100
79
|
}
|
|
101
80
|
};
|
package/dist/js/node/cli.js
CHANGED
|
@@ -10,11 +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) { 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); }
|
|
18
13
|
const supportCssInJsLibrary = 'styled-components';
|
|
19
14
|
const getRandomTwConfigFileName = internalDirectory => {
|
|
20
15
|
return (0, _utils.slash)(_path.default.join(internalDirectory, `tailwind.config.${Date.now()}.${(0, _utils.nanoid)()}.js`));
|
|
@@ -76,34 +71,18 @@ var _default = ({
|
|
|
76
71
|
config.postcssOptions.plugins = [require('tailwindcss')(tailwindConfig)];
|
|
77
72
|
}
|
|
78
73
|
},
|
|
79
|
-
babel(
|
|
80
|
-
|
|
74
|
+
babel(_, {
|
|
75
|
+
addPlugins
|
|
76
|
+
}) {
|
|
81
77
|
if (notHaveTwinMacro) {
|
|
82
78
|
return;
|
|
83
79
|
}
|
|
84
|
-
|
|
80
|
+
addPlugins([[require.resolve('babel-plugin-macros'), {
|
|
85
81
|
twin: {
|
|
86
82
|
preset: supportCssInJsLibrary,
|
|
87
83
|
config: internalTwConfigPath
|
|
88
84
|
}
|
|
89
|
-
};
|
|
90
|
-
(_config$plugins = config.plugins) === null || _config$plugins === void 0 ? void 0 : _config$plugins.some(plugin => {
|
|
91
|
-
if (Array.isArray(plugin) && plugin[0]) {
|
|
92
|
-
const pluginTarget = plugin[0];
|
|
93
|
-
let pluginOptions = plugin[1];
|
|
94
|
-
if (typeof pluginTarget === 'string' &&
|
|
95
|
-
// TODO: use babel chain
|
|
96
|
-
(0, _utils.slash)(pluginTarget).includes('compiled/babel-plugin-macros')) {
|
|
97
|
-
if (pluginOptions) {
|
|
98
|
-
pluginOptions = _objectSpread(_objectSpread({}, pluginOptions), twinConfig);
|
|
99
|
-
} else {
|
|
100
|
-
plugin.push(twinConfig);
|
|
101
|
-
}
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return false;
|
|
106
|
-
});
|
|
85
|
+
}]]);
|
|
107
86
|
}
|
|
108
87
|
}
|
|
109
88
|
};
|
|
@@ -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/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/
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
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": "0.0.0-next-
|
|
70
|
+
"@modern-js/runtime": "0.0.0-next-20221211140544"
|
|
70
71
|
},
|
|
71
72
|
"peerDependenciesMeta": {
|
|
72
73
|
"@modern-js/runtime": {
|