@tmsfe/tmskit 0.0.35 → 0.0.37
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
CHANGED
|
@@ -455,7 +455,7 @@ const CREATE_TEMPLATE_QUESTION$1 = [{
|
|
|
455
455
|
name: '小程序项目',
|
|
456
456
|
value: 'mp'
|
|
457
457
|
}, {
|
|
458
|
-
name: '
|
|
458
|
+
name: '小程序模块',
|
|
459
459
|
value: 'mp-module'
|
|
460
460
|
}, {
|
|
461
461
|
name: '构建工具扩展命令',
|
|
@@ -1037,7 +1037,7 @@ const render = render_1;
|
|
|
1037
1037
|
const ask = ask_1;
|
|
1038
1038
|
const FILES_TO_IGNORE = ignoreFiles;
|
|
1039
1039
|
const generator$1 = (buildDir, distDir, preMetadata = {}) => new Promise((resolve, reject) => {
|
|
1040
|
-
Metalsmith(buildDir).metadata(preMetadata).ignore(FILES_TO_IGNORE).clean(false).use(ask(buildDir)).source('./').destination(distDir).use(render).
|
|
1040
|
+
Metalsmith(buildDir).metadata(preMetadata).ignore(FILES_TO_IGNORE).clean(false).use(ask(buildDir)).source('./').destination(distDir).use(render).build(err => {
|
|
1041
1041
|
if (err) {
|
|
1042
1042
|
reject(err);
|
|
1043
1043
|
} else {
|
|
@@ -1161,10 +1161,9 @@ async function create(projectName) {
|
|
|
1161
1161
|
report$9('create-start', {
|
|
1162
1162
|
projectType
|
|
1163
1163
|
});
|
|
1164
|
-
|
|
1164
|
+
|
|
1165
1165
|
// 创建项目目录
|
|
1166
1166
|
await createProjectDir(targetDir);
|
|
1167
|
-
console.log('createProjectDir222');
|
|
1168
1167
|
|
|
1169
1168
|
// 新创建缓存目录
|
|
1170
1169
|
if (fs$g.existsSync(TEMPLATE_DIR)) {
|
|
@@ -1173,7 +1172,6 @@ async function create(projectName) {
|
|
|
1173
1172
|
fs$g.mkdirSync(TEMPLATE_DIR, {
|
|
1174
1173
|
recursive: true
|
|
1175
1174
|
});
|
|
1176
|
-
console.log('downloadAndUnZipTemplate0000', TEMPLATE_DIR, TEMPLATE_URL, TEMPLATE_NAME);
|
|
1177
1175
|
|
|
1178
1176
|
// 下载和解压模板
|
|
1179
1177
|
await downloadAndUnZipTemplate(TEMPLATE_DIR, TEMPLATE_URL, TEMPLATE_NAME);
|
|
@@ -1546,7 +1544,7 @@ function replaceGitUrlAccount(httpRepoUrl, moduleName) {
|
|
|
1546
1544
|
} = (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]) || {};
|
|
1547
1545
|
const urlPrefixReg = /http(s)?:\/\//;
|
|
1548
1546
|
if (username && pass && urlPrefixReg.test(gitUrl)) {
|
|
1549
|
-
gitUrl = gitUrl.replace(urlPrefixReg, val => `${val}${encodeURIComponent(username)}:${pass}@`);
|
|
1547
|
+
gitUrl = gitUrl.replace(urlPrefixReg, val => `${val}${encodeURIComponent(username)}:${encodeURIComponent(pass)}@`);
|
|
1550
1548
|
}
|
|
1551
1549
|
return gitUrl;
|
|
1552
1550
|
}
|
|
@@ -3077,7 +3075,6 @@ function delOtherPackages(tmsConfig, targetSubPackages) {
|
|
|
3077
3075
|
}
|
|
3078
3076
|
});
|
|
3079
3077
|
}
|
|
3080
|
-
|
|
3081
3078
|
async function dev$3(tmsConfig, targetModules) {
|
|
3082
3079
|
var _tmsConfig$hooks;
|
|
3083
3080
|
const {
|
|
@@ -3906,11 +3903,11 @@ var entry = [{
|
|
|
3906
3903
|
|
|
3907
3904
|
var require$$12 = {
|
|
3908
3905
|
name: "@tmsfe/tmskit",
|
|
3909
|
-
version: "0.0.
|
|
3906
|
+
version: "0.0.37",
|
|
3910
3907
|
description: "tmskit",
|
|
3911
|
-
main: "
|
|
3908
|
+
main: "dist/index.cjs",
|
|
3912
3909
|
bin: {
|
|
3913
|
-
tmskit: "
|
|
3910
|
+
tmskit: "main.js"
|
|
3914
3911
|
},
|
|
3915
3912
|
files: [
|
|
3916
3913
|
"build",
|
package/package.json
CHANGED
package/src/config/constant.js
CHANGED
package/src/core/cloneModules.js
CHANGED
|
@@ -31,7 +31,7 @@ function replaceGitUrlAccount(httpRepoUrl, moduleName) {
|
|
|
31
31
|
const urlPrefixReg = /http(s)?:\/\//;
|
|
32
32
|
|
|
33
33
|
if (username && pass && urlPrefixReg.test(gitUrl)) {
|
|
34
|
-
gitUrl = gitUrl.replace(urlPrefixReg, val => `${val}${encodeURIComponent(username)}:${pass}@`);
|
|
34
|
+
gitUrl = gitUrl.replace(urlPrefixReg, val => `${val}${encodeURIComponent(username)}:${encodeURIComponent(pass)}@`);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
return gitUrl;
|
|
@@ -74,17 +74,14 @@ async function create(projectName) {
|
|
|
74
74
|
const { projectType } = await inquirer.prompt(CREATE_TEMPLATE_QUESTION);
|
|
75
75
|
report('create-start', { projectType });
|
|
76
76
|
|
|
77
|
-
console.log('targetDir', targetDir, TEMPLATE_DIR);
|
|
78
77
|
// 创建项目目录
|
|
79
78
|
await createProjectDir(targetDir);
|
|
80
|
-
console.log('createProjectDir222');
|
|
81
79
|
|
|
82
80
|
// 新创建缓存目录
|
|
83
81
|
if (fs.existsSync(TEMPLATE_DIR)) {
|
|
84
82
|
shelljs.rm('-rf', TEMPLATE_DIR);
|
|
85
83
|
}
|
|
86
84
|
fs.mkdirSync(TEMPLATE_DIR, { recursive: true });
|
|
87
|
-
console.log('downloadAndUnZipTemplate0000', TEMPLATE_DIR, TEMPLATE_URL, TEMPLATE_NAME);
|
|
88
85
|
|
|
89
86
|
// 下载和解压模板
|
|
90
87
|
await downloadAndUnZipTemplate(TEMPLATE_DIR, TEMPLATE_URL, TEMPLATE_NAME);
|