tiktok-live-api 1.2.5 → 1.2.6

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.
Files changed (2) hide show
  1. package/bin/demo.mjs +12 -11
  2. package/package.json +1 -1
package/bin/demo.mjs CHANGED
@@ -274,20 +274,21 @@ function runScaffold(choice, targetDir, pm) {
274
274
  execSync(installCmd, { cwd: fullPath, stdio: 'inherit' });
275
275
 
276
276
  if (isNuxt) {
277
- const compDir = path.join(fullPath, 'components');
277
+ const isNuxt4 = fs.existsSync(path.join(fullPath, 'app', 'app.vue')) || !fs.existsSync(path.join(fullPath, 'app.vue'));
278
+ const baseApp = isNuxt4 ? path.join(fullPath, 'app') : fullPath;
279
+
280
+ const compDir = path.join(baseApp, 'components');
278
281
  if (!fs.existsSync(compDir)) fs.mkdirSync(compDir, { recursive: true });
279
282
  fs.writeFileSync(path.join(compDir, 'TikTokLive.vue'), VUE_TEMPLATE);
280
283
 
281
- const appVue = path.join(fullPath, 'app.vue');
282
- if (fs.existsSync(appVue)) {
283
- fs.writeFileSync(appVue, [
284
- '<template>',
285
- ' <main style="min-height: 100vh; background: #f9fafb; padding-top: 40px;">',
286
- ' <TikTokLive />',
287
- ' </main>',
288
- '</template>'
289
- ].join('\n') + '\n');
290
- }
284
+ const appVue = path.join(baseApp, 'app.vue');
285
+ fs.writeFileSync(appVue, [
286
+ '<template>',
287
+ ' <main style="min-height: 100vh; background: #f9fafb; padding-top: 40px;">',
288
+ ' <TikTokLive />',
289
+ ' </main>',
290
+ '</template>'
291
+ ].join('\\n') + '\\n');
291
292
  } else if (isNext) {
292
293
  const compDir = path.join(fullPath, 'src', 'components');
293
294
  if (!fs.existsSync(compDir)) fs.mkdirSync(compDir, { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiktok-live-api",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Unofficial TikTok LIVE API Client — Real-time chat, gifts, viewers, battles, and AI live captions from any TikTok livestream. Managed WebSocket API with 99.9% uptime.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",