@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.
- package/CHANGELOG.md +6 -0
- package/dist/index.js +198 -40
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -2
- package/dist/public/assets/index-9wLHKdTg.css +1 -0
- package/dist/public/assets/index-9wLHKdTg.css.br +0 -0
- package/dist/public/assets/{index-tH12LIuT.js → index-Cuov3ysP.js} +18 -18
- package/dist/public/assets/index-Cuov3ysP.js.br +0 -0
- package/dist/public/assets/{index-BLMuzkOF.js → index-D5if59dO.js} +1 -1
- package/dist/public/assets/index-D5if59dO.js.br +0 -0
- package/dist/public/assets/index-D9N96fJ2.js +67 -0
- package/dist/public/assets/index-D9N96fJ2.js.br +0 -0
- package/dist/public/assets/index-DER-DYLd.css +1 -0
- package/dist/public/assets/index-DER-DYLd.css.br +0 -0
- package/dist/public/assets/{index-O0TENe77.js → index-YhxvkywD.js} +1 -1
- package/dist/public/assets/index-YhxvkywD.js.br +0 -0
- package/dist/public/index.html +2 -2
- package/dist/scripts/worker.js +4 -27
- package/package.json +3 -2
- package/dist/public/assets/index-BLMuzkOF.js.br +0 -0
- package/dist/public/assets/index-O0TENe77.js.br +0 -0
- package/dist/public/assets/index-tH12LIuT.js.br +0 -0
|
Binary file
|
package/dist/public/index.html
CHANGED
|
@@ -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-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
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>
|
package/dist/scripts/worker.js
CHANGED
|
@@ -83,12 +83,9 @@ async function compile(context = {}) {
|
|
|
83
83
|
chalk.yellow.underline(outputDir),
|
|
84
84
|
),
|
|
85
85
|
);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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:
|
|
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
|
|
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.
|
|
51
|
+
"ttmg-pack": "0.2.9",
|
|
51
52
|
"ws": "^8.18.3"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|