4e5ea05987
* web: begin refactoring the application for future development This commit: - Deletes a bit of code. - Extracts *all* of the Locale logic into a single folder, turns management of the Locale files over to Lit itself, and restricts our responsibility to setting the locale on startup and when the user changes the locale. We do this by converting a lot of internal calls into events; a request to change a locale isn't a function call, it's an event emitted asking `REQUEST_LOCALE_CHANGE`. We've even eliminated the `DETECT_LOCALE_CHANGE` event, which redrew elements with text in them, since Lit's own `@localized()` decorator does that for us automagically. - We wrap our interfaces in an `ak-locale-context` that handles the startup and listens for the `REQUEST_LOCALE_CHANGE` event. - ... and that's pretty much it. Adding `@localized()` as a default behavior to `AKElement` means no more custom localization is needed *anywhere*. * web: improve the localization experience This commit fixes the Storybook story for the localization context component, and fixes the localization initialization pass so that it is only called once per interface environment initialization. Since all our interfaces share the same environment (the Django server), this preserves functionality across all interfaces. --------- Co-authored-by: Jens Langhammer <jens@goauthentik.io>
115 lines
4.8 KiB
JSON
115 lines
4.8 KiB
JSON
{
|
|
"name": "@goauthentik/web",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"license": "MIT",
|
|
"scripts": {
|
|
"extract-locales": "lit-localize extract",
|
|
"build-locales": "run-s build-locales:build",
|
|
"build-locales:build": "lit-localize build",
|
|
"build-locales:repair": "prettier --write ./src/locale-codes.ts",
|
|
"rollup:build": "node --max-old-space-size=4096 node_modules/.bin/rollup -c ./rollup.config.js",
|
|
"rollup:build-proxy": "node --max-old-space-size=4096 node_modules/.bin/rollup -c ./rollup.proxy.js",
|
|
"rollup:watch": "node --max-old-space-size=8192 node_modules/.bin/rollup -c -w",
|
|
"build": "run-s build-locales rollup:build",
|
|
"build-proxy": "run-s build-locales rollup:build-proxy",
|
|
"watch": "run-s build-locales rollup:watch",
|
|
"lint": "eslint . --max-warnings 0 --fix",
|
|
"lit-analyse": "lit-analyzer src",
|
|
"precommit": "run-s tsc lit-analyse lint prettier",
|
|
"prettier-check": "prettier --check .",
|
|
"prettier": "prettier --write .",
|
|
"tsc:execute": "tsc --noEmit -p .",
|
|
"tsc": "run-s build-locales tsc:execute",
|
|
"storybook": "storybook dev -p 6006",
|
|
"storybook:build": "storybook build",
|
|
"background-image": "sharp resize 2650 --mozjpeg -i src/assets/images/flow_background.jpg -o src/assets/images/flow_background.jpg"
|
|
},
|
|
"dependencies": {
|
|
"@codemirror/lang-html": "^6.4.5",
|
|
"@codemirror/lang-javascript": "^6.1.9",
|
|
"@codemirror/lang-python": "^6.1.3",
|
|
"@codemirror/lang-xml": "^6.0.2",
|
|
"@codemirror/legacy-modes": "^6.3.2",
|
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
"@formatjs/intl-listformat": "^7.4.0",
|
|
"@fortawesome/fontawesome-free": "^6.4.0",
|
|
"@lit-labs/context": "^0.3.3",
|
|
"@goauthentik/api": "^2023.6.0-1688736781",
|
|
"@lit/localize": "^0.11.4",
|
|
"@patternfly/patternfly": "^4.224.2",
|
|
"@sentry/browser": "^7.57.0",
|
|
"@sentry/tracing": "^7.57.0",
|
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
"base64-js": "^1.5.1",
|
|
"chart.js": "^4.3.0",
|
|
"chartjs-adapter-moment": "^1.0.1",
|
|
"codemirror": "^6.0.1",
|
|
"construct-style-sheets-polyfill": "^3.1.0",
|
|
"core-js": "^3.31.1",
|
|
"country-flag-icons": "^1.5.7",
|
|
"fuse.js": "^6.6.2",
|
|
"lit": "^2.7.6",
|
|
"mermaid": "^10.2.4",
|
|
"rapidoc": "^9.3.4",
|
|
"style-mod": "^4.0.3",
|
|
"webcomponent-qr-code": "^1.1.1",
|
|
"yaml": "^2.3.1"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/core": "^7.22.8",
|
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
"@babel/plugin-proposal-decorators": "^7.22.7",
|
|
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
"@babel/plugin-transform-runtime": "^7.22.7",
|
|
"@babel/preset-env": "^7.22.7",
|
|
"@babel/preset-typescript": "^7.22.5",
|
|
"@hcaptcha/types": "^1.0.3",
|
|
"@jackfranklin/rollup-plugin-markdown": "^0.4.0",
|
|
"@jeysal/storybook-addon-css-user-preferences": "^0.2.0",
|
|
"@lit/localize-tools": "^0.6.9",
|
|
"@rollup/plugin-babel": "^6.0.3",
|
|
"@rollup/plugin-commonjs": "^25.0.2",
|
|
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
"@rollup/plugin-replace": "^5.0.2",
|
|
"@rollup/plugin-typescript": "^11.1.2",
|
|
"@storybook/addon-essentials": "^7.0.26",
|
|
"@storybook/addon-links": "^7.0.26",
|
|
"@storybook/blocks": "^7.0.22",
|
|
"@storybook/web-components": "^7.0.24",
|
|
"@storybook/web-components-vite": "^7.0.26",
|
|
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
|
"@types/chart.js": "^2.9.37",
|
|
"@types/codemirror": "5.60.8",
|
|
"@types/grecaptcha": "^3.0.4",
|
|
"@typescript-eslint/eslint-plugin": "^5.61.0",
|
|
"@typescript-eslint/parser": "^5.61.0",
|
|
"babel-plugin-macros": "^3.1.0",
|
|
"babel-plugin-tsconfig-paths": "^1.0.3",
|
|
"eslint": "^8.44.0",
|
|
"eslint-config-google": "^0.14.0",
|
|
"eslint-plugin-custom-elements": "0.0.8",
|
|
"eslint-plugin-lit": "^1.8.3",
|
|
"eslint-plugin-storybook": "^0.6.12",
|
|
"lit-analyzer": "^1.2.1",
|
|
"npm-run-all": "^4.1.5",
|
|
"prettier": "^2.8.8",
|
|
"pyright": "^1.1.316",
|
|
"react": "^18.2.0",
|
|
"react-dom": "^18.2.0",
|
|
"rollup": "^2.79.1",
|
|
"rollup-plugin-copy": "^3.4.0",
|
|
"rollup-plugin-cssimport": "^1.0.3",
|
|
"rollup-plugin-minify-html-literals": "^1.2.6",
|
|
"rollup-plugin-postcss-lit": "^2.1.0",
|
|
"rollup-plugin-terser": "^7.0.2",
|
|
"sharp-cli": "^4.1.1",
|
|
"storybook": "^7.0.26",
|
|
"ts-lit-plugin": "^1.2.1",
|
|
"tslib": "^2.6.0",
|
|
"turnstile-types": "^1.1.2",
|
|
"typescript": "^5.1.6",
|
|
"vite-tsconfig-paths": "^4.2.0"
|
|
}
|
|
}
|