@ttmg/cli 0.3.1-unity.9 → 0.3.1

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.
@@ -12,8 +12,8 @@
12
12
  rel="stylesheet"
13
13
  />
14
14
  <title>TikTok Mini Games DevTool</title>
15
- <script type="module" crossorigin src="/assets/index-O0TENe77.js"></script>
16
- <link rel="stylesheet" crossorigin href="/assets/index-sCifET6h.css">
15
+ <script type="module" crossorigin src="/assets/index-D9N96fJ2.js"></script>
16
+ <link rel="stylesheet" crossorigin href="/assets/index-DER-DYLd.css">
17
17
  </head>
18
18
  <body>
19
19
  <div id="root"></div>
@@ -83,12 +83,9 @@ async function compile(context = {}) {
83
83
  chalk.yellow.underline(outputDir),
84
84
  ),
85
85
  );
86
- // if (outputDir) {
87
- // if (fs.existsSync(outputDir)) {
88
- // fs.rmSync(outputDir, { recursive: true, force: true });
89
- // }
90
- // fs.mkdirSync(outputDir, { recursive: true });
91
- // }
86
+ if (fs.existsSync(outputDir)) {
87
+ fs.rmSync(outputDir, { recursive: true, force: true });
88
+ }
92
89
  } catch (e) {
93
90
  // 目录操作失败也上报
94
91
  parentPort?.postMessage({
@@ -100,21 +97,10 @@ async function compile(context = {}) {
100
97
 
101
98
  parentPort?.postMessage({ type: 'status', status: 'start' });
102
99
 
103
- const outputTempDir = path.join(
104
- entryDir,
105
- '__TTMG_TEMP__',
106
- clientKey + '_compile_' + Date.now().toString(),
107
- );
108
- console.log(
109
- chalk(
110
- `🔍 Game local debug assets temp directory`,
111
- chalk.yellow.underline(outputTempDir),
112
- ),
113
- );
114
100
  // 调用打包
115
101
  const { isSuccess, errorMsg, packages } = await debugPkgs({
116
102
  entry: entryDir,
117
- output: outputTempDir,
103
+ output: outputDir,
118
104
  dev: {
119
105
  enable: true,
120
106
  port: devPort,
@@ -133,15 +119,6 @@ async function compile(context = {}) {
133
119
  // spawnOptions: { stdio: ['ignore', 'pipe', 'pipe'] },
134
120
  // concurrency: 4,
135
121
  });
136
- if (fs.existsSync(outputDir)) {
137
- // 删除旧输出目录
138
- fs.rmSync(outputDir, { recursive: true, force: true });
139
- // 复制临时目录到输出目录
140
- // 直接替换 outputDir 内容,避免生成 __TTMG_TEMP__ 子目录
141
- fs.cpSync(outputTempDir, outputDir, { recursive: true });
142
- // 删除临时目录
143
- fs.rmSync(outputTempDir, { recursive: true, force: true });
144
- }
145
122
  if (fs.existsSync(path.join(outputDir, '__TTMG_TEMP__'))) {
146
123
  fs.rmSync(path.join(outputDir, '__TTMG_TEMP__'), {
147
124
  recursive: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttmg/cli",
3
- "version": "0.3.1-unity.9",
3
+ "version": "0.3.1",
4
4
  "description": "TikTok Mini Game Command Line Tool",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -46,8 +46,9 @@
46
46
  "ora": "^9.0.0",
47
47
  "p-limit": "5.0.0",
48
48
  "prettier": "^3.6.2",
49
+ "qs": "6.12.1",
49
50
  "semver": "^7.7.2",
50
- "ttmg-pack": "0.2.8-unity.1",
51
+ "ttmg-pack": "0.2.9",
51
52
  "ws": "^8.18.3"
52
53
  },
53
54
  "devDependencies": {