Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate the default sample to vite #259

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25,982 changes: 25,982 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions samples/asgardeo-react-app/.env

This file was deleted.

6 changes: 3 additions & 3 deletions samples/asgardeo-react-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This sample is developed to demonstrate the basic usage of the Asgardeo Auth Rea

Follow the instructions in the [Try Out the Sample Apps](../../SAMPLE_APPS.md#try-out-the-sample-apps) section to register an application.

Make sure to add `https://localhost:3000` as a Redirect URL and also add it under allowed origins.
Make sure to add `https://localhost:3000` as a Redirect URL and also add it under allowed origins.

### Download the Sample

Expand All @@ -38,13 +38,13 @@ Read more about the SDK configurations [here](../../README.md#authprovider).
### Run the Application

```bash
npm install && npm start
npm install && npm run dev
```
The app should open at [`https://localhost:3000`](https://localhost:3000)

### Change the Application's Development Server Port

By default, the development server runs on port `3000`. Incase if you wish to change this to something else,
By default, the development server runs on port `3000`. Incase if you wish to change this to something else,
follow the steps below.

1. Update the `PORT` in [.env](.env) file in the app root.
Expand Down
43 changes: 0 additions & 43 deletions samples/asgardeo-react-app/babel.config.js

This file was deleted.

38 changes: 38 additions & 0 deletions samples/asgardeo-react-app/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'

export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: '18.3' } },
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
]
13 changes: 13 additions & 0 deletions samples/asgardeo-react-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sample react based SPA with Asgardeo Auth React SDK</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading