Skip to content

Commit

Permalink
add github action deploy, change readme
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Jun 4, 2024
1 parent 0ba75aa commit e622698
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 56 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20

- name: Install dependencies
run: npm install

- name: Build project
run: npm run build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
31 changes: 2 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
# React + TypeScript + Vite
# @tscircuit/kicad-viewer

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/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

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

- Configure the top-level `parserOptions` property like this:

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
View the kicad official footprint library [online](https://tscircuit.github.io/kicad-viewer)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "tsc && vite build",
"lint": "biome lint",
"preview": "vite preview",
"aider": "aider --no-auto-commits --lint-cmd javascript:biome"
"aider": "aider --no-auto-commits --no-auto-lint"
},
"dependencies": {
"react": "^18.2.0",
Expand Down
41 changes: 15 additions & 26 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
import { useState } from "react"
import reactLogo from "./assets/react.svg"
import viteLogo from "/vite.svg"
import "./App.css"

function App() {
const [count, setCount] = useState(0)

return (
<>
<div>
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank" rel="noreferrer">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button type="button" onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
<div className="flex flex-col min-h-screen">
<header className="bg-blue-500 text-white p-4">
<h1 className="text-2xl">Header</h1>
</header>
<div className="flex flex-1">
<aside className="bg-gray-200 w-1/4 p-4">
<h2 className="text-xl">Sidebar</h2>
</aside>
<section className="flex-1 p-4">
<h2 className="text-xl">Content</h2>
</section>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
</>
<footer className="bg-blue-500 text-white p-4">
<h2 className="text-xl">Footer</h2>
</footer>
</div>
)
}

Expand Down

0 comments on commit e622698

Please sign in to comment.