Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: pnpm exec nx-cloud record -- echo Hello World
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
- run: pnpx nx affected -t build && pnpm build
- run: pnpm build:all
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ dist

# Documentations / Demos
demos/out
demos/packages.json

# Gatsby files
.cache/
Expand Down Expand Up @@ -170,3 +171,4 @@ tmp
.nx/cache
.nx/workspace-data
.cursor
Icon
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"cSpell.words": [
"arcstack",
"factman",
"webapi",
"webapis"
],
"typescript.tsdk": "node_modules/typescript/lib",
Expand All @@ -31,4 +32,4 @@
]
}
]
}
}
25 changes: 25 additions & 0 deletions demos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
packages.json

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
75 changes: 75 additions & 0 deletions demos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## React Compiler

The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information.

Note: This will impact Vite dev & build performances.

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

```js
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...

// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,

// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```

You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:

```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```
23 changes: 23 additions & 0 deletions demos/eslint.config.js
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,
},
},
])
22 changes: 22 additions & 0 deletions demos/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Web APIs Demo - @ArcStackLab</title>
<script>
navigator.registerProtocolHandler('web+api', `./?source=PWA&ref=%s`)
</script>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>
35 changes: 35 additions & 0 deletions demos/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@arcstack/demos",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@headlessui/react": "^2.2.9",
"@tailwindcss/vite": "^4.1.18",
"clsx": "^2.1.1",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"tailwindcss": "^4.1.18"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
"@types/node": "^24.10.1",
"@types/react": "^19.2.5",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.1",
"babel-plugin-react-compiler": "^1.0.0",
"eslint": "^9.39.1",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.5.0",
"typescript": "~5.9.3",
"typescript-eslint": "^8.46.4",
"vite": "^7.2.4"
}
}
Binary file added demos/public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/public/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/public/arcstack.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/public/favicon.ico
Binary file not shown.
Binary file added demos/public/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions demos/public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"$schema": "https://json.schemastore.org/web-manifest",
"name": "Web APIs Demos - @ArcStackLab",
"short_name": "Web APIs Demos",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable monochrome"
}
],
"screenshots": [
{
"src": "/icon.png",
"sizes": "1024x1024",
"type": "image/png",
"form_factor": "wide",
"label": "Web APIs"
},
{
"src": "/arcstack.jpg",
"sizes": "1024x1024",
"type": "image/jpeg",
"form_factor": "wide",
"label": "@ArcStackLab"
},
{
"src": "/icon.png",
"sizes": "1024x1024",
"type": "image/png",
"form_factor": "narrow",
"label": "Web APIs"
},
{
"src": "/arcstack.jpg",
"sizes": "1024x1024",
"type": "image/jpeg",
"form_factor": "narrow",
"label": "@ArcStackLab"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone",
"start_url": "./?source=PWA",
"id": "@arcstack/webapis",
"shortcuts": [
{
"name": "Web APIs Demos",
"short_name": "WebAPIs Demos",
"url": "./?source=PWA",
"description": "A Comprehensive Integration of All Web Standard APIs",
"icons": [
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
],
"protocol_handlers": [
{
"protocol": "web+api",
"url": "./?source=PWA&ref=%s"
}
]
}
39 changes: 39 additions & 0 deletions demos/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Footer } from './components/Footer'
import { Header } from './components/Header'
import { SearchFilter } from './components/SearchFilter'
import { ThemeToggle } from './components/ThemeToggle'
import { Packages } from './components/Packages'
import { PackageModal } from './components/PackageModal'
import { useSearchParam } from './hooks/searchParamHooks'
import { useEffect } from 'react'

function App() {
const refParam = useSearchParam('ref')

useEffect(() => {
if (refParam.value) {
const url = new URL(refParam.value)
const destUrl = new URL(location.href)
destUrl.searchParams.delete('ref')
destUrl.searchParams.set('package', url.hostname)
location.replace(destUrl)
}
}, [refParam.value])

return (
<>
<Header />
<main className="min-h-screen py-15 px-4">
<div className="w-full min-h-screen max-w-7xl m-auto flex flex-col gap-4">
<SearchFilter />
<Packages />
<PackageModal />
<ThemeToggle />
</div>
</main>
<Footer />
</>
)
}

export default App
15 changes: 15 additions & 0 deletions demos/src/assets/icons/close.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const CloseIcon = ({ size = 24 }: { size: number }) => (
<svg
viewBox="0 0 24 24"
fill="none"
width={size}
height={size}
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M18 6 6 18" />
<path d="m6 6 12 12" />
</svg>
)
16 changes: 16 additions & 0 deletions demos/src/assets/icons/dark.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const DarkIcon = ({ size = 24 }: { size: number }) => (
<svg viewBox="0 0 28 28" fill="none" width={size} height={size}>
<path
d="M10.5 10a7.5 7.5 0 0 0 10.413 6.912A7.502 7.502 0 0 1 6.5 14a7.5 7.5 0 0 1 4.587-6.913A7.5 7.5 0 0 0 10.5 10Z"
stroke="currentColor"
strokeLinejoin="round"
/>
<path
d="M16.356 6.508 16.5 5.5l.144 1.008a1 1 0 0 0 .849.848L18.5 7.5l-1.008.144a1 1 0 0 0-.848.848L16.5 9.5l-.144-1.008a1 1 0 0 0-.849-.848L14.5 7.5l1.008-.144a1 1 0 0 0 .848-.848m4 5L20.5 10.5l.144 1.008a1 1 0 0 0 .849.848l1.007.144-1.008.144a1 1 0 0 0-.848.848L20.5 14.5l-.144-1.008a1 1 0 0 0-.849-.848L18.5 12.5l1.008-.144a1 1 0 0 0 .848-.848"
fill="currentColor"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
)
14 changes: 14 additions & 0 deletions demos/src/assets/icons/github.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const GithubIcon = ({ size = 24 }: { size: number }) => (
<svg
width={size}
height={size}
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
data-name="Layer 1"
>
<path
fill="currentColor"
d="M12 2.247a10 10 0 0 0-3.162 19.487c.5.088.687-.212.687-.475 0-.237-.012-1.025-.012-1.862-2.513.462-3.163-.613-3.363-1.175a3.64 3.64 0 0 0-1.025-1.413c-.35-.187-.85-.65-.013-.662a2 2 0 0 1 1.538 1.025 2.137 2.137 0 0 0 2.912.825 2.1 2.1 0 0 1 .638-1.338c-2.225-.25-4.55-1.112-4.55-4.937a3.9 3.9 0 0 1 1.025-2.688 3.6 3.6 0 0 1 .1-2.65s.837-.262 2.75 1.025a9.43 9.43 0 0 1 5 0c1.912-1.3 2.75-1.025 2.75-1.025a3.6 3.6 0 0 1 .1 2.65 3.87 3.87 0 0 1 1.025 2.688c0 3.837-2.338 4.687-4.562 4.937a2.37 2.37 0 0 1 .674 1.85c0 1.338-.012 2.413-.012 2.75 0 .263.187.575.687.475A10.005 10.005 0 0 0 12 2.247"
/>
</svg>
)
9 changes: 9 additions & 0 deletions demos/src/assets/icons/jsr.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const JSRIcon = ({ size = 24 }: { size: number }) => (
<svg viewBox="0 0 13 7" aria-hidden="true" height={size}>
<path d="M0 2h2V0h7v1h4v4h-2v2H4V6H0" fill="currentColor" />
<path
d="M1 3h1v1h1V1h1v4H1m4-4h3v1H6v1h2v3H5V5h2V4H5m4-2h3v2h-1V3h-1v3H9"
className="fill-surface"
/>
</svg>
)
Loading