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

moving to keycloak v11, work in progress #129

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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 changes: 0 additions & 25 deletions .eslintrc.cjs

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
/dist/
/dist_keycloak/
/public/keycloakify-dev-resources/
/.vscode/
/.yarn_home/
25 changes: 25 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"printWidth": 90,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"arrowParens": "avoid",
"overrides": [
{
"files": [
"**/login/pages/*.tsx",
"**/account/pages/*.tsx",
"**/login/Template.tsx",
"**/account/Template.tsx",
"**/login/UserProfileFormFields.tsx",
"KcApp.tsx"
],
"options": {
"printWidth": 150
}
}
]
}
22 changes: 7 additions & 15 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
staticDirs: ["../public"]
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [],
framework: {
name: "@storybook/react-vite",
options: {}
},
staticDirs: ["../public"]
};
export default config;
25 changes: 25 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<style>
body.sb-show-main.sb-main-padded {
padding: 0;
}

/* Following styles are just meant to avoid white flash when switching from one story to another */
@keyframes fadeToTransparent {
from {
background-color: #393939;
}

to {
background-color: transparent;
}
}
html {
animation: fadeToTransparent 500ms forwards ease-in;
}
body > .sb-preparing-docs {
visibility: hidden;
}
body > .sb-preparing-story {
visibility: hidden;
}
</style>
17 changes: 8 additions & 9 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import type { Preview } from "@storybook/react";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i
}
}
}
};

export default preview;
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

48 changes: 48 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import typescriptEslint from "typescript-eslint";
import reactRefresh from "eslint-plugin-react-refresh";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import eslintConfigPrettier from "eslint-config-prettier";
import globals from "globals";
import js from "@eslint/js";
import storybook from "eslint-plugin-storybook";

export default typescriptEslint.config(
js.configs.recommended,
...typescriptEslint.configs.recommended,
react.configs.flat.recommended,
react.configs.flat["jsx-runtime"],
eslintConfigPrettier,
...storybook.configs["flat/recommended"],
{
ignores: ["dist/**", "public/**"],
},
{
plugins: {
"react-refresh": reactRefresh,
"react-hooks": reactHooks,
},
languageOptions: {
globals: {
...globals.browser,
},
},
settings: {
react: {
version: "detect",
},
},
rules: {
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/no-redeclare": "off",
"no-labels": "off",
},
},
{
files: ["**/*.stories.*"],
rules: {
"import/no-anonymous-default-export": "off",
},
},
);
137 changes: 24 additions & 113 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,123 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<!--
Notice the use of %BASE_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
<head>
<meta charset=" utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

Unlike "/favicon.ico" or "favicon.ico", "%BASE_URL%favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
-->
<link
rel="icon"
type="image/png"
sizes="32x32"
href="%BASE_URL%favicon.ico"
/>
<title>Neosync</title>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-JNE89GJ6WJ"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-JNE89GJ6WJ");
</script>
<script>
gtag("event", "conversion", {
send_to: "AW-11350558666/9_e_CKSV7uUYEMqPr6Qq",
});
</script>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />

<link
rel="preload"
href="%BASE_URL%fonts/WorkSans/worksans-bold-webfont.woff2"
as="font"
crossorigin="anonymous"
/>
<link
rel="preload"
href="%BASE_URL%fonts/WorkSans/worksans-medium-webfont.woff2"
as="font"
crossorigin="anonymous"
/>
<link
rel="preload"
href="%BASE_URL%fonts/WorkSans/worksans-regular-webfont.woff2"
as="font"
crossorigin="anonymous"
/>
<link
rel="preload"
href="%BASE_URL%fonts/WorkSans/worksans-semibold-webfont.woff2"
as="font"
crossorigin="anonymous"
/>
<!-- SEE: https://docs.keycloakify.dev/limitations#self-hosted-fonts -->
<!-- Don't forget to import your custom fonts in Storybook as well: https://github.com/keycloakify/keycloakify-starter/blob/bb019e66fb09166cb9af1e24e230994f59daa420/src/keycloak-theme/login/createPageStory.tsx#L21 -->
<style>
/* latin */
@font-face {
font-family: "Work Sans";
font-style: normal;
font-weight: normal;
/*400*/
font-display: swap;
src: url("%BASE_URL%fonts/WorkSans/worksans-regular-webfont.woff2")
format("woff2");
}
<title>Neosync</title>

/* latin */
@font-face {
font-family: "Work Sans";
font-style: normal;
font-weight: 500;
font-display: swap;
src: url("%BASE_URL%fonts/WorkSans/worksans-medium-webfont.woff2")
format("woff2");
}
<script async src="https://www.googletagmanager.com/gtag/js?id=G-JNE89GJ6WJ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-JNE89GJ6WJ");
</script>
<script>
gtag("event", "conversion", {
send_to: "AW-11350558666/9_e_CKSV7uUYEMqPr6Qq",
});
</script>

/* latin */
@font-face {
font-family: "Work Sans";
font-style: normal;
font-weight: 600;
font-display: swap;
src: url("%BASE_URL%fonts/WorkSans/worksans-semibold-webfont.woff2")
format("woff2");
}
</head>

/* latin */
@font-face {
font-family: "Work Sans";
font-style: normal;
font-weight: bold;
/*700*/
font-display: swap;
src: url("%BASE_URL%fonts/WorkSans/worksans-bold-webfont.woff2")
format("woff2");
}
</style>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

<meta name="keycloakify-ignore-start" />
<script>
console.log(
"This is logged Only in the main app, stripped out in the theme"
);
</script>
<meta name="keycloakify-ignore-end" />
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading