Skip to content

Commit

Permalink
feat: Add playground project
Browse files Browse the repository at this point in the history
  • Loading branch information
aerotoad committed Feb 26, 2023
1 parent 64e7238 commit 0437ab0
Show file tree
Hide file tree
Showing 10 changed files with 1,282 additions and 7 deletions.
1,176 changes: 1,169 additions & 7 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions playground/xeito/.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?
13 changes: 13 additions & 0 deletions playground/xeito/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>
21 changes: 21 additions & 0 deletions playground/xeito/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "xeito",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"typescript": "^4.9.3",
"vite": "^4.1.0"
},
"dependencies": {
"@xeito/core": "^0.3.3",
"@xeito/injection": "^0.3.3",
"@xeito/store": "^0.3.3",
"vite-plugin-inspect": "^0.7.15"
}
}
1 change: 1 addition & 0 deletions playground/xeito/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.
21 changes: 21 additions & 0 deletions playground/xeito/src/app-component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Component, XeitoComponent, html, State } from "@xeito/core";

@Component({
selector: 'app-root',
})
export class AppComponent extends XeitoComponent {

@State() count: number = 0;

onDidMount() {
console.dir(this);
}

render() {
return html`
<h1>My App</h1>
<button @click=${()=>this.count++}>Count is: ${this.count}</button>
`;
}

}
5 changes: 5 additions & 0 deletions playground/xeito/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Xeito } from '@xeito/core';
import { AppComponent } from './app-component';

const xeito = new Xeito(AppComponent);
xeito.bootstrap('#app');
1 change: 1 addition & 0 deletions playground/xeito/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
20 changes: 20 additions & 0 deletions playground/xeito/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"skipLibCheck": true,
"experimentalDecorators": true
},
"include": ["src"]
}
7 changes: 7 additions & 0 deletions playground/xeito/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vite';
import xeito from '../../packages/vite-plugin-xeito/src/index';
import Inspect from 'vite-plugin-inspect';

export default defineConfig({
plugins: [xeito(), Inspect()],
});

0 comments on commit 0437ab0

Please sign in to comment.