@tmsfe/tmskit 0.0.33 → 0.0.35
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
|
@@ -417,7 +417,7 @@ const EXTEND_CMD$1 = path$f.resolve(CACHE_DIR, 'cmd');
|
|
|
417
417
|
const TEMPLATE_NAME$1 = 'tmskit-template';
|
|
418
418
|
|
|
419
419
|
// 脚手架模板的远程地址
|
|
420
|
-
const TEMPLATE_URL$1 = '
|
|
420
|
+
const TEMPLATE_URL$1 = 'http://tms-web-1g1czzwka2fd06f2-1301126013.tcloudbaseapp.com/tmskit-template/tmskit-template.zip';
|
|
421
421
|
|
|
422
422
|
// 脚手架的名称
|
|
423
423
|
const TMS_NAME$1 = 'tmskit';
|
|
@@ -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).build(err => {
|
|
1040
|
+
Metalsmith(buildDir).metadata(preMetadata).ignore(FILES_TO_IGNORE).clean(false).use(ask(buildDir)).source('./').destination(distDir).use(render).use(render).build(err => {
|
|
1041
1041
|
if (err) {
|
|
1042
1042
|
reject(err);
|
|
1043
1043
|
} else {
|
|
@@ -1161,9 +1161,10 @@ async function create(projectName) {
|
|
|
1161
1161
|
report$9('create-start', {
|
|
1162
1162
|
projectType
|
|
1163
1163
|
});
|
|
1164
|
-
|
|
1164
|
+
console.log('targetDir', targetDir, TEMPLATE_DIR);
|
|
1165
1165
|
// 创建项目目录
|
|
1166
1166
|
await createProjectDir(targetDir);
|
|
1167
|
+
console.log('createProjectDir222');
|
|
1167
1168
|
|
|
1168
1169
|
// 新创建缓存目录
|
|
1169
1170
|
if (fs$g.existsSync(TEMPLATE_DIR)) {
|
|
@@ -1172,6 +1173,7 @@ async function create(projectName) {
|
|
|
1172
1173
|
fs$g.mkdirSync(TEMPLATE_DIR, {
|
|
1173
1174
|
recursive: true
|
|
1174
1175
|
});
|
|
1176
|
+
console.log('downloadAndUnZipTemplate0000', TEMPLATE_DIR, TEMPLATE_URL, TEMPLATE_NAME);
|
|
1175
1177
|
|
|
1176
1178
|
// 下载和解压模板
|
|
1177
1179
|
await downloadAndUnZipTemplate(TEMPLATE_DIR, TEMPLATE_URL, TEMPLATE_NAME);
|
|
@@ -2783,7 +2785,8 @@ var watch_1 = function (globValue, watchOptions, callback, module) {
|
|
|
2783
2785
|
const tmsConfig = global$6.getData('tmsConfig');
|
|
2784
2786
|
let targetFile = getTargetFile$1(sourceFile, module, tmsConfig.outputDir);
|
|
2785
2787
|
if (module.custom) {
|
|
2786
|
-
|
|
2788
|
+
const filePath = sourceFile.replace(/\\/g, '/').replace(module.from, '');
|
|
2789
|
+
targetFile = path$4.join(module.to, filePath);
|
|
2787
2790
|
}
|
|
2788
2791
|
if (vinyl.event === 'unlink' || vinyl.event === 'unlinkDir') {
|
|
2789
2792
|
info$a(`删除${sourceFileName}`);
|
|
@@ -2893,7 +2896,7 @@ var dev$4 = async (tmsConfig, modules, isDev = true) => {
|
|
|
2893
2896
|
glob: item.rules,
|
|
2894
2897
|
module: {
|
|
2895
2898
|
custom: true,
|
|
2896
|
-
from:
|
|
2899
|
+
from: item.from,
|
|
2897
2900
|
to: item.to
|
|
2898
2901
|
},
|
|
2899
2902
|
destPath: item.to,
|
|
@@ -3074,6 +3077,7 @@ function delOtherPackages(tmsConfig, targetSubPackages) {
|
|
|
3074
3077
|
}
|
|
3075
3078
|
});
|
|
3076
3079
|
}
|
|
3080
|
+
|
|
3077
3081
|
async function dev$3(tmsConfig, targetModules) {
|
|
3078
3082
|
var _tmsConfig$hooks;
|
|
3079
3083
|
const {
|
|
@@ -3902,11 +3906,11 @@ var entry = [{
|
|
|
3902
3906
|
|
|
3903
3907
|
var require$$12 = {
|
|
3904
3908
|
name: "@tmsfe/tmskit",
|
|
3905
|
-
version: "0.0.
|
|
3909
|
+
version: "0.0.35",
|
|
3906
3910
|
description: "tmskit",
|
|
3907
|
-
main: "
|
|
3911
|
+
main: "src/index.js",
|
|
3908
3912
|
bin: {
|
|
3909
|
-
tmskit: "
|
|
3913
|
+
tmskit: "src/index.js"
|
|
3910
3914
|
},
|
|
3911
3915
|
files: [
|
|
3912
3916
|
"build",
|
package/package.json
CHANGED
package/src/compile/dev.js
CHANGED
package/src/compile/watch.js
CHANGED
|
@@ -58,7 +58,8 @@ module.exports = function (globValue, watchOptions, callback, module) {
|
|
|
58
58
|
const tmsConfig = global.getData('tmsConfig');
|
|
59
59
|
let targetFile = getTargetFile(sourceFile, module, tmsConfig.outputDir);
|
|
60
60
|
if (module.custom) {
|
|
61
|
-
|
|
61
|
+
const filePath = sourceFile.replace(/\\/g, '/').replace(module.from, '');
|
|
62
|
+
targetFile = path.join(module.to, filePath);
|
|
62
63
|
}
|
|
63
64
|
if (vinyl.event === 'unlink' || vinyl.event === 'unlinkDir') {
|
|
64
65
|
info(`删除${sourceFileName}`);
|
package/src/config/constant.js
CHANGED
|
@@ -32,7 +32,7 @@ const EXTEND_CMD = path.resolve(CACHE_DIR, 'cmd');
|
|
|
32
32
|
const TEMPLATE_NAME = 'tmskit-template';
|
|
33
33
|
|
|
34
34
|
// 脚手架模板的远程地址
|
|
35
|
-
const TEMPLATE_URL = '
|
|
35
|
+
const TEMPLATE_URL = 'http://tms-web-1g1czzwka2fd06f2-1301126013.tcloudbaseapp.com/tmskit-template/tmskit-template.zip';
|
|
36
36
|
|
|
37
37
|
// 脚手架的名称
|
|
38
38
|
const TMS_NAME = 'tmskit';
|
|
@@ -75,7 +75,7 @@ const CREATE_TEMPLATE_QUESTION = [
|
|
|
75
75
|
name: '小程序项目',
|
|
76
76
|
value: 'mp',
|
|
77
77
|
}, {
|
|
78
|
-
name: '
|
|
78
|
+
name: '小程序模块-非独立分包',
|
|
79
79
|
value: 'mp-module',
|
|
80
80
|
}, {
|
|
81
81
|
name: '构建工具扩展命令',
|
|
@@ -74,14 +74,17 @@ 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);
|
|
77
78
|
// 创建项目目录
|
|
78
79
|
await createProjectDir(targetDir);
|
|
80
|
+
console.log('createProjectDir222');
|
|
79
81
|
|
|
80
82
|
// 新创建缓存目录
|
|
81
83
|
if (fs.existsSync(TEMPLATE_DIR)) {
|
|
82
84
|
shelljs.rm('-rf', TEMPLATE_DIR);
|
|
83
85
|
}
|
|
84
86
|
fs.mkdirSync(TEMPLATE_DIR, { recursive: true });
|
|
87
|
+
console.log('downloadAndUnZipTemplate0000', TEMPLATE_DIR, TEMPLATE_URL, TEMPLATE_NAME);
|
|
85
88
|
|
|
86
89
|
// 下载和解压模板
|
|
87
90
|
await downloadAndUnZipTemplate(TEMPLATE_DIR, TEMPLATE_URL, TEMPLATE_NAME);
|