Skip to content

Commit

Permalink
Monorepo working
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Aug 15, 2024
1 parent 2109dea commit 68f0d00
Show file tree
Hide file tree
Showing 104 changed files with 312 additions and 273 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ I have setup Prettier and ESLint, they use some basic rules (you can propose new

To run all the tests (unit and e2e) please run:

`npm test`
`npm run test`

This is not instantaneous: playwright may seems to do nothing for a while at first.

Expand Down
Binary file added bun.lockb
Binary file not shown.
59 changes: 43 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
{
"name": "@aitube/clapper-monorepo",
"version": "1.0.0",
"private": true,
"description": "A monorepo for the Clapper project. Individual packages are in the packages directory.",
"workspaces": [
"packages/*"
],
"scripts": {
"dev": "npm install --verbose && npm run dev --workspaces",
"start": "npm run start --workspaces",
"build": "npm install --verbose && npm run build --workspaces",
"test": "npm run test --workspaces",
"format": "npm run format --workspaces"
}
}

"name": "@aitube/clapper-monorepo",
"version": "0.2.4",
"private": true,
"description": "A monorepo for the Clapper project. Individual packages are in the packages directory.",
"workspaces": [
"packages/clap",
"packages/timeline",
"packages/api-client",
"packages/io",
"packages/colors",
"packages/engine",
"packages/broadway",
"packages/clapper-services",
"packages/app"
],
"engines": {
"bun": ">=1.0.0"
},
"scripts": {
"dev": "bun run --cwd packages/app dev",
"start": "bun run --cwd packages/app start",
"build": "bun run build:all",
"build:all": "bun run build:clap && bun run build:timeline && bun run build:api-client && bun run build:io && bun run build:colors && bun run build:engine && bun run build:broadway && bun run build:services && bun run build:app",
"build:clap": "bun run --cwd packages/clap build",
"build:timeline": "bun run --cwd packages/timeline build",
"build:api-client": "bun run --cwd packages/api-client build",
"build:io": "bun run --cwd packages/io build",
"build:colors": "bun run --cwd packages/colors build",
"build:engine": "bun run --cwd packages/engine build",
"build:broadway": "bun run --cwd packages/broadway build",
"build:clapper-services": "bun run --cwd packages/clapper-services build",
"build:app": "bun run --cwd packages/app build",
"test": "bun run test:all",
"test:all": "bun run --cwd packages/clap test && bun run --cwd packages/timeline test && bun run --cwd packages/api-client test && bun run --cwd packages/io test && bun run --cwd packages/colors test && bun run --cwd packages/engine test && bun run --cwd packages/broadway test && bun run --cwd packages/clapper-services test && bun run --cwd packages/app test",
"format": "bun run --cwd packages/app format"
},
"packageManager": "[email protected]",
"trustedDependencies": [
"@aitube/clapper",
"onnxruntime-node",
"protobufjs"
]
}
6 changes: 3 additions & 3 deletions packages/api-client/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @aitube/client
# @aitube/api-client

*Official API client for AiTube.at*

Expand All @@ -20,7 +20,7 @@ so we need to perform all API calls to `jbilcke-hf-ai-tube.hf.space`.
To install the package, run the following command:

```bash
npm install @aitube/client
npm install @aitube/api-client
```

## Getting Started
Expand Down Expand Up @@ -48,7 +48,7 @@ import {
ClapEntityPrompt,
SupportedExportFormat,
applyClapCompletion,
} from '@aitube/client'
} from '@aitube/api-client'

const ultraSecret = "ultra secret token unavailable to common mortals"

Expand Down
Binary file removed packages/api-client/bun.lockb
Binary file not shown.
7 changes: 2 additions & 5 deletions packages/api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@aitube/client",
"name": "@aitube/api-client",
"module": "index.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"version": "0.2.3",
"version": "0.2.4",
"description": "Official API client for AiTube.at",
"scripts": {
"build": "bun build ./src/index.ts --outfile=dist/index.js --external=@aitube/clap && bun run build:declaration",
Expand All @@ -19,9 +19,6 @@
"rimraf": "^6.0.1",
"typescript": "^5.5.4"
},
"peerDependencies": {
"@aitube/clap": "file:../clap"
},
"repository": {
"type": "git",
"url": "https://github.com/jbilcke-hf/aitube-client.git"
Expand Down
4 changes: 2 additions & 2 deletions packages/api-client/src/api/editClapVideos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function editClapVideos({
}
// special trick to not touch the generated
// storyboards that are used by pending videos
const idsOfStoryboardsToKeep = clap.segments.map(segment => {
const idsOfStoryboardsToKeep = clap.segments.map((segment: ClapSegment) => {

const isPendingVideo = (
segment.category === ClapSegmentCategory.VIDEO
Expand All @@ -61,7 +61,7 @@ export async function editClapVideos({
).at(0)

return storyboard?.id
}).filter(x => x) as string[]
}).filter((x: any) => x) as string[]

const newClap = await fetchClap(`${aitubeApiUrl}edit/videos?${queryString.stringify(params)}`, {
method: "POST",
Expand Down
38 changes: 19 additions & 19 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aitube/clapper",
"version": "0.0.8",
"version": "0.2.4",
"private": true,
"description": "🎬 Clapper",
"license": "GPL-3.0-only",
Expand All @@ -13,35 +13,35 @@
"public:": "./public"
},
"scripts": {
"dev": "npm run checks && next dev",
"build": "npm run prepare && npm run checks && rm -Rf out && next build && npm run build:copyassets",
"build:ci": "rm -Rf out && npm run prepare && next build && npm run build:copyassets",
"build:copyassets": "cp -R public .next/standalone/public && cp -R .next/static .next/standalone/.next/static",
"prepare": "cp -R node_modules/mediainfo.js/dist/MediaInfoModule.wasm public/wasm/",
"dev": "bun run checks && next dev",
"build": "bun run prepare && bun run checks && rm -Rf out && next build && bun run build:copyassets",
"build:ci": "rm -Rf out && bun run prepare && next build && bun run build:copyassets",
"build:copyassets": "cp -R public .next/standalone/public && cp -R .next/static .next/standalone/static",
"prepare": "cp -R ../../node_modules/mediainfo.js/dist/MediaInfoModule.wasm public/wasm/",
"start": "next start",
"start:prod": "node .next/standalone/server.js",
"checks": "npm run format:fix && npm run lint",
"checks": "bun run format:fix && bun run lint",
"format": "prettier --check --ignore-path .gitignore ./src/",
"format:fix": "prettier --write --ignore-path .gitignore ./src/",
"lint": "next lint",
"lint:fix": "next lint --fix",
"test": "npm run build && npm run test:unit:ci",
"test_TEMPORARY_DISABLED": "npm run build && npm run test:unit:ci && npm run test:e2e",
"test": "bun run build && bun run test:unit:ci",
"test_TEMPORARY_DISABLED": "bun run build && bun run test:unit:ci && bun run test:e2e",
"test:unit:ci": "vitest run",
"test:unit:watch": "vitest",
"test:e2e": "npx playwright test",
"electron": "npm run build && electron .",
"electron:start": "npm run build && electron-forge start",
"electron:package": "npm run build && electron-forge package",
"electron:make": "npm run build && electron-forge make"
"electron": "bun run build && electron .",
"electron:start": "bun run build && electron-forge start",
"electron:package": "bun run build && electron-forge package",
"electron:make": "bun run build && electron-forge make"
},
"dependencies": {
"@aitube/broadway": "file:../broadway",
"@aitube/clap": "file:../clap",
"@aitube/clapper-services": "file:../services",
"@aitube/client": "file:../api-client",
"@aitube/engine": "file:../engine",
"@aitube/timeline": "file:../timeline",
"@aitube/api-client": "workspace:*",
"@aitube/broadway": "workspace:*",
"@aitube/clap": "workspace:*",
"@aitube/clapper-services": "workspace:*",
"@aitube/engine": "workspace:*",
"@aitube/timeline": "workspace:*",
"@fal-ai/serverless-client": "^0.13.0",
"@ffmpeg/ffmpeg": "^0.12.10",
"@ffmpeg/util": "^0.12.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/app/api/assistant/askAnyAssistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export async function askAnyAssistant({
})
// console.log('Lanchain success on the first time! rawResponse:', rawResponse)

assistantMessage = parseLangChainResponse(rawResponse)
assistantMessage = parseLangChainResponse(rawResponse as any)
// console.log('assistantMessage:', assistantMessage)
} catch (err) {
// LangChain failure (this happens quite often, actually)
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/app/api/resolve/providers/aitube/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
editClapSounds,
editClapStoryboards,
editClapVideos,
} from '@aitube/client'
} from '@aitube/api-client'

import { getWorkflowInputValues } from '../getWorkflowInputValues'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function AssistantWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function ImageDepthWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function ImageGenerationWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function ImageSegmentationWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function ImageUpscalingWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function MusicGenerationWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function SoundGenerationWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function VideoDepthWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function VideoGenerationWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function VideoSegmentationWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function VideoUpscalingWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function VoiceGenerationWorkflows() {
</ClapWorkflowProviderName>
</MenubarSubTrigger>
<MenubarSubContent>
{workflows.map((w) => (
{workflows?.map((w) => (
<MenubarCheckboxItem
key={w.id}
checked={workflowId === w.id}
Expand Down
Loading

0 comments on commit 68f0d00

Please sign in to comment.