@tmsfe/tmskit 0.0.27 → 0.0.29
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/dist/index.cjs.js +11 -6
- package/main.js +0 -0
- package/package.json +2 -2
- package/src/core/cloneModules.js +10 -2
- package/src/utils/widgets.js +1 -1
- package/CHANGELOG.md +0 -58
- package/src/.DS_Store +0 -0
- package/src/scripts/.DS_Store +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -240,7 +240,7 @@ function pullRepoForGit$1(dest, branch) {
|
|
|
240
240
|
function npmInstall$3(dir, npmConfig) {
|
|
241
241
|
return new Promise((resolve, reject) => {
|
|
242
242
|
const registry = getNpmRegistry(npmConfig);
|
|
243
|
-
shelljs$7.exec(`npm install --production ${registry}`, {
|
|
243
|
+
shelljs$7.exec(`npm install --production --legacy-peer-deps ${registry}`, {
|
|
244
244
|
cwd: dir,
|
|
245
245
|
silent: true
|
|
246
246
|
}, (code, stdout, stderr) => {
|
|
@@ -1660,15 +1660,17 @@ const {
|
|
|
1660
1660
|
*/
|
|
1661
1661
|
|
|
1662
1662
|
function replaceGitUrlAccount(httpRepoUrl, moduleName) {
|
|
1663
|
-
var _tmsConfig$gitAccount, _tmsConfig$gitAccount2;
|
|
1663
|
+
var _tmsConfig$gitAccount, _tmsConfig$gitAccount2, _tmsConfig$gitAccount3;
|
|
1664
1664
|
|
|
1665
1665
|
// 用户本地的私有项目配置(用来配置环境\模块信息\账号信息)
|
|
1666
1666
|
const tmsConfig = global$8.getData('tmsConfig');
|
|
1667
1667
|
let gitUrl = httpRepoUrl;
|
|
1668
|
+
const gitGroupReg = /http(s)?:\/\/[^/]+\/[^/]+/;
|
|
1669
|
+
const group = gitUrl.match(gitGroupReg)[0];
|
|
1668
1670
|
const {
|
|
1669
1671
|
username = '',
|
|
1670
1672
|
pass = ''
|
|
1671
|
-
} = (tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$gitAccount = tmsConfig.gitAccount) === null || _tmsConfig$gitAccount === void 0 ? void 0 : _tmsConfig$gitAccount[moduleName]) || (tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$gitAccount2 = tmsConfig.gitAccount) === null || _tmsConfig$gitAccount2 === void 0 ? void 0 : _tmsConfig$gitAccount2[httpRepoUrl]) || {};
|
|
1673
|
+
} = (tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$gitAccount = tmsConfig.gitAccount) === null || _tmsConfig$gitAccount === void 0 ? void 0 : _tmsConfig$gitAccount[moduleName]) || (tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$gitAccount2 = tmsConfig.gitAccount) === null || _tmsConfig$gitAccount2 === void 0 ? void 0 : _tmsConfig$gitAccount2[httpRepoUrl]) || (tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$gitAccount3 = tmsConfig.gitAccount) === null || _tmsConfig$gitAccount3 === void 0 ? void 0 : _tmsConfig$gitAccount3[group]) || {};
|
|
1672
1674
|
const urlPrefixReg = /http(s)?:\/\//;
|
|
1673
1675
|
|
|
1674
1676
|
if (username && pass && urlPrefixReg.test(gitUrl)) {
|
|
@@ -1819,7 +1821,10 @@ function collectDownLoadTasksMap(sourceDir, targetDir, modules) {
|
|
|
1819
1821
|
if (fs$d.existsSync(sourcePath) && fs$d.existsSync(`${sourcePath}/.git`)) {
|
|
1820
1822
|
promiseTask = (gitUrl, sourcePath, branch, httpRepoUrl) => {
|
|
1821
1823
|
info$d(`git pull:${httpRepoUrl} --branch: ${branch}`);
|
|
1822
|
-
return pullRepoForGit(sourcePath, branch)
|
|
1824
|
+
return pullRepoForGit(sourcePath, branch).catch(e => {
|
|
1825
|
+
info$d(`pull代码失败:${e}, 开始git clone: ${httpRepoUrl}:${branch}`);
|
|
1826
|
+
return downloadRepoForGit(gitUrl, sourcePath, branch);
|
|
1827
|
+
});
|
|
1823
1828
|
};
|
|
1824
1829
|
} else {
|
|
1825
1830
|
promiseTask = (gitUrl, sourcePath, branch, httpRepoUrl) => {
|
|
@@ -4195,7 +4200,7 @@ var entry = [{
|
|
|
4195
4200
|
|
|
4196
4201
|
var require$$12 = {
|
|
4197
4202
|
name: "@tmsfe/tmskit",
|
|
4198
|
-
version: "0.0.
|
|
4203
|
+
version: "0.0.29",
|
|
4199
4204
|
description: "tmskit",
|
|
4200
4205
|
main: "dist/index.cjs",
|
|
4201
4206
|
bin: {
|
|
@@ -4257,7 +4262,7 @@ var require$$12 = {
|
|
|
4257
4262
|
ora: "^5.4.1",
|
|
4258
4263
|
"path-is-absolute": "^1.0.1",
|
|
4259
4264
|
"plugin-error": "^1.0.0",
|
|
4260
|
-
postcss: "^8.4.
|
|
4265
|
+
postcss: "^8.4.17",
|
|
4261
4266
|
precinct: "^8.3.1",
|
|
4262
4267
|
"readable-stream": "^2.2.2",
|
|
4263
4268
|
"replace-ext": "^2.0.0",
|
package/main.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmsfe/tmskit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "tmskit",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"bin": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"ora": "^5.4.1",
|
|
62
62
|
"path-is-absolute": "^1.0.1",
|
|
63
63
|
"plugin-error": "^1.0.0",
|
|
64
|
-
"postcss": "^8.4.
|
|
64
|
+
"postcss": "^8.4.17",
|
|
65
65
|
"precinct": "^8.3.1",
|
|
66
66
|
"readable-stream": "^2.2.2",
|
|
67
67
|
"replace-ext": "^2.0.0",
|
package/src/core/cloneModules.js
CHANGED
|
@@ -21,10 +21,15 @@ function replaceGitUrlAccount(httpRepoUrl, moduleName) {
|
|
|
21
21
|
const tmsConfig = global.getData('tmsConfig');
|
|
22
22
|
|
|
23
23
|
let gitUrl = httpRepoUrl;
|
|
24
|
+
const gitGroupReg = /http(s)?:\/\/[^/]+\/[^/]+/;
|
|
25
|
+
const group = gitUrl.match(gitGroupReg)[0];
|
|
24
26
|
|
|
25
|
-
const { username = '', pass = '' } = tmsConfig?.gitAccount?.[moduleName]
|
|
27
|
+
const { username = '', pass = '' } = tmsConfig?.gitAccount?.[moduleName]
|
|
28
|
+
|| tmsConfig?.gitAccount?.[httpRepoUrl]
|
|
29
|
+
|| tmsConfig?.gitAccount?.[group] || {};
|
|
26
30
|
|
|
27
31
|
const urlPrefixReg = /http(s)?:\/\//;
|
|
32
|
+
|
|
28
33
|
if (username && pass && urlPrefixReg.test(gitUrl)) {
|
|
29
34
|
gitUrl = gitUrl.replace(urlPrefixReg, val => `${val}${encodeURIComponent(username)}:${pass}@`);
|
|
30
35
|
}
|
|
@@ -160,7 +165,10 @@ function collectDownLoadTasksMap(sourceDir, targetDir, modules) {
|
|
|
160
165
|
if (fs.existsSync(sourcePath) && fs.existsSync(`${sourcePath}/.git`)) {
|
|
161
166
|
promiseTask = (gitUrl, sourcePath, branch, httpRepoUrl) => {
|
|
162
167
|
info(`git pull:${httpRepoUrl} --branch: ${branch}`);
|
|
163
|
-
return pullRepoForGit(sourcePath, branch)
|
|
168
|
+
return pullRepoForGit(sourcePath, branch).catch((e) => {
|
|
169
|
+
info(`pull代码失败:${e}, 开始git clone: ${httpRepoUrl}:${branch}`);
|
|
170
|
+
return downloadRepoForGit(gitUrl, sourcePath, branch);
|
|
171
|
+
});
|
|
164
172
|
};
|
|
165
173
|
} else {
|
|
166
174
|
promiseTask = (gitUrl, sourcePath, branch, httpRepoUrl) => {
|
package/src/utils/widgets.js
CHANGED
|
@@ -92,7 +92,7 @@ function npmInstall(dir, npmConfig) {
|
|
|
92
92
|
return new Promise((resolve, reject) => {
|
|
93
93
|
const registry = getNpmRegistry(npmConfig);
|
|
94
94
|
shelljs.exec(
|
|
95
|
-
`npm install --production ${registry}`,
|
|
95
|
+
`npm install --production --legacy-peer-deps ${registry}`,
|
|
96
96
|
{ cwd: dir, silent: true },
|
|
97
97
|
(code, stdout, stderr) => {
|
|
98
98
|
if (code !== 0) {
|
package/CHANGELOG.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
1. [0.0.5] 支持创建新的小程序
|
|
3
|
-
2. [0.0.6] 支持编译功能
|
|
4
|
-
3. [0.0.7]
|
|
5
|
-
* 更新切换开发环境需要重启构建工具,调整为改代码直接生效
|
|
6
|
-
* 修复切换第三方代码库分支后,构建工具没有重新拉代码的问题
|
|
7
|
-
* 修复thirdparty代码没有正确构建问题
|
|
8
|
-
* 新增对一个仓库下多个分包的支持
|
|
9
|
-
* 优化代码下载流程,多仓库并行下载,第三方代码下载时间60s->15s
|
|
10
|
-
* 本地private.config.js配置,支持指定屏蔽某些模块,屏蔽所有远程模块的设置
|
|
11
|
-
4. [0.0.10]
|
|
12
|
-
* 优化npm install并行改成串行,60个模块开发第一次启动由100s优化至40s, 第二次启动2s;
|
|
13
|
-
* 添加global全局缓存变量,避免变量层层传递的问题
|
|
14
|
-
* 增加--latest参数,重新初始化操作(拉去第三方模块、npm下载、生成appJson)
|
|
15
|
-
* 修复获取用户指定模块的bug
|
|
16
|
-
5. [0.0.12] 云函数支持创建软连, 支持引入项目外的云函数能力
|
|
17
|
-
|
|
18
|
-
6. [0.0.13]
|
|
19
|
-
* 首次编译完成,提示用户编译完成.
|
|
20
|
-
* 日志添加时间戳
|
|
21
|
-
* 编译代码有更新时,增加提示日志
|
|
22
|
-
* 删除源码文件或文件夹时,支持监听文件变动,删除编译文件
|
|
23
|
-
* fix window中tar命令的兼容性问题
|
|
24
|
-
7. [0.0.15]
|
|
25
|
-
* 删除原函数软连功能
|
|
26
|
-
* fix 修复dist node_module.tar.gz没有删除bug
|
|
27
|
-
8. [0.0.16]
|
|
28
|
-
* fix: 日志打印多空行问题
|
|
29
|
-
* add: 增加--noCache的参数,支持不使用缓存运行dev
|
|
30
|
-
* add: package.json、module.config.json更新后,提示重新启动dev
|
|
31
|
-
* fix: gulp-watch更新某个文件时,编译多个文件的问题
|
|
32
|
-
* 策略:拉取第三方代码,dev流程都会执行
|
|
33
|
-
* add: 钩子函数支持promise
|
|
34
|
-
* fix: 编译watch不支持文件夹监听
|
|
35
|
-
* fix: 升级chokidar的版本
|
|
36
|
-
9. [0.0.17]
|
|
37
|
-
* 删除“module.config.json pages为空”的判断
|
|
38
|
-
* 编译后 app.json 的 `subpackages`字段 按 `name` 排序
|
|
39
|
-
* `updateAppJson`钩子,增加`isDev、tmsConfig、modules、appJson`参数
|
|
40
|
-
* 增加`tmskit run cloud`命令
|
|
41
|
-
10. [0.0.18]
|
|
42
|
-
* 修改模板名称tmskit-template
|
|
43
|
-
* tms.private.config.js 作为 tms.config.js的复写文件,不再是补充文件
|
|
44
|
-
* module.config.json 支持`preloadRule`字段
|
|
45
|
-
* 处理miniprogram_npm 不构建问题
|
|
46
|
-
11. [0.0.20]
|
|
47
|
-
* tmskit create 支持创建模块
|
|
48
|
-
* 模板压缩zip包,存到cdn,支持外部同学下载
|
|
49
|
-
* package.json更新时,判断版本变动,然后给出重新tmskit run dev的提示
|
|
50
|
-
* module.config.json增加分包的描述文件
|
|
51
|
-
12. [0.0.23]
|
|
52
|
-
* 支持扩展命令
|
|
53
|
-
* 支持集成tms-prebuild
|
|
54
|
-
* 上报接口
|
|
55
|
-
* 支持编译插件
|
|
56
|
-
* 支持npm源配置
|
|
57
|
-
13. [0.0.27]
|
|
58
|
-
* 添加云函数cloud-dev命令
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/scripts/.DS_Store
DELETED
|
Binary file
|