Skip to content

Commit

Permalink
chore: use vite starter to create playground
Browse files Browse the repository at this point in the history
  • Loading branch information
niconiahi committed May 13, 2024
1 parent b05cae4 commit 34018fe
Show file tree
Hide file tree
Showing 10 changed files with 2,209 additions and 1,136 deletions.
24 changes: 24 additions & 0 deletions apps/playground/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
12 changes: 2 additions & 10 deletions apps/playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@
<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" />
<script defer src="https://unpkg.com/[email protected]"></script>
<title>Vite + TS + Hyperscript</title>
<title>Vite + TS</title>
<script src="https://unpkg.com/[email protected]"></script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.ts"></script>
<section style="display: grid; grid-template-columns: 1fr; row-gap: 8px">
<button is="ariabones-button" _="on click set @disabled to true">
Disable button
</button>
<button is="ariabones-button" data-type="toggle" data-pressed="true">
Toggle button
</button>
</section>
</body>
</html>
12 changes: 8 additions & 4 deletions apps/playground/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"name": "@ariabones/playground",
"type": "module",
"version": "0.0.0",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build": "tsc && vite build",
"deploy": "wrangler pages deploy",
"preview": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@ariabones/button": "workspace:*"
},
"devDependencies": {
"vite": "^5.0.8"
"typescript": "^5.2.2",
"vite": "^5.2.0",
"wrangler": "^3.55.0"
}
}
1 change: 1 addition & 0 deletions apps/playground/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions apps/playground/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
import { registerButton } from "@ariabones/button"

document.querySelector<HTMLDivElement>('#root')!.innerHTML = `
<section style="display: grid; grid-template-columns: 1fr; row-gap: 8px">
<h3>Make sure you have the Elements tab open so that you can see the changing HTML attributes</h3>
<button is="ariabones-button" _="on click set @disabled to true">
Disable button
</button>
<button is="ariabones-button" data-type="toggle" data-pressed="true">
Toggle button
</button>
</section>
`

registerButton()

1 change: 1 addition & 0 deletions apps/playground/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
21 changes: 15 additions & 6 deletions apps/playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{
"compilerOptions": {
"target": "ESNext",
"jsx": "preserve",
"lib": ["ESNext", "DOM"],
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"skipLibCheck": true

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}
3 changes: 3 additions & 0 deletions apps/playground/wrangler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name = "ariabones"
compatibility_date = "2024-03-29"
pages_build_output_dir = "dist"
2 changes: 1 addition & 1 deletion packages/listbox/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@ariabones/button",
"name": "@ariabones/listbox",
"type": "module",
"version": "0.3.0",
"author": "Nicolas Accetta",
Expand Down
Loading

0 comments on commit 34018fe

Please sign in to comment.