Skip to content

Commit

Permalink
docs: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
nekomeowww committed Jan 22, 2025
1 parent cad43b7 commit e1b20e8
Show file tree
Hide file tree
Showing 25 changed files with 47 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ node_modules
**/.cache/**
**/.vitepress/docsMetadata.json
**/.vitepress/cache/
**/tsconfig.tsbuildinfo

**/.netlify/*
**/.netlify/functions-serve/*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/elevenlabs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions packages/elevenlabs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"composite": true,
"target": "ESNext",
"lib": [
"ESNext"
Expand Down
1 change: 1 addition & 0 deletions packages/hfup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions packages/hfup/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"composite": true,
"target": "ESNext",
"lib": [
"ESNext"
Expand Down
3 changes: 2 additions & 1 deletion packages/server-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/server-runtime/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"composite": true,
"target": "ESNext",
"lib": [
"ESNext"
Expand Down
1 change: 1 addition & 0 deletions packages/server-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions packages/server-sdk/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"composite": true,
"target": "ESNext",
"lib": [
"ESNext"
Expand Down
1 change: 1 addition & 0 deletions packages/server-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions packages/server-shared/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"composite": true,
"target": "ESNext",
"lib": [
"ESNext"
Expand Down
12 changes: 6 additions & 6 deletions packages/stage-tamagotchi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions packages/stage-tamagotchi/tsconfig.web.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"paths": {
"@renderer/*": [
"src/renderer/src/*"
],
"@proj-airi/stage-ui/*": [
"../stage-ui/src/*"
]
}
},
Expand Down
3 changes: 2 additions & 1 deletion packages/stage-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"scripts": {
"dev": "pnpm run stub",
"stub": "unbuild --stub",
"build": "unbuild"
"build": "unbuild",
"typecheck": "vue-tsc --noEmit"
}
}
2 changes: 1 addition & 1 deletion packages/stage-ui/src/libs/workers/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown>)

globalThis.postMessage({ status: 'ready' })
}
Expand Down
4 changes: 2 additions & 2 deletions packages/stage-ui/src/stores/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function calculateVolumeWithLinearNormalize(analyser: AnalyserNode) {
const dataBuffer = new Uint8Array(analyser.frequencyBinCount)
analyser.getByteFrequencyData(dataBuffer)

const volumeVector = []
const volumeVector: Array<number> = []
for (let i = 0; i < 700; i += 80)
volumeVector.push(dataBuffer[i])

Expand All @@ -25,7 +25,7 @@ function calculateVolumeWithMinMaxNormalize(analyser: AnalyserNode) {
const dataBuffer = new Uint8Array(analyser.frequencyBinCount)
analyser.getByteFrequencyData(dataBuffer)

const volumeVector = []
const volumeVector: Array<number> = []
for (let i = 0; i < 700; i += 80)
volumeVector.push(dataBuffer[i])

Expand Down
2 changes: 1 addition & 1 deletion packages/stage-web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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"
></script>
<script src="/assets/js/CubismSdkForWeb-5-r.1/Core/live2dcubismcore.min.js"></script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion packages/stage-web/public/_headers
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
5 changes: 3 additions & 2 deletions packages/stage-web/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<script setup lang="ts">
import { useSettings } from '@proj-airi/stage-ui/stores/settings'
import { storeToRefs } from 'pinia'
import { watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { RouterView } from 'vue-router'
const i18n = useI18n()
const settings = useSettings()
const settings = storeToRefs(useSettings())
watch(settings.language, () => {
i18n.locale = settings.language
i18n.locale.value = settings.language.value
})
</script>

Expand Down
10 changes: 1 addition & 9 deletions packages/stage-web/src/pages/test/queues/emotions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ const messagesProcessed = ref<string[]>([])
const emotionsProcessed = ref<string[]>([])
const processing = ref<boolean>(false)
const messageContentQueue = useQueue<string>({
handlers: [
async (ctx) => {
messagesProcessed.value.push(ctx.data)
},
],
})
const emotionsQueue = useQueue<Emotion>({
handlers: [
async (ctx) => {
Expand All @@ -28,7 +20,7 @@ const emotionsQueue = useQueue<Emotion>({
],
})
const emotionMessageContentQueue = useEmotionsMessageQueue(emotionsQueue, messageContentQueue)
const emotionMessageContentQueue = useEmotionsMessageQueue(emotionsQueue)
function onSendMessage() {
processing.value = true
Expand Down
8 changes: 7 additions & 1 deletion packages/stage-web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"ESNext"
],
"baseUrl": ".",
"paths": {
"@proj-airi/stage-ui/*": [
"../stage-ui/src/*"
]
},
"resolveJsonModule": true,
"types": [
"vitest",
Expand All @@ -17,7 +22,8 @@
"unplugin-vue-router/client"
],
"allowJs": true,
"strict": true
"strict": true,
"skipLibCheck": true
},
"vueCompilerOptions": {
"plugins": [
Expand Down
1 change: 1 addition & 0 deletions packages/unplugin-download/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"composite": true,
"target": "ESNext",
"lib": [
"ESNext"
Expand Down
1 change: 1 addition & 0 deletions packages/unplugin-live2d-sdk/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"composite": true,
"target": "ESNext",
"lib": [
"ESNext"
Expand Down
11 changes: 5 additions & 6 deletions packages/whisper-webgpu/src/libs/worker.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable no-restricted-globals */
import type {
ModelOutput,
PreTrainedModel,
PreTrainedTokenizer,
Processor,
ProgressCallback,
Tensor,
WhisperModel,
} from '@huggingface/transformers'

import {
Expand All @@ -25,7 +25,7 @@ class AutomaticSpeechRecognitionPipeline {
static model_id: string | null = null
static tokenizer: Promise<PreTrainedTokenizer>
static processor: Promise<Processor>
static model: Promise<PreTrainedModel>
static model: Promise<WhisperModel>

static async getInstance(progress_callback?: ProgressCallback) {
this.model_id = 'onnx-community/whisper-base'
Expand All @@ -45,7 +45,7 @@ class AutomaticSpeechRecognitionPipeline {
},
device: 'webgpu',
progress_callback,
})
}) as Promise<unknown> as Promise<WhisperModel>

return Promise.all([this.tokenizer, this.processor, this.model])
}
Expand Down Expand Up @@ -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)
Expand All @@ -131,7 +130,7 @@ async function load() {
await model.generate({
input_features: full([1, 80, 3000], 0.0),
max_new_tokens: 1,
})
} as Record<string, unknown>)

self.postMessage({ status: 'ready' })
}
Expand Down

0 comments on commit e1b20e8

Please sign in to comment.