Skip to content

Commit cc87553

Browse files
committed
init
0 parents  commit cc87553

File tree

19 files changed

+1294
-0
lines changed

19 files changed

+1294
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
3+
env:
4+
VITE_GITHUB_PAGE_URL: ${{ secrets.VITE_GITHUB_PAGE_URL }}
5+
6+
on:
7+
# Runs on pushes targeting the default branch
8+
push:
9+
tags:
10+
- "*"
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow one concurrent deployment
22+
concurrency:
23+
group: "pages"
24+
cancel-in-progress: true
25+
26+
jobs:
27+
# Single deploy job
28+
deploy:
29+
environment:
30+
name: github-pages
31+
url: ${{ steps.deployment.outputs.page_url }}
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Set up Bun
37+
uses: oven-sh/setup-bun@v2
38+
- name: Install dependencies
39+
run: bun install
40+
- name: Build
41+
run: bun run build
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v4
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
# Upload dist folder
48+
path: "./dist"
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

bun.lock

Lines changed: 249 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "javascript-projects",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"devDependencies": {
12+
"@fortawesome/fontawesome-free": "^6.7.2",
13+
"@tailwindcss/vite": "^4.1.8",
14+
"@types/node": "^22.15.29",
15+
"install": "^0.13.0",
16+
"tailwindcss": "^4.1.8",
17+
"typescript": "~5.8.3",
18+
"vite": "^6.3.5"
19+
},
20+
"trustedDependencies": [
21+
"@tailwindcss/oxide"
22+
]
23+
}

src/counter.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export function setupCounter(element: HTMLButtonElement) {
2+
let counter = 0
3+
const setCounter = (count: number) => {
4+
counter = count
5+
element.innerHTML = `count is ${counter}`
6+
}
7+
element.addEventListener('click', () => setCounter(counter + 1))
8+
setCounter(0)
9+
}

src/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + TS</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="main.ts"></script>
12+
</body>
13+
</html>

src/main.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import './style.css'
2+
import typescriptLogo from './typescript.svg'
3+
import viteLogo from '/vite.svg'
4+
import { setupCounter } from './counter.ts'
5+
6+
document.querySelector<HTMLDivElement>('#app')!.innerHTML = `
7+
<div>
8+
<a href="https://vite.dev" target="_blank">
9+
<img src="${viteLogo}" class="logo" alt="Vite logo" />
10+
</a>
11+
<a href="https://www.typescriptlang.org/" target="_blank">
12+
<img src="${typescriptLogo}" class="logo vanilla" alt="TypeScript logo" />
13+
</a>
14+
<h1>Vite + TypeScript</h1>
15+
<div class="card">
16+
<button id="counter" type="button"></button>
17+
</div>
18+
<p class="read-the-docs">
19+
Click on the Vite and TypeScript logos to learn more
20+
</p>
21+
</div>
22+
`
23+
24+
setupCounter(document.querySelector<HTMLButtonElement>('#counter')!)

src/public/vite.svg

Lines changed: 1 addition & 0 deletions
Loading

src/quote-generator/ambient.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface Quote {
2+
text: string;
3+
author: string | null;
4+
}

0 commit comments

Comments
 (0)