-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ env: | |
|
||
jobs: | ||
release: | ||
permissions: read-all|write-all | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import "./App.css"; | ||
declare function App(): import("react/jsx-runtime").JSX.Element; | ||
export default App; | ||
//# sourceMappingURL=App.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; | ||
import { useState } from "react"; | ||
import reactLogo from "./assets/react.svg"; | ||
import "./App.css"; | ||
import { cn, useProxyState, useDeepClone } from "@chiastack/ui-utils"; | ||
// import { Button, Input, FadeIn } from "@chiastack/ui"; | ||
import Button from "@chiastack/ui/button"; | ||
import Input from "@chiastack/ui/input"; | ||
import FadeIn from "@chiastack/ui/fade-in"; | ||
function App() { | ||
const [count, setCount] = useState(0); | ||
const [objCount, setObjCount] = useState({ count: 0 }); // [1 | ||
const proxyCount = useProxyState({ count: 0 }); | ||
const [sameDeepCount, setSameDeepCount] = useDeepClone({ | ||
count: 0, | ||
}); | ||
const [diffDeepCount, setDiffDeepCount] = useDeepClone({ | ||
count: 0, | ||
}); | ||
return _jsxs("div", { | ||
className: cn("App flex flex-col items-center justify-center gap-5"), | ||
children: [ | ||
_jsxs("div", { | ||
className: "flex gap-5", | ||
children: [ | ||
_jsx("a", { | ||
href: "https://vitejs.dev", | ||
target: "_blank", | ||
rel: "noreferrer", | ||
children: _jsx("img", { | ||
src: "/vite.svg", | ||
className: "logo", | ||
alt: "Vite logo", | ||
}), | ||
}), | ||
_jsx("a", { | ||
href: "https://reactjs.org", | ||
target: "_blank", | ||
rel: "noreferrer", | ||
children: _jsx("img", { | ||
src: reactLogo, | ||
className: "logo react", | ||
alt: "React logo", | ||
}), | ||
}), | ||
], | ||
}), | ||
_jsx(Input, { autoComplete: "off", placeholder: "Type something..." }), | ||
_jsx("h1", { children: "Vite + React + TS + TailwindCSS" }), | ||
_jsxs("div", { | ||
className: cn("card flex flex-col gap-3"), | ||
children: [ | ||
_jsxs(Button, { | ||
className: "border-info bg-primary-light border", | ||
onClick: () => setCount((count) => count + 1), | ||
children: ["count is ", count], | ||
}), | ||
_jsxs(Button, { | ||
className: "border-info bg-primary border", | ||
onClick: () => proxyCount.count++, | ||
children: ["proxyCount is ", proxyCount.count], | ||
}), | ||
_jsxs(Button, { | ||
className: "border-info bg-primary border", | ||
onClick: () => setSameDeepCount({ count: 0 }), | ||
children: [ | ||
"sameDeepCount is ", | ||
sameDeepCount.count, | ||
", this one will not re-render", | ||
], | ||
}), | ||
_jsxs(Button, { | ||
className: "border-info bg-primary border", | ||
onClick: () => setDiffDeepCount({ count: 1 }), | ||
children: ["diffDeepCount is ", diffDeepCount.count], | ||
}), | ||
_jsxs(Button, { | ||
className: "border-info bg-primary border", | ||
onClick: () => setObjCount({ count: 0 }), | ||
children: ["objCount is ", objCount.count], | ||
}), | ||
_jsxs("p", { | ||
children: [ | ||
"Edit ", | ||
_jsx("code", { children: "src/App.tsx" }), | ||
" and save to test HMR", | ||
], | ||
}), | ||
], | ||
}), | ||
_jsx(FadeIn, { | ||
children: _jsx("p", { | ||
className: "read-the-docs", | ||
children: "Create with '@chia-stack/react-ts-tailwind' template", | ||
}), | ||
}), | ||
], | ||
}); | ||
} | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=App.spec.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { describe, expect, test } from "vitest"; | ||
import { render, screen } from "@testing-library/react"; | ||
import App from "./App"; | ||
describe("App", () => { | ||
test("render: Create with '@chia-stack/react-ts-tailwindcss' template", () => { | ||
render(_jsx(App, {})); | ||
expect( | ||
screen.getByText("Create with '@chia-stack/react-ts-tailwind' template") | ||
).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import "./index.css"; | ||
//# sourceMappingURL=main.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import App from "./App"; | ||
import "./index.css"; | ||
ReactDOM.createRoot(document.getElementById("root")).render( | ||
_jsx(React.StrictMode, { children: _jsx(App, {}) }) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare const _default: import("vite").UserConfigExport; | ||
export default _default; | ||
//# sourceMappingURL=vite.config.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/// <reference types="vitest" /> | ||
import { defineConfig } from "vite"; | ||
import react from "@vitejs/plugin-react-swc"; | ||
import path from "path"; | ||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react()], | ||
resolve: { | ||
alias: { | ||
"@": path.resolve(__dirname, "./src"), | ||
}, | ||
}, | ||
test: { | ||
environment: "happy-dom", | ||
}, | ||
}); |