-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[oauth-app] Move to examples and convert to vite (#260)
* [oauth-app] Move to examples and convert to vite (#6504) All CRA removed from workspaces! π GitOrigin-RevId: ebdcec569f5f95f98b2f7281561b4b0de1fe8ca4 * [js] Resolve dep warnings (#6506) GitOrigin-RevId: ed8d59e4ff7f6ecad65239b036a19a85298f6146 * Update package.json to new concurrency (#6519) GitOrigin-RevId: f4993ca59d270f75447aa5840e83ba6357847361 * add job permissions * [oauth-app] Remove private dep * update permissions * fix permissions * fix dep --------- Co-authored-by: Corey Martin <[email protected]> Co-authored-by: Rohan Ramakrishnan <[email protected]>
- Loading branch information
1 parent
c76b83c
commit 32768cd
Showing
65 changed files
with
770 additions
and
18,287 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
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
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,13 @@ | ||
module.exports = { | ||
extends: ["@lightsparkdev/eslint-config/react-app"], | ||
|
||
overrides: [ | ||
{ | ||
files: ["**/*.ts?(x)"], | ||
parserOptions: { | ||
/* Allow linting for ts files outside src with tsconfig-eslint: */ | ||
project: ["./tsconfig.json", "./tsconfig-eslint.json"], | ||
}, | ||
}, | ||
], | ||
}; |
File renamed without changes.
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,33 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="A demo of using oauth with the Lightspark JS SDK" | ||
/> | ||
<link rel="apple-touch-icon" href="/logo192.png" /> | ||
<link rel="manifest" href="/manifest.json" /> | ||
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
<link | ||
rel="preload" | ||
href="https://fonts.googleapis.com/css?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" | ||
as="style" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
href="https://fonts.googleapis.com/css?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" | ||
/> | ||
|
||
<title>Lightspark OAuth Demo</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<script type="module" src="/src/index.tsx"></script> | ||
</body> | ||
</html> |
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,43 @@ | ||
{ | ||
"name": "@lightsparkdev/oauth-app", | ||
"version": "0.0.0", | ||
"private": true, | ||
"dependencies": { | ||
"@emotion/css": "^11.11.0", | ||
"@emotion/react": "^11.11.0", | ||
"@emotion/styled": "^11.11.0", | ||
"@lightsparkdev/lightspark-sdk": "1.0.6", | ||
"@lightsparkdev/oauth": "*", | ||
"@lightsparkdev/ui": "*", | ||
"qrcode.react": "^3.1.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.1.0", | ||
"react-router-dom": "6.11.2", | ||
"web-vitals": "^3.3.0" | ||
}, | ||
"devDependencies": { | ||
"@lightsparkdev/eslint-config": "*", | ||
"@lightsparkdev/tsconfig": "*", | ||
"@types/jest": "^29.5.3", | ||
"@types/node": "^20.2.5", | ||
"@types/react": "^18.2.12", | ||
"@types/react-dom": "^18.0.0", | ||
"@vitejs/plugin-react": "^4.0.1", | ||
"eslint": "^8.3.0", | ||
"eslint-watch": "^8.0.0", | ||
"tsc-absolute": "^1.0.1", | ||
"typescript": "^4.9.5", | ||
"vite": "^4.3.9" | ||
}, | ||
"scripts": { | ||
"start": "yarn vite", | ||
"build": "yarn tsc && yarn vite build", | ||
"clean": "rm -rf .turbo && rm -rf dist", | ||
"lint:fix": "eslint --fix .", | ||
"lint:watch": "esw ./src -w --ext .ts,.tsx,.js --color", | ||
"lint": "eslint .", | ||
"test": "echo \"TODO\"", | ||
"types:watch": "tsc-absolute --watch", | ||
"types": "tsc" | ||
} | ||
} |
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,14 @@ | ||
import { Route, Routes } from "react-router-dom"; | ||
import { MainRoutes } from "./routes"; | ||
import DashboardPage from "./pages/DashboardPage"; | ||
import LoginPage from "./pages/LoginPage"; | ||
|
||
export function Root() { | ||
return ( | ||
<Routes> | ||
<Route path={MainRoutes.Base} element={<DashboardPage />} /> | ||
<Route path={MainRoutes.Login} element={<LoginPage />} /> | ||
<Route path={MainRoutes.Oauth} element={<LoginPage />} /> | ||
</Routes> | ||
); | ||
} |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...s/oauth-example/src/auth/AuthProvider.tsx β ...mples/oauth-app/src/auth/AuthProvider.tsx
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
12 changes: 8 additions & 4 deletions
12
...es/oauth-example/src/auth/RequireAuth.tsx β ...amples/oauth-app/src/auth/RequireAuth.tsx
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
File renamed without changes.
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,5 @@ | ||
/* eslint-disable-next-line no-restricted-imports -- only use with typesafe routes */ | ||
import { Button as ButtonBase } from "@lightsparkdev/ui/components"; | ||
import { type RoutesType } from "src/routes"; | ||
|
||
export const Button = ButtonBase<RoutesType>; |
10 changes: 5 additions & 5 deletions
10
...auth-example/src/components/Dashboard.tsx β ...es/oauth-app/src/components/Dashboard.tsx
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
File renamed without changes.
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,24 @@ | ||
/* eslint-disable no-restricted-imports -- only allow in this file */ | ||
import { | ||
Link as LinkBase, | ||
Navigate as NavigateBase, | ||
replaceParams as replaceParamsBase, | ||
useCurrentRoute as useCurrentRouteBase, | ||
useFindMatchingRoute as useFindMatchingRouteBase, | ||
useMatchRoute as useMatchRouteBase, | ||
useMatchRoutes as useMatchRoutesBase, | ||
useNavigate as useNavigateBase, | ||
type LinkProps as LinkPropsBase, | ||
} from "@lightsparkdev/ui/router"; | ||
import type { RoutesType } from "src/routes"; | ||
/* eslint-enable no-restricted-imports */ | ||
|
||
export const replaceParams = replaceParamsBase<RoutesType>; | ||
export const Link = LinkBase<RoutesType>; | ||
export const Navigate = NavigateBase<RoutesType>; | ||
export const useNavigate = useNavigateBase<RoutesType>; | ||
export const useMatchRoutes = useMatchRoutesBase<RoutesType>; | ||
export const useFindMatchingRoute = useFindMatchingRouteBase<RoutesType>; | ||
export const useMatchRoute = useMatchRouteBase<RoutesType>; | ||
export const useCurrentRoute = useCurrentRouteBase<RoutesType>; | ||
export type LinkProps = LinkPropsBase<RoutesType>; |
4 changes: 2 additions & 2 deletions
4
...auth-example/src/hooks/useAccountInfo.tsx β ...es/oauth-app/src/hooks/useAccountInfo.tsx
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
File renamed without changes.
16 changes: 12 additions & 4 deletions
16
...-sdk/examples/oauth-example/src/index.tsx β apps/examples/oauth-app/src/index.tsx
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
4 changes: 2 additions & 2 deletions
4
...ghtsparkclient/LightsparkClientContext.ts β ...ghtsparkclient/LightsparkClientContext.ts
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
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
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
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
2 changes: 1 addition & 1 deletion
2
...ples/oauth-example/src/reportWebVitals.ts β ...examples/oauth-app/src/reportWebVitals.ts
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
Oops, something went wrong.