framework-for-react 1.0.5 → 1.0.7

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 (2) hide show
  1. package/babel.config.js +29 -7
  2. package/package.json +63 -64
package/babel.config.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ const config = {
2
2
  assumptions: {
3
3
  privateFieldsAsProperties: true,
4
4
  setPublicClassFields: true,
@@ -8,15 +8,37 @@ module.exports = {
8
8
  '@babel/plugin-transform-arrow-functions',
9
9
  ['@babel/plugin-proposal-decorators', { legacy: true }],
10
10
  ['@babel/plugin-proposal-private-methods' /*, { loose: true }*/],
11
- ['@babel/plugin-proposal-class-properties' /*, { loose: true }*/],
12
- [
11
+ ['@babel/plugin-transform-class-properties' /*, { loose: true }*/],
12
+ ],
13
+ compact: false,
14
+ };
15
+
16
+
17
+ const fs = require("fs");
18
+ const path = require('path');
19
+
20
+ function getPackageVersion (module) {
21
+ const pkgPath = path.join(__dirname + '/../' + module + '/package.json');
22
+ const pkgData = JSON.parse(fs.readFileSync(pkgPath));
23
+ return pkgData?.version;
24
+ }
25
+
26
+ try {
27
+ let antdVer = getPackageVersion('antd');
28
+ if (antdVer[0] < '5') {
29
+ console.log('antd use less than 5.x')
30
+ config.plugins.push([
13
31
  'babel-plugin-import',
14
32
  {
15
33
  libraryName: 'antd',
16
34
  libraryDirectory: 'lib',
17
35
  style: 'css',
18
36
  },
19
- ],
20
- ],
21
- compact: false,
22
- };
37
+ ])
38
+ }
39
+ } catch (e) {
40
+ console.log(e)
41
+ }
42
+
43
+
44
+ module.exports = config
package/package.json CHANGED
@@ -1,64 +1,63 @@
1
- {
2
- "name": "framework-for-react",
3
- "version": "1.0.5",
4
- "description": "framework for react18",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "files": [
10
- "index.js",
11
- "babel.config.js"
12
- ],
13
- "repository": {
14
- "type": "git",
15
- "url": "https://gitee.com/sky_yz/framework-for-react.git"
16
- },
17
- "keywords": [
18
- "framework",
19
- "react18",
20
- "webpack5"
21
- ],
22
- "author": "yzh",
23
- "license": "ISC",
24
- "dependencies": {
25
- "@babel/core": "^7.18.5",
26
- "@babel/plugin-proposal-class-properties": "^7.18.6",
27
- "@babel/plugin-proposal-decorators": "^7.20.7",
28
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
29
- "@babel/plugin-syntax-jsx": "^7.17.12",
30
- "@babel/plugin-transform-runtime": "^7.18.5",
31
- "@babel/polyfill": "^7.12.1",
32
- "@babel/preset-env": "^7.18.2",
33
- "@babel/preset-react": "^7.18.6",
34
- "@babel/runtime": "^7.18.3",
35
- "autoprefixer": "^10.4.7",
36
- "axios": "^1.3.5",
37
- "babel-loader": "^8.2.5",
38
- "babel-plugin-import": "^1.13.6",
39
- "classnames": "^2.3.1",
40
- "copy-webpack-plugin": "^8.1.1",
41
- "cross-env": "^7.0.3",
42
- "css-loader": "^6.7.1",
43
- "git-revision-webpack-plugin": "^5.0.0",
44
- "html-webpack-plugin": "^4.5.2",
45
- "less": "^4.1.3",
46
- "less-loader": "^7.3.0",
47
- "mini-css-extract-plugin": "^2.6.1",
48
- "postcss": "^8.4.14",
49
- "postcss-loader": "^7.0.0",
50
- "react": "^18.2.0",
51
- "react-dom": "^18.2.0",
52
- "react-intl": "^6.4.0",
53
- "react-redux": "^8.0.5",
54
- "react-router-dom": "^6.10.0",
55
- "redux": "^4.2.1",
56
- "redux-logger": "^3.0.6",
57
- "redux-thunk": "^2.4.2",
58
- "style-loader": "^3.3.1",
59
- "webpack": "^5.73.0",
60
- "webpack-cli": "^5.0.1",
61
- "webpack-dev-server": "^4.9.2",
62
- "webpack-merge": "^5.8.0"
63
- }
64
- }
1
+ {
2
+ "name": "framework-for-react",
3
+ "version": "1.0.7",
4
+ "description": "framework for react18",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "files": [
10
+ "index.js",
11
+ "babel.config.js"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://gitee.com/sky_yz/framework-for-react.git"
16
+ },
17
+ "keywords": [
18
+ "framework",
19
+ "react18",
20
+ "webpack5"
21
+ ],
22
+ "author": "yzh",
23
+ "license": "ISC",
24
+ "dependencies": {
25
+ "@babel/core": "^7.29.0",
26
+ "@babel/plugin-proposal-decorators": "^7.29.0",
27
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
28
+ "@babel/plugin-syntax-jsx": "^7.28.6",
29
+ "@babel/plugin-transform-class-properties": "^7.28.6",
30
+ "@babel/plugin-transform-runtime": "^7.29.0",
31
+ "@babel/preset-env": "^7.29.0",
32
+ "@babel/preset-react": "^7.28.5",
33
+ "@babel/runtime": "^7.28.6",
34
+ "autoprefixer": "^10.4.24",
35
+ "axios": "^1.13.5",
36
+ "babel-loader": "^10.0.0",
37
+ "babel-plugin-import": "^1.13.8",
38
+ "classnames": "^2.5.1",
39
+ "copy-webpack-plugin": "^13.0.1",
40
+ "cross-env": "^10.1.0",
41
+ "css-loader": "^7.1.3",
42
+ "git-revision-webpack-plugin": "^5.0.0",
43
+ "html-webpack-plugin": "^5.6.6",
44
+ "less": "^4.5.1",
45
+ "less-loader": "^12.3.1",
46
+ "mini-css-extract-plugin": "^2.10.0",
47
+ "postcss": "^8.5.6",
48
+ "postcss-loader": "^8.2.0",
49
+ "react": "^19.2.4",
50
+ "react-dom": "^19.2.4",
51
+ "react-intl": "^8.1.3",
52
+ "react-redux": "^9.2.0",
53
+ "react-router-dom": "^7.13.0",
54
+ "redux": "^5.0.1",
55
+ "redux-logger": "^3.0.6",
56
+ "redux-thunk": "^3.1.0",
57
+ "style-loader": "^4.0.0",
58
+ "webpack": "^5.105.1",
59
+ "webpack-cli": "^6.0.1",
60
+ "webpack-dev-server": "^5.2.3",
61
+ "webpack-merge": "^6.0.1"
62
+ }
63
+ }