@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 = 'https://tms-web-1g1czzwka2fd06f2-1301126013.tcloudbaseapp.com/tmskit-template/tmskit-template.zip';
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
- targetFile = path$4.join(module.to, sourceFileName);
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.33",
3909
+ version: "0.0.35",
3906
3910
  description: "tmskit",
3907
- main: "dist/index.cjs",
3911
+ main: "src/index.js",
3908
3912
  bin: {
3909
- tmskit: "main.js"
3913
+ tmskit: "src/index.js"
3910
3914
  },
3911
3915
  files: [
3912
3916
  "build",
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@tmsfe/tmskit",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "description": "tmskit",
5
- "main": "dist/index.cjs",
5
+ "main": "src/index.js",
6
6
  "bin": {
7
- "tmskit": "main.js"
7
+ "tmskit": "src/index.js"
8
8
  },
9
9
  "files": [
10
10
  "build",
@@ -33,7 +33,7 @@ module.exports = async (tmsConfig, modules, isDev = true) => {
33
33
  glob: item.rules,
34
34
  module: {
35
35
  custom: true,
36
- from: '',
36
+ from: item.from,
37
37
  to: item.to,
38
38
  },
39
39
  destPath: item.to,
@@ -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
- targetFile = path.join(module.to, sourceFileName);
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}`);
@@ -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 = 'https://tms-web-1g1czzwka2fd06f2-1301126013.tcloudbaseapp.com/tmskit-template/tmskit-template.zip';
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: '构建工具扩展命令',
@@ -12,6 +12,7 @@ const generator = (buildDir, distDir, preMetadata = {}) => new Promise((resolve,
12
12
  .source('./')
13
13
  .destination(distDir)
14
14
  .use(render)
15
+ .use(render)
15
16
  .build((err) => {
16
17
  if (err) {
17
18
  reject(err);
@@ -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);