@modern-js/plugin-tailwindcss 2.0.0-beta.0 → 2.0.0-beta.2

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/dist/js/modern/cli.js +33 -37
  3. package/dist/js/modern/design-token/cli/index.js +13 -38
  4. package/dist/js/modern/design-token/postcss-plugin/index.js +0 -3
  5. package/dist/js/modern/design-token/runtime/plugin.js +0 -8
  6. package/dist/js/modern/tailwind.js +7 -11
  7. package/dist/js/modern/types.js +0 -0
  8. package/dist/js/modern/utils.js +0 -2
  9. package/dist/js/node/cli.js +33 -49
  10. package/dist/js/node/design-token/cli/index.js +13 -41
  11. package/dist/js/node/design-token/index.js +0 -4
  12. package/dist/js/node/design-token/postcss-plugin/index.js +0 -5
  13. package/dist/js/node/design-token/runtime/index.js +0 -5
  14. package/dist/js/node/design-token/runtime/plugin.js +0 -20
  15. package/dist/js/node/index.js +0 -2
  16. package/dist/js/node/tailwind.js +7 -14
  17. package/dist/js/node/types.js +0 -0
  18. package/dist/js/node/utils.js +0 -9
  19. package/dist/js/treeshaking/cli.js +34 -36
  20. package/dist/js/treeshaking/design-token/cli/index.js +22 -30
  21. package/dist/js/treeshaking/design-token/postcss-plugin/index.js +2 -6
  22. package/dist/js/treeshaking/design-token/runtime/plugin.js +7 -12
  23. package/dist/js/treeshaking/tailwind.js +10 -15
  24. package/dist/js/treeshaking/types.js +0 -0
  25. package/dist/js/treeshaking/utils.js +0 -9
  26. package/dist/types/cli.d.ts +2 -4
  27. package/dist/types/design-token/cli/index.d.ts +2 -4
  28. package/dist/types/design-token/postcss-plugin/index.d.ts +0 -2
  29. package/dist/types/design-token/runtime/plugin.d.ts +0 -2
  30. package/dist/types/tailwind.d.ts +2 -2
  31. package/dist/types/types.d.ts +10 -0
  32. package/package.json +13 -12
@@ -12,10 +12,9 @@ export var getRandomTwConfigFileName = function getRandomTwConfigFileName(intern
12
12
  };
13
13
  export default (function () {
14
14
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
15
- pluginName: '@modern-js/plugin-tailwindcss'
16
- },
17
- pluginName = _ref.pluginName;
18
-
15
+ pluginName: '@modern-js/plugin-tailwindcss'
16
+ },
17
+ pluginName = _ref.pluginName;
19
18
  return {
20
19
  name: '@modern-js/plugin-tailwindcss',
21
20
  // support designSystem.supportStyledComponents
@@ -25,17 +24,14 @@ export default (function () {
25
24
  setup: function () {
26
25
  var _setup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(api) {
27
26
  var _api$useAppContext, appDirectory, internalDirectory, internalTwConfigPath, notHaveTwinMacro;
28
-
29
27
  return _regeneratorRuntime().wrap(function _callee$(_context) {
30
28
  while (1) {
31
29
  switch (_context.prev = _context.next) {
32
30
  case 0:
33
31
  _api$useAppContext = api.useAppContext(), appDirectory = _api$useAppContext.appDirectory, internalDirectory = _api$useAppContext.internalDirectory;
34
32
  internalTwConfigPath = ''; // When reinstalling dependencies, most of the time the project will be restarted
35
-
36
33
  _context.next = 4;
37
34
  return checkTwinMacroNotExist(appDirectory);
38
-
39
35
  case 4:
40
36
  notHaveTwinMacro = _context.sent;
41
37
  return _context.abrupt("return", {
@@ -43,13 +39,11 @@ export default (function () {
43
39
  if (notHaveTwinMacro) {
44
40
  return;
45
41
  }
46
-
47
42
  internalTwConfigPath = getRandomTwConfigFileName(internalDirectory);
48
43
  var globPattern = slash(path.join(appDirectory, CONFIG_CACHE_DIR, '*.cjs'));
49
44
  var files = globby.sync(globPattern, {
50
45
  absolute: true
51
46
  });
52
-
53
47
  if (files.length > 0) {
54
48
  fs.writeFileSync(internalTwConfigPath, template(files[files.length - 1]), 'utf-8');
55
49
  }
@@ -64,26 +58,44 @@ export default (function () {
64
58
  // TODO: In module project, also is called, but should not be called.
65
59
  postcss: function postcss(config) {
66
60
  var modernConfig = api.useResolvedConfigContext();
67
- var tailwindConfig = getTailwindConfig(modernConfig, {
68
- pureConfig: {
69
- content: ['./config/html/**/*.html', './config/html/**/*.ejs', './config/html/**/*.hbs', './src/**/*.js', './src/**/*.jsx', './src/**/*.ts', './src/**/*.tsx', // about storybook
70
- './storybook/**/*', './styles/**/*.less', './styles/**/*.css', './styles/**/*.sass', './styles/**/*.scss']
61
+ if (!config.postcssOptions
62
+ // config.$$tools === 'module-tools'
63
+ ) {
64
+ if (Array.isArray(config.plugins)) {
65
+ var tailwindConfig = getTailwindConfig(modernConfig, {
66
+ pureConfig: {
67
+ content: ['./src/**/*.js', './src/**/*.jsx', './src/**/*.ts', './src/**/*.tsx', './src/**/*.less', './src/**/*.css', './src/**/*.sass', './src/**/*.scss', './styles/**/*.less', './styles/**/*.css', './styles/**/*.sass', './styles/**/*.scss']
68
+ }
69
+ });
70
+ config.plugins.push(require('tailwindcss')(tailwindConfig));
71
+ } else {
72
+ var _tailwindConfig = getTailwindConfig(modernConfig, {
73
+ pureConfig: {
74
+ content: ['./src/**/*.js', './src/**/*.jsx', './src/**/*.ts', './src/**/*.tsx', './src/**/*.less', './src/**/*.css', './src/**/*.sass', './src/**/*.scss', './styles/**/*.less', './styles/**/*.css', './styles/**/*.sass', './styles/**/*.scss']
75
+ }
76
+ });
77
+ config.plugins = [require('tailwindcss')(_tailwindConfig)];
71
78
  }
72
- });
73
-
74
- if (Array.isArray(config.postcssOptions.plugins)) {
75
- config.postcssOptions.plugins.push(require('tailwindcss')(tailwindConfig));
76
79
  } else {
77
- config.postcssOptions.plugins = [require('tailwindcss')(tailwindConfig)];
80
+ var _tailwindConfig2 = getTailwindConfig(modernConfig, {
81
+ pureConfig: {
82
+ content: ['./config/html/**/*.html', './config/html/**/*.ejs', './config/html/**/*.hbs', './src/**/*.js', './src/**/*.jsx', './src/**/*.ts', './src/**/*.tsx',
83
+ // about storybook
84
+ './storybook/**/*', './styles/**/*.less', './styles/**/*.css', './styles/**/*.sass', './styles/**/*.scss']
85
+ }
86
+ });
87
+ if (Array.isArray(config.postcssOptions.plugins)) {
88
+ config.postcssOptions.plugins.push(require('tailwindcss')(_tailwindConfig2));
89
+ } else {
90
+ config.postcssOptions.plugins = [require('tailwindcss')(_tailwindConfig2)];
91
+ }
78
92
  }
79
93
  },
80
94
  babel: function babel(config) {
81
95
  var _config$plugins;
82
-
83
96
  if (notHaveTwinMacro) {
84
97
  return;
85
98
  }
86
-
87
99
  var twinConfig = {
88
100
  twin: {
89
101
  preset: supportCssInJsLibrary,
@@ -94,36 +106,24 @@ export default (function () {
94
106
  if (Array.isArray(plugin) && plugin[0]) {
95
107
  var pluginTarget = plugin[0];
96
108
  var pluginOptions = plugin[1];
97
-
98
- if (typeof pluginTarget === 'string' && // TODO: use babel chain
109
+ if (typeof pluginTarget === 'string' &&
110
+ // TODO: use babel chain
99
111
  slash(pluginTarget).includes('compiled/babel-plugin-macros')) {
100
112
  if (pluginOptions) {
101
113
  pluginOptions = _objectSpread(_objectSpread({}, pluginOptions), twinConfig);
102
114
  } else {
103
115
  plugin.push(twinConfig);
104
116
  }
105
-
106
117
  return true;
107
118
  }
108
119
  }
109
-
110
120
  return false;
111
121
  });
112
122
  }
113
123
  }
114
124
  };
115
- },
116
- moduleTailwindConfig: function moduleTailwindConfig() {
117
- var modernConfig = api.useResolvedConfigContext();
118
- var tailwindConfig = getTailwindConfig(modernConfig, {
119
- pureConfig: {
120
- content: ['./src/**/*.js', './src/**/*.jsx', './src/**/*.ts', './src/**/*.tsx', './src/**/*.less', './src/**/*.css', './src/**/*.sass', './src/**/*.scss', './styles/**/*.less', './styles/**/*.css', './styles/**/*.sass', './styles/**/*.scss']
121
- }
122
- });
123
- return require('tailwindcss')(tailwindConfig);
124
125
  }
125
126
  });
126
-
127
127
  case 6:
128
128
  case "end":
129
129
  return _context.stop();
@@ -131,11 +131,9 @@ export default (function () {
131
131
  }
132
132
  }, _callee);
133
133
  }));
134
-
135
134
  function setup(_x) {
136
135
  return _setup.apply(this, arguments);
137
136
  }
138
-
139
137
  return setup;
140
138
  }()
141
139
  };
@@ -3,36 +3,32 @@ 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
5
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
6
- pluginName: '@modern-js/plugin-tailwindcss'
7
- },
8
- pluginName = _ref.pluginName;
9
-
6
+ pluginName: '@modern-js/plugin-tailwindcss'
7
+ },
8
+ pluginName = _ref.pluginName;
10
9
  return {
11
10
  name: '@modern-js/plugin-design-token',
12
11
  setup: function setup(api) {
13
12
  var pluginsExportsUtils;
14
13
  var resolveConfig = lazyImport('tailwindcss/resolveConfig', require);
15
14
  var PLUGIN_IDENTIFIER = 'designToken';
16
-
17
15
  var getDesignTokens = function getDesignTokens(userConfig) {
18
- var _ref2 = userConfig,
19
- designSystem = _ref2.source.designSystem; // TODO: Type to be filled
20
-
16
+ var _userConfig$source;
17
+ var designSystem = (_userConfig$source = userConfig.source) === null || _userConfig$source === void 0 ? void 0 : _userConfig$source.designSystem;
21
18
  var tailwindcssConfig = {};
22
- tailwindcssConfig.theme = designSystem ? _objectSpread({}, designSystem) : {}; // not use default design token when designToken.defaultTheme is false or theme is false
19
+ tailwindcssConfig.theme = designSystem ? _objectSpread({}, designSystem) : {};
23
20
 
21
+ // not use default design token when designToken.defaultTheme is false or theme is false
24
22
  if (!designSystem) {
25
23
  tailwindcssConfig.presets = [];
26
- } // when only designSystem exist, need remove supportStyledComponents
27
-
24
+ }
28
25
 
26
+ // when only designSystem exist, need remove supportStyledComponents
29
27
  if (designSystem) {
30
28
  delete tailwindcssConfig.theme.supportStyledComponents;
31
29
  }
32
-
33
30
  return resolveConfig(tailwindcssConfig).theme || {};
34
31
  };
35
-
36
32
  return {
37
33
  config: function config() {
38
34
  var appContext = api.useAppContext();
@@ -43,19 +39,20 @@ export default (function () {
43
39
  '@modern-js/runtime/plugins': pluginsExportsUtils.getPath()
44
40
  }
45
41
  },
46
- tools: {// TODO: support less、scss、css vars
42
+ tools: {
43
+ // TODO: support less、scss、css vars
47
44
  // less: https://github.com/modern-js-dev/modern.js/pull/398/files#diff-f77c749e403fbf1fb676d5687bef3d7138a230331c849298d8afaff9b6afbc3dR166
48
45
  // sass: https://github.com/modern-js-dev/modern.js/pull/398/files#diff-f77c749e403fbf1fb676d5687bef3d7138a230331c849298d8afaff9b6afbc3dR229
49
46
  // postcss: https://github.com/modern-js-dev/modern.js/pull/398/files#diff-f77c749e403fbf1fb676d5687bef3d7138a230331c849298d8afaff9b6afbc3dR281
50
47
  }
51
48
  };
52
49
  },
53
- modifyEntryImports: function modifyEntryImports(_ref3) {
54
- var entrypoint = _ref3.entrypoint,
55
- imports = _ref3.imports;
50
+ modifyEntryImports: function modifyEntryImports(_ref2) {
51
+ var _userConfig$source$de, _userConfig$source2;
52
+ var entrypoint = _ref2.entrypoint,
53
+ imports = _ref2.imports;
56
54
  var userConfig = api.useResolvedConfigContext();
57
- var designSystem = userConfig.source.designSystem;
58
-
55
+ var designSystem = (_userConfig$source$de = (_userConfig$source2 = userConfig.source) === null || _userConfig$source2 === void 0 ? void 0 : _userConfig$source2.designSystem) !== null && _userConfig$source$de !== void 0 ? _userConfig$source$de : {};
59
56
  if (_typeof(designSystem) === 'object' && designSystem.supportStyledComponents) {
60
57
  var designTokens = getDesignTokens(userConfig);
61
58
  imports.push({
@@ -66,33 +63,28 @@ export default (function () {
66
63
  initialize: "\n const designTokens = ".concat(JSON.stringify(designTokens), ";\n ")
67
64
  });
68
65
  }
69
-
70
66
  return {
71
67
  entrypoint: entrypoint,
72
68
  imports: imports
73
69
  };
74
70
  },
75
- modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(_ref4) {
76
- var entrypoint = _ref4.entrypoint,
77
- plugins = _ref4.plugins;
78
-
79
- var _ref5 = api.useResolvedConfigContext(),
80
- designSystem = _ref5.source.designSystem;
81
-
71
+ modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(_ref3) {
72
+ var _userConfig$source$de2, _userConfig$source3;
73
+ var entrypoint = _ref3.entrypoint,
74
+ plugins = _ref3.plugins;
75
+ var userConfig = api.useResolvedConfigContext();
76
+ var designSystem = (_userConfig$source$de2 = (_userConfig$source3 = userConfig.source) === null || _userConfig$source3 === void 0 ? void 0 : _userConfig$source3.designSystem) !== null && _userConfig$source$de2 !== void 0 ? _userConfig$source$de2 : {};
82
77
  var useSCThemeProvider = true;
83
-
84
78
  if (designSystem) {
85
79
  // when designSystem exist, designToken.styledComponents`s default value is false.
86
80
  useSCThemeProvider = (designSystem === null || designSystem === void 0 ? void 0 : designSystem.supportStyledComponents) || false;
87
81
  }
88
-
89
82
  if (_typeof(designSystem) === 'object' && designSystem.supportStyledComponents) {
90
83
  plugins.push({
91
84
  name: PLUGIN_IDENTIFIER,
92
85
  options: "{token: designTokens, useStyledComponentsThemeProvider: ".concat(useSCThemeProvider ? 'true' : 'false', ", useDesignTokenContext: false}")
93
86
  });
94
87
  }
95
-
96
88
  return {
97
89
  entrypoint: entrypoint,
98
90
  plugins: plugins
@@ -1,19 +1,16 @@
1
1
  export default (function () {
2
2
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
3
- _ref$cssVarsHash = _ref.cssVarsHash,
4
- cssVarsHash = _ref$cssVarsHash === void 0 ? {} : _ref$cssVarsHash;
5
-
3
+ _ref$cssVarsHash = _ref.cssVarsHash,
4
+ cssVarsHash = _ref$cssVarsHash === void 0 ? {} : _ref$cssVarsHash;
6
5
  return {
7
6
  postcssPlugin: 'postcss-replace-css-vars',
8
7
  Declaration: function (_Declaration) {
9
8
  function Declaration(_x) {
10
9
  return _Declaration.apply(this, arguments);
11
10
  }
12
-
13
11
  Declaration.toString = function () {
14
12
  return _Declaration.toString();
15
13
  };
16
-
17
14
  return Declaration;
18
15
  }(function (decl) {
19
16
  if (decl.value && typeof decl.value === 'string') {
@@ -21,7 +18,6 @@ export default (function () {
21
18
  if (cssVarsHash[match]) {
22
19
  return cssVarsHash[match];
23
20
  }
24
-
25
21
  return match;
26
22
  });
27
23
  }
@@ -14,19 +14,16 @@ export default (function () {
14
14
  return {
15
15
  hoc: function hoc(_ref, next) {
16
16
  var App = _ref.App;
17
-
18
17
  var DesignTokenAppWrapper = function DesignTokenAppWrapper(props) {
19
18
  var _options$token = options.token,
20
- token = _options$token === void 0 ? {} : _options$token,
21
- _options$useStyledCom = options.useStyledComponentsThemeProvider,
22
- useStyledComponentsThemeProvider = _options$useStyledCom === void 0 ? false : _options$useStyledCom,
23
- _options$useDesignTok = options.useDesignTokenContext,
24
- useDesignTokenContext = _options$useDesignTok === void 0 ? false : _options$useDesignTok;
25
-
19
+ token = _options$token === void 0 ? {} : _options$token,
20
+ _options$useStyledCom = options.useStyledComponentsThemeProvider,
21
+ useStyledComponentsThemeProvider = _options$useStyledCom === void 0 ? false : _options$useStyledCom,
22
+ _options$useDesignTok = options.useDesignTokenContext,
23
+ useDesignTokenContext = _options$useDesignTok === void 0 ? false : _options$useDesignTok;
26
24
  if (useStyledComponentsThemeProvider && useDesignTokenContext) {
27
25
  var _require = require('@modern-js/runtime/styled'),
28
- ThemeProvider = _require.ThemeProvider;
29
-
26
+ ThemeProvider = _require.ThemeProvider;
30
27
  return /*#__PURE__*/_jsx(ThemeProvider, {
31
28
  theme: token,
32
29
  children: /*#__PURE__*/_jsx(DesignTokenContext.Provider, {
@@ -36,8 +33,7 @@ export default (function () {
36
33
  });
37
34
  } else if (useStyledComponentsThemeProvider) {
38
35
  var _require2 = require('@modern-js/runtime/styled'),
39
- _ThemeProvider = _require2.ThemeProvider;
40
-
36
+ _ThemeProvider = _require2.ThemeProvider;
41
37
  return /*#__PURE__*/_jsx(_ThemeProvider, {
42
38
  theme: token,
43
39
  children: /*#__PURE__*/_jsx(App, _objectSpread({}, props))
@@ -51,7 +47,6 @@ export default (function () {
51
47
  return /*#__PURE__*/_jsx(App, _objectSpread({}, props));
52
48
  }
53
49
  };
54
-
55
50
  return next({
56
51
  App: hoistNonReactStatics(DesignTokenAppWrapper, App)
57
52
  });
@@ -1,7 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import { applyOptionsChain, logger } from '@modern-js/utils';
3
3
  import { merge, cloneDeep } from '@modern-js/utils/lodash';
4
-
5
4
  var checkIfExistNotAllowKeys = function checkIfExistNotAllowKeys(tailwindConfig) {
6
5
  var notAllowExistKeys = ['theme'];
7
6
  var notAllowKey = '';
@@ -10,14 +9,13 @@ var checkIfExistNotAllowKeys = function checkIfExistNotAllowKeys(tailwindConfig)
10
9
  });
11
10
  return [ret, notAllowKey];
12
11
  };
13
-
14
12
  var getPureDesignSystemConfig = function getPureDesignSystemConfig(designSystemConfig) {
15
13
  var pureDesignSystemConfig = cloneDeep(designSystemConfig);
16
14
  delete pureDesignSystemConfig.supportStyledComponents;
17
15
  return pureDesignSystemConfig;
18
16
  };
19
-
20
17
  var getTailwindConfig = function getTailwindConfig(config) {
18
+ var _config$tools, _ref, _designSystem;
21
19
  var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22
20
  var purgeConfig = merge({
23
21
  // TODO: how the operating environment is determined
@@ -29,23 +27,20 @@ var getTailwindConfig = function getTailwindConfig(config) {
29
27
  var defaultTailwindConfig = {
30
28
  purge: purgeConfig
31
29
  };
32
- var tailwindConfig = applyOptionsChain(defaultTailwindConfig, config.tools.tailwindcss || {});
33
- var designSystem = getPureDesignSystemConfig(config.source.designSystem || {});
34
-
30
+ var tailwindConfig = applyOptionsChain(defaultTailwindConfig, ((_config$tools = config.tools) === null || _config$tools === void 0 ? void 0 : _config$tools.tailwindcss) || {});
31
+ var designSystem = getPureDesignSystemConfig((_ref = (_designSystem = config.designSystem) !== null && _designSystem !== void 0 ? _designSystem : config.source.designSystem) !== null && _ref !== void 0 ? _ref : {});
35
32
  var _checkIfExistNotAllow = checkIfExistNotAllowKeys(tailwindConfig),
36
- _checkIfExistNotAllow2 = _slicedToArray(_checkIfExistNotAllow, 2),
37
- exist = _checkIfExistNotAllow2[0],
38
- key = _checkIfExistNotAllow2[1];
39
-
33
+ _checkIfExistNotAllow2 = _slicedToArray(_checkIfExistNotAllow, 2),
34
+ exist = _checkIfExistNotAllow2[0],
35
+ key = _checkIfExistNotAllow2[1];
40
36
  if (exist) {
41
- logger.error("should not exist '".concat(key, "' on tools.tailwindcss, please remove it")); // eslint-disable-next-line no-process-exit
42
-
37
+ logger.error("should not exist '".concat(key, "' on tools.tailwindcss, please remove it"));
38
+ // eslint-disable-next-line no-process-exit
43
39
  process.exit(0);
44
- } // Because there is no default theme configuration
45
-
40
+ }
46
41
 
42
+ // Because there is no default theme configuration
47
43
  tailwindConfig.theme = designSystem || {};
48
44
  return tailwindConfig;
49
45
  };
50
-
51
46
  export { getTailwindConfig };
File without changes
@@ -18,30 +18,22 @@ export var checkTwinMacroNotExist = /*#__PURE__*/function () {
18
18
  return fs.readJSON(path.join(appDirectory, 'package.json'), {
19
19
  "throws": false
20
20
  });
21
-
22
21
  case 3:
23
22
  _context.t0 = _context.sent;
24
-
25
23
  if (_context.t0) {
26
24
  _context.next = 6;
27
25
  break;
28
26
  }
29
-
30
27
  _context.t0 = {};
31
-
32
28
  case 6:
33
29
  packageJson = _context.t0;
34
-
35
30
  if (!(_typeof(packageJson.dependencies) === 'object' && packageJson.dependencies[depName] || _typeof(packageJson.devDependencies) === 'object' && packageJson.devDependencies[depName])) {
36
31
  _context.next = 9;
37
32
  break;
38
33
  }
39
-
40
34
  return _context.abrupt("return", false);
41
-
42
35
  case 9:
43
36
  return _context.abrupt("return", true);
44
-
45
37
  case 10:
46
38
  case "end":
47
39
  return _context.stop();
@@ -49,7 +41,6 @@ export var checkTwinMacroNotExist = /*#__PURE__*/function () {
49
41
  }
50
42
  }, _callee);
51
43
  }));
52
-
53
44
  return function checkTwinMacroNotExist(_x) {
54
45
  return _ref.apply(this, arguments);
55
46
  };
@@ -1,10 +1,8 @@
1
- import type { CliPlugin } from '@modern-js/core';
1
+ import type { LegacyAppTools, CliPlugin } from '@modern-js/app-tools';
2
2
  export declare const getRandomTwConfigFileName: (internalDirectory: string) => string;
3
-
4
3
  declare const _default: ({
5
4
  pluginName
6
5
  }?: {
7
6
  pluginName: string;
8
- }) => CliPlugin;
9
-
7
+ }) => CliPlugin<LegacyAppTools>;
10
8
  export default _default;
@@ -1,9 +1,7 @@
1
- import type { CliPlugin } from '@modern-js/core';
2
-
1
+ import type { CliPlugin, LegacyAppTools } from '@modern-js/app-tools';
3
2
  declare const _default: ({
4
3
  pluginName
5
4
  }?: {
6
5
  pluginName: string;
7
- }) => CliPlugin;
8
-
6
+ }) => CliPlugin<LegacyAppTools>;
9
7
  export default _default;
@@ -1,5 +1,4 @@
1
1
  import type { Declaration } from 'postcss';
2
-
3
2
  declare const _default: ({
4
3
  cssVarsHash
5
4
  }?: {
@@ -8,5 +7,4 @@ declare const _default: ({
8
7
  postcssPlugin: string;
9
8
  Declaration(decl: Declaration): void;
10
9
  };
11
-
12
10
  export default _default;
@@ -2,11 +2,9 @@ import type { Plugin } from '@modern-js/runtime';
2
2
  import React from 'react';
3
3
  export declare const DesignTokenContext: React.Context<any>;
4
4
  export declare const useDesignTokens: () => IDesignTokens;
5
-
6
5
  declare const _default: (options?: {
7
6
  token?: Record<string, any>;
8
7
  useStyledComponentsThemeProvider?: boolean;
9
8
  useDesignTokenContext?: boolean;
10
9
  }) => Plugin;
11
-
12
10
  export default _default;
@@ -1,5 +1,5 @@
1
- import type { NormalizedConfig } from '@modern-js/core';
2
- declare const getTailwindConfig: (config: NormalizedConfig, option?: {
1
+ import type { AppLegacyNormalizedConfig } from '@modern-js/app-tools';
2
+ declare const getTailwindConfig: (config: AppLegacyNormalizedConfig, option?: {
3
3
  pureConfig?: Record<string, any>;
4
4
  }) => any;
5
5
  export { getTailwindConfig };
@@ -0,0 +1,10 @@
1
+ export declare type LegacyUserConfig = {
2
+ designSystem?: Record<string, any> & {
3
+ supportStyledComponents?: boolean;
4
+ };
5
+ source?: {
6
+ designSystem?: Record<string, any> & {
7
+ supportStyledComponents?: boolean;
8
+ };
9
+ };
10
+ };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.0-beta.0",
14
+ "version": "2.0.0-beta.2",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -44,14 +44,10 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@babel/runtime": "^7.18.0",
47
- "@modern-js/utils": "2.0.0-beta.0",
48
- "hoist-non-react-statics": "^3.3.2"
47
+ "hoist-non-react-statics": "^3.3.2",
48
+ "@modern-js/utils": "2.0.0-beta.2"
49
49
  },
50
50
  "devDependencies": {
51
- "@modern-js/core": "2.0.0-beta.0",
52
- "@modern-js/runtime": "2.0.0-beta.0",
53
- "@modern-js/types": "2.0.0-beta.0",
54
- "@scripts/build": "2.0.0-beta.0",
55
51
  "@types/jest": "^27",
56
52
  "@types/node": "^14",
57
53
  "@types/tailwindcss": "^2.2.1",
@@ -60,11 +56,16 @@
60
56
  "jest": "^27",
61
57
  "react": "^18",
62
58
  "postcss": "^8.4.14",
63
- "@scripts/jest-config": "2.0.0-beta.0"
59
+ "@modern-js/core": "2.0.0-beta.2",
60
+ "@modern-js/runtime": "2.0.0-beta.2",
61
+ "@modern-js/types": "2.0.0-beta.2",
62
+ "@scripts/build": "2.0.0-beta.2",
63
+ "@modern-js/app-tools": "2.0.0-beta.2",
64
+ "@scripts/jest-config": "2.0.0-beta.2"
64
65
  },
65
66
  "peerDependencies": {
66
67
  "tailwindcss": "^2.0.4",
67
- "@modern-js/runtime": "^2.0.0-beta.0"
68
+ "@modern-js/runtime": "^2.0.0-beta.2"
68
69
  },
69
70
  "peerDependenciesMeta": {
70
71
  "@modern-js/runtime": {
@@ -77,9 +78,9 @@
77
78
  "access": "public"
78
79
  },
79
80
  "scripts": {
80
- "new": "modern new",
81
- "dev": "modern build --watch",
82
- "build": "modern build",
81
+ "new": "modern-lib new",
82
+ "dev": "modern-lib build --watch",
83
+ "build": "modern-lib build",
83
84
  "test": "jest --passWithNoTests"
84
85
  }
85
86
  }