@modern-js/plugin-tailwindcss 1.2.2 → 1.2.5

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/.eslintrc.js ADDED
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: ['@modern-js'],
4
+ parserOptions: {
5
+ // the base path used to search for `tsconfig.json`
6
+ tsconfigRootDir: __dirname,
7
+ // the relative path to sub-package's `tsconfig.json`
8
+ project: ['./tsconfig.json'],
9
+ },
10
+ };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @modern-js/plugin-tailwindcss
2
2
 
3
+ ## 1.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - b851d628: feat: convert to new plugin
8
+ - 61e3f623: feat: convert to new plugin
9
+ - Updated dependencies [c2046f37]
10
+ - Updated dependencies [10379961]
11
+ - Updated dependencies [61e3f623]
12
+ - @modern-js/utils@1.3.6
13
+ - @modern-js/plugin-design-token@1.0.2
14
+
15
+ ## 1.2.4
16
+
17
+ ### Patch Changes
18
+
19
+ - 83059b93: fix tailwindcss type reference
20
+ - 83059b93: fix tailwindcss generator
21
+ - Updated dependencies [969f172f]
22
+ - Updated dependencies [4c792f68]
23
+ - Updated dependencies [4b5d4bf4]
24
+ - Updated dependencies [62f5b8c8]
25
+ - Updated dependencies [55e18278]
26
+ - Updated dependencies [4499a674]
27
+ - Updated dependencies [403f5169]
28
+ - Updated dependencies [a7f42f48]
29
+ - @modern-js/core@1.4.4
30
+ - @modern-js/utils@1.3.3
31
+
32
+ ## 1.2.3
33
+
34
+ ### Patch Changes
35
+
36
+ - 8f24a514: fix: UserConfig is missing tools.tailwindcss type
37
+ - Updated dependencies [deeaa602]
38
+ - Updated dependencies [54786e58]
39
+ - @modern-js/utils@1.3.2
40
+ - @modern-js/core@1.4.3
41
+
3
42
  ## 1.2.2
4
43
 
5
44
  ### Patch Changes
@@ -7,54 +7,56 @@ exports.default = void 0;
7
7
 
8
8
  var _utils = require("@modern-js/utils");
9
9
 
10
- var _tailwind = require("./tailwind");
11
-
12
- const core = _utils.Import.lazy('@modern-js/core', require); // support designSystem.supportStyledComponents
13
-
14
-
15
- core.usePlugins([require.resolve('@modern-js/plugin-design-token/cli')]);
10
+ var _cli = _interopRequireDefault(require("@modern-js/plugin-design-token/cli"));
16
11
 
17
- var _default = core.createPlugin(() => ({
18
- validateSchema() {
19
- return _utils.PLUGIN_SCHEMAS['@modern-js/plugin-tailwindcss'];
20
- },
12
+ var _tailwind = require("./tailwind");
21
13
 
22
- config() {
23
- return {
24
- tools: {
25
- // TODO: Add interface about postcss config
26
- // TODO: In module project, also is called, but should not be called.
27
- postcss: config => {
28
- const modernConfig = core.useResolvedConfigContext();
29
- const tailwindConfig = (0, _tailwind.getTailwindConfig)(modernConfig, {
30
- pureConfig: {
31
- content: ['./config/html/**/*.html', './config/html/**/*.ejs', './config/html/**/*.hbs', './src/**/*.js', './src/**/*.jsx', './src/**/*.ts', './src/**/*.tsx', // about storybook
32
- './storybook/**/*', './styles/**/*.less', './styles/**/*.css', './styles/**/*.sass', './styles/**/*.scss']
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ var _default = () => ({
17
+ name: '@modern-js/plugin-tailwindcss',
18
+ // support designSystem.supportStyledComponents
19
+ usePlugins: [(0, _cli.default)()],
20
+ setup: api => ({
21
+ validateSchema() {
22
+ return _utils.PLUGIN_SCHEMAS['@modern-js/plugin-tailwindcss'];
23
+ },
24
+
25
+ config() {
26
+ return {
27
+ tools: {
28
+ // TODO: Add interface about postcss config
29
+ // TODO: In module project, also is called, but should not be called.
30
+ postcss: config => {
31
+ const modernConfig = api.useResolvedConfigContext();
32
+ const tailwindConfig = (0, _tailwind.getTailwindConfig)(modernConfig, {
33
+ pureConfig: {
34
+ content: ['./config/html/**/*.html', './config/html/**/*.ejs', './config/html/**/*.hbs', './src/**/*.js', './src/**/*.jsx', './src/**/*.ts', './src/**/*.tsx', // about storybook
35
+ './storybook/**/*', './styles/**/*.less', './styles/**/*.css', './styles/**/*.sass', './styles/**/*.scss']
36
+ }
37
+ });
38
+
39
+ if (Array.isArray(config.postcssOptions.plugins)) {
40
+ config.postcssOptions.plugins.push(require('tailwindcss')(tailwindConfig));
41
+ } else {
42
+ config.postcssOptions.plugins = [require('tailwindcss')(tailwindConfig)];
33
43
  }
34
- });
35
-
36
- if (Array.isArray(config.postcssOptions.plugins)) {
37
- config.postcssOptions.plugins.push(require('tailwindcss')(tailwindConfig));
38
- } else {
39
- config.postcssOptions.plugins = [require('tailwindcss')(tailwindConfig)];
40
44
  }
41
45
  }
42
- }
43
- };
44
- },
45
-
46
- moduleTailwindConfig() {
47
- const modernConfig = core.useResolvedConfigContext();
48
- const tailwindConfig = (0, _tailwind.getTailwindConfig)(modernConfig, {
49
- pureConfig: {
50
- 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']
51
- }
52
- });
53
- return require('tailwindcss')(tailwindConfig);
54
- }
55
-
56
- }), {
57
- name: '@modern-js/plugin-tailwindcss'
46
+ };
47
+ },
48
+
49
+ moduleTailwindConfig() {
50
+ const modernConfig = api.useResolvedConfigContext();
51
+ const tailwindConfig = (0, _tailwind.getTailwindConfig)(modernConfig, {
52
+ pureConfig: {
53
+ 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']
54
+ }
55
+ });
56
+ return require('tailwindcss')(tailwindConfig);
57
+ }
58
+
59
+ })
58
60
  });
59
61
 
60
62
  exports.default = _default;
@@ -10,6 +10,8 @@ Object.defineProperty(exports, "default", {
10
10
  }
11
11
  });
12
12
 
13
+ require("./types");
14
+
13
15
  var _cli = _interopRequireDefault(require("./cli"));
14
16
 
15
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ require("@modern-js/core");
@@ -1,3 +1,5 @@
1
- declare const _default: any;
1
+ import type { CliPlugin } from '@modern-js/core';
2
+
3
+ declare const _default: () => CliPlugin;
2
4
 
3
5
  export default _default;
@@ -1 +1,2 @@
1
+ import './types';
1
2
  export { default } from './cli';
@@ -0,0 +1,9 @@
1
+ import '@modern-js/core';
2
+ declare module '@modern-js/core' {
3
+ interface ToolsConfig {
4
+ tailwindcss?: Record<string, any> | ((options: Record<string, any>) => Record<string, any> | void);
5
+ }
6
+ interface SourceConfig {
7
+ designSystem?: Record<string, any>;
8
+ }
9
+ }
package/modern.config.js CHANGED
@@ -1,2 +1,8 @@
1
1
  /** @type {import('@modern-js/module-tools').UserConfig} */
2
- module.exports = {};
2
+ module.exports = {
3
+ output: {
4
+ packageFields: {
5
+ main: 'CJS+ES6',
6
+ },
7
+ },
8
+ };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.2",
14
+ "version": "1.2.5",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -29,17 +29,35 @@
29
29
  "./cli": {
30
30
  "jsnext:source": "./src/cli.ts",
31
31
  "default": "./dist/js/node/cli.js"
32
+ },
33
+ "./types": {
34
+ "node": {
35
+ "import": "./dist/js/modern/types.js",
36
+ "require": "./dist/js/node/types.js",
37
+ "types": "./dist/types/types.d.ts"
38
+ },
39
+ "default": "./dist/js/treeshaking/types.js"
40
+ }
41
+ },
42
+ "typesVersions": {
43
+ "*": {
44
+ ".": [
45
+ "./dist/types/index.d.ts"
46
+ ],
47
+ "types": [
48
+ "./dist/types/types.d.ts"
49
+ ]
32
50
  }
33
51
  },
34
52
  "dependencies": {
35
53
  "@babel/runtime": "^7",
36
- "@modern-js/utils": "^1.2.2",
37
- "@modern-js/plugin-design-token": "^1.0.1",
54
+ "@modern-js/utils": "^1.3.6",
55
+ "@modern-js/plugin-design-token": "^1.0.2",
38
56
  "lodash.clonedeep": "^4.5.0",
39
57
  "lodash.merge": "^4.6.2"
40
58
  },
41
59
  "devDependencies": {
42
- "@modern-js/core": "^1.4.2",
60
+ "@modern-js/core": "^1.6.0",
43
61
  "@scripts/build": "0.0.0",
44
62
  "@types/jest": "^26",
45
63
  "@types/lodash.clonedeep": "^4.5.6",
@@ -52,23 +70,16 @@
52
70
  "@scripts/jest-config": "0.0.0"
53
71
  },
54
72
  "peerDependencies": {
55
- "@modern-js/core": "^1.4.2",
56
73
  "tailwindcss": "^2.0.4"
57
74
  },
58
75
  "sideEffects": false,
59
- "modernConfig": {
60
- "output": {
61
- "packageFields": {
62
- "main": "CJS+ES6"
63
- }
64
- }
65
- },
66
76
  "publishConfig": {
67
77
  "registry": "https://registry.npmjs.org/",
68
78
  "access": "public"
69
79
  },
70
80
  "scripts": {
71
81
  "new": "modern new",
82
+ "dev": "modern build --watch",
72
83
  "build": "modern build",
73
84
  "test": "jest --passWithNoTests"
74
85
  },