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

Gå over fra Create-react-app til Vite #8

Merged
merged 18 commits into from
Jan 6, 2025
Merged
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
Binary file added .DS_Store
Binary file not shown.
12 changes: 8 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,24 @@ jobs:
name: Build, push and deploy
runs-on: ubuntu-latest
env:
REACT_APP_BASE_URL: ${{ secrets.REACT_APP_BASE_URL }}
VITE_REACT_APP_BASE_URL: ${{ secrets.REACT_APP_BASE_URL }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hva er grunnen til at base url er i en github secret?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tipper @mettok er rett mann å spørre om dette. Jeg tenker at vi evt. kan gjøre litt om på det når han kommer tilbake fra ferie.

NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/setup-node@v4
with:
registry-url: 'https://npm.pkg.github.com'
- uses: actions/checkout@v4

- name: Install frontend dependencies
run: npm install
working-directory: ./lps-client-frontend
working-directory: ./lps-client-frontend-v

- name: Build frontend
run: npm run build
working-directory: ./lps-client-frontend
working-directory: ./lps-client-frontend-v

- uses: actions/setup-java@v4
with:
Expand All @@ -52,4 +56,4 @@ jobs:
env:
CLUSTER: dev-gcp
RESOURCE: .nais/app.yaml
VAR: image=${{ steps.docker-build-push.outputs.image }}
VAR: image=${{ steps.docker-build-push.outputs.image }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/.idea/
.gradle
gradle
gradlew
gradlew.bat
.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ private val dotenv =
ignoreIfMissing = true
}

val maskinportenClientId: String = System.getenv("MASKINPORTEN_CLIENT_ID") ?: dotenv["MASKINPORTEN_CLIENT_ID"]
val maskinportenClientJwk: String = System.getenv("MASKINPORTEN_CLIENT_JWK") ?: dotenv["MASKINPORTEN_CLIENT_JWK"]
val maskinportenClientIssuer: String = System.getenv("MASKINPORTEN_ISSUER") ?: dotenv["MASKINPORTEN_ISSUER"]
val maskinportenPortenScopes: String = System.getenv("MASKINPORTEN_SCOPES") ?: dotenv["MASKINPORTEN_SCOPES"]
val maskinportenTokenEndpoint: String = System.getenv("MASKINPORTEN_TOKEN_ENDPOINT") ?: dotenv["MASKINPORTEN_TOKEN_ENDPOINT"]
val maskinportenIntegrasjonsId: String = System.getenv("MASKINPORTEN_INTEGRATION_ID") ?: dotenv["MASKINPORTEN_INTEGRATION_ID"]
val maskinportenKid: String = System.getenv("MASKINPORTEN_KID") ?: dotenv["MASKINPORTEN_KID"]
Expand Down
24 changes: 24 additions & 0 deletions lps-client-frontend-v/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ npm start

## Building

Denne applikasjonen er bygget med [Create React App](https://create-react-app.dev/). For å bygge applikasjonen kjører du:
Denne applikasjonen er bygget med Vite. For å bygge applikasjonen kjører du:
```bash
npm run build
```
applikasjonen vil bygges og legges i
applikasjonen vil bygges og legges i

```code
lps-client-backend/src/main/resources/lps-client-front
Expand Down
28 changes: 28 additions & 0 deletions lps-client-frontend-v/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
13 changes: 13 additions & 0 deletions lps-client-frontend-v/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" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TigerSys</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading