@modern-js/plugin-tailwindcss 2.35.0 → 2.36.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/dist/cjs/macro.js CHANGED
@@ -1,31 +1,41 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
6
9
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- template: function() {
14
- return template;
15
- },
16
- checkTwinMacroExist: function() {
17
- return checkTwinMacroExist;
18
- },
19
- getTwinMacroMajorVersion: function() {
20
- return getTwinMacroMajorVersion;
21
- },
22
- getRandomTwConfigFileName: function() {
23
- return getRandomTwConfigFileName;
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
17
  }
18
+ return to;
19
+ };
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.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var macro_exports = {};
30
+ __export(macro_exports, {
31
+ checkTwinMacroExist: () => checkTwinMacroExist,
32
+ getRandomTwConfigFileName: () => getRandomTwConfigFileName,
33
+ getTwinMacroMajorVersion: () => getTwinMacroMajorVersion,
34
+ template: () => template
25
35
  });
26
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
27
- const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
28
- const _utils = require("@modern-js/utils");
36
+ module.exports = __toCommonJS(macro_exports);
37
+ var import_path = __toESM(require("path"));
38
+ var import_utils = require("@modern-js/utils");
29
39
  const template = (configPath) => `
30
40
  function _interopRequireDefault(obj) {
31
41
  return obj && obj.__esModule ? obj : { default: obj };
@@ -48,7 +58,7 @@ module.exports = {
48
58
  `;
49
59
  const TWIN_MACRO_NAME = "twin.macro";
50
60
  const checkTwinMacroExist = async (appDirectory) => {
51
- const packageJson = await _utils.fs.readJSON(_path.default.join(appDirectory, "package.json"), {
61
+ const packageJson = await import_utils.fs.readJSON(import_path.default.join(appDirectory, "package.json"), {
52
62
  throws: false
53
63
  }) || {};
54
64
  return Boolean(typeof packageJson.dependencies === "object" && packageJson.dependencies[TWIN_MACRO_NAME] || typeof packageJson.devDependencies === "object" && packageJson.devDependencies[TWIN_MACRO_NAME]);
@@ -67,5 +77,12 @@ const getTwinMacroMajorVersion = (appDirectory) => {
67
77
  }
68
78
  };
69
79
  const getRandomTwConfigFileName = (internalDirectory) => {
70
- return (0, _utils.slash)(_path.default.join(internalDirectory, `tailwind.config.${Date.now()}.${(0, _utils.nanoid)()}.js`));
80
+ return (0, import_utils.slash)(import_path.default.join(internalDirectory, `tailwind.config.${Date.now()}.${(0, import_utils.nanoid)()}.js`));
71
81
  };
82
+ // Annotate the CommonJS export names for ESM import in node:
83
+ 0 && (module.exports = {
84
+ checkTwinMacroExist,
85
+ getRandomTwConfigFileName,
86
+ getTwinMacroMajorVersion,
87
+ template
88
+ });
package/dist/cjs/types.js CHANGED
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
package/dist/cjs/utils.js CHANGED
@@ -1,22 +1,27 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
6
7
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- getTailwindPath: function() {
14
- return getTailwindPath;
15
- },
16
- getTailwindVersion: function() {
17
- return getTailwindVersion;
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var utils_exports = {};
20
+ __export(utils_exports, {
21
+ getTailwindPath: () => getTailwindPath,
22
+ getTailwindVersion: () => getTailwindVersion
19
23
  });
24
+ module.exports = __toCommonJS(utils_exports);
20
25
  function getTailwindPath(appDirectory) {
21
26
  try {
22
27
  return require.resolve("tailwindcss", {
@@ -42,3 +47,8 @@ function getTailwindVersion(appDirectory) {
42
47
  return "3";
43
48
  }
44
49
  }
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ getTailwindPath,
53
+ getTailwindVersion
54
+ });
package/dist/esm/cli.js CHANGED
@@ -6,7 +6,7 @@ import { designTokenPlugin } from "./design-token/cli";
6
6
  import { getTailwindConfig, loadConfigFile } from "./config";
7
7
  import { getTailwindPath, getTailwindVersion } from "./utils";
8
8
  import { template, checkTwinMacroExist, getTwinMacroMajorVersion, getRandomTwConfigFileName } from "./macro";
9
- export var tailwindcssPlugin = function() {
9
+ var tailwindcssPlugin = function() {
10
10
  var pluginName = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
11
11
  pluginName: "@modern-js/plugin-tailwindcss"
12
12
  }).pluginName;
@@ -15,7 +15,7 @@ export var tailwindcssPlugin = function() {
15
15
  // support designSystem.supportStyledComponents
16
16
  usePlugins: [
17
17
  designTokenPlugin({
18
- pluginName: pluginName
18
+ pluginName
19
19
  })
20
20
  ],
21
21
  setup: function() {
@@ -76,14 +76,14 @@ export var tailwindcssPlugin = function() {
76
76
  var tailwindConfig;
77
77
  var initTailwindConfig = function() {
78
78
  if (!tailwindConfig) {
79
- var _modernConfig_tools, _modernConfig, _modernConfig_source, _modernConfig1;
79
+ var _modernConfig_tools, _modernConfig_source;
80
80
  var modernConfig = api.useResolvedConfigContext();
81
81
  tailwindConfig = getTailwindConfig({
82
- appDirectory: appDirectory,
83
- tailwindVersion: tailwindVersion,
82
+ appDirectory,
83
+ tailwindVersion,
84
84
  userConfig: userTailwindConfig,
85
- extraConfig: (_modernConfig = modernConfig) === null || _modernConfig === void 0 ? void 0 : (_modernConfig_tools = _modernConfig.tools) === null || _modernConfig_tools === void 0 ? void 0 : _modernConfig_tools.tailwindcss,
86
- designSystem: (_modernConfig1 = modernConfig) === null || _modernConfig1 === void 0 ? void 0 : (_modernConfig_source = _modernConfig1.source) === null || _modernConfig_source === void 0 ? void 0 : _modernConfig_source.designSystem
85
+ extraConfig: modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_tools = modernConfig.tools) === null || _modernConfig_tools === void 0 ? void 0 : _modernConfig_tools.tailwindcss,
86
+ designSystem: modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_source = modernConfig.source) === null || _modernConfig_source === void 0 ? void 0 : _modernConfig_source.designSystem
87
87
  });
88
88
  }
89
89
  };
@@ -124,8 +124,8 @@ export var tailwindcssPlugin = function() {
124
124
  beforeBuildTask: function beforeBuildTask(config) {
125
125
  var modernConfig = api.useResolvedConfigContext();
126
126
  var tailwindConfig = getTailwindConfig({
127
- appDirectory: appDirectory,
128
- tailwindVersion: tailwindVersion,
127
+ appDirectory,
128
+ tailwindVersion,
129
129
  userConfig: userTailwindConfig,
130
130
  extraConfig: config.style.tailwindcss,
131
131
  designSystem: modernConfig.designSystem
@@ -138,11 +138,8 @@ export var tailwindcssPlugin = function() {
138
138
  tailwindPlugin
139
139
  ];
140
140
  }
141
- return config;
142
- },
143
- modifyLibuild: function modifyLibuild(config, next) {
144
141
  config.transformCache = false;
145
- return next(config);
142
+ return config;
146
143
  }
147
144
  }
148
145
  ];
@@ -155,4 +152,8 @@ export var tailwindcssPlugin = function() {
155
152
  }()
156
153
  };
157
154
  };
158
- export default tailwindcssPlugin;
155
+ var cli_default = tailwindcssPlugin;
156
+ export {
157
+ cli_default as default,
158
+ tailwindcssPlugin
159
+ };
@@ -27,10 +27,10 @@ var getV2PurgeConfig = function(content) {
27
27
  layers: [
28
28
  "utilities"
29
29
  ],
30
- content: content
30
+ content
31
31
  };
32
32
  };
33
- export function loadConfigFile(appDirectory) {
33
+ function loadConfigFile(appDirectory) {
34
34
  return _loadConfigFile.apply(this, arguments);
35
35
  }
36
36
  function _loadConfigFile() {
@@ -78,7 +78,7 @@ var getTailwindConfig = function(param) {
78
78
  var tailwindVersion = param.tailwindVersion, appDirectory = param.appDirectory, userConfig = param.userConfig, extraConfig = param.extraConfig, designSystem = param.designSystem;
79
79
  var content = getDefaultContent(appDirectory);
80
80
  var tailwindConfig = tailwindVersion === "3" ? {
81
- content: content
81
+ content
82
82
  } : {
83
83
  purge: getV2PurgeConfig(content)
84
84
  };
@@ -90,4 +90,7 @@ var getTailwindConfig = function(param) {
90
90
  }
91
91
  return tailwindConfig;
92
92
  };
93
- export { getTailwindConfig };
93
+ export {
94
+ getTailwindConfig,
95
+ loadConfigFile
96
+ };
@@ -1,6 +1,6 @@
1
1
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { lazyImport, createRuntimeExportsUtils } from "@modern-js/utils";
3
- export var designTokenPlugin = function() {
3
+ var designTokenPlugin = function() {
4
4
  var pluginName = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
5
5
  pluginName: "@modern-js/plugin-tailwindcss"
6
6
  }).pluginName;
@@ -52,8 +52,8 @@ export var designTokenPlugin = function() {
52
52
  });
53
53
  }
54
54
  return {
55
- entrypoint: entrypoint,
56
- imports: imports
55
+ entrypoint,
56
+ imports
57
57
  };
58
58
  },
59
59
  modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(param) {
@@ -64,8 +64,7 @@ export var designTokenPlugin = function() {
64
64
  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 : {};
65
65
  var useSCThemeProvider = true;
66
66
  if (designSystem) {
67
- var _designSystem;
68
- useSCThemeProvider = ((_designSystem = designSystem) === null || _designSystem === void 0 ? void 0 : _designSystem.supportStyledComponents) || false;
67
+ useSCThemeProvider = (designSystem === null || designSystem === void 0 ? void 0 : designSystem.supportStyledComponents) || false;
69
68
  }
70
69
  if (typeof designSystem === "object" && designSystem.supportStyledComponents) {
71
70
  plugins.push({
@@ -74,8 +73,8 @@ export var designTokenPlugin = function() {
74
73
  });
75
74
  }
76
75
  return {
77
- entrypoint: entrypoint,
78
- plugins: plugins
76
+ entrypoint,
77
+ plugins
79
78
  };
80
79
  },
81
80
  validateSchema: function validateSchema() {
@@ -114,3 +113,6 @@ export var designTokenPlugin = function() {
114
113
  }
115
114
  };
116
115
  };
116
+ export {
117
+ designTokenPlugin
118
+ };
@@ -1,2 +1,5 @@
1
- export { default } from "./runtime";
1
+ import { default as default2 } from "./runtime";
2
2
  export * from "./runtime";
3
+ export {
4
+ default2 as default
5
+ };
@@ -1,4 +1,4 @@
1
- export default function() {
1
+ function postcss_plugin_default() {
2
2
  var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_cssVarsHash = _ref.cssVarsHash, cssVarsHash = _ref_cssVarsHash === void 0 ? {} : _ref_cssVarsHash;
3
3
  return {
4
4
  postcssPlugin: "postcss-replace-css-vars",
@@ -15,3 +15,6 @@ export default function() {
15
15
  };
16
16
  }
17
17
  ;
18
+ export {
19
+ postcss_plugin_default as default
20
+ };
@@ -1,3 +1,6 @@
1
1
  import designTokenPlugin from "./plugin";
2
2
  export * from "./plugin";
3
- export default designTokenPlugin;
3
+ var runtime_default = designTokenPlugin;
4
+ export {
5
+ runtime_default as default
6
+ };
@@ -2,11 +2,11 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import hoistNonReactStatics from "hoist-non-react-statics";
4
4
  import React, { useContext } from "react";
5
- export var DesignTokenContext = /* @__PURE__ */ React.createContext({});
6
- export var useDesignTokens = function() {
5
+ var DesignTokenContext = /* @__PURE__ */ React.createContext({});
6
+ var useDesignTokens = function() {
7
7
  return useContext(DesignTokenContext);
8
8
  };
9
- export default function() {
9
+ function plugin_default() {
10
10
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
11
11
  return {
12
12
  name: "@modern-js/plugin-design-token",
@@ -49,3 +49,8 @@ export default function() {
49
49
  };
50
50
  }
51
51
  ;
52
+ export {
53
+ DesignTokenContext,
54
+ plugin_default as default,
55
+ useDesignTokens
56
+ };
package/dist/esm/index.js CHANGED
@@ -1,3 +1,6 @@
1
1
  import { tailwindcssPlugin } from "./cli";
2
- export { tailwindcssPlugin };
3
- export default tailwindcssPlugin;
2
+ var src_default = tailwindcssPlugin;
3
+ export {
4
+ src_default as default,
5
+ tailwindcssPlugin
6
+ };
package/dist/esm/macro.js CHANGED
@@ -2,11 +2,11 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
3
  import path from "path";
4
4
  import { fs, nanoid, slash } from "@modern-js/utils";
5
- export var template = function(configPath) {
5
+ var template = function(configPath) {
6
6
  return "\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nconst modernConfig = _interopRequireDefault(require('".concat(configPath, "')).default;\n\nconst theme =\n modernConfig && modernConfig.source && modernConfig.source.designSystem\n ? modernConfig.source.designSystem\n : {};\nconst tailwindcss =\n modernConfig && modernConfig.tools && modernConfig.tools.tailwindcss\n ? modernConfig.tools.tailwindcss\n : {};\n\nmodule.exports = {\n theme,\n ...tailwindcss,\n};\n");
7
7
  };
8
8
  var TWIN_MACRO_NAME = "twin.macro";
9
- export var checkTwinMacroExist = function() {
9
+ var checkTwinMacroExist = function() {
10
10
  var _ref = _async_to_generator(function(appDirectory) {
11
11
  var packageJson;
12
12
  return _ts_generator(this, function(_state) {
@@ -31,7 +31,7 @@ export var checkTwinMacroExist = function() {
31
31
  return _ref.apply(this, arguments);
32
32
  };
33
33
  }();
34
- export var getTwinMacroMajorVersion = function(appDirectory) {
34
+ var getTwinMacroMajorVersion = function(appDirectory) {
35
35
  try {
36
36
  var pkgJsonPath = require.resolve("".concat(TWIN_MACRO_NAME, "/package.json"), {
37
37
  paths: [
@@ -44,6 +44,12 @@ export var getTwinMacroMajorVersion = function(appDirectory) {
44
44
  return null;
45
45
  }
46
46
  };
47
- export var getRandomTwConfigFileName = function(internalDirectory) {
47
+ var getRandomTwConfigFileName = function(internalDirectory) {
48
48
  return slash(path.join(internalDirectory, "tailwind.config.".concat(Date.now(), ".").concat(nanoid(), ".js")));
49
49
  };
50
+ export {
51
+ checkTwinMacroExist,
52
+ getRandomTwConfigFileName,
53
+ getTwinMacroMajorVersion,
54
+ template
55
+ };
package/dist/esm/types.js CHANGED
@@ -1 +0,0 @@
1
- export {};
package/dist/esm/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- export function getTailwindPath(appDirectory) {
1
+ function getTailwindPath(appDirectory) {
2
2
  try {
3
3
  return require.resolve("tailwindcss", {
4
4
  paths: [
@@ -10,7 +10,7 @@ export function getTailwindPath(appDirectory) {
10
10
  return "tailwindcss";
11
11
  }
12
12
  }
13
- export function getTailwindVersion(appDirectory) {
13
+ function getTailwindVersion(appDirectory) {
14
14
  try {
15
15
  var packageJsonPath = require.resolve("tailwindcss/package.json", {
16
16
  paths: [
@@ -23,3 +23,7 @@ export function getTailwindVersion(appDirectory) {
23
23
  return "3";
24
24
  }
25
25
  }
26
+ export {
27
+ getTailwindPath,
28
+ getTailwindVersion
29
+ };
@@ -4,7 +4,7 @@ import { designTokenPlugin } from "./design-token/cli";
4
4
  import { getTailwindConfig, loadConfigFile } from "./config";
5
5
  import { getTailwindPath, getTailwindVersion } from "./utils";
6
6
  import { template, checkTwinMacroExist, getTwinMacroMajorVersion, getRandomTwConfigFileName } from "./macro";
7
- export const tailwindcssPlugin = ({ pluginName } = {
7
+ const tailwindcssPlugin = ({ pluginName } = {
8
8
  pluginName: "@modern-js/plugin-tailwindcss"
9
9
  }) => ({
10
10
  name: "@modern-js/plugin-tailwindcss",
@@ -55,14 +55,14 @@ export const tailwindcssPlugin = ({ pluginName } = {
55
55
  let tailwindConfig;
56
56
  const initTailwindConfig = () => {
57
57
  if (!tailwindConfig) {
58
- var _modernConfig_tools, _modernConfig, _modernConfig_source, _modernConfig1;
58
+ var _modernConfig_tools, _modernConfig_source;
59
59
  const modernConfig = api.useResolvedConfigContext();
60
60
  tailwindConfig = getTailwindConfig({
61
61
  appDirectory,
62
62
  tailwindVersion,
63
63
  userConfig: userTailwindConfig,
64
- extraConfig: (_modernConfig = modernConfig) === null || _modernConfig === void 0 ? void 0 : (_modernConfig_tools = _modernConfig.tools) === null || _modernConfig_tools === void 0 ? void 0 : _modernConfig_tools.tailwindcss,
65
- designSystem: (_modernConfig1 = modernConfig) === null || _modernConfig1 === void 0 ? void 0 : (_modernConfig_source = _modernConfig1.source) === null || _modernConfig_source === void 0 ? void 0 : _modernConfig_source.designSystem
64
+ extraConfig: modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_tools = modernConfig.tools) === null || _modernConfig_tools === void 0 ? void 0 : _modernConfig_tools.tailwindcss,
65
+ designSystem: modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_source = modernConfig.source) === null || _modernConfig_source === void 0 ? void 0 : _modernConfig_source.designSystem
66
66
  });
67
67
  }
68
68
  };
@@ -116,13 +116,14 @@ export const tailwindcssPlugin = ({ pluginName } = {
116
116
  tailwindPlugin
117
117
  ];
118
118
  }
119
- return config;
120
- },
121
- modifyLibuild(config, next) {
122
119
  config.transformCache = false;
123
- return next(config);
120
+ return config;
124
121
  }
125
122
  };
126
123
  }
127
124
  });
128
- export default tailwindcssPlugin;
125
+ var cli_default = tailwindcssPlugin;
126
+ export {
127
+ cli_default as default,
128
+ tailwindcssPlugin
129
+ };
@@ -26,7 +26,7 @@ const getV2PurgeConfig = (content) => ({
26
26
  ],
27
27
  content
28
28
  });
29
- export async function loadConfigFile(appDirectory) {
29
+ async function loadConfigFile(appDirectory) {
30
30
  const extensions = [
31
31
  "ts",
32
32
  "js",
@@ -56,4 +56,7 @@ const getTailwindConfig = ({ tailwindVersion, appDirectory, userConfig, extraCon
56
56
  }
57
57
  return tailwindConfig;
58
58
  };
59
- export { getTailwindConfig };
59
+ export {
60
+ getTailwindConfig,
61
+ loadConfigFile
62
+ };
@@ -1,5 +1,5 @@
1
1
  import { lazyImport, createRuntimeExportsUtils } from "@modern-js/utils";
2
- export const designTokenPlugin = ({ pluginName } = {
2
+ const designTokenPlugin = ({ pluginName } = {
3
3
  pluginName: "@modern-js/plugin-tailwindcss"
4
4
  }) => ({
5
5
  name: "@modern-js/plugin-design-token",
@@ -63,8 +63,7 @@ export const designTokenPlugin = ({ pluginName } = {
63
63
  const 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 : {};
64
64
  let useSCThemeProvider = true;
65
65
  if (designSystem) {
66
- var _designSystem;
67
- useSCThemeProvider = ((_designSystem = designSystem) === null || _designSystem === void 0 ? void 0 : _designSystem.supportStyledComponents) || false;
66
+ useSCThemeProvider = (designSystem === null || designSystem === void 0 ? void 0 : designSystem.supportStyledComponents) || false;
68
67
  }
69
68
  if (typeof designSystem === "object" && designSystem.supportStyledComponents) {
70
69
  plugins.push({
@@ -112,3 +111,6 @@ export const designTokenPlugin = ({ pluginName } = {
112
111
  };
113
112
  }
114
113
  });
114
+ export {
115
+ designTokenPlugin
116
+ };
@@ -1,2 +1,5 @@
1
- export { default } from "./runtime";
1
+ import { default as default2 } from "./runtime";
2
2
  export * from "./runtime";
3
+ export {
4
+ default2 as default
5
+ };
@@ -1,4 +1,4 @@
1
- export default ({ cssVarsHash = {} } = {}) => ({
1
+ var postcss_plugin_default = ({ cssVarsHash = {} } = {}) => ({
2
2
  postcssPlugin: "postcss-replace-css-vars",
3
3
  Declaration(decl) {
4
4
  if (decl.value && typeof decl.value === "string") {
@@ -11,3 +11,6 @@ export default ({ cssVarsHash = {} } = {}) => ({
11
11
  }
12
12
  }
13
13
  });
14
+ export {
15
+ postcss_plugin_default as default
16
+ };
@@ -1,3 +1,6 @@
1
1
  import designTokenPlugin from "./plugin";
2
2
  export * from "./plugin";
3
- export default designTokenPlugin;
3
+ var runtime_default = designTokenPlugin;
4
+ export {
5
+ runtime_default as default
6
+ };
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import hoistNonReactStatics from "hoist-non-react-statics";
3
3
  import React, { useContext } from "react";
4
- export const DesignTokenContext = /* @__PURE__ */ React.createContext({});
5
- export const useDesignTokens = () => useContext(DesignTokenContext);
6
- export default (options = {}) => ({
4
+ const DesignTokenContext = /* @__PURE__ */ React.createContext({});
5
+ const useDesignTokens = () => useContext(DesignTokenContext);
6
+ var plugin_default = (options = {}) => ({
7
7
  name: "@modern-js/plugin-design-token",
8
8
  setup: () => ({
9
9
  hoc({ App }, next) {
@@ -47,3 +47,8 @@ export default (options = {}) => ({
47
47
  }
48
48
  })
49
49
  });
50
+ export {
51
+ DesignTokenContext,
52
+ plugin_default as default,
53
+ useDesignTokens
54
+ };
@@ -1,3 +1,6 @@
1
1
  import { tailwindcssPlugin } from "./cli";
2
- export { tailwindcssPlugin };
3
- export default tailwindcssPlugin;
2
+ var src_default = tailwindcssPlugin;
3
+ export {
4
+ src_default as default,
5
+ tailwindcssPlugin
6
+ };
@@ -1,6 +1,6 @@
1
1
  import path from "path";
2
2
  import { fs, nanoid, slash } from "@modern-js/utils";
3
- export const template = (configPath) => `
3
+ const template = (configPath) => `
4
4
  function _interopRequireDefault(obj) {
5
5
  return obj && obj.__esModule ? obj : { default: obj };
6
6
  }
@@ -21,13 +21,13 @@ module.exports = {
21
21
  };
22
22
  `;
23
23
  const TWIN_MACRO_NAME = "twin.macro";
24
- export const checkTwinMacroExist = async (appDirectory) => {
24
+ const checkTwinMacroExist = async (appDirectory) => {
25
25
  const packageJson = await fs.readJSON(path.join(appDirectory, "package.json"), {
26
26
  throws: false
27
27
  }) || {};
28
28
  return Boolean(typeof packageJson.dependencies === "object" && packageJson.dependencies[TWIN_MACRO_NAME] || typeof packageJson.devDependencies === "object" && packageJson.devDependencies[TWIN_MACRO_NAME]);
29
29
  };
30
- export const getTwinMacroMajorVersion = (appDirectory) => {
30
+ const getTwinMacroMajorVersion = (appDirectory) => {
31
31
  try {
32
32
  const pkgJsonPath = require.resolve(`${TWIN_MACRO_NAME}/package.json`, {
33
33
  paths: [
@@ -40,6 +40,12 @@ export const getTwinMacroMajorVersion = (appDirectory) => {
40
40
  return null;
41
41
  }
42
42
  };
43
- export const getRandomTwConfigFileName = (internalDirectory) => {
43
+ const getRandomTwConfigFileName = (internalDirectory) => {
44
44
  return slash(path.join(internalDirectory, `tailwind.config.${Date.now()}.${nanoid()}.js`));
45
45
  };
46
+ export {
47
+ checkTwinMacroExist,
48
+ getRandomTwConfigFileName,
49
+ getTwinMacroMajorVersion,
50
+ template
51
+ };
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +1,4 @@
1
- export function getTailwindPath(appDirectory) {
1
+ function getTailwindPath(appDirectory) {
2
2
  try {
3
3
  return require.resolve("tailwindcss", {
4
4
  paths: [
@@ -10,7 +10,7 @@ export function getTailwindPath(appDirectory) {
10
10
  return "tailwindcss";
11
11
  }
12
12
  }
13
- export function getTailwindVersion(appDirectory) {
13
+ function getTailwindVersion(appDirectory) {
14
14
  try {
15
15
  const packageJsonPath = require.resolve("tailwindcss/package.json", {
16
16
  paths: [
@@ -23,3 +23,7 @@ export function getTailwindVersion(appDirectory) {
23
23
  return "3";
24
24
  }
25
25
  }
26
+ export {
27
+ getTailwindPath,
28
+ getTailwindVersion
29
+ };