-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add vite-7/ folder #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| node_modules | ||
| dist | ||
| dist-ssr | ||
| *.local | ||
|
|
||
| # Environment variables | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Editor directories and files | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| .idea | ||
| .DS_Store | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,59 @@ | ||||||||||||||||||||
| # React 19 + TypeScript + Vite 7 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Minimal integration example demonstrating `@moq/hang` and `@moq/hang-ui` with React and Vite. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Features | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - Watch mode: Stream consumption from a relay | ||||||||||||||||||||
| - Publish mode: Stream publishing to a relay | ||||||||||||||||||||
| - Simple mode toggle to switch between viewer and publisher | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Prerequisites | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - Node.js 20.19.0 or >=22.12.0 | ||||||||||||||||||||
| - A running MoQ relay server (default: `http://localhost:4443/anon`) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Quick Start | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| npm install | ||||||||||||||||||||
| npm dev | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
Comment on lines
+18
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✏️ Proposed fix-npm install
-npm dev
+npm install
+npm run dev-npm build
+npm run build📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
| The app opens at `http://localhost:5173` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Environment Variables | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Create a `.env.local` file to override defaults: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```env | ||||||||||||||||||||
| VITE_RELAY_URL=http://localhost:4443/anon | ||||||||||||||||||||
| VITE_BROADCAST_PATH=demo | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| npm build | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Output is generated in the `dist/` directory. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Project Structure | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ``` | ||||||||||||||||||||
| src/ | ||||||||||||||||||||
| ├── App.tsx # Main component with mode toggle | ||||||||||||||||||||
| ├── components/ | ||||||||||||||||||||
| │ ├── HangWatch.tsx # Stream viewer | ||||||||||||||||||||
| │ └── HangPublish.tsx # Stream publisher | ||||||||||||||||||||
| ├── App.css # Component styles | ||||||||||||||||||||
| └── index.css # Global styles | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
Comment on lines
+44
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing language specifier on fenced code block (MD040). The project-structure block has no language tag, triggering a markdownlint warning. Use ✏️ Proposed fix-```
+```text
src/
├── App.tsx # Main component with mode toggle📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.21.0)[warning] 44-44: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Resources | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - [@moq/hang](https://www.npmjs.com/package/@moq/hang) | ||||||||||||||||||||
| - [@moq/hang-ui](https://www.npmjs.com/package/@moq/hang-ui) | ||||||||||||||||||||
| - [Vite](https://vite.dev) | ||||||||||||||||||||
| - [React](https://react.dev) | ||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import js from '@eslint/js' | ||
| import globals from 'globals' | ||
| import reactHooks from 'eslint-plugin-react-hooks' | ||
| import reactRefresh from 'eslint-plugin-react-refresh' | ||
| import tseslint from 'typescript-eslint' | ||
| import { defineConfig, globalIgnores } from 'eslint/config' | ||
|
|
||
| export default defineConfig([ | ||
| globalIgnores(['dist']), | ||
| { | ||
| files: ['**/*.{ts,tsx}'], | ||
| extends: [ | ||
| js.configs.recommended, | ||
| tseslint.configs.recommended, | ||
| reactHooks.configs.flat.recommended, | ||
| reactRefresh.configs.vite, | ||
| ], | ||
| languageOptions: { | ||
| ecmaVersion: 2020, | ||
| globals: globals.browser, | ||
| }, | ||
| }, | ||
| ]) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>@moq/hang Integration Example</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package names in the description don't match
package.json.Line 3 describes demonstrating
@moq/hangand@moq/hang-ui, but the actual runtime dependencies are@moq/publishand@moq/watch. The Resources section at lines 56–57 has the same mismatch. This looks like the README was drafted against an earlier API surface.✏️ Proposed fix
And in the Resources section:
📝 Committable suggestion
🤖 Prompt for AI Agents