@modern-js/plugin-tailwindcss 2.4.0 → 2.4.1-beta.0
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 +10 -0
- package/dist/js/treeshaking/cli.js +4 -4
- package/dist/js/treeshaking/design-token/cli/index.js +6 -6
- package/dist/js/treeshaking/design-token/postcss-plugin/index.js +1 -1
- package/dist/js/treeshaking/design-token/runtime/plugin.js +1 -1
- package/dist/js/treeshaking/tailwind.js +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# @modern-js/plugin-tailwindcss
|
2
2
|
|
3
|
+
## 2.4.1-beta.0
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [7a25271]
|
8
|
+
- Updated dependencies [11c053b]
|
9
|
+
- Updated dependencies [a0f2ab1]
|
10
|
+
- @modern-js/runtime@2.4.1-beta.0
|
11
|
+
- @modern-js/utils@2.4.1-beta.0
|
12
|
+
|
3
13
|
## 2.4.0
|
4
14
|
|
5
15
|
### Patch Changes
|
@@ -144,11 +144,11 @@ var cli_default = function() {
|
|
144
144
|
],
|
145
145
|
setup: function() {
|
146
146
|
var _ref = _asyncToGenerator(function(api) {
|
147
|
-
var
|
147
|
+
var _api_useAppContext, appDirectory, internalDirectory, internalTwConfigPath, haveTwinMacro, tailwindPath, tailwindVersion, defaultContent;
|
148
148
|
return __generator(this, function(_state) {
|
149
149
|
switch(_state.label){
|
150
150
|
case 0:
|
151
|
-
|
151
|
+
_api_useAppContext = api.useAppContext(), appDirectory = _api_useAppContext.appDirectory, internalDirectory = _api_useAppContext.internalDirectory;
|
152
152
|
internalTwConfigPath = "";
|
153
153
|
return [
|
154
154
|
4,
|
@@ -194,9 +194,9 @@ var cli_default = function() {
|
|
194
194
|
var tailwindConfig;
|
195
195
|
var initTailwindConfig = function() {
|
196
196
|
if (!tailwindConfig) {
|
197
|
-
var
|
197
|
+
var _modernConfig_tools, _modernConfig_source;
|
198
198
|
var modernConfig = api.useResolvedConfigContext();
|
199
|
-
tailwindConfig = getTailwindConfig(tailwindVersion, modernConfig === null || modernConfig === void 0 ? void 0 : (
|
199
|
+
tailwindConfig = getTailwindConfig(tailwindVersion, modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_tools = modernConfig.tools) === null || _modernConfig_tools === void 0 ? void 0 : _modernConfig_tools.tailwindcss, modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_source = modernConfig.source) === null || _modernConfig_source === void 0 ? void 0 : _modernConfig_source.designSystem, {
|
200
200
|
pureConfig: {
|
201
201
|
content: defaultContent
|
202
202
|
}
|
@@ -63,10 +63,10 @@ var cli_default = function() {
|
|
63
63
|
},
|
64
64
|
modifyEntryImports: function modifyEntryImports(param) {
|
65
65
|
var entrypoint = param.entrypoint, imports = param.imports;
|
66
|
-
var
|
66
|
+
var _userConfig_source;
|
67
67
|
var userConfig = api.useResolvedConfigContext();
|
68
|
-
var
|
69
|
-
var designSystem = (
|
68
|
+
var _userConfig_source_designSystem;
|
69
|
+
var designSystem = (_userConfig_source_designSystem = (_userConfig_source = userConfig.source) === null || _userConfig_source === void 0 ? void 0 : _userConfig_source.designSystem) !== null && _userConfig_source_designSystem !== void 0 ? _userConfig_source_designSystem : {};
|
70
70
|
if (typeof designSystem === "object" && designSystem.supportStyledComponents) {
|
71
71
|
var designTokens = getDesignTokens(userConfig.source.designSystem);
|
72
72
|
imports.push({
|
@@ -86,10 +86,10 @@ var cli_default = function() {
|
|
86
86
|
},
|
87
87
|
modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(param) {
|
88
88
|
var entrypoint = param.entrypoint, plugins = param.plugins;
|
89
|
-
var
|
89
|
+
var _userConfig_source;
|
90
90
|
var userConfig = api.useResolvedConfigContext();
|
91
|
-
var
|
92
|
-
var designSystem = (
|
91
|
+
var _userConfig_source_designSystem;
|
92
|
+
var designSystem = (_userConfig_source_designSystem = (_userConfig_source = userConfig.source) === null || _userConfig_source === void 0 ? void 0 : _userConfig_source.designSystem) !== null && _userConfig_source_designSystem !== void 0 ? _userConfig_source_designSystem : {};
|
93
93
|
var useSCThemeProvider = true;
|
94
94
|
if (designSystem) {
|
95
95
|
useSCThemeProvider = (designSystem === null || designSystem === void 0 ? void 0 : designSystem.supportStyledComponents) || false;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
var postcss_plugin_default = function() {
|
2
|
-
var
|
2
|
+
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_cssVarsHash = _ref.cssVarsHash, cssVarsHash = _ref_cssVarsHash === void 0 ? {} : _ref_cssVarsHash;
|
3
3
|
return {
|
4
4
|
postcssPlugin: "postcss-replace-css-vars",
|
5
5
|
Declaration: function Declaration(decl) {
|
@@ -42,7 +42,7 @@ var plugin_default = function() {
|
|
42
42
|
hoc: function hoc(param, next) {
|
43
43
|
var App = param.App;
|
44
44
|
var DesignTokenAppWrapper = function(props) {
|
45
|
-
var
|
45
|
+
var _options_token = options.token, token = _options_token === void 0 ? {} : _options_token, _options_useStyledComponentsThemeProvider = options.useStyledComponentsThemeProvider, useStyledComponentsThemeProvider = _options_useStyledComponentsThemeProvider === void 0 ? false : _options_useStyledComponentsThemeProvider, _options_useDesignTokenContext = options.useDesignTokenContext, useDesignTokenContext = _options_useDesignTokenContext === void 0 ? false : _options_useDesignTokenContext;
|
46
46
|
if (useStyledComponentsThemeProvider && useDesignTokenContext) {
|
47
47
|
var ThemeProvider = require("@modern-js/runtime/styled").ThemeProvider;
|
48
48
|
return /* @__PURE__ */ jsx(ThemeProvider, {
|
@@ -80,7 +80,7 @@ var getTailwindConfig = function(tailwindVersion, tailwindcss, designSystem) {
|
|
80
80
|
};
|
81
81
|
var tailwindConfig = applyOptionsChain(defaultTailwindConfig, tailwindcss || {});
|
82
82
|
var designSystemConfig = getPureDesignSystemConfig(designSystem !== null && designSystem !== void 0 ? designSystem : {});
|
83
|
-
var
|
83
|
+
var _checkIfExistNotAllowKeys = _slicedToArray(checkIfExistNotAllowKeys(tailwindConfig), 2), exist = _checkIfExistNotAllowKeys[0], key = _checkIfExistNotAllowKeys[1];
|
84
84
|
if (exist) {
|
85
85
|
logger.error("should not exist '".concat(key, "' on tools.tailwindcss, please remove it"));
|
86
86
|
process.exit(0);
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "2.4.0",
|
14
|
+
"version": "2.4.1-beta.0",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/types/index.d.ts",
|
17
17
|
"main": "./dist/js/node/index.js",
|
@@ -46,7 +46,7 @@
|
|
46
46
|
"@babel/runtime": "^7.18.0",
|
47
47
|
"babel-plugin-macros": "3.1.0",
|
48
48
|
"hoist-non-react-statics": "^3.3.2",
|
49
|
-
"@modern-js/utils": "2.4.0"
|
49
|
+
"@modern-js/utils": "2.4.1-beta.0"
|
50
50
|
},
|
51
51
|
"devDependencies": {
|
52
52
|
"@types/jest": "^27",
|
@@ -56,17 +56,17 @@
|
|
56
56
|
"jest": "^27",
|
57
57
|
"react": "^18",
|
58
58
|
"postcss": "8.4.21",
|
59
|
-
"@modern-js/core": "2.4.0",
|
60
|
-
"@modern-js/module-tools": "2.
|
61
|
-
"@modern-js/runtime": "2.4.0",
|
59
|
+
"@modern-js/core": "2.4.1-beta.0",
|
60
|
+
"@modern-js/module-tools": "2.5.0-beta.0",
|
61
|
+
"@modern-js/runtime": "2.4.1-beta.0",
|
62
62
|
"@modern-js/types": "2.4.0",
|
63
63
|
"@scripts/build": "2.4.0",
|
64
|
-
"@modern-js/app-tools": "
|
64
|
+
"@modern-js/app-tools": "3.0.0-beta.0",
|
65
65
|
"@scripts/jest-config": "2.4.0"
|
66
66
|
},
|
67
67
|
"peerDependencies": {
|
68
68
|
"tailwindcss": ">= 2.0.0 || >= 3.0.0",
|
69
|
-
"@modern-js/runtime": "^2.4.0"
|
69
|
+
"@modern-js/runtime": "^2.4.1-beta.0"
|
70
70
|
},
|
71
71
|
"peerDependenciesMeta": {
|
72
72
|
"@modern-js/runtime": {
|