@modern-js/plugin-tailwindcss 1.5.0 → 1.5.1
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 -0
- package/dist/js/modern/cli.js +8 -2
- package/dist/js/modern/design-token/cli/index.js +4 -2
- package/dist/js/node/cli.js +8 -2
- package/dist/js/node/design-token/cli/index.js +4 -2
- package/dist/js/treeshaking/cli.js +8 -1
- package/dist/js/treeshaking/design-token/cli/index.js +13 -12
- package/dist/types/cli.d.ts +5 -1
- package/dist/types/design-token/cli/index.d.ts +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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,9 @@ 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
|
+
}) => ({
|
9
11
|
name: '@modern-js/plugin-design-token',
|
10
12
|
|
11
13
|
setup(api) {
|
@@ -118,7 +120,7 @@ export default (() => ({
|
|
118
120
|
},
|
119
121
|
|
120
122
|
addRuntimeExports() {
|
121
|
-
pluginsExportsUtils.addExport(`export { default as designToken } from '
|
123
|
+
pluginsExportsUtils.addExport(`export { default as designToken } from '${pluginName}/runtime-design-token'`);
|
122
124
|
}
|
123
125
|
|
124
126
|
};
|
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,9 @@ 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
|
+
}) => ({
|
17
19
|
name: '@modern-js/plugin-design-token',
|
18
20
|
|
19
21
|
setup(api) {
|
@@ -126,7 +128,7 @@ var _default = () => ({
|
|
126
128
|
},
|
127
129
|
|
128
130
|
addRuntimeExports() {
|
129
|
-
pluginsExportsUtils.addExport(`export { default as designToken } from '
|
131
|
+
pluginsExportsUtils.addExport(`export { default as designToken } from '${pluginName}/runtime-design-token'`);
|
130
132
|
}
|
131
133
|
|
132
134
|
};
|
@@ -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;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
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
|
-
export default (function () {
|
4
|
+
export default (function (_ref) {
|
5
|
+
var pluginName = _ref.pluginName;
|
5
6
|
return {
|
6
7
|
name: '@modern-js/plugin-design-token',
|
7
8
|
setup: function setup(api) {
|
@@ -10,8 +11,8 @@ export default (function () {
|
|
10
11
|
var PLUGIN_IDENTIFIER = 'designToken';
|
11
12
|
|
12
13
|
var getDesignTokens = function getDesignTokens(userConfig) {
|
13
|
-
var
|
14
|
-
designSystem =
|
14
|
+
var _ref2 = userConfig,
|
15
|
+
designSystem = _ref2.source.designSystem; // TODO: Type to be filled
|
15
16
|
|
16
17
|
var tailwindcssConfig = {};
|
17
18
|
tailwindcssConfig.theme = designSystem ? _objectSpread({}, designSystem) : {}; // not use default design token when designToken.defaultTheme is false or theme is false
|
@@ -45,9 +46,9 @@ export default (function () {
|
|
45
46
|
}
|
46
47
|
};
|
47
48
|
},
|
48
|
-
modifyEntryImports: function modifyEntryImports(
|
49
|
-
var entrypoint =
|
50
|
-
imports =
|
49
|
+
modifyEntryImports: function modifyEntryImports(_ref3) {
|
50
|
+
var entrypoint = _ref3.entrypoint,
|
51
|
+
imports = _ref3.imports;
|
51
52
|
var userConfig = api.useResolvedConfigContext();
|
52
53
|
var designSystem = userConfig.source.designSystem;
|
53
54
|
|
@@ -67,12 +68,12 @@ export default (function () {
|
|
67
68
|
imports: imports
|
68
69
|
};
|
69
70
|
},
|
70
|
-
modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(
|
71
|
-
var entrypoint =
|
72
|
-
plugins =
|
71
|
+
modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(_ref4) {
|
72
|
+
var entrypoint = _ref4.entrypoint,
|
73
|
+
plugins = _ref4.plugins;
|
73
74
|
|
74
|
-
var
|
75
|
-
designSystem =
|
75
|
+
var _ref5 = api.useResolvedConfigContext(),
|
76
|
+
designSystem = _ref5.source.designSystem;
|
76
77
|
|
77
78
|
var useSCThemeProvider = true;
|
78
79
|
|
@@ -98,7 +99,7 @@ export default (function () {
|
|
98
99
|
return PLUGIN_SCHEMAS['@modern-js/plugin-design-token'];
|
99
100
|
},
|
100
101
|
addRuntimeExports: function addRuntimeExports() {
|
101
|
-
pluginsExportsUtils.addExport("export { default as designToken } from '
|
102
|
+
pluginsExportsUtils.addExport("export { default as designToken } from '".concat(pluginName, "/runtime-design-token'"));
|
102
103
|
}
|
103
104
|
};
|
104
105
|
}
|
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;
|