6eb33f4f6c
* Added a 'Hard-Core' lint mode to pre-commit; this will not automagically fix all your problems, but it will show you where some deeper issues arise. * web: streamline sidebar renderer The sidebar renderer had a lot of repetitive code that could easily be templatized, so I extracted the content from it and turned it into a table. * web: complexity of the Sidebar now below 10. This commit incorporates SonarJS into the pre-commit (and *only* the pre-commit) linting pass; SonarJS is much more comprehensive in its complaints, and it's helpful in breaking long functions down to their simplest forms. In this case, the `renderSidebarItems()` function was considered "unreadable," and I've managed to boil it down to its three special cases (new version, impersonation, and enterprise notification) and its routine case (the rest of the sidebar). Going forward, I'd like all our commits to correspond to the SonarJS settings I've established in .eslint.precommit.json, but I'm not gonna hate on others if they don't quite hit it. :-) * web: modernization continues. Three of our four Babel plug-ins have moved from 'proposed' to 'accepted'; I have updated package.json and the .babelrc file to accept those. Node's ability to set its max_old_space_size via the environment variable was enable in 2019; using it here makes it easier to move this code toward a multi-package monorepo in the future. * Adding 'cross-env' so that the uses of the NODE_OPTIONS environment will work (theoretically) on Windows.
126 lines
5.4 KiB
JSON
126 lines
5.4 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": "cross-env NODE_OPTIONS='--max_old_space_size=4096' rollup -c ./rollup.config.mjs",
|
|
"rollup:build-proxy": "cross-env NODE_OPTIONS='--max_old_space_size=4096' rollup -c ./rollup.proxy.mjs",
|
|
"rollup:watch": "cross-env NODE_OPTIONS='--max_old_space_size=4096' 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",
|
|
"lint:precommit": "eslint --max-warnings 0 --config ./.eslintrc.precommit.json $(git status --porcelain | cut -c2- | grep '^[M?]' | cut -c7- | grep -E '\\.(ts|js|tsx|jsx)$') ",
|
|
"lint:spelling": "codespell -D - -D ../.github/codespell-dictionary.txt -I ../.github/codespell-words.txt -S './src/locales/**' ./src -s",
|
|
"lit-analyse": "lit-analyzer src",
|
|
"precommit": "run-s tsc lit-analyse lint:precommit lint:spelling 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": "cross-env NODE_OPTIONS='--max_old_space_size=4096' storybook build"
|
|
},
|
|
"dependencies": {
|
|
"@codemirror/lang-html": "^6.4.6",
|
|
"@codemirror/lang-javascript": "^6.2.1",
|
|
"@codemirror/lang-python": "^6.1.3",
|
|
"@codemirror/lang-xml": "^6.0.2",
|
|
"@codemirror/legacy-modes": "^6.3.3",
|
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
"@formatjs/intl-listformat": "^7.4.2",
|
|
"@fortawesome/fontawesome-free": "^6.4.2",
|
|
"@goauthentik/api": "^2023.8.2-1693820747",
|
|
"@lit-labs/context": "^0.4.0",
|
|
"@lit-labs/task": "^3.0.2",
|
|
"@lit/localize": "^0.11.4",
|
|
"@open-wc/lit-helpers": "^0.6.0",
|
|
"@patternfly/elements": "^2.4.0",
|
|
"@patternfly/patternfly": "^4.224.2",
|
|
"@sentry/browser": "^7.68.0",
|
|
"@sentry/tracing": "^7.68.0",
|
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
"base64-js": "^1.5.1",
|
|
"chart.js": "^4.4.0",
|
|
"chartjs-adapter-moment": "^1.0.1",
|
|
"codemirror": "^6.0.1",
|
|
"construct-style-sheets-polyfill": "^3.1.0",
|
|
"core-js": "^3.32.2",
|
|
"country-flag-icons": "^1.5.7",
|
|
"fuse.js": "^6.6.2",
|
|
"lit": "^2.8.0",
|
|
"mermaid": "^10.4.0",
|
|
"rapidoc": "^9.3.4",
|
|
"style-mod": "^4.1.0",
|
|
"webcomponent-qr-code": "^1.2.0",
|
|
"yaml": "^2.3.2"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/core": "^7.22.17",
|
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
"@babel/plugin-proposal-decorators": "^7.22.15",
|
|
"@babel/plugin-transform-private-methods": "^7.22.5",
|
|
"@babel/plugin-transform-private-property-in-object": "^7.22.11",
|
|
"@babel/plugin-transform-runtime": "^7.22.15",
|
|
"@babel/preset-env": "^7.22.15",
|
|
"@babel/preset-typescript": "^7.22.15",
|
|
"@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.4",
|
|
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
"@rollup/plugin-replace": "^5.0.2",
|
|
"@rollup/plugin-terser": "^0.4.3",
|
|
"@rollup/plugin-typescript": "^11.1.3",
|
|
"@storybook/addon-essentials": "^7.4.0",
|
|
"@storybook/addon-links": "^7.4.0",
|
|
"@storybook/blocks": "^7.1.1",
|
|
"@storybook/web-components": "^7.4.0",
|
|
"@storybook/web-components-vite": "^7.4.0",
|
|
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|
|
"@types/chart.js": "^2.9.38",
|
|
"@types/codemirror": "5.60.10",
|
|
"@types/grecaptcha": "^3.0.4",
|
|
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
|
"@typescript-eslint/parser": "^6.6.0",
|
|
"babel-plugin-macros": "^3.1.0",
|
|
"babel-plugin-tsconfig-paths": "^1.0.3",
|
|
"cross-env": "^7.0.3",
|
|
"eslint": "^8.49.0",
|
|
"eslint-config-google": "^0.14.0",
|
|
"eslint-plugin-custom-elements": "0.0.8",
|
|
"eslint-plugin-lit": "^1.9.1",
|
|
"eslint-plugin-sonarjs": "^0.21.0",
|
|
"eslint-plugin-storybook": "^0.6.13",
|
|
"lit-analyzer": "^1.2.1",
|
|
"npm-run-all": "^4.1.5",
|
|
"prettier": "^3.0.3",
|
|
"pyright": "^1.1.326",
|
|
"react": "^18.2.0",
|
|
"react-dom": "^18.2.0",
|
|
"rollup": "^3.29.1",
|
|
"rollup-plugin-copy": "^3.5.0",
|
|
"rollup-plugin-cssimport": "^1.0.3",
|
|
"rollup-plugin-postcss-lit": "^2.1.0",
|
|
"storybook": "^7.4.0",
|
|
"storybook-addon-mock": "^4.2.1",
|
|
"ts-lit-plugin": "^1.2.1",
|
|
"tslib": "^2.6.2",
|
|
"turnstile-types": "^1.1.2",
|
|
"typescript": "^5.2.2",
|
|
"vite-tsconfig-paths": "^4.2.1"
|
|
},
|
|
"optionalDependencies": {
|
|
"@esbuild/darwin-arm64": "^0.19.2",
|
|
"@esbuild/linux-amd64": "^0.18.11",
|
|
"@esbuild/linux-arm64": "^0.19.2"
|
|
}
|
|
}
|