@tmsfe/tmskit 0.0.5 → 0.0.8

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 (53) hide show
  1. package/README.md +18 -2
  2. package/dist/index.cjs.js +2286 -1258
  3. package/package.json +24 -8
  4. package/src/compile/build.js +5 -0
  5. package/src/compile/compile.js +90 -0
  6. package/src/compile/dev.js +129 -0
  7. package/src/compile/plugins/less.js +116 -0
  8. package/src/compile/plugins/mpCommonDep.js +131 -0
  9. package/src/compile/plugins/mpJsonDep.js +112 -0
  10. package/src/compile/plugins/mpWxmlDep.js +194 -0
  11. package/src/compile/plugins/postcss-font-base64.js +72 -0
  12. package/src/compile/plugins/replaceEnv.js +29 -0
  13. package/src/compile/plugins/utils/pluginError.js +25 -0
  14. package/src/config/constant.js +11 -10
  15. package/src/config/defaultTmsConfig.js +9 -10
  16. package/src/core/buildAppJson.js +166 -0
  17. package/src/{utils → core}/checkDependencies.js +6 -6
  18. package/src/core/cloneModules.js +203 -0
  19. package/src/core/handleError.js +18 -0
  20. package/src/core/isInIt.js +69 -0
  21. package/src/{utils/mpCiUtils.js → core/mpCi.js} +0 -1
  22. package/src/core/npm.js +218 -0
  23. package/src/core/symbolicLink.js +24 -0
  24. package/src/core/tmsMpconfig.js +234 -0
  25. package/src/entry.js +50 -8
  26. package/src/index.js +31 -15
  27. package/src/init.js +2 -7
  28. package/src/scripts/create/index.js +2 -2
  29. package/src/scripts/run/build/index.js +3 -3
  30. package/src/scripts/run/dev/index.js +27 -52
  31. package/src/scripts/run/index.js +70 -36
  32. package/src/scripts/run/init/index.js +40 -42
  33. package/src/scripts/run/install/index.js +21 -29
  34. package/src/utils/findCssImport.js +30 -0
  35. package/src/utils/global.js +19 -33
  36. package/src/utils/io.js +86 -0
  37. package/src/utils/log.js +3 -0
  38. package/src/utils/widgets.js +59 -51
  39. package/CHANGELOG.md +0 -0
  40. package/main.js +0 -3
  41. package/rollup.config.js +0 -179
  42. package/src/utils/buildAppJson.js +0 -144
  43. package/src/utils/cliUtils.js +0 -35
  44. package/src/utils/cloneModules.js +0 -90
  45. package/src/utils/npmUtils.js +0 -126
  46. package/src/utils/tkitUtils.js +0 -84
  47. package/src/webpack/base.js +0 -65
  48. package/src/webpack/build.js +0 -21
  49. package/src/webpack/buildServer.js +0 -34
  50. package/src/webpack/dev.js +0 -31
  51. package/src/webpack/devServer.js +0 -37
  52. package/src/webpack/plugins/entryExtractPlugin/index.js +0 -28
  53. package/src/webpack/utils.js +0 -244
@@ -2,45 +2,40 @@ const shelljs = require('shelljs');
2
2
  const fs = require('fs');
3
3
  const io = require('../../../utils/io');
4
4
  const { resolve, createTask } = require('../../../utils/widgets');
5
- const { buildOutputAppJson } = require('../../../utils/buildAppJson');
6
- const { npmInstallAll } = require('../../../utils/npmUtils');
7
- const { buildMpNpm } = require('../../../utils/mpCiUtils');
8
- const { MODULE_CODE_DIR, CACHE_DIR, DEFAULT_COPY_CONFIG, DEFAULT_MODULE_DIR } = require('../../../config/constant');
9
- const { cloneModules } = require('../../../utils/cloneModules');
10
- const { tmsModulesMergeLocalModuleCfg } = require('../../../utils/tkitUtils');
11
- const { fail } = require('../../../utils/log');
5
+ const { buildOutputAppJson } = require('../../../core/buildAppJson');
6
+ const { symLink } = require('../../../core/symbolicLink');
7
+ const { MODULE_CODE_DIR, DEFAULT_COPY_CONFIG } = require('../../../config/constant');
8
+ const { cloneModules } = require('../../../core/cloneModules');
9
+ const { tmsModulesMergeLocalModuleCfg, subModulesMergeDepModules } = require('../../../core/tmsMpconfig');
10
+ const { fail, info } = require('../../../utils/log');
11
+ const install = require('../install');
12
12
 
13
13
  /**
14
- * 拷贝package.json\模块的代码到编译输出目录
14
+ * 拷贝相关配置文件到编译输出目录
15
15
  * @param { object } tmsConfig
16
16
  * @param { array } modules
17
17
  * @param { array } defaultFiles 默认需要拷贝的配置项
18
18
  * @returns
19
19
  */
20
20
  const cpFilesToOutput = function (tmsConfig, targetModules, defaultFiles) {
21
- const outputDir = resolve(tmsConfig.webpack.outputDir);
21
+ const outputDir = resolve(tmsConfig.outputDir);
22
22
  io.ensureDirExist(outputDir);
23
23
  defaultFiles.forEach((item) => {
24
24
  if (fs.existsSync(resolve(item))) {
25
- shelljs.cp('-rf', resolve(item), resolve(tmsConfig.webpack.outputDir, item));
25
+ shelljs.cp('-rf', resolve(item), resolve(tmsConfig.outputDir, item));
26
26
  }
27
27
  });
28
28
 
29
- // 拷贝模块的代码到编译输出目录
29
+ // 拷贝模块的package.json到编译输出目录
30
30
  targetModules.forEach((item) => {
31
- const outputModuleDir = resolve(`${tmsConfig.webpack.outputDir}/${item.root}`);
31
+ const outputModuleDir = resolve(`${tmsConfig.outputDir}/${item.root}`);
32
32
  if (!fs.existsSync(resolve(item.path))) {
33
33
  fail(`${item.path}模块代码路径不存在, 请检查tms.config.js的${item.name}模块的path`);
34
34
  process.exit(1);
35
35
  }
36
- if (!fs.existsSync(outputModuleDir)) {
37
- shelljs.mkdir('-p', outputModuleDir);
38
- } else {
39
- // 删除除了node_modules、miniprogram_npm 的其他文件
40
- // eslint-disable-next-line
41
- shelljs.exec('find . -not \( -name node_modules -or -name miniprogram_npm \) -delete', { silent: true });
42
- }
43
- shelljs.cp('-Rf', `${resolve(item.path)}/*`, outputModuleDir);
36
+ io.ensureDirExist(outputModuleDir);
37
+ const modulePackagePath = resolve(item.path, 'package.json');
38
+ if (fs.existsSync(modulePackagePath)) shelljs.cp('-Rf', modulePackagePath, outputModuleDir);
44
39
  });
45
40
  };
46
41
 
@@ -48,13 +43,14 @@ async function task(tmsConfig, targetModules) {
48
43
  // 下载和移动代码
49
44
  await createTask(
50
45
  cloneModules,
51
- '开始下载模块代码完成',
46
+ '开始下载模块代码',
52
47
  '下载模块代码码完成',
53
48
  )(MODULE_CODE_DIR, resolve('./'), targetModules);
54
49
 
55
50
  // tms.config.js的modules 合并 module.config.json的配置项
56
- const newModules = tmsModulesMergeLocalModuleCfg(targetModules, tmsConfig.appName, DEFAULT_MODULE_DIR);
57
- console.log('当前init的有效模块', newModules.map(item => item.name));
51
+ let newModules = tmsModulesMergeLocalModuleCfg(targetModules, tmsConfig.appName);
52
+ // A分包依赖了B分包的代码, merge B分包进行编译;
53
+ newModules = subModulesMergeDepModules(tmsConfig, newModules);
58
54
 
59
55
  // 拷贝相关配置文件到输出目录
60
56
  await createTask(
@@ -63,19 +59,8 @@ async function task(tmsConfig, targetModules) {
63
59
  '拷贝文件到编译输出目录完成',
64
60
  )(tmsConfig, newModules, DEFAULT_COPY_CONFIG);
65
61
 
66
- // npm install
67
- await createTask(
68
- npmInstallAll,
69
- '开始npm install',
70
- 'npm install 完成',
71
- )(newModules, resolve(tmsConfig.webpack.outputDir), `${CACHE_DIR}/node_modules`);
72
-
73
- // 构建miniprograme_npm
74
- await createTask(
75
- buildMpNpm,
76
- '开始构建miniprograme_npm',
77
- '构建miniprograme_npm 完成',
78
- )({ appId: tmsConfig.appId, projectPath: resolve('./'), privateKey: tmsConfig.privateKey });
62
+ // install
63
+ await install(tmsConfig, newModules, false);
79
64
 
80
65
  // 动态生成编译后的app.json;
81
66
  await createTask(
@@ -84,14 +69,27 @@ async function task(tmsConfig, targetModules) {
84
69
  '生成编译后的app.json完成',
85
70
  )(tmsConfig, newModules);
86
71
 
72
+ await createTask(
73
+ symLink,
74
+ '开始创建软链接',
75
+ '创建软链接完成',
76
+ )(tmsConfig);
77
+
87
78
  return newModules;
88
79
  }
89
- async function bootstrap(tmsConfig, targetModules) {
90
- const newModules = await task(tmsConfig, targetModules);
80
+ async function init(tmsConfig, targetModules) {
81
+ try {
82
+ const newModules = await task(tmsConfig, targetModules);
91
83
 
92
- return {
93
- targetModules: newModules,
94
- };
84
+ return {
85
+ targetModules: newModules,
86
+ };
87
+ } catch (error) {
88
+ const errMsg = typeof error === 'object' ? error.message : error;
89
+ fail(`init流程出现错误${errMsg}`);
90
+ info('详细的错误信息', error);
91
+ process.exit(1);
92
+ }
95
93
  }
96
94
 
97
- module.exports = bootstrap;
95
+ module.exports = init;
@@ -1,39 +1,31 @@
1
- const shelljs = require('shelljs');
2
- const { createTask } = require('../../../utils/widgets');
3
- const { buildMpNpm } = require('../../../utils/mpCiUtils');
4
- const glob = require('glob-ignore');
5
- const path = require('path');
1
+ const { createTask, resolve } = require('../../../utils/widgets');
2
+ const { buildMpNpm } = require('../../../core/mpCi');
3
+ const { CACHE_DIR } = require('../../../config/constant');
4
+ const { cloudNpmInstall, mpNpmInstallAll } = require('../../../core/npm');
5
+ const { global } = require('../../../utils/global');
6
6
 
7
- function npmInstall(contextDir) {
8
- return new Promise((resolve, reject) => {
9
- glob(`${contextDir}/**/package.json`, ['node_modules', 'miniprogram_npm'], (err, files) => {
10
- if (err) {
11
- reject(err);
12
- }
13
- files.forEach((file) => {
14
- const dir = path.dirname(file);
15
- shelljs.cd(dir);
16
- shelljs.exec('npx pnpm install --prod --registry http://mirrors.tencent.com/npm/', { silent: false });
17
- });
18
- resolve();
19
- });
20
- });
21
- }
22
-
23
- async function install(contextDir) {
24
- // npm install
7
+ async function install(tmsConfig, modules, isCloud = false) {
8
+ // 小程序npm install
25
9
  await createTask(
26
- npmInstall,
27
- '开始npm install',
28
- 'npm install完成',
29
- )(contextDir);
10
+ mpNpmInstallAll,
11
+ '小程序 开始npm install',
12
+ '小程序npm install 完成',
13
+ )(modules, resolve(tmsConfig.outputDir), `${CACHE_DIR}/node_modules`);
30
14
 
31
- // 构建miniprograme_npm
15
+ const tmsPrivateCf = global.getData('tmsPrivateCf');
16
+ // 构建miniprogram_npm
32
17
  await createTask(
33
18
  buildMpNpm,
34
19
  '开始构建miniprogram_npm',
35
20
  '构建miniprogram_npm 完成',
36
- )({ appId: 'null', projectPath: contextDir, privateKey: 'null' });
21
+ )({ appId: tmsConfig.appId, projectPath: resolve('./'), privateKey: tmsPrivateCf.privateKey });
22
+
23
+ // 安装云函数的
24
+ isCloud && createTask(
25
+ cloudNpmInstall,
26
+ '云函数npm install',
27
+ '云函数npm install安装完毕',
28
+ )(resolve(tmsConfig.cloudDir));
37
29
  }
38
30
 
39
31
  module.exports = install;
@@ -0,0 +1,30 @@
1
+ /* eslint-disable no-param-reassign */
2
+ const strip = require('strip-comments');
3
+ // 匹配规则
4
+ const MATCH_RULE = new RegExp(/@import *(?:url\(['"]?([^'")]+)['"]?\)|['"]([^'"]+)['"]);?/g);
5
+
6
+ /**
7
+ * 获取样式文件中的@import语句
8
+ * @param code 代码片段
9
+ * @returns 结果数组
10
+ */
11
+ const findCssImports = (code) => {
12
+ // 将buffer转成字符串
13
+ code = code.toString();
14
+ // 去除注释
15
+ code = strip.block(code);
16
+ // 定义最后返回的结果
17
+ const result = [];
18
+ let matchList;
19
+ // 循环遍历代码段,直至匹配结果为空
20
+ while ((matchList = MATCH_RULE.exec(code))) {
21
+ // 存入结果数组
22
+ result.push(matchList?.[1] || matchList?.[2]);
23
+ }
24
+ // 返回结果
25
+ return result;
26
+ };
27
+
28
+ module.exports = {
29
+ findCssImports,
30
+ };
@@ -1,36 +1,22 @@
1
- class Globale {
2
- constructor() {
3
- this.moduleCache = {};
4
- }
5
-
6
- setModuleCache(url, branch, dest) {
7
- const instance = getGlobalInstance();
8
-
9
- const key = `${branch}:${url}`;
10
-
11
- instance.moduleCache[key] = {
12
- dest,
13
- };
14
-
15
- return instance.moduleCache[key];
16
- }
17
-
18
- getModuleCache(url, branch) {
19
- const instance = getGlobalInstance();
20
-
21
- return instance.moduleCache[`${branch}:${url}`];
22
- }
23
- }
24
-
25
- let instance;
26
- function getGlobalInstance() {
27
- if (instance) {
28
- return instance;
29
- }
30
-
31
- return instance = new Globale();
32
- }
1
+ const global = {
2
+ data: {},
3
+ setData(...args) {
4
+ if (args.length === 1) {
5
+ Object.keys(args[0]).forEach((k) => {
6
+ if (args[0][k]) {
7
+ this.data[k] = args[0][k];
8
+ }
9
+ });
10
+ } else {
11
+ const [name, value] = args;
12
+ this.data[name] = value;
13
+ }
14
+ },
15
+ getData(name) {
16
+ return this.data[name];
17
+ },
18
+ };
33
19
 
34
20
  module.exports = {
35
- getGlobalInstance,
21
+ global,
36
22
  };
package/src/utils/io.js CHANGED
@@ -1,10 +1,23 @@
1
1
  const fs = require('fs');
2
+ const path = require('path');
3
+ const { info } = require('../utils/log');
2
4
  /**
3
5
  * 判断目录是否为空
4
6
  * @param {string} dirname 目录名
5
7
  * @returns
6
8
  */
7
9
  const isDirEmpty = dirname => fs.promises.readdir(dirname).then(files => files.length === 0);
10
+
11
+ // 判断是否是文件
12
+ const isFile = (pathName) => {
13
+ try {
14
+ const stat = fs.lstatSync(pathName);
15
+ return stat.isFile();
16
+ } catch {
17
+ return false;
18
+ }
19
+ };
20
+
8
21
  /**
9
22
  * 确保目录存在,不存在就创建一个
10
23
  * @param {*} dirname 目录名
@@ -15,7 +28,80 @@ const ensureDirExist = (dirname) => {
15
28
  }
16
29
  };
17
30
 
31
+ // 复制文件
32
+ const copyFile = function (src, dest) {
33
+ if (fs.existsSync(dest)) {
34
+ fs.unlinkSync(dest);
35
+ }
36
+ const dir = path.dirname(dest);
37
+ ensureDirExist(dir);
38
+ fs.copyFileSync(src, dest);
39
+ };
40
+
41
+ // 判断文件内容是否一致,不一致再进行拷贝
42
+ function diffContentCopyFile(originFile, destFile) {
43
+ if (fs.existsSync(destFile)) {
44
+ const depDestContent = fs.readFileSync(destFile, 'utf8');
45
+ const depOriginContent = fs.readFileSync(originFile, 'utf8');
46
+ if (depDestContent !== depOriginContent) {
47
+ info(`拷贝${originFile}内容到${destFile}`);
48
+ copyFile(originFile, destFile);
49
+ }
50
+ } else {
51
+ info(`拷贝${originFile}内容到${destFile}`);
52
+ copyFile(originFile, destFile);
53
+ }
54
+ }
55
+
56
+ // 添加后缀
57
+ function ext(filePath, extensions) {
58
+ let newFilePath = filePath;
59
+ let extPath = '';
60
+ // try catch需要包裹:用来处理'./lib/timer'没有后缀的情况
61
+ try {
62
+ const stat = fs.lstatSync(newFilePath);
63
+ if (stat.isDirectory()) {
64
+ extPath = newFilePath[newFilePath.length - 1] === '/' ? 'index' : '/index';
65
+ newFilePath += extPath;
66
+ }
67
+ } catch (e) {}
68
+
69
+ for (const ext of extensions) {
70
+ const file = newFilePath.endsWith(ext) ? newFilePath : newFilePath + ext;
71
+ if (fs.existsSync(file)) {
72
+ return {
73
+ ext,
74
+ extPath: extPath + ext,
75
+ file,
76
+ };
77
+ }
78
+ }
79
+ return {
80
+ ext: '',
81
+ extPath,
82
+ file: filePath,
83
+ };
84
+ }
85
+
86
+ // 判断文件是否在某个目录
87
+ const fileInDir = (dir, file) => {
88
+ if (!fs.existsSync(dir) || !fs.existsSync(file)) {
89
+ return false;
90
+ }
91
+ const relativePath = path.relative(dir, file);
92
+ if (relativePath.startsWith('..')) {
93
+ return false;
94
+ }
95
+ return true;
96
+ };
97
+
98
+
18
99
  module.exports = {
19
100
  isDirEmpty,
101
+ copyFile,
102
+ diffContentCopyFile,
20
103
  ensureDirExist,
104
+ ext,
105
+ fileInDir,
106
+ isFile,
21
107
  };
package/src/utils/log.js CHANGED
@@ -37,8 +37,11 @@ const warn = (message) => {
37
37
  console.log(chalk.yellow(message));
38
38
  };
39
39
 
40
+ const info = (...args) => console.log(...args);
41
+
40
42
  module.exports = {
41
43
  fail,
42
44
  succeed,
43
45
  warn,
46
+ info,
44
47
  };
@@ -5,9 +5,9 @@ const ora = require('ora');
5
5
  const path = require('path');
6
6
  const fs = require('fs');
7
7
  const shelljs = require('shelljs');
8
- const download = require('download-git-repo');
8
+ const { info } = require('./log');
9
9
  const chalk = require('chalk');
10
- const shelljsOptons = { slient: true };
10
+ const shelljsOptions = { slient: true, async: false };
11
11
 
12
12
  // 获取当前目录
13
13
  const cwd = process.cwd();
@@ -15,11 +15,6 @@ function resolve(...args) {
15
15
  return path.resolve(cwd, ...args);
16
16
  };
17
17
 
18
- /**
19
- * 封装logs
20
- * @returns {Undefined} 无需返回值
21
- */
22
- const log = (...args) => console.log(...args);
23
18
 
24
19
  /**
25
20
  * 用户输入命令时,进行提示
@@ -38,7 +33,7 @@ const suggestCommands = (unknownCommand) => {
38
33
  });
39
34
 
40
35
  if (suggestion) {
41
- log(` ${chalk.red(`Did you mean ${chalk.yellow(suggestion)}?`)}`);
36
+ info(` ${chalk.red(`Did you mean ${chalk.yellow(suggestion)}?`)}`);
42
37
  }
43
38
  };
44
39
 
@@ -60,55 +55,74 @@ function isArray(obj) {
60
55
  return Object.prototype.toString.call(obj) === '[object Array]';
61
56
  }
62
57
 
58
+
63
59
  /**
64
- * 下载模块到目标目录
60
+ * 下载模块代码
61
+ * @param { string } url 模块地址
65
62
  * @param { string } dest 目标地址
66
- * @param { object } downloadOptions 模块下载配置 { repoUrl-仓库地址, gitUrl-git地址, branch-分支或者tag }
63
+ * @param { string } branch 分支名
67
64
  * @returns { undefined } no return
68
65
  */
69
- function downloadRepo(dest, downloadOptions = { repoUrl: '', gitUrl: '', branch: '' }) {
70
- const { repoUrl, gitUrl, branch } = downloadOptions;
66
+ function downloadRepoForGit(url, dest, branch) {
67
+ const cwd = process.cwd();
68
+ return new Promise((resolve, reject) => {
69
+ // 如果目标目录不存在
70
+ if (fs.existsSync(dest)) {
71
+ shelljs.rm('-rf', path.join(dest));
72
+ }
71
73
 
72
- if (fs.existsSync(dest)) {
73
- shelljs.rm('-rf', dest);
74
- }
74
+ shelljs.mkdir('-p', dest);
75
+ shelljs.cd(dest);
75
76
 
76
- shelljs.mkdir('-p', dest);
77
- return new Promise((resolve) => {
78
- download(`${repoUrl}#${branch}`, dest, { clone: true }, async (e) => {
79
- if (e) {
80
- console.log(e) // eslint-disable-line
81
- await downloadRepoForGit(gitUrl, dest, branch);
77
+ shelljs.exec(`git clone ${url} ${dest} --branch ${branch} --depth 1`, { silent: true }, (code, stdout, stderr) => {
78
+ if (code !== 0) {
79
+ reject(stderr);
82
80
  }
83
-
81
+ shelljs.cd(cwd);
84
82
  resolve();
85
83
  });
86
84
  });
87
85
  }
88
86
 
87
+
89
88
  /**
90
- * 下载模块到目标目录备用方案
91
- * @param { string } url 模块地址
92
- * @param { string } dest 目标地址
89
+ * pull模块代码
90
+ * @param { string } dest 下载代码的路径
93
91
  * @param { string } branch 分支名
94
92
  * @returns { undefined } no return
95
93
  */
96
- function downloadRepoForGit(url, dest, branch) {
94
+ function pullRepoForGit(dest, branch) {
97
95
  const cwd = process.cwd();
98
-
99
- return new Promise((resolve) => {
100
- // 如果目标目录不存在
101
- if (fs.existsSync(dest)) {
102
- shelljs.rm('-rf', path.join(dest));
103
- }
104
-
105
- shelljs.mkdir('-p', dest);
96
+ return new Promise((resolve, reject) => {
106
97
  shelljs.cd(dest);
98
+ shelljs.exec('git config pull.rebase false', shelljsOptions);
99
+ shelljs.exec(`git pull origin ${branch}`, { silent: true }, (code, stdout, stderr) => {
100
+ if (code !== 0) {
101
+ reject(stderr);
102
+ }
103
+ shelljs.cd(cwd);
104
+ resolve();
105
+ });
106
+ });
107
+ }
107
108
 
108
- shelljs.exec(`git clone ${url} ${dest} --branch ${branch} --depth 1`, shelljsOptons);
109
-
110
- shelljs.cd(cwd);
111
- resolve();
109
+ /**
110
+ * npm 下载依赖
111
+ * @param {*} dir
112
+ * @returns
113
+ */
114
+ function npmInstall(dir) {
115
+ return new Promise((resolve, reject) => {
116
+ shelljs.exec(
117
+ 'npx yarn --production --registry http://mirrors.tencent.com/npm/',
118
+ { cwd: dir, silent: true },
119
+ (code, stdout, stderr) => {
120
+ if (code !== 0) {
121
+ reject(stderr);
122
+ }
123
+ resolve();
124
+ },
125
+ );
112
126
  });
113
127
  }
114
128
 
@@ -129,22 +143,16 @@ const cost = start => Date.now() - start;
129
143
  function createTask(task, startText, endText) {
130
144
  return async (...args) => {
131
145
  const start = Date.now();
132
- let result;
133
146
 
134
147
  const spinner = ora(startText);
148
+
135
149
  spinner.start();
150
+ info('\n');
136
151
 
137
- try {
138
- result = await task(...args);
139
- } catch (e) {
140
- result = e;
141
- console.log(chalk.red(e));
152
+ const result = await task(...args);
142
153
 
143
- process.exit(-1);
144
- } finally {
145
- endText && spinner.succeed(`${endText}, ${cost(start)}ms`);
146
- spinner.stop();
147
- }
154
+ endText && spinner.succeed(`${endText}, ${cost(start)}ms`);
155
+ spinner.stop();
148
156
 
149
157
  return result;
150
158
  };
@@ -159,12 +167,12 @@ const camelize = str => str.replace(/-(\w)/g, (a, c) => (c ? c.toUpperCase() : '
159
167
 
160
168
  module.exports = {
161
169
  resolve,
162
- log,
163
170
  isObject,
164
171
  isArray,
165
172
  createTask,
166
- downloadRepo,
167
173
  downloadRepoForGit,
174
+ pullRepoForGit,
168
175
  suggestCommands,
169
176
  camelize,
177
+ npmInstall,
170
178
  };
package/CHANGELOG.md DELETED
File without changes
package/main.js DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require('./dist/index.cjs'); // eslint-disable-line