glyphix 1.0.40 → 1.1.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.
Files changed (2) hide show
  1. package/bin/glyphix.js +16 -6
  2. package/package.json +2 -2
package/bin/glyphix.js CHANGED
@@ -117,8 +117,8 @@ var import_esbuild = __toESM(require("esbuild"));
117
117
  var import_node_path3 = require("path");
118
118
  var import_node_fs = require("fs");
119
119
  var import_dotenv = __toESM(require("dotenv"));
120
- var import_lodash = require("lodash");
121
120
  var import_node_child_process = require("child_process");
121
+ var import_deepmerge = __toESM(require("deepmerge"));
122
122
  var GxGenerate = class {
123
123
  constructor() {
124
124
  // 执行 gx 命令的目录路径
@@ -199,7 +199,7 @@ var GxGenerate = class {
199
199
  target: "node14",
200
200
  // 目标平台设置为最新 ECMAScript
201
201
  define: {
202
- // 'process.env.GLYPHIX_APP_VERSION': `"${this.getGitVersion()}"`,
202
+ "process.env.GLYPHIX_APP_VERSION": `"${this.getGitVersion()}"`,
203
203
  ...this.loadEnv()
204
204
  },
205
205
  nodePaths: [(0, import_node_path3.resolve)(this.sourceRoot, "..", "node_modules")],
@@ -252,7 +252,13 @@ var GxGenerate = class {
252
252
  if (!(0, import_node_fs.existsSync)(customConfigPath)) return internalConfig;
253
253
  try {
254
254
  const useConfig = require(customConfigPath);
255
- return (0, import_lodash.merge)(internalConfig, useConfig);
255
+ const a = (0, import_deepmerge.default)(internalConfig, useConfig, {
256
+ arrayMerge: (targetArray, sourceArray) => [
257
+ ...targetArray,
258
+ ...sourceArray
259
+ ]
260
+ });
261
+ return a;
256
262
  } catch (error) {
257
263
  console.error(error);
258
264
  }
@@ -296,9 +302,13 @@ var GxGenerate = class {
296
302
  });
297
303
  });
298
304
  }
299
- // getGitVersion() {
300
- // return execSync('git rev-parse HEAD').toString().trim();
301
- // }
305
+ getGitVersion() {
306
+ try {
307
+ return (0, import_node_child_process.execSync)("git rev-parse HEAD").toString().trim();
308
+ } catch (err) {
309
+ return "not git version";
310
+ }
311
+ }
302
312
  build() {
303
313
  const curDir = process.cwd();
304
314
  this.installDependencies().then(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glyphix",
3
- "version": "1.0.40",
3
+ "version": "1.1.0",
4
4
  "main": "lib/index.js",
5
5
  "types": "types/index.d.ts",
6
6
  "files": [
@@ -50,13 +50,13 @@
50
50
  "dependencies": {
51
51
  "adm-zip": "^0.5.16",
52
52
  "chalk": "^4.1.2",
53
+ "deepmerge": "^4.3.1",
53
54
  "dotenv": "^16.4.7",
54
55
  "esbuild": "^0.24.2",
55
56
  "esbuild-plugin-d.ts": "^1.3.1",
56
57
  "eslint": "^9.18.0",
57
58
  "fs-extra": "^11.2.0",
58
59
  "glob": "^11.0.1",
59
- "lodash": "^4.17.21",
60
60
  "yargs": "^17.7.2"
61
61
  },
62
62
  "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"