Fix build issues.

This commit is contained in:
Mike Cao 2021-11-22 14:53:36 -08:00
parent cfa220c095
commit d4dd2069b6
9 changed files with 686 additions and 171 deletions

View File

@ -4,7 +4,7 @@
"es2020": true, "es2020": true,
"node": true "node": true
}, },
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier"], "extends": ["eslint:recommended", "plugin:react/recommended", "prettier", "next"],
"parserOptions": { "parserOptions": {
"ecmaFeatures": { "ecmaFeatures": {
"jsx": true "jsx": true

2
.gitignore vendored
View File

@ -25,7 +25,7 @@
.idea .idea
*.iml *.iml
*.log *.log
.vscode/* /.vscode/
# debug # debug
npm-debug.log* npm-debug.log*

4
.husky/pre-commit Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged

View File

@ -18,7 +18,7 @@ import Bars from 'assets/bars.svg';
export default function Header() { export default function Header() {
const user = useSelector(state => state.user); const user = useSelector(state => state.user);
const [active, setActive] = useState(false); const [active, setActive] = useState(false);
const { locale, dir } = useLocale(); const { dir } = useLocale();
function handleClick() { function handleClick() {
setActive(state => !state); setActive(state => !state);

View File

@ -15,7 +15,7 @@ export default function FilterTags({ params, onClick }) {
return null; return null;
} }
return ( return (
<div className={styles.tag}> <div key={key} className={styles.tag}>
<Button icon={<Times />} onClick={() => onClick(key)} variant="action" iconRight> <Button icon={<Times />} onClick={() => onClick(key)} variant="action" iconRight>
{`${key}: ${params[key]}`} {`${key}: ${params[key]}`}
</Button> </Button>

View File

@ -427,7 +427,7 @@ export function getSessionMetrics(website_id, start_at, end_at, field, filters =
export function getPageviewMetrics(website_id, start_at, end_at, field, table, filters = {}) { export function getPageviewMetrics(website_id, start_at, end_at, field, table, filters = {}) {
const params = [website_id, start_at, end_at]; const params = [website_id, start_at, end_at];
const { domain, url, ref } = filters; const { domain, url } = filters;
let domainFilter = ''; let domainFilter = '';
let urlFilter = ''; let urlFilter = '';

View File

@ -7,6 +7,9 @@ module.exports = {
FORCE_SSL: !!process.env.FORCE_SSL, FORCE_SSL: !!process.env.FORCE_SSL,
}, },
basePath: process.env.BASE_PATH, basePath: process.env.BASE_PATH,
eslint: {
ignoreDuringBuilds: true,
},
webpack(config) { webpack(config) {
config.module.rules.push({ config.module.rules.push({
test: /\.svg$/, test: /\.svg$/,

View File

@ -1,6 +1,6 @@
{ {
"name": "umami", "name": "umami",
"version": "1.24.0", "version": "1.24.1",
"description": "A simple, fast, website analytics alternative to Google Analytics. ", "description": "A simple, fast, website analytics alternative to Google Analytics. ",
"author": "Mike Cao <mike@mikecao.com>", "author": "Mike Cao <mike@mikecao.com>",
"license": "MIT", "license": "MIT",
@ -35,7 +35,9 @@
"download-country-names": "node scripts/download-country-names.js", "download-country-names": "node scripts/download-country-names.js",
"loadtest": "node scripts/loadtest.js", "loadtest": "node scripts/loadtest.js",
"loadtest:medium": "node scripts/loadtest.js --weight=medium", "loadtest:medium": "node scripts/loadtest.js --weight=medium",
"loadtest:heavy": "node scripts/loadtest.js --weight=heavy --verbose" "loadtest:heavy": "node scripts/loadtest.js --weight=heavy --verbose",
"lint": "next lint --quiet",
"prepare": "husky install"
}, },
"lint-staged": { "lint-staged": {
"**/*.js": [ "**/*.js": [
@ -50,11 +52,6 @@
"prettier --write" "prettier --write"
] ]
}, },
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"dependencies": { "dependencies": {
"@fontsource/inter": "4.5.0", "@fontsource/inter": "4.5.0",
"@prisma/client": "2.29.1", "@prisma/client": "2.29.1",
@ -107,14 +104,14 @@
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"del": "^6.0.0", "del": "^6.0.0",
"dotenv-cli": "^4.0.0", "dotenv-cli": "^4.0.0",
"eslint": "^8.1.0", "eslint": "^7.32.0",
"eslint-config-next": "^12.0.1", "eslint-config-next": "^12.0.1",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.24.0", "eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-hooks": "^4.2.0",
"extract-react-intl-messages": "^4.1.1", "extract-react-intl-messages": "^4.1.1",
"husky": "^7.0.4", "husky": "^7.0.0",
"lint-staged": "^11.0.0", "lint-staged": "^11.0.0",
"loadtest": "5.1.2", "loadtest": "5.1.2",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
@ -129,7 +126,7 @@
"rollup": "^2.48.0", "rollup": "^2.48.0",
"rollup-plugin-hashbang": "^2.2.2", "rollup-plugin-hashbang": "^2.2.2",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"stylelint": "^14.0.1", "stylelint": "^13.13.0",
"stylelint-config-css-modules": "^2.2.0", "stylelint-config-css-modules": "^2.2.0",
"stylelint-config-prettier": "^9.0.3", "stylelint-config-prettier": "^9.0.3",
"stylelint-config-recommended": "^5.0.0", "stylelint-config-recommended": "^5.0.0",

823
yarn.lock

File diff suppressed because it is too large Load Diff