@modern-js/plugin-tailwindcss 2.22.0 → 2.23.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/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @modern-js/plugin-tailwindcss
2
2
 
3
+ ## 2.23.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 7e6fb5f: chore: publishConfig add provenance config
8
+
9
+ chore: publishConfig 增加 provenance 配置
10
+
11
+ - c3216b5: chore: split the scheme into the plugin
12
+
13
+ chore: 拆分 scheme 到插件内部
14
+
15
+ - Updated dependencies [7e6fb5f]
16
+ - Updated dependencies [a7a7ad7]
17
+ - Updated dependencies [6dec7c2]
18
+ - Updated dependencies [c3216b5]
19
+ - @modern-js/runtime@2.23.0
20
+ - @modern-js/utils@2.23.0
21
+
22
+ ## 2.22.1
23
+
24
+ ### Patch Changes
25
+
26
+ - 5522285: fix(tailwind): should not add tools.babel config when not haveTwinMacro
27
+
28
+ fix(tailwind): 在没有命中 haveTwinMacro 时,不添加 tools.babel 配置
29
+
30
+ - Updated dependencies [e2848a2]
31
+ - Updated dependencies [9b69987]
32
+ - Updated dependencies [d4045ed]
33
+ - @modern-js/runtime@2.22.1
34
+ - @modern-js/utils@2.22.1
35
+
3
36
  ## 2.22.0
4
37
 
5
38
  ### Patch Changes
package/dist/cjs/cli.js CHANGED
@@ -78,7 +78,17 @@ const _default = ({ pluginName } = {
78
78
  }
79
79
  },
80
80
  validateSchema() {
81
- return _utils.PLUGIN_SCHEMAS["@modern-js/plugin-tailwindcss"];
81
+ return [
82
+ {
83
+ target: "tools.tailwindcss",
84
+ schema: {
85
+ typeof: [
86
+ "object",
87
+ "function"
88
+ ]
89
+ }
90
+ }
91
+ ];
82
92
  },
83
93
  config() {
84
94
  let tailwindConfig;
@@ -108,22 +118,20 @@ const _default = ({ pluginName } = {
108
118
  ];
109
119
  }
110
120
  },
111
- babel(_, { addPlugins }) {
112
- if (haveTwinMacro) {
113
- initTailwindConfig();
114
- addPlugins([
115
- [
116
- require.resolve("babel-plugin-macros"),
117
- {
118
- twin: {
119
- preset: supportCssInJsLibrary,
120
- config: internalTwConfigPath || tailwindConfig
121
- }
121
+ babel: haveTwinMacro ? (_, { addPlugins }) => {
122
+ initTailwindConfig();
123
+ addPlugins([
124
+ [
125
+ require.resolve("babel-plugin-macros"),
126
+ {
127
+ twin: {
128
+ preset: supportCssInJsLibrary,
129
+ config: internalTwConfigPath || tailwindConfig
122
130
  }
123
- ]
124
- ]);
125
- }
126
- }
131
+ }
132
+ ]
133
+ ]);
134
+ } : void 0
127
135
  }
128
136
  };
129
137
  },
@@ -89,7 +89,33 @@ const _default = ({ pluginName } = {
89
89
  };
90
90
  },
91
91
  validateSchema() {
92
- return _utils.PLUGIN_SCHEMAS["@modern-js/plugin-design-token"];
92
+ return [
93
+ // Legacy Features
94
+ {
95
+ target: "source.designSystem",
96
+ schema: {
97
+ typeof: [
98
+ "object"
99
+ ]
100
+ }
101
+ },
102
+ {
103
+ target: "source.designSystem.supportStyledComponents",
104
+ schema: {
105
+ type: [
106
+ "boolean"
107
+ ]
108
+ }
109
+ },
110
+ {
111
+ target: "designSystem",
112
+ schema: {
113
+ typeof: [
114
+ "object"
115
+ ]
116
+ }
117
+ }
118
+ ];
93
119
  },
94
120
  addRuntimeExports() {
95
121
  pluginsExportsUtils.addExport(`export { default as designToken } from '${pluginName}/runtime-design-token'`);
package/dist/esm/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  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
- import { PLUGIN_SCHEMAS, fs, CONFIG_CACHE_DIR, globby, nanoid, slash } from "@modern-js/utils";
4
+ import { fs, CONFIG_CACHE_DIR, globby, nanoid, slash } from "@modern-js/utils";
5
5
  import designTokenPlugin from "./design-token/cli";
6
6
  import { getTailwindConfig } from "./tailwind";
7
7
  import { template, checkTwinMacroExist, getTailwindPath, getTailwindVersion, getTwinMacroMajorVersion } from "./utils";
@@ -73,7 +73,17 @@ export default function() {
73
73
  }
74
74
  },
75
75
  validateSchema: function validateSchema() {
76
- return PLUGIN_SCHEMAS["@modern-js/plugin-tailwindcss"];
76
+ return [
77
+ {
78
+ target: "tools.tailwindcss",
79
+ schema: {
80
+ typeof: [
81
+ "object",
82
+ "function"
83
+ ]
84
+ }
85
+ }
86
+ ];
77
87
  },
78
88
  config: function config() {
79
89
  var tailwindConfig;
@@ -103,23 +113,21 @@ export default function() {
103
113
  ];
104
114
  }
105
115
  },
106
- babel: function babel(_, param) {
116
+ babel: haveTwinMacro ? function(_, param) {
107
117
  var addPlugins = param.addPlugins;
108
- if (haveTwinMacro) {
109
- initTailwindConfig();
110
- addPlugins([
111
- [
112
- require.resolve("babel-plugin-macros"),
113
- {
114
- twin: {
115
- preset: supportCssInJsLibrary,
116
- config: internalTwConfigPath || tailwindConfig
117
- }
118
+ initTailwindConfig();
119
+ addPlugins([
120
+ [
121
+ require.resolve("babel-plugin-macros"),
122
+ {
123
+ twin: {
124
+ preset: supportCssInJsLibrary,
125
+ config: internalTwConfigPath || tailwindConfig
118
126
  }
119
- ]
120
- ]);
121
- }
122
- }
127
+ }
128
+ ]
129
+ ]);
130
+ } : void 0
123
131
  }
124
132
  };
125
133
  },
@@ -1,5 +1,5 @@
1
1
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
- import { lazyImport, PLUGIN_SCHEMAS, createRuntimeExportsUtils } from "@modern-js/utils";
2
+ import { lazyImport, createRuntimeExportsUtils } from "@modern-js/utils";
3
3
  export default function() {
4
4
  var pluginName = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
5
5
  pluginName: "@modern-js/plugin-tailwindcss"
@@ -79,7 +79,33 @@ export default function() {
79
79
  };
80
80
  },
81
81
  validateSchema: function validateSchema() {
82
- return PLUGIN_SCHEMAS["@modern-js/plugin-design-token"];
82
+ return [
83
+ // Legacy Features
84
+ {
85
+ target: "source.designSystem",
86
+ schema: {
87
+ typeof: [
88
+ "object"
89
+ ]
90
+ }
91
+ },
92
+ {
93
+ target: "source.designSystem.supportStyledComponents",
94
+ schema: {
95
+ type: [
96
+ "boolean"
97
+ ]
98
+ }
99
+ },
100
+ {
101
+ target: "designSystem",
102
+ schema: {
103
+ typeof: [
104
+ "object"
105
+ ]
106
+ }
107
+ }
108
+ ];
83
109
  },
84
110
  addRuntimeExports: function addRuntimeExports() {
85
111
  pluginsExportsUtils.addExport("export { default as designToken } from '".concat(pluginName, "/runtime-design-token'"));
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import { PLUGIN_SCHEMAS, fs, CONFIG_CACHE_DIR, globby, nanoid, slash } from "@modern-js/utils";
2
+ import { fs, CONFIG_CACHE_DIR, globby, nanoid, slash } from "@modern-js/utils";
3
3
  import designTokenPlugin from "./design-token/cli";
4
4
  import { getTailwindConfig } from "./tailwind";
5
5
  import { template, checkTwinMacroExist, getTailwindPath, getTailwindVersion, getTwinMacroMajorVersion } from "./utils";
@@ -58,7 +58,17 @@ export default ({ pluginName } = {
58
58
  }
59
59
  },
60
60
  validateSchema() {
61
- return PLUGIN_SCHEMAS["@modern-js/plugin-tailwindcss"];
61
+ return [
62
+ {
63
+ target: "tools.tailwindcss",
64
+ schema: {
65
+ typeof: [
66
+ "object",
67
+ "function"
68
+ ]
69
+ }
70
+ }
71
+ ];
62
72
  },
63
73
  config() {
64
74
  let tailwindConfig;
@@ -88,22 +98,20 @@ export default ({ pluginName } = {
88
98
  ];
89
99
  }
90
100
  },
91
- babel(_, { addPlugins }) {
92
- if (haveTwinMacro) {
93
- initTailwindConfig();
94
- addPlugins([
95
- [
96
- require.resolve("babel-plugin-macros"),
97
- {
98
- twin: {
99
- preset: supportCssInJsLibrary,
100
- config: internalTwConfigPath || tailwindConfig
101
- }
101
+ babel: haveTwinMacro ? (_, { addPlugins }) => {
102
+ initTailwindConfig();
103
+ addPlugins([
104
+ [
105
+ require.resolve("babel-plugin-macros"),
106
+ {
107
+ twin: {
108
+ preset: supportCssInJsLibrary,
109
+ config: internalTwConfigPath || tailwindConfig
102
110
  }
103
- ]
104
- ]);
105
- }
106
- }
111
+ }
112
+ ]
113
+ ]);
114
+ } : void 0
107
115
  }
108
116
  };
109
117
  },
@@ -1,4 +1,4 @@
1
- import { lazyImport, PLUGIN_SCHEMAS, createRuntimeExportsUtils } from "@modern-js/utils";
1
+ import { lazyImport, createRuntimeExportsUtils } from "@modern-js/utils";
2
2
  export default ({ pluginName } = {
3
3
  pluginName: "@modern-js/plugin-tailwindcss"
4
4
  }) => {
@@ -79,7 +79,33 @@ export default ({ pluginName } = {
79
79
  };
80
80
  },
81
81
  validateSchema() {
82
- return PLUGIN_SCHEMAS["@modern-js/plugin-design-token"];
82
+ return [
83
+ // Legacy Features
84
+ {
85
+ target: "source.designSystem",
86
+ schema: {
87
+ typeof: [
88
+ "object"
89
+ ]
90
+ }
91
+ },
92
+ {
93
+ target: "source.designSystem.supportStyledComponents",
94
+ schema: {
95
+ type: [
96
+ "boolean"
97
+ ]
98
+ }
99
+ },
100
+ {
101
+ target: "designSystem",
102
+ schema: {
103
+ typeof: [
104
+ "object"
105
+ ]
106
+ }
107
+ }
108
+ ];
83
109
  },
84
110
  addRuntimeExports() {
85
111
  pluginsExportsUtils.addExport(`export { default as designToken } from '${pluginName}/runtime-design-token'`);
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.22.0",
18
+ "version": "2.23.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -49,7 +49,7 @@
49
49
  "babel-plugin-macros": "3.1.0",
50
50
  "hoist-non-react-statics": "^3.3.2",
51
51
  "@swc/helpers": "0.5.1",
52
- "@modern-js/utils": "2.22.0"
52
+ "@modern-js/utils": "2.23.0"
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.21",
62
- "@modern-js/core": "2.22.0",
63
- "@modern-js/module-tools": "2.22.0",
64
- "@modern-js/runtime": "2.22.0",
65
- "@modern-js/types": "2.22.0",
66
- "@scripts/build": "2.22.0",
67
- "@modern-js/app-tools": "2.22.0",
68
- "@scripts/jest-config": "2.22.0"
62
+ "@modern-js/core": "2.23.0",
63
+ "@modern-js/module-tools": "2.23.0",
64
+ "@modern-js/types": "2.23.0",
65
+ "@modern-js/runtime": "2.23.0",
66
+ "@scripts/build": "2.23.0",
67
+ "@modern-js/app-tools": "2.23.0",
68
+ "@scripts/jest-config": "2.23.0"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "tailwindcss": ">= 2.0.0 || >= 3.0.0",
72
- "@modern-js/runtime": "^2.22.0"
72
+ "@modern-js/runtime": "^2.23.0"
73
73
  },
74
74
  "peerDependenciesMeta": {
75
75
  "@modern-js/runtime": {
@@ -79,7 +79,8 @@
79
79
  "sideEffects": false,
80
80
  "publishConfig": {
81
81
  "registry": "https://registry.npmjs.org/",
82
- "access": "public"
82
+ "access": "public",
83
+ "provenance": true
83
84
  },
84
85
  "scripts": {
85
86
  "new": "modern-lib new",