@modern-js/plugin-tailwindcss 2.5.0 → 2.7.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 +31 -0
- package/dist/cjs/cli.js +8 -0
- package/dist/cjs/design-token/cli/index.js +6 -1
- package/dist/cjs/design-token/index.js +4 -0
- package/dist/cjs/design-token/runtime/index.js +4 -0
- package/dist/cjs/design-token/runtime/plugin.js +8 -24
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/tailwind.js +2 -0
- package/dist/cjs/utils.js +4 -0
- package/dist/esm/cli.js +4 -0
- package/dist/esm/design-token/cli/index.js +2 -1
- package/dist/esm/tailwind.js +2 -0
- package/dist/esm-node/cli.js +4 -0
- package/dist/esm-node/design-token/cli/index.js +6 -1
- package/dist/esm-node/design-token/runtime/plugin.js +4 -24
- package/dist/esm-node/tailwind.js +2 -0
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,36 @@
|
|
1
1
|
# @modern-js/plugin-tailwindcss
|
2
2
|
|
3
|
+
## 2.7.0
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 7fff9020e1: chore: make file naming consistent
|
8
|
+
|
9
|
+
chore: 统一文件命名为小驼峰格式
|
10
|
+
|
11
|
+
- Updated dependencies [0f15fc597c]
|
12
|
+
- Updated dependencies [dcad887024]
|
13
|
+
- Updated dependencies [a4672f7c16]
|
14
|
+
- Updated dependencies [7fff9020e1]
|
15
|
+
- Updated dependencies [1eea234fdd]
|
16
|
+
- Updated dependencies [84bfb439b8]
|
17
|
+
- @modern-js/utils@2.7.0
|
18
|
+
- @modern-js/runtime@2.7.0
|
19
|
+
|
20
|
+
## 2.6.0
|
21
|
+
|
22
|
+
### Patch Changes
|
23
|
+
|
24
|
+
- Updated dependencies [671477d]
|
25
|
+
- Updated dependencies [e1f799e]
|
26
|
+
- Updated dependencies [7915ab3]
|
27
|
+
- Updated dependencies [a909ad1]
|
28
|
+
- Updated dependencies [49fa0b1]
|
29
|
+
- Updated dependencies [0fe658a]
|
30
|
+
- Updated dependencies [1906d7b]
|
31
|
+
- @modern-js/runtime@2.6.0
|
32
|
+
- @modern-js/utils@2.6.0
|
33
|
+
|
3
34
|
## 2.5.0
|
4
35
|
|
5
36
|
### Patch Changes
|
package/dist/cjs/cli.js
CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
return to;
|
18
18
|
};
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
25
|
mod
|
22
26
|
));
|
@@ -45,6 +49,7 @@ var cli_default = ({ pluginName } = {
|
|
45
49
|
pluginName: "@modern-js/plugin-tailwindcss"
|
46
50
|
}) => ({
|
47
51
|
name: "@modern-js/plugin-tailwindcss",
|
52
|
+
// support designSystem.supportStyledComponents
|
48
53
|
usePlugins: [
|
49
54
|
(0, import_cli.default)({
|
50
55
|
pluginName
|
@@ -64,6 +69,7 @@ var cli_default = ({ pluginName } = {
|
|
64
69
|
"./src/**/*.jsx",
|
65
70
|
"./src/**/*.ts",
|
66
71
|
"./src/**/*.tsx",
|
72
|
+
// about storybook
|
67
73
|
"./storybook/**/*"
|
68
74
|
];
|
69
75
|
return {
|
@@ -112,6 +118,8 @@ var cli_default = ({ pluginName } = {
|
|
112
118
|
};
|
113
119
|
return {
|
114
120
|
tools: {
|
121
|
+
// TODO: Add interface about postcss config
|
122
|
+
// TODO: In module project, also is called, but should not be called.
|
115
123
|
postcss: (config) => {
|
116
124
|
initTailwindConfig();
|
117
125
|
const tailwindPlugin = require(tailwindPath)(tailwindConfig);
|
@@ -51,7 +51,12 @@ var cli_default = ({ pluginName } = { pluginName: "@modern-js/plugin-tailwindcss
|
|
51
51
|
"@modern-js/runtime/plugins": pluginsExportsUtils.getPath()
|
52
52
|
}
|
53
53
|
},
|
54
|
-
tools: {
|
54
|
+
tools: {
|
55
|
+
// TODO: support less、scss、css vars
|
56
|
+
// less: https://github.com/modern-js-dev/modern.js/pull/398/files#diff-f77c749e403fbf1fb676d5687bef3d7138a230331c849298d8afaff9b6afbc3dR166
|
57
|
+
// sass: https://github.com/modern-js-dev/modern.js/pull/398/files#diff-f77c749e403fbf1fb676d5687bef3d7138a230331c849298d8afaff9b6afbc3dR229
|
58
|
+
// postcss: https://github.com/modern-js-dev/modern.js/pull/398/files#diff-f77c749e403fbf1fb676d5687bef3d7138a230331c849298d8afaff9b6afbc3dR281
|
59
|
+
}
|
55
60
|
};
|
56
61
|
},
|
57
62
|
modifyEntryImports({ entrypoint, imports }) {
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
18
18
|
};
|
19
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
22
26
|
mod
|
23
27
|
));
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
18
18
|
};
|
19
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
22
26
|
mod
|
23
27
|
));
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
return to;
|
18
18
|
};
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
25
|
mod
|
22
26
|
));
|
@@ -45,34 +49,14 @@ var plugin_default = (options = {}) => ({
|
|
45
49
|
} = options;
|
46
50
|
if (useStyledComponentsThemeProvider && useDesignTokenContext) {
|
47
51
|
const { ThemeProvider } = require("@modern-js/runtime/styled");
|
48
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeProvider, {
|
49
|
-
theme: token,
|
50
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DesignTokenContext.Provider, {
|
51
|
-
value: token,
|
52
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
53
|
-
...props
|
54
|
-
})
|
55
|
-
})
|
56
|
-
});
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeProvider, { theme: token, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DesignTokenContext.Provider, { value: token, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { ...props }) }) });
|
57
53
|
} else if (useStyledComponentsThemeProvider) {
|
58
54
|
const { ThemeProvider } = require("@modern-js/runtime/styled");
|
59
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeProvider, {
|
60
|
-
theme: token,
|
61
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
62
|
-
...props
|
63
|
-
})
|
64
|
-
});
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeProvider, { theme: token, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { ...props }) });
|
65
56
|
} else if (useDesignTokenContext) {
|
66
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DesignTokenContext.Provider, {
|
67
|
-
value: token,
|
68
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
69
|
-
...props
|
70
|
-
})
|
71
|
-
});
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DesignTokenContext.Provider, { value: token, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { ...props }) });
|
72
58
|
} else {
|
73
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
74
|
-
...props
|
75
|
-
});
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { ...props });
|
76
60
|
}
|
77
61
|
};
|
78
62
|
return next({
|
package/dist/cjs/index.js
CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
return to;
|
18
18
|
};
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
25
|
mod
|
22
26
|
));
|
package/dist/cjs/tailwind.js
CHANGED
@@ -38,7 +38,9 @@ const getPureDesignSystemConfig = (designSystemConfig) => {
|
|
38
38
|
const getTailwindConfig = (tailwindVersion, tailwindcss, designSystem, option = {}) => {
|
39
39
|
const purgeConfig = (0, import_lodash.merge)(
|
40
40
|
{
|
41
|
+
// TODO: how the operating environment is determined
|
41
42
|
enabled: process.env.NODE_ENV === "production",
|
43
|
+
// TODO: Remove or not
|
42
44
|
layers: ["utilities"],
|
43
45
|
content: []
|
44
46
|
},
|
package/dist/cjs/utils.js
CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
return to;
|
18
18
|
};
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
25
|
mod
|
22
26
|
));
|
package/dist/esm/cli.js
CHANGED
@@ -137,6 +137,7 @@ var cli_default = function() {
|
|
137
137
|
}).pluginName;
|
138
138
|
return {
|
139
139
|
name: "@modern-js/plugin-tailwindcss",
|
140
|
+
// support designSystem.supportStyledComponents
|
140
141
|
usePlugins: [
|
141
142
|
designTokenPlugin({
|
142
143
|
pluginName: pluginName
|
@@ -166,6 +167,7 @@ var cli_default = function() {
|
|
166
167
|
"./src/**/*.jsx",
|
167
168
|
"./src/**/*.ts",
|
168
169
|
"./src/**/*.tsx",
|
170
|
+
// about storybook
|
169
171
|
"./storybook/**/*"
|
170
172
|
];
|
171
173
|
return [
|
@@ -205,6 +207,8 @@ var cli_default = function() {
|
|
205
207
|
};
|
206
208
|
return {
|
207
209
|
tools: {
|
210
|
+
// TODO: Add interface about postcss config
|
211
|
+
// TODO: In module project, also is called, but should not be called.
|
208
212
|
postcss: function(config) {
|
209
213
|
initTailwindConfig();
|
210
214
|
var tailwindPlugin = require(tailwindPath)(tailwindConfig);
|
package/dist/esm/tailwind.js
CHANGED
@@ -67,7 +67,9 @@ var getPureDesignSystemConfig = function(designSystemConfig) {
|
|
67
67
|
var getTailwindConfig = function(tailwindVersion, tailwindcss, designSystem) {
|
68
68
|
var option = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
69
69
|
var purgeConfig = merge({
|
70
|
+
// TODO: how the operating environment is determined
|
70
71
|
enabled: process.env.NODE_ENV === "production",
|
72
|
+
// TODO: Remove or not
|
71
73
|
layers: [
|
72
74
|
"utilities"
|
73
75
|
],
|
package/dist/esm-node/cli.js
CHANGED
@@ -29,6 +29,7 @@ var cli_default = ({ pluginName } = {
|
|
29
29
|
pluginName: "@modern-js/plugin-tailwindcss"
|
30
30
|
}) => ({
|
31
31
|
name: "@modern-js/plugin-tailwindcss",
|
32
|
+
// support designSystem.supportStyledComponents
|
32
33
|
usePlugins: [
|
33
34
|
designTokenPlugin({
|
34
35
|
pluginName
|
@@ -48,6 +49,7 @@ var cli_default = ({ pluginName } = {
|
|
48
49
|
"./src/**/*.jsx",
|
49
50
|
"./src/**/*.ts",
|
50
51
|
"./src/**/*.tsx",
|
52
|
+
// about storybook
|
51
53
|
"./storybook/**/*"
|
52
54
|
];
|
53
55
|
return {
|
@@ -96,6 +98,8 @@ var cli_default = ({ pluginName } = {
|
|
96
98
|
};
|
97
99
|
return {
|
98
100
|
tools: {
|
101
|
+
// TODO: Add interface about postcss config
|
102
|
+
// TODO: In module project, also is called, but should not be called.
|
99
103
|
postcss: (config) => {
|
100
104
|
initTailwindConfig();
|
101
105
|
const tailwindPlugin = require(tailwindPath)(tailwindConfig);
|
@@ -33,7 +33,12 @@ var cli_default = ({ pluginName } = { pluginName: "@modern-js/plugin-tailwindcss
|
|
33
33
|
"@modern-js/runtime/plugins": pluginsExportsUtils.getPath()
|
34
34
|
}
|
35
35
|
},
|
36
|
-
tools: {
|
36
|
+
tools: {
|
37
|
+
// TODO: support less、scss、css vars
|
38
|
+
// less: https://github.com/modern-js-dev/modern.js/pull/398/files#diff-f77c749e403fbf1fb676d5687bef3d7138a230331c849298d8afaff9b6afbc3dR166
|
39
|
+
// sass: https://github.com/modern-js-dev/modern.js/pull/398/files#diff-f77c749e403fbf1fb676d5687bef3d7138a230331c849298d8afaff9b6afbc3dR229
|
40
|
+
// postcss: https://github.com/modern-js-dev/modern.js/pull/398/files#diff-f77c749e403fbf1fb676d5687bef3d7138a230331c849298d8afaff9b6afbc3dR281
|
41
|
+
}
|
37
42
|
};
|
38
43
|
},
|
39
44
|
modifyEntryImports({ entrypoint, imports }) {
|
@@ -15,34 +15,14 @@ var plugin_default = (options = {}) => ({
|
|
15
15
|
} = options;
|
16
16
|
if (useStyledComponentsThemeProvider && useDesignTokenContext) {
|
17
17
|
const { ThemeProvider } = require("@modern-js/runtime/styled");
|
18
|
-
return /* @__PURE__ */ jsx(ThemeProvider, {
|
19
|
-
theme: token,
|
20
|
-
children: /* @__PURE__ */ jsx(DesignTokenContext.Provider, {
|
21
|
-
value: token,
|
22
|
-
children: /* @__PURE__ */ jsx(App, {
|
23
|
-
...props
|
24
|
-
})
|
25
|
-
})
|
26
|
-
});
|
18
|
+
return /* @__PURE__ */ jsx(ThemeProvider, { theme: token, children: /* @__PURE__ */ jsx(DesignTokenContext.Provider, { value: token, children: /* @__PURE__ */ jsx(App, { ...props }) }) });
|
27
19
|
} else if (useStyledComponentsThemeProvider) {
|
28
20
|
const { ThemeProvider } = require("@modern-js/runtime/styled");
|
29
|
-
return /* @__PURE__ */ jsx(ThemeProvider, {
|
30
|
-
theme: token,
|
31
|
-
children: /* @__PURE__ */ jsx(App, {
|
32
|
-
...props
|
33
|
-
})
|
34
|
-
});
|
21
|
+
return /* @__PURE__ */ jsx(ThemeProvider, { theme: token, children: /* @__PURE__ */ jsx(App, { ...props }) });
|
35
22
|
} else if (useDesignTokenContext) {
|
36
|
-
return /* @__PURE__ */ jsx(DesignTokenContext.Provider, {
|
37
|
-
value: token,
|
38
|
-
children: /* @__PURE__ */ jsx(App, {
|
39
|
-
...props
|
40
|
-
})
|
41
|
-
});
|
23
|
+
return /* @__PURE__ */ jsx(DesignTokenContext.Provider, { value: token, children: /* @__PURE__ */ jsx(App, { ...props }) });
|
42
24
|
} else {
|
43
|
-
return /* @__PURE__ */ jsx(App, {
|
44
|
-
...props
|
45
|
-
});
|
25
|
+
return /* @__PURE__ */ jsx(App, { ...props });
|
46
26
|
}
|
47
27
|
};
|
48
28
|
return next({
|
@@ -16,7 +16,9 @@ const getPureDesignSystemConfig = (designSystemConfig) => {
|
|
16
16
|
const getTailwindConfig = (tailwindVersion, tailwindcss, designSystem, option = {}) => {
|
17
17
|
const purgeConfig = merge(
|
18
18
|
{
|
19
|
+
// TODO: how the operating environment is determined
|
19
20
|
enabled: process.env.NODE_ENV === "production",
|
21
|
+
// TODO: Remove or not
|
20
22
|
layers: ["utilities"],
|
21
23
|
content: []
|
22
24
|
},
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "2.
|
14
|
+
"version": "2.7.0",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/types/index.d.ts",
|
17
17
|
"main": "./dist/cjs/index.js",
|
@@ -45,7 +45,7 @@
|
|
45
45
|
"@babel/runtime": "^7.18.0",
|
46
46
|
"babel-plugin-macros": "3.1.0",
|
47
47
|
"hoist-non-react-statics": "^3.3.2",
|
48
|
-
"@modern-js/utils": "2.
|
48
|
+
"@modern-js/utils": "2.7.0"
|
49
49
|
},
|
50
50
|
"devDependencies": {
|
51
51
|
"@types/jest": "^27",
|
@@ -55,17 +55,17 @@
|
|
55
55
|
"jest": "^27",
|
56
56
|
"react": "^18",
|
57
57
|
"postcss": "8.4.21",
|
58
|
-
"@modern-js/core": "2.
|
59
|
-
"@modern-js/
|
60
|
-
"@modern-js/
|
61
|
-
"@modern-js/types": "2.
|
62
|
-
"@scripts/build": "2.
|
63
|
-
"@modern-js/app-tools": "2.
|
64
|
-
"@scripts/jest-config": "2.
|
58
|
+
"@modern-js/core": "2.7.0",
|
59
|
+
"@modern-js/module-tools": "2.7.0",
|
60
|
+
"@modern-js/runtime": "2.7.0",
|
61
|
+
"@modern-js/types": "2.7.0",
|
62
|
+
"@scripts/build": "2.7.0",
|
63
|
+
"@modern-js/app-tools": "2.7.0",
|
64
|
+
"@scripts/jest-config": "2.7.0"
|
65
65
|
},
|
66
66
|
"peerDependencies": {
|
67
67
|
"tailwindcss": ">= 2.0.0 || >= 3.0.0",
|
68
|
-
"@modern-js/runtime": "^2.
|
68
|
+
"@modern-js/runtime": "^2.7.0"
|
69
69
|
},
|
70
70
|
"peerDependenciesMeta": {
|
71
71
|
"@modern-js/runtime": {
|