@modern-js/plugin-tailwindcss 1.5.0 → 1.16.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 +42 -0
- package/dist/js/modern/cli.js +8 -2
- package/dist/js/modern/design-token/cli/index.js +6 -2
- package/dist/js/node/cli.js +8 -2
- package/dist/js/node/design-token/cli/index.js +6 -2
- package/dist/js/treeshaking/cli.js +8 -1
- package/dist/js/treeshaking/design-token/cli/index.js +16 -11
- package/dist/types/cli.d.ts +5 -1
- package/dist/types/design-token/cli/index.d.ts +5 -1
- package/package.json +8 -9
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,47 @@
|
|
1
1
|
# @modern-js/plugin-tailwindcss
|
2
2
|
|
3
|
+
## 1.16.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- 1100dd58c: chore: support react 18
|
8
|
+
|
9
|
+
chore: 支持 React 18
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- Updated dependencies [641592f52]
|
14
|
+
- Updated dependencies [3904b30a5]
|
15
|
+
- Updated dependencies [1100dd58c]
|
16
|
+
- Updated dependencies [a480d6ad0]
|
17
|
+
- Updated dependencies [e04e6e76a]
|
18
|
+
- Updated dependencies [81c66e4a4]
|
19
|
+
- Updated dependencies [2c305b6f5]
|
20
|
+
- @modern-js/utils@1.16.0
|
21
|
+
- @modern-js/runtime@1.16.0
|
22
|
+
|
23
|
+
## 1.15.0
|
24
|
+
|
25
|
+
### Patch Changes
|
26
|
+
|
27
|
+
- Updated dependencies [8658a78]
|
28
|
+
- Updated dependencies [335c97c]
|
29
|
+
- Updated dependencies [05d4a4f]
|
30
|
+
- Updated dependencies [ad05af9]
|
31
|
+
- Updated dependencies [5d53d1c]
|
32
|
+
- Updated dependencies [37cd159]
|
33
|
+
- Updated dependencies [a04a11b]
|
34
|
+
- @modern-js/utils@1.15.0
|
35
|
+
- @modern-js/runtime@1.15.0
|
36
|
+
|
37
|
+
## 1.5.1
|
38
|
+
|
39
|
+
### Patch Changes
|
40
|
+
|
41
|
+
- 3c874ca16: fix: `@modern-js/plugin-tailwindcss` support `pluginName` params
|
42
|
+
|
43
|
+
fix: `@modern-js/plugin-tailwindcss` 支持 `pluginName` 参数
|
44
|
+
|
3
45
|
## 1.5.0
|
4
46
|
|
5
47
|
### Minor Changes
|
package/dist/js/modern/cli.js
CHANGED
@@ -13,10 +13,16 @@ const supportCssInJsLibrary = 'styled-components';
|
|
13
13
|
export const getRandomTwConfigFileName = internalDirectory => {
|
14
14
|
return slash(path.join(internalDirectory, `tailwind.config.${Date.now()}.${nanoid()}.js`));
|
15
15
|
};
|
16
|
-
export default ((
|
16
|
+
export default (({
|
17
|
+
pluginName
|
18
|
+
} = {
|
19
|
+
pluginName: '@modern-js/plugin-tailwindcss'
|
20
|
+
}) => ({
|
17
21
|
name: '@modern-js/plugin-tailwindcss',
|
18
22
|
// support designSystem.supportStyledComponents
|
19
|
-
usePlugins: [DesignTokenPlugin(
|
23
|
+
usePlugins: [DesignTokenPlugin({
|
24
|
+
pluginName
|
25
|
+
})],
|
20
26
|
setup: async api => {
|
21
27
|
const {
|
22
28
|
appDirectory,
|
@@ -5,7 +5,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
5
5
|
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; }
|
6
6
|
|
7
7
|
import { lazyImport, PLUGIN_SCHEMAS, createRuntimeExportsUtils } from '@modern-js/utils';
|
8
|
-
export default ((
|
8
|
+
export default (({
|
9
|
+
pluginName
|
10
|
+
} = {
|
11
|
+
pluginName: '@modern-js/plugin-tailwindcss'
|
12
|
+
}) => ({
|
9
13
|
name: '@modern-js/plugin-design-token',
|
10
14
|
|
11
15
|
setup(api) {
|
@@ -118,7 +122,7 @@ export default (() => ({
|
|
118
122
|
},
|
119
123
|
|
120
124
|
addRuntimeExports() {
|
121
|
-
pluginsExportsUtils.addExport(`export { default as designToken } from '
|
125
|
+
pluginsExportsUtils.addExport(`export { default as designToken } from '${pluginName}/runtime-design-token'`);
|
122
126
|
}
|
123
127
|
|
124
128
|
};
|
package/dist/js/node/cli.js
CHANGED
@@ -31,10 +31,16 @@ const getRandomTwConfigFileName = internalDirectory => {
|
|
31
31
|
|
32
32
|
exports.getRandomTwConfigFileName = getRandomTwConfigFileName;
|
33
33
|
|
34
|
-
var _default = (
|
34
|
+
var _default = ({
|
35
|
+
pluginName
|
36
|
+
} = {
|
37
|
+
pluginName: '@modern-js/plugin-tailwindcss'
|
38
|
+
}) => ({
|
35
39
|
name: '@modern-js/plugin-tailwindcss',
|
36
40
|
// support designSystem.supportStyledComponents
|
37
|
-
usePlugins: [(0, _cli.default)(
|
41
|
+
usePlugins: [(0, _cli.default)({
|
42
|
+
pluginName
|
43
|
+
})],
|
38
44
|
setup: async api => {
|
39
45
|
const {
|
40
46
|
appDirectory,
|
@@ -13,7 +13,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
13
13
|
|
14
14
|
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
15
|
|
16
|
-
var _default = (
|
16
|
+
var _default = ({
|
17
|
+
pluginName
|
18
|
+
} = {
|
19
|
+
pluginName: '@modern-js/plugin-tailwindcss'
|
20
|
+
}) => ({
|
17
21
|
name: '@modern-js/plugin-design-token',
|
18
22
|
|
19
23
|
setup(api) {
|
@@ -126,7 +130,7 @@ var _default = () => ({
|
|
126
130
|
},
|
127
131
|
|
128
132
|
addRuntimeExports() {
|
129
|
-
pluginsExportsUtils.addExport(`export { default as designToken } from '
|
133
|
+
pluginsExportsUtils.addExport(`export { default as designToken } from '${pluginName}/runtime-design-token'`);
|
130
134
|
}
|
131
135
|
|
132
136
|
};
|
@@ -11,10 +11,17 @@ export var getRandomTwConfigFileName = function getRandomTwConfigFileName(intern
|
|
11
11
|
return slash(path.join(internalDirectory, "tailwind.config.".concat(Date.now(), ".").concat(nanoid(), ".js")));
|
12
12
|
};
|
13
13
|
export default (function () {
|
14
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
15
|
+
pluginName: '@modern-js/plugin-tailwindcss'
|
16
|
+
},
|
17
|
+
pluginName = _ref.pluginName;
|
18
|
+
|
14
19
|
return {
|
15
20
|
name: '@modern-js/plugin-tailwindcss',
|
16
21
|
// support designSystem.supportStyledComponents
|
17
|
-
usePlugins: [DesignTokenPlugin(
|
22
|
+
usePlugins: [DesignTokenPlugin({
|
23
|
+
pluginName: pluginName
|
24
|
+
})],
|
18
25
|
setup: function () {
|
19
26
|
var _setup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(api) {
|
20
27
|
var _api$useAppContext, appDirectory, internalDirectory, internalTwConfigPath, notHaveTwinMacro;
|
@@ -2,6 +2,11 @@ import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3
3
|
import { lazyImport, PLUGIN_SCHEMAS, createRuntimeExportsUtils } from '@modern-js/utils';
|
4
4
|
export default (function () {
|
5
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
6
|
+
pluginName: '@modern-js/plugin-tailwindcss'
|
7
|
+
},
|
8
|
+
pluginName = _ref.pluginName;
|
9
|
+
|
5
10
|
return {
|
6
11
|
name: '@modern-js/plugin-design-token',
|
7
12
|
setup: function setup(api) {
|
@@ -10,8 +15,8 @@ export default (function () {
|
|
10
15
|
var PLUGIN_IDENTIFIER = 'designToken';
|
11
16
|
|
12
17
|
var getDesignTokens = function getDesignTokens(userConfig) {
|
13
|
-
var
|
14
|
-
designSystem =
|
18
|
+
var _ref2 = userConfig,
|
19
|
+
designSystem = _ref2.source.designSystem; // TODO: Type to be filled
|
15
20
|
|
16
21
|
var tailwindcssConfig = {};
|
17
22
|
tailwindcssConfig.theme = designSystem ? _objectSpread({}, designSystem) : {}; // not use default design token when designToken.defaultTheme is false or theme is false
|
@@ -45,9 +50,9 @@ export default (function () {
|
|
45
50
|
}
|
46
51
|
};
|
47
52
|
},
|
48
|
-
modifyEntryImports: function modifyEntryImports(
|
49
|
-
var entrypoint =
|
50
|
-
imports =
|
53
|
+
modifyEntryImports: function modifyEntryImports(_ref3) {
|
54
|
+
var entrypoint = _ref3.entrypoint,
|
55
|
+
imports = _ref3.imports;
|
51
56
|
var userConfig = api.useResolvedConfigContext();
|
52
57
|
var designSystem = userConfig.source.designSystem;
|
53
58
|
|
@@ -67,12 +72,12 @@ export default (function () {
|
|
67
72
|
imports: imports
|
68
73
|
};
|
69
74
|
},
|
70
|
-
modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(
|
71
|
-
var entrypoint =
|
72
|
-
plugins =
|
75
|
+
modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(_ref4) {
|
76
|
+
var entrypoint = _ref4.entrypoint,
|
77
|
+
plugins = _ref4.plugins;
|
73
78
|
|
74
|
-
var
|
75
|
-
designSystem =
|
79
|
+
var _ref5 = api.useResolvedConfigContext(),
|
80
|
+
designSystem = _ref5.source.designSystem;
|
76
81
|
|
77
82
|
var useSCThemeProvider = true;
|
78
83
|
|
@@ -98,7 +103,7 @@ export default (function () {
|
|
98
103
|
return PLUGIN_SCHEMAS['@modern-js/plugin-design-token'];
|
99
104
|
},
|
100
105
|
addRuntimeExports: function addRuntimeExports() {
|
101
|
-
pluginsExportsUtils.addExport("export { default as designToken } from '
|
106
|
+
pluginsExportsUtils.addExport("export { default as designToken } from '".concat(pluginName, "/runtime-design-token'"));
|
102
107
|
}
|
103
108
|
};
|
104
109
|
}
|
package/dist/types/cli.d.ts
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
import type { CliPlugin } from '@modern-js/core';
|
2
2
|
export declare const getRandomTwConfigFileName: (internalDirectory: string) => string;
|
3
3
|
|
4
|
-
declare const _default: (
|
4
|
+
declare const _default: ({
|
5
|
+
pluginName
|
6
|
+
}?: {
|
7
|
+
pluginName: string;
|
8
|
+
}) => CliPlugin;
|
5
9
|
|
6
10
|
export default _default;
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "1.
|
14
|
+
"version": "1.16.0",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/types/index.d.ts",
|
17
17
|
"main": "./dist/js/node/index.js",
|
@@ -44,13 +44,13 @@
|
|
44
44
|
},
|
45
45
|
"dependencies": {
|
46
46
|
"@babel/runtime": "^7.18.0",
|
47
|
-
"@modern-js/utils": "
|
47
|
+
"@modern-js/utils": "1.16.0",
|
48
48
|
"hoist-non-react-statics": "^3.3.2"
|
49
49
|
},
|
50
50
|
"devDependencies": {
|
51
|
-
"@modern-js/core": "1.
|
52
|
-
"@modern-js/runtime": "1.
|
53
|
-
"@scripts/build": "
|
51
|
+
"@modern-js/core": "1.16.0",
|
52
|
+
"@modern-js/runtime": "1.16.0",
|
53
|
+
"@scripts/build": "1.15.0",
|
54
54
|
"@types/jest": "^27",
|
55
55
|
"@types/node": "^14",
|
56
56
|
"@types/tailwindcss": "^2.2.1",
|
@@ -59,13 +59,12 @@
|
|
59
59
|
"jest": "^27",
|
60
60
|
"react": "^17.0.2",
|
61
61
|
"postcss": "^8.4.14",
|
62
|
-
"@scripts/jest-config": "
|
63
|
-
"@types/hoist-non-react-statics": "^3.3.1"
|
64
|
-
"@types/react": "^17"
|
62
|
+
"@scripts/jest-config": "1.15.0",
|
63
|
+
"@types/hoist-non-react-statics": "^3.3.1"
|
65
64
|
},
|
66
65
|
"peerDependencies": {
|
67
66
|
"tailwindcss": "^2.0.4",
|
68
|
-
"@modern-js/runtime": "^1.
|
67
|
+
"@modern-js/runtime": "^1.16.0"
|
69
68
|
},
|
70
69
|
"peerDependenciesMeta": {
|
71
70
|
"@modern-js/runtime": {
|