vibefast-cli 0.1.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/FINAL-STATUS.md +144 -0
- package/HOW-IT-WORKS.md +559 -0
- package/PLAN.md +453 -0
- package/README.md +129 -0
- package/RECIPES-READY.md +172 -0
- package/STATUS.md +199 -0
- package/SUCCESS.md +259 -0
- package/TESTING-CHECKLIST.md +450 -0
- package/cloudflare-worker/.wrangler/state/v3/kv/64907821e2634080acce34618d2f3d4c/blobs/11f2769953c717e188062bc644da97c1fd1e4d6d0813a226ce7567dba759afab0000019a736fb8d4 +1 -0
- package/cloudflare-worker/.wrangler/state/v3/kv/miniflare-KVNamespaceObject/0b03767237c0408301af51ca35d4b09470cbc479c7e5f23cc9de774749d23c59.sqlite +0 -0
- package/cloudflare-worker/.wrangler/state/v3/kv/miniflare-KVNamespaceObject/0b03767237c0408301af51ca35d4b09470cbc479c7e5f23cc9de774749d23c59.sqlite-shm +0 -0
- package/cloudflare-worker/.wrangler/state/v3/kv/miniflare-KVNamespaceObject/0b03767237c0408301af51ca35d4b09470cbc479c7e5f23cc9de774749d23c59.sqlite-wal +0 -0
- package/cloudflare-worker/.wrangler/state/v3/r2/miniflare-R2BucketObject/d1cc388a1a0ef44dd5669fd1a165d168b61362136c8b5fa50aefd96c72688e54.sqlite +0 -0
- package/cloudflare-worker/.wrangler/state/v3/r2/miniflare-R2BucketObject/d1cc388a1a0ef44dd5669fd1a165d168b61362136c8b5fa50aefd96c72688e54.sqlite-shm +0 -0
- package/cloudflare-worker/.wrangler/state/v3/r2/miniflare-R2BucketObject/d1cc388a1a0ef44dd5669fd1a165d168b61362136c8b5fa50aefd96c72688e54.sqlite-wal +0 -0
- package/cloudflare-worker/.wrangler/state/v3/r2/vibefast-recipes/blobs/620e8cf7c35d9806da25dee237e1d7e8b2432bd98f755b60e2c7f08a48d2c7b90000019a73736484 +0 -0
- package/cloudflare-worker/MIGRATION.md +160 -0
- package/cloudflare-worker/QUICKSTART.md +200 -0
- package/cloudflare-worker/README.md +242 -0
- package/cloudflare-worker/generate-token.js +32 -0
- package/cloudflare-worker/mini-native@latest.zip +0 -0
- package/cloudflare-worker/setup.sh +143 -0
- package/cloudflare-worker/test-recipe/apps/native/src/app/mini/index.tsx +15 -0
- package/cloudflare-worker/test-recipe/recipe.json +16 -0
- package/cloudflare-worker/worker.js +308 -0
- package/cloudflare-worker/wrangler.toml +13 -0
- package/dist/commands/add.d.ts +3 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +149 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/devices.d.ts +3 -0
- package/dist/commands/devices.d.ts.map +1 -0
- package/dist/commands/devices.js +35 -0
- package/dist/commands/devices.js.map +1 -0
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +67 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +40 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/login.d.ts +3 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +23 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +3 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +16 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/remove.d.ts +3 -0
- package/dist/commands/remove.d.ts.map +1 -0
- package/dist/commands/remove.js +67 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/core/__tests__/journal.test.d.ts +2 -0
- package/dist/core/__tests__/journal.test.d.ts.map +1 -0
- package/dist/core/__tests__/journal.test.js +101 -0
- package/dist/core/__tests__/journal.test.js.map +1 -0
- package/dist/core/__tests__/validate.test.d.ts +2 -0
- package/dist/core/__tests__/validate.test.d.ts.map +1 -0
- package/dist/core/__tests__/validate.test.js +53 -0
- package/dist/core/__tests__/validate.test.js.map +1 -0
- package/dist/core/archive.d.ts +2 -0
- package/dist/core/archive.d.ts.map +1 -0
- package/dist/core/archive.js +59 -0
- package/dist/core/archive.js.map +1 -0
- package/dist/core/auth.d.ts +15 -0
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js +76 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/codemod.d.ts +20 -0
- package/dist/core/codemod.d.ts.map +1 -0
- package/dist/core/codemod.js +150 -0
- package/dist/core/codemod.js.map +1 -0
- package/dist/core/fsx.d.ts +12 -0
- package/dist/core/fsx.d.ts.map +1 -0
- package/dist/core/fsx.js +70 -0
- package/dist/core/fsx.js.map +1 -0
- package/dist/core/http.d.ts +30 -0
- package/dist/core/http.d.ts.map +1 -0
- package/dist/core/http.js +95 -0
- package/dist/core/http.js.map +1 -0
- package/dist/core/journal.d.ts +18 -0
- package/dist/core/journal.d.ts.map +1 -0
- package/dist/core/journal.js +34 -0
- package/dist/core/journal.js.map +1 -0
- package/dist/core/log.d.ts +8 -0
- package/dist/core/log.d.ts.map +1 -0
- package/dist/core/log.js +9 -0
- package/dist/core/log.js.map +1 -0
- package/dist/core/pathGuard.d.ts +3 -0
- package/dist/core/pathGuard.d.ts.map +1 -0
- package/dist/core/pathGuard.js +18 -0
- package/dist/core/pathGuard.js.map +1 -0
- package/dist/core/paths.d.ts +11 -0
- package/dist/core/paths.d.ts.map +1 -0
- package/dist/core/paths.js +22 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/validate.d.ts +8 -0
- package/dist/core/validate.d.ts.map +1 -0
- package/dist/core/validate.js +27 -0
- package/dist/core/validate.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/docs/decisions.md +55 -0
- package/package.json +39 -0
- package/recipes/audio-recorder/apps/native/src/app/audio-recorder/index.tsx +5 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/components/audio-player.tsx +301 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/components/audio-recorder.tsx +373 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/components/audio-waveform.tsx +270 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/components/index.ts +4 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/components/recording-list.tsx +89 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/demo/audio-player-demo.tsx +66 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/demo/audio-recorder-cloud.tsx +68 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/demo/audio-recorder-interview.tsx +102 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/demo/basic.tsx +27 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/demo/index.ts +5 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/demo/with-recording-list-demo.tsx +82 -0
- package/recipes/audio-recorder/recipe.json +22 -0
- package/recipes/audio-recorder@latest.zip +0 -0
- package/recipes/charts/apps/native/src/app/charts/index.tsx +3 -0
- package/recipes/charts/apps/native/src/features/charts/README.md +185 -0
- package/recipes/charts/apps/native/src/features/charts/app/preview.tsx +223 -0
- package/recipes/charts/apps/native/src/features/charts/components/area-chart.tsx +40 -0
- package/recipes/charts/apps/native/src/features/charts/components/bar-chart.tsx +143 -0
- package/recipes/charts/apps/native/src/features/charts/components/candlestick-chart.tsx +196 -0
- package/recipes/charts/apps/native/src/features/charts/components/chart-card.tsx +65 -0
- package/recipes/charts/apps/native/src/features/charts/components/column-chart.tsx +143 -0
- package/recipes/charts/apps/native/src/features/charts/components/doughnut-chart.tsx +246 -0
- package/recipes/charts/apps/native/src/features/charts/components/index.ts +10 -0
- package/recipes/charts/apps/native/src/features/charts/components/line-chart.tsx +308 -0
- package/recipes/charts/apps/native/src/features/charts/components/radar-chart.tsx +180 -0
- package/recipes/charts/apps/native/src/features/charts/components/radial-bar-chart.tsx +188 -0
- package/recipes/charts/apps/native/src/features/charts/components/stacked-area-chart.tsx +265 -0
- package/recipes/charts/apps/native/src/features/charts/components/stacked-bar-chart.tsx +322 -0
- package/recipes/charts/apps/native/src/features/charts/data/mock-data.ts +183 -0
- package/recipes/charts/apps/native/src/features/charts/types/index.ts +66 -0
- package/recipes/charts/recipe.json +22 -0
- package/recipes/charts@latest.zip +0 -0
- package/recipes/chatbot/apps/native/src/app/chatbot/index.tsx +1 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/app/index.tsx +302 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/chat-header-buttons.tsx +59 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/chat-input-bar.tsx +469 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/chat-markdown.tsx +575 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/chat-message-bubble.tsx +246 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/chat-settings-modal.tsx +161 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/image-preview-list.tsx +115 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/markdown/code-block.tsx +165 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/markdown/index.ts +10 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/markdown/table-renderer.tsx +129 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/message-error-boundary.tsx +78 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/message-list.tsx +173 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/model-selector.tsx +283 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/report-content-modal.tsx +188 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/suggested-messages.tsx +67 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/constants/models.ts +20 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/constants/report-reasons.ts +9 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/hooks/use-attachment-cache.ts +143 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/hooks/use-chat-config.ts +664 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/hooks/use-chat-handlers.ts +359 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/hooks/use-chatbot-settings.ts +89 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/hooks/use-conversation.ts +79 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/hooks/use-image-picker.ts +122 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/hooks/use-keyboard-coordinator.ts +161 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/hooks/use-smart-scroll-manager.ts +207 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/models/index.ts +86 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/models/models.ts +162 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/models/providers.ts +62 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/models/types.ts +40 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/services/file-uploader.ts +238 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/services/message-handler-service.ts +180 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/types/index.ts +60 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/utils/chat-telemetry.ts +91 -0
- package/recipes/chatbot/recipe.json +22 -0
- package/recipes/chatbot@latest.zip +0 -0
- package/recipes/image-generator/apps/native/src/app/image-generator/gallery.tsx +3 -0
- package/recipes/image-generator/apps/native/src/app/image-generator/index.tsx +3 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/app/_layout.tsx +25 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/app/gallery.tsx +217 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/app/index.tsx +237 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/components/gallery-image.tsx +26 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/components/image-detail-modal.tsx +215 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/components/image-model-selector.tsx +210 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/components/image-placeholder.tsx +26 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/hooks/use-image-gallery.ts +71 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/hooks/use-image-generator-settings.ts +152 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/hooks/use-image-generator.ts +93 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/models/models.ts +66 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/services/image-gallery-service.ts +98 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/services/image-save-service.ts +121 -0
- package/recipes/image-generator/recipe.json +22 -0
- package/recipes/image-generator@latest.zip +0 -0
- package/recipes/quiz/apps/native/src/app/quiz/index.tsx +47 -0
- package/recipes/quiz/apps/native/src/features/quiz/components/question.tsx +67 -0
- package/recipes/quiz/apps/native/src/features/quiz/config.ts +11 -0
- package/recipes/quiz/apps/native/src/features/quiz/index.tsx +133 -0
- package/recipes/quiz/recipe.json +22 -0
- package/recipes/quiz@latest.zip +0 -0
- package/recipes/tracker-app/apps/native/src/app/tracker-app/index.tsx +1 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/app/index.tsx +108 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/components/animated-number.tsx +102 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/components/calorie-card.tsx +66 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/components/circular-progress.tsx +97 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/components/floating-add-button.tsx +27 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/components/macro-card.tsx +80 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/components/promo-banner.tsx +98 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/components/recently-logged.tsx +64 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/components/week-calendar.tsx +68 -0
- package/recipes/tracker-app/recipe.json +22 -0
- package/recipes/tracker-app@latest.zip +0 -0
- package/recipes/upload-all.sh +32 -0
- package/recipes/voice-bot/apps/native/src/app/voice-bot/index.tsx +27 -0
- package/recipes/voice-bot/apps/native/src/features/voice-bot/README.md +185 -0
- package/recipes/voice-bot/apps/native/src/features/voice-bot/components/conversation-status.tsx +76 -0
- package/recipes/voice-bot/apps/native/src/features/voice-bot/components/index.ts +4 -0
- package/recipes/voice-bot/apps/native/src/features/voice-bot/components/message-input.tsx +98 -0
- package/recipes/voice-bot/apps/native/src/features/voice-bot/components/voice-bot-screen.tsx +173 -0
- package/recipes/voice-bot/apps/native/src/features/voice-bot/components/voice-controls.tsx +73 -0
- package/recipes/voice-bot/apps/native/src/features/voice-bot/index.ts +3 -0
- package/recipes/voice-bot/apps/native/src/features/voice-bot/services/index.ts +1 -0
- package/recipes/voice-bot/apps/native/src/features/voice-bot/services/use-voice-bot.ts +161 -0
- package/recipes/voice-bot/apps/native/src/features/voice-bot/types.ts +29 -0
- package/recipes/voice-bot/recipe.json +22 -0
- package/recipes/voice-bot@latest.zip +0 -0
- package/scripts/create-recipes.mjs +189 -0
- package/src/commands/add.ts +183 -0
- package/src/commands/devices.ts +38 -0
- package/src/commands/doctor.ts +67 -0
- package/src/commands/list.ts +45 -0
- package/src/commands/login.ts +24 -0
- package/src/commands/logout.ts +15 -0
- package/src/commands/remove.ts +78 -0
- package/src/core/__tests__/journal.test.ts +119 -0
- package/src/core/__tests__/validate.test.ts +64 -0
- package/src/core/archive.ts +69 -0
- package/src/core/auth.ts +103 -0
- package/src/core/codemod.ts +211 -0
- package/src/core/fsx.ts +80 -0
- package/src/core/http.ts +136 -0
- package/src/core/journal.ts +64 -0
- package/src/core/log.ts +9 -0
- package/src/core/pathGuard.ts +22 -0
- package/src/core/paths.ts +33 -0
- package/src/core/validate.ts +44 -0
- package/src/index.ts +27 -0
- package/test-critical-cases.mjs +258 -0
- package/tsconfig.json +21 -0
- package/vitest.config.mts +12 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { addCommand } from './commands/add.js';
|
|
4
|
+
import { removeCommand } from './commands/remove.js';
|
|
5
|
+
import { listCommand } from './commands/list.js';
|
|
6
|
+
import { doctorCommand } from './commands/doctor.js';
|
|
7
|
+
import { loginCommand } from './commands/login.js';
|
|
8
|
+
import { devicesCommand } from './commands/devices.js';
|
|
9
|
+
import { logoutCommand } from './commands/logout.js';
|
|
10
|
+
const program = new Command();
|
|
11
|
+
program
|
|
12
|
+
.name('vf')
|
|
13
|
+
.description('VibeFast CLI - Install features into your monorepo')
|
|
14
|
+
.version('0.1.0');
|
|
15
|
+
program.addCommand(loginCommand);
|
|
16
|
+
program.addCommand(logoutCommand);
|
|
17
|
+
program.addCommand(devicesCommand);
|
|
18
|
+
program.addCommand(doctorCommand);
|
|
19
|
+
program.addCommand(listCommand);
|
|
20
|
+
program.addCommand(addCommand);
|
|
21
|
+
program.addCommand(removeCommand);
|
|
22
|
+
program.parse();
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,IAAI,CAAC;KACV,WAAW,CAAC,oDAAoD,CAAC;KACjE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC/B,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAElC,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# VibeFast CLI — Decisions & Ground Rules
|
|
2
|
+
|
|
3
|
+
## Package Details
|
|
4
|
+
- **Package name:** `vibefast-cli`
|
|
5
|
+
- **Binary alias:** `vf`
|
|
6
|
+
- **Default target:** `native` (override with `--target web`)
|
|
7
|
+
|
|
8
|
+
## Authentication
|
|
9
|
+
- **Method:** Fixed opaque token per customer
|
|
10
|
+
- **Device slots:** 2 by default
|
|
11
|
+
- **Storage:** Cloudflare Worker validates token/seat → issues short-lived signed URL to recipe zip in R2/KV
|
|
12
|
+
|
|
13
|
+
## Repository Signature
|
|
14
|
+
Requires `.vibefast/starter.json`:
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"name": "vibefast",
|
|
18
|
+
"version": "1.0.0",
|
|
19
|
+
"targets": ["native", "web"]
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Code Markers
|
|
24
|
+
|
|
25
|
+
### Native Target
|
|
26
|
+
File: `apps/native/src/app/(root)/(protected)/(tabs)/index.tsx`
|
|
27
|
+
```tsx
|
|
28
|
+
// --- @vibefast:navigation:start ---
|
|
29
|
+
{/* CLI will inject feature links here */}
|
|
30
|
+
// --- @vibefast:navigation:end ---
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Web Target
|
|
34
|
+
File: `apps/web/app/page.tsx`
|
|
35
|
+
```tsx
|
|
36
|
+
{/* @vibefast:nav:start */}
|
|
37
|
+
{/* CLI will inject feature cards here */}
|
|
38
|
+
{/* @vibefast:nav:end */}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Journal
|
|
42
|
+
- **Location:** `.vibefast/journal.json`
|
|
43
|
+
- **Purpose:** Tracks installed files and nav inserts
|
|
44
|
+
|
|
45
|
+
## Rate Limits
|
|
46
|
+
- **Daily:** 500 requests per token
|
|
47
|
+
- **Per minute:** 30 requests per token
|
|
48
|
+
- Subject to tuning based on usage patterns
|
|
49
|
+
|
|
50
|
+
## Delivery Architecture
|
|
51
|
+
1. CLI sends token + device info to Cloudflare Worker
|
|
52
|
+
2. Worker validates token and checks device slots
|
|
53
|
+
3. Worker issues short-lived signed URL to recipe zip in R2/KV
|
|
54
|
+
4. CLI downloads and extracts recipe
|
|
55
|
+
5. CLI applies codemod and updates journal
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vibefast-cli",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "CLI for installing VibeFast features into your monorepo",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"vf": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "tsx src/index.ts",
|
|
12
|
+
"test": "vitest",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"vibefast",
|
|
17
|
+
"cli",
|
|
18
|
+
"expo",
|
|
19
|
+
"nextjs",
|
|
20
|
+
"monorepo"
|
|
21
|
+
],
|
|
22
|
+
"author": "VibeFast",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"commander": "^12.0.0",
|
|
26
|
+
"picocolors": "^1.0.0",
|
|
27
|
+
"yauzl": "^2.10.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^20.11.0",
|
|
31
|
+
"@types/yauzl": "^2.10.3",
|
|
32
|
+
"tsx": "^4.7.0",
|
|
33
|
+
"typescript": "^5.3.3",
|
|
34
|
+
"vitest": "^1.2.0"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=18.0.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
package/recipes/audio-recorder/apps/native/src/features/audio-recorder/components/audio-player.tsx
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type AudioSource,
|
|
3
|
+
useAudioPlayer,
|
|
4
|
+
useAudioPlayerStatus,
|
|
5
|
+
} from 'expo-audio';
|
|
6
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
7
|
+
import { View, type ViewStyle } from 'react-native';
|
|
8
|
+
import { tv } from 'tailwind-variants';
|
|
9
|
+
|
|
10
|
+
import { Button, Icon, Text } from '@/components/ui';
|
|
11
|
+
import { useThemeConfig } from '@/lib/use-theme-config';
|
|
12
|
+
|
|
13
|
+
// import { Progress } from '@/components/ui/progress';
|
|
14
|
+
import { AudioWaveform } from './audio-waveform';
|
|
15
|
+
|
|
16
|
+
const audioPlayerStyles = tv({
|
|
17
|
+
slots: {
|
|
18
|
+
container: 'm-2 rounded-2xl p-4',
|
|
19
|
+
waveformContainer: 'mb-3 items-center',
|
|
20
|
+
progressBarContainer: 'mb-3 px-1',
|
|
21
|
+
timerContainer: 'mb-3 flex-row items-center justify-between',
|
|
22
|
+
timerText: 'font-mono text-sm text-muted',
|
|
23
|
+
controlsContainer: 'mt-2 flex-row items-center justify-center gap-4',
|
|
24
|
+
controlButton: 'size-14',
|
|
25
|
+
playPauseButton: 'size-16 rounded-full',
|
|
26
|
+
loadingContainer: 'items-center p-2',
|
|
27
|
+
loadingText: 'text-muted',
|
|
28
|
+
},
|
|
29
|
+
variants: {
|
|
30
|
+
shrinked: {
|
|
31
|
+
true: {
|
|
32
|
+
container: 'm-0 rounded-2xl p-2',
|
|
33
|
+
waveformContainer: 'mb-0 items-center',
|
|
34
|
+
progressBarContainer: 'mb-0 px-1',
|
|
35
|
+
timerContainer: 'mb-0 flex-row items-center justify-between',
|
|
36
|
+
controlsContainer: 'mt-0 flex-row items-center justify-center gap-2',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export interface AudioPlayerProps {
|
|
43
|
+
source: AudioSource;
|
|
44
|
+
shrinked?: boolean;
|
|
45
|
+
style?: ViewStyle & { className?: string };
|
|
46
|
+
showControls?: boolean;
|
|
47
|
+
showWaveform?: boolean;
|
|
48
|
+
showTimer?: boolean;
|
|
49
|
+
showProgressBar?: boolean;
|
|
50
|
+
autoPlay?: boolean;
|
|
51
|
+
onPlaybackStatusUpdate?: (status: any) => void;
|
|
52
|
+
// Custom sizing props for compact mode
|
|
53
|
+
waveformHeight?: number;
|
|
54
|
+
waveformBarCount?: number;
|
|
55
|
+
waveformBarWidth?: number;
|
|
56
|
+
waveformBarGap?: number;
|
|
57
|
+
controlButtonSize?: number;
|
|
58
|
+
playButtonSize?: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function AudioPlayer({
|
|
62
|
+
source,
|
|
63
|
+
style,
|
|
64
|
+
shrinked = false,
|
|
65
|
+
showControls = true,
|
|
66
|
+
showWaveform = true,
|
|
67
|
+
showTimer = true,
|
|
68
|
+
// showProgressBar = true,
|
|
69
|
+
autoPlay = false,
|
|
70
|
+
onPlaybackStatusUpdate,
|
|
71
|
+
// Custom sizing with defaults
|
|
72
|
+
waveformHeight = 80,
|
|
73
|
+
waveformBarCount = 60,
|
|
74
|
+
waveformBarWidth = 4,
|
|
75
|
+
waveformBarGap = 1.5,
|
|
76
|
+
controlButtonSize = 24,
|
|
77
|
+
playButtonSize = 28,
|
|
78
|
+
}: AudioPlayerProps) {
|
|
79
|
+
const {
|
|
80
|
+
container,
|
|
81
|
+
waveformContainer,
|
|
82
|
+
// progressBarContainer,
|
|
83
|
+
timerContainer,
|
|
84
|
+
timerText,
|
|
85
|
+
controlsContainer,
|
|
86
|
+
controlButton,
|
|
87
|
+
playPauseButton,
|
|
88
|
+
loadingContainer,
|
|
89
|
+
loadingText,
|
|
90
|
+
} = audioPlayerStyles({ shrinked });
|
|
91
|
+
const theme = useThemeConfig();
|
|
92
|
+
const player = useAudioPlayer(source);
|
|
93
|
+
const status = useAudioPlayerStatus(player);
|
|
94
|
+
const [duration, setDuration] = useState(0);
|
|
95
|
+
const [position, setPosition] = useState(0);
|
|
96
|
+
const [isSeeking, setIsSeeking] = useState(false);
|
|
97
|
+
|
|
98
|
+
// Enhanced waveform data - more bars for smoother visualization
|
|
99
|
+
const [waveformData] = useState<number[]>(
|
|
100
|
+
Array.from({ length: 60 }, (_, i) => {
|
|
101
|
+
// Create more varied and realistic waveform pattern
|
|
102
|
+
const base1 = Math.sin((i / 60) * Math.PI * 6) * 0.4 + 0.5;
|
|
103
|
+
const base2 = Math.sin((i / 60) * Math.PI * 2.5) * 0.3 + 0.4;
|
|
104
|
+
const noise = (Math.random() - 0.5) * 0.25;
|
|
105
|
+
const peak = Math.random() < 0.15 ? Math.random() * 0.4 : 0; // Occasional peaks
|
|
106
|
+
return Math.max(0.15, Math.min(0.95, (base1 + base2) / 2 + noise + peak));
|
|
107
|
+
}),
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (autoPlay && player.isLoaded && !player.playing) {
|
|
112
|
+
player.play();
|
|
113
|
+
}
|
|
114
|
+
}, [autoPlay, player]);
|
|
115
|
+
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (!isSeeking && status?.isLoaded) {
|
|
118
|
+
setDuration(status.duration || 0);
|
|
119
|
+
setPosition(status.currentTime || 0);
|
|
120
|
+
|
|
121
|
+
if (status.didJustFinish && status.duration > 0) {
|
|
122
|
+
player.seekTo(0);
|
|
123
|
+
player.pause();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
onPlaybackStatusUpdate?.(status);
|
|
127
|
+
}
|
|
128
|
+
}, [status, isSeeking, player, onPlaybackStatusUpdate]);
|
|
129
|
+
|
|
130
|
+
const handlePlayPause = () => {
|
|
131
|
+
if (player.playing) {
|
|
132
|
+
player.pause();
|
|
133
|
+
} else {
|
|
134
|
+
player.play();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const handleBackFiveSeconds = () => {
|
|
139
|
+
const newPosition = Math.max(0, position - 5);
|
|
140
|
+
seekToPosition(newPosition);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const handleRestart = () => {
|
|
144
|
+
seekToPosition(0);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// Unified seeking function
|
|
148
|
+
const seekToPosition = useCallback(
|
|
149
|
+
(newPosition: number) => {
|
|
150
|
+
if (player.isLoaded && duration > 0) {
|
|
151
|
+
const clampedPosition = Math.max(0, Math.min(duration, newPosition));
|
|
152
|
+
player.seekTo(clampedPosition);
|
|
153
|
+
setPosition(clampedPosition);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
[player, duration],
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
// Handle waveform seeking
|
|
160
|
+
const handleWaveformSeek = useCallback(
|
|
161
|
+
(seekPercentage: number) => {
|
|
162
|
+
if (duration > 0) {
|
|
163
|
+
const newPosition = (seekPercentage / 100) * duration;
|
|
164
|
+
seekToPosition(newPosition);
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
[duration, seekToPosition],
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
// Handle progress bar seeking
|
|
171
|
+
// const handleProgressSeek = useCallback(
|
|
172
|
+
// (progressValue: number) => {
|
|
173
|
+
// if (duration > 0) {
|
|
174
|
+
// const newPosition = (progressValue / 100) * duration;
|
|
175
|
+
// seekToPosition(newPosition);
|
|
176
|
+
// }
|
|
177
|
+
// },
|
|
178
|
+
// [duration, seekToPosition]
|
|
179
|
+
// );
|
|
180
|
+
|
|
181
|
+
// Handle seeking start/end for smooth updates
|
|
182
|
+
const handleSeekStart = useCallback(() => {
|
|
183
|
+
setIsSeeking(true);
|
|
184
|
+
}, []);
|
|
185
|
+
|
|
186
|
+
const handleSeekEnd = useCallback(() => {
|
|
187
|
+
setIsSeeking(false);
|
|
188
|
+
}, []);
|
|
189
|
+
|
|
190
|
+
const formatTime = (seconds: number) => {
|
|
191
|
+
const mins = Math.floor(seconds / 60);
|
|
192
|
+
const secs = Math.floor(seconds % 60);
|
|
193
|
+
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const progressPercentage = duration > 0 ? (position / duration) * 100 : 0;
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
<View className={container({ class: style?.className })}>
|
|
200
|
+
{/* Waveform Visualization with seeking capability */}
|
|
201
|
+
{showWaveform && (
|
|
202
|
+
<View className={waveformContainer()}>
|
|
203
|
+
<AudioWaveform
|
|
204
|
+
data={waveformData}
|
|
205
|
+
isPlaying={player.playing}
|
|
206
|
+
progress={progressPercentage}
|
|
207
|
+
onSeek={handleWaveformSeek}
|
|
208
|
+
onSeekStart={handleSeekStart}
|
|
209
|
+
onSeekEnd={handleSeekEnd}
|
|
210
|
+
height={waveformHeight}
|
|
211
|
+
barCount={waveformBarCount}
|
|
212
|
+
barWidth={waveformBarWidth}
|
|
213
|
+
barGap={waveformBarGap}
|
|
214
|
+
animated={true}
|
|
215
|
+
showProgress={true}
|
|
216
|
+
interactive={true} // Enable seeking
|
|
217
|
+
/>
|
|
218
|
+
</View>
|
|
219
|
+
)}
|
|
220
|
+
|
|
221
|
+
{/* Interactive Progress Bar */}
|
|
222
|
+
{/* {showProgressBar && (
|
|
223
|
+
<View className={progressBarContainer()}>
|
|
224
|
+
<Progress
|
|
225
|
+
value={progressPercentage}
|
|
226
|
+
onValueChange={handleProgressSeek}
|
|
227
|
+
onSeekStart={handleSeekStart}
|
|
228
|
+
onSeekEnd={handleSeekEnd}
|
|
229
|
+
style={{ height: 8 }}
|
|
230
|
+
indicatorClassName="bg-destructive"
|
|
231
|
+
/>
|
|
232
|
+
</View>
|
|
233
|
+
)} */}
|
|
234
|
+
|
|
235
|
+
{/* Timer Display */}
|
|
236
|
+
{showTimer && (
|
|
237
|
+
<View className={timerContainer()}>
|
|
238
|
+
<Text className={timerText()}>{formatTime(position)}</Text>
|
|
239
|
+
<Text className={timerText()}>{formatTime(duration)}</Text>
|
|
240
|
+
</View>
|
|
241
|
+
)}
|
|
242
|
+
|
|
243
|
+
{/* Playback Controls */}
|
|
244
|
+
{showControls && (
|
|
245
|
+
<View className={controlsContainer()}>
|
|
246
|
+
{/* Back 5s Button */}
|
|
247
|
+
<Button
|
|
248
|
+
variant="ghost"
|
|
249
|
+
size="icon"
|
|
250
|
+
className={controlButton()}
|
|
251
|
+
onPress={handleBackFiveSeconds}
|
|
252
|
+
disabled={!player.isLoaded}
|
|
253
|
+
>
|
|
254
|
+
<Icon name="refresh" size={controlButtonSize} />
|
|
255
|
+
</Button>
|
|
256
|
+
|
|
257
|
+
{/* Play/Pause Button */}
|
|
258
|
+
<Button
|
|
259
|
+
variant="default"
|
|
260
|
+
size="icon"
|
|
261
|
+
className={playPauseButton()}
|
|
262
|
+
onPress={handlePlayPause}
|
|
263
|
+
disabled={!player.isLoaded}
|
|
264
|
+
>
|
|
265
|
+
{player.playing ? (
|
|
266
|
+
<Icon
|
|
267
|
+
name="pause"
|
|
268
|
+
size={playButtonSize}
|
|
269
|
+
color={theme.colors.background}
|
|
270
|
+
/>
|
|
271
|
+
) : (
|
|
272
|
+
<Icon
|
|
273
|
+
name="play"
|
|
274
|
+
size={playButtonSize}
|
|
275
|
+
color={theme.colors.background}
|
|
276
|
+
/>
|
|
277
|
+
)}
|
|
278
|
+
</Button>
|
|
279
|
+
|
|
280
|
+
{/* Stop Button */}
|
|
281
|
+
<Button
|
|
282
|
+
variant="ghost"
|
|
283
|
+
size="icon"
|
|
284
|
+
className={controlButton()}
|
|
285
|
+
onPress={handleRestart}
|
|
286
|
+
disabled={!player.isLoaded}
|
|
287
|
+
>
|
|
288
|
+
<Icon name="stop" size={controlButtonSize} />
|
|
289
|
+
</Button>
|
|
290
|
+
</View>
|
|
291
|
+
)}
|
|
292
|
+
|
|
293
|
+
{/* Loading State */}
|
|
294
|
+
{!player.isLoaded && (
|
|
295
|
+
<View className={loadingContainer()}>
|
|
296
|
+
<Text className={loadingText()}>Loading audio...</Text>
|
|
297
|
+
</View>
|
|
298
|
+
)}
|
|
299
|
+
</View>
|
|
300
|
+
);
|
|
301
|
+
}
|