@modern-js/plugin-tailwindcss 1.2.3 → 1.2.6

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,45 @@
1
1
  # @modern-js/plugin-tailwindcss
2
2
 
3
+ ## 1.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - bebb39b6: chore: improve devDependencies and peerDependencies
8
+ - 132f7b53: feat: move config declarations to @modern-js/core
9
+ - Updated dependencies [bebb39b6]
10
+ - Updated dependencies [132f7b53]
11
+ - @modern-js/plugin-design-token@1.0.3
12
+ - @modern-js/utils@1.3.7
13
+
14
+ ## 1.2.5
15
+
16
+ ### Patch Changes
17
+
18
+ - b851d628: feat: convert to new plugin
19
+ - 61e3f623: feat: convert to new plugin
20
+ - Updated dependencies [c2046f37]
21
+ - Updated dependencies [10379961]
22
+ - Updated dependencies [61e3f623]
23
+ - @modern-js/utils@1.3.6
24
+ - @modern-js/plugin-design-token@1.0.2
25
+
26
+ ## 1.2.4
27
+
28
+ ### Patch Changes
29
+
30
+ - 83059b93: fix tailwindcss type reference
31
+ - 83059b93: fix tailwindcss generator
32
+ - Updated dependencies [969f172f]
33
+ - Updated dependencies [4c792f68]
34
+ - Updated dependencies [4b5d4bf4]
35
+ - Updated dependencies [62f5b8c8]
36
+ - Updated dependencies [55e18278]
37
+ - Updated dependencies [4499a674]
38
+ - Updated dependencies [403f5169]
39
+ - Updated dependencies [a7f42f48]
40
+ - @modern-js/core@1.4.4
41
+ - @modern-js/utils@1.3.3
42
+
3
43
  ## 1.2.3
4
44
 
5
45
  ### 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,8 +10,6 @@ Object.defineProperty(exports, "default", {
10
10
  }
11
11
  });
12
12
 
13
- require("./types");
14
-
15
13
  var _cli = _interopRequireDefault(require("./cli"));
16
14
 
17
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -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,2 +1 @@
1
- import './types';
2
1
  export { default } from './cli';
package/jest.config.js CHANGED
@@ -2,7 +2,6 @@ const sharedConfig = require('@scripts/jest-config');
2
2
 
3
3
  /** @type {import('@jest/types').Config.InitialOptions} */
4
4
  module.exports = {
5
- // eslint-disable-next-line node/no-unsupported-features/es-syntax
6
5
  ...sharedConfig,
7
6
  rootDir: __dirname,
8
7
  };
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.3",
14
+ "version": "1.2.6",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -33,13 +33,13 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7",
36
- "@modern-js/utils": "^1.3.2",
37
- "@modern-js/plugin-design-token": "^1.0.1",
36
+ "@modern-js/utils": "^1.3.7",
37
+ "@modern-js/plugin-design-token": "^1.0.3",
38
38
  "lodash.clonedeep": "^4.5.0",
39
39
  "lodash.merge": "^4.6.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@modern-js/core": "^1.4.3",
42
+ "@modern-js/core": "1.6.1",
43
43
  "@scripts/build": "0.0.0",
44
44
  "@types/jest": "^26",
45
45
  "@types/lodash.clonedeep": "^4.5.6",
@@ -52,23 +52,16 @@
52
52
  "@scripts/jest-config": "0.0.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@modern-js/core": "^1.4.3",
56
55
  "tailwindcss": "^2.0.4"
57
56
  },
58
57
  "sideEffects": false,
59
- "modernConfig": {
60
- "output": {
61
- "packageFields": {
62
- "main": "CJS+ES6"
63
- }
64
- }
65
- },
66
58
  "publishConfig": {
67
59
  "registry": "https://registry.npmjs.org/",
68
60
  "access": "public"
69
61
  },
70
62
  "scripts": {
71
63
  "new": "modern new",
64
+ "dev": "modern build --watch",
72
65
  "build": "modern build",
73
66
  "test": "jest --passWithNoTests"
74
67
  },
@@ -1,3 +0,0 @@
1
- "use strict";
2
-
3
- require("@modern-js/core");
@@ -1,6 +0,0 @@
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
- }