Skip to content

Commit

Permalink
ci: fix permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Chia1104 committed Jul 22, 2023
1 parent 7e3bed1 commit 6ef15c5
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ env:

jobs:
release:
permissions: read-all|write-all

runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 4 additions & 0 deletions playground/react/src/App.d.ts
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
1 change: 1 addition & 0 deletions playground/react/src/App.d.ts.map

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

100 changes: 100 additions & 0 deletions playground/react/src/App.js
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;
2 changes: 2 additions & 0 deletions playground/react/src/App.spec.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=App.spec.d.ts.map
1 change: 1 addition & 0 deletions playground/react/src/App.spec.d.ts.map

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

12 changes: 12 additions & 0 deletions playground/react/src/App.spec.js
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();
});
});
2 changes: 2 additions & 0 deletions playground/react/src/main.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import "./index.css";
//# sourceMappingURL=main.d.ts.map
1 change: 1 addition & 0 deletions playground/react/src/main.d.ts.map

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

8 changes: 8 additions & 0 deletions playground/react/src/main.js
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, {}) })
);
3 changes: 3 additions & 0 deletions playground/react/vite.config.d.ts
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
1 change: 1 addition & 0 deletions playground/react/vite.config.d.ts.map

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

16 changes: 16 additions & 0 deletions playground/react/vite.config.js
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",
},
});

0 comments on commit 6ef15c5

Please sign in to comment.