diff --git a/.gitignore b/.gitignore index 651032dc3..7a2fc24a1 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ node_modules **/.cache/** **/.vitepress/docsMetadata.json **/.vitepress/cache/ +**/tsconfig.tsbuildinfo **/.netlify/* **/.netlify/functions-serve/* diff --git a/package.json b/package.json index 9af4345d2..55a7c61d2 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "scripts": { "lint": "eslint --cache .", "lint:fix": "eslint --cache --fix .", - "typecheck": "pnpm -r --filter=./packages/* run build", + "typecheck": "pnpm -r --filter=./packages/* run typecheck", "dev": "pnpm packages:dev", "build": "pnpm packages:build", "dev:tamagotchi": "pnpm packages:dev:tamagotchi", diff --git a/packages/elevenlabs/package.json b/packages/elevenlabs/package.json index 0b69b240d..3302a631d 100644 --- a/packages/elevenlabs/package.json +++ b/packages/elevenlabs/package.json @@ -30,6 +30,7 @@ "dev": "pnpm run stub", "stub": "unbuild --stub", "build": "unbuild", + "typecheck": "tsc --noEmit", "package:publish": "pnpm build && pnpm publish --access public --no-git-checks" }, "devDependencies": { diff --git a/packages/elevenlabs/tsconfig.json b/packages/elevenlabs/tsconfig.json index 00dcfd807..1b548c648 100644 --- a/packages/elevenlabs/tsconfig.json +++ b/packages/elevenlabs/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "composite": true, "target": "ESNext", "lib": [ "ESNext" diff --git a/packages/hfup/package.json b/packages/hfup/package.json index a19c3cc20..f888661d3 100644 --- a/packages/hfup/package.json +++ b/packages/hfup/package.json @@ -39,6 +39,7 @@ "dev": "pnpm run stub", "stub": "unbuild --stub", "build": "unbuild", + "typecheck": "tsc --noEmit", "package:publish": "pnpm build && pnpm publish --access public --no-git-checks" }, "dependencies": { diff --git a/packages/hfup/tsconfig.json b/packages/hfup/tsconfig.json index 00dcfd807..1b548c648 100644 --- a/packages/hfup/tsconfig.json +++ b/packages/hfup/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "composite": true, "target": "ESNext", "lib": [ "ESNext" diff --git a/packages/server-runtime/package.json b/packages/server-runtime/package.json index 967223172..cd21abdc9 100644 --- a/packages/server-runtime/package.json +++ b/packages/server-runtime/package.json @@ -32,7 +32,8 @@ ], "scripts": { "dev": "listhen -w --ws --port 6121 ./src/index.ts", - "start": "listhen --ws --port 6121 ./src/index.ts" + "start": "listhen --ws --port 6121 ./src/index.ts", + "typecheck": "tsc --noEmit" }, "dependencies": { "@guiiai/logg": "^1.0.7", diff --git a/packages/server-runtime/tsconfig.json b/packages/server-runtime/tsconfig.json index 00dcfd807..1b548c648 100644 --- a/packages/server-runtime/tsconfig.json +++ b/packages/server-runtime/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "composite": true, "target": "ESNext", "lib": [ "ESNext" diff --git a/packages/server-sdk/package.json b/packages/server-sdk/package.json index 7828f52a9..3a3d5ed52 100644 --- a/packages/server-sdk/package.json +++ b/packages/server-sdk/package.json @@ -34,6 +34,7 @@ "dev": "pnpm run stub", "stub": "unbuild --stub", "build": "unbuild", + "typecheck": "tsc --noEmit", "package:publish": "pnpm build && pnpm publish --access public --no-git-checks" }, "dependencies": { diff --git a/packages/server-sdk/tsconfig.json b/packages/server-sdk/tsconfig.json index 00dcfd807..1b548c648 100644 --- a/packages/server-sdk/tsconfig.json +++ b/packages/server-sdk/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "composite": true, "target": "ESNext", "lib": [ "ESNext" diff --git a/packages/server-shared/package.json b/packages/server-shared/package.json index 08d8a3dfc..32dcc57ad 100644 --- a/packages/server-shared/package.json +++ b/packages/server-shared/package.json @@ -34,6 +34,7 @@ "dev": "pnpm run stub", "stub": "unbuild --stub", "build": "unbuild", + "typecheck": "tsc --noEmit", "package:publish": "pnpm build && pnpm publish --access public --no-git-checks" }, "dependencies": { diff --git a/packages/server-shared/tsconfig.json b/packages/server-shared/tsconfig.json index 00dcfd807..1b548c648 100644 --- a/packages/server-shared/tsconfig.json +++ b/packages/server-shared/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "composite": true, "target": "ESNext", "lib": [ "ESNext" diff --git a/packages/stage-tamagotchi/package.json b/packages/stage-tamagotchi/package.json index db6756081..d9134887c 100644 --- a/packages/stage-tamagotchi/package.json +++ b/packages/stage-tamagotchi/package.json @@ -8,15 +8,15 @@ "scripts": { "typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false", "typecheck:web": "vue-tsc --noEmit -p tsconfig.web.json --composite false", - "typecheck": "npm run typecheck:node && npm run typecheck:web", + "typecheck": "pnpm run typecheck:node && pnpm run typecheck:web", "start": "electron-vite preview", "dev": "electron-vite dev", - "build": "npm run typecheck && electron-vite build", + "build": "pnpm run typecheck && electron-vite build", "postinstall": "electron-builder install-app-deps", - "build:unpack": "npm run build && electron-builder --dir", - "build:win": "npm run build && electron-builder --win", - "build:mac": "npm run build && electron-builder --mac", - "build:linux": "npm run build && electron-builder --linux" + "build:unpack": "pnpm run build && electron-builder --dir", + "build:win": "pnpm run build && electron-builder --win", + "build:mac": "pnpm run build && electron-builder --mac", + "build:linux": "pnpm run build && electron-builder --linux" }, "dependencies": { "@11labs/client": "^0.0.4", diff --git a/packages/stage-tamagotchi/tsconfig.web.json b/packages/stage-tamagotchi/tsconfig.web.json index 25269579c..63e385a16 100644 --- a/packages/stage-tamagotchi/tsconfig.web.json +++ b/packages/stage-tamagotchi/tsconfig.web.json @@ -11,6 +11,9 @@ "paths": { "@renderer/*": [ "src/renderer/src/*" + ], + "@proj-airi/stage-ui/*": [ + "../stage-ui/src/*" ] } }, diff --git a/packages/stage-ui/package.json b/packages/stage-ui/package.json index 2d33dfe1e..12f96d378 100644 --- a/packages/stage-ui/package.json +++ b/packages/stage-ui/package.json @@ -49,6 +49,7 @@ "scripts": { "dev": "pnpm run stub", "stub": "unbuild --stub", - "build": "unbuild" + "build": "unbuild", + "typecheck": "vue-tsc --noEmit" } } diff --git a/packages/stage-ui/src/libs/workers/worker.ts b/packages/stage-ui/src/libs/workers/worker.ts index 7ac669506..0709c8204 100644 --- a/packages/stage-ui/src/libs/workers/worker.ts +++ b/packages/stage-ui/src/libs/workers/worker.ts @@ -155,7 +155,7 @@ async function load() { // input_features: full([1, 80, 3000], 0.0), // for fp32 input_features: full([1, 128, 3000], 0.0), // for fp16 max_new_tokens: 1, - }) + } as Record) globalThis.postMessage({ status: 'ready' }) } diff --git a/packages/stage-ui/src/stores/audio.ts b/packages/stage-ui/src/stores/audio.ts index 07c064994..000a5c7a6 100644 --- a/packages/stage-ui/src/stores/audio.ts +++ b/packages/stage-ui/src/stores/audio.ts @@ -5,7 +5,7 @@ function calculateVolumeWithLinearNormalize(analyser: AnalyserNode) { const dataBuffer = new Uint8Array(analyser.frequencyBinCount) analyser.getByteFrequencyData(dataBuffer) - const volumeVector = [] + const volumeVector: Array = [] for (let i = 0; i < 700; i += 80) volumeVector.push(dataBuffer[i]) @@ -25,7 +25,7 @@ function calculateVolumeWithMinMaxNormalize(analyser: AnalyserNode) { const dataBuffer = new Uint8Array(analyser.frequencyBinCount) analyser.getByteFrequencyData(dataBuffer) - const volumeVector = [] + const volumeVector: Array = [] for (let i = 0; i < 700; i += 80) volumeVector.push(dataBuffer[i]) diff --git a/packages/stage-web/index.html b/packages/stage-web/index.html index d8c748432..775ffab3c 100644 --- a/packages/stage-web/index.html +++ b/packages/stage-web/index.html @@ -21,7 +21,7 @@ defer data-domain="airi.ayaka.io" data-api="/api/v1/page-external-data/submit" - src="/assets/page-external-data/js/script.js" + src="/remote-assets/page-external-data/js/script.js" > diff --git a/packages/stage-web/public/_headers b/packages/stage-web/public/_headers index 046f69f98..9b8a7be65 100644 --- a/packages/stage-web/public/_headers +++ b/packages/stage-web/public/_headers @@ -2,7 +2,7 @@ # # Proxying Plausible through Netlify | Plausible docs # https://plausible.io/docs/proxy/guides/netlify -/assets/page-external-data/js/script.js https://plausible.io/js/script.js 200 +/remote-assets/page-external-data/js/script.js https://plausible.io/js/script.js 200 /api/v1/page-external-data/submit https://plausible.io/api/event 200 /assets/* diff --git a/packages/stage-web/src/App.vue b/packages/stage-web/src/App.vue index 49a36a92e..7234d7796 100644 --- a/packages/stage-web/src/App.vue +++ b/packages/stage-web/src/App.vue @@ -1,14 +1,15 @@ diff --git a/packages/stage-web/src/pages/test/queues/emotions.vue b/packages/stage-web/src/pages/test/queues/emotions.vue index 0fd7795c1..a7cf624f9 100644 --- a/packages/stage-web/src/pages/test/queues/emotions.vue +++ b/packages/stage-web/src/pages/test/queues/emotions.vue @@ -12,14 +12,6 @@ const messagesProcessed = ref([]) const emotionsProcessed = ref([]) const processing = ref(false) -const messageContentQueue = useQueue({ - handlers: [ - async (ctx) => { - messagesProcessed.value.push(ctx.data) - }, - ], -}) - const emotionsQueue = useQueue({ handlers: [ async (ctx) => { @@ -28,7 +20,7 @@ const emotionsQueue = useQueue({ ], }) -const emotionMessageContentQueue = useEmotionsMessageQueue(emotionsQueue, messageContentQueue) +const emotionMessageContentQueue = useEmotionsMessageQueue(emotionsQueue) function onSendMessage() { processing.value = true diff --git a/packages/stage-web/tsconfig.json b/packages/stage-web/tsconfig.json index 105a40ef6..bb7c95ca3 100644 --- a/packages/stage-web/tsconfig.json +++ b/packages/stage-web/tsconfig.json @@ -7,6 +7,11 @@ "ESNext" ], "baseUrl": ".", + "paths": { + "@proj-airi/stage-ui/*": [ + "../stage-ui/src/*" + ] + }, "resolveJsonModule": true, "types": [ "vitest", @@ -17,7 +22,8 @@ "unplugin-vue-router/client" ], "allowJs": true, - "strict": true + "strict": true, + "skipLibCheck": true }, "vueCompilerOptions": { "plugins": [ diff --git a/packages/unplugin-download/tsconfig.json b/packages/unplugin-download/tsconfig.json index 00dcfd807..1b548c648 100644 --- a/packages/unplugin-download/tsconfig.json +++ b/packages/unplugin-download/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "composite": true, "target": "ESNext", "lib": [ "ESNext" diff --git a/packages/unplugin-live2d-sdk/tsconfig.json b/packages/unplugin-live2d-sdk/tsconfig.json index 00dcfd807..1b548c648 100644 --- a/packages/unplugin-live2d-sdk/tsconfig.json +++ b/packages/unplugin-live2d-sdk/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "composite": true, "target": "ESNext", "lib": [ "ESNext" diff --git a/packages/whisper-webgpu/src/libs/worker.ts b/packages/whisper-webgpu/src/libs/worker.ts index c8dc71941..f35275ae9 100644 --- a/packages/whisper-webgpu/src/libs/worker.ts +++ b/packages/whisper-webgpu/src/libs/worker.ts @@ -1,11 +1,11 @@ /* eslint-disable no-restricted-globals */ import type { ModelOutput, - PreTrainedModel, PreTrainedTokenizer, Processor, ProgressCallback, Tensor, + WhisperModel, } from '@huggingface/transformers' import { @@ -25,7 +25,7 @@ class AutomaticSpeechRecognitionPipeline { static model_id: string | null = null static tokenizer: Promise static processor: Promise - static model: Promise + static model: Promise static async getInstance(progress_callback?: ProgressCallback) { this.model_id = 'onnx-community/whisper-base' @@ -45,7 +45,7 @@ class AutomaticSpeechRecognitionPipeline { }, device: 'webgpu', progress_callback, - }) + }) as Promise as Promise return Promise.all([this.tokenizer, this.processor, this.model]) } @@ -115,8 +115,7 @@ async function load() { }) // Load the pipeline and save it for future use. - // eslint-disable-next-line unused-imports/no-unused-vars - const [tokenizer, processor, model] = await AutomaticSpeechRecognitionPipeline.getInstance((x) => { + const [_tokenizer, _processor, model] = await AutomaticSpeechRecognitionPipeline.getInstance((x) => { // We also add a progress callback to the pipeline so that we can // track model loading. self.postMessage(x) @@ -131,7 +130,7 @@ async function load() { await model.generate({ input_features: full([1, 80, 3000], 0.0), max_new_tokens: 1, - }) + } as Record) self.postMessage({ status: 'ready' }) }