From fe02e371be34cd4d99ceb9273b4add1447a41f91 Mon Sep 17 00:00:00 2001 From: omi3 Date: Tue, 10 Sep 2024 17:44:45 +0000 Subject: [PATCH 01/24] docs(changeset): formating --- .changeset/poor-dolls-thank.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .changeset/poor-dolls-thank.md diff --git a/.changeset/poor-dolls-thank.md b/.changeset/poor-dolls-thank.md new file mode 100644 index 0000000..8393082 --- /dev/null +++ b/.changeset/poor-dolls-thank.md @@ -0,0 +1,9 @@ +--- +'@omi3/audio': patch +'@omi3/utils': patch +'@omi3/tailwind': patch +'@omi3/ui': patch +'@omi3/site': patch +--- + +formating From c6dff16fbd0cb41d5fb7052998c0187e4c6ac812 Mon Sep 17 00:00:00 2001 From: omi3 Date: Tue, 10 Sep 2024 17:45:20 +0000 Subject: [PATCH 02/24] format all --- apps/site/app/opengraph-image.tsx | 42 +++++++++++++--------------- packages/audio/README.md | 37 ++++++++++++------------ packages/ui/src/assets/svg/_types.ts | 1 - 3 files changed, 38 insertions(+), 42 deletions(-) diff --git a/apps/site/app/opengraph-image.tsx b/apps/site/app/opengraph-image.tsx index c515566..2d69b67 100644 --- a/apps/site/app/opengraph-image.tsx +++ b/apps/site/app/opengraph-image.tsx @@ -1,44 +1,42 @@ -import { ImageResponse } from "next/og"; +import { ImageResponse } from 'next/og'; -export const runtime = "edge"; -export const alt = "Ouest Labs"; +export const runtime = 'edge'; +export const alt = 'Ouest Labs'; export const size = { width: 1200, height: 630, }; export default async function Image() { - return new ImageResponse( (
- - +
), { - ...size - } + ...size, + }, ); -} \ No newline at end of file +} diff --git a/packages/audio/README.md b/packages/audio/README.md index 1a6a060..83af8d7 100644 --- a/packages/audio/README.md +++ b/packages/audio/README.md @@ -84,13 +84,13 @@ An interface for handling audio events. ```typescript interface EventHandler { -onPlay?: () => void; -onPause?: () => void; -onEnded?: () => void; -onTimeUpdate?: (time: number) => void; -onDurationChange?: (duration: number) => void; -onError?: (error: Error) => void; -onAnalyserCreated?: (analyser: AnalyserNode) => void; + onPlay?: () => void; + onPause?: () => void; + onEnded?: () => void; + onTimeUpdate?: (time: number) => void; + onDurationChange?: (duration: number) => void; + onError?: (error: Error) => void; + onAnalyserCreated?: (analyser: AnalyserNode) => void; } ``` @@ -99,11 +99,10 @@ onAnalyserCreated?: (analyser: AnalyserNode) => void; A simple interface for representing music data. ```typescript - interface Music { -id: string; -name: string; -url: string; + id: string; + name: string; + url: string; } ``` @@ -115,10 +114,10 @@ The `AudioChannel` class provides access to an `AnalyserNode` for audio visualiz ```typescript const eventHandler: EventHandler = { -onAnalyserCreated: (analyser: AnalyserNode) => { -// Use the analyser node for visualizations or further audio processing -console.log('Analyser created:', analyser); -}, + onAnalyserCreated: (analyser: AnalyserNode) => { + // Use the analyser node for visualizations or further audio processing + console.log('Analyser created:', analyser); + }, }; const audioChannel = new AudioChannel(eventHandler); ``` @@ -129,10 +128,10 @@ You can provide a custom audio context factory to the `AudioChannel` constructor ```typescript const customAudioContextFactory = () => { -return new (window.AudioContext || (window as any).webkitAudioContext)({ -latencyHint: 'interactive', -sampleRate: 44100, -}); + return new (window.AudioContext || (window as any).webkitAudioContext)({ + latencyHint: 'interactive', + sampleRate: 44100, + }); }; const audioChannel = new AudioChannel(eventHandler, customAudioContextFactory); ``` diff --git a/packages/ui/src/assets/svg/_types.ts b/packages/ui/src/assets/svg/_types.ts index 1900a65..7e84592 100644 --- a/packages/ui/src/assets/svg/_types.ts +++ b/packages/ui/src/assets/svg/_types.ts @@ -1,2 +1 @@ - export type Omi3SVG = React.SVGProps; From b0cca81df072bc524ec45f60291a1cdcc1c579b1 Mon Sep 17 00:00:00 2001 From: omi3 Date: Wed, 11 Sep 2024 14:17:43 +0000 Subject: [PATCH 03/24] format all --- .changeset/README.md | 8 - .changeset/config.json | 11 - .changeset/poor-dolls-thank.md | 9 - .dockerignore | 9 - .editorconfig | 42 - .github/FUNDING.yml | 15 - .github/workflows/build.yml | 60 - .github/workflows/release.yml | 52 - .github/workflows/test.yml | 35 - .gitignore | 38 - .npmrc | 1 - .prettierignore | 7 - .prettierrc | 21 - CONTRIBUTING.md | 67 - LICENSE | 201 - README.md | 68 - apps/.keep | 0 apps/site/.eslintrc.js | 8 - apps/site/.gitignore | 40 - apps/site/CHANGELOG.md | 52 - apps/site/Dockerfile | 51 - apps/site/README.md | 5 - apps/site/app/_components/audio/index.ts | 1 - apps/site/app/_components/audio/player.tsx | 89 - .../site/app/_components/audio/visualizer.tsx | 89 - apps/site/app/_components/layout/footer.tsx | 11 - apps/site/app/icon.tsx | 32 - apps/site/app/layout.tsx | 29 - apps/site/app/opengraph-image.tsx | 42 - apps/site/app/page.tsx | 14 - apps/site/e2e/player.spec.ts | 61 - apps/site/next.config.mjs | 6 - apps/site/package.json | 35 - apps/site/playwright.config.ts | 56 - apps/site/postcss.config.mjs | 8 - apps/site/public/.keep | 0 apps/site/tailwind.config.ts | 10 - apps/site/tsconfig.json | 31 - docker-compose.yml | 8 - logo.svg | 6 - package.json | 29 - packages/.keep | 0 packages/audio/.eslintrc.cjs | 6 +- .../audio/src/__test__/audio-channel.test.ts | 192 +- packages/audio/src/audio-channel/index.ts | 152 +- packages/audio/src/index.ts | 2 + packages/audio/src/interfaces/index.ts | 2 + packages/ui/.eslintrc.js | 9 - packages/ui/CHANGELOG.md | 13 - packages/ui/components.json | 17 - packages/ui/package.json | 47 - packages/ui/postcss.config.js | 9 - packages/ui/src/assets/fonts/index.ts | 18 - .../src/assets/fonts/montserrat-variable.ttf | Bin 394140 -> 0 bytes .../src/assets/fonts/silkscreen-regular.ttf | Bin 31960 -> 0 bytes packages/ui/src/assets/index.ts | 4 - packages/ui/src/assets/svg/_types.ts | 1 - packages/ui/src/assets/svg/index.ts | 1 - packages/ui/src/assets/svg/logos/index.tsx | 79 - packages/ui/src/components/.keep | 0 packages/ui/src/components/index.ts | 1 - packages/ui/src/components/ui/button.tsx | 87 - packages/ui/src/components/ui/card.tsx | 52 - packages/ui/src/components/ui/index.ts | 4 - packages/ui/src/components/ui/input.tsx | 22 - packages/ui/src/components/ui/progress.tsx | 39 - packages/ui/src/index.ts | 2 - packages/ui/src/styles/neobrutalism.css | 33 - packages/ui/src/styles/shadcn.css | 92 - packages/ui/tailwind.config.ts | 5 - packages/ui/tsconfig.json | 12 - packages/utils/.eslintrc.js | 10 - packages/utils/CHANGELOG.md | 19 - packages/utils/README.md | 37 - packages/utils/jest.config.ts | 26 - packages/utils/package.json | 50 - packages/utils/src/__tests__/.keep | 0 .../utils/src/__tests__/_functions/cn.test.ts | 33 - .../src/__tests__/_functions/playtime.test.ts | 34 - .../src/__tests__/_functions/shuffle.test.ts | 49 - packages/utils/src/constants/audio.ts | 1 - packages/utils/src/functions/cn.ts | 13 - packages/utils/src/functions/playtime.ts | 6 - packages/utils/src/functions/shuffle.ts | 8 - packages/utils/src/index.ts | 6 - packages/utils/tsconfig.json | 11 - packages/utils/tsup.config.ts | 5 - pnpm-lock.yaml | 8690 ----------------- pnpm-workspace.yaml | 4 - tools/eslint/.eslintrc.js | 10 - tools/eslint/README.md | 3 - tools/eslint/library.js | 51 - tools/eslint/next.js | 35 - tools/eslint/package.json | 32 - tools/eslint/react.js | 34 - tools/tailwind/README.md | 47 - tools/tailwind/package.json | 24 - tools/tailwind/tailwind.config.ts | 122 - tools/tailwind/tsconfig.json | 5 - tools/tsup/CHANGELOG.md | 13 - tools/tsup/README.md | 0 tools/tsup/package.json | 43 - tools/tsup/src/index.ts | 27 - tools/tsup/tsconfig.json | 5 - tools/tsup/tsup.config.ts | 13 - tools/typescript/CHANGELOG.md | 7 - tools/typescript/base.json | 23 - tools/typescript/nextjs.json | 16 - tools/typescript/package.json | 8 - tools/typescript/react-library.json | 10 - tsconfig.json | 5 - turbo.json | 23 - 112 files changed, 297 insertions(+), 11519 deletions(-) delete mode 100644 .changeset/README.md delete mode 100644 .changeset/config.json delete mode 100644 .changeset/poor-dolls-thank.md delete mode 100644 .dockerignore delete mode 100644 .editorconfig delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .gitignore delete mode 100644 .npmrc delete mode 100644 .prettierignore delete mode 100644 .prettierrc delete mode 100644 CONTRIBUTING.md delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 apps/.keep delete mode 100644 apps/site/.eslintrc.js delete mode 100644 apps/site/.gitignore delete mode 100644 apps/site/CHANGELOG.md delete mode 100644 apps/site/Dockerfile delete mode 100644 apps/site/README.md delete mode 100644 apps/site/app/_components/audio/index.ts delete mode 100644 apps/site/app/_components/audio/player.tsx delete mode 100644 apps/site/app/_components/audio/visualizer.tsx delete mode 100644 apps/site/app/_components/layout/footer.tsx delete mode 100644 apps/site/app/icon.tsx delete mode 100644 apps/site/app/layout.tsx delete mode 100644 apps/site/app/opengraph-image.tsx delete mode 100644 apps/site/app/page.tsx delete mode 100644 apps/site/e2e/player.spec.ts delete mode 100644 apps/site/next.config.mjs delete mode 100644 apps/site/package.json delete mode 100644 apps/site/playwright.config.ts delete mode 100644 apps/site/postcss.config.mjs delete mode 100644 apps/site/public/.keep delete mode 100644 apps/site/tailwind.config.ts delete mode 100644 apps/site/tsconfig.json delete mode 100644 docker-compose.yml delete mode 100644 logo.svg delete mode 100644 package.json delete mode 100644 packages/.keep delete mode 100644 packages/ui/.eslintrc.js delete mode 100644 packages/ui/CHANGELOG.md delete mode 100644 packages/ui/components.json delete mode 100644 packages/ui/package.json delete mode 100644 packages/ui/postcss.config.js delete mode 100644 packages/ui/src/assets/fonts/index.ts delete mode 100644 packages/ui/src/assets/fonts/montserrat-variable.ttf delete mode 100644 packages/ui/src/assets/fonts/silkscreen-regular.ttf delete mode 100644 packages/ui/src/assets/index.ts delete mode 100644 packages/ui/src/assets/svg/_types.ts delete mode 100644 packages/ui/src/assets/svg/index.ts delete mode 100644 packages/ui/src/assets/svg/logos/index.tsx delete mode 100644 packages/ui/src/components/.keep delete mode 100644 packages/ui/src/components/index.ts delete mode 100644 packages/ui/src/components/ui/button.tsx delete mode 100644 packages/ui/src/components/ui/card.tsx delete mode 100644 packages/ui/src/components/ui/index.ts delete mode 100644 packages/ui/src/components/ui/input.tsx delete mode 100644 packages/ui/src/components/ui/progress.tsx delete mode 100644 packages/ui/src/index.ts delete mode 100644 packages/ui/src/styles/neobrutalism.css delete mode 100644 packages/ui/src/styles/shadcn.css delete mode 100644 packages/ui/tailwind.config.ts delete mode 100644 packages/ui/tsconfig.json delete mode 100644 packages/utils/.eslintrc.js delete mode 100644 packages/utils/CHANGELOG.md delete mode 100644 packages/utils/README.md delete mode 100644 packages/utils/jest.config.ts delete mode 100644 packages/utils/package.json delete mode 100644 packages/utils/src/__tests__/.keep delete mode 100644 packages/utils/src/__tests__/_functions/cn.test.ts delete mode 100644 packages/utils/src/__tests__/_functions/playtime.test.ts delete mode 100644 packages/utils/src/__tests__/_functions/shuffle.test.ts delete mode 100644 packages/utils/src/constants/audio.ts delete mode 100644 packages/utils/src/functions/cn.ts delete mode 100644 packages/utils/src/functions/playtime.ts delete mode 100644 packages/utils/src/functions/shuffle.ts delete mode 100644 packages/utils/src/index.ts delete mode 100644 packages/utils/tsconfig.json delete mode 100644 packages/utils/tsup.config.ts delete mode 100644 pnpm-lock.yaml delete mode 100644 pnpm-workspace.yaml delete mode 100644 tools/eslint/.eslintrc.js delete mode 100644 tools/eslint/README.md delete mode 100644 tools/eslint/library.js delete mode 100644 tools/eslint/next.js delete mode 100644 tools/eslint/package.json delete mode 100644 tools/eslint/react.js delete mode 100644 tools/tailwind/README.md delete mode 100644 tools/tailwind/package.json delete mode 100644 tools/tailwind/tailwind.config.ts delete mode 100644 tools/tailwind/tsconfig.json delete mode 100644 tools/tsup/CHANGELOG.md delete mode 100644 tools/tsup/README.md delete mode 100644 tools/tsup/package.json delete mode 100644 tools/tsup/src/index.ts delete mode 100644 tools/tsup/tsconfig.json delete mode 100644 tools/tsup/tsup.config.ts delete mode 100644 tools/typescript/CHANGELOG.md delete mode 100644 tools/typescript/base.json delete mode 100644 tools/typescript/nextjs.json delete mode 100644 tools/typescript/package.json delete mode 100644 tools/typescript/react-library.json delete mode 100644 tsconfig.json delete mode 100644 turbo.json diff --git a/.changeset/README.md b/.changeset/README.md deleted file mode 100644 index e5b6d8d..0000000 --- a/.changeset/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Changesets - -Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works -with multi-package repos, or single-package repos to help you version and publish your code. You can -find the full documentation for it [in our repository](https://github.com/changesets/changesets) - -We have a quick list of common questions to get you started engaging with this project in -[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json deleted file mode 100644 index d03b641..0000000 --- a/.changeset/config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json", - "changelog": "@changesets/cli/changelog", - "commit": true, - "fixed": [], - "linked": [], - "access": "public", - "baseBranch": "main", - "updateInternalDependencies": "patch", - "ignore": [] -} diff --git a/.changeset/poor-dolls-thank.md b/.changeset/poor-dolls-thank.md deleted file mode 100644 index 8393082..0000000 --- a/.changeset/poor-dolls-thank.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@omi3/audio': patch -'@omi3/utils': patch -'@omi3/tailwind': patch -'@omi3/ui': patch -'@omi3/site': patch ---- - -formating diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 52a79f5..0000000 --- a/.dockerignore +++ /dev/null @@ -1,9 +0,0 @@ -Dockerfile -.dockerignore -node_modules -npm-debug.log -README.md -.next -!.next/static -!.next/standalone -.git \ No newline at end of file diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 02f0bde..0000000 --- a/.editorconfig +++ /dev/null @@ -1,42 +0,0 @@ -# EditorConfig aide à maintenir des styles de codage cohérents pour plusieurs développeurs -# travaillant sur le même projet dans divers éditeurs et IDE. -# editorconfig.org - -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Fichiers Markdown -[*.md] -trim_trailing_whitespace = false - - -# Fichiers batch Windows -[*.bat] -end_of_line = crlf - -# Fichiers YAML -[*.{yaml,yml}] -indent_size = 2 - -# Fichiers JSON -[*.json] -indent_size = 2 - -# Fichiers TypeScript et JavaScript -[*.{ts,js,tsx,jsx}] -indent_size = 2 - -# Fichiers CSS, SASS, SCSS -[*.{css,sass,scss}] -indent_size = 2 - -# Fichiers HTML -[*.html] -indent_size = 2 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index ed4a13c..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,15 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: omi3 -open_collective: # Replace with a single open_collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -polar: # Replace with a single Polar username -buy_me_a_coffee: # Replace with a single Buy Me a Coffee username -thanks_dev: xyhomi3 -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 371ebf1..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Build Site Docker Image -on: - push: - branches: [main] - tags: [v*.*.*] - pull_request: - branches: ['main'] - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - id-token: write - env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }}-site - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: ${{ vars.TURBO_TEAM }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Docker Setup Buildx - uses: docker/setup-buildx-action@v3.6.1 - - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@v3.3.0 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v5.5.1 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - id: build-and-push - uses: docker/build-push-action@v6.7.0 - with: - context: . - file: ./apps/site/Dockerfile - platforms: linux/arm64,linux/amd64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - build-args: | - TURBO_TOKEN=${{ secrets.TURBO_TOKEN }} - TURBO_TEAM=${{ vars.TURBO_TEAM }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index ebcb15a..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Release - -on: - push: - branches: [main] - pull_request: - branches: [main] - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -jobs: - release: - name: Release - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - env: - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: ${{ vars.TURBO_TEAM }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: pnpm/action-setup@v2 - with: - version: 9.1.1 - - - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - cache: 'pnpm' - - - run: pnpm install --frozen-lockfile - - - name: Create Release Pull Request - if: github.event_name == 'pull_request' - uses: changesets/action@v1 - with: - version: pnpm version-packages - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish to npm - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: changesets/action@v1 - with: - publish: pnpm release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 6b65a9d..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Site e2e Tests -on: - push: - branches: [main] - pull_request: - branches: [main] -jobs: - test: - timeout-minutes: 60 - runs-on: ubuntu-latest - env: - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: ${{ vars.TURBO_TEAM }} - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9.1.1 - - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - cache: 'pnpm' - - run: pnpm install --frozen-lockfile - - name: Install playwright browsers - run: pnpm exec playwright install --with-deps - - name: Build packages - run: pnpm build - - name: Run tests - run: pnpm test - - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: apps/site/playwright-report/ - retention-days: 30 diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 00f9b61..0000000 --- a/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# Dependencies -node_modules -.pnp -.pnp.js - -# Local env files -.env -.env.local -.env.development.local -.env.test.local -.env.production.local - -# Testing -coverage - -# Turbo -.turbo - -# Vercel -.vercel - -# Build Outputs -.next/ -out/ -build -dist - - -# Debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Misc -.DS_Store -*.pem \ No newline at end of file diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 829951d..0000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -public-hoist-pattern=* \ No newline at end of file diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 1d3e480..0000000 --- a/.prettierignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules -coverage -build -.idea/ -.next/ -.turbo/ -dist/ \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index cfd8ee3..0000000 --- a/.prettierrc +++ /dev/null @@ -1,21 +0,0 @@ -{ - "plugins": ["prettier-plugin-tailwindcss"], - "tailwindConfig": "./tools/tailwind/tailwind.config.ts", - "printWidth": 120, - "tabWidth": 2, - "useTabs": false, - "semi": true, - "singleQuote": true, - "trailingComma": "all", - "bracketSpacing": true, - "arrowParens": "always", - "endOfLine": "lf", - "overrides": [ - { - "files": "*.json", - "options": { - "printWidth": 200 - } - } - ] -} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 9d16a5c..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,67 +0,0 @@ -
- Logo Omi3 -
- ---- - -We're thrilled that you're interested in contributing to `Omi3`! This document provides guidelines for contributing to the project. - -## Code of Conduct - -By participating in this project, you are expected to uphold our Code of Conduct (to be added). - -## How to Contribute - -1. Fork the repository and create your branch from `main`. -2. If you've added code that should be tested, add tests. -3. Ensure the test suite passes. -4. Make sure your code lints. -5. Issue that pull request! - -## Reporting Bugs - -Bugs are tracked as GitHub issues. Create an issue and provide the following information: - -- Use a clear and descriptive title -- Describe the exact steps which reproduce the problem -- Provide specific examples to demonstrate the steps - -## Suggesting Enhancements - -Enhancement suggestions are also tracked as GitHub issues. When creating an enhancement suggestion, please include: - -- A clear and descriptive title -- A detailed description of the proposed enhancement -- An explanation of why this enhancement would be useful to most `Omi3` users - -## Pull Requests - -- Fill in the required template -- Do not include issue numbers in the PR title -- Include screenshots and animated GIFs in your pull request whenever possible -- Follow the TypeScript and JavaScript styleguides -- End all files with a newline - -## Style Guides - -### Git Commit Messages - -- Use the present tense ("Add feature" not "Added feature") -- Use the imperative mood ("Move cursor to..." not "Moves cursor to...") -- Limit the first line to 72 characters or less -- Reference issues and pull requests liberally after the first line - -### TypeScript Styleguide - -- Prefer `const` over `let` -- Use template literals instead of string concatenation -- Use async/await instead of callbacks - -### Documentation Styleguide - -- Use Markdown -- Reference methods and classes in markdown with the custom `{}` notation: - - Class: `{ClassName}` - - Method: `{ClassName.methodName}` - -Thank you for contributing to `Omi3`! diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f7b7d3f..0000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2024 Omi3 - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.md b/README.md deleted file mode 100644 index 8ee69a0..0000000 --- a/README.md +++ /dev/null @@ -1,68 +0,0 @@ -
- Logo Omi3 - -

- Build Status - Test - Repo Size -

-
- ---- - -# Dev Branch - -`Omi3` is an open-source project focused on building audio processing and playback capabilities for web applications. - -## Project Overview - -`Omi3` aims to provide developers with a comprehensive set of tools and components for handling audio in web applications. From low-level audio processing to high-level UI components, Omi3 covers a wide range of audio-related functionalities. - -### Key Features - -- Audio processing and manipulation -- Customizable audio playback controls - -## Project Structure - -The project is organized as follows: - -``` -. -├── apps/ # Main applications -│ └── site/ # Main website and demo -├── packages/ # Shared packages -│ ├── audio/ # Core audio processing library -│ ├── ui/ # Reusable UI components -│ └── utils/ # Utility functions -└── tools/ # Development tools and configurations - ├── eslint/ # ESLint configuration - ├── tailwind/ # Tailwind CSS configuration - ├── tsup/ # tsup configuration - └── typescript/ # TypeScript configurations -``` - -## Getting Started - -1. Ensure you have `Node.js (>=18)` and `pnpm` installed. -2. Clone the repository. -3. Install dependencies: - ``` - pnpm install - ``` -4. Start the development server: - ``` - pnpm dev - ``` - -## Contributing - -We welcome contributions from the community! Please read our [Contributing Guidelines](CONTRIBUTING.md) for more information on how to get involved. - -## License - -`Omi3` is open-source software licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for more details. - ---- - -Omi3 - Audio processing and playback capabilities for web. | Product Hunt diff --git a/apps/.keep b/apps/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/apps/site/.eslintrc.js b/apps/site/.eslintrc.js deleted file mode 100644 index 9e2b80b..0000000 --- a/apps/site/.eslintrc.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - extends: [ - "next/core-web-vitals", - "next/typescript", - require.resolve("@omi3/eslint/next.js"), - ], -}; - diff --git a/apps/site/.gitignore b/apps/site/.gitignore deleted file mode 100644 index 27bf904..0000000 --- a/apps/site/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js -.yarn/install-state.gz - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env*.local - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts -/test-results/ -/playwright-report/ -/blob-report/ -/playwright/.cache/ diff --git a/apps/site/CHANGELOG.md b/apps/site/CHANGELOG.md deleted file mode 100644 index 2f8ae34..0000000 --- a/apps/site/CHANGELOG.md +++ /dev/null @@ -1,52 +0,0 @@ -# @omi3/site - -## 0.0.6 - -### Patch Changes - -- Updated dependencies [5cfdef7] - - @omi3/audio@0.0.3 - - @omi3/utils@0.0.3 - - @omi3/ui@0.0.2 - -## 0.0.5 - -### Patch Changes - -- a9e2c60: add og-image.tsx - -## 0.0.4 - -### Patch Changes - -- Updated dependencies [a2895a9] - - @omi3/ui@0.0.2 - - @omi3/audio@0.0.2 - - @omi3/utils@0.0.2 - -## 0.0.3 - -### Patch Changes - -- Updated dependencies [ecb66e7] - - @omi3/ui@0.0.1 - -## 0.0.2 - -### Patch Changes - -- 537f255: . -- Updated dependencies [537f255] - - @omi3/audio@0.0.2 - - @omi3/utils@0.0.2 - - @omi3/ui@0.0.0 - -## 0.0.1 - -### Patch Changes - -- 203f78f: init changeset -- Updated dependencies [203f78f] - - @omi3/audio@0.0.1 - - @omi3/utils@0.0.1 - - @omi3/ui@0.0.0 diff --git a/apps/site/Dockerfile b/apps/site/Dockerfile deleted file mode 100644 index d1f148c..0000000 --- a/apps/site/Dockerfile +++ /dev/null @@ -1,51 +0,0 @@ -# Use a base image with pnpm pre-installed -FROM node:18-alpine AS base -RUN npm install -g pnpm turbo -ARG TURBO_TOKEN -ARG TURBO_TEAM - -# Build stage -FROM base AS builder -RUN apk update && apk add --no-cache libc6-compat -WORKDIR /app -COPY . . -ENV TURBO_TOKEN=$TURBO_TOKEN -ENV TURBO_TEAM=$TURBO_TEAM -RUN turbo prune @omi3/site --docker - -# Install and build stage -FROM base AS installer -RUN apk update && apk add --no-cache libc6-compat -WORKDIR /app - -# Copy necessary files for installation -COPY --from=builder /app/out/json/ . -COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml -COPY --from=builder /app/out/full/ . -RUN pnpm install - -# Copy remaining files and build -COPY --from=builder /app/out/full/ . -RUN pnpm turbo build --filter=@omi3/site... - -# Final stage -FROM base AS runner -WORKDIR /app - -# Create user -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 omi3 -USER omi3 - -# Copy standalone content -COPY --from=installer --chown=omi3:nodejs /app/apps/site/.next/standalone ./ -COPY --from=installer --chown=omi3:nodejs /app/apps/site/.next/static ./apps/site/.next/static -COPY --from=installer --chown=omi3:nodejs /app/apps/site/public ./apps/site/public - -EXPOSE 3000 - -ENV NODE_ENV=production -ENV PORT=3000 -ENV HOSTNAME=0.0.0.0 - -CMD ["node", "apps/site/server.js"] \ No newline at end of file diff --git a/apps/site/README.md b/apps/site/README.md deleted file mode 100644 index 0d35c44..0000000 --- a/apps/site/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# `@omi3/site` - -![Version](https://img.shields.io/github/package-json/v/xyhomi3/omi3?filename=apps%2Fsite%2Fpackage.json) - -Main website. diff --git a/apps/site/app/_components/audio/index.ts b/apps/site/app/_components/audio/index.ts deleted file mode 100644 index 0cd97ac..0000000 --- a/apps/site/app/_components/audio/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { AudioPlayer } from './player'; diff --git a/apps/site/app/_components/audio/player.tsx b/apps/site/app/_components/audio/player.tsx deleted file mode 100644 index 090a77a..0000000 --- a/apps/site/app/_components/audio/player.tsx +++ /dev/null @@ -1,89 +0,0 @@ -'use client'; - -import { Button, Card, CardContent, CardHeader, CardTitle, Progress } from '@omi3/ui'; -import { useCallback, useEffect, useMemo, useState } from 'react'; - -import { AudioChannel } from '@omi3/audio'; -import { playtime } from '@omi3/utils'; -import AudioVisualizer from './visualizer'; - -const sampleMusic = { - url: 'https://cdn.pixabay.com/audio/2023/12/29/audio_a1497a53af.mp3', -}; - -export function AudioPlayer() { - const [audioChannel, setAudioChannel] = useState(null); - const [isPlaying, setIsPlaying] = useState(false); - const [analyser, setAnalyser] = useState(null); - const [currentTime, setCurrentTime] = useState(0); - const [duration, setDuration] = useState(0); - - const eventHandlers = useMemo( - () => ({ - onPlay: () => setIsPlaying(true), - onPause: () => setIsPlaying(false), - onEnded: () => setIsPlaying(false), - onAnalyserCreated: (newAnalyser: AnalyserNode) => { - newAnalyser.fftSize = 1024; // ou 2048 pour plus de détails - newAnalyser.smoothingTimeConstant = 0.8; - newAnalyser.minDecibels = -90; - newAnalyser.maxDecibels = -10; - setAnalyser(newAnalyser); - }, - onTimeUpdate: (time: number) => setCurrentTime(time), - onDurationChange: (newDuration: number) => setDuration(newDuration), - onStop: () => setIsPlaying(false), - }), - [], - ); - - useEffect(() => { - const channel = AudioChannel.getInstance(eventHandlers); - setAudioChannel(channel); - - return () => { - channel.dispose(); - }; - }, [eventHandlers]); - - const handlePlayPause = useCallback(async () => { - if (!audioChannel) return; - - try { - if (!isPlaying) { - await audioChannel.initialize(); - if (!audioChannel.currentMusic) { - await audioChannel.load(sampleMusic); - } - await audioChannel.play(); - } else { - audioChannel.pause(); - } - } catch (error) { - console.error('Erreur lors de la lecture/pause audio:', error); - } - }, [audioChannel, isPlaying]); - - return ( - - - - Omi3 Player - - - -
- -
- -
- {playtime(currentTime)} - {playtime(duration)} -
- -
-
- ); -} diff --git a/apps/site/app/_components/audio/visualizer.tsx b/apps/site/app/_components/audio/visualizer.tsx deleted file mode 100644 index 687a9f7..0000000 --- a/apps/site/app/_components/audio/visualizer.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import React from 'react'; - -interface AudioVisualizerProps { - analyser: AnalyserNode | null; - width: number; - height: number; -} - -class AudioVisualizer extends React.Component { - private canvasRef: React.RefObject; - private animationFrameId: number | null = null; - constructor(props: AudioVisualizerProps) { - super(props); - this.canvasRef = React.createRef(); - } - - componentDidMount() { - this.setupVisualizer(); - } - - componentDidUpdate(prevProps: AudioVisualizerProps) { - if (this.props.analyser !== prevProps.analyser) { - this.setupVisualizer(); - } - } - - componentWillUnmount() { - if (this.animationFrameId) { - cancelAnimationFrame(this.animationFrameId); - } - } - - setupVisualizer() { - const { analyser } = this.props; - const canvas = this.canvasRef.current; - - if (!analyser || !canvas) return; - - const canvasCtx = canvas.getContext('2d'); - if (!canvasCtx) return; - - const bufferLength = analyser.frequencyBinCount; - const dataArray = new Uint8Array(bufferLength); - - const draw = () => { - this.animationFrameId = requestAnimationFrame(draw); - analyser.getByteTimeDomainData(dataArray); - - canvasCtx.fillStyle = ' rgb(0, 0, 0)'; - canvasCtx.fillRect(0, 0, canvas.width, canvas.height); - canvasCtx.lineWidth = 2; - canvasCtx.strokeStyle = '#a3e636'; - canvasCtx.beginPath(); - - const sliceWidth = canvas.width / bufferLength; - let x = 0; - - for (let i = 0; i < bufferLength; i++) { - const v = dataArray[i] / 128.0; - const y = (v * canvas.height) / 2; - - if (i === 0) { - canvasCtx.moveTo(x, y); - } else { - canvasCtx.lineTo(x, y); - } - - x += sliceWidth; - } - - canvasCtx.lineTo(canvas.width, canvas.height / 2); - canvasCtx.stroke(); - }; - - draw(); - } - - render() { - const { width, height } = this.props; - - return ( -
- -
- ); - } -} - -export default AudioVisualizer; diff --git a/apps/site/app/_components/layout/footer.tsx b/apps/site/app/_components/layout/footer.tsx deleted file mode 100644 index 7f6fa91..0000000 --- a/apps/site/app/_components/layout/footer.tsx +++ /dev/null @@ -1,11 +0,0 @@ -export function Footer() { - return ( - - ); -} diff --git a/apps/site/app/icon.tsx b/apps/site/app/icon.tsx deleted file mode 100644 index fdeca9f..0000000 --- a/apps/site/app/icon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { ImageResponse } from 'next/og'; - -export const runtime = 'edge'; - -export const size = { - width: 32, - height: 32, -}; -export const contentType = 'image/png'; - -export default function Icon() { - return new ImageResponse( - ( -
- - - -
- ), - { ...size }, - ); -} diff --git a/apps/site/app/layout.tsx b/apps/site/app/layout.tsx deleted file mode 100644 index 1273d5d..0000000 --- a/apps/site/app/layout.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import '@omi3/ui/neobrutalism.css'; - -import { Footer } from './_components/layout/footer'; -import type { Metadata } from 'next'; -import { cn } from '@omi3/utils'; -import { silk } from '@omi3/ui'; - -export const metadata: Metadata = { - title: { - template: '%s - Omi3', - default: 'Omi3', - }, - description: 'Omi3', -}; - -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - return ( - - -
{children}
-