@ttmg/cli 0.1.0-beta.10 → 0.1.0-beta.12

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/CHANGELOG.md CHANGED
@@ -18,3 +18,11 @@
18
18
  ## 0.1.0-beta.10
19
19
 
20
20
  fix: 修复还未完成新编译就直接上传了的问题
21
+
22
+ ## 0.1.0-beta.11
23
+
24
+ feat: 先关闭自动上传能力
25
+
26
+ ## 0.1.0-beta.12
27
+
28
+ feat: 支持文件变更监听,告知浏览器文件变更,提醒开发者重新加载游戏
package/dist/index.js CHANGED
@@ -1119,6 +1119,7 @@ async function prepareResource() {
1119
1119
  }
1120
1120
  }
1121
1121
 
1122
+ // import { uploadGame } from './uploadGame';
1122
1123
  async function watchChange() {
1123
1124
  let debounceTimer = null;
1124
1125
  fs.watch(process.cwd(), (eventType, filename) => {
@@ -1128,22 +1129,24 @@ async function watchChange() {
1128
1129
  clearTimeout(debounceTimer);
1129
1130
  // 重新设置定时器
1130
1131
  debounceTimer = setTimeout(async () => {
1131
- wsServer.sendUploadStatus('start');
1132
1132
  await prepareResource();
1133
- uploadGame()
1134
- .then((res) => {
1135
- if (res.isSuccess) {
1136
- wsServer.sendUploadStatus('success');
1137
- }
1138
- else {
1139
- wsServer.sendUploadStatus('error', {
1140
- errMsg: res.errorMsg,
1141
- });
1142
- }
1143
- })
1144
- .catch(() => {
1145
- wsServer.sendUploadStatus('error');
1133
+ wsServer.send({
1134
+ method: 'resourceChange',
1146
1135
  });
1136
+ // TODO:只做文件预准备,但不主动上传
1137
+ // uploadGame()
1138
+ // .then((res) => {
1139
+ // if (res.isSuccess) {
1140
+ // wsServer.sendUploadStatus('success');
1141
+ // } else {
1142
+ // wsServer.sendUploadStatus('error', {
1143
+ // errMsg: res.errorMsg,
1144
+ // });
1145
+ // }
1146
+ // })
1147
+ // .catch(() => {
1148
+ // wsServer.sendUploadStatus('error');
1149
+ // });
1147
1150
  debounceTimer = null;
1148
1151
  }, 500); // 500ms内只执行一次
1149
1152
  });
@@ -1184,7 +1187,7 @@ async function dev() {
1184
1187
  await watchChange();
1185
1188
  }
1186
1189
 
1187
- var version = "0.1.0-beta.10";
1190
+ var version = "0.1.0-beta.12";
1188
1191
  var pkg = {
1189
1192
  version: version};
1190
1193
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttmg/cli",
3
- "version": "0.1.0-beta.10",
3
+ "version": "0.1.0-beta.12",
4
4
  "description": "TikTok Mini Game Command Line Tool",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -41,7 +41,7 @@
41
41
  "open": "^10.2.0",
42
42
  "prettier": "^3.6.2",
43
43
  "qrcode-terminal": "^0.12.0",
44
- "ttmg-pack": "0.0.17",
44
+ "ttmg-pack": "^0.0.19",
45
45
  "ws": "^8.18.3"
46
46
  },
47
47
  "devDependencies": {