@ttmg/cli 0.4.6-vibe-beta.2 → 0.4.6-vibe-beta.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttmg/cli",
3
- "version": "0.4.6-vibe-beta.2",
3
+ "version": "0.4.6-vibe-beta.3",
4
4
  "description": "TikTok Mini Game Command Line Tool",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -80,7 +80,7 @@
80
80
  "qs": "6.12.1",
81
81
  "semver": "^7.7.2",
82
82
  "socks-proxy-agent": "^9.0.0",
83
- "ttmg-pack": "0.4.8",
83
+ "ttmg-pack": "0.4.13-beta.1",
84
84
  "ws": "^8.18.3"
85
85
  },
86
86
  "devDependencies": {
@@ -65,8 +65,6 @@ async function run() {
65
65
  'dev',
66
66
  '--client-key',
67
67
  'smoke-client',
68
- '--format',
69
- 'json',
70
68
  '--events',
71
69
  'ndjson',
72
70
  '--no-open',
@@ -98,6 +96,33 @@ async function run() {
98
96
  const exitCode = await new Promise(resolve => child.once('close', resolve));
99
97
  assert.equal(exitCode, 0, stderr || stdout);
100
98
 
99
+ const stdoutEvents = stdout
100
+ .trim()
101
+ .split(/\r?\n/)
102
+ .filter(Boolean)
103
+ .map(line => JSON.parse(line));
104
+ assert.ok(stdoutEvents.length > 0, 'dev did not emit NDJSON events');
105
+ assert.equal(
106
+ stdoutEvents.every(
107
+ event =>
108
+ event.schemaVersion === '1' &&
109
+ typeof event.sessionId === 'string' &&
110
+ Number.isInteger(event.seq) &&
111
+ typeof event.type === 'string',
112
+ ),
113
+ true,
114
+ 'dev stdout contained a non-event JSON object',
115
+ );
116
+ assert.equal(
117
+ stdoutEvents.some(
118
+ event =>
119
+ event.type === 'lifecycle' &&
120
+ event.payload?.state === 'GAME_READY',
121
+ ),
122
+ true,
123
+ 'dev stdout did not contain the GAME_READY event',
124
+ );
125
+
101
126
  const events = fs
102
127
  .readFileSync(path.join(evidenceDirectory, 'events.ndjson'), 'utf8')
103
128
  .trim()
@@ -94,11 +94,39 @@ assert.equal(
94
94
  );
95
95
  assert.equal(capabilities.commands.build.platformWrite, false);
96
96
  assert.equal(capabilities.commands.dev.platformWrite, false);
97
+ assert.equal(
98
+ capabilities.commands.dev.command,
99
+ 'ttmg dev --format json --no-open',
100
+ );
101
+ assert.equal(
102
+ capabilities.commands.dev.eventsCommand,
103
+ 'ttmg dev --events ndjson --no-open',
104
+ );
105
+ assert.equal(capabilities.commands.dev.outputModesMutuallyExclusive, true);
97
106
  assert.equal(capabilities.commands.uploadPreview.platformWrite, true);
98
107
  assert.equal(capabilities.dev.gameReadyProtocol, true);
99
108
  assert.equal(capabilities.dev.gameReady, false);
100
109
  assertNoSecretKeys(capabilities, 'capabilities');
101
110
 
111
+ const conflictingDevOutput = runCli([
112
+ 'dev',
113
+ '--format',
114
+ 'json',
115
+ '--events',
116
+ 'ndjson',
117
+ '--no-open',
118
+ ]);
119
+ assertExit(conflictingDevOutput, 1, 'conflicting dev output modes');
120
+ assert.equal(
121
+ conflictingDevOutput.stdout,
122
+ '',
123
+ 'conflicting dev output modes must not write protocol data to stdout',
124
+ );
125
+ assert.match(
126
+ conflictingDevOutput.stderr,
127
+ /output modes cannot be combined|输出模式不能同时使用/,
128
+ );
129
+
102
130
  const checkHelp = runCli(['check', '--help']);
103
131
  assertExit(checkHelp, 0, 'check help');
104
132
  assert.match(checkHelp.stdout, /Usage: ttmg check \[options\]/);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttmg/cli",
3
- "version": "0.4.6-vibe-beta.2",
3
+ "version": "0.4.6-vibe-beta.3",
4
4
  "description": "TikTok Mini Game Command Line Tool",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -80,7 +80,7 @@
80
80
  "qs": "6.12.1",
81
81
  "semver": "^7.7.2",
82
82
  "socks-proxy-agent": "^9.0.0",
83
- "ttmg-pack": "0.4.8",
83
+ "ttmg-pack": "0.4.13-beta.1",
84
84
  "ws": "^8.18.3"
85
85
  },
86
86
  "devDependencies": {