@tmsfe/tmskit 0.0.28 → 0.0.30
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 +10 -10
- package/main.js +0 -0
- package/package.json +2 -2
- package/src/compile/dev.js +2 -2
- package/src/compile/watch.js +2 -2
- package/src/core/buildAppJson.js +2 -2
- package/src/core/cloneModules.js +4 -4
- package/src/utils/widgets.js +1 -1
- package/CHANGELOG.md +0 -61
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) => {
|
|
@@ -1587,7 +1587,7 @@ const fixAppJson = appJson => {
|
|
|
1587
1587
|
*/
|
|
1588
1588
|
|
|
1589
1589
|
|
|
1590
|
-
function buildOutputAppJson$2(tmsConfig, modules) {
|
|
1590
|
+
async function buildOutputAppJson$2(tmsConfig, modules) {
|
|
1591
1591
|
try {
|
|
1592
1592
|
var _tmsConfig$hooks;
|
|
1593
1593
|
|
|
@@ -1609,13 +1609,13 @@ function buildOutputAppJson$2(tmsConfig, modules) {
|
|
|
1609
1609
|
if (typeof (tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$hooks = tmsConfig.hooks) === null || _tmsConfig$hooks === void 0 ? void 0 : _tmsConfig$hooks.updateAppJson) === 'function') {
|
|
1610
1610
|
var _tmsConfig$hooks2;
|
|
1611
1611
|
|
|
1612
|
-
tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$hooks2 = tmsConfig.hooks) === null || _tmsConfig$hooks2 === void 0 ? void 0 : _tmsConfig$hooks2.updateAppJson({
|
|
1612
|
+
await (tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$hooks2 = tmsConfig.hooks) === null || _tmsConfig$hooks2 === void 0 ? void 0 : _tmsConfig$hooks2.updateAppJson({
|
|
1613
1613
|
tmsConfig: filterField$6(tmsConfig, ['gitAccount']),
|
|
1614
1614
|
cmdOptions: global$9.getData('cmdOptions'),
|
|
1615
1615
|
modules,
|
|
1616
1616
|
appJson,
|
|
1617
1617
|
isDev: global$9.getData('isDev')
|
|
1618
|
-
});
|
|
1618
|
+
}));
|
|
1619
1619
|
report$8('hooks:updateAppJson');
|
|
1620
1620
|
}
|
|
1621
1621
|
|
|
@@ -3008,7 +3008,7 @@ const getTargetFile$1 = (sourceFile, module, outputDir) => {
|
|
|
3008
3008
|
var watch_1 = function (globValue, watchOptions, callback, module) {
|
|
3009
3009
|
watch$2(globValue, { // readDelay: 100,
|
|
3010
3010
|
...watchOptions
|
|
3011
|
-
}, vinyl => {
|
|
3011
|
+
}, async vinyl => {
|
|
3012
3012
|
const sourceFile = vinyl.history[0];
|
|
3013
3013
|
const sourceFileDirArr = sourceFile.replace(/\\/g, '/').split('/');
|
|
3014
3014
|
const sourceFileName = sourceFileDirArr.slice(sourceFileDirArr.length - 2).join('/');
|
|
@@ -3022,7 +3022,7 @@ var watch_1 = function (globValue, watchOptions, callback, module) {
|
|
|
3022
3022
|
return;
|
|
3023
3023
|
}
|
|
3024
3024
|
|
|
3025
|
-
runCallback({
|
|
3025
|
+
await runCallback({
|
|
3026
3026
|
tmsConfig,
|
|
3027
3027
|
sourceFile,
|
|
3028
3028
|
targetFile,
|
|
@@ -3211,7 +3211,7 @@ var dev$4 = async (tmsConfig, modules, isDev = true) => {
|
|
|
3211
3211
|
watch$1([resolve$9('app.json')], {
|
|
3212
3212
|
ignoreInitial: false,
|
|
3213
3213
|
events: watchEvents
|
|
3214
|
-
}, () => buildOutputAppJson(tmsConfig, modules, isDev), {
|
|
3214
|
+
}, async () => await buildOutputAppJson(tmsConfig, modules, isDev), {
|
|
3215
3215
|
from: resolve$9(),
|
|
3216
3216
|
to: resolve$9(tmsConfig.outputDir)
|
|
3217
3217
|
}); // 监听其他文件
|
|
@@ -3226,7 +3226,7 @@ var dev$4 = async (tmsConfig, modules, isDev = true) => {
|
|
|
3226
3226
|
}, taskFn, module);
|
|
3227
3227
|
});
|
|
3228
3228
|
} else {
|
|
3229
|
-
buildOutputAppJson(tmsConfig, modules, isDev);
|
|
3229
|
+
await buildOutputAppJson(tmsConfig, modules, isDev);
|
|
3230
3230
|
}
|
|
3231
3231
|
|
|
3232
3232
|
eTime = new Date().getTime() - sTime;
|
|
@@ -4200,7 +4200,7 @@ var entry = [{
|
|
|
4200
4200
|
|
|
4201
4201
|
var require$$12 = {
|
|
4202
4202
|
name: "@tmsfe/tmskit",
|
|
4203
|
-
version: "0.0.
|
|
4203
|
+
version: "0.0.30",
|
|
4204
4204
|
description: "tmskit",
|
|
4205
4205
|
main: "dist/index.cjs",
|
|
4206
4206
|
bin: {
|
|
@@ -4262,7 +4262,7 @@ var require$$12 = {
|
|
|
4262
4262
|
ora: "^5.4.1",
|
|
4263
4263
|
"path-is-absolute": "^1.0.1",
|
|
4264
4264
|
"plugin-error": "^1.0.0",
|
|
4265
|
-
postcss: "^8.4.
|
|
4265
|
+
postcss: "^8.4.17",
|
|
4266
4266
|
precinct: "^8.3.1",
|
|
4267
4267
|
"readable-stream": "^2.2.2",
|
|
4268
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.30",
|
|
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/compile/dev.js
CHANGED
|
@@ -103,7 +103,7 @@ module.exports = async (tmsConfig, modules, isDev = true) => {
|
|
|
103
103
|
watch(
|
|
104
104
|
[resolve('app.json')],
|
|
105
105
|
{ ignoreInitial: false, events: watchEvents },
|
|
106
|
-
() => buildOutputAppJson(tmsConfig, modules, isDev),
|
|
106
|
+
async () => await buildOutputAppJson(tmsConfig, modules, isDev),
|
|
107
107
|
{ from: resolve(), to: resolve(tmsConfig.outputDir) },
|
|
108
108
|
);
|
|
109
109
|
// 监听其他文件
|
|
@@ -111,7 +111,7 @@ module.exports = async (tmsConfig, modules, isDev = true) => {
|
|
|
111
111
|
watch(globValue, { ignoreInitial: true, events: watchEvents }, taskFn, module);
|
|
112
112
|
});
|
|
113
113
|
} else {
|
|
114
|
-
buildOutputAppJson(tmsConfig, modules, isDev);
|
|
114
|
+
await buildOutputAppJson(tmsConfig, modules, isDev);
|
|
115
115
|
}
|
|
116
116
|
eTime = new Date().getTime() - sTime;
|
|
117
117
|
if (typeof tmsConfig?.hooks?.afterFirstCompile === 'function') {
|
package/src/compile/watch.js
CHANGED
|
@@ -52,7 +52,7 @@ module.exports = function (globValue, watchOptions, callback, module) {
|
|
|
52
52
|
watch(globValue, {
|
|
53
53
|
// readDelay: 100,
|
|
54
54
|
...watchOptions,
|
|
55
|
-
}, (vinyl) => {
|
|
55
|
+
}, async (vinyl) => {
|
|
56
56
|
const sourceFile = vinyl.history[0];
|
|
57
57
|
const sourceFileDirArr = sourceFile.replace(/\\/g, '/').split('/');
|
|
58
58
|
const sourceFileName = sourceFileDirArr.slice(sourceFileDirArr.length - 2).join('/');
|
|
@@ -66,7 +66,7 @@ module.exports = function (globValue, watchOptions, callback, module) {
|
|
|
66
66
|
updateFileHook(tmsConfig, sourceFile, targetFile, vinyl.event);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
runCallback({
|
|
69
|
+
await runCallback({
|
|
70
70
|
tmsConfig,
|
|
71
71
|
sourceFile,
|
|
72
72
|
targetFile,
|
package/src/core/buildAppJson.js
CHANGED
|
@@ -120,7 +120,7 @@ const fixAppJson = (appJson) => {
|
|
|
120
120
|
* @param {array} modules 用户要编译的模块列表
|
|
121
121
|
* @returns
|
|
122
122
|
*/
|
|
123
|
-
function buildOutputAppJson(tmsConfig, modules) {
|
|
123
|
+
async function buildOutputAppJson(tmsConfig, modules) {
|
|
124
124
|
try {
|
|
125
125
|
// 获取所有模块,合并模块依赖的模块
|
|
126
126
|
const modulesConfig = getModulesConfig(modules, tmsConfig.appName, false);
|
|
@@ -141,7 +141,7 @@ function buildOutputAppJson(tmsConfig, modules) {
|
|
|
141
141
|
fs.writeFileSync(resolve(`${tmsConfig.outputDir}/app.json`), JSON.stringify(appJson, null, 2), 'utf8');
|
|
142
142
|
|
|
143
143
|
if (typeof tmsConfig?.hooks?.updateAppJson === 'function') {
|
|
144
|
-
tmsConfig?.hooks?.updateAppJson({
|
|
144
|
+
await tmsConfig?.hooks?.updateAppJson({
|
|
145
145
|
tmsConfig: filterField(tmsConfig, ['gitAccount']),
|
|
146
146
|
cmdOptions: global.getData('cmdOptions'),
|
|
147
147
|
modules,
|
package/src/core/cloneModules.js
CHANGED
|
@@ -23,13 +23,13 @@ function replaceGitUrlAccount(httpRepoUrl, moduleName) {
|
|
|
23
23
|
let gitUrl = httpRepoUrl;
|
|
24
24
|
const gitGroupReg = /http(s)?:\/\/[^/]+\/[^/]+/;
|
|
25
25
|
const group = gitUrl.match(gitGroupReg)[0];
|
|
26
|
-
|
|
27
|
-
const { username = '', pass = '' } = tmsConfig?.gitAccount?.[moduleName]
|
|
28
|
-
|| tmsConfig?.gitAccount?.[httpRepoUrl]
|
|
26
|
+
|
|
27
|
+
const { username = '', pass = '' } = tmsConfig?.gitAccount?.[moduleName]
|
|
28
|
+
|| tmsConfig?.gitAccount?.[httpRepoUrl]
|
|
29
29
|
|| tmsConfig?.gitAccount?.[group] || {};
|
|
30
30
|
|
|
31
31
|
const urlPrefixReg = /http(s)?:\/\//;
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
if (username && pass && urlPrefixReg.test(gitUrl)) {
|
|
34
34
|
gitUrl = gitUrl.replace(urlPrefixReg, val => `${val}${encodeURIComponent(username)}:${pass}@`);
|
|
35
35
|
}
|
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,61 +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命令
|
|
59
|
-
14. [0.0.28]
|
|
60
|
-
* 修复git pull 代码失败的兼容问题
|
|
61
|
-
* 拉取第三方仓库时,支持按group维度配置账号信息
|