@modern-js/plugin-tailwindcss 2.14.0 → 2.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.
@@ -1,119 +1,118 @@
1
- function _defineProperty(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value: value,
5
- enumerable: true,
6
- configurable: true,
7
- writable: true
8
- });
9
- } else {
10
- obj[key] = value;
11
- }
12
- return obj;
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
13
  }
14
- function _objectSpread(target) {
15
- for(var i = 1; i < arguments.length; i++){
16
- var source = arguments[i] != null ? arguments[i] : {};
17
- var ownKeys = Object.keys(source);
18
- if (typeof Object.getOwnPropertySymbols === "function") {
19
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
- }));
22
- }
23
- ownKeys.forEach(function(key) {
24
- _defineProperty(target, key, source[key]);
25
- });
14
+ function _object_spread(target) {
15
+ for (var i = 1; i < arguments.length; i++) {
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
26
22
  }
27
- return target;
23
+ ownKeys.forEach(function(key) {
24
+ _define_property(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
28
  }
29
29
  import { lazyImport, PLUGIN_SCHEMAS, createRuntimeExportsUtils } from "@modern-js/utils";
30
- var cli_default = function() {
31
- var pluginName = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
32
- pluginName: "@modern-js/plugin-tailwindcss"
33
- }).pluginName;
34
- return {
35
- name: "@modern-js/plugin-design-token",
36
- setup: function setup(api) {
37
- var pluginsExportsUtils;
38
- var resolveConfig = lazyImport("tailwindcss/resolveConfig", require);
39
- var PLUGIN_IDENTIFIER = "designToken";
40
- var getDesignTokens = function(designSystem) {
41
- var tailwindcssConfig = {};
42
- tailwindcssConfig.theme = designSystem ? _objectSpread({}, designSystem) : {};
43
- if (!designSystem) {
44
- tailwindcssConfig.presets = [];
45
- }
46
- if (designSystem) {
47
- delete tailwindcssConfig.theme.supportStyledComponents;
48
- }
49
- return resolveConfig(tailwindcssConfig).theme || {};
50
- };
51
- return {
52
- config: function config() {
53
- var appContext = api.useAppContext();
54
- pluginsExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "plugins");
55
- return {
56
- source: {
57
- alias: {
58
- "@modern-js/runtime/plugins": pluginsExportsUtils.getPath()
59
- }
60
- },
61
- tools: {
62
- }
63
- };
64
- },
65
- modifyEntryImports: function modifyEntryImports(param) {
66
- var entrypoint = param.entrypoint, imports = param.imports;
67
- var _userConfig_source;
68
- var userConfig = api.useResolvedConfigContext();
69
- var _userConfig_source_designSystem;
70
- 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 : {};
71
- if (typeof designSystem === "object" && designSystem.supportStyledComponents) {
72
- var designTokens = getDesignTokens(userConfig.source.designSystem);
73
- imports.push({
74
- value: "@modern-js/runtime/plugins",
75
- specifiers: [
76
- {
77
- imported: PLUGIN_IDENTIFIER
78
- }
79
- ],
80
- initialize: "\n const designTokens = ".concat(JSON.stringify(designTokens), ";\n ")
81
- });
82
- }
83
- return {
84
- entrypoint: entrypoint,
85
- imports: imports
86
- };
87
- },
88
- modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(param) {
89
- var entrypoint = param.entrypoint, plugins = param.plugins;
90
- var _userConfig_source;
91
- var userConfig = api.useResolvedConfigContext();
92
- var _userConfig_source_designSystem;
93
- 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 : {};
94
- var useSCThemeProvider = true;
95
- if (designSystem) {
96
- useSCThemeProvider = (designSystem === null || designSystem === void 0 ? void 0 : designSystem.supportStyledComponents) || false;
97
- }
98
- if (typeof designSystem === "object" && designSystem.supportStyledComponents) {
99
- plugins.push({
100
- name: PLUGIN_IDENTIFIER,
101
- options: "{token: designTokens, useStyledComponentsThemeProvider: ".concat(useSCThemeProvider ? "true" : "false", ", useDesignTokenContext: false}")
102
- });
103
- }
104
- return {
105
- entrypoint: entrypoint,
106
- plugins: plugins
107
- };
108
- },
109
- validateSchema: function validateSchema() {
110
- return PLUGIN_SCHEMAS["@modern-js/plugin-design-token"];
111
- },
112
- addRuntimeExports: function addRuntimeExports() {
113
- pluginsExportsUtils.addExport("export { default as designToken } from '".concat(pluginName, "/runtime-design-token'"));
30
+ export default function() {
31
+ var pluginName = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
32
+ pluginName: "@modern-js/plugin-tailwindcss"
33
+ }).pluginName;
34
+ return {
35
+ name: "@modern-js/plugin-design-token",
36
+ setup: function setup(api) {
37
+ var pluginsExportsUtils;
38
+ var resolveConfig = lazyImport("tailwindcss/resolveConfig", require);
39
+ var PLUGIN_IDENTIFIER = "designToken";
40
+ var getDesignTokens = function(designSystem) {
41
+ var tailwindcssConfig = {};
42
+ tailwindcssConfig.theme = designSystem ? _object_spread({}, designSystem) : {};
43
+ if (!designSystem) {
44
+ tailwindcssConfig.presets = [];
45
+ }
46
+ if (designSystem) {
47
+ delete tailwindcssConfig.theme.supportStyledComponents;
48
+ }
49
+ return resolveConfig(tailwindcssConfig).theme || {};
50
+ };
51
+ return {
52
+ config: function config() {
53
+ var appContext = api.useAppContext();
54
+ pluginsExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "plugins");
55
+ return {
56
+ source: {
57
+ alias: {
58
+ "@modern-js/runtime/plugins": pluginsExportsUtils.getPath()
59
+ }
60
+ },
61
+ tools: {}
62
+ };
63
+ },
64
+ modifyEntryImports: function modifyEntryImports(param) {
65
+ var entrypoint = param.entrypoint, imports = param.imports;
66
+ var _userConfig_source;
67
+ var userConfig = api.useResolvedConfigContext();
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
+ if (typeof designSystem === "object" && designSystem.supportStyledComponents) {
71
+ var designTokens = getDesignTokens(userConfig.source.designSystem);
72
+ imports.push({
73
+ value: "@modern-js/runtime/plugins",
74
+ specifiers: [
75
+ {
76
+ imported: PLUGIN_IDENTIFIER
114
77
  }
115
- };
78
+ ],
79
+ initialize: "\n const designTokens = ".concat(JSON.stringify(designTokens), ";\n ")
80
+ });
81
+ }
82
+ return {
83
+ entrypoint,
84
+ imports
85
+ };
86
+ },
87
+ modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(param) {
88
+ var entrypoint = param.entrypoint, plugins = param.plugins;
89
+ var _userConfig_source;
90
+ var userConfig = api.useResolvedConfigContext();
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
+ var useSCThemeProvider = true;
94
+ if (designSystem) {
95
+ useSCThemeProvider = (designSystem === null || designSystem === void 0 ? void 0 : designSystem.supportStyledComponents) || false;
96
+ }
97
+ if (typeof designSystem === "object" && designSystem.supportStyledComponents) {
98
+ plugins.push({
99
+ name: PLUGIN_IDENTIFIER,
100
+ options: "{token: designTokens, useStyledComponentsThemeProvider: ".concat(useSCThemeProvider ? "true" : "false", ", useDesignTokenContext: false}")
101
+ });
102
+ }
103
+ return {
104
+ entrypoint,
105
+ plugins
106
+ };
107
+ },
108
+ validateSchema: function validateSchema() {
109
+ return PLUGIN_SCHEMAS["@modern-js/plugin-design-token"];
110
+ },
111
+ addRuntimeExports: function addRuntimeExports() {
112
+ pluginsExportsUtils.addExport("export { default as designToken } from '".concat(pluginName, "/runtime-design-token'"));
116
113
  }
117
- };
118
- };
119
- export { cli_default as default };
114
+ };
115
+ }
116
+ };
117
+ }
118
+ ;
@@ -1,3 +1,2 @@
1
- import { default as default2 } from "./runtime";
1
+ export { default } from "./runtime";
2
2
  export * from "./runtime";
3
- export { default2 as default };
@@ -1,17 +1,17 @@
1
- var postcss_plugin_default = function() {
2
- var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_cssVarsHash = _ref.cssVarsHash, cssVarsHash = _ref_cssVarsHash === void 0 ? {} : _ref_cssVarsHash;
3
- return {
4
- postcssPlugin: "postcss-replace-css-vars",
5
- Declaration: function Declaration(decl) {
6
- if (decl.value && typeof decl.value === "string") {
7
- decl.value = decl.value.replace(/--\S*/g, function(match) {
8
- if (cssVarsHash[match]) {
9
- return cssVarsHash[match];
10
- }
11
- return match;
12
- });
13
- }
14
- }
15
- };
16
- };
17
- export { postcss_plugin_default as default };
1
+ export default function() {
2
+ var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_cssVarsHash = _ref.cssVarsHash, cssVarsHash = _ref_cssVarsHash === void 0 ? {} : _ref_cssVarsHash;
3
+ return {
4
+ postcssPlugin: "postcss-replace-css-vars",
5
+ Declaration: function Declaration(decl) {
6
+ if (decl.value && typeof decl.value === "string") {
7
+ decl.value = decl.value.replace(/--\S*/g, function(match) {
8
+ if (cssVarsHash[match]) {
9
+ return cssVarsHash[match];
10
+ }
11
+ return match;
12
+ });
13
+ }
14
+ }
15
+ };
16
+ }
17
+ ;
@@ -1,4 +1,3 @@
1
1
  import designTokenPlugin from "./plugin";
2
2
  export * from "./plugin";
3
- var runtime_default = designTokenPlugin;
4
- export { runtime_default as default };
3
+ export default designTokenPlugin;
@@ -1,78 +1,78 @@
1
- function _defineProperty(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value: value,
5
- enumerable: true,
6
- configurable: true,
7
- writable: true
8
- });
9
- } else {
10
- obj[key] = value;
11
- }
12
- return obj;
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
13
  }
14
- function _objectSpread(target) {
15
- for(var i = 1; i < arguments.length; i++){
16
- var source = arguments[i] != null ? arguments[i] : {};
17
- var ownKeys = Object.keys(source);
18
- if (typeof Object.getOwnPropertySymbols === "function") {
19
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
- }));
22
- }
23
- ownKeys.forEach(function(key) {
24
- _defineProperty(target, key, source[key]);
25
- });
14
+ function _object_spread(target) {
15
+ for (var i = 1; i < arguments.length; i++) {
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
26
22
  }
27
- return target;
23
+ ownKeys.forEach(function(key) {
24
+ _define_property(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
28
  }
29
- import { jsx } from "react/jsx-runtime";
29
+ import { jsx as _jsx } from "react/jsx-runtime";
30
30
  import hoistNonReactStatics from "hoist-non-react-statics";
31
31
  import React, { useContext } from "react";
32
- var DesignTokenContext = React.createContext({});
33
- var useDesignTokens = function() {
34
- return useContext(DesignTokenContext);
32
+ export var DesignTokenContext = /* @__PURE__ */ React.createContext({});
33
+ export var useDesignTokens = function() {
34
+ return useContext(DesignTokenContext);
35
35
  };
36
- var plugin_default = function() {
37
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
38
- return {
39
- name: "@modern-js/plugin-design-token",
40
- setup: function() {
41
- return {
42
- hoc: function hoc(param, next) {
43
- var App = param.App;
44
- var DesignTokenAppWrapper = function(props) {
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
- if (useStyledComponentsThemeProvider && useDesignTokenContext) {
47
- var ThemeProvider = require("@modern-js/runtime/styled").ThemeProvider;
48
- return /* @__PURE__ */ jsx(ThemeProvider, {
49
- theme: token,
50
- children: /* @__PURE__ */ jsx(DesignTokenContext.Provider, {
51
- value: token,
52
- children: /* @__PURE__ */ jsx(App, _objectSpread({}, props))
53
- })
54
- });
55
- } else if (useStyledComponentsThemeProvider) {
56
- var ThemeProvider1 = require("@modern-js/runtime/styled").ThemeProvider;
57
- return /* @__PURE__ */ jsx(ThemeProvider1, {
58
- theme: token,
59
- children: /* @__PURE__ */ jsx(App, _objectSpread({}, props))
60
- });
61
- } else if (useDesignTokenContext) {
62
- return /* @__PURE__ */ jsx(DesignTokenContext.Provider, {
63
- value: token,
64
- children: /* @__PURE__ */ jsx(App, _objectSpread({}, props))
65
- });
66
- } else {
67
- return /* @__PURE__ */ jsx(App, _objectSpread({}, props));
68
- }
69
- };
70
- return next({
71
- App: hoistNonReactStatics(DesignTokenAppWrapper, App)
72
- });
73
- }
74
- };
36
+ export default function() {
37
+ var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
38
+ return {
39
+ name: "@modern-js/plugin-design-token",
40
+ setup: function() {
41
+ return {
42
+ hoc: function hoc(param, next) {
43
+ var App = param.App;
44
+ var DesignTokenAppWrapper = function(props) {
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
+ if (useStyledComponentsThemeProvider && useDesignTokenContext) {
47
+ var ThemeProvider = require("@modern-js/runtime/styled").ThemeProvider;
48
+ return /* @__PURE__ */ _jsx(ThemeProvider, {
49
+ theme: token,
50
+ children: /* @__PURE__ */ _jsx(DesignTokenContext.Provider, {
51
+ value: token,
52
+ children: /* @__PURE__ */ _jsx(App, _object_spread({}, props))
53
+ })
54
+ });
55
+ } else if (useStyledComponentsThemeProvider) {
56
+ var ThemeProvider1 = require("@modern-js/runtime/styled").ThemeProvider;
57
+ return /* @__PURE__ */ _jsx(ThemeProvider1, {
58
+ theme: token,
59
+ children: /* @__PURE__ */ _jsx(App, _object_spread({}, props))
60
+ });
61
+ } else if (useDesignTokenContext) {
62
+ return /* @__PURE__ */ _jsx(DesignTokenContext.Provider, {
63
+ value: token,
64
+ children: /* @__PURE__ */ _jsx(App, _object_spread({}, props))
65
+ });
66
+ } else {
67
+ return /* @__PURE__ */ _jsx(App, _object_spread({}, props));
68
+ }
69
+ };
70
+ return next({
71
+ App: hoistNonReactStatics(DesignTokenAppWrapper, App)
72
+ });
75
73
  }
76
- };
77
- };
78
- export { DesignTokenContext, plugin_default as default, useDesignTokens };
74
+ };
75
+ }
76
+ };
77
+ }
78
+ ;
package/dist/esm/index.js CHANGED
@@ -1,2 +1 @@
1
- import { default as default2 } from "./cli";
2
- export { default2 as default };
1
+ export { default } from "./cli";
@@ -1,93 +1,105 @@
1
- function _arrayLikeToArray(arr, len) {
2
- if (len == null || len > arr.length) len = arr.length;
3
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
- return arr2;
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length)
3
+ len = arr.length;
4
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
5
+ arr2[i] = arr[i];
6
+ return arr2;
5
7
  }
6
- function _arrayWithHoles(arr) {
7
- if (Array.isArray(arr)) return arr;
8
+ function _array_with_holes(arr) {
9
+ if (Array.isArray(arr))
10
+ return arr;
8
11
  }
9
- function _iterableToArrayLimit(arr, i) {
10
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
11
- if (_i == null) return;
12
- var _arr = [];
13
- var _n = true;
14
- var _d = false;
15
- var _s, _e;
12
+ function _iterable_to_array_limit(arr, i) {
13
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
14
+ if (_i == null)
15
+ return;
16
+ var _arr = [];
17
+ var _n = true;
18
+ var _d = false;
19
+ var _s, _e;
20
+ try {
21
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
22
+ _arr.push(_s.value);
23
+ if (i && _arr.length === i)
24
+ break;
25
+ }
26
+ } catch (err) {
27
+ _d = true;
28
+ _e = err;
29
+ } finally {
16
30
  try {
17
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
18
- _arr.push(_s.value);
19
- if (i && _arr.length === i) break;
20
- }
21
- } catch (err) {
22
- _d = true;
23
- _e = err;
24
- } finally{
25
- try {
26
- if (!_n && _i["return"] != null) _i["return"]();
27
- } finally{
28
- if (_d) throw _e;
29
- }
31
+ if (!_n && _i["return"] != null)
32
+ _i["return"]();
33
+ } finally {
34
+ if (_d)
35
+ throw _e;
30
36
  }
31
- return _arr;
37
+ }
38
+ return _arr;
32
39
  }
33
- function _nonIterableRest() {
34
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
40
+ function _non_iterable_rest() {
41
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
35
42
  }
36
- function _slicedToArray(arr, i) {
37
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
43
+ function _sliced_to_array(arr, i) {
44
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
38
45
  }
39
- function _unsupportedIterableToArray(o, minLen) {
40
- if (!o) return;
41
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
42
- var n = Object.prototype.toString.call(o).slice(8, -1);
43
- if (n === "Object" && o.constructor) n = o.constructor.name;
44
- if (n === "Map" || n === "Set") return Array.from(n);
45
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
46
+ function _unsupported_iterable_to_array(o, minLen) {
47
+ if (!o)
48
+ return;
49
+ if (typeof o === "string")
50
+ return _array_like_to_array(o, minLen);
51
+ var n = Object.prototype.toString.call(o).slice(8, -1);
52
+ if (n === "Object" && o.constructor)
53
+ n = o.constructor.name;
54
+ if (n === "Map" || n === "Set")
55
+ return Array.from(n);
56
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
57
+ return _array_like_to_array(o, minLen);
46
58
  }
47
59
  import { applyOptionsChain, logger } from "@modern-js/utils";
48
60
  import { merge, cloneDeep } from "@modern-js/utils/lodash";
49
61
  var checkIfExistNotAllowKeys = function(tailwindConfig) {
50
- var notAllowExistKeys = [
51
- "theme"
52
- ];
53
- var notAllowKey = "";
54
- var ret = Object.keys(tailwindConfig).some(function(key) {
55
- return notAllowExistKeys.includes(key) && (notAllowKey = key);
56
- });
57
- return [
58
- ret,
59
- notAllowKey
60
- ];
62
+ var notAllowExistKeys = [
63
+ "theme"
64
+ ];
65
+ var notAllowKey = "";
66
+ var ret = Object.keys(tailwindConfig).some(function(key) {
67
+ return notAllowExistKeys.includes(key) && (notAllowKey = key);
68
+ });
69
+ return [
70
+ ret,
71
+ notAllowKey
72
+ ];
61
73
  };
62
74
  var getPureDesignSystemConfig = function(designSystemConfig) {
63
- var pureDesignSystemConfig = cloneDeep(designSystemConfig);
64
- delete pureDesignSystemConfig.supportStyledComponents;
65
- return pureDesignSystemConfig;
75
+ var pureDesignSystemConfig = cloneDeep(designSystemConfig);
76
+ delete pureDesignSystemConfig.supportStyledComponents;
77
+ return pureDesignSystemConfig;
66
78
  };
67
79
  var getTailwindConfig = function(tailwindVersion, tailwindcss, designSystem) {
68
- var option = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
69
- var purgeConfig = merge({
70
- // TODO: how the operating environment is determined
71
- enabled: process.env.NODE_ENV === "production",
72
- // TODO: Remove or not
73
- layers: [
74
- "utilities"
75
- ],
76
- content: []
77
- }, option.pureConfig || {});
78
- var defaultTailwindConfig = tailwindVersion === "3" ? {
79
- content: purgeConfig.content
80
- } : {
81
- purge: purgeConfig
82
- };
83
- var tailwindConfig = applyOptionsChain(defaultTailwindConfig, tailwindcss || {});
84
- var designSystemConfig = getPureDesignSystemConfig(designSystem !== null && designSystem !== void 0 ? designSystem : {});
85
- var _checkIfExistNotAllowKeys = _slicedToArray(checkIfExistNotAllowKeys(tailwindConfig), 2), exist = _checkIfExistNotAllowKeys[0], key = _checkIfExistNotAllowKeys[1];
86
- if (exist) {
87
- logger.error("should not exist '".concat(key, "' on tools.tailwindcss, please remove it"));
88
- process.exit(0);
89
- }
90
- tailwindConfig.theme = designSystemConfig || {};
91
- return tailwindConfig;
80
+ var option = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
81
+ var purgeConfig = merge({
82
+ // TODO: how the operating environment is determined
83
+ enabled: process.env.NODE_ENV === "production",
84
+ // TODO: Remove or not
85
+ layers: [
86
+ "utilities"
87
+ ],
88
+ content: []
89
+ }, option.pureConfig || {});
90
+ var defaultTailwindConfig = tailwindVersion === "3" ? {
91
+ content: purgeConfig.content
92
+ } : {
93
+ purge: purgeConfig
94
+ };
95
+ var tailwindConfig = applyOptionsChain(defaultTailwindConfig, tailwindcss || {});
96
+ var designSystemConfig = getPureDesignSystemConfig(designSystem !== null && designSystem !== void 0 ? designSystem : {});
97
+ var _checkIfExistNotAllowKeys = _sliced_to_array(checkIfExistNotAllowKeys(tailwindConfig), 2), exist = _checkIfExistNotAllowKeys[0], key = _checkIfExistNotAllowKeys[1];
98
+ if (exist) {
99
+ logger.error("should not exist '".concat(key, "' on tools.tailwindcss, please remove it"));
100
+ process.exit(0);
101
+ }
102
+ tailwindConfig.theme = designSystemConfig || {};
103
+ return tailwindConfig;
92
104
  };
93
105
  export { getTailwindConfig };
package/dist/esm/types.js CHANGED
@@ -1 +1 @@
1
- "use strict";
1
+ export {};