Skip to content

Commit edc3596

Browse files
authored
Update all dependencies to latest (#10)
1 parent 79aa354 commit edc3596

13 files changed

+4220
-3352
lines changed

.env.example

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# openssl rand -base64 32
2+
WORKOS_COOKIE_PASSWORD="your-secure-cookie-password"
3+
14
# Available in your WorkOS dashboard
2-
WORKOS_CLIENT_ID=
3-
WORKOS_API_KEY=
4-
WORKOS_REDIRECT_URI=
5-
WORKOS_COOKIE_PASSWORD=
5+
WORKOS_CLIENT_ID="..."
6+
WORKOS_API_KEY="..."
7+
WORKOS_REDIRECT_URI="http://localhost:5173/callback"

.eslintrc.cjs

Lines changed: 0 additions & 79 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ node_modules
55
/public/build
66
.env
77
.react-router/
8+
.DS_Store

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package-lock.json
2+
pnpm-lock.yaml
3+
yarn.lock
4+
5+
node_modules
6+
/.cache
7+
/build
8+
/public/build
9+
.react-router/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Rename the `.env.example` file to `.env` and supply your Client ID and API key a
1919
```sh
2020
WORKOS_CLIENT_ID=client_... # retrieved from the WorkOS dashboard
2121
WORKOS_API_KEY=sk_test_... # retrieved from the WorkOS dashboard
22-
WORKOS_REDIRECT_URI=http://localhost:3000/callback # configured in the WorkOS dashboard
22+
WORKOS_REDIRECT_URI=http://localhost:5173/callback # configured in the WorkOS dashboard
2323
WORKOS_COOKIE_PASSWORD=<your password> # generate a secure password here
2424
```
2525

@@ -35,7 +35,7 @@ Install the dependencies
3535
npm install
3636
```
3737

38-
Run the following command and navigate to [http://localhost:3000](http://localhost:3000).
38+
Run the following command and navigate to [http://localhost:5173](http://localhost:5173).
3939

4040
```bash
4141
npm run dev

app/root.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
// Import the base CSS styles for the radix-ui components.
22
import '@radix-ui/themes/styles.css';
33
import { Theme, Card, Container, Flex, Button, Box } from '@radix-ui/themes';
4-
5-
import type { ActionFunctionArgs, LinksFunction, LoaderFunctionArgs } from 'react-router';
64
import { Links, Link, Meta, Outlet, Scripts, ScrollRestoration, useRouteLoaderData } from 'react-router';
75

86
import Footer from './components/footer';
97
import SignInButton from './components/sign-in-button';
108

119
import { signOut, authkitLoader } from '@workos-inc/authkit-react-router';
10+
import type { Route } from './+types/root';
1211

13-
export const links: LinksFunction = () => [];
12+
export const links: Route.LinksFunction = () => [];
1413

15-
export const loader = (args: LoaderFunctionArgs) => authkitLoader(args, { debug: true });
14+
export const loader = (args: Route.LoaderArgs) => authkitLoader(args, { debug: true });
1615

1716
export function useRootLoaderData() {
1817
return useRouteLoaderData<typeof loader>('root');
1918
}
2019

21-
export async function action({ request }: ActionFunctionArgs) {
20+
export async function action({ request }: Route.ActionArgs) {
2221
// Called when the form in SignInButton is submitted
2322
return await signOut(request);
2423
}

app/routes/_index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { ActionFunctionArgs, MetaFunction } from 'react-router';
21
import { Button, Flex, Heading, Text } from '@radix-ui/themes';
32
import { Link } from 'react-router';
43
import SignInButton from '~/components/sign-in-button';
54
import { useRootLoaderData } from '~/root';
65
import { signOut } from '@workos-inc/authkit-react-router';
6+
import type { Route } from './+types/_index';
77

8-
export const meta: MetaFunction = () => {
8+
export const meta: Route.MetaFunction = () => {
99
return [
1010
{ title: 'Example AuthKit Authenticated App' },
1111
{
@@ -15,7 +15,7 @@ export const meta: MetaFunction = () => {
1515
];
1616
};
1717

18-
export async function action({ request }: ActionFunctionArgs) {
18+
export async function action({ request }: Route.ActionArgs) {
1919
// Called when the form in SignInButton is submitted
2020
return await signOut(request);
2121
}

app/routes/account.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { Text, Heading, TextField, Flex, Box } from '@radix-ui/themes';
22

33
import { useLoaderData } from 'react-router';
44
import { authkitLoader } from '@workos-inc/authkit-react-router';
5-
import type { LoaderFunctionArgs } from 'react-router';
5+
import type { Route } from './+types/account';
66

7-
export const loader = (args: LoaderFunctionArgs) => authkitLoader(args, { ensureSignedIn: true });
7+
export const loader = (args: Route.LoaderArgs) => authkitLoader(args, { ensureSignedIn: true });
88

99
export default function AccountPage() {
1010
const { user, role } = useLoaderData<typeof loader>();

eslint.config.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* This is intended to be a basic starting point for linting in your app.
3+
* It relies on recommended configs out of the box for simplicity, but you can
4+
* and should modify this configuration to best suit your team's needs.
5+
*/
6+
7+
// @ts-check
8+
import js from '@eslint/js';
9+
import globals from 'globals';
10+
import reactHooks from 'eslint-plugin-react-hooks';
11+
import reactRefresh from 'eslint-plugin-react-refresh';
12+
import jsxA11y from 'eslint-plugin-jsx-a11y';
13+
import tseslint from 'typescript-eslint';
14+
15+
export default tseslint.config(
16+
{ ignores: ['dist'] },
17+
{
18+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
19+
files: ['**/*.{js,ts,tsx}'],
20+
languageOptions: {
21+
ecmaVersion: 2020,
22+
globals: globals.browser,
23+
},
24+
plugins: {
25+
'react-hooks': reactHooks,
26+
'react-refresh': reactRefresh,
27+
'jsx-a11y': jsxA11y,
28+
},
29+
rules: {
30+
...reactHooks.configs.recommended.rules,
31+
// TODO: Recommended for Vite apps. Enable and fix surfaced issues.
32+
// 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
33+
},
34+
},
35+
);

0 commit comments

Comments
 (0)