@modern-js/plugin-tailwindcss 0.0.0-next-20240618090226 → 0.0.0-next-20240618094033

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.
@@ -27,7 +27,6 @@ const designTokenPlugin = ({ pluginName } = {
27
27
  }) => ({
28
28
  name: "@modern-js/plugin-design-token",
29
29
  setup(api) {
30
- let pluginsExportsUtils;
31
30
  const resolveConfig = (0, import_utils.lazyImport)("tailwindcss/resolveConfig", require);
32
31
  const PLUGIN_IDENTIFIER = "designToken";
33
32
  const getDesignTokens = (designSystem) => {
@@ -57,7 +56,7 @@ const designTokenPlugin = ({ pluginName } = {
57
56
  const designTokens = getDesignTokens(userConfig.source.designSystem);
58
57
  plugins.push({
59
58
  name: PLUGIN_IDENTIFIER,
60
- implementation: "@modern-js/plugin-tailwindcss/runtime-design-token",
59
+ implementation: `${pluginName}/runtime-design-token`,
61
60
  config: {
62
61
  token: designTokens,
63
62
  useStyledComponentsThemeProvider: Boolean(useSCThemeProvider),
@@ -70,18 +69,9 @@ const designTokenPlugin = ({ pluginName } = {
70
69
  plugins
71
70
  };
72
71
  },
73
- config() {
74
- const appContext = api.useAppContext();
75
- pluginsExportsUtils = (0, import_utils.createRuntimeExportsUtils)(appContext.internalDirectory, "plugins");
76
- return {
77
- source: {
78
- alias: {
79
- "@modern-js/runtime/plugins": pluginsExportsUtils.getPath()
80
- }
81
- }
82
- };
83
- },
84
72
  addRuntimeExports() {
73
+ const appContext = api.useAppContext();
74
+ const pluginsExportsUtils = (0, import_utils.createRuntimeExportsUtils)(appContext.internalDirectory, "plugins");
85
75
  pluginsExportsUtils.addExport(`export { default as designToken } from '${pluginName}/runtime-design-token'`);
86
76
  }
87
77
  };
@@ -1,5 +1,5 @@
1
1
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
- import { lazyImport, createRuntimeExportsUtils } from "@modern-js/utils";
2
+ import { createRuntimeExportsUtils, lazyImport } from "@modern-js/utils";
3
3
  var designTokenPlugin = function() {
4
4
  var pluginName = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
5
5
  pluginName: "@modern-js/plugin-tailwindcss"
@@ -7,7 +7,6 @@ var designTokenPlugin = function() {
7
7
  return {
8
8
  name: "@modern-js/plugin-design-token",
9
9
  setup: function setup(api) {
10
- var pluginsExportsUtils;
11
10
  var resolveConfig = lazyImport("tailwindcss/resolveConfig", require);
12
11
  var PLUGIN_IDENTIFIER = "designToken";
13
12
  var getDesignTokens = function(designSystem) {
@@ -36,7 +35,7 @@ var designTokenPlugin = function() {
36
35
  var designTokens = getDesignTokens(userConfig.source.designSystem);
37
36
  plugins.push({
38
37
  name: PLUGIN_IDENTIFIER,
39
- implementation: "@modern-js/plugin-tailwindcss/runtime-design-token",
38
+ implementation: "".concat(pluginName, "/runtime-design-token"),
40
39
  config: {
41
40
  token: designTokens,
42
41
  useStyledComponentsThemeProvider: Boolean(useSCThemeProvider),
@@ -49,18 +48,9 @@ var designTokenPlugin = function() {
49
48
  plugins
50
49
  };
51
50
  },
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
- };
62
- },
63
51
  addRuntimeExports: function addRuntimeExports() {
52
+ var appContext = api.useAppContext();
53
+ var pluginsExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "plugins");
64
54
  pluginsExportsUtils.addExport("export { default as designToken } from '".concat(pluginName, "/runtime-design-token'"));
65
55
  }
66
56
  };
@@ -1,10 +1,9 @@
1
- import { lazyImport, createRuntimeExportsUtils } from "@modern-js/utils";
1
+ import { createRuntimeExportsUtils, lazyImport } from "@modern-js/utils";
2
2
  const designTokenPlugin = ({ pluginName } = {
3
3
  pluginName: "@modern-js/plugin-tailwindcss"
4
4
  }) => ({
5
5
  name: "@modern-js/plugin-design-token",
6
6
  setup(api) {
7
- let pluginsExportsUtils;
8
7
  const resolveConfig = lazyImport("tailwindcss/resolveConfig", require);
9
8
  const PLUGIN_IDENTIFIER = "designToken";
10
9
  const getDesignTokens = (designSystem) => {
@@ -34,7 +33,7 @@ const designTokenPlugin = ({ pluginName } = {
34
33
  const designTokens = getDesignTokens(userConfig.source.designSystem);
35
34
  plugins.push({
36
35
  name: PLUGIN_IDENTIFIER,
37
- implementation: "@modern-js/plugin-tailwindcss/runtime-design-token",
36
+ implementation: `${pluginName}/runtime-design-token`,
38
37
  config: {
39
38
  token: designTokens,
40
39
  useStyledComponentsThemeProvider: Boolean(useSCThemeProvider),
@@ -47,18 +46,9 @@ const designTokenPlugin = ({ pluginName } = {
47
46
  plugins
48
47
  };
49
48
  },
50
- config() {
51
- const appContext = api.useAppContext();
52
- pluginsExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "plugins");
53
- return {
54
- source: {
55
- alias: {
56
- "@modern-js/runtime/plugins": pluginsExportsUtils.getPath()
57
- }
58
- }
59
- };
60
- },
61
49
  addRuntimeExports() {
50
+ const appContext = api.useAppContext();
51
+ const pluginsExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "plugins");
62
52
  pluginsExportsUtils.addExport(`export { default as designToken } from '${pluginName}/runtime-design-token'`);
63
53
  }
64
54
  };
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-20240618090226",
18
+ "version": "0.0.0-next-20240618094033",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -48,8 +48,8 @@
48
48
  "dependencies": {
49
49
  "babel-plugin-macros": "3.1.0",
50
50
  "@swc/helpers": "0.5.3",
51
- "@modern-js/utils": "0.0.0-next-20240618090226",
52
- "@modern-js/node-bundle-require": "0.0.0-next-20240618090226"
51
+ "@modern-js/utils": "0.0.0-next-20240618094033",
52
+ "@modern-js/node-bundle-require": "0.0.0-next-20240618094033"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/jest": "^29",
@@ -59,17 +59,17 @@
59
59
  "jest": "^29",
60
60
  "react": "^18",
61
61
  "postcss": "^8.4.35",
62
- "@modern-js/core": "0.0.0-next-20240618090226",
63
- "@modern-js/runtime": "0.0.0-next-20240618090226",
64
- "@modern-js/types": "0.0.0-next-20240618090226",
65
- "@modern-js/module-tools": "0.0.0-next-20240618090226",
66
- "@scripts/build": "0.0.0-next-20240618090226",
67
- "@scripts/jest-config": "0.0.0-next-20240618090226",
68
- "@modern-js/app-tools": "0.0.0-next-20240618090226"
62
+ "@modern-js/core": "0.0.0-next-20240618094033",
63
+ "@modern-js/runtime": "0.0.0-next-20240618094033",
64
+ "@modern-js/types": "0.0.0-next-20240618094033",
65
+ "@modern-js/module-tools": "0.0.0-next-20240618094033",
66
+ "@scripts/build": "0.0.0-next-20240618094033",
67
+ "@modern-js/app-tools": "0.0.0-next-20240618094033",
68
+ "@scripts/jest-config": "0.0.0-next-20240618094033"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "tailwindcss": ">= 2.0.0 || >= 3.0.0",
72
- "@modern-js/runtime": "0.0.0-next-20240618090226"
72
+ "@modern-js/runtime": "0.0.0-next-20240618094033"
73
73
  },
74
74
  "peerDependenciesMeta": {
75
75
  "@modern-js/runtime": {