Skip to content

Commit

Permalink
feat: version updates
Browse files Browse the repository at this point in the history
  • Loading branch information
htmujahid committed Apr 21, 2024
1 parent 68cbbe3 commit 42ae418
Show file tree
Hide file tree
Showing 21 changed files with 606 additions and 22 deletions.
13 changes: 13 additions & 0 deletions apps/playground/index.html
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>Vite + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
304 changes: 304 additions & 0 deletions apps/playground/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions apps/playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "playground",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^5.2.6"
},
"dependencies": {
"@sonnetjs/core": "*",
"@sonnetjs/html": "*"
}
}
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.
52 changes: 52 additions & 0 deletions apps/playground/src/Counter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { SonnetComponent } from '@sonnetjs/core';
import { a, button, div, h1, img, p } from '@sonnetjs/html';

class Counter extends SonnetComponent {
counter = 0;

public script() {
const counterButton = document.getElementById(
'counter',
) as HTMLButtonElement;
counterButton.addEventListener('click', () => {
this.counter += 1;
counterButton.innerText = `count is ${this.counter}`;
});
}

public get() {
return div()
.children(
a()
.href('https://vitejs.dev')
.target('blank')
.children(
img()
.src('https://vitejs.dev/logo.svg')
.className('logo')
.alt('Vite Logo')
.get(),
)
.get(),
h1().innerText('Vite').get(),
div()
.className('card')
.children(
button()
.id('counter')
.type('button')
.innerText(`count is ${this.counter}`)
.className('btn')
.get(),
)
.get(),
p()
.innerText('Edit src/main.ts and save to test HMR.')
.className('read-the-docs')
.get(),
)
.get();
}
}

export default Counter;
Loading

0 comments on commit 42ae418

Please sign in to comment.