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 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 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.

8 changes: 4 additions & 4 deletions samples/asgardeo-react-app/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PORT=3000
HOST="localhost"
DISABLE_DEV_SERVER_HOST_CHECK=false
HTTPS=true
VITE_PORT=3000
VITE_HOST="localhost"
VITE_DISABLE_DEV_SERVER_HOST_CHECK=false
VITE_HTTPS=true
HewageNKM marked this conversation as resolved.
Show resolved Hide resolved
201 changes: 0 additions & 201 deletions samples/asgardeo-react-app/LICENSE
HewageNKM marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

8 changes: 4 additions & 4 deletions samples/asgardeo-react-app/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Asgardeo Auth React SDK Usage Example (Single Page Application)
# Asgardeo Auth React SDK Usage Vite Example (Single Page Application)

HewageNKM marked this conversation as resolved.
Show resolved Hide resolved
This sample is developed to demonstrate the basic usage of the Asgardeo Auth React SDK.

Expand All @@ -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>Vite + React + Asgardeo</title>
HewageNKM marked this conversation as resolved.
Show resolved Hide resolved
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading
Loading