Skip to content

Commit

Permalink
feat(oidc-client): install app
Browse files Browse the repository at this point in the history
Signed-off-by: Roy Scheeren <[email protected]>
  • Loading branch information
royscheeren committed Feb 20, 2024
1 parent 17c449c commit 9c583f7
Show file tree
Hide file tree
Showing 17 changed files with 4,960 additions and 749 deletions.
23 changes: 23 additions & 0 deletions apps/oidc-client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['preact', '@typescript-eslint'],
extends: ['../../.eslintrc.json'],
ignorePatterns: ['!**/*', 'vite.config.ts'],
overrides: [
{
files: ['*.ts', '*.js', '*.tsx'],
parserOptions: {
project: ['apps/oidc-client/tsconfig.*?.json'],
},
rules: {},
},
{
files: ['*.ts', '*.tsx'],
rules: {},
},
{
files: ['*.js', '*.jsx'],
rules: {},
},
],
}
16 changes: 16 additions & 0 deletions apps/oidc-client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="shortcut icon" type="image/ico" href="favicon.svg" />
<title>Preact App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

<script src="/src/index.tsx" type="module"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions apps/oidc-client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "oidc-client",
"version": "0.0.1",
"description": "Nx Preact oidc-client app"
}
68 changes: 68 additions & 0 deletions apps/oidc-client/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "oidc-client",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/oidc-client/src",
"projectType": "application",
"tags": [],
"targets": {
"lint": {
"command": "eslint apps/oidc-client/**/*.{ts,spec.ts,tsx}"
},
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/apps/oidc-client"
},
"configurations": {
"development": {
"mode": "development"
},
"production": {
"mode": "production"
}
}
},
"serve": {
"executor": "@nx/vite:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "oidc-client:build"
},
"configurations": {
"development": {
"buildTarget": "oidc-client:build:development",
"hmr": true
},
"production": {
"buildTarget": "oidc-client:build:production",
"hmr": false
}
}
},
"preview": {
"executor": "@nx/vite:preview-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "oidc-client:build"
},
"configurations": {
"development": {
"buildTarget": "oidc-client:build:development"
},
"production": {
"buildTarget": "oidc-client:build:production"
}
}
},
"test": {
"executor": "@nx/vite:test",
"outputs": ["{options.reportsDirectory}"],
"options": {
"passWithNoTests": true,
"reportsDirectory": "../../coverage/apps/oidc-client"
}
}
}
}
15 changes: 15 additions & 0 deletions apps/oidc-client/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions apps/oidc-client/src/App.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.App {
text-align: center;
}

.logo {
animation: logo-spin infinite 20s linear;
height: 40vmin;
pointer-events: none;
}

.header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.link {
color: #b318f0;
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
20 changes: 20 additions & 0 deletions apps/oidc-client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import styles from './App.module.css'
import { Logo } from './logo'

function App() {
return (
<div class={styles.App}>
<header class={styles.header}>
<Logo class={styles.logo} />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a class={styles.link} href="https://github.com/preactjs/preact" target="_blank" rel="noopener noreferrer">
Learn Preact
</a>
</header>
</div>
)
}

export default App
30 changes: 30 additions & 0 deletions apps/oidc-client/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
html,
body {
height: 100%;
width: 100%;
padding: 0;
margin: 0;
background: #fafafa;
font-family: 'Helvetica Neue', arial, sans-serif;
font-weight: 400;
color: #444;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

* {
box-sizing: border-box;
}

#app {
height: 100%;
text-align: center;
background-color: #673ab8;
color: #fff;
font-size: 1.5em;
padding-top: 100px;
}

.link {
color: #fff;
}
7 changes: 7 additions & 0 deletions apps/oidc-client/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { render } from 'preact'

import App from './App'
import './index.css'

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
render(<App />, document.getElementById('root')!)
47 changes: 47 additions & 0 deletions apps/oidc-client/src/logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
export const Logo = () => (
<svg
class="logo"
height="180px"
viewBox="-256 -256 1800 512"
title="Preact"
style="
display: inline-block;
margin: -0.25em 0px 0px;
vertical-align: middle;
"
>
<path
d="M0,-256 221.7025033688164,-128 221.7025033688164,128 0,256 -221.7025033688164,128 -221.7025033688164,-128z"
fill="white"
></path>
<ellipse
cx="0"
cy="0"
rx="75px"
ry="196px"
stroke-width="16px"
stroke-dasharray="365.2604060943886 81.7395939056114"
stroke-dashoffset="1131.9689975248618"
fill="none"
stroke="#673ab8"
transform="rotate(52)"
></ellipse>
<ellipse
cx="0"
cy="0"
rx="75px"
ry="196px"
stroke-width="16px"
stroke-dasharray="403.1225208830963 43.87747911690373"
stroke-dashoffset="-963.0079812482553"
fill="none"
stroke="#673ab8"
transform="rotate(-52)"
></ellipse>
<circle cx="0" cy="0" r="34" fill="#673ab8"></circle>
<path
fill="white"
d="M289.85 25.25L289.85 125L272 125L272-122.63L335.88-122.63Q379.45-122.63 401.59-103.55Q423.73-84.48 423.73-49.13Q423.73-32.85 417.69-19.20Q411.65-5.55 400.27 4.34Q388.90 14.22 372.63 19.74Q356.35 25.25 335.88 25.25L289.85 25.25M289.85 10.90L335.88 10.90Q352.33 10.90 365.27 6.35Q378.23 1.80 387.24-6.25Q396.25-14.30 401.06-25.24Q405.88-36.18 405.88-49.13Q405.88-77.65 388.29-93.05Q370.70-108.45 335.88-108.45L289.85-108.45L289.85 10.90ZM497.58 13.00L497.58 125L479.73 125L479.73-122.63L542.90-122.63Q585.78-122.63 606.95-106.09Q628.13-89.55 628.13-57.53Q628.13-43.35 623.23-31.63Q618.33-19.90 609.14-11.06Q599.95-2.23 587 3.46Q574.05 9.15 557.78 10.90Q561.98 13.52 565.30 17.90L650.53 125L634.95 125Q632.15 125 630.14 123.95Q628.13 122.90 626.20 120.45L546.93 20.00Q543.95 16.15 540.54 14.57Q537.13 13.00 529.95 13.00L497.58 13.00M497.58-0.30L540.63-0.30Q557.08-0.30 570.11-4.24Q583.15-8.18 592.16-15.53Q601.18-22.88 605.90-33.20Q610.63-43.53 610.63-56.48Q610.63-82.90 593.30-95.68Q575.98-108.45 542.90-108.45L497.58-108.45L497.58-0.30ZM843.73-122.63L843.73-107.75L713.35-107.75L713.35-7.65L821.85-7.65L821.85 6.87L713.35 6.87L713.35 110.13L843.73 110.13L843.73 125L695.33 125L695.33-122.63L843.73-122.63ZM1088.55 125L1074.73 125Q1072.28 125 1070.70 123.69Q1069.13 122.38 1068.25 120.28L1039.03 48.35L917.40 48.35L888.35 120.28Q887.65 122.20 885.90 123.60Q884.15 125 881.70 125L868.05 125L969.38-122.63L987.23-122.63L1088.55 125M922.83 35.05L1033.78 35.05L983.20-90.08Q981.98-93.05 980.75-96.81Q979.53-100.58 978.30-104.78Q977.08-100.58 975.85-96.81Q974.63-93.05 973.40-89.90L922.83 35.05ZM1302.40 83.35Q1304.15 83.35 1305.38 84.57L1312.38 92.10Q1304.67 100.33 1295.58 106.89Q1286.47 113.45 1275.71 118.09Q1264.95 122.72 1252.09 125.26Q1239.22 127.80 1223.83 127.80Q1198.10 127.80 1176.66 118.79Q1155.22 109.78 1139.91 93.24Q1124.60 76.70 1116.03 53.25Q1107.45 29.80 1107.45 1.10Q1107.45-27.08 1116.29-50.35Q1125.13-73.63 1141.14-90.34Q1157.15-107.05 1179.46-116.24Q1201.78-125.43 1228.72-125.43Q1242.20-125.43 1253.40-123.41Q1264.60-121.40 1274.31-117.64Q1284.03-113.88 1292.60-108.28Q1301.17-102.68 1309.40-95.33L1303.97-87.45Q1302.58-85.35 1299.60-85.35Q1298.03-85.35 1295.58-87.19Q1293.13-89.03 1289.36-91.74Q1285.60-94.45 1280.26-97.69Q1274.92-100.93 1267.58-103.64Q1260.22-106.35 1250.60-108.19Q1240.97-110.03 1228.72-110.03Q1206.15-110.03 1187.25-102.24Q1168.35-94.45 1154.70-80.01Q1141.05-65.58 1133.44-45.01Q1125.83-24.45 1125.83 1.10Q1125.83 27.35 1133.35 48.00Q1140.88 68.65 1154.17 82.91Q1167.47 97.17 1185.59 104.79Q1203.70 112.40 1224.88 112.40Q1238.17 112.40 1248.59 110.65Q1259 108.90 1267.75 105.40Q1276.50 101.90 1284.03 96.82Q1291.55 91.75 1298.90 84.92Q1299.78 84.22 1300.56 83.79Q1301.35 83.35 1302.40 83.35ZM1530.42-122.63L1530.42-107.40L1443.45-107.40L1443.45 125L1425.60 125L1425.60-107.40L1338.10-107.40L1338.10-122.63L1530.42-122.63Z"
></path>
</svg>
)
10 changes: 10 additions & 0 deletions apps/oidc-client/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",

"compilerOptions": {
"outDir": "../../dist/out-tsc"
},

"include": ["src/**/*"],
"exclude": ["**/*.spec.ts", "**/*_spec.ts", "**/*.spec.tsx", "**/*_spec.tsx", "public/*"]
}
26 changes: 26 additions & 0 deletions apps/oidc-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"strict": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment",
"jsxImportSource": "preact",
"types": ["vite/client"]
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
19 changes: 19 additions & 0 deletions apps/oidc-client/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["vitest/globals", "vitest/importMeta", "vite/client", "node", "vitest"]
},
"include": [
"vite.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.d.ts"
]
}
38 changes: 38 additions & 0 deletions apps/oidc-client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/// <reference types='vitest' />
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'
import preact from '@preact/preset-vite'
import { defineConfig, searchForWorkspaceRoot } from 'vite'

console.log(searchForWorkspaceRoot(process.cwd()))
export default defineConfig({
cacheDir: '../../node_modules/.vite/oidc-client',

server: {
port: 4201,
host: 'localhost',
fs: {
allow: ['..'],
},
},

preview: {
port: 4301,
host: 'localhost',
},

plugins: [preact(), nxViteTsPaths()],

// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },

test: {
globals: true,
cache: {
dir: '../../node_modules/.vitest',
},
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
},
})
6 changes: 6 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
"cache": true,
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"e2e": {
"inputs": ["default", "^production"]
},
"test": {
"inputs": ["default", "^production"]
}
},
"namedInputs": {
Expand Down
Loading

0 comments on commit 9c583f7

Please sign in to comment.