@tmsfe/tmskit 0.0.30 → 0.0.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmsfe/tmskit",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "tmskit",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {
@@ -33,7 +33,9 @@
33
33
  "@rollup/plugin-json": "^4.0.3",
34
34
  "rollup": "^2.6.1"
35
35
  },
36
- "whiteDependencies": {},
36
+ "whiteDependencies": {
37
+ "unzipper": "0.10.11"
38
+ },
37
39
  "dependencies": {
38
40
  "ansi-colors": "1.1.0",
39
41
  "anymatch": "^1.3.0",
@@ -70,7 +72,7 @@
70
72
  "slash": "^1.0.0",
71
73
  "strip-comments": "^2.0.1",
72
74
  "through2": "^4.0.2",
73
- "unzipper": "^0.10.11",
75
+ "unzipper": "0.10.11",
74
76
  "vinyl": "^2.1.0",
75
77
  "vinyl-file": "^2.0.0",
76
78
  "vinyl-sourcemaps-apply": "^0.2.0"
@@ -81,4 +83,4 @@
81
83
  "jest": {
82
84
  "testEnvironment": "jest-environment-node"
83
85
  }
84
- }
86
+ }
@@ -2,8 +2,9 @@ const shelljs = require('shelljs');
2
2
  const fs = require('fs');
3
3
  const path = require('path');
4
4
  const io = require('../../../utils/io');
5
- const { createTask, resolve, getAbsolutePath } = require('../../../utils/widgets');
5
+ const { createTask, resolve, getAbsolutePath, filterField } = require('../../../utils/widgets');
6
6
  const { buildMpNpm } = require('../../../core/mpCi');
7
+ const { global } = require('../../../utils/global');
7
8
  const { setCache, getCache } = require('./cache');
8
9
  const { NODE_MODULES_DIR } = require('../../../config/constant');
9
10
  const { npmInstallAll } = require('../../../core/npm');
@@ -13,6 +14,15 @@ const { isDependenciesUpdate } = require('../../../core/checkDependencies');
13
14
 
14
15
  async function install(tmsConfig, subPackages, useCache = true) {
15
16
  const cwd = process.cwd();
17
+ // 加npm install之前的钩子
18
+ if (typeof tmsConfig?.hooks?.beforeNpmInstall === 'function') {
19
+ info('—————— 执行beforeNpmInstall ————');
20
+ await tmsConfig?.hooks?.beforeNpmInstall({
21
+ tmsConfig: filterField(tmsConfig, ['gitAccount']),
22
+ cmdOptions: global.getData('cmdOptions'),
23
+ });
24
+ info('—————— 执行beforeNpmInstall 完成 ————');
25
+ };
16
26
  const npmInstallRes = await createTask(
17
27
  npmInstall,
18
28
  '小程序 开始npm install',