Skip to content

Commit b6e5438

Browse files
authored
Merge pull request #3242 from umami-software/analytics
v2.16
2 parents e34547c + f86be7b commit b6e5438

File tree

469 files changed

+7213
-7486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

469 files changed

+7213
-7486
lines changed

.eslintrc.json

-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
"ecmaVersion": 11,
1414
"sourceType": "module"
1515
},
16-
"settings": {
17-
"import/resolver": {
18-
"node": {
19-
"moduleDirectory": ["node_modules", "src/"]
20-
}
21-
}
22-
},
2316
"extends": [
2417
"plugin:@typescript-eslint/recommended",
2518
"eslint:recommended",

Dockerfile

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Install dependencies only when needed
2-
FROM node:18-alpine AS deps
2+
FROM node:22-alpine AS deps
33
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
44
RUN apk add --no-cache libc6-compat
55
WORKDIR /app
@@ -9,7 +9,7 @@ RUN yarn config set network-timeout 300000
99
RUN yarn install --frozen-lockfile
1010

1111
# Rebuild the source code only when needed
12-
FROM node:18-alpine AS builder
12+
FROM node:22-alpine AS builder
1313
WORKDIR /app
1414
COPY --from=deps /app/node_modules ./node_modules
1515
COPY . .
@@ -26,18 +26,21 @@ ENV NEXT_TELEMETRY_DISABLED 1
2626
RUN yarn build-docker
2727

2828
# Production image, copy all the files and run next
29-
FROM node:18-alpine AS runner
29+
FROM node:22-alpine AS runner
3030
WORKDIR /app
3131

32+
ARG NODE_OPTIONS
33+
3234
ENV NODE_ENV production
3335
ENV NEXT_TELEMETRY_DISABLED 1
36+
ENV NODE_OPTIONS $NODE_OPTIONS
3437

3538
RUN addgroup --system --gid 1001 nodejs
3639
RUN adduser --system --uid 1001 nextjs
3740

3841
RUN set -x \
39-
&& apk add --no-cache curl openssl \
40-
&& yarn add npm-run-all dotenv semver prisma@5.17.0
42+
&& apk add --no-cache curl \
43+
&& yarn add npm-run-all dotenv semver prisma@6.1.0
4144

4245
# You only need to copy next.config.js if you are NOT using the default configuration
4346
COPY --from=builder /app/next.config.js .

db/mysql/schema.prisma

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
generator client {
22
provider = "prisma-client-js"
3-
binaryTargets = ["native", "linux-musl-openssl-3.0.x", "linux-musl-arm64-openssl-3.0.x"]
3+
binaryTargets = ["native"]
44
}
55

66
datasource db {

db/postgresql/schema.prisma

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
generator client {
22
provider = "prisma-client-js"
3-
binaryTargets = ["native", "linux-musl-openssl-3.0.x", "linux-musl-arm64-openssl-3.0.x"]
3+
binaryTargets = ["native"]
44
}
55

66
datasource db {

next-env.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference types="next/navigation-types/compat/navigation" />
43

54
// NOTE: This file should not be edited
65
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

next.config.js

+25-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-var-requires */
22
require('dotenv').config();
3-
const path = require('path');
43
const pkg = require('./package.json');
54

65
const TRACKER_SCRIPT = '/script.js';
@@ -9,6 +8,7 @@ const basePath = process.env.BASE_PATH;
98
const collectApiEndpoint = process.env.COLLECT_API_ENDPOINT;
109
const cloudMode = process.env.CLOUD_MODE;
1110
const cloudUrl = process.env.CLOUD_URL;
11+
const corsMaxAge = process.env.CORS_MAX_AGE;
1212
const defaultLocale = process.env.DEFAULT_LOCALE;
1313
const disableLogin = process.env.DISABLE_LOGIN;
1414
const disableUI = process.env.DISABLE_UI;
@@ -60,6 +60,15 @@ const trackerHeaders = [
6060
];
6161

6262
const headers = [
63+
{
64+
source: '/api/:path*',
65+
headers: [
66+
{ key: 'Access-Control-Allow-Origin', value: '*' },
67+
{ key: 'Access-Control-Allow-Headers', value: '*' },
68+
{ key: 'Access-Control-Allow-Methods', value: 'GET, DELETE, POST, PUT' },
69+
{ key: 'Access-Control-Max-Age', value: corsMaxAge || '86400' },
70+
],
71+
},
6372
{
6473
source: '/:path*',
6574
headers: defaultHeaders,
@@ -169,27 +178,22 @@ const config = {
169178
typescript: {
170179
ignoreBuildErrors: true,
171180
},
172-
webpack(config) {
173-
const fileLoaderRule = config.module.rules.find(rule => rule.test?.test?.('.svg'));
174-
175-
config.module.rules.push(
176-
{
177-
...fileLoaderRule,
178-
test: /\.svg$/i,
179-
resourceQuery: /url/,
180-
},
181-
{
182-
test: /\.svg$/i,
183-
issuer: fileLoaderRule.issuer,
184-
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] },
185-
use: ['@svgr/webpack'],
181+
experimental: {
182+
turbo: {
183+
rules: {
184+
'*.svg': {
185+
loaders: ['@svgr/webpack'],
186+
as: '*.js',
187+
},
186188
},
187-
);
188-
189-
fileLoaderRule.exclude = /\.svg$/i;
190-
191-
config.resolve.alias['public'] = path.resolve('./public');
192-
189+
},
190+
},
191+
webpack(config) {
192+
config.module.rules.push({
193+
test: /\.svg$/,
194+
issuer: /\.(js|ts)x?$/,
195+
use: ['@svgr/webpack'],
196+
});
193197
return config;
194198
},
195199
async headers() {

package.json

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "umami",
3-
"version": "2.15.1",
3+
"version": "2.16.0",
44
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
55
"author": "Umami Software, Inc. <[email protected]>",
66
"license": "MIT",
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/umami-software/umami.git"
1111
},
1212
"scripts": {
13-
"dev": "next dev -p 3000",
13+
"dev": "next dev -p 3000 --turbo",
1414
"build": "npm-run-all check-env build-db check-db build-tracker build-geo build-app",
1515
"start": "next start",
1616
"build-docker": "npm-run-all build-db build-tracker build-geo build-app",
@@ -63,21 +63,20 @@
6363
"cacheDirectories": [
6464
".next/cache"
6565
],
66-
"resolutions": {
67-
"jackspeak": "2.1.1"
68-
},
6966
"dependencies": {
70-
"@clickhouse/client": "^1.4.1",
67+
"@clickhouse/client": "^1.10.1",
7168
"@date-fns/utc": "^1.2.0",
7269
"@dicebear/collection": "^9.2.1",
7370
"@dicebear/core": "^9.2.1",
7471
"@fontsource/inter": "^4.5.15",
75-
"@prisma/client": "5.22.0",
76-
"@prisma/extension-read-replicas": "^0.3.0",
72+
"@hello-pangea/dnd": "^17.0.0",
73+
"@prisma/client": "6.1.0",
74+
"@prisma/extension-read-replicas": "^0.4.0",
7775
"@react-spring/web": "^9.7.3",
7876
"@tanstack/react-query": "^5.28.6",
7977
"@umami/prisma-client": "^0.14.0",
80-
"@umami/redis-client": "^0.24.0",
78+
"@umami/redis-client": "^0.26.0",
79+
"bcryptjs": "^2.4.3",
8180
"chalk": "^4.1.1",
8281
"chart.js": "^4.4.2",
8382
"chartjs-adapter-date-fns": "^3.0.0",
@@ -99,17 +98,17 @@
9998
"is-docker": "^3.0.0",
10099
"is-localhost-ip": "^1.4.0",
101100
"isbot": "^5.1.16",
101+
"jsonwebtoken": "^9.0.2",
102102
"kafkajs": "^2.1.0",
103-
"maxmind": "^4.3.6",
103+
"maxmind": "^4.3.24",
104104
"md5": "^2.3.0",
105105
"next": "15.0.4",
106-
"next-basics": "^0.39.0",
107106
"node-fetch": "^3.2.8",
108107
"npm-run-all": "^4.1.5",
109-
"prisma": "5.22.0",
108+
"prisma": "6.1.0",
109+
"pure-rand": "^6.1.0",
110110
"react": "^19.0.0",
111-
"react-basics": "^0.125.0",
112-
"react-beautiful-dnd": "^13.1.0",
111+
"react-basics": "^0.126.0",
113112
"react-dom": "^19.0.0",
114113
"react-error-boundary": "^4.0.4",
115114
"react-intl": "^6.5.5",
@@ -118,9 +117,10 @@
118117
"react-window": "^1.8.6",
119118
"request-ip": "^3.3.0",
120119
"semver": "^7.5.4",
120+
"serialize-error": "^12.0.0",
121121
"thenby": "^1.3.4",
122122
"uuid": "^9.0.0",
123-
"yup": "^0.32.11",
123+
"zod": "^3.24.1",
124124
"zustand": "^4.5.5"
125125
},
126126
"devDependencies": {
@@ -135,15 +135,16 @@
135135
"@svgr/webpack": "^8.1.0",
136136
"@types/cypress": "^1.1.3",
137137
"@types/jest": "^29.5.14",
138-
"@types/node": "^20.9.0",
139-
"@types/react": "^18.2.41",
140-
"@types/react-dom": "^18.2.17",
138+
"@types/node": "^22.13.4",
139+
"@types/react": "^19.0.8",
140+
"@types/react-dom": "^19.0.2",
141+
"@types/react-intl": "^3.0.0",
141142
"@types/react-window": "^1.8.8",
142143
"@typescript-eslint/eslint-plugin": "^6.7.3",
143144
"@typescript-eslint/parser": "^6.7.3",
144145
"cross-env": "^7.0.3",
145146
"cypress": "^13.6.6",
146-
"esbuild": "^0.17.17",
147+
"esbuild": "^0.25.0",
147148
"eslint": "^8.33.0",
148149
"eslint-config-next": "^14.0.4",
149150
"eslint-config-prettier": "^8.5.0",

0 commit comments

Comments
 (0)