@modern-js/plugin-tailwindcss 0.0.0-next-20230201182715 → 0.0.0-next-20230202034424
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 +7 -7
- 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 +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# @modern-js/plugin-tailwindcss
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-20230202034424
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Updated dependencies [
|
|
8
|
-
- Updated dependencies [
|
|
9
|
-
- Updated dependencies [
|
|
10
|
-
- Updated dependencies [
|
|
11
|
-
- @modern-js/utils@0.0.0-next-
|
|
12
|
-
- @modern-js/runtime@0.0.0-next-
|
|
7
|
+
- Updated dependencies [fd5a3ed020]
|
|
8
|
+
- Updated dependencies [6ca1c0bb80]
|
|
9
|
+
- Updated dependencies [89b6739e58]
|
|
10
|
+
- Updated dependencies [b4dd017da4]
|
|
11
|
+
- @modern-js/utils@0.0.0-next-20230202034424
|
|
12
|
+
- @modern-js/runtime@0.0.0-next-20230202034424
|
|
13
13
|
|
|
14
14
|
## 2.2.0
|
|
15
15
|
|
|
@@ -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 ref, 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
|
+
ref = api.useAppContext(), appDirectory = ref.appDirectory, internalDirectory = ref.internalDirectory;
|
|
152
152
|
internalTwConfigPath = "";
|
|
153
153
|
return [
|
|
154
154
|
4,
|
|
@@ -191,9 +191,9 @@ var cli_default = function() {
|
|
|
191
191
|
return {
|
|
192
192
|
tools: {
|
|
193
193
|
postcss: function(config) {
|
|
194
|
-
var
|
|
194
|
+
var ref, ref1;
|
|
195
195
|
var modernConfig = api.useResolvedConfigContext();
|
|
196
|
-
var tailwindConfig = getTailwindConfig(tailwindVersion, modernConfig === null || modernConfig === void 0 ? void 0 : (
|
|
196
|
+
var tailwindConfig = getTailwindConfig(tailwindVersion, modernConfig === null || modernConfig === void 0 ? void 0 : (ref = modernConfig.tools) === null || ref === void 0 ? void 0 : ref.tailwindcss, modernConfig === null || modernConfig === void 0 ? void 0 : (ref1 = modernConfig.source) === null || ref1 === void 0 ? void 0 : ref1.designSystem, {
|
|
197
197
|
pureConfig: {
|
|
198
198
|
content: defaultContent
|
|
199
199
|
}
|
|
@@ -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 ref;
|
|
67
67
|
var userConfig = api.useResolvedConfigContext();
|
|
68
|
-
var
|
|
69
|
-
var designSystem = (
|
|
68
|
+
var ref1;
|
|
69
|
+
var designSystem = (ref1 = (ref = userConfig.source) === null || ref === void 0 ? void 0 : ref.designSystem) !== null && ref1 !== void 0 ? ref1 : {};
|
|
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 ref;
|
|
90
90
|
var userConfig = api.useResolvedConfigContext();
|
|
91
|
-
var
|
|
92
|
-
var designSystem = (
|
|
91
|
+
var ref1;
|
|
92
|
+
var designSystem = (ref1 = (ref = userConfig.source) === null || ref === void 0 ? void 0 : ref.designSystem) !== null && ref1 !== void 0 ? ref1 : {};
|
|
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] : {}, _cssVarsHash = ref.cssVarsHash, cssVarsHash = _cssVarsHash === void 0 ? {} : _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 _token = options.token, token = _token === void 0 ? {} : _token, _useStyledComponentsThemeProvider = options.useStyledComponentsThemeProvider, useStyledComponentsThemeProvider = _useStyledComponentsThemeProvider === void 0 ? false : _useStyledComponentsThemeProvider, _useDesignTokenContext = options.useDesignTokenContext, useDesignTokenContext = _useDesignTokenContext === void 0 ? false : _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 ref = _slicedToArray(checkIfExistNotAllowKeys(tailwindConfig), 2), exist = ref[0], key = ref[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": "0.0.0-next-
|
|
14
|
+
"version": "0.0.0-next-20230202034424",
|
|
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": "0.0.0-next-
|
|
49
|
+
"@modern-js/utils": "0.0.0-next-20230202034424"
|
|
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": "0.0.0-next-
|
|
60
|
-
"@modern-js/module-tools": "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-
|
|
59
|
+
"@modern-js/core": "0.0.0-next-20230202034424",
|
|
60
|
+
"@modern-js/module-tools": "0.0.0-next-20230202034424",
|
|
61
|
+
"@modern-js/runtime": "0.0.0-next-20230202034424",
|
|
62
|
+
"@modern-js/types": "0.0.0-next-20230202034424",
|
|
63
|
+
"@scripts/build": "0.0.0-next-20230202034424",
|
|
64
|
+
"@modern-js/app-tools": "0.0.0-next-20230202034424",
|
|
65
|
+
"@scripts/jest-config": "0.0.0-next-20230202034424"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"tailwindcss": ">= 2.0.0 || >= 3.0.0",
|
|
69
|
-
"@modern-js/runtime": "0.0.0-next-
|
|
69
|
+
"@modern-js/runtime": "^0.0.0-next-20230202034424"
|
|
70
70
|
},
|
|
71
71
|
"peerDependenciesMeta": {
|
|
72
72
|
"@modern-js/runtime": {
|