wgt-node-utils 1.2.46 → 1.2.48

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.
@@ -1,15 +1,15 @@
1
- /*!
2
- * mime-db
3
- * Copyright(c) 2014 Jonathan Ong
4
- * Copyright(c) 2015-2022 Douglas Christopher Wilson
5
- * MIT Licensed
6
- */
7
-
8
- /*!
9
- * mime-types
10
- * Copyright(c) 2014 Jonathan Ong
11
- * Copyright(c) 2015 Douglas Christopher Wilson
12
- * MIT Licensed
13
- */
14
-
15
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
1
+ /*!
2
+ * mime-db
3
+ * Copyright(c) 2014 Jonathan Ong
4
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
5
+ * MIT Licensed
6
+ */
7
+
8
+ /*!
9
+ * mime-types
10
+ * Copyright(c) 2014 Jonathan Ong
11
+ * Copyright(c) 2015 Douglas Christopher Wilson
12
+ * MIT Licensed
13
+ */
14
+
15
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
package/eslint.config.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import globals from "globals";
2
- import pluginJs from "@eslint/js";
3
- import tseslint from "typescript-eslint";
4
- import pluginReact from "eslint-plugin-react";
5
-
6
-
7
- export default [
8
- {files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]},
9
- {languageOptions: { globals: globals.browser }},
10
- pluginJs.configs.recommended,
11
- ...tseslint.configs.recommended,
12
- pluginReact.configs.flat.recommended,
1
+ import globals from "globals";
2
+ import pluginJs from "@eslint/js";
3
+ import tseslint from "typescript-eslint";
4
+ import pluginReact from "eslint-plugin-react";
5
+
6
+
7
+ export default [
8
+ {files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]},
9
+ {languageOptions: { globals: globals.browser }},
10
+ pluginJs.configs.recommended,
11
+ ...tseslint.configs.recommended,
12
+ pluginReact.configs.flat.recommended,
13
13
  ];
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
- {
2
- "name": "wgt-node-utils",
3
- "version": "1.2.46",
4
- "description": "WGT工具类包",
5
- "main": "dist/bundle.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1",
8
- "build": "cross-env NODE_ENV=production webpack"
9
- },
10
- "keywords": [
11
- "utils",
12
- "test"
13
- ],
14
- "author": "rookie",
15
- "license": "ISC",
16
- "dependencies": {
17
- "axios": "^0.19.2",
18
- "bufferutil": "^4.0.8",
19
- "utf-8-validate": "^6.0.5"
20
- },
21
- "devDependencies": {
22
- "@babel/core": "^7.25.8",
23
- "@babel/preset-env": "^7.25.8",
24
- "@eslint/js": "^9.12.0",
25
- "@larksuiteoapi/node-sdk": "^1.37.2",
26
- "babel-cli": "^6.26.0",
27
- "babel-loader": "^9.2.1",
28
- "cross-env": "^7.0.3",
29
- "crypto-browserify": "^3.12.0",
30
- "eslint": "^9.12.0",
31
- "eslint-plugin-react": "^7.37.1",
32
- "fs": "0.0.1-security",
33
- "globals": "^15.11.0",
34
- "https": "^1.0.0",
35
- "path": "^0.12.7",
36
- "typescript-eslint": "^8.9.0",
37
- "webpack": "^5.95.0",
38
- "webpack-cli": "^5.1.4"
39
- }
40
- }
1
+ {
2
+ "name": "wgt-node-utils",
3
+ "version": "1.2.48",
4
+ "description": "WGT工具类包",
5
+ "main": "dist/bundle.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "build": "cross-env NODE_ENV=production webpack"
9
+ },
10
+ "keywords": [
11
+ "utils",
12
+ "test"
13
+ ],
14
+ "author": "rookie",
15
+ "license": "ISC",
16
+ "dependencies": {
17
+ "axios": "^0.19.2",
18
+ "bufferutil": "^4.0.8",
19
+ "utf-8-validate": "^6.0.5"
20
+ },
21
+ "devDependencies": {
22
+ "@babel/core": "^7.25.8",
23
+ "@babel/preset-env": "^7.25.8",
24
+ "@eslint/js": "^9.12.0",
25
+ "@larksuiteoapi/node-sdk": "^1.37.2",
26
+ "babel-cli": "^6.26.0",
27
+ "babel-loader": "^9.2.1",
28
+ "cross-env": "^7.0.3",
29
+ "crypto-browserify": "^3.12.0",
30
+ "eslint": "^9.12.0",
31
+ "eslint-plugin-react": "^7.37.1",
32
+ "fs": "0.0.1-security",
33
+ "globals": "^15.11.0",
34
+ "https": "^1.0.0",
35
+ "path": "^0.12.7",
36
+ "typescript-eslint": "^8.9.0",
37
+ "webpack": "^5.95.0",
38
+ "webpack-cli": "^5.1.4"
39
+ }
40
+ }
package/src/index.js CHANGED
@@ -275,6 +275,8 @@ class wgtNodeUtils {
275
275
 
276
276
  // 增加preact依赖
277
277
  this.fileContents['preact.min.js'] = fs.readFileSync(path.join(dirname, `../${buildName}/dist/preact.min.js`), 'utf8');
278
+ // 获取wgt-web-ui的css文件
279
+ this.fileContents['global.css'] = fs.readFileSync(path.join(dirname, `../${buildName}/assets/global.css`), 'utf8');
278
280
 
279
281
  console.log('静态资源列表:');
280
282
 
@@ -429,11 +431,10 @@ class wgtNodeUtils {
429
431
  * @param list 清理数组
430
432
  * @param need 需要的字段 [game_id,game_category]
431
433
  */
432
- clearGameCardListData = (list, need=[]) => {
433
- var result = {};
434
+ clearGameCardListData = (list, need = []) => {
434
435
  // 游戏卡片使用到的字段
435
436
  return list.map((item = {}) => {
436
-
437
+ var result = {};
437
438
  if (need.length === 0) {
438
439
  return {
439
440
  id: item.game_id,
@@ -456,7 +457,6 @@ class wgtNodeUtils {
456
457
  }
457
458
 
458
459
  });
459
-
460
460
  }
461
461
 
462
462
  // 用于渲染游戏详情的数据,清理无用字段
@@ -690,6 +690,15 @@ class wgtNodeUtils {
690
690
  return f2eFiles;
691
691
  }
692
692
 
693
+ /**
694
+ * 获取wgt-web-ui css静态资源
695
+ * 可以在项目中单独控制wgt-web-ui的css样式
696
+ */
697
+ getWgtWebUiCss = () => {
698
+ let globalCssStr = this.fileContents['global.css'];
699
+ return globalCssStr;
700
+ }
701
+
693
702
  /**
694
703
  *
695
704
  * @param {string} url 获取自定义政策信息URL