Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

chore(root): migrate to biome

Carl-Gerhard Lindesvärd32e91959f6d1
diff --git a/.dockerignore b/.dockerignore
index 754915157..b57dee0da 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -7,4 +7,6 @@ node_modules
npm-debug.log
README.md
.next
-.git
\ No newline at end of file
+.git
+tmp
+converage
\ No newline at end of file
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 0a535e057..3ae0537b4 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,7 +1,3 @@
{
- "recommendations": [
- "dbaeumer.vscode-eslint",
- "esbenp.prettier-vscode",
- "yoavbls.pretty-ts-errors"
- ]
+ "recommendations": ["yoavbls.pretty-ts-errors"]
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index d9aacae88..63692fe54 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,21 +1,34 @@
{
+ "prettier.enable": false,
+ "eslint.enable": false,
+ "files.associations": {
+ "*.css": "tailwindcss"
+ },
"editor.codeActionsOnSave": {
- "source.fixAll.eslint": "explicit"
+ "source.organizeImports.biome": "explicit"
+ },
+ "[prisma]": {
+ "editor.defaultFormatter": "Prisma.prisma"
+ },
+ "[typescript]": {
+ "editor.defaultFormatter": "biomejs.biome"
+ },
+ "[typescriptreact]": {
+ "editor.defaultFormatter": "biomejs.biome"
+ },
+ "[json]": {
+ "editor.defaultFormatter": "biomejs.biome"
},
- "editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
- "eslint.workingDirectories": [
- { "pattern": "apps/*/" },
- { "pattern": "packages/*/" },
- { "pattern": "tooling/*/" }
+ "tailwindCSS.experimental.configFile": "./packages/ui/tailwind.config.ts",
+ "tailwindCSS.experimental.classRegex": [
+ ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
+ ["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
],
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.autoImportFileExcludePatterns": [
"next/router.d.ts",
"next/dist/client/router.d.ts"
- ],
- "[sql]": {
- "editor.defaultFormatter": "adpyke.vscode-sql-formatter"
- }
+ ]
}
diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile
index 6e9649151..57c319959 100644
--- a/apps/api/Dockerfile
+++ b/apps/api/Dockerfile
@@ -38,9 +38,6 @@ COPY packages/constants/package.json packages/constants/
COPY packages/validation/package.json packages/validation/
COPY packages/sdks/sdk/package.json packages/sdks/sdk/
-# Patches
-COPY patches patches
-
# BUILD
FROM base AS build
diff --git a/apps/api/package.json b/apps/api/package.json
index 14c042b26..923b1ffbd 100644
--- a/apps/api/package.json
+++ b/apps/api/package.json
@@ -6,8 +6,6 @@
"testing": "API_PORT=3333 pnpm dev",
"start": "node dist/index.js",
"build": "rm -rf dist && tsup",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -40,8 +38,6 @@
"zod": "^3.22.4"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/sdk": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/jsonwebtoken": "^9.0.6",
@@ -51,16 +47,7 @@
"@types/ua-parser-js": "^0.7.39",
"@types/uuid": "^9.0.8",
"@types/ws": "^8.5.10",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/apps/api/scripts/get-referrers.ts b/apps/api/scripts/get-referrers.ts
index e0934a006..e32e24ae4 100644
--- a/apps/api/scripts/get-referrers.ts
+++ b/apps/api/scripts/get-referrers.ts
@@ -1,5 +1,5 @@
-import fs from 'fs';
-import path from 'path';
+import fs from 'node:fs';
+import path from 'node:path';
function transform(data: any) {
const obj: Record<string, unknown> = {};
@@ -22,7 +22,7 @@ async function main() {
// Get document, or throw exception on error
try {
const data = await fetch(
- 'https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-latest.json'
+ 'https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-latest.json',
).then((res) => res.json());
fs.writeFileSync(
@@ -34,11 +34,11 @@ async function main() {
`// The orginal referers.yml is based on Piwik's SearchEngines.php and Socials.php, copyright 2012 Matthieu Aubry and available under the GNU General Public License v3.`,
'',
`const referrers: Record<string, { type: string, name: string }> = ${JSON.stringify(
- transform(data)
+ transform(data),
)} as const;`,
'export default referrers;',
].join('\n'),
- 'utf-8'
+ 'utf-8',
);
} catch (e) {
console.log(e);
diff --git a/apps/api/scripts/migrate-origins.ts b/apps/api/scripts/migrate-origins.ts
index 0c8698bd9..a88f5950e 100644
--- a/apps/api/scripts/migrate-origins.ts
+++ b/apps/api/scripts/migrate-origins.ts
@@ -1,8 +1,8 @@
-import { ch, chQuery, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, ch, chQuery } from '@openpanel/db';
async function main() {
const projects = await chQuery(
- `SELECT distinct project_id FROM ${TABLE_NAMES.events} ORDER BY project_id`
+ `SELECT distinct project_id FROM ${TABLE_NAMES.events} ORDER BY project_id`,
);
const withOrigin = [];
@@ -10,10 +10,10 @@ async function main() {
try {
const [eventWithOrigin, eventWithoutOrigin] = await Promise.all([
await chQuery(
- `SELECT * FROM ${TABLE_NAMES.events} WHERE origin != '' AND project_id = '${project.project_id}' ORDER BY created_at DESC LIMIT 1`
+ `SELECT * FROM ${TABLE_NAMES.events} WHERE origin != '' AND project_id = '${project.project_id}' ORDER BY created_at DESC LIMIT 1`,
),
await chQuery(
- `SELECT * FROM ${TABLE_NAMES.events} WHERE origin = '' AND project_id = '${project.project_id}' AND path != '' ORDER BY created_at DESC LIMIT 1`
+ `SELECT * FROM ${TABLE_NAMES.events} WHERE origin = '' AND project_id = '${project.project_id}' AND path != '' ORDER BY created_at DESC LIMIT 1`,
),
]);
@@ -22,7 +22,7 @@ async function main() {
console.log(`- Origin: ${eventWithOrigin[0].origin}`);
withOrigin.push(project.project_id);
const events = await chQuery(
- `SELECT count(*) as count FROM ${TABLE_NAMES.events} WHERE project_id = '${project.project_id}' AND path != '' AND origin = ''`
+ `SELECT count(*) as count FROM ${TABLE_NAMES.events} WHERE project_id = '${project.project_id}' AND path != '' AND origin = ''`,
);
console.log(`🤠🤠🤠🤠 Will update ${events[0]?.count} events`);
await ch.command({
@@ -35,20 +35,20 @@ async function main() {
if (!eventWithOrigin[0] && eventWithoutOrigin[0]) {
console.log(
- `😧 Project ${project.project_id} has no events with origin (last event ${eventWithoutOrigin[0].created_at})`
+ `😧 Project ${project.project_id} has no events with origin (last event ${eventWithoutOrigin[0].created_at})`,
);
console.log('- NO ORIGIN');
}
if (!eventWithOrigin[0] && !eventWithoutOrigin[0]) {
console.log(
- `🔥 WARNING: Project ${project.project_id} has no events at all?!?!?!`
+ `🔥 WARNING: Project ${project.project_id} has no events at all?!?!?!`,
);
}
if (eventWithOrigin[0] && !eventWithoutOrigin[0]) {
console.log(
- `✅ Project ${project.project_id} has all events with origin!!!`
+ `✅ Project ${project.project_id} has all events with origin!!!`,
);
}
console.log('');
diff --git a/apps/api/src/controllers/event.controller.ts b/apps/api/src/controllers/event.controller.ts
index 24e9ef11e..9cd851519 100644
--- a/apps/api/src/controllers/event.controller.ts
+++ b/apps/api/src/controllers/event.controller.ts
@@ -1,7 +1,7 @@
import { getClientIp, parseIp } from '@/utils/parseIp';
import type { FastifyReply, FastifyRequest } from 'fastify';
-import { generateDeviceId } from '@openpanel/common';
+import { generateDeviceId } from '@openpanel/common/server';
import { getSalts } from '@openpanel/db';
import { eventsQueue } from '@openpanel/queue';
import { getRedisCache } from '@openpanel/redis';
@@ -13,7 +13,7 @@ export async function postEvent(
request: FastifyRequest<{
Body: PostEventPayload;
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const ip = getClientIp(request)!;
const ua = request.headers['user-agent']!;
@@ -44,7 +44,7 @@ export async function postEvent(
'locked',
'EX',
10,
- 'NX'
+ 'NX',
);
eventsQueue.add('event', {
diff --git a/apps/api/src/controllers/export.controller.ts b/apps/api/src/controllers/export.controller.ts
index 4d2978297..63cd631e5 100644
--- a/apps/api/src/controllers/export.controller.ts
+++ b/apps/api/src/controllers/export.controller.ts
@@ -19,7 +19,7 @@ async function getProjectId(
projectId?: string;
};
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
let projectId = request.query.projectId || request.query.project_id;
@@ -77,7 +77,7 @@ const eventsScheme = z.object({
includes: z
.preprocess(
(arg) => (typeof arg === 'string' ? [arg] : arg),
- z.array(z.string())
+ z.array(z.string()),
)
.optional(),
});
@@ -86,7 +86,7 @@ export async function events(
request: FastifyRequest<{
Querystring: z.infer<typeof eventsScheme>;
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const query = eventsScheme.safeParse(request.query);
@@ -118,7 +118,7 @@ export async function events(
meta: false,
...query.data.includes?.reduce(
(acc, key) => ({ ...acc, [key]: true }),
- {}
+ {},
),
},
};
@@ -154,7 +154,7 @@ export async function charts(
request: FastifyRequest<{
Querystring: Record<string, string>;
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const query = chartSchemeFull.safeParse(parseQueryString(request.query));
diff --git a/apps/api/src/controllers/import.controller.ts b/apps/api/src/controllers/import.controller.ts
index 5584ec6ef..355db7520 100644
--- a/apps/api/src/controllers/import.controller.ts
+++ b/apps/api/src/controllers/import.controller.ts
@@ -2,13 +2,13 @@ import type { FastifyReply, FastifyRequest } from 'fastify';
import { toDots } from '@openpanel/common';
import type { IClickhouseEvent } from '@openpanel/db';
-import { ch, formatClickhouseDate, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, ch, formatClickhouseDate } from '@openpanel/db';
export async function importEvents(
request: FastifyRequest<{
Body: IClickhouseEvent[];
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const importedAt = formatClickhouseDate(new Date());
const values: IClickhouseEvent[] = request.body.map((event) => {
diff --git a/apps/api/src/controllers/live.controller.ts b/apps/api/src/controllers/live.controller.ts
index 9a08cc01c..9bc1645ba 100644
--- a/apps/api/src/controllers/live.controller.ts
+++ b/apps/api/src/controllers/live.controller.ts
@@ -6,11 +6,11 @@ import type * as WebSocket from 'ws';
import { getSuperJson } from '@openpanel/common';
import type { IServiceEvent } from '@openpanel/db';
import {
+ TABLE_NAMES,
getEvents,
getLiveVisitors,
getProfileById,
getProfileByIdCached,
- TABLE_NAMES,
transformMinimalEvent,
} from '@openpanel/db';
import { getRedisCache, getRedisPub, getRedisSub } from '@openpanel/redis';
@@ -26,10 +26,10 @@ export async function testVisitors(
projectId: string;
};
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const events = await getEvents(
- `SELECT * FROM ${TABLE_NAMES.events} LIMIT 500`
+ `SELECT * FROM ${TABLE_NAMES.events} LIMIT 500`,
);
const event = events[Math.floor(Math.random() * events.length)];
if (!event) {
@@ -41,7 +41,7 @@ export async function testVisitors(
`live:event:${event.projectId}:${Math.random() * 1000}`,
'',
'EX',
- 10
+ 10,
);
reply.status(202).send(event);
}
@@ -52,10 +52,10 @@ export async function testEvents(
projectId: string;
};
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const events = await getEvents(
- `SELECT * FROM ${TABLE_NAMES.events} LIMIT 500`
+ `SELECT * FROM ${TABLE_NAMES.events} LIMIT 500`,
);
const event = events[Math.floor(Math.random() * events.length)];
if (!event) {
@@ -73,7 +73,7 @@ export function wsVisitors(
Params: {
projectId: string;
};
- }>
+ }>,
) {
const { params } = req;
@@ -122,7 +122,7 @@ export async function wsProjectEvents(
token?: string;
type?: string;
};
- }>
+ }>,
) {
const { params, query } = req;
const { token } = query;
@@ -147,7 +147,7 @@ export async function wsProjectEvents(
if (event?.projectId === params.projectId) {
const profile = await getProfileByIdCached(
event.profileId,
- event.projectId
+ event.projectId,
);
connection.socket.send(
superjson.stringify(
@@ -156,8 +156,8 @@ export async function wsProjectEvents(
...event,
profile,
}
- : transformMinimalEvent(event)
- )
+ : transformMinimalEvent(event),
+ ),
);
}
};
diff --git a/apps/api/src/controllers/misc.controller.ts b/apps/api/src/controllers/misc.controller.ts
index cac315590..dbe7c4794 100644
--- a/apps/api/src/controllers/misc.controller.ts
+++ b/apps/api/src/controllers/misc.controller.ts
@@ -4,8 +4,8 @@ import type { FastifyReply, FastifyRequest } from 'fastify';
import icoToPng from 'ico-to-png';
import sharp from 'sharp';
-import { createHash } from '@openpanel/common';
-import { ch, formatClickhouseDate, TABLE_NAMES } from '@openpanel/db';
+import { createHash } from '@openpanel/common/server';
+import { TABLE_NAMES, ch, formatClickhouseDate } from '@openpanel/db';
import { getRedisCache } from '@openpanel/redis';
interface GetFaviconParams {
@@ -38,7 +38,7 @@ async function getImageBuffer(url: string) {
.png()
.toBuffer();
} catch (error) {
- logger.error(`Failed to get image from url`, {
+ logger.error('Failed to get image from url', {
error,
url,
});
@@ -51,7 +51,7 @@ export async function getFavicon(
request: FastifyRequest<{
Querystring: GetFaviconParams;
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
function sendBuffer(buffer: Buffer, cacheKey?: string) {
if (cacheKey) {
@@ -95,7 +95,7 @@ export async function getFavicon(
}
const buffer = await getImageBuffer(
- 'https://www.iconsdb.com/icons/download/orange/warning-128.png'
+ 'https://www.iconsdb.com/icons/download/orange/warning-128.png',
);
if (buffer && buffer.byteLength > 0) {
return sendBuffer(buffer, hostname);
@@ -106,7 +106,7 @@ export async function getFavicon(
export async function clearFavicons(
request: FastifyRequest,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const keys = await getRedisCache().keys('favicon:*');
for (const key of keys) {
@@ -122,7 +122,7 @@ export async function ping(
count: number;
};
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
try {
await ch.insert({
@@ -137,7 +137,7 @@ export async function ping(
format: 'JSONEachRow',
});
reply.status(200).send({
- message: `Success`,
+ message: 'Success',
count: request.body.count,
domain: request.body.domain,
});
diff --git a/apps/api/src/controllers/profile.controller.ts b/apps/api/src/controllers/profile.controller.ts
index dd7eadcbc..d1f5628d2 100644
--- a/apps/api/src/controllers/profile.controller.ts
+++ b/apps/api/src/controllers/profile.controller.ts
@@ -13,7 +13,7 @@ export async function updateProfile(
request: FastifyRequest<{
Body: UpdateProfilePayload;
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const { profileId, properties, ...rest } = request.body;
const projectId = request.projectId;
@@ -41,7 +41,7 @@ export async function incrementProfileProperty(
request: FastifyRequest<{
Body: IncrementProfilePayload;
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const { profileId, property, value } = request.body;
const projectId = request.projectId;
@@ -51,19 +51,19 @@ export async function incrementProfileProperty(
return reply.status(404).send('Not found');
}
- const parsed = parseInt(
+ const parsed = Number.parseInt(
pathOr<string>('0', property.split('.'), profile.properties),
- 10
+ 10,
);
- if (isNaN(parsed)) {
+ if (Number.isNaN(parsed)) {
return reply.status(400).send('Not number');
}
profile.properties = assocPath(
property.split('.'),
parsed + value,
- profile.properties
+ profile.properties,
);
await upsertProfile({
@@ -80,7 +80,7 @@ export async function decrementProfileProperty(
request: FastifyRequest<{
Body: IncrementProfilePayload;
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const { profileId, property, value } = request.body;
const projectId = request.projectId;
@@ -90,19 +90,19 @@ export async function decrementProfileProperty(
return reply.status(404).send('Not found');
}
- const parsed = parseInt(
+ const parsed = Number.parseInt(
pathOr<string>('0', property.split('.'), profile.properties),
- 10
+ 10,
);
- if (isNaN(parsed)) {
+ if (Number.isNaN(parsed)) {
return reply.status(400).send('Not number');
}
profile.properties = assocPath(
property.split('.'),
parsed - value,
- profile.properties
+ profile.properties,
);
await upsertProfile({
diff --git a/apps/api/src/controllers/track.controller.ts b/apps/api/src/controllers/track.controller.ts
index e9d55c1d6..32b651bd0 100644
--- a/apps/api/src/controllers/track.controller.ts
+++ b/apps/api/src/controllers/track.controller.ts
@@ -2,9 +2,9 @@ import type { GeoLocation } from '@/utils/parseIp';
import { getClientIp, parseIp } from '@/utils/parseIp';
import { parseUserAgent } from '@/utils/parseUserAgent';
import type { FastifyReply, FastifyRequest } from 'fastify';
-import { assocPath, path, pathOr, pick } from 'ramda';
+import { path, assocPath, pathOr, pick } from 'ramda';
-import { generateDeviceId } from '@openpanel/common';
+import { generateDeviceId } from '@openpanel/common/server';
import {
createProfileAlias,
getProfileById,
@@ -31,21 +31,21 @@ export function getStringHeaders(headers: FastifyRequest['headers']) {
'openpanel-sdk-version',
'openpanel-client-id',
],
- headers
- )
+ headers,
+ ),
).reduce(
(acc, [key, value]) => ({
...acc,
[key]: value ? String(value) : undefined,
}),
- {}
+ {},
);
}
function getIdentity(body: TrackHandlerPayload): IdentifyPayload | undefined {
const identity = path<IdentifyPayload>(
['properties', '__identify'],
- body.payload
+ body.payload,
);
return (
@@ -62,7 +62,7 @@ export async function handler(
request: FastifyRequest<{
Body: TrackHandlerPayload;
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const ip =
path<string>(['properties', '__ip'], request.body.payload) ||
@@ -129,7 +129,7 @@ export async function handler(
projectId,
geo,
ua,
- })
+ }),
);
}
@@ -196,7 +196,7 @@ async function track({
'locked',
'EX',
10,
- 'NX'
+ 'NX',
);
eventsQueue.add('event', {
@@ -269,19 +269,19 @@ async function increment({
throw new Error('Not found');
}
- const parsed = parseInt(
+ const parsed = Number.parseInt(
pathOr<string>('0', property.split('.'), profile.properties),
- 10
+ 10,
);
- if (isNaN(parsed)) {
+ if (Number.isNaN(parsed)) {
throw new Error('Not number');
}
profile.properties = assocPath(
property.split('.'),
parsed + (value || 1),
- profile.properties
+ profile.properties,
);
await upsertProfile({
@@ -305,19 +305,19 @@ async function decrement({
throw new Error('Not found');
}
- const parsed = parseInt(
+ const parsed = Number.parseInt(
pathOr<string>('0', property.split('.'), profile.properties),
- 10
+ 10,
);
- if (isNaN(parsed)) {
+ if (Number.isNaN(parsed)) {
throw new Error('Not number');
}
profile.properties = assocPath(
property.split('.'),
parsed - (value || 1),
- profile.properties
+ profile.properties,
);
await upsertProfile({
diff --git a/apps/api/src/controllers/webhook.controller.ts b/apps/api/src/controllers/webhook.controller.ts
index 2326e30bb..2eea13380 100644
--- a/apps/api/src/controllers/webhook.controller.ts
+++ b/apps/api/src/controllers/webhook.controller.ts
@@ -33,7 +33,7 @@ export async function clerkWebhook(
request: FastifyRequest<{
Body: WebhookEvent;
}>,
- reply: FastifyReply
+ reply: FastifyReply,
) {
const payload = request.body;
const verified = verify(payload, request.headers);
@@ -49,7 +49,7 @@ export async function clerkWebhook(
if (!email) {
return Response.json(
{ message: 'No email address found' },
- { status: 400 }
+ { status: 400 },
);
}
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 6d9b31441..e3ce868ce 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -1,4 +1,4 @@
-import zlib from 'zlib';
+import zlib from 'node:zlib';
import { clerkPlugin } from '@clerk/fastify';
import compress from '@fastify/compress';
import cookie from '@fastify/cookie';
@@ -11,7 +11,7 @@ import metricsPlugin from 'fastify-metrics';
import { path } from 'ramda';
import { generateId, round } from '@openpanel/common';
-import { chQuery, db, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, chQuery, db } from '@openpanel/db';
import type { IServiceClient } from '@openpanel/db';
import { eventsQueue } from '@openpanel/queue';
import { getRedisCache, getRedisPub } from '@openpanel/redis';
@@ -48,7 +48,7 @@ async function withTimings<T>(promise: Promise<T>) {
}
}
-const port = parseInt(process.env.API_PORT || '3000', 10);
+const port = Number.parseInt(process.env.API_PORT || '3000', 10);
const startServer = async () => {
logger.info('Starting server');
@@ -65,7 +65,7 @@ const startServer = async () => {
});
const getTrpcInput = (
- request: FastifyRequest
+ request: FastifyRequest,
): Record<string, unknown> | undefined => {
const input = path(['query', 'input'], request);
try {
@@ -125,14 +125,14 @@ const startServer = async () => {
fastify.addContentTypeParser(
'application/json',
{ parseAs: 'buffer' },
- function (req, body, done) {
+ (req, body, done) => {
const isGzipped = req.headers['content-encoding'] === 'gzip';
if (isGzipped) {
zlib.gunzip(body, (err, decompressedBody) => {
console.log(
'decompressedBody',
- decompressedBody.toString().slice(0, 100)
+ decompressedBody.toString().slice(0, 100),
);
if (err) {
done(err);
@@ -153,7 +153,7 @@ const startServer = async () => {
done(new Error('Invalid JSON'));
}
}
- }
+ },
);
await fastify.register(metricsPlugin, { endpoint: '/metrics' });
@@ -211,7 +211,7 @@ const startServer = async () => {
const dbRes = await withTimings(db.project.findFirst());
const queueRes = await withTimings(eventsQueue.getCompleted());
const chRes = await withTimings(
- chQuery(`SELECT * FROM ${TABLE_NAMES.events} LIMIT 1`)
+ chQuery(`SELECT * FROM ${TABLE_NAMES.events} LIMIT 1`),
);
const status = redisRes && dbRes && queueRes && chRes ? 200 : 500;
diff --git a/apps/api/src/routes/event.router.ts b/apps/api/src/routes/event.router.ts
index eda616b29..914ae504d 100644
--- a/apps/api/src/routes/event.router.ts
+++ b/apps/api/src/routes/event.router.ts
@@ -14,7 +14,7 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
req: FastifyRequest<{
Body: PostEventPayload;
}>,
- reply
+ reply,
) => {
try {
const client = await validateSdkRequest(req.headers).catch((error) => {
@@ -51,7 +51,7 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
reply.status(401).send();
return;
}
- }
+ },
);
fastify.route({
diff --git a/apps/api/src/routes/export.router.ts b/apps/api/src/routes/export.router.ts
index f1f61d72d..edc7882ce 100644
--- a/apps/api/src/routes/export.router.ts
+++ b/apps/api/src/routes/export.router.ts
@@ -15,11 +15,14 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
error: 'Unauthorized',
message: 'Client ID seems to be malformed',
});
- } else if (e instanceof Error) {
+ }
+
+ if (e instanceof Error) {
return reply
.status(401)
.send({ error: 'Unauthorized', message: e.message });
}
+
return reply
.status(401)
.send({ error: 'Unauthorized', message: 'Unexpected error' });
diff --git a/apps/api/src/routes/import.router.ts b/apps/api/src/routes/import.router.ts
index e993a591b..0dab535b9 100644
--- a/apps/api/src/routes/import.router.ts
+++ b/apps/api/src/routes/import.router.ts
@@ -15,11 +15,14 @@ const importRouter: FastifyPluginCallback = (fastify, opts, done) => {
error: 'Unauthorized',
message: 'Client ID seems to be malformed',
});
- } else if (e instanceof Error) {
+ }
+
+ if (e instanceof Error) {
return reply
.status(401)
.send({ error: 'Unauthorized', message: e.message });
}
+
return reply
.status(401)
.send({ error: 'Unauthorized', message: 'Unexpected error' });
diff --git a/apps/api/src/routes/live.router.ts b/apps/api/src/routes/live.router.ts
index b836af43c..ba71b301d 100644
--- a/apps/api/src/routes/live.router.ts
+++ b/apps/api/src/routes/live.router.ts
@@ -20,12 +20,12 @@ const liveRouter: FastifyPluginCallback = (fastify, opts, done) => {
fastify.get(
'/visitors/:projectId',
{ websocket: true },
- controller.wsVisitors
+ controller.wsVisitors,
);
fastify.get(
'/events/:projectId',
{ websocket: true },
- controller.wsProjectEvents
+ controller.wsProjectEvents,
);
done();
});
diff --git a/apps/api/src/routes/track.router.ts b/apps/api/src/routes/track.router.ts
index b5b43e9ce..c8ce3fe1f 100644
--- a/apps/api/src/routes/track.router.ts
+++ b/apps/api/src/routes/track.router.ts
@@ -14,7 +14,7 @@ const trackRouter: FastifyPluginCallback = (fastify, opts, done) => {
req: FastifyRequest<{
Body: TrackHandlerPayload;
}>,
- reply
+ reply,
) => {
try {
const client = await validateSdkRequest(req.headers).catch((error) => {
@@ -55,7 +55,7 @@ const trackRouter: FastifyPluginCallback = (fastify, opts, done) => {
reply.status(401).send();
return;
}
- }
+ },
);
fastify.route({
diff --git a/apps/api/src/utils/auth.ts b/apps/api/src/utils/auth.ts
index aaabd663f..7f5c3b90a 100644
--- a/apps/api/src/utils/auth.ts
+++ b/apps/api/src/utils/auth.ts
@@ -1,7 +1,7 @@
import type { RawRequestDefaultExpression } from 'fastify';
import jwt from 'jsonwebtoken';
-import { verifyPassword } from '@openpanel/common';
+import { verifyPassword } from '@openpanel/common/server';
import type { Client, IServiceClient } from '@openpanel/db';
import { ClientType, db } from '@openpanel/db';
@@ -24,7 +24,7 @@ export class SdkAuthError extends Error {
clientId?: string;
clientSecret?: string;
origin?: string;
- }
+ },
) {
super(message);
this.name = 'SdkAuthError';
@@ -33,7 +33,7 @@ export class SdkAuthError extends Error {
}
export async function validateSdkRequest(
- headers: RawRequestDefaultExpression['headers']
+ headers: RawRequestDefaultExpression['headers'],
): Promise<Client> {
const clientIdNew = headers['openpanel-client-id'] as string;
const clientIdOld = headers['mixan-client-id'] as string;
@@ -48,7 +48,7 @@ export async function validateSdkRequest(
clientId,
clientSecret:
typeof clientSecret === 'string'
- ? clientSecret.slice(0, 5) + '...' + clientSecret.slice(-5)
+ ? `${clientSecret.slice(0, 5)}...${clientSecret.slice(-5)}`
: 'none',
origin,
});
@@ -99,7 +99,7 @@ export async function validateSdkRequest(
}
export async function validateExportRequest(
- headers: RawRequestDefaultExpression['headers']
+ headers: RawRequestDefaultExpression['headers'],
): Promise<IServiceClient> {
const clientId = headers['openpanel-client-id'] as string;
const clientSecret = (headers['openpanel-client-secret'] as string) || '';
@@ -129,7 +129,7 @@ export async function validateExportRequest(
}
export async function validateImportRequest(
- headers: RawRequestDefaultExpression['headers']
+ headers: RawRequestDefaultExpression['headers'],
): Promise<IServiceClient> {
const clientId = headers['openpanel-client-id'] as string;
const clientSecret = (headers['openpanel-client-secret'] as string) || '';
@@ -165,7 +165,7 @@ export function validateClerkJwt(token?: string) {
try {
const decoded = jwt.verify(
token,
- process.env.CLERK_PUBLIC_PEM_KEY!.replace(/\\n/g, '\n')
+ process.env.CLERK_PUBLIC_PEM_KEY!.replace(/\\n/g, '\n'),
);
if (typeof decoded === 'object') {
diff --git a/apps/api/src/utils/parse-zod-query-string.ts b/apps/api/src/utils/parse-zod-query-string.ts
index f9b097ce4..c72683d3e 100644
--- a/apps/api/src/utils/parse-zod-query-string.ts
+++ b/apps/api/src/utils/parse-zod-query-string.ts
@@ -4,8 +4,11 @@ export const parseQueryString = (obj: Record<string, any>): any => {
return Object.fromEntries(
Object.entries(obj).map(([k, v]) => {
if (typeof v === 'object') return [k, parseQueryString(v)];
- if (/^-?[0-9]+(\.[0-9]+)?$/i.test(v) && !isNaN(parseFloat(v)))
- return [k, parseFloat(v)];
+ if (
+ /^-?[0-9]+(\.[0-9]+)?$/i.test(v) &&
+ !Number.isNaN(Number.parseFloat(v))
+ )
+ return [k, Number.parseFloat(v)];
if (v === 'true') return [k, true];
if (v === 'false') return [k, false];
if (typeof v === 'string') {
@@ -15,6 +18,6 @@ export const parseQueryString = (obj: Record<string, any>): any => {
return [k, v];
}
return [k, null];
- })
+ }),
);
};
diff --git a/apps/api/src/utils/parseUrlMeta.ts b/apps/api/src/utils/parseUrlMeta.ts
index 670c3cbc5..cda031a04 100644
--- a/apps/api/src/utils/parseUrlMeta.ts
+++ b/apps/api/src/utils/parseUrlMeta.ts
@@ -9,7 +9,7 @@ function findBestFavicon(favicons: UrlMetaData['favicons']) {
(favicon) =>
favicon.rel === 'shortcut icon' ||
favicon.rel === 'icon' ||
- favicon.rel === 'apple-touch-icon'
+ favicon.rel === 'apple-touch-icon',
);
if (match) {
diff --git a/apps/api/src/utils/parseUserAgent.ts b/apps/api/src/utils/parseUserAgent.ts
index af469ee7d..b7e8666d3 100644
--- a/apps/api/src/utils/parseUserAgent.ts
+++ b/apps/api/src/utils/parseUserAgent.ts
@@ -71,7 +71,7 @@ const userAgentServerList = [
function isServer(userAgent: string) {
const match = userAgentServerList.some((server) =>
- userAgent.toLowerCase().includes(server.toLowerCase())
+ userAgent.toLowerCase().includes(server.toLowerCase()),
);
if (match) {
return true;
@@ -83,15 +83,15 @@ function isServer(userAgent: string) {
export function getDevice(ua: string) {
const mobile1 =
/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(
- ua
+ ua,
);
const mobile2 =
/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(
- ua.slice(0, 4)
+ ua.slice(0, 4),
);
const tablet =
/tablet|ipad|android(?!.*mobile)|xoom|sch-i800|kindle|silk|playbook/i.test(
- ua
+ ua,
);
if (mobile1 || mobile2) {
diff --git a/apps/dashboard/.gitignore b/apps/dashboard/.gitignore
index 2971a0bd6..04424e485 100644
--- a/apps/dashboard/.gitignore
+++ b/apps/dashboard/.gitignore
@@ -26,9 +26,6 @@ next-env.d.ts
# debug
npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-.pnpm-debug.log*
# local env files
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
diff --git a/apps/dashboard/Dockerfile b/apps/dashboard/Dockerfile
index 089a74807..db079e549 100644
--- a/apps/dashboard/Dockerfile
+++ b/apps/dashboard/Dockerfile
@@ -37,7 +37,6 @@ COPY packages/common/package.json packages/common/package.json
COPY packages/constants/package.json packages/constants/package.json
COPY packages/validation/package.json packages/validation/package.json
COPY packages/sdks/sdk/package.json packages/sdks/sdk/package.json
-COPY patches patches
# BUILD
FROM base AS build
diff --git a/apps/dashboard/next.config.mjs b/apps/dashboard/next.config.mjs
index a3b94d9a1..7f83a9dad 100644
--- a/apps/dashboard/next.config.mjs
+++ b/apps/dashboard/next.config.mjs
@@ -30,7 +30,11 @@ const config = {
typescript: { ignoreBuildErrors: true },
experimental: {
// Avoid "Critical dependency: the request of a dependency is an expression"
- serverComponentsExternalPackages: ['bullmq', 'ioredis'],
+ serverComponentsExternalPackages: [
+ 'bullmq',
+ 'ioredis',
+ '@hyperdx/node-opentelemetry',
+ ],
instrumentationHook: !!process.env.ENABLE_INSTRUMENTATION_HOOK,
},
/**
diff --git a/apps/dashboard/package.json b/apps/dashboard/package.json
index d2bf9f7e1..3c37d3b0f 100644
--- a/apps/dashboard/package.json
+++ b/apps/dashboard/package.json
@@ -7,8 +7,6 @@
"testing": "pnpm dev",
"build": "pnpm with-env next build",
"start": "next start",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{tsx,mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env -c --"
},
@@ -76,7 +74,7 @@
"lucide-react": "^0.331.0",
"mathjs": "^12.3.2",
"mitt": "^3.0.1",
- "next": "~14.2.1",
+ "next": "14.2.1",
"next-auth": "^4.24.5",
"next-themes": "^0.2.1",
"nextjs-toploader": "^1.6.11",
@@ -112,8 +110,6 @@
"zod": "^3.22.4"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/trpc": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/bcrypt": "^5.0.2",
@@ -127,26 +123,9 @@
"@types/react-simple-maps": "^3.0.4",
"@types/react-syntax-highlighter": "^15.5.11",
"@types/sqlstring": "^2.3.2",
- "@typescript-eslint/eslint-plugin": "^6.21.0",
- "@typescript-eslint/parser": "^6.21.0",
"autoprefixer": "^10.4.17",
- "eslint": "^8.56.0",
"postcss": "^8.4.35",
- "prettier": "^3.2.5",
- "prettier-plugin-tailwindcss": "^0.5.11",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
- },
- "ct3aMetadata": {
- "initVersion": "7.21.0"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base",
- "@openpanel/eslint-config/react",
- "@openpanel/eslint-config/nextjs"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/dashboards/[dashboardId]/list-reports.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/dashboards/[dashboardId]/list-reports.tsx
index ab2b40e79..63404d52b 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/dashboards/[dashboardId]/list-reports.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/dashboards/[dashboardId]/list-reports.tsx
@@ -30,7 +30,7 @@ import {
getDefaultIntervalByRange,
timeWindows,
} from '@openpanel/constants';
-import type { getReportsByDashboardId, IServiceDashboard } from '@openpanel/db';
+import type { IServiceDashboard, getReportsByDashboardId } from '@openpanel/db';
import { OverviewReportRange } from '../../overview-sticky-header';
@@ -64,7 +64,7 @@ export function ListReports({ reports, dashboard }: ListReportsProps) {
params.projectId
}/reports?${new URLSearchParams({
dashboardId: params.dashboardId,
- }).toString()}`
+ }).toString()}`,
);
}}
>
@@ -163,7 +163,7 @@ export function ListReports({ reports, dashboard }: ListReportsProps) {
params.projectId
}/reports?${new URLSearchParams({
dashboardId: params.dashboardId,
- }).toString()}`
+ }).toString()}`,
)
}
className="mt-14"
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/dashboards/list-dashboards/list-dashboards.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/dashboards/list-dashboards/list-dashboards.tsx
index c9d045036..3bf9dbd45 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/dashboards/list-dashboards/list-dashboards.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/dashboards/list-dashboards/list-dashboards.tsx
@@ -79,7 +79,7 @@ export function ListDashboards({ dashboards }: ListDashboardsProps) {
{dashboards.map((item) => {
const visibleReports = item.reports.slice(
0,
- item.reports.length > 6 ? 5 : 6
+ item.reports.length > 6 ? 5 : 6,
);
return (
<Card key={item.id} hover>
@@ -97,7 +97,7 @@ export function ListDashboards({ dashboards }: ListDashboardsProps) {
<div
className={cn(
'mt-4 grid gap-2',
- 'grid-cols-1 @sm:grid-cols-2'
+ 'grid-cols-1 @sm:grid-cols-2',
)}
>
{visibleReports.map((report) => {
@@ -145,6 +145,7 @@ export function ListDashboards({ dashboards }: ListDashboardsProps) {
<CardActions>
<CardActionsItem className="w-full" asChild>
<button
+ type="button"
onClick={() => {
pushModal('EditDashboard', item);
}}
@@ -155,6 +156,7 @@ export function ListDashboards({ dashboards }: ListDashboardsProps) {
</CardActionsItem>
<CardActionsItem className="w-full text-destructive" asChild>
<button
+ type="button"
onClick={() => {
deletion.mutate({
id: item.id,
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/conversions.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/conversions.tsx
index 67ac16e47..f5bd1096c 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/conversions.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/conversions.tsx
@@ -15,7 +15,7 @@ const Conversions = ({ projectId }: Props) => {
},
{
keepPreviousData: true,
- }
+ },
);
return <EventsTable query={query} />;
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/events.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/events.tsx
index 4285b6fb7..b3808b1ea 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/events.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/events.tsx
@@ -23,7 +23,7 @@ const Events = ({ projectId, profileId }: Props) => {
const [eventNames] = useEventQueryNamesFilter();
const [cursor, setCursor] = useQueryState(
'cursor',
- parseAsInteger.withDefault(0)
+ parseAsInteger.withDefault(0),
);
const query = api.event.events.useQuery(
{
@@ -36,7 +36,7 @@ const Events = ({ projectId, profileId }: Props) => {
},
{
keepPreviousData: true,
- }
+ },
);
return (
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/page.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/page.tsx
index 587691cc4..946d08f4a 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/page.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/events/page.tsx
@@ -27,16 +27,16 @@ export default function Page({
<Padding>
<div className="mb-4">
<PageTabs>
- <PageTabsLink href={`?tab=events`} isActive={tab === 'events'}>
+ <PageTabsLink href={'?tab=events'} isActive={tab === 'events'}>
Events
</PageTabsLink>
<PageTabsLink
- href={`?tab=conversions`}
+ href={'?tab=conversions'}
isActive={tab === 'conversions'}
>
Conversions
</PageTabsLink>
- <PageTabsLink href={`?tab=charts`} isActive={tab === 'charts'}>
+ <PageTabsLink href={'?tab=charts'} isActive={tab === 'charts'}>
Charts
</PageTabsLink>
</PageTabs>
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-menu.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-menu.tsx
index 9c631642a..ea6fbd96e 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-menu.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-menu.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useEffect } from 'react';
import { Button } from '@/components/ui/button';
import { useAppParams } from '@/hooks/useAppParams';
import { pushModal } from '@/modals';
@@ -19,6 +18,7 @@ import {
import type { LucideProps } from 'lucide-react';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
+import { useEffect } from 'react';
import type { IServiceDashboards } from '@openpanel/db';
@@ -42,7 +42,7 @@ function LinkWithIcon({
className={cn(
'text-text flex items-center gap-2 rounded-md px-3 py-2 font-medium transition-all hover:bg-def-200',
active && 'bg-def-200',
- className
+ className,
)}
href={href}
>
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-organization-selector.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-organization-selector.tsx
index 5d8a663fa..a440c9649 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-organization-selector.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-organization-selector.tsx
@@ -18,7 +18,7 @@ export default function LayoutOrganizationSelector({
const router = useRouter();
const organization = organizations.find(
- (item) => item.id === params.organizationSlug
+ (item) => item.id === params.organizationSlug,
);
return (
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-project-selector.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-project-selector.tsx
index b16559b95..e866a8f86 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-project-selector.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-project-selector.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useState } from 'react';
import { Button } from '@/components/ui/button';
import { Combobox } from '@/components/ui/combobox';
import {
@@ -24,6 +23,7 @@ import {
PlusIcon,
} from 'lucide-react';
import { usePathname, useRouter } from 'next/navigation';
+import { useState } from 'react';
import type {
getCurrentOrganizations,
@@ -50,7 +50,7 @@ export default function LayoutProjectSelector({
const split = pathname
.replace(
`/${organizationSlug}/${projectId}`,
- `/${organizationSlug}/${newProjectId}`
+ `/${organizationSlug}/${newProjectId}`,
)
.split('/');
// slicing here will remove everything after /{orgId}/{projectId}/dashboards [slice here] /xxx/xxx/xxx
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-sidebar.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-sidebar.tsx
index b2b1b80ae..c0d1f890d 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-sidebar.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-sidebar.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useEffect, useState } from 'react';
import { LogoSquare } from '@/components/logo';
import SettingsToggle from '@/components/settings-toggle';
import { Button } from '@/components/ui/button';
@@ -8,11 +7,12 @@ import { cn } from '@/utils/cn';
import { Rotate as Hamburger } from 'hamburger-react';
import { MenuIcon, XIcon } from 'lucide-react';
import { usePathname } from 'next/navigation';
+import { useEffect, useState } from 'react';
import type {
- getProjectsByOrganizationSlug,
IServiceDashboards,
IServiceOrganization,
+ getProjectsByOrganizationSlug,
} from '@openpanel/db';
import LayoutMenu from './layout-menu';
@@ -40,19 +40,20 @@ export function LayoutSidebar({
return (
<>
<button
+ type="button"
onClick={() => setActive(false)}
className={cn(
'fixed bottom-0 left-0 right-0 top-0 z-50 backdrop-blur-sm transition-opacity',
active
? 'pointer-events-auto opacity-100'
- : 'pointer-events-none opacity-0'
+ : 'pointer-events-none opacity-0',
)}
/>
<div
className={cn(
'fixed left-0 top-0 z-50 flex h-screen w-72 flex-col border-r border-border bg-card transition-transform',
'-translate-x-72 lg:-translate-x-0', // responsive
- active && 'translate-x-0' // force active on mobile
+ active && 'translate-x-0', // force active on mobile
)}
>
<div className="absolute -right-12 flex h-16 items-center lg:hidden">
@@ -77,7 +78,7 @@ export function LayoutSidebar({
<LayoutMenu dashboards={dashboards} />
</div>
<div className="fixed bottom-0 left-0 right-0">
- <div className="h-8 w-full bg-gradient-to-t from-card to-card/0"></div>
+ <div className="h-8 w-full bg-gradient-to-t from-card to-card/0" />
</div>
</div>
</>
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-sticky-below-header.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-sticky-below-header.tsx
index 41875e127..5c29c82d7 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-sticky-below-header.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/layout-sticky-below-header.tsx
@@ -13,7 +13,7 @@ export function StickyBelowHeader({
<div
className={cn(
'top-0 z-20 border-b border-border bg-card md:sticky',
- className
+ className,
)}
>
{children}
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/pages/pages-table.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/pages/pages-table.tsx
index 14013078d..08891283b 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/pages/pages-table.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/pages/pages-table.tsx
@@ -1,11 +1,11 @@
'use client';
-import { memo } from 'react';
import { ReportChart } from '@/components/report-chart';
import { useNumber } from '@/hooks/useNumerFormatter';
import { cn } from '@/utils/cn';
import isEqual from 'lodash.isequal';
import { ExternalLinkIcon } from 'lucide-react';
+import { memo } from 'react';
import type { IServicePage } from '@openpanel/db';
@@ -38,7 +38,7 @@ export const PagesTable = memo(
className={cn(
cell,
'center-center font-mono text-lg font-semibold',
- index === data.length - 1 && 'rounded-bl-md'
+ index === data.length - 1 && 'rounded-bl-md',
)}
>
{number.short(item.count)}
@@ -46,7 +46,7 @@ export const PagesTable = memo(
<div
className={cn(
cell,
- 'flex w-80 flex-col justify-center gap-2 text-left'
+ 'flex w-80 flex-col justify-center gap-2 text-left',
)}
>
<span className="truncate font-medium">{item.title}</span>
@@ -68,7 +68,7 @@ export const PagesTable = memo(
className={cn(
cell,
'p-1',
- index === data.length - 1 && 'rounded-br-md'
+ index === data.length - 1 && 'rounded-br-md',
)}
>
<ReportChart
@@ -122,7 +122,7 @@ export const PagesTable = memo(
},
(prevProps, nextProps) => {
return isEqual(prevProps.data, nextProps.data);
- }
+ },
);
PagesTable.displayName = 'PagesTable';
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/pages/pages.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/pages/pages.tsx
index 8145910d0..3494552e1 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/pages/pages.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/pages/pages.tsx
@@ -15,7 +15,7 @@ export function Pages({ projectId }: { projectId: string }) {
const take = 20;
const [cursor, setCursor] = useQueryState(
'cursor',
- parseAsInteger.withDefault(0)
+ parseAsInteger.withDefault(0),
);
const [search, setSearch] = useQueryState('search', {
defaultValue: '',
@@ -31,7 +31,7 @@ export function Pages({ projectId }: { projectId: string }) {
},
{
keepPreviousData: true,
- }
+ },
);
const data = query.data ?? [];
@@ -56,7 +56,7 @@ export function Pages({ projectId }: { projectId: string }) {
className="mt-2"
setCursor={setCursor}
cursor={cursor}
- count={Infinity}
+ count={Number.POSITIVE_INFINITY}
take={take}
loading={query.isFetching}
/>
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/most-events/index.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/most-events/index.tsx
index 8be37ccdc..7220cdae3 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/most-events/index.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/most-events/index.tsx
@@ -1,7 +1,7 @@
import withLoadingWidget from '@/hocs/with-loading-widget';
import { escape } from 'sqlstring';
-import { chQuery, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, chQuery } from '@openpanel/db';
import MostEvents from './most-events';
@@ -12,7 +12,7 @@ type Props = {
const MostEventsServer = async ({ projectId, profileId }: Props) => {
const data = await chQuery<{ count: number; name: string }>(
- `SELECT count(*) as count, name FROM ${TABLE_NAMES.events} WHERE name NOT IN ('screen_view', 'session_start', 'session_end') AND project_id = ${escape(projectId)} and profile_id = ${escape(profileId)} GROUP BY name ORDER BY count DESC`
+ `SELECT count(*) as count, name FROM ${TABLE_NAMES.events} WHERE name NOT IN ('screen_view', 'session_start', 'session_end') AND project_id = ${escape(projectId)} and profile_id = ${escape(profileId)} GROUP BY name ORDER BY count DESC`,
);
return <MostEvents data={data} />;
};
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/most-events/most-events.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/most-events/most-events.tsx
index eb9cd2e99..fa8db293b 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/most-events/most-events.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/most-events/most-events.tsx
@@ -22,7 +22,7 @@ const MostEvents = ({ data }: Props) => {
style={{
width: `${(item.count / max) * 100}%`,
}}
- ></div>
+ />
<div className="relative flex justify-between ">
<div>{item.name}</div>
<div>{item.count}</div>
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/popular-routes/index.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/popular-routes/index.tsx
index 66ea3fb44..c01eca227 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/popular-routes/index.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/popular-routes/index.tsx
@@ -1,7 +1,7 @@
import withLoadingWidget from '@/hocs/with-loading-widget';
import { escape } from 'sqlstring';
-import { chQuery, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, chQuery } from '@openpanel/db';
import PopularRoutes from './popular-routes';
@@ -12,7 +12,7 @@ type Props = {
const PopularRoutesServer = async ({ projectId, profileId }: Props) => {
const data = await chQuery<{ count: number; path: string }>(
- `SELECT count(*) as count, path FROM ${TABLE_NAMES.events} WHERE name = 'screen_view' AND project_id = ${escape(projectId)} and profile_id = ${escape(profileId)} GROUP BY path ORDER BY count DESC`
+ `SELECT count(*) as count, path FROM ${TABLE_NAMES.events} WHERE name = 'screen_view' AND project_id = ${escape(projectId)} and profile_id = ${escape(profileId)} GROUP BY path ORDER BY count DESC`,
);
return <PopularRoutes data={data} />;
};
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/popular-routes/popular-routes.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/popular-routes/popular-routes.tsx
index 687df3b59..e72e94e32 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/popular-routes/popular-routes.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/popular-routes/popular-routes.tsx
@@ -22,7 +22,7 @@ const PopularRoutes = ({ data }: Props) => {
style={{
width: `${(item.count / max) * 100}%`,
}}
- ></div>
+ />
<div className="relative flex justify-between ">
<div>{item.path}</div>
<div>{item.count}</div>
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-activity/index.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-activity/index.tsx
index 37784b7a2..61aa195f2 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-activity/index.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-activity/index.tsx
@@ -1,7 +1,7 @@
import withLoadingWidget from '@/hocs/with-loading-widget';
import { escape } from 'sqlstring';
-import { chQuery, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, chQuery } from '@openpanel/db';
import ProfileActivity from './profile-activity';
@@ -12,7 +12,7 @@ type Props = {
const ProfileActivityServer = async ({ projectId, profileId }: Props) => {
const data = await chQuery<{ count: number; date: string }>(
- `SELECT count(*) as count, toStartOfDay(created_at) as date FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(projectId)} and profile_id = ${escape(profileId)} GROUP BY date ORDER BY date DESC`
+ `SELECT count(*) as count, toStartOfDay(created_at) as date FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(projectId)} and profile_id = ${escape(profileId)} GROUP BY date ORDER BY date DESC`,
);
return <ProfileActivity data={data} />;
};
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-activity/profile-activity.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-activity/profile-activity.tsx
index 783fd31d4..d6949c81b 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-activity/profile-activity.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-activity/profile-activity.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useState } from 'react';
import { Button } from '@/components/ui/button';
import {
Widget,
@@ -20,6 +19,7 @@ import {
subMonths,
} from 'date-fns';
import { ActivityIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
+import { useState } from 'react';
type Props = {
data: { count: number; date: string }[];
@@ -64,17 +64,17 @@ const ProfileActivity = ({ data }: Props) => {
}).map((date) => {
const hit = data.find((item) =>
item.date.includes(
- formatISO(date, { representation: 'date' })
- )
+ formatISO(date, { representation: 'date' }),
+ ),
);
return (
<div
key={date.toISOString()}
className={cn(
'aspect-square w-full rounded',
- hit ? 'bg-highlight' : 'bg-def-200'
+ hit ? 'bg-highlight' : 'bg-def-200',
)}
- ></div>
+ />
);
})}
</div>
@@ -90,17 +90,17 @@ const ProfileActivity = ({ data }: Props) => {
}).map((date) => {
const hit = data.find((item) =>
item.date.includes(
- formatISO(date, { representation: 'date' })
- )
+ formatISO(date, { representation: 'date' }),
+ ),
);
return (
<div
key={date.toISOString()}
className={cn(
'aspect-square w-full rounded',
- hit ? 'bg-highlight' : 'bg-def-200'
+ hit ? 'bg-highlight' : 'bg-def-200',
)}
- ></div>
+ />
);
})}
</div>
@@ -116,17 +116,17 @@ const ProfileActivity = ({ data }: Props) => {
}).map((date) => {
const hit = data.find((item) =>
item.date.includes(
- formatISO(date, { representation: 'date' })
- )
+ formatISO(date, { representation: 'date' }),
+ ),
);
return (
<div
key={date.toISOString()}
className={cn(
'aspect-square w-full rounded',
- hit ? 'bg-highlight' : 'bg-def-200'
+ hit ? 'bg-highlight' : 'bg-def-200',
)}
- ></div>
+ />
);
})}
</div>
@@ -140,17 +140,17 @@ const ProfileActivity = ({ data }: Props) => {
}).map((date) => {
const hit = data.find((item) =>
item.date.includes(
- formatISO(date, { representation: 'date' })
- )
+ formatISO(date, { representation: 'date' }),
+ ),
);
return (
<div
key={date.toISOString()}
className={cn(
'aspect-square w-full rounded',
- hit ? 'bg-highlight' : 'bg-def-200'
+ hit ? 'bg-highlight' : 'bg-def-200',
)}
- ></div>
+ />
);
})}
</div>
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-charts.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-charts.tsx
index 214b4a8f6..3a36b814c 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-charts.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-charts.tsx
@@ -1,8 +1,8 @@
'use client';
-import { memo } from 'react';
import { ReportChart } from '@/components/report-chart';
import { Widget, WidgetBody, WidgetHead } from '@/components/widget';
+import { memo } from 'react';
import type { IChartProps } from '@openpanel/validation';
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-events.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-events.tsx
index e65e78e37..587430ec0 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-events.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-events.tsx
@@ -24,7 +24,7 @@ const Events = ({ projectId, profileId }: Props) => {
const [eventNames] = useEventQueryNamesFilter();
const [cursor, setCursor] = useQueryState(
'cursor',
- parseAsInteger.withDefault(0)
+ parseAsInteger.withDefault(0),
);
const query = api.event.events.useQuery(
{
@@ -37,7 +37,7 @@ const Events = ({ projectId, profileId }: Props) => {
},
{
keepPreviousData: true,
- }
+ },
);
return (
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-metrics/profile-metrics.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-metrics/profile-metrics.tsx
index ebe076734..293326bb3 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-metrics/profile-metrics.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/profile-metrics/profile-metrics.tsx
@@ -35,7 +35,7 @@ function Info({ title, value }: { title: string; value: string }) {
const ProfileMetrics = ({ data, profile }: Props) => {
const [tab, setTab] = useQueryState(
'tab',
- parseAsStringEnum(['profile', 'properties']).withDefault('profile')
+ parseAsStringEnum(['profile', 'properties']).withDefault('profile'),
);
const number = useNumber();
return (
@@ -44,24 +44,26 @@ const ProfileMetrics = ({ data, profile }: Props) => {
<div className="col-span-2 @xl:col-span-3 @4xl:col-span-6">
<div className="row border-b">
<button
+ type="button"
onClick={() => setTab('profile')}
className={cn(
'p-4',
'opacity-50',
tab === 'profile' &&
- 'border-b border-foreground text-foreground opacity-100'
+ 'border-b border-foreground text-foreground opacity-100',
)}
>
Profile
</button>
<div className="h-full w-px bg-border" />
<button
+ type="button"
onClick={() => setTab('properties')}
className={cn(
'p-4',
'opacity-50',
tab === 'properties' &&
- 'border-b border-foreground text-foreground opacity-100'
+ 'border-b border-foreground text-foreground opacity-100',
)}
>
Properties
@@ -81,15 +83,12 @@ const ProfileMetrics = ({ data, profile }: Props) => {
<ListPropertiesIcon {...profile.properties} />
</>
)}
- {tab === 'properties' && (
- <>
- {Object.entries(profile.properties)
- .filter(([key, value]) => value !== undefined)
- .map(([key, value]) => (
- <Info key={key} title={key} value={value as string} />
- ))}
- </>
- )}
+ {tab === 'properties' &&
+ Object.entries(profile.properties)
+ .filter(([key, value]) => value !== undefined)
+ .map(([key, value]) => (
+ <Info key={key} title={key} value={value as string} />
+ ))}
</div>
</div>
<Card
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/page.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/page.tsx
index 93a3a3f7e..c92fed472 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/page.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/page.tsx
@@ -26,11 +26,11 @@ export default function Page({
<Padding>
<div className="mb-4">
<PageTabs>
- <PageTabsLink href={`?tab=profiles`} isActive={tab === 'profiles'}>
+ <PageTabsLink href={'?tab=profiles'} isActive={tab === 'profiles'}>
Profiles
</PageTabsLink>
<PageTabsLink
- href={`?tab=power-users`}
+ href={'?tab=power-users'}
isActive={tab === 'power-users'}
>
Power users
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/power-users.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/power-users.tsx
index de026da14..e4da65ebe 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/power-users.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/power-users.tsx
@@ -12,7 +12,7 @@ type Props = {
const Events = ({ projectId }: Props) => {
const [cursor, setCursor] = useQueryState(
'cursor',
- parseAsInteger.withDefault(0)
+ parseAsInteger.withDefault(0),
);
const query = api.profile.powerUsers.useQuery(
{
@@ -23,7 +23,7 @@ const Events = ({ projectId }: Props) => {
},
{
keepPreviousData: true,
- }
+ },
);
return (
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/profile-last-seen/index.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/profile-last-seen/index.tsx
index 9fe959a29..2f74747f0 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/profile-last-seen/index.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/profile-last-seen/index.tsx
@@ -7,7 +7,7 @@ import { Widget, WidgetBody, WidgetHead } from '@/components/widget';
import { cn } from '@/utils/cn';
import { escape } from 'sqlstring';
-import { chQuery, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, chQuery } from '@openpanel/db';
interface Props {
projectId: string;
@@ -21,7 +21,7 @@ export default async function ProfileLastSeenServer({ projectId }: Props) {
// Days since last event from users
// group by days
const res = await chQuery<Row>(
- `SELECT age('days',created_at, now()) as days, count(distinct profile_id) as count FROM ${TABLE_NAMES.events} where project_id = ${escape(projectId)} group by days order by days ASC LIMIT 51`
+ `SELECT age('days',created_at, now()) as days, count(distinct profile_id) as count FROM ${TABLE_NAMES.events} where project_id = ${escape(projectId)} group by days order by days ASC LIMIT 51`,
);
const maxValue = Math.max(...res.map((x) => x.count));
@@ -29,7 +29,7 @@ export default async function ProfileLastSeenServer({ projectId }: Props) {
const calculateRatio = (currentValue: number) =>
Math.max(
0.1,
- Math.min(1, (currentValue - minValue) / (maxValue - minValue))
+ Math.min(1, (currentValue - minValue) / (maxValue - minValue)),
);
const renderItem = (item: Row) => (
@@ -41,7 +41,7 @@ export default async function ProfileLastSeenServer({ projectId }: Props) {
style={{
opacity: calculateRatio(item.count),
}}
- ></div>
+ />
</TooltipTrigger>
<TooltipContent>
{item.count} profiles last seen{' '}
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/profiles.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/profiles.tsx
index a50da9c62..e751ae264 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/profiles.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/profiles.tsx
@@ -15,7 +15,7 @@ type Props = {
const Events = ({ projectId }: Props) => {
const [cursor, setCursor] = useQueryState(
'cursor',
- parseAsInteger.withDefault(0)
+ parseAsInteger.withDefault(0),
);
const [search, setSearch] = useQueryState('search', {
defaultValue: '',
@@ -31,7 +31,7 @@ const Events = ({ projectId }: Props) => {
},
{
keepPreviousData: true,
- }
+ },
);
return (
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/coordinates.ts b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/coordinates.ts
index 24efd1362..7e430cae7 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/coordinates.ts
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/coordinates.ts
@@ -5,7 +5,7 @@ export type Coordinate = {
export function haversineDistance(
coord1: Coordinate,
- coord2: Coordinate
+ coord2: Coordinate,
): number {
const R = 6371; // Earth's radius in kilometers
const lat1Rad = coord1.lat * (Math.PI / 180);
@@ -25,7 +25,7 @@ export function haversineDistance(
}
export function findFarthestPoints(
- coordinates: Coordinate[]
+ coordinates: Coordinate[],
): [Coordinate, Coordinate] {
if (coordinates.length < 2) {
throw new Error('At least two coordinates are required');
@@ -80,12 +80,12 @@ function cross(o: Coordinate, a: Coordinate, b: Coordinate): number {
// convex hull
export function getOuterMarkers(coordinates: Coordinate[]): Coordinate[] {
- coordinates = coordinates.sort(sortCoordinates);
+ const sorted = coordinates.sort(sortCoordinates);
- if (coordinates.length <= 3) return coordinates;
+ if (sorted.length <= 3) return sorted;
const lower: Coordinate[] = [];
- for (const coord of coordinates) {
+ for (const coord of sorted) {
while (
lower.length >= 2 &&
cross(lower[lower.length - 2]!, lower[lower.length - 1]!, coord) <= 0
@@ -99,15 +99,11 @@ export function getOuterMarkers(coordinates: Coordinate[]): Coordinate[] {
for (let i = coordinates.length - 1; i >= 0; i--) {
while (
upper.length >= 2 &&
- cross(
- upper[upper.length - 2]!,
- upper[upper.length - 1]!,
- coordinates[i]!
- ) <= 0
+ cross(upper[upper.length - 2]!, upper[upper.length - 1]!, sorted[i]!) <= 0
) {
upper.pop();
}
- upper.push(coordinates[i]!);
+ upper.push(sorted[i]!);
}
upper.pop();
@@ -148,22 +144,22 @@ export function calculateCentroid(polygon: Coordinate[]): Coordinate {
}
export function calculateGeographicMidpoint(
- coordinate: Coordinate[]
+ coordinate: Coordinate[],
): Coordinate {
- let minLat = Infinity,
- maxLat = -Infinity,
- minLong = Infinity,
- maxLong = -Infinity;
+ let minLat = Number.POSITIVE_INFINITY;
+ let maxLat = Number.NEGATIVE_INFINITY;
+ let minLong = Number.POSITIVE_INFINITY;
+ let maxLong = Number.NEGATIVE_INFINITY;
- coordinate.forEach(({ lat, long }) => {
+ for (const { lat, long } of coordinate) {
if (lat < minLat) minLat = lat;
if (lat > maxLat) maxLat = lat;
if (long < minLong) minLong = long;
if (long > maxLong) maxLong = long;
- });
+ }
// Handling the wrap around the international date line
- let midLong;
+ let midLong: number;
if (maxLong > minLong) {
midLong = (maxLong + minLong) / 2;
} else {
@@ -211,7 +207,7 @@ export function clusterCoordinates(coordinates: Coordinate[], radius = 25) {
long: center.long + cur.long / cluster.members.length,
};
},
- { lat: 0, long: 0 }
+ { lat: 0, long: 0 },
);
clusters.push(cluster);
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/index.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/index.tsx
index a0f183fad..59700e8af 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/index.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/index.tsx
@@ -1,7 +1,7 @@
import { subMinutes } from 'date-fns';
import { escape } from 'sqlstring';
-import { chQuery, formatClickhouseDate, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, chQuery, formatClickhouseDate } from '@openpanel/db';
import type { Coordinate } from './coordinates';
import Map from './map';
@@ -11,7 +11,7 @@ type Props = {
};
const RealtimeMap = async ({ projectId }: Props) => {
const res = await chQuery<Coordinate>(
- `SELECT DISTINCT city, longitude as long, latitude as lat FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(projectId)} AND created_at >= '${formatClickhouseDate(subMinutes(new Date(), 30))}' ORDER BY created_at DESC`
+ `SELECT DISTINCT city, longitude as long, latitude as lat FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(projectId)} AND created_at >= '${formatClickhouseDate(subMinutes(new Date(), 30))}' ORDER BY created_at DESC`,
);
return <Map markers={res} />;
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.helpers.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.helpers.tsx
index fb688db3b..0ce40bbf1 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.helpers.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.helpers.tsx
@@ -49,7 +49,7 @@ export const getBoundingBox = (coordinates: Coordinate[]) => {
export const determineZoom = (
bbox: ReturnType<typeof getBoundingBox>,
- aspectRatio = 1.0
+ aspectRatio = 1.0,
): number => {
const latDiff = bbox.maxLat - bbox.minLat;
const longDiff = bbox.maxLong - bbox.minLong;
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.tsx
index da382e56c..5ba1a15bc 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.tsx
@@ -1,11 +1,11 @@
'use client';
-import { Fragment, useEffect, useRef, useState } from 'react';
import { useFullscreen } from '@/components/fullscreen-toggle';
import { Tooltiper } from '@/components/ui/tooltip';
import { cn } from '@/utils/cn';
import { bind } from 'bind-event-listener';
import { useTheme } from 'next-themes';
+import { Fragment, useEffect, useRef, useState } from 'react';
import {
ComposableMap,
Geographies,
@@ -22,8 +22,8 @@ import {
} from './coordinates';
import {
CustomZoomableGroup,
- determineZoom,
GEO_MAP_URL,
+ determineZoom,
getBoundingBox,
useAnimatedState,
} from './map.helpers';
@@ -37,7 +37,7 @@ const Map = ({ markers }: Props) => {
const showCenterMarker = false;
const ref = useRef<HTMLDivElement>(null);
const [size, setSize] = useState<{ width: number; height: number } | null>(
- null
+ null,
);
// const { markers, toggle } = useActiveMarkers(_m);
@@ -50,7 +50,7 @@ const Map = ({ markers }: Props) => {
const [zoom] = useAnimatedState(
markers.length === 1
? 20
- : determineZoom(boundingBox, size ? size?.height / size?.width : 1)
+ : determineZoom(boundingBox, size ? size?.height / size?.width : 1),
);
const [long] = useAnimatedState(center.long);
@@ -99,7 +99,7 @@ const Map = ({ markers }: Props) => {
<div
className={cn(
'fixed bottom-0 left-0 right-0 top-0',
- !isFullscreen && 'lg:left-72'
+ !isFullscreen && 'lg:left-72',
)}
ref={ref}
>
@@ -142,7 +142,7 @@ const Map = ({ markers }: Props) => {
)}
{clusterCoordinates(markers).map((marker) => {
const size = adjustSizeBasedOnZoom(
- calculateMarkerSize(marker.count)
+ calculateMarkerSize(marker.count),
);
const coordinates: [number, number] = [
marker.center.long,
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/markers.ts b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/markers.ts
index 453d63929..9513dd0df 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/markers.ts
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/markers.ts
@@ -11,7 +11,7 @@ const useActiveMarkers = (initialMarkers: Coordinate[]) => {
// Cut the array in half randomly to simulate changes in active markers
const selected = shuffled.slice(
0,
- Math.floor(Math.random() * shuffled.length) + 1
+ Math.floor(Math.random() * shuffled.length) + 1,
);
setActiveMarkers(selected);
}, [activeMarkers]);
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/page.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/page.tsx
index a20995f18..c190ad00b 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/page.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/page.tsx
@@ -1,10 +1,10 @@
-import { Suspense } from 'react';
import {
Fullscreen,
FullscreenClose,
FullscreenOpen,
} from '@/components/fullscreen-toggle';
import { ReportChart } from '@/components/report-chart';
+import { Suspense } from 'react';
import RealtimeMap from './map';
import RealtimeLiveEventsServer from './realtime-live-events';
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-events/index.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-events/index.tsx
index 9dce9fdb4..6fc9523fc 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-events/index.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-events/index.tsx
@@ -1,6 +1,6 @@
import { escape } from 'sqlstring';
-import { getEvents, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, getEvents } from '@openpanel/db';
import LiveEvents from './live-events';
@@ -13,7 +13,7 @@ const RealtimeLiveEventsServer = async ({ projectId, limit = 30 }: Props) => {
`SELECT * FROM ${TABLE_NAMES.events} WHERE created_at > now() - INTERVAL 2 HOUR AND project_id = ${escape(projectId)} ORDER BY created_at DESC LIMIT ${limit}`,
{
profile: true,
- }
+ },
);
return <LiveEvents events={events} projectId={projectId} limit={limit} />;
};
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-events/live-events.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-events/live-events.tsx
index b570748cf..75cc06e68 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-events/live-events.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-events/live-events.tsx
@@ -1,9 +1,9 @@
'use client';
-import { useState } from 'react';
import { EventListItem } from '@/components/events/event-list-item';
import useWS from '@/hooks/useWS';
import { AnimatePresence, motion } from 'framer-motion';
+import { useState } from 'react';
import type { IServiceEvent, IServiceEventMinimal } from '@openpanel/db';
@@ -19,7 +19,7 @@ const RealtimeLiveEvents = ({ events, projectId, limit }: Props) => {
`/live/events/${projectId}`,
(event) => {
setState((p) => [event, ...p].slice(0, limit));
- }
+ },
);
return (
<AnimatePresence mode="popLayout" initial={false}>
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-histogram.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-histogram.tsx
index a910673ad..17e64b2e3 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-histogram.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-live-histogram.tsx
@@ -71,18 +71,16 @@ export function RealtimeLiveHistogram({
const liveCount = countRes.data?.series[0]?.metrics?.sum ?? 0;
if (res.isInitialLoading || countRes.isInitialLoading || liveCount === 0) {
- // prettier-ignore
const staticArray = [
- 10, 25, 30, 45, 20, 5, 55, 18, 40, 12,
- 50, 35, 8, 22, 38, 42, 15, 28, 52, 5,
- 48, 14, 32, 58, 7, 19, 33, 56, 24, 5
+ 10, 25, 30, 45, 20, 5, 55, 18, 40, 12, 50, 35, 8, 22, 38, 42, 15, 28, 52,
+ 5, 48, 14, 32, 58, 7, 19, 33, 56, 24, 5,
];
return (
<Wrapper count={0}>
{staticArray.map((percent, i) => (
<div
- key={i}
+ key={i as number}
className="flex-1 animate-pulse rounded bg-def-200"
style={{ height: `${percent}%` }}
/>
@@ -104,7 +102,7 @@ export function RealtimeLiveHistogram({
<div
className={cn(
'flex-1 rounded transition-all ease-in-out hover:scale-110',
- minute.count === 0 ? 'bg-def-200' : 'bg-highlight'
+ minute.count === 0 ? 'bg-def-200' : 'bg-highlight',
)}
style={{
height:
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-reloader.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-reloader.tsx
index 27dbca2b4..858e2d772 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-reloader.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/realtime-reloader.tsx
@@ -27,7 +27,7 @@ const RealtimeReloader = ({ projectId }: Props) => {
maxWait: 15000,
delay: 15000,
},
- }
+ },
);
return null;
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/reports/report-editor.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/reports/report-editor.tsx
index 85ce15745..27adfbc9a 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/reports/report-editor.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/reports/report-editor.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useEffect } from 'react';
import { StickyBelowHeader } from '@/app/(app)/[organizationSlug]/[projectId]/layout-sticky-below-header';
import { ReportChart } from '@/components/report-chart';
import { ReportChartType } from '@/components/report/ReportChartType';
@@ -25,6 +24,7 @@ import { useDispatch, useSelector } from '@/redux';
import { bind } from 'bind-event-listener';
import { endOfDay, startOfDay } from 'date-fns';
import { GanttChartSquareIcon } from 'lucide-react';
+import { useEffect } from 'react';
import type { IServiceReport } from '@openpanel/db';
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/last-active-users/chart.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/last-active-users/chart.tsx
index 5af24f1d0..1b9616496 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/last-active-users/chart.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/last-active-users/chart.tsx
@@ -55,12 +55,12 @@ const Chart = ({ data }: Props) => {
offset="0%"
stopColor={getChartColor(0)}
stopOpacity={0.8}
- ></stop>
+ />
<stop
offset="100%"
stopColor={getChartColor(0)}
stopOpacity={0.1}
- ></stop>
+ />
</linearGradient>
</defs>
@@ -70,7 +70,7 @@ const Chart = ({ data }: Props) => {
dataKey="users"
stroke={getChartColor(0)}
strokeWidth={2}
- fill={`url(#bg)`}
+ fill={'url(#bg)'}
isAnimationActive={false}
/>
<XAxis
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/rolling-active-users/chart.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/rolling-active-users/chart.tsx
index 9dc0ff1b4..4fb8edcbd 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/rolling-active-users/chart.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/rolling-active-users/chart.tsx
@@ -72,36 +72,36 @@ const Chart = ({ data }: Props) => {
offset="0%"
stopColor={getChartColor(0)}
stopOpacity={0.8}
- ></stop>
+ />
<stop
offset="100%"
stopColor={getChartColor(0)}
stopOpacity={0.1}
- ></stop>
+ />
</linearGradient>
<linearGradient id="wau" x1="0" y1="0" x2="0" y2="1">
<stop
offset="0%"
stopColor={getChartColor(1)}
stopOpacity={0.8}
- ></stop>
+ />
<stop
offset="100%"
stopColor={getChartColor(1)}
stopOpacity={0.1}
- ></stop>
+ />
</linearGradient>
<linearGradient id="mau" x1="0" y1="0" x2="0" y2="1">
<stop
offset="0%"
stopColor={getChartColor(2)}
stopOpacity={0.8}
- ></stop>
+ />
<stop
offset="100%"
stopColor={getChartColor(2)}
stopOpacity={0.1}
- ></stop>
+ />
</linearGradient>
</defs>
@@ -111,21 +111,21 @@ const Chart = ({ data }: Props) => {
dataKey="dau"
stroke={getChartColor(0)}
strokeWidth={2}
- fill={`url(#dau)`}
+ fill={'url(#dau)'}
isAnimationActive={false}
/>
<Area
dataKey="wau"
stroke={getChartColor(1)}
strokeWidth={2}
- fill={`url(#wau)`}
+ fill={'url(#wau)'}
isAnimationActive={false}
/>
<Area
dataKey="mau"
stroke={getChartColor(2)}
strokeWidth={2}
- fill={`url(#mau)`}
+ fill={'url(#mau)'}
isAnimationActive={false}
/>
<XAxis {...xAxisProps} dataKey="date" />
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/users-retention-series/chart.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/users-retention-series/chart.tsx
index fe5fae6f2..7e0905f29 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/users-retention-series/chart.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/users-retention-series/chart.tsx
@@ -70,12 +70,12 @@ const Chart = ({ data }: Props) => {
offset="0%"
stopColor={getChartColor(0)}
stopOpacity={0.8}
- ></stop>
+ />
<stop
offset="100%"
stopColor={getChartColor(0)}
stopOpacity={0.1}
- ></stop>
+ />
</linearGradient>
</defs>
@@ -85,7 +85,7 @@ const Chart = ({ data }: Props) => {
dataKey="retention"
stroke={getChartColor(0)}
strokeWidth={2}
- fill={`url(#bg)`}
+ fill={'url(#bg)'}
isAnimationActive={false}
/>
<XAxis
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/weekly-cohorts/index.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/weekly-cohorts/index.tsx
index 1fa9b1b5b..db4c7a54e 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/weekly-cohorts/index.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/retention/weekly-cohorts/index.tsx
@@ -17,7 +17,7 @@ const Cell = ({ value, ratio }: { value: number; ratio: number }) => {
<div
className="absolute inset-0 z-0 bg-highlight"
style={{ opacity: ratio }}
- ></div>
+ />
<div className="relative z-10">{value}</div>
</td>
);
@@ -39,7 +39,7 @@ const WeeklyCohortsServer = async ({ projectId }: Props) => {
row.period_7,
row.period_8,
row.period_9,
- ])
+ ]),
);
const calculateRatio = (currentValue: number) =>
@@ -47,7 +47,7 @@ const WeeklyCohortsServer = async ({ projectId }: Props) => {
? 0
: Math.max(
0.1,
- Math.min(1, (currentValue - minValue) / (maxValue - minValue))
+ Math.min(1, (currentValue - minValue) / (maxValue - minValue)),
);
return (
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/invites/create-invite.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/invites/create-invite.tsx
index 2c9c5f21e..2ed0428f7 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/invites/create-invite.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/invites/create-invite.tsx
@@ -6,7 +6,6 @@ import { ComboboxAdvanced } from '@/components/ui/combobox-advanced';
import { Label } from '@/components/ui/label';
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
import {
- closeSheet,
Sheet,
SheetContent,
SheetDescription,
@@ -14,6 +13,7 @@ import {
SheetHeader,
SheetTitle,
SheetTrigger,
+ closeSheet,
} from '@/components/ui/sheet';
import { useAppParams } from '@/hooks/useAppParams';
import { api } from '@/trpc/client';
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/page.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/page.tsx
index c8a5a90a8..187d99f7f 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/page.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/page.tsx
@@ -52,7 +52,7 @@ export default async function Page({
}
const member = organization.members.find(
- (member) => member.userId === session.userId
+ (member) => member.userId === session.userId,
);
const hasAccess = member?.role === 'org:admin';
@@ -69,13 +69,13 @@ export default async function Page({
return (
<Padding>
<PageTabs className="mb-4">
- <PageTabsLink href={`?tab=org`} isActive={tab === 'org'}>
+ <PageTabsLink href={'?tab=org'} isActive={tab === 'org'}>
Organization
</PageTabsLink>
- <PageTabsLink href={`?tab=members`} isActive={tab === 'members'}>
+ <PageTabsLink href={'?tab=members'} isActive={tab === 'members'}>
Members
</PageTabsLink>
- <PageTabsLink href={`?tab=invites`} isActive={tab === 'invites'}>
+ <PageTabsLink href={'?tab=invites'} isActive={tab === 'invites'}>
Invites
</PageTabsLink>
</PageTabs>
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/profile/logout.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/profile/logout.tsx
index fc3f53915..71578074f 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/profile/logout.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/profile/logout.tsx
@@ -10,9 +10,7 @@ export function Logout() {
<span className="title">Sad part</span>
</WidgetHead>
<WidgetBody>
- <p className="mb-4">
- Sometimes you need to go. See you next time
- </p>
+ <p className="mb-4">Sometimes you need to go. See you next time</p>
<SignOutButton />
</WidgetBody>
</Widget>
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/projects/list-projects.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/projects/list-projects.tsx
index 974600073..9a1c882a7 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/projects/list-projects.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/projects/list-projects.tsx
@@ -44,7 +44,7 @@ export default function ListProjects({ projects, clients }: ListProjectsProps) {
<Accordion type="single" collapsible className="-mx-4">
{projects.map((project) => {
const pClients = clients.filter(
- (client) => client.projectId === project.id
+ (client) => client.projectId === project.id,
);
return (
<AccordionItem
@@ -61,7 +61,7 @@ export default function ListProjects({ projects, clients }: ListProjectsProps) {
: 'No clients created yet'}
</span>
</div>
- <div className="mx-4"></div>
+ <div className="mx-4" />
</AccordionTrigger>
<AccordionContent className="px-4">
<ProjectActions {...project} />
@@ -91,6 +91,7 @@ export default function ListProjects({ projects, clients }: ListProjectsProps) {
);
})}
<button
+ type="button"
onClick={() => {
pushModal('AddClient', {
projectId: project.id,
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/side-effects.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/side-effects.tsx
index b883c4456..d2e97928f 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/side-effects.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/side-effects.tsx
@@ -1,9 +1,9 @@
'use client';
-import { useEffect } from 'react';
import { pushModal, useOnPushModal } from '@/modals';
import { useUser } from '@clerk/nextjs';
import { differenceInDays } from 'date-fns';
+import { useEffect } from 'react';
import { useOpenPanel } from '@openpanel/nextjs';
@@ -12,7 +12,7 @@ export default function SideEffects() {
const { user } = useUser();
const accountAgeInDays = differenceInDays(
new Date(),
- user?.createdAt || new Date()
+ user?.createdAt || new Date(),
);
useOnPushModal('Testimonial', (open) => {
if (!open) {
diff --git a/apps/dashboard/src/app/(auth)/live-events/live-events.tsx b/apps/dashboard/src/app/(auth)/live-events/live-events.tsx
index f1ca4fb56..7e4b581a8 100644
--- a/apps/dashboard/src/app/(auth)/live-events/live-events.tsx
+++ b/apps/dashboard/src/app/(auth)/live-events/live-events.tsx
@@ -1,8 +1,8 @@
'use client';
-import { useEffect, useState } from 'react';
import { EventListItem } from '@/components/events/event-list-item';
import { AnimatePresence, motion } from 'framer-motion';
+import { useEffect, useState } from 'react';
import type { IServiceEventMinimal } from '@openpanel/db';
diff --git a/apps/dashboard/src/app/(onboarding)/layout.tsx b/apps/dashboard/src/app/(onboarding)/layout.tsx
index af1c0e119..348ce9988 100644
--- a/apps/dashboard/src/app/(onboarding)/layout.tsx
+++ b/apps/dashboard/src/app/(onboarding)/layout.tsx
@@ -11,8 +11,8 @@ const Page = ({ children }: Props) => {
return (
<>
<div className="fixed inset-0 hidden md:grid md:grid-cols-[30vw_1fr] lg:grid-cols-[30vw_1fr]">
- <div className=""></div>
- <div className="border-l border-border bg-card"></div>
+ <div className="" />
+ <div className="border-l border-border bg-card" />
</div>
<div className="relative min-h-screen bg-card md:bg-transparent">
<FullWidthNavbar>
diff --git a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-app.tsx b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-app.tsx
index b76f828e3..4ccc802d8 100644
--- a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-app.tsx
+++ b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-app.tsx
@@ -21,6 +21,7 @@ const ConnectApp = ({ client }: Props) => {
<div className="mt-4 grid gap-4 md:grid-cols-2">
{frameworks.app.map((framework) => (
<button
+ type="button"
onClick={() =>
pushModal('Instructions', {
framework,
diff --git a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-backend.tsx b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-backend.tsx
index c25f9597a..c42420ae7 100644
--- a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-backend.tsx
+++ b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-backend.tsx
@@ -21,6 +21,7 @@ const ConnectBackend = ({ client }: Props) => {
<div className="mt-4 grid gap-4 md:grid-cols-2">
{frameworks.backend.map((framework) => (
<button
+ type="button"
onClick={() =>
pushModal('Instructions', {
framework,
diff --git a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-web.tsx b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-web.tsx
index fcc547168..afe480a54 100644
--- a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-web.tsx
+++ b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/connect/connect-web.tsx
@@ -21,6 +21,7 @@ const ConnectWeb = ({ client }: Props) => {
<div className="mt-4 grid gap-4 md:grid-cols-2">
{frameworks.website.map((framework) => (
<button
+ type="button"
onClick={() =>
pushModal('Instructions', {
framework,
diff --git a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/onboarding-verify-listener.tsx b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/onboarding-verify-listener.tsx
index ba0256b7b..9ddd091d8 100644
--- a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/onboarding-verify-listener.tsx
+++ b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/onboarding-verify-listener.tsx
@@ -1,12 +1,12 @@
'use client';
-import { useState } from 'react';
import { Badge } from '@/components/ui/badge';
import useWS from '@/hooks/useWS';
import { pushModal } from '@/modals';
import { cn } from '@/utils/cn';
import { timeAgo } from '@/utils/date';
import { CheckCircle2Icon, CheckIcon, Loader2 } from 'lucide-react';
+import { useState } from 'react';
import type {
IServiceClient,
@@ -28,7 +28,7 @@ const VerifyListener = ({ client, events: _events, onVerified }: Props) => {
(data) => {
setEvents((prev) => [...prev, data]);
onVerified(true);
- }
+ },
);
const isConnected = events.length > 0;
@@ -70,7 +70,7 @@ const VerifyListener = ({ client, events: _events, onVerified }: Props) => {
'my-6 flex gap-6 rounded-xl p-4 md:p-6',
isConnected
? 'bg-emerald-100 dark:bg-emerald-700'
- : 'bg-blue-100 dark:bg-blue-700'
+ : 'bg-blue-100 dark:bg-blue-700',
)}
>
{renderIcon()}
@@ -87,7 +87,7 @@ const VerifyListener = ({ client, events: _events, onVerified }: Props) => {
</div>
)}
{events.slice(-5).map((event, index) => (
- <div key={index} className="flex items-center gap-2 ">
+ <div key={event.id} className="flex items-center gap-2 ">
<CheckIcon size={14} />{' '}
<span className="font-medium">{event.name}</span>{' '}
<span className="ml-auto text-emerald-800">
@@ -108,6 +108,7 @@ const VerifyListener = ({ client, events: _events, onVerified }: Props) => {
<div className="mt-2 text-sm text-muted-foreground">
You can{' '}
<button
+ type="button"
className="underline"
onClick={() => {
pushModal('OnboardingTroubleshoot', {
diff --git a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/onboarding-verify.tsx b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/onboarding-verify.tsx
index 25322ff8b..f512f0574 100644
--- a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/onboarding-verify.tsx
+++ b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/onboarding-verify.tsx
@@ -1,10 +1,10 @@
'use client';
-import { useState } from 'react';
import { ButtonContainer } from '@/components/button-container';
import { LinkButton } from '@/components/ui/button';
import { cn } from '@/utils/cn';
import Link from 'next/link';
+import { useState } from 'react';
import type { IServiceEvent, IServiceProjectWithClients } from '@openpanel/db';
@@ -84,7 +84,7 @@ const Verify = ({ project, events }: Props) => {
size="lg"
className={cn(
'min-w-28 self-start',
- !verified && 'pointer-events-none select-none opacity-20'
+ !verified && 'pointer-events-none select-none opacity-20',
)}
>
Your dashboard
diff --git a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/page.tsx b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/page.tsx
index 8a4c1c6bd..47632d28d 100644
--- a/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/page.tsx
+++ b/apps/dashboard/src/app/(onboarding)/onboarding/[projectId]/verify/page.tsx
@@ -2,10 +2,10 @@ import { cookies } from 'next/headers';
import { escape } from 'sqlstring';
import {
+ TABLE_NAMES,
getCurrentOrganizations,
getEvents,
getProjectWithClients,
- TABLE_NAMES,
} from '@openpanel/db';
import OnboardingVerify from './onboarding-verify';
@@ -25,7 +25,7 @@ const Verify = async ({ params: { projectId } }: Props) => {
const [project, events] = await Promise.all([
await getProjectWithClients(projectId),
getEvents(
- `SELECT * FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(projectId)} LIMIT 100`
+ `SELECT * FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(projectId)} LIMIT 100`,
),
]);
diff --git a/apps/dashboard/src/app/(onboarding)/onboarding/onboarding-tracking.tsx b/apps/dashboard/src/app/(onboarding)/onboarding/onboarding-tracking.tsx
index 2a234f6c2..eb1ad28d9 100644
--- a/apps/dashboard/src/app/(onboarding)/onboarding/onboarding-tracking.tsx
+++ b/apps/dashboard/src/app/(onboarding)/onboarding/onboarding-tracking.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useEffect } from 'react';
import AnimateHeight from '@/components/animate-height';
import { ButtonContainer } from '@/components/button-container';
import { CheckboxItem } from '@/components/forms/checkbox-item';
@@ -19,6 +18,7 @@ import {
SmartphoneIcon,
} from 'lucide-react';
import { useRouter } from 'next/navigation';
+import { useEffect } from 'react';
import type { SubmitHandler } from 'react-hook-form';
import { Controller, useForm, useWatch } from 'react-hook-form';
import type { z } from 'zod';
@@ -185,7 +185,7 @@ const Tracking = ({
}
return `https://${trimmed}`;
})
- .join(',')
+ .join(','),
);
}}
/>
diff --git a/apps/dashboard/src/app/(onboarding)/skip-onboarding.tsx b/apps/dashboard/src/app/(onboarding)/skip-onboarding.tsx
index bf1708fb7..e9f828e7c 100644
--- a/apps/dashboard/src/app/(onboarding)/skip-onboarding.tsx
+++ b/apps/dashboard/src/app/(onboarding)/skip-onboarding.tsx
@@ -1,11 +1,11 @@
'use client';
-import { useEffect } from 'react';
import { showConfirm } from '@/modals';
import { api } from '@/trpc/client';
import { useAuth } from '@clerk/nextjs';
import { ChevronLastIcon } from 'lucide-react';
import { usePathname, useRouter } from 'next/navigation';
+import { useEffect } from 'react';
const SkipOnboarding = () => {
const router = useRouter();
@@ -20,6 +20,7 @@ const SkipOnboarding = () => {
return (
<button
+ type="button"
onClick={() => {
if (res.data?.canSkip && res.data?.url) {
router.push(res.data.url);
diff --git a/apps/dashboard/src/app/(onboarding)/steps.tsx b/apps/dashboard/src/app/(onboarding)/steps.tsx
index 6d8c5ceb3..e9bed2a40 100644
--- a/apps/dashboard/src/app/(onboarding)/steps.tsx
+++ b/apps/dashboard/src/app/(onboarding)/steps.tsx
@@ -39,7 +39,7 @@ function useSteps(path: string) {
];
const matchIndex = steps.findLastIndex((step) =>
- path.match(new RegExp(step.match))
+ path.match(new RegExp(step.match)),
);
return steps.map((step, index) => {
@@ -59,17 +59,17 @@ const Steps = ({ className }: Props) => {
const currentIndex = steps.findIndex((i) => i.status === 'current');
return (
<div className="relative">
- <div className="absolute bottom-4 left-4 top-4 w-px bg-def-200"></div>
+ <div className="absolute bottom-4 left-4 top-4 w-px bg-def-200" />
<div
className="absolute left-4 top-4 w-px bg-highlight"
style={{
height: `calc(${((currentIndex + 1) / steps.length) * 100}% - 3.5rem)`,
}}
- ></div>
+ />
<div
className={cn(
'relative flex gap-4 overflow-hidden md:-ml-3 md:flex-col md:gap-8',
- className
+ className,
)}
>
{steps.map((step, index) => (
@@ -80,32 +80,31 @@ const Steps = ({ className }: Props) => {
'rounded-xl border border-border bg-card',
step.status === 'completed' &&
index !== currentIndex - 1 &&
- 'max-md:hidden'
+ 'max-md:hidden',
)}
key={step.name}
>
<div
className={cn(
- 'relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-white'
+ 'relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-white',
)}
>
<div
className={cn(
'absolute inset-0 z-0 rounded-full bg-highlight',
- step.status === 'pending' && 'bg-def-400'
+ step.status === 'pending' && 'bg-def-400',
)}
- ></div>
+ />
{step.status === 'current' && (
- <div className="absolute inset-1 z-0 animate-ping-slow rounded-full bg-highlight"></div>
+ <div className="absolute inset-1 z-0 animate-ping-slow rounded-full bg-highlight" />
)}
<div className="relative">
{step.status === 'completed' && <CheckCheckIcon size={14} />}
{/* {step.status === 'current' && (
<ArrowRightCircleIcon size={14} />
)} */}
- {(step.status === 'pending' || step.status === 'current') && (
- <>{index + 1}</>
- )}
+ {(step.status === 'pending' || step.status === 'current') &&
+ index + 1}
</div>
</div>
diff --git a/apps/dashboard/src/app/api/clerk/webhook/route.ts b/apps/dashboard/src/app/api/clerk/webhook/route.ts
index 878c0b133..bcb325802 100644
--- a/apps/dashboard/src/app/api/clerk/webhook/route.ts
+++ b/apps/dashboard/src/app/api/clerk/webhook/route.ts
@@ -15,7 +15,7 @@ export async function POST(request: Request) {
if (!email) {
return Response.json(
{ message: 'No email address found' },
- { status: 400 }
+ { status: 400 },
);
}
diff --git a/apps/dashboard/src/app/layout.tsx b/apps/dashboard/src/app/layout.tsx
index 2f4c1ebbf..78d16742d 100644
--- a/apps/dashboard/src/app/layout.tsx
+++ b/apps/dashboard/src/app/layout.tsx
@@ -4,7 +4,7 @@ import NextTopLoader from 'nextjs-toploader';
import Providers from './providers';
import '@/styles/globals.css';
-import '/node_modules/flag-icons/css/flag-icons.min.css';
+import 'flag-icons/css/flag-icons.min.css';
import { GeistMono } from 'geist/font/mono';
import { GeistSans } from 'geist/font/sans';
@@ -31,7 +31,7 @@ export default function RootLayout({
className={cn(
'grainy min-h-screen bg-def-100 font-sans text-base antialiased',
GeistSans.variable,
- GeistMono.variable
+ GeistMono.variable,
)}
>
<NextTopLoader
diff --git a/apps/dashboard/src/app/providers.tsx b/apps/dashboard/src/app/providers.tsx
index 56cfcb919..403bd3a28 100644
--- a/apps/dashboard/src/app/providers.tsx
+++ b/apps/dashboard/src/app/providers.tsx
@@ -1,6 +1,5 @@
'use client';
-import React, { useRef, useState } from 'react';
import { TooltipProvider } from '@/components/ui/tooltip';
import { ModalProvider } from '@/modals';
import type { AppStore } from '@/redux';
@@ -10,6 +9,8 @@ import { ClerkProvider, useAuth } from '@clerk/nextjs';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { httpLink } from '@trpc/client';
import { ThemeProvider } from 'next-themes';
+import type React from 'react';
+import { useRef, useState } from 'react';
import { Provider as ReduxProvider } from 'react-redux';
import { Toaster } from 'sonner';
import superjson from 'superjson';
@@ -28,7 +29,7 @@ function AllProviders({ children }: { children: React.ReactNode }) {
refetchOnWindowFocus: false,
},
},
- })
+ }),
);
const [trpcClient] = useState(() =>
api.createClient({
@@ -47,7 +48,7 @@ function AllProviders({ children }: { children: React.ReactNode }) {
},
}),
],
- })
+ }),
);
const storeRef = useRef<AppStore>();
diff --git a/apps/dashboard/src/components/card.tsx b/apps/dashboard/src/components/card.tsx
index 1ca0ffd43..baff698bf 100644
--- a/apps/dashboard/src/components/card.tsx
+++ b/apps/dashboard/src/components/card.tsx
@@ -21,7 +21,7 @@ export function Card({ children, hover, className }: CardProps) {
className={cn(
'card relative',
hover && 'transition-all hover:-translate-y-0.5',
- className
+ className,
)}
>
{children}
diff --git a/apps/dashboard/src/components/chart-ssr.tsx b/apps/dashboard/src/components/chart-ssr.tsx
index cc58626b0..52bd51a76 100644
--- a/apps/dashboard/src/components/chart-ssr.tsx
+++ b/apps/dashboard/src/components/chart-ssr.tsx
@@ -51,23 +51,23 @@ export function ChartSSR({
>
<defs>
<linearGradient
- id={`gradient`}
+ id={'gradient'}
x1="0"
y1="0"
x2="0"
y2="100%"
gradientUnits="userSpaceOnUse"
>
- <stop offset="0%" stopColor={'blue'} stopOpacity={0.2}></stop>
- <stop offset="50%" stopColor={'blue'} stopOpacity={0.05}></stop>
- <stop offset="100%" stopColor={'blue'} stopOpacity={0}></stop>
+ <stop offset="0%" stopColor={'blue'} stopOpacity={0.2} />
+ <stop offset="50%" stopColor={'blue'} stopOpacity={0.05} />
+ <stop offset="100%" stopColor={'blue'} stopOpacity={0} />
</linearGradient>
</defs>
{/* Gradient area */}
{pathArea && (
<path
d={pathArea}
- fill={`url(#gradient)`}
+ fill={'url(#gradient)'}
vectorEffect="non-scaling-stroke"
/>
)}
diff --git a/apps/dashboard/src/components/clients/create-client-success.tsx b/apps/dashboard/src/components/clients/create-client-success.tsx
index 591a8c1b0..639089ace 100644
--- a/apps/dashboard/src/components/clients/create-client-success.tsx
+++ b/apps/dashboard/src/components/clients/create-client-success.tsx
@@ -39,6 +39,7 @@ export function CreateClientSuccess({ id, secret, cors }: Props) {
target="_blank"
href="https://docs.openpanel.dev"
className="underline"
+ rel="noreferrer"
>
documentation
</a>{' '}
diff --git a/apps/dashboard/src/components/color-square.tsx b/apps/dashboard/src/components/color-square.tsx
index cbdd63fda..f98b7f44f 100644
--- a/apps/dashboard/src/components/color-square.tsx
+++ b/apps/dashboard/src/components/color-square.tsx
@@ -8,7 +8,7 @@ export function ColorSquare({ children, className }: ColorSquareProps) {
<div
className={cn(
'flex h-5 w-5 flex-shrink-0 items-center justify-center rounded bg-blue-600 text-sm font-medium text-white [.mini_&]:h-4 [.mini_&]:w-4 [.mini_&]:text-[0.6rem]',
- className
+ className,
)}
>
{children}
diff --git a/apps/dashboard/src/components/dark-mode-toggle.tsx b/apps/dashboard/src/components/dark-mode-toggle.tsx
index 2e4b96f3c..428c6c31f 100644
--- a/apps/dashboard/src/components/dark-mode-toggle.tsx
+++ b/apps/dashboard/src/components/dark-mode-toggle.tsx
@@ -1,6 +1,5 @@
'use client';
-import * as React from 'react';
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
@@ -10,6 +9,7 @@ import {
} from '@/components/ui/dropdown-menu';
import { MoonIcon, SunIcon } from 'lucide-react';
import { useTheme } from 'next-themes';
+import * as React from 'react';
interface Props {
className?: string;
diff --git a/apps/dashboard/src/components/data-table.tsx b/apps/dashboard/src/components/data-table.tsx
index 162c86bae..efa7c954f 100644
--- a/apps/dashboard/src/components/data-table.tsx
+++ b/apps/dashboard/src/components/data-table.tsx
@@ -47,7 +47,7 @@ export function DataTable<TData>({ columns, data }: DataTableProps<TData>) {
? null
: flexRender(
header.column.columnDef.header,
- header.getContext()
+ header.getContext(),
)}
</GridCell>
))}
diff --git a/apps/dashboard/src/components/dot.tsx b/apps/dashboard/src/components/dot.tsx
index 6dd67aec2..66ce3452c 100644
--- a/apps/dashboard/src/components/dot.tsx
+++ b/apps/dashboard/src/components/dot.tsx
@@ -22,7 +22,7 @@ export function Dot({ className, size = 8, animated }: DotProps) {
<div
className={cn(
'relative',
- filterCn(['bg-', 'animate-', 'group-hover/row'], className)
+ filterCn(['bg-', 'animate-', 'group-hover/row'], className),
)}
style={style}
>
@@ -30,14 +30,14 @@ export function Dot({ className, size = 8, animated }: DotProps) {
className={cn(
'absolute !m-0 rounded-full',
animated !== false && 'animate-ping',
- className
+ className,
)}
style={style}
/>
<div
className={cn(
'absolute !m-0 rounded-full',
- filterCn(['animate-', 'group-hover/row'], className)
+ filterCn(['animate-', 'group-hover/row'], className),
)}
style={style}
/>
diff --git a/apps/dashboard/src/components/events/event-list-item.tsx b/apps/dashboard/src/components/events/event-list-item.tsx
index 740d2189e..4983a5435 100644
--- a/apps/dashboard/src/components/events/event-list-item.tsx
+++ b/apps/dashboard/src/components/events/event-list-item.tsx
@@ -51,6 +51,7 @@ export function EventListItem(props: EventListItemProps) {
return (
<>
<button
+ type="button"
onClick={() => {
if (!isMinimal) {
pushModal('EventDetails', {
@@ -61,7 +62,7 @@ export function EventListItem(props: EventListItemProps) {
className={cn(
'card hover:bg-light-background flex w-full items-center justify-between rounded-lg p-4 transition-colors',
meta?.conversion &&
- `bg-${meta.color}-50 dark:bg-${meta.color}-900 hover:bg-${meta.color}-100 dark:hover:bg-${meta.color}-700`
+ `bg-${meta.color}-50 dark:bg-${meta.color}-900 hover:bg-${meta.color}-100 dark:hover:bg-${meta.color}-700`,
)}
>
<div>
diff --git a/apps/dashboard/src/components/events/event-listener.tsx b/apps/dashboard/src/components/events/event-listener.tsx
index 02e59c48a..4c20bb9ed 100644
--- a/apps/dashboard/src/components/events/event-listener.tsx
+++ b/apps/dashboard/src/components/events/event-listener.tsx
@@ -38,6 +38,7 @@ export default function EventListener({
<Tooltip>
<TooltipTrigger asChild>
<button
+ type="button"
onClick={() => {
counter.set(0);
onRefresh();
@@ -47,14 +48,14 @@ export default function EventListener({
<div className="relative">
<div
className={cn(
- 'h-3 w-3 animate-ping rounded-full bg-emerald-500 opacity-100 transition-all'
+ 'h-3 w-3 animate-ping rounded-full bg-emerald-500 opacity-100 transition-all',
)}
- ></div>
+ />
<div
className={cn(
- 'absolute left-0 top-0 h-3 w-3 rounded-full bg-emerald-500 transition-all'
+ 'absolute left-0 top-0 h-3 w-3 rounded-full bg-emerald-500 transition-all',
)}
- ></div>
+ />
</div>
{counter.debounced === 0 ? (
'Listening'
diff --git a/apps/dashboard/src/components/events/table/columns.tsx b/apps/dashboard/src/components/events/table/columns.tsx
index 56a9a3f50..db7522114 100644
--- a/apps/dashboard/src/components/events/table/columns.tsx
+++ b/apps/dashboard/src/components/events/table/columns.tsx
@@ -52,6 +52,7 @@ export function useColumns() {
<div className="flex items-center gap-2">
<TooltipComplete content="Click to edit" side="left">
<button
+ type="button"
className="transition-transform hover:scale-105"
onClick={() => {
pushModal('EditEvent', {
@@ -68,6 +69,7 @@ export function useColumns() {
</TooltipComplete>
<span className="flex gap-2">
<button
+ type="button"
onClick={() => {
pushModal('EventDetails', {
id: row.original.id,
diff --git a/apps/dashboard/src/components/events/table/index.tsx b/apps/dashboard/src/components/events/table/index.tsx
index 5717dadf7..df86e917d 100644
--- a/apps/dashboard/src/components/events/table/index.tsx
+++ b/apps/dashboard/src/components/events/table/index.tsx
@@ -1,4 +1,3 @@
-import type { Dispatch, SetStateAction } from 'react';
import { DataTable } from '@/components/data-table';
import { FullPageEmptyState } from '@/components/full-page-empty-state';
import { Pagination } from '@/components/pagination';
@@ -7,6 +6,7 @@ import { TableSkeleton } from '@/components/ui/table';
import type { UseQueryResult } from '@tanstack/react-query';
import { GanttChartIcon } from 'lucide-react';
import { column } from 'mathjs';
+import type { Dispatch, SetStateAction } from 'react';
import type { IServiceEvent } from '@openpanel/db';
@@ -55,7 +55,7 @@ export const EventsTable = ({ query, ...props }: Props) => {
className="mt-2"
setCursor={props.setCursor}
cursor={props.cursor}
- count={Infinity}
+ count={Number.POSITIVE_INFINITY}
take={50}
loading={isFetching}
/>
diff --git a/apps/dashboard/src/components/fade-in.tsx b/apps/dashboard/src/components/fade-in.tsx
index fb1deaadc..d273a1c6f 100644
--- a/apps/dashboard/src/components/fade-in.tsx
+++ b/apps/dashboard/src/components/fade-in.tsx
@@ -1,7 +1,7 @@
'use client';
-import { useEffect, useRef } from 'react';
import { cn } from '@/utils/cn';
+import { useEffect, useRef } from 'react';
type Props = {
className?: string;
diff --git a/apps/dashboard/src/components/forms/checkbox-item.tsx b/apps/dashboard/src/components/forms/checkbox-item.tsx
index 3f24f3e89..ea86a5e04 100644
--- a/apps/dashboard/src/components/forms/checkbox-item.tsx
+++ b/apps/dashboard/src/components/forms/checkbox-item.tsx
@@ -1,7 +1,7 @@
-import { forwardRef } from 'react';
import { cn } from '@/utils/cn';
import { slug } from '@/utils/slug';
import type { LucideIcon } from 'lucide-react';
+import { forwardRef } from 'react';
import type { ControllerRenderProps } from 'react-hook-form';
import { Switch } from '../ui/switch';
@@ -17,7 +17,7 @@ type Props = {
export const CheckboxItem = forwardRef<HTMLButtonElement, Props>(
(
{ label, description, Icon, children, onChange, value, disabled, error },
- ref
+ ref,
) => {
const id = slug(label);
return (
@@ -25,7 +25,7 @@ export const CheckboxItem = forwardRef<HTMLButtonElement, Props>(
<label
className={cn(
'flex items-center gap-4 px-4 py-6 transition-colors hover:bg-def-200',
- disabled && 'cursor-not-allowed opacity-50'
+ disabled && 'cursor-not-allowed opacity-50',
)}
htmlFor={id}
>
@@ -48,7 +48,7 @@ export const CheckboxItem = forwardRef<HTMLButtonElement, Props>(
{children}
</div>
);
- }
+ },
);
CheckboxItem.displayName = 'CheckboxItem';
diff --git a/apps/dashboard/src/components/forms/copy-input.tsx b/apps/dashboard/src/components/forms/copy-input.tsx
index c9c7239fd..b70850f8f 100644
--- a/apps/dashboard/src/components/forms/copy-input.tsx
+++ b/apps/dashboard/src/components/forms/copy-input.tsx
@@ -13,6 +13,7 @@ type Props = {
const CopyInput = ({ label, value, className }: Props) => {
return (
<button
+ type="button"
className={cn('w-full text-left', className)}
onClick={() => clipboard(value)}
>
diff --git a/apps/dashboard/src/components/forms/input-with-label.tsx b/apps/dashboard/src/components/forms/input-with-label.tsx
index 972d9cf2e..9ef8ad1bb 100644
--- a/apps/dashboard/src/components/forms/input-with-label.tsx
+++ b/apps/dashboard/src/components/forms/input-with-label.tsx
@@ -1,5 +1,5 @@
-import { forwardRef } from 'react';
import { BanIcon, InfoIcon } from 'lucide-react';
+import { forwardRef } from 'react';
import { Input } from '../ui/input';
import type { InputProps } from '../ui/input';
@@ -57,7 +57,7 @@ export const InputWithLabel = forwardRef<HTMLInputElement, InputWithLabelProps>(
<Input ref={ref} id={props.label} {...props} />
</WithLabel>
);
- }
+ },
);
InputWithLabel.displayName = 'InputWithLabel';
diff --git a/apps/dashboard/src/components/forms/tag-input.tsx b/apps/dashboard/src/components/forms/tag-input.tsx
index 727eeeb4a..13bae5395 100644
--- a/apps/dashboard/src/components/forms/tag-input.tsx
+++ b/apps/dashboard/src/components/forms/tag-input.tsx
@@ -1,11 +1,11 @@
// Based on Christin Alares tag input component (https://github.com/christianalares/seventy-seven)
-import type { ElementRef } from 'react';
-import { useEffect, useRef, useState } from 'react';
import { Button } from '@/components/ui/button';
import { cn } from '@/utils/cn';
import { useAnimate } from 'framer-motion';
import { XIcon } from 'lucide-react';
+import type { ElementRef } from 'react';
+import { useEffect, useRef, useState } from 'react';
type Props = {
placeholder: string;
@@ -47,7 +47,7 @@ const TagInput = ({
e.preventDefault();
const tagAlreadyExists = value.some(
- (tag) => tag.toLowerCase() === inputValue.toLowerCase()
+ (tag) => tag.toLowerCase() === inputValue.toLowerCase(),
);
if (inputValue) {
@@ -59,7 +59,7 @@ const TagInput = ({
},
{
duration: 0.3,
- }
+ },
);
return;
}
@@ -101,7 +101,7 @@ const TagInput = ({
ref={scope}
className={cn(
'inline-flex w-full flex-wrap items-center gap-2 rounded-md border border-input p-1 px-3 ring-offset-background has-[input:focus]:ring-2 has-[input:focus]:ring-ring has-[input:focus]:ring-offset-1',
- !!error && 'border-destructive'
+ !!error && 'border-destructive',
)}
>
{value.map((tag, i) => {
@@ -116,7 +116,7 @@ const TagInput = ({
isMarkedForDeletion &&
i === value.length - 1 &&
'bg-destructive-foreground ring-2 ring-destructive/50 ring-offset-1',
- isCreating && 'opacity-60'
+ isCreating && 'opacity-60',
)}
>
{renderTag ? renderTag(tag) : tag}
diff --git a/apps/dashboard/src/components/full-page-empty-state.tsx b/apps/dashboard/src/components/full-page-empty-state.tsx
index 4eecb00e9..23935f8da 100644
--- a/apps/dashboard/src/components/full-page-empty-state.tsx
+++ b/apps/dashboard/src/components/full-page-empty-state.tsx
@@ -19,7 +19,7 @@ export function FullPageEmptyState({
<div
className={cn(
'flex items-center justify-center p-4 text-center',
- className
+ className,
)}
>
<div className="flex w-full max-w-xl flex-col items-center justify-center p-8">
diff --git a/apps/dashboard/src/components/fullscreen-toggle.tsx b/apps/dashboard/src/components/fullscreen-toggle.tsx
index 03876c1d8..cf8c58c77 100644
--- a/apps/dashboard/src/components/fullscreen-toggle.tsx
+++ b/apps/dashboard/src/components/fullscreen-toggle.tsx
@@ -1,10 +1,10 @@
'use client';
-import { useEffect, useRef, useState } from 'react';
import { cn } from '@/utils/cn';
import { bind } from 'bind-event-listener';
import { ChevronLeftIcon, FullscreenIcon } from 'lucide-react';
import { parseAsBoolean, useQueryState } from 'nuqs';
+import { useEffect, useRef, useState } from 'react';
import { useDebounce } from 'usehooks-ts';
import { Button } from './ui/button';
@@ -21,7 +21,7 @@ export const useFullscreen = () =>
parseAsBoolean.withDefault(false).withOptions({
history: 'push',
clearOnDefault: true,
- })
+ }),
);
export const Fullscreen = (props: Props) => {
@@ -29,7 +29,7 @@ export const Fullscreen = (props: Props) => {
return (
<div
className={cn(
- isFullscreen && 'fixed inset-0 z-50 overflow-auto bg-def-200'
+ isFullscreen && 'fixed inset-0 z-50 overflow-auto bg-def-200',
)}
>
{props.children}
@@ -92,10 +92,11 @@ export const FullscreenClose = () => {
<div className="fixed bottom-0 top-0 z-50 flex items-center">
<Tooltiper content="Exit full screen" asChild>
<button
+ type="button"
ref={ref}
className={cn(
'flex h-20 w-20 -translate-x-20 items-center justify-center rounded-full bg-foreground transition-transform',
- visible && isFullscreenDebounced && '-translate-x-10'
+ visible && isFullscreenDebounced && '-translate-x-10',
)}
onClick={() => {
setIsFullscreen(false);
diff --git a/apps/dashboard/src/components/grid-table.tsx b/apps/dashboard/src/components/grid-table.tsx
index 9553cf2f9..226182ff7 100644
--- a/apps/dashboard/src/components/grid-table.tsx
+++ b/apps/dashboard/src/components/grid-table.tsx
@@ -1,5 +1,5 @@
-import React from 'react';
import { cn } from '@/utils/cn';
+import type React from 'react';
export const Grid: React.FC<
React.HTMLAttributes<HTMLDivElement> & { columns: number }
@@ -63,7 +63,7 @@ export const GridCell: React.FC<
'flex min-h-12 items-center whitespace-nowrap px-4 align-middle shadow-[0_0_0_0.5px] shadow-border',
isHeader && 'h-10 bg-def-100 font-semibold text-muted-foreground',
colSpan && `col-span-${colSpan}`,
- className
+ className,
)}
{...props}
>
@@ -79,7 +79,7 @@ export const GridRow: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
<div
className={cn(
'contents transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted',
- className
+ className,
)}
{...props}
>
diff --git a/apps/dashboard/src/components/overview/filters/origin-filter.tsx b/apps/dashboard/src/components/overview/filters/origin-filter.tsx
index d957f632f..8e168d441 100644
--- a/apps/dashboard/src/components/overview/filters/origin-filter.tsx
+++ b/apps/dashboard/src/components/overview/filters/origin-filter.tsx
@@ -16,7 +16,7 @@ export function OriginFilter() {
},
{
staleTime: 1000 * 60 * 60,
- }
+ },
);
if (!data || data.length === 0) {
@@ -32,7 +32,7 @@ export function OriginFilter() {
variant="outline"
icon={GlobeIcon}
className={cn(
- originFilter?.value.includes(item.origin) && 'border-foreground'
+ originFilter?.value.includes(item.origin) && 'border-foreground',
)}
onClick={() => setFilter('origin', [item.origin], 'is')}
>
diff --git a/apps/dashboard/src/components/overview/filters/overview-filters-drawer-content.tsx b/apps/dashboard/src/components/overview/filters/overview-filters-drawer-content.tsx
index cdcbf9e2d..351ba9989 100644
--- a/apps/dashboard/src/components/overview/filters/overview-filters-drawer-content.tsx
+++ b/apps/dashboard/src/components/overview/filters/overview-filters-drawer-content.tsx
@@ -125,7 +125,7 @@ export function FilterOptionEvent({
setFilter: (
name: string,
value: IChartEventFilterValue,
- operator: IChartEventFilterOperator
+ operator: IChartEventFilterOperator,
) => void;
}) {
const { interval, range } = useOverviewOptions();
@@ -172,7 +172,7 @@ export function FilterOptionProfile({
setFilter: (
name: string,
value: IChartEventFilterValue,
- operator: IChartEventFilterOperator
+ operator: IChartEventFilterOperator,
) => void;
}) {
const values = useProfileValues(projectId, filter.name);
diff --git a/apps/dashboard/src/components/overview/filters/overview-filters-drawer.tsx b/apps/dashboard/src/components/overview/filters/overview-filters-drawer.tsx
index 7eaa9cb27..3ff0e3fce 100644
--- a/apps/dashboard/src/components/overview/filters/overview-filters-drawer.tsx
+++ b/apps/dashboard/src/components/overview/filters/overview-filters-drawer.tsx
@@ -8,7 +8,7 @@ import type { OverviewFiltersDrawerContentProps } from './overview-filters-drawe
import { OverviewFiltersDrawerContent } from './overview-filters-drawer-content';
export function OverviewFiltersDrawer(
- props: OverviewFiltersDrawerContentProps
+ props: OverviewFiltersDrawerContentProps,
) {
return (
<Sheet>
diff --git a/apps/dashboard/src/components/overview/live-counter/live-counter.tsx b/apps/dashboard/src/components/overview/live-counter/live-counter.tsx
index 53aba29a1..d03d91c26 100644
--- a/apps/dashboard/src/components/overview/live-counter/live-counter.tsx
+++ b/apps/dashboard/src/components/overview/live-counter/live-counter.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useRef, useState } from 'react';
import { TooltipComplete } from '@/components/tooltip-complete';
import {
Tooltip,
@@ -12,6 +11,7 @@ import useWS from '@/hooks/useWS';
import { cn } from '@/utils/cn';
import { useQueryClient } from '@tanstack/react-query';
import dynamic from 'next/dynamic';
+import { useRef, useState } from 'react';
import { toast } from 'sonner';
export interface LiveCounterProps {
@@ -34,7 +34,7 @@ export default function LiveCounter({ data = 0, projectId }: LiveCounterProps) {
const lastRefresh = useRef(Date.now());
useWS<number>(`/live/visitors/${projectId}`, (value) => {
- if (!isNaN(value)) {
+ if (!Number.isNaN(value)) {
counter.set(value);
if (Date.now() - lastRefresh.current > FIFTEEN_SECONDS) {
lastRefresh.current = Date.now();
@@ -57,13 +57,13 @@ export default function LiveCounter({ data = 0, projectId }: LiveCounterProps) {
<div
className={cn(
'h-3 w-3 animate-ping rounded-full bg-emerald-500 opacity-100 transition-all',
- counter.debounced === 0 && 'bg-destructive opacity-0'
+ counter.debounced === 0 && 'bg-destructive opacity-0',
)}
/>
<div
className={cn(
'absolute left-0 top-0 h-3 w-3 rounded-full bg-emerald-500 transition-all',
- counter.debounced === 0 && 'bg-destructive'
+ counter.debounced === 0 && 'bg-destructive',
)}
/>
</div>
diff --git a/apps/dashboard/src/components/overview/overview-chart-toggle.tsx b/apps/dashboard/src/components/overview/overview-chart-toggle.tsx
index fb38a4c64..d446fa06e 100644
--- a/apps/dashboard/src/components/overview/overview-chart-toggle.tsx
+++ b/apps/dashboard/src/components/overview/overview-chart-toggle.tsx
@@ -1,5 +1,5 @@
-import type { Dispatch, SetStateAction } from 'react';
import { BarChartIcon, LineChartIcon } from 'lucide-react';
+import type { Dispatch, SetStateAction } from 'react';
import type { IChartType } from '@openpanel/validation';
diff --git a/apps/dashboard/src/components/overview/overview-live-histogram.tsx b/apps/dashboard/src/components/overview/overview-live-histogram.tsx
index ba0ced38a..d9e37f596 100644
--- a/apps/dashboard/src/components/overview/overview-live-histogram.tsx
+++ b/apps/dashboard/src/components/overview/overview-live-histogram.tsx
@@ -69,18 +69,16 @@ export function OverviewLiveHistogram({
const liveCount = countRes.data?.series[0]?.metrics?.sum ?? 0;
if (res.isInitialLoading || countRes.isInitialLoading) {
- // prettier-ignore
const staticArray = [
- 10, 25, 30, 45, 20, 5, 55, 18, 40, 12,
- 50, 35, 8, 22, 38, 42, 15, 28, 52, 5,
- 48, 14, 32, 58, 7, 19, 33, 56, 24, 5
+ 10, 25, 30, 45, 20, 5, 55, 18, 40, 12, 50, 35, 8, 22, 38, 42, 15, 28, 52,
+ 5, 48, 14, 32, 58, 7, 19, 33, 56, 24, 5,
];
return (
<Wrapper count={0}>
{staticArray.map((percent, i) => (
<div
- key={i}
+ key={i as number}
className="flex-1 animate-pulse rounded-t bg-def-200"
style={{ height: `${percent}%` }}
/>
@@ -102,7 +100,7 @@ export function OverviewLiveHistogram({
<div
className={cn(
'flex-1 rounded-t transition-all ease-in-out hover:scale-110',
- minute.count === 0 ? 'bg-def-200' : 'bg-highlight'
+ minute.count === 0 ? 'bg-def-200' : 'bg-highlight',
)}
style={{
height:
diff --git a/apps/dashboard/src/components/overview/overview-metrics.tsx b/apps/dashboard/src/components/overview/overview-metrics.tsx
index 67545a843..969b8eb8a 100644
--- a/apps/dashboard/src/components/overview/overview-metrics.tsx
+++ b/apps/dashboard/src/components/overview/overview-metrics.tsx
@@ -197,10 +197,11 @@ export default function OverviewMetrics({ projectId }: OverviewMetricsProps) {
<div className="card mb-2 grid grid-cols-4 overflow-hidden rounded-md">
{reports.map((report, index) => (
<button
- key={index}
+ type="button"
+ key={report.id}
className={cn(
'col-span-2 flex-1 shadow-[0_0_0_0.5px] shadow-border md:col-span-1',
- index === metric && 'bg-def-100'
+ index === metric && 'bg-def-100',
)}
onClick={() => {
setMetric(index);
@@ -211,7 +212,7 @@ export default function OverviewMetrics({ projectId }: OverviewMetricsProps) {
))}
<div
className={cn(
- 'col-span-4 min-h-16 flex-1 p-4 pb-0 shadow-[0_0_0_0.5px] shadow-border max-md:row-start-1 md:col-span-2'
+ 'col-span-4 min-h-16 flex-1 p-4 pb-0 shadow-[0_0_0_0.5px] shadow-border max-md:row-start-1 md:col-span-2',
)}
>
<OverviewLiveHistogram projectId={projectId} />
diff --git a/apps/dashboard/src/components/overview/overview-share/overview-share.tsx b/apps/dashboard/src/components/overview/overview-share/overview-share.tsx
index 2a47efa10..1a92d9bdb 100644
--- a/apps/dashboard/src/components/overview/overview-share/overview-share.tsx
+++ b/apps/dashboard/src/components/overview/overview-share/overview-share.tsx
@@ -31,8 +31,8 @@ export function OverviewShare({ data }: OverviewShareProps) {
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <Button icon={data && data.public ? Globe2Icon : LockIcon} responsive>
- {data && data.public ? 'Public' : 'Private'}
+ <Button icon={data?.public ? Globe2Icon : LockIcon} responsive>
+ {data?.public ? 'Public' : 'Private'}
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
diff --git a/apps/dashboard/src/components/overview/overview-top-bots.tsx b/apps/dashboard/src/components/overview/overview-top-bots.tsx
index 543406363..c90002a33 100644
--- a/apps/dashboard/src/components/overview/overview-top-bots.tsx
+++ b/apps/dashboard/src/components/overview/overview-top-bots.tsx
@@ -1,5 +1,5 @@
-import { useState } from 'react';
import { api } from '@/trpc/client';
+import { useState } from 'react';
import { Pagination } from '../pagination';
import { Tooltiper } from '../ui/tooltip';
@@ -23,7 +23,7 @@ const OverviewTopBots = ({ projectId }: Props) => {
{ projectId, cursor },
{
keepPreviousData: true,
- }
+ },
);
const data = res.data?.data ?? [];
const count = res.data?.count ?? 0;
diff --git a/apps/dashboard/src/components/overview/overview-top-devices.tsx b/apps/dashboard/src/components/overview/overview-top-devices.tsx
index 6dfc63e9e..d05eef7a2 100644
--- a/apps/dashboard/src/components/overview/overview-top-devices.tsx
+++ b/apps/dashboard/src/components/overview/overview-top-devices.tsx
@@ -1,8 +1,8 @@
'use client';
-import { useState } from 'react';
import { useEventQueryFilters } from '@/hooks/useEventQueryFilters';
import { cn } from '@/utils/cn';
+import { useState } from 'react';
import { NOT_SET_VALUE } from '@openpanel/constants';
import type { IChartType } from '@openpanel/validation';
@@ -295,6 +295,7 @@ export default function OverviewTopDevices({
<WidgetButtons>
{widgets.map((w) => (
<button
+ type="button"
key={w.key}
onClick={() => setWidget(w.key)}
className={cn(w.key === widget.key && 'active')}
diff --git a/apps/dashboard/src/components/overview/overview-top-events/overview-top-events.tsx b/apps/dashboard/src/components/overview/overview-top-events/overview-top-events.tsx
index 642cd56da..d291eb691 100644
--- a/apps/dashboard/src/components/overview/overview-top-events/overview-top-events.tsx
+++ b/apps/dashboard/src/components/overview/overview-top-events/overview-top-events.tsx
@@ -1,9 +1,9 @@
'use client';
-import { useState } from 'react';
import { ReportChart } from '@/components/report-chart';
import { useEventQueryFilters } from '@/hooks/useEventQueryFilters';
import { cn } from '@/utils/cn';
+import { useState } from 'react';
import type { IChartType } from '@openpanel/validation';
@@ -155,6 +155,7 @@ export default function OverviewTopEvents({
.filter((item) => item.hide !== true)
.map((w) => (
<button
+ type="button"
key={w.key}
onClick={() => setWidget(w.key)}
className={cn(w.key === widget.key && 'active')}
diff --git a/apps/dashboard/src/components/overview/overview-top-geo.tsx b/apps/dashboard/src/components/overview/overview-top-geo.tsx
index 84e1a5662..a6fc5a451 100644
--- a/apps/dashboard/src/components/overview/overview-top-geo.tsx
+++ b/apps/dashboard/src/components/overview/overview-top-geo.tsx
@@ -1,9 +1,9 @@
'use client';
-import { useState } from 'react';
import { useEventQueryFilters } from '@/hooks/useEventQueryFilters';
import { getCountry } from '@/translations/countries';
import { cn } from '@/utils/cn';
+import { useState } from 'react';
import { NOT_SET_VALUE } from '@openpanel/constants';
import type { IChartType } from '@openpanel/validation';
@@ -158,6 +158,7 @@ export default function OverviewTopGeo({ projectId }: OverviewTopGeoProps) {
<WidgetButtons>
{widgets.map((w) => (
<button
+ type="button"
key={w.key}
onClick={() => setWidget(w.key)}
className={cn(w.key === widget.key && 'active')}
diff --git a/apps/dashboard/src/components/overview/overview-top-pages.tsx b/apps/dashboard/src/components/overview/overview-top-pages.tsx
index 9386dfb69..85a2813f5 100644
--- a/apps/dashboard/src/components/overview/overview-top-pages.tsx
+++ b/apps/dashboard/src/components/overview/overview-top-pages.tsx
@@ -1,10 +1,10 @@
'use client';
-import { useState } from 'react';
import { useEventQueryFilters } from '@/hooks/useEventQueryFilters';
import { cn } from '@/utils/cn';
import { ExternalLinkIcon, FilterIcon, Globe2Icon } from 'lucide-react';
import { parseAsBoolean, useQueryState } from 'nuqs';
+import { useState } from 'react';
import { NOT_SET_VALUE } from '@openpanel/constants';
import type { IChartType } from '@openpanel/validation';
@@ -180,6 +180,7 @@ export default function OverviewTopPages({ projectId }: OverviewTopPagesProps) {
<WidgetButtons>
{widgets.map((w) => (
<button
+ type="button"
key={w.key}
onClick={() => setWidget(w.key)}
className={cn(w.key === widget.key && 'active')}
@@ -225,7 +226,7 @@ export default function OverviewTopPages({ projectId }: OverviewTopPagesProps) {
<WidgetFooter>
<OverviewDetailsButton chart={widget.chart.report} />
<OverviewChartToggle {...{ chartType, setChartType }} />
- <div className="flex-1"></div>
+ <div className="flex-1" />
<Button
variant={'ghost'}
onClick={() => {
diff --git a/apps/dashboard/src/components/overview/overview-top-sources.tsx b/apps/dashboard/src/components/overview/overview-top-sources.tsx
index 87eaa7b08..e3783b0f9 100644
--- a/apps/dashboard/src/components/overview/overview-top-sources.tsx
+++ b/apps/dashboard/src/components/overview/overview-top-sources.tsx
@@ -1,8 +1,8 @@
'use client';
-import { useState } from 'react';
import { useEventQueryFilters } from '@/hooks/useEventQueryFilters';
import { cn } from '@/utils/cn';
+import { useState } from 'react';
import type { IChartType } from '@openpanel/validation';
@@ -301,6 +301,7 @@ export default function OverviewTopSources({
<WidgetButtons>
{widgets.map((w) => (
<button
+ type="button"
key={w.key}
onClick={() => setWidget(w.key)}
className={cn(w.key === widget.key && 'active')}
diff --git a/apps/dashboard/src/components/overview/overview-widget.tsx b/apps/dashboard/src/components/overview/overview-widget.tsx
index c768d9349..34194dcb9 100644
--- a/apps/dashboard/src/components/overview/overview-widget.tsx
+++ b/apps/dashboard/src/components/overview/overview-widget.tsx
@@ -1,10 +1,10 @@
'use client';
-import { Children, useEffect, useRef, useState } from 'react';
import { useThrottle } from '@/hooks/useThrottle';
import { cn } from '@/utils/cn';
import { ChevronsUpDownIcon } from 'lucide-react';
import { last } from 'ramda';
+import { Children, useEffect, useRef, useState } from 'react';
import {
DropdownMenu,
@@ -21,7 +21,7 @@ export function WidgetHead({ className, ...props }: WidgetHeadProps) {
<WidgetHeadBase
className={cn(
'flex flex-col rounded-t-xl p-0 [&_.title]:flex [&_.title]:items-center [&_.title]:justify-between [&_.title]:p-4 [&_.title]:font-semibold',
- className
+ className,
)}
{...props}
/>
@@ -43,11 +43,11 @@ export function WidgetButtons({
if (sizes.current.length === 0) {
// Get buttons
const buttons: HTMLButtonElement[] = Array.from(
- container.current.querySelectorAll(`button`)
+ container.current.querySelectorAll('button'),
);
// Get sizes and cache them
sizes.current = buttons.map(
- (button) => Math.ceil(button.offsetWidth) + gap
+ (button) => Math.ceil(button.offsetWidth) + gap,
);
}
const containerWidth = container.current.offsetWidth;
@@ -62,7 +62,7 @@ export function WidgetButtons({
}
return { index, size: acc.size + size };
},
- { index: 0, size: 0 }
+ { index: 0, size: 0 },
);
setSlice(res.index);
@@ -86,7 +86,7 @@ export function WidgetButtons({
ref={container}
className={cn(
'-mb-px -mt-2 flex flex-wrap justify-start self-stretch px-4 transition-opacity [&_button.active]:border-b-2 [&_button.active]:border-black [&_button.active]:opacity-100 dark:[&_button.active]:border-white [&_button]:whitespace-nowrap [&_button]:py-1 [&_button]:text-sm [&_button]:opacity-50',
- className
+ className,
)}
style={{ gap }}
{...props}
@@ -96,7 +96,7 @@ export function WidgetButtons({
<div
className={cn(
'flex [&_button]:leading-normal',
- slice < index ? hidden : 'opacity-100'
+ slice < index ? hidden : 'opacity-100',
)}
>
{child}
@@ -106,9 +106,10 @@ export function WidgetButtons({
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button
+ type="button"
className={cn(
'flex select-none items-center gap-1',
- sizes.current.length - 1 === slice ? hidden : 'opacity-50'
+ sizes.current.length - 1 === slice ? hidden : 'opacity-50',
)}
>
More <ChevronsUpDownIcon size={12} />
@@ -138,7 +139,7 @@ export function WidgetFooter({
<div
className={cn(
'flex rounded-b-md border-t bg-def-100 p-2 py-1',
- className
+ className,
)}
{...props}
>
diff --git a/apps/dashboard/src/components/overview/useOverviewOptions.ts b/apps/dashboard/src/components/overview/useOverviewOptions.ts
index 89e226ea6..a04ff3645 100644
--- a/apps/dashboard/src/components/overview/useOverviewOptions.ts
+++ b/apps/dashboard/src/components/overview/useOverviewOptions.ts
@@ -19,17 +19,17 @@ const nuqsOptions = { history: 'push' } as const;
export function useOverviewOptions() {
const [startDate, setStartDate] = useQueryState(
'start',
- parseAsString.withOptions(nuqsOptions)
+ parseAsString.withOptions(nuqsOptions),
);
const [endDate, setEndDate] = useQueryState(
'end',
- parseAsString.withOptions(nuqsOptions)
+ parseAsString.withOptions(nuqsOptions),
);
const [range, setRange] = useQueryState(
'range',
parseAsStringEnum(mapKeys(timeWindows))
.withDefault('7d')
- .withOptions(nuqsOptions)
+ .withOptions(nuqsOptions),
);
const interval =
@@ -38,7 +38,7 @@ export function useOverviewOptions() {
const [metric, setMetric] = useQueryState(
'metric',
- parseAsInteger.withDefault(0).withOptions(nuqsOptions)
+ parseAsInteger.withDefault(0).withOptions(nuqsOptions),
);
return {
diff --git a/apps/dashboard/src/components/overview/useOverviewWidget.tsx b/apps/dashboard/src/components/overview/useOverviewWidget.tsx
index 72d77aaaa..7a155e2a1 100644
--- a/apps/dashboard/src/components/overview/useOverviewWidget.tsx
+++ b/apps/dashboard/src/components/overview/useOverviewWidget.tsx
@@ -9,14 +9,14 @@ export function useOverviewWidget<T extends string>(
widgets: Record<
T,
{ title: string; btn: string; chart: ReportChartProps; hide?: boolean }
- >
+ >,
) {
const keys = Object.keys(widgets) as T[];
const [widget, setWidget] = useQueryState<T>(
key,
parseAsStringEnum(keys)
.withDefault(keys[0]!)
- .withOptions({ history: 'push' })
+ .withOptions({ history: 'push' }),
);
return [
{
diff --git a/apps/dashboard/src/components/page-tabs.tsx b/apps/dashboard/src/components/page-tabs.tsx
index 2e19ea05c..b55042790 100644
--- a/apps/dashboard/src/components/page-tabs.tsx
+++ b/apps/dashboard/src/components/page-tabs.tsx
@@ -30,7 +30,7 @@ export function PageTabsLink({
<Link
className={cn(
'inline-block opacity-100 transition-transform hover:translate-y-[-1px]',
- isActive ? 'opacity-100' : 'opacity-50'
+ isActive ? 'opacity-100' : 'opacity-50',
)}
href={href}
>
@@ -50,9 +50,10 @@ export function PageTabsItem({
}) {
return (
<button
+ type="button"
className={cn(
'inline-block opacity-100 transition-transform hover:translate-y-[-1px]',
- isActive ? 'opacity-100' : 'opacity-50'
+ isActive ? 'opacity-100' : 'opacity-50',
)}
onClick={onClick}
>
diff --git a/apps/dashboard/src/components/pagination.tsx b/apps/dashboard/src/components/pagination.tsx
index efba9a448..35a254b13 100644
--- a/apps/dashboard/src/components/pagination.tsx
+++ b/apps/dashboard/src/components/pagination.tsx
@@ -1,5 +1,3 @@
-import type { Dispatch, SetStateAction } from 'react';
-import { useState } from 'react';
import { cn } from '@/utils/cn';
import {
ChevronLeftIcon,
@@ -7,6 +5,8 @@ import {
ChevronsLeftIcon,
ChevronsRightIcon,
} from 'lucide-react';
+import type { Dispatch, SetStateAction } from 'react';
+import { useState } from 'react';
import { Button } from './ui/button';
@@ -45,7 +45,7 @@ export function Pagination({
<div
className={cn(
'flex select-none items-center justify-end gap-1',
- className
+ className,
)}
>
{size === 'base' && (
diff --git a/apps/dashboard/src/components/profiles/profile-avatar.tsx b/apps/dashboard/src/components/profiles/profile-avatar.tsx
index 125c0ace6..0fc1d22d6 100644
--- a/apps/dashboard/src/components/profiles/profile-avatar.tsx
+++ b/apps/dashboard/src/components/profiles/profile-avatar.tsx
@@ -47,7 +47,7 @@ export function ProfileAvatar({
: size === 'xs'
? 'text-[8px]'
: 'text-base',
- 'bg-def-200 text-muted-foreground'
+ 'bg-def-200 text-muted-foreground',
)}
>
{firstName?.at(0) ?? '🫣'}
diff --git a/apps/dashboard/src/components/profiles/table/index.tsx b/apps/dashboard/src/components/profiles/table/index.tsx
index 9b78e5960..b98e3e766 100644
--- a/apps/dashboard/src/components/profiles/table/index.tsx
+++ b/apps/dashboard/src/components/profiles/table/index.tsx
@@ -1,5 +1,3 @@
-import { memo } from 'react';
-import type { Dispatch, SetStateAction } from 'react';
import { DataTable } from '@/components/data-table';
import { FullPageEmptyState } from '@/components/full-page-empty-state';
import { Pagination } from '@/components/pagination';
@@ -8,6 +6,8 @@ import { TableSkeleton } from '@/components/ui/table';
import type { UseQueryResult } from '@tanstack/react-query';
import isEqual from 'lodash.isequal';
import { GanttChartIcon } from 'lucide-react';
+import { memo } from 'react';
+import type { Dispatch, SetStateAction } from 'react';
import type { IServiceProfile } from '@openpanel/db';
@@ -58,7 +58,7 @@ export const ProfilesTable = memo(
className="mt-2"
setCursor={props.setCursor}
cursor={props.cursor}
- count={Infinity}
+ count={Number.POSITIVE_INFINITY}
take={50}
loading={isFetching}
/>
@@ -68,7 +68,7 @@ export const ProfilesTable = memo(
},
(prevProps, nextProps) => {
return isEqual(prevProps.query.data, nextProps.query.data);
- }
+ },
);
ProfilesTable.displayName = 'ProfilesTable';
diff --git a/apps/dashboard/src/components/projects/project-card.tsx b/apps/dashboard/src/components/projects/project-card.tsx
index 2cbce8e91..17a606496 100644
--- a/apps/dashboard/src/components/projects/project-card.tsx
+++ b/apps/dashboard/src/components/projects/project-card.tsx
@@ -1,9 +1,9 @@
-import { Suspense } from 'react';
import { shortNumber } from '@/hooks/useNumerFormatter';
+import { Suspense } from 'react';
import { escape } from 'sqlstring';
import type { IServiceProject } from '@openpanel/db';
-import { chQuery, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, chQuery } from '@openpanel/db';
import { ChartSSR } from '../chart-ssr';
import { FadeIn } from '../fade-in';
@@ -34,7 +34,7 @@ function ProjectCard({ id, name, organizationSlug }: IServiceProject) {
async function ProjectChart({ id }: { id: string }) {
const chart = await chQuery<{ value: number; date: string }>(
- `SELECT countDistinct(profile_id) as value, toStartOfDay(created_at) as date FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(id)} AND name = 'session_start' AND created_at >= now() - interval '1 month' GROUP BY date ORDER BY date ASC`
+ `SELECT countDistinct(profile_id) as value, toStartOfDay(created_at) as date FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(id)} AND name = 'session_start' AND created_at >= now() - interval '1 month' GROUP BY date ORDER BY date ASC`,
);
return (
@@ -70,7 +70,7 @@ async function ProjectMetrics({ id }: { id: string }) {
(
SELECT count(DISTINCT profile_id) as count FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(id)} AND created_at >= now() - interval '1 day'
) as day
- `
+ `,
);
return (
diff --git a/apps/dashboard/src/components/report-chart/area/chart.tsx b/apps/dashboard/src/components/report-chart/area/chart.tsx
index 0c821410e..02e61159a 100644
--- a/apps/dashboard/src/components/report-chart/area/chart.tsx
+++ b/apps/dashboard/src/components/report-chart/area/chart.tsx
@@ -1,6 +1,5 @@
'use client';
-import React, { useCallback } from 'react';
import { useRechartDataModel } from '@/hooks/useRechartDataModel';
import { useVisibleSeries } from '@/hooks/useVisibleSeries';
import { api } from '@/trpc/client';
@@ -9,6 +8,7 @@ import { cn } from '@/utils/cn';
import { getChartColor } from '@/utils/theme';
import { isSameDay, isSameHour, isSameMonth } from 'date-fns';
import { last } from 'ramda';
+import React, { useCallback } from 'react';
import {
Area,
CartesianGrid,
@@ -57,7 +57,7 @@ export function Chart({ data }: Props) {
},
{
staleTime: 1000 * 60 * 10,
- }
+ },
);
const { series, setVisibleSeries } = useVisibleSeries(data);
const rechartData = useRechartDataModel(series);
@@ -73,7 +73,7 @@ export function Chart({ data }: Props) {
id: string,
col1: string,
col2: string,
- percentChange: number
+ percentChange: number,
) => (
<linearGradient id={id} x1="0" y1="0" x2="100%" y2="0">
<stop offset="0%" stopColor={col1} />
@@ -177,29 +177,25 @@ export function Chart({ data }: Props) {
x2="0"
y2="1"
>
- <stop
- offset="0%"
- stopColor={color}
- stopOpacity={0.8}
- ></stop>
+ <stop offset="0%" stopColor={color} stopOpacity={0.8} />
<stop
offset="100%"
stopColor={color}
stopOpacity={0.1}
- ></stop>
+ />
</linearGradient>
)}
{gradientTwoColors(
`hideAllButLastInterval_${serie.id}`,
'rgba(0,0,0,0)',
color,
- lastIntervalPercent
+ lastIntervalPercent,
)}
{gradientTwoColors(
`hideJustLastInterval_${serie.id}`,
color,
'rgba(0,0,0,0)',
- lastIntervalPercent
+ lastIntervalPercent,
)}
</defs>
<Line
diff --git a/apps/dashboard/src/components/report-chart/bar/chart.tsx b/apps/dashboard/src/components/report-chart/bar/chart.tsx
index 101958923..4a4f7392b 100644
--- a/apps/dashboard/src/components/report-chart/bar/chart.tsx
+++ b/apps/dashboard/src/components/report-chart/bar/chart.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useMemo } from 'react';
import {
DropdownMenu,
DropdownMenuContent,
@@ -11,6 +10,7 @@ import { useNumber } from '@/hooks/useNumerFormatter';
import type { IChartData } from '@/trpc/client';
import { cn } from '@/utils/cn';
import { DropdownMenuPortal } from '@radix-ui/react-dropdown-menu';
+import { useMemo } from 'react';
import { round } from '@openpanel/common';
import { NOT_SET_VALUE } from '@openpanel/constants';
@@ -33,7 +33,7 @@ export function Chart({ data }: Props) {
const number = useNumber();
const series = useMemo(
() => (isEditMode ? data.series : data.series.slice(0, limit || 10)),
- [data, isEditMode, limit]
+ [data, isEditMode, limit],
);
const maxCount = Math.max(...series.map((serie) => serie.metrics[metric]));
@@ -41,7 +41,7 @@ export function Chart({ data }: Props) {
<div
className={cn(
'flex flex-col text-sm',
- isEditMode ? 'card gap-2 p-4 text-base' : '-m-3 gap-1'
+ isEditMode ? 'card gap-2 p-4 text-base' : '-m-3 gap-1',
)}
>
{series.map((serie) => {
@@ -56,7 +56,7 @@ export function Chart({ data }: Props) {
<div
className={cn(
'relative',
- (isClickable || isDropDownEnabled) && 'cursor-pointer'
+ (isClickable || isDropDownEnabled) && 'cursor-pointer',
)}
{...(isClickable && !isDropDownEnabled
? { onClick: () => onClick?.(serie) }
@@ -80,7 +80,7 @@ export function Chart({ data }: Props) {
{serie.metrics.previous?.[metric]?.value}
<div className="text-muted-foreground">
{number.format(
- round((serie.metrics.sum / data.metrics.sum) * 100, 2)
+ round((serie.metrics.sum / data.metrics.sum) * 100, 2),
)}
%
</div>
diff --git a/apps/dashboard/src/components/report-chart/bar/index.tsx b/apps/dashboard/src/components/report-chart/bar/index.tsx
index 4bc456624..5ffc7b2ff 100644
--- a/apps/dashboard/src/components/report-chart/bar/index.tsx
+++ b/apps/dashboard/src/components/report-chart/bar/index.tsx
@@ -33,12 +33,15 @@ function Loading() {
return (
<AspectContainer className="col gap-4 overflow-hidden">
{Array.from({ length: 10 }).map((_, index) => (
- <div key={index} className="row animate-pulse justify-between">
- <div className="h-4 w-2/5 rounded bg-def-200"></div>
+ <div
+ key={index as number}
+ className="row animate-pulse justify-between"
+ >
+ <div className="h-4 w-2/5 rounded bg-def-200" />
<div className="row w-1/5 gap-2">
- <div className="h-4 w-full rounded bg-def-200"></div>
- <div className="h-4 w-full rounded bg-def-200"></div>
- <div className="h-4 w-full rounded bg-def-200"></div>
+ <div className="h-4 w-full rounded bg-def-200" />
+ <div className="h-4 w-full rounded bg-def-200" />
+ <div className="h-4 w-full rounded bg-def-200" />
</div>
</div>
))}
diff --git a/apps/dashboard/src/components/report-chart/common/axis.tsx b/apps/dashboard/src/components/report-chart/common/axis.tsx
index 96e49e135..623279f0d 100644
--- a/apps/dashboard/src/components/report-chart/common/axis.tsx
+++ b/apps/dashboard/src/components/report-chart/common/axis.tsx
@@ -1,8 +1,8 @@
-import { useRef, useState } from 'react';
import { useDebounceFn } from '@/hooks/useDebounceFn';
import { useFormatDateInterval } from '@/hooks/useFormatDateInterval';
import { useNumber } from '@/hooks/useNumerFormatter';
import { isNil } from 'ramda';
+import { useRef, useState } from 'react';
import type { AxisDomain } from 'recharts/types/util/types';
import type { IInterval } from '@openpanel/validation';
@@ -60,10 +60,10 @@ export const useXAxisProps = (
} = {
hide: false,
interval: 'auto',
- }
+ },
) => {
const formatDate = useFormatDateInterval(
- interval === 'auto' ? 'day' : interval
+ interval === 'auto' ? 'day' : interval,
);
return {
height: hide ? 0 : 14,
diff --git a/apps/dashboard/src/components/report-chart/common/loading.tsx b/apps/dashboard/src/components/report-chart/common/loading.tsx
index 0886fc244..4b2a6ef0d 100644
--- a/apps/dashboard/src/components/report-chart/common/loading.tsx
+++ b/apps/dashboard/src/components/report-chart/common/loading.tsx
@@ -1,3 +1,3 @@
export function ReportChartLoading() {
- return <div className="h-full w-full animate-pulse rounded bg-def-100"></div>;
+ return <div className="h-full w-full animate-pulse rounded bg-def-100" />;
}
diff --git a/apps/dashboard/src/components/report-chart/common/previous-diff-indicator.tsx b/apps/dashboard/src/components/report-chart/common/previous-diff-indicator.tsx
index 8d1cf3c3d..e33bb3f96 100644
--- a/apps/dashboard/src/components/report-chart/common/previous-diff-indicator.tsx
+++ b/apps/dashboard/src/components/report-chart/common/previous-diff-indicator.tsx
@@ -9,7 +9,7 @@ export function getDiffIndicator<A, B, C>(
state: string | undefined | null,
positive: A,
negative: B,
- neutral: C
+ neutral: C,
): A | B | C {
if (state === 'neutral' || !state) {
return neutral;
@@ -48,7 +48,7 @@ export function PreviousDiffIndicator({
state,
'bg-emerald-300',
'bg-rose-300',
- undefined
+ undefined,
);
const number = useNumber();
@@ -72,14 +72,14 @@ export function PreviousDiffIndicator({
className={cn(
'flex items-center gap-1 font-mono font-medium',
size === 'lg' && 'gap-2',
- className
+ className,
)}
>
<div
className={cn(
- `flex size-4 items-center justify-center rounded-full`,
+ 'flex size-4 items-center justify-center rounded-full',
variant,
- size === 'lg' && 'size-8'
+ size === 'lg' && 'size-8',
)}
>
{renderIcon()}
diff --git a/apps/dashboard/src/components/report-chart/common/report-chart-tooltip.tsx b/apps/dashboard/src/components/report-chart/common/report-chart-tooltip.tsx
index 8ba4734e9..b837059f0 100644
--- a/apps/dashboard/src/components/report-chart/common/report-chart-tooltip.tsx
+++ b/apps/dashboard/src/components/report-chart/common/report-chart-tooltip.tsx
@@ -1,4 +1,3 @@
-import React, { useEffect, useState } from 'react';
import { useFormatDateInterval } from '@/hooks/useFormatDateInterval';
import { useNumber } from '@/hooks/useNumerFormatter';
import type { IRechartPayloadItem } from '@/hooks/useRechartDataModel';
@@ -6,6 +5,7 @@ import type { IToolTipProps } from '@/types';
import * as Portal from '@radix-ui/react-portal';
import { bind } from 'bind-event-listener';
import throttle from 'lodash.throttle';
+import React, { useEffect, useState } from 'react';
import { useReportChartContext } from '../context';
import { PreviousDiffIndicator } from './previous-diff-indicator';
@@ -29,7 +29,7 @@ export function ReportChartTooltip({
const formatDate = useFormatDateInterval(interval);
const number = useNumber();
const [position, setPosition] = useState<{ x: number; y: number } | null>(
- null
+ null,
);
const inactive = !active || !payload?.length;
diff --git a/apps/dashboard/src/components/report-chart/common/report-table.tsx b/apps/dashboard/src/components/report-chart/common/report-table.tsx
index 0f0060536..bd00f2a57 100644
--- a/apps/dashboard/src/components/report-chart/common/report-table.tsx
+++ b/apps/dashboard/src/components/report-chart/common/report-table.tsx
@@ -1,4 +1,3 @@
-import * as React from 'react';
import { Pagination, usePagination } from '@/components/pagination';
import { Stats, StatsCard } from '@/components/stats';
import { Badge } from '@/components/ui/badge';
@@ -18,6 +17,7 @@ import { useSelector } from '@/redux';
import { getPropertyLabel } from '@/translations/properties';
import type { IChartData } from '@/trpc/client';
import { getChartColor } from '@/utils/theme';
+import type * as React from 'react';
import { PreviousDiffIndicator } from './previous-diff-indicator';
import { SerieName } from './serie-name';
@@ -45,9 +45,8 @@ export function ReportTable({
setVisibleSeries((prev) => {
if (checked) {
return [...prev, name];
- } else {
- return prev.filter((item) => item !== name);
}
+ return prev.filter((item) => item !== name);
});
}
@@ -77,7 +76,7 @@ export function ReportTable({
<TableBody className="bg-def-100">
{paginate(data.series).map((serie, index) => {
const checked = !!visibleSeries.find(
- (item) => item.id === serie.id
+ (item) => item.id === serie.id,
);
return (
diff --git a/apps/dashboard/src/components/report-chart/common/serie-icon.flags.tsx b/apps/dashboard/src/components/report-chart/common/serie-icon.flags.tsx
index a3ea22f5b..f338864f3 100644
--- a/apps/dashboard/src/components/report-chart/common/serie-icon.flags.tsx
+++ b/apps/dashboard/src/components/report-chart/common/serie-icon.flags.tsx
@@ -1,13 +1,11 @@
import type { LucideIcon, LucideProps } from 'lucide-react';
const createFlagIcon = (url: string) => {
- return function (_props: LucideProps) {
- return (
- <span
- className={`fi !block aspect-[1.33] overflow-hidden rounded-[2px] fi-${url}`}
- ></span>
- );
- } as LucideIcon;
+ return ((_props: LucideProps) => (
+ <span
+ className={`fi !block aspect-[1.33] overflow-hidden rounded-[2px] fi-${url}`}
+ />
+ )) as LucideIcon;
};
const data = {
diff --git a/apps/dashboard/src/components/report-chart/common/serie-icon.tsx b/apps/dashboard/src/components/report-chart/common/serie-icon.tsx
index be5a92ab8..2975a9905 100644
--- a/apps/dashboard/src/components/report-chart/common/serie-icon.tsx
+++ b/apps/dashboard/src/components/report-chart/common/serie-icon.tsx
@@ -1,4 +1,3 @@
-import { useMemo } from 'react';
import type { LucideIcon, LucideProps } from 'lucide-react';
import {
ActivityIcon,
@@ -15,6 +14,7 @@ import {
TabletIcon,
TvIcon,
} from 'lucide-react';
+import { useMemo } from 'react';
import { NOT_SET_VALUE } from '@openpanel/constants';
@@ -30,9 +30,13 @@ function getProxyImage(url: string) {
}
const createImageIcon = (url: string) => {
- return function (_props: LucideProps) {
- return <img className="max-h-4 rounded-[2px] object-contain" src={url} />;
- } as LucideIcon;
+ return ((_props: LucideProps) => (
+ <img
+ alt="serie icon"
+ className="max-h-4 rounded-[2px] object-contain"
+ src={url}
+ />
+ )) as LucideIcon;
};
const mapper: Record<string, LucideIcon> = {
@@ -60,7 +64,7 @@ const mapper: Record<string, LucideIcon> = {
...acc,
[key]: createImageIcon(getProxyImage(value)),
}),
- {}
+ {},
),
...flags,
diff --git a/apps/dashboard/src/components/report-chart/common/serie-icon.urls.ts b/apps/dashboard/src/components/report-chart/common/serie-icon.urls.ts
index 072a99e1a..92767dc97 100644
--- a/apps/dashboard/src/components/report-chart/common/serie-icon.urls.ts
+++ b/apps/dashboard/src/components/report-chart/common/serie-icon.urls.ts
@@ -1,19 +1,20 @@
-// prettier-ignore
+// biome-ignore format: annoying
+
const data = {
'chromium os': 'https://upload.wikimedia.org/wikipedia/commons/2/28/Chromium_Logo.svg',
'mac os': 'https://upload.wikimedia.org/wikipedia/commons/thumb/3/30/MacOS_logo.svg/1200px-MacOS_logo.svg.png',
- 'apple': 'https://sladesportfolio.wordpress.com/wp-content/uploads/2015/08/apple_logo_black-svg.png',
- 'huawei': 'https://upload.wikimedia.org/wikipedia/en/0/04/Huawei_Standard_logo.svg',
- 'xiaomi': 'https://upload.wikimedia.org/wikipedia/commons/2/29/Xiaomi_logo.svg',
- 'sony': 'https://serialtrainer7.com/wp-content/uploads/2021/07/sony-logo-300px-square.png',
- 'lg': 'https://upload.wikimedia.org/wikipedia/commons/2/20/LG_symbol.svg',
- 'samsung': 'https://seekvectors.com/storage/images/Samsung-Logo-22.svg',
- 'oppo': 'https://indoleads.nyc3.cdn.digitaloceanspaces.com/uploads/offers/logos/8695_95411e367b832.png',
- 'motorola': 'https://upload.wikimedia.org/wikipedia/commons/8/8f/Motorola_M_symbol_blue.svg',
- 'oneplus': 'https://pbs.twimg.com/profile_images/1709165009148809216/ebHb4xhF_400x400.png',
- 'asus': 'https://cdn-icons-png.freepik.com/512/5969/5969050.png',
- 'fairphone': 'https://cdn.dribbble.com/users/433772/screenshots/2109827/fairphone_dribbble.jpg',
- 'nokia': 'https://www.gizchina.com/wp-content/uploads/images/2023/02/Nokia-logo.webp',
+ apple: 'https://sladesportfolio.wordpress.com/wp-content/uploads/2015/08/apple_logo_black-svg.png',
+ huawei: 'https://upload.wikimedia.org/wikipedia/en/0/04/Huawei_Standard_logo.svg',
+ xiaomi: 'https://upload.wikimedia.org/wikipedia/commons/2/29/Xiaomi_logo.svg',
+ sony: 'https://serialtrainer7.com/wp-content/uploads/2021/07/sony-logo-300px-square.png',
+ lg: 'https://upload.wikimedia.org/wikipedia/commons/2/20/LG_symbol.svg',
+ samsung: 'https://seekvectors.com/storage/images/Samsung-Logo-22.svg',
+ oppo: 'https://indoleads.nyc3.cdn.digitaloceanspaces.com/uploads/offers/logos/8695_95411e367b832.png',
+ motorola: 'https://upload.wikimedia.org/wikipedia/commons/8/8f/Motorola_M_symbol_blue.svg',
+ oneplus: 'https://pbs.twimg.com/profile_images/1709165009148809216/ebHb4xhF_400x400.png',
+ asus: 'https://cdn-icons-png.freepik.com/512/5969/5969050.png',
+ fairphone: 'https://cdn.dribbble.com/users/433772/screenshots/2109827/fairphone_dribbble.jpg',
+ nokia: 'https://www.gizchina.com/wp-content/uploads/images/2023/02/Nokia-logo.webp',
'mobile safari': 'https://upload.wikimedia.org/wikipedia/commons/5/52/Safari_browser_logo.svg',
'openpanel.dev': 'https://openpanel.dev',
'samsung internet': 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Samsung_Internet_logo.svg/1024px-Samsung_Internet_logo.svg.png',
@@ -21,12 +22,12 @@ const data = {
'yahoo!': 'https://yahoo.com',
android: 'https://image.similarpng.com/very-thumbnail/2020/08/Android-icon-on-transparent--background-PNG.png',
'android browser': 'https://image.similarpng.com/very-thumbnail/2020/08/Android-icon-on-transparent--background-PNG.png',
- 'silk': 'https://m.media-amazon.com/images/I/51VCjQCvF0L.png',
- 'kakaotalk': 'https://www.kakaocorp.com/',
+ silk: 'https://m.media-amazon.com/images/I/51VCjQCvF0L.png',
+ kakaotalk: 'https://www.kakaocorp.com/',
bing: 'https://bing.com',
- 'electron': 'https://www.electronjs.org',
- 'whale': 'https://whale.naver.com',
- 'wechat': 'https://wechat.com',
+ electron: 'https://www.electronjs.org',
+ whale: 'https://whale.naver.com',
+ wechat: 'https://wechat.com',
chrome: 'https://upload.wikimedia.org/wikipedia/commons/e/e1/Google_Chrome_icon_%28February_2022%29.svg',
'chrome webview': 'https://upload.wikimedia.org/wikipedia/commons/e/e1/Google_Chrome_icon_%28February_2022%29.svg',
'chrome headless': 'https://upload.wikimedia.org/wikipedia/commons/e/e1/Google_Chrome_icon_%28February_2022%29.svg',
@@ -68,8 +69,8 @@ const data = {
tiktok: 'https://tiktok.com',
sharpspring: 'https://sharpspring.com',
'hacker news': 'https://news.ycombinator.com',
- 'betalist': 'https://betalist.com',
- 'qwant': 'https://www.qwant.com',
+ betalist: 'https://betalist.com',
+ qwant: 'https://www.qwant.com',
flipboard: 'https://flipboard.com/',
trustpilot: 'https://trustpilot.com',
'outlook.com': 'https://login.live.com/',
diff --git a/apps/dashboard/src/components/report-chart/common/serie-name.tsx b/apps/dashboard/src/components/report-chart/common/serie-name.tsx
index 2b29de538..e4c5fcc05 100644
--- a/apps/dashboard/src/components/report-chart/common/serie-name.tsx
+++ b/apps/dashboard/src/components/report-chart/common/serie-name.tsx
@@ -3,6 +3,7 @@ import { ChevronRightIcon } from 'lucide-react';
import { NOT_SET_VALUE } from '@openpanel/constants';
+import React, { Fragment } from 'react';
import { useReportChartContext } from '../context';
interface SerieNameProps {
@@ -23,12 +24,12 @@ export function SerieName({ name, className }: SerieNameProps) {
<div className={cn('flex items-center gap-1', className)}>
{name.map((n, index) => {
return (
- <>
+ <Fragment key={n}>
<span>{n || NOT_SET_VALUE}</span>
{name.length - 1 > index && (
<ChevronRightIcon className="text-muted-foreground" size={12} />
)}
- </>
+ </Fragment>
);
})}
</div>
diff --git a/apps/dashboard/src/components/report-chart/context.tsx b/apps/dashboard/src/components/report-chart/context.tsx
index f686b9c93..ad51537ed 100644
--- a/apps/dashboard/src/components/report-chart/context.tsx
+++ b/apps/dashboard/src/components/report-chart/context.tsx
@@ -1,6 +1,6 @@
-import { createContext, useContext, useEffect, useState } from 'react';
import isEqual from 'lodash.isequal';
import type { LucideIcon } from 'lucide-react';
+import { createContext, useContext, useEffect, useState } from 'react';
import type {
IChartInput,
@@ -46,14 +46,14 @@ export const useReportChartContext = () => {
const ctx = useContext(context);
if (!ctx) {
throw new Error(
- 'useReportChartContext must be used within a ReportChartProvider'
+ 'useReportChartContext must be used within a ReportChartProvider',
);
}
return ctx;
};
export const useSelectReportChartContext = <T,>(
- selector: (ctx: ReportChartContextType) => T
+ selector: (ctx: ReportChartContextType) => T,
) => {
const ctx = useReportChartContext();
const [state, setState] = useState(selector(ctx));
diff --git a/apps/dashboard/src/components/report-chart/funnel/chart.tsx b/apps/dashboard/src/components/report-chart/funnel/chart.tsx
index 20ccec253..ef647b767 100644
--- a/apps/dashboard/src/components/report-chart/funnel/chart.tsx
+++ b/apps/dashboard/src/components/report-chart/funnel/chart.tsx
@@ -17,7 +17,7 @@ import { PreviousDiffIndicator } from '../common/previous-diff-indicator';
import { useReportChartContext } from '../context';
const findMostDropoffs = (
- steps: RouterOutputs['chart']['funnel']['current']['steps']
+ steps: RouterOutputs['chart']['funnel']['current']['steps'],
) => {
return steps.reduce((acc, step) => {
if (step.dropoffCount > acc.dropoffCount) {
@@ -58,7 +58,7 @@ export function Chart({
<div
className={cn(
'border border-border',
- !isEditMode && 'border-0 border-b'
+ !isEditMode && 'border-0 border-b',
)}
>
<div className="flex items-center gap-8 p-4">
@@ -72,7 +72,7 @@ export function Chart({
<div
className="w-full bg-def-400"
style={{ height: `${step.percent}%` }}
- ></div>
+ />
</div>
);
})}
@@ -129,7 +129,7 @@ export function Chart({
<PreviousDiffIndicator
{...getPreviousMetric(
step.previousCount,
- previous.steps[index]?.previousCount
+ previous.steps[index]?.previousCount,
)}
/>
</div>
@@ -160,7 +160,7 @@ export function Chart({
inverted
{...getPreviousMetric(
step.dropoffCount,
- previous.steps[index]?.dropoffCount
+ previous.steps[index]?.dropoffCount,
)}
/>
</div>
@@ -174,7 +174,7 @@ export function Chart({
<span
className={cn(
'flex items-center gap-1 text-lg font-bold',
- isMostDropoffs && 'text-rose-500'
+ isMostDropoffs && 'text-rose-500',
)}
>
{isMostDropoffs && <AlertCircleIcon size={14} />}
@@ -196,7 +196,7 @@ export function Chart({
<PreviousDiffIndicator
{...getPreviousMetric(
step.count,
- previous.steps[index]?.count
+ previous.steps[index]?.count,
)}
/>
</div>
@@ -208,7 +208,7 @@ export function Chart({
</span>
<div className="flex items-center gap-4">
<span className="text-lg font-bold">{step.count}</span>
- {/* <button
+ {/* <button type="button"
className="ml-2 underline"
onClick={() =>
pushModal('FunnelStepDetails', {
@@ -234,6 +234,6 @@ export function Chart({
);
})}
</div>
- </div>
+ </div>,
);
}
diff --git a/apps/dashboard/src/components/report-chart/histogram/chart.tsx b/apps/dashboard/src/components/report-chart/histogram/chart.tsx
index a023ff239..5349b4c68 100644
--- a/apps/dashboard/src/components/report-chart/histogram/chart.tsx
+++ b/apps/dashboard/src/components/report-chart/histogram/chart.tsx
@@ -1,10 +1,10 @@
-import React from 'react';
import { useRechartDataModel } from '@/hooks/useRechartDataModel';
import { useVisibleSeries } from '@/hooks/useVisibleSeries';
import type { IChartData } from '@/trpc/client';
import { cn } from '@/utils/cn';
import { getChartColor, theme } from '@/utils/theme';
import { useTheme } from 'next-themes';
+import React from 'react';
import {
Bar,
BarChart,
diff --git a/apps/dashboard/src/components/report-chart/index.tsx b/apps/dashboard/src/components/report-chart/index.tsx
index 92dad234c..c1c57630d 100644
--- a/apps/dashboard/src/components/report-chart/index.tsx
+++ b/apps/dashboard/src/components/report-chart/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import React, { useEffect, useRef } from 'react';
import { mergeDeepRight } from 'ramda';
+import React, { useEffect, useRef } from 'react';
import { useInViewport } from 'react-in-viewport';
import { ReportAreaChart } from './area';
diff --git a/apps/dashboard/src/components/report-chart/line/chart.tsx b/apps/dashboard/src/components/report-chart/line/chart.tsx
index a86d55fde..55550d833 100644
--- a/apps/dashboard/src/components/report-chart/line/chart.tsx
+++ b/apps/dashboard/src/components/report-chart/line/chart.tsx
@@ -1,6 +1,5 @@
'use client';
-import React, { useCallback } from 'react';
import { useRechartDataModel } from '@/hooks/useRechartDataModel';
import { useVisibleSeries } from '@/hooks/useVisibleSeries';
import { api } from '@/trpc/client';
@@ -9,6 +8,7 @@ import { cn } from '@/utils/cn';
import { getChartColor } from '@/utils/theme';
import { isSameDay, isSameHour, isSameMonth } from 'date-fns';
import { last } from 'ramda';
+import React, { useCallback } from 'react';
import {
Area,
CartesianGrid,
@@ -57,7 +57,7 @@ export function Chart({ data }: Props) {
},
{
staleTime: 1000 * 60 * 10,
- }
+ },
);
const { series, setVisibleSeries } = useVisibleSeries(data);
const rechartData = useRechartDataModel(series);
@@ -73,7 +73,7 @@ export function Chart({ data }: Props) {
id: string,
col1: string,
col2: string,
- percentChange: number
+ percentChange: number,
) => (
<linearGradient id={id} x1="0" y1="0" x2="100%" y2="0">
<stop offset="0%" stopColor={col1} />
@@ -177,29 +177,25 @@ export function Chart({ data }: Props) {
x2="0"
y2="1"
>
- <stop
- offset="0%"
- stopColor={color}
- stopOpacity={0.8}
- ></stop>
+ <stop offset="0%" stopColor={color} stopOpacity={0.8} />
<stop
offset="100%"
stopColor={color}
stopOpacity={0.1}
- ></stop>
+ />
</linearGradient>
)}
{gradientTwoColors(
`hideAllButLastInterval_${serie.id}`,
'rgba(0,0,0,0)',
color,
- lastIntervalPercent
+ lastIntervalPercent,
)}
{gradientTwoColors(
`hideJustLastInterval_${serie.id}`,
color,
'rgba(0,0,0,0)',
- lastIntervalPercent
+ lastIntervalPercent,
)}
</defs>
<Line
diff --git a/apps/dashboard/src/components/report-chart/map/chart.tsx b/apps/dashboard/src/components/report-chart/map/chart.tsx
index c9db76661..714772d4a 100644
--- a/apps/dashboard/src/components/report-chart/map/chart.tsx
+++ b/apps/dashboard/src/components/report-chart/map/chart.tsx
@@ -1,7 +1,7 @@
-import { useMemo } from 'react';
import { useVisibleSeries } from '@/hooks/useVisibleSeries';
import type { IChartData } from '@/trpc/client';
import { theme } from '@/utils/theme';
+import { useMemo } from 'react';
import WorldMap from 'react-svg-worldmap';
import AutoSizer from 'react-virtualized-auto-sizer';
@@ -23,7 +23,7 @@ export function Chart({ data }: Props) {
country: s.names[0]?.toLowerCase() ?? '',
value: s.metrics[metric],
})),
- [series, metric]
+ [series, metric],
);
return (
diff --git a/apps/dashboard/src/components/report-chart/metric/chart.tsx b/apps/dashboard/src/components/report-chart/metric/chart.tsx
index c8106b36c..c961d1b1a 100644
--- a/apps/dashboard/src/components/report-chart/metric/chart.tsx
+++ b/apps/dashboard/src/components/report-chart/metric/chart.tsx
@@ -21,7 +21,7 @@ export function Chart({ data }: Props) {
<div
className={cn(
'grid grid-cols-1 gap-4',
- isEditMode && 'md:grid-cols-2 lg:grid-cols-3'
+ isEditMode && 'md:grid-cols-2 lg:grid-cols-3',
)}
>
{series.map((serie) => {
diff --git a/apps/dashboard/src/components/report-chart/metric/index.tsx b/apps/dashboard/src/components/report-chart/metric/index.tsx
index fbcb8ff3e..7c82b8a31 100644
--- a/apps/dashboard/src/components/report-chart/metric/index.tsx
+++ b/apps/dashboard/src/components/report-chart/metric/index.tsx
@@ -29,10 +29,10 @@ export function ReportMetricChart() {
export function Loading() {
return (
<div className="flex h-[78px] flex-col justify-between p-4">
- <div className="h-3 w-1/2 animate-pulse rounded bg-def-200"></div>
+ <div className="h-3 w-1/2 animate-pulse rounded bg-def-200" />
<div className="row items-end justify-between">
- <div className="h-6 w-1/3 animate-pulse rounded bg-def-200"></div>
- <div className="h-3 w-1/5 animate-pulse rounded bg-def-200"></div>
+ <div className="h-6 w-1/3 animate-pulse rounded bg-def-200" />
+ <div className="h-3 w-1/5 animate-pulse rounded bg-def-200" />
</div>
</div>
);
diff --git a/apps/dashboard/src/components/report-chart/metric/metric-card.tsx b/apps/dashboard/src/components/report-chart/metric/metric-card.tsx
index db9bd5a44..5a29ed20a 100644
--- a/apps/dashboard/src/components/report-chart/metric/metric-card.tsx
+++ b/apps/dashboard/src/components/report-chart/metric/metric-card.tsx
@@ -9,8 +9,8 @@ import { Area, AreaChart } from 'recharts';
import type { IChartMetric } from '@openpanel/validation';
import {
- getDiffIndicator,
PreviousDiffIndicator,
+ getDiffIndicator,
} from '../common/previous-diff-indicator';
import { SerieName } from '../common/serie-name';
import { useReportChartContext } from '../context';
@@ -54,7 +54,7 @@ export function MetricCard({
previous?.state,
'#6ee7b7', // green
'#fda4af', // red
- '#93c5fd' // blue
+ '#93c5fd', // blue
);
return (
@@ -64,7 +64,7 @@ export function MetricCard({
>
<div
className={cn(
- 'pointer-events-none absolute -left-1 -right-1 bottom-0 top-0 z-0 opacity-50 transition-opacity duration-300 group-hover:opacity-100'
+ 'pointer-events-none absolute -left-1 -right-1 bottom-0 top-0 z-0 opacity-50 transition-opacity duration-300 group-hover:opacity-100',
)}
>
<AutoSizer>
diff --git a/apps/dashboard/src/components/report/ReportLineType.tsx b/apps/dashboard/src/components/report/ReportLineType.tsx
index 2e2e29b21..3f9e21e06 100644
--- a/apps/dashboard/src/components/report/ReportLineType.tsx
+++ b/apps/dashboard/src/components/report/ReportLineType.tsx
@@ -15,7 +15,7 @@ export function ReportLineType({ className }: ReportLineTypeProps) {
const chartType = useSelector((state) => state.report.chartType);
const type = useSelector((state) => state.report.lineType);
- if (chartType != 'linear' && chartType != 'area') {
+ if (chartType !== 'linear' && chartType !== 'area') {
return null;
}
diff --git a/apps/dashboard/src/components/report/ReportSaveButton.tsx b/apps/dashboard/src/components/report/ReportSaveButton.tsx
index aa5f0f110..f00fa3724 100644
--- a/apps/dashboard/src/components/report/ReportSaveButton.tsx
+++ b/apps/dashboard/src/components/report/ReportSaveButton.tsx
@@ -44,20 +44,19 @@ export function ReportSaveButton({ className }: ReportSaveButtonProps) {
Update
</Button>
);
- } else {
- return (
- <Button
- className={className}
- disabled={!report.dirty}
- onClick={() => {
- pushModal('SaveReport', {
- report,
- });
- }}
- icon={SaveIcon}
- >
- Save
- </Button>
- );
}
+ return (
+ <Button
+ className={className}
+ disabled={!report.dirty}
+ onClick={() => {
+ pushModal('SaveReport', {
+ report,
+ });
+ }}
+ icon={SaveIcon}
+ >
+ Save
+ </Button>
+ );
}
diff --git a/apps/dashboard/src/components/report/edit-report-name.tsx b/apps/dashboard/src/components/report/edit-report-name.tsx
index 10c923a65..8cf39e00c 100644
--- a/apps/dashboard/src/components/report/edit-report-name.tsx
+++ b/apps/dashboard/src/components/report/edit-report-name.tsx
@@ -1,7 +1,7 @@
'use client';
-import { useState } from 'react';
import { PencilIcon } from 'lucide-react';
+import { useState } from 'react';
type Props = {
name?: string;
@@ -23,7 +23,7 @@ const EditReportName = ({ name }: Props) => {
window.dispatchEvent(
new CustomEvent('report-name-change', {
detail: newName === '' ? name : newName,
- })
+ }),
);
setIsEditing(false);
@@ -33,8 +33,6 @@ const EditReportName = ({ name }: Props) => {
return (
<div className="flex">
<input
- // eslint-disable-next-line jsx-a11y/no-autofocus
- autoFocus
type="text"
value={newName}
onKeyDown={(e) => {
@@ -53,6 +51,7 @@ const EditReportName = ({ name }: Props) => {
return (
<button
+ type="button"
className="flex cursor-pointer select-none items-center gap-2"
onClick={() => setIsEditing(true)}
>
diff --git a/apps/dashboard/src/components/report/reportSlice.ts b/apps/dashboard/src/components/report/reportSlice.ts
index 4ecf2a582..f687f9e37 100644
--- a/apps/dashboard/src/components/report/reportSlice.ts
+++ b/apps/dashboard/src/components/report/reportSlice.ts
@@ -100,11 +100,11 @@ export const reportSlice = createSlice({
state,
action: PayloadAction<{
id?: string;
- }>
+ }>,
) => {
state.dirty = true;
state.events = state.events.filter(
- (event) => event.id !== action.payload.id
+ (event) => event.id !== action.payload.id,
);
},
changeEvent: (state, action: PayloadAction<IChartEvent>) => {
@@ -126,7 +126,7 @@ export const reportSlice = createSlice({
// Breakdowns
addBreakdown: (
state,
- action: PayloadAction<Omit<IChartBreakdown, 'id'>>
+ action: PayloadAction<Omit<IChartBreakdown, 'id'>>,
) => {
state.dirty = true;
state.breakdowns.push({
@@ -138,11 +138,11 @@ export const reportSlice = createSlice({
state,
action: PayloadAction<{
id?: string;
- }>
+ }>,
) => {
state.dirty = true;
state.breakdowns = state.breakdowns.filter(
- (event) => event.id !== action.payload.id
+ (event) => event.id !== action.payload.id,
);
},
changeBreakdown: (state, action: PayloadAction<IChartBreakdown>) => {
@@ -193,7 +193,7 @@ export const reportSlice = createSlice({
action: PayloadAction<{
startDate: string;
endDate: string;
- }>
+ }>,
) => {
state.dirty = true;
state.startDate = formatISO(startOfDay(action.payload.startDate));
@@ -215,7 +215,7 @@ export const reportSlice = createSlice({
const interval = getDefaultIntervalByDates(
state.startDate,
- state.endDate
+ state.endDate,
);
if (interval) {
state.interval = interval;
@@ -229,7 +229,7 @@ export const reportSlice = createSlice({
const interval = getDefaultIntervalByDates(
state.startDate,
- state.endDate
+ state.endDate,
);
if (interval) {
state.interval = interval;
diff --git a/apps/dashboard/src/components/report/sidebar/EventPropertiesCombobox.tsx b/apps/dashboard/src/components/report/sidebar/EventPropertiesCombobox.tsx
index 0f1b3523f..fb4cd419c 100644
--- a/apps/dashboard/src/components/report/sidebar/EventPropertiesCombobox.tsx
+++ b/apps/dashboard/src/components/report/sidebar/EventPropertiesCombobox.tsx
@@ -30,7 +30,7 @@ export function EventPropertiesCombobox({
},
{
enabled: !!event.name,
- }
+ },
).map((item) => ({
label: item,
value: item,
@@ -47,14 +47,15 @@ export function EventPropertiesCombobox({
changeEvent({
...event,
property: value,
- })
+ }),
);
}}
>
<button
+ type="button"
className={cn(
'flex items-center gap-1 rounded-md border border-border p-1 px-2 text-sm font-medium leading-none',
- !event.property && 'border-destructive text-destructive'
+ !event.property && 'border-destructive text-destructive',
)}
>
<DatabaseIcon size={12} />{' '}
diff --git a/apps/dashboard/src/components/report/sidebar/ReportBreakdownMore.tsx b/apps/dashboard/src/components/report/sidebar/ReportBreakdownMore.tsx
index fc2e706c2..d4697622f 100644
--- a/apps/dashboard/src/components/report/sidebar/ReportBreakdownMore.tsx
+++ b/apps/dashboard/src/components/report/sidebar/ReportBreakdownMore.tsx
@@ -1,4 +1,3 @@
-import * as React from 'react';
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
@@ -9,6 +8,7 @@ import {
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
import { MoreHorizontal, Trash } from 'lucide-react';
+import * as React from 'react';
export interface ReportBreakdownMoreProps {
onClick: (action: 'remove') => void;
diff --git a/apps/dashboard/src/components/report/sidebar/ReportBreakdowns.tsx b/apps/dashboard/src/components/report/sidebar/ReportBreakdowns.tsx
index 59f7c3b4f..f5ed2ca0c 100644
--- a/apps/dashboard/src/components/report/sidebar/ReportBreakdowns.tsx
+++ b/apps/dashboard/src/components/report/sidebar/ReportBreakdowns.tsx
@@ -60,7 +60,7 @@ export function ReportBreakdowns() {
changeBreakdown({
...item,
name: value,
- })
+ }),
);
}}
items={properties}
@@ -80,7 +80,7 @@ export function ReportBreakdowns() {
dispatch(
addBreakdown({
name: value,
- })
+ }),
);
}}
items={properties}
diff --git a/apps/dashboard/src/components/report/sidebar/ReportEventMore.tsx b/apps/dashboard/src/components/report/sidebar/ReportEventMore.tsx
index 25168b87f..341ed243a 100644
--- a/apps/dashboard/src/components/report/sidebar/ReportEventMore.tsx
+++ b/apps/dashboard/src/components/report/sidebar/ReportEventMore.tsx
@@ -1,4 +1,3 @@
-import * as React from 'react';
import { Button } from '@/components/ui/button';
import {
Command,
@@ -22,6 +21,7 @@ import {
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
import { Filter, MoreHorizontal, Tags, Trash } from 'lucide-react';
+import * as React from 'react';
const labels = [
'feature',
diff --git a/apps/dashboard/src/components/report/sidebar/ReportEvents.tsx b/apps/dashboard/src/components/report/sidebar/ReportEvents.tsx
index 0743f4d2c..aec73468c 100644
--- a/apps/dashboard/src/components/report/sidebar/ReportEvents.tsx
+++ b/apps/dashboard/src/components/report/sidebar/ReportEvents.tsx
@@ -21,10 +21,10 @@ import {
removeEvent,
} from '../reportSlice';
import { EventPropertiesCombobox } from './EventPropertiesCombobox';
-import { FiltersCombobox } from './filters/FiltersCombobox';
-import { FiltersList } from './filters/FiltersList';
import { ReportEventMore } from './ReportEventMore';
import type { ReportEventMoreProps } from './ReportEventMore';
+import { FiltersCombobox } from './filters/FiltersCombobox';
+import { FiltersList } from './filters/FiltersList';
export function ReportEvents() {
const previous = useSelector((state) => state.report.previous);
@@ -79,7 +79,7 @@ export function ReportEvents() {
...event,
name: value,
filters: [],
- })
+ }),
);
}}
items={eventNames.map((item) => ({
@@ -113,7 +113,7 @@ export function ReportEvents() {
changeEvent({
...event,
segment,
- })
+ }),
);
}}
items={[
@@ -148,7 +148,10 @@ export function ReportEvents() {
]}
label="Segment"
>
- <button className="flex items-center gap-1 rounded-md border border-border bg-card p-1 px-2 text-sm font-medium leading-none">
+ <button
+ type="button"
+ className="flex items-center gap-1 rounded-md border border-border bg-card p-1 px-2 text-sm font-medium leading-none"
+ >
{event.segment === 'user' ? (
<>
<Users size={12} /> Unique users
@@ -205,7 +208,7 @@ export function ReportEvents() {
name: value,
segment: 'event',
filters: [],
- })
+ }),
);
}}
items={eventNames.map((item) => ({
diff --git a/apps/dashboard/src/components/report/sidebar/filters/FilterItem.tsx b/apps/dashboard/src/components/report/sidebar/filters/FilterItem.tsx
index b5595745c..1a10901cb 100644
--- a/apps/dashboard/src/components/report/sidebar/filters/FilterItem.tsx
+++ b/apps/dashboard/src/components/report/sidebar/filters/FilterItem.tsx
@@ -1,17 +1,17 @@
-import { useEffect, useState } from 'react';
import { ColorSquare } from '@/components/color-square';
+import { RenderDots } from '@/components/ui/RenderDots';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import { ComboboxAdvanced } from '@/components/ui/combobox-advanced';
import { DropdownMenuComposed } from '@/components/ui/dropdown-menu';
import { Input } from '@/components/ui/input';
-import { RenderDots } from '@/components/ui/RenderDots';
import { useAppParams } from '@/hooks/useAppParams';
import { useMappings } from '@/hooks/useMappings';
import { usePropertyValues } from '@/hooks/usePropertyValues';
import { useDispatch, useSelector } from '@/redux';
import { AnimatePresence, motion } from 'framer-motion';
import { RefreshCcwIcon, SlidersHorizontal, Trash } from 'lucide-react';
+import { useEffect, useState } from 'react';
import { operators } from '@openpanel/constants';
import type {
@@ -41,31 +41,31 @@ interface PureFilterProps {
onRemove: (filter: IChartEventFilter) => void;
onChangeValue: (
value: IChartEventFilterValue[],
- filter: IChartEventFilter
+ filter: IChartEventFilter,
) => void;
onChangeOperator: (
operator: IChartEventFilterOperator,
- filter: IChartEventFilter
+ filter: IChartEventFilter,
) => void;
className?: string;
}
export function FilterItem({ filter, event }: FilterProps) {
const { range, startDate, endDate, interval } = useSelector(
- (state) => state.report
+ (state) => state.report,
);
const onRemove = ({ id }: IChartEventFilter) => {
dispatch(
changeEvent({
...event,
filters: event.filters.filter((item) => item.id !== id),
- })
+ }),
);
};
const onChangeValue = (
value: IChartEventFilterValue[],
- { id }: IChartEventFilter
+ { id }: IChartEventFilter,
) => {
dispatch(
changeEvent({
@@ -80,13 +80,13 @@ export function FilterItem({ filter, event }: FilterProps) {
return item;
}),
- })
+ }),
);
};
const onChangeOperator = (
operator: IChartEventFilterOperator,
- { id }: IChartEventFilter
+ { id }: IChartEventFilter,
) => {
dispatch(
changeEvent({
@@ -102,7 +102,7 @@ export function FilterItem({ filter, event }: FilterProps) {
return item;
}),
- })
+ }),
);
};
diff --git a/apps/dashboard/src/components/report/sidebar/filters/FiltersCombobox.tsx b/apps/dashboard/src/components/report/sidebar/filters/FiltersCombobox.tsx
index 4e819eb1d..59bd75251 100644
--- a/apps/dashboard/src/components/report/sidebar/filters/FiltersCombobox.tsx
+++ b/apps/dashboard/src/components/report/sidebar/filters/FiltersCombobox.tsx
@@ -32,7 +32,7 @@ export function FiltersCombobox({ event }: FiltersComboboxProps) {
},
{
enabled: !!event.name,
- }
+ },
);
return (
@@ -57,11 +57,14 @@ export function FiltersCombobox({ event }: FiltersComboboxProps) {
value: [],
},
],
- })
+ }),
);
}}
>
- <button className="flex items-center gap-1 rounded-md border border-border bg-card p-1 px-2 text-sm font-medium leading-none">
+ <button
+ type="button"
+ className="flex items-center gap-1 rounded-md border border-border bg-card p-1 px-2 text-sm font-medium leading-none"
+ >
<FilterIcon size={12} /> Add filter
</button>
</Combobox>
diff --git a/apps/dashboard/src/components/settings-toggle.tsx b/apps/dashboard/src/components/settings-toggle.tsx
index 2a49c56d3..75f0e7d47 100644
--- a/apps/dashboard/src/components/settings-toggle.tsx
+++ b/apps/dashboard/src/components/settings-toggle.tsx
@@ -1,6 +1,5 @@
'use client';
-import * as React from 'react';
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
@@ -16,6 +15,7 @@ import {
} from '@/components/ui/dropdown-menu';
import { CheckIcon, MoreHorizontalIcon, PlusIcon } from 'lucide-react';
import { useTheme } from 'next-themes';
+import * as React from 'react';
import { ProjectLink } from './links';
diff --git a/apps/dashboard/src/components/settings/invites/columns.tsx b/apps/dashboard/src/components/settings/invites/columns.tsx
index 10fb374c5..c5c54c4c0 100644
--- a/apps/dashboard/src/components/settings/invites/columns.tsx
+++ b/apps/dashboard/src/components/settings/invites/columns.tsx
@@ -17,7 +17,7 @@ import { toast } from 'sonner';
import type { IServiceInvite, IServiceProject } from '@openpanel/db';
export function useColumns(
- projects: IServiceProject[]
+ projects: IServiceProject[],
): ColumnDef<IServiceInvite>[] {
return [
{
diff --git a/apps/dashboard/src/components/settings/invites/index.tsx b/apps/dashboard/src/components/settings/invites/index.tsx
index d7d35cf5d..e9cf7ebba 100644
--- a/apps/dashboard/src/components/settings/invites/index.tsx
+++ b/apps/dashboard/src/components/settings/invites/index.tsx
@@ -21,11 +21,11 @@ export const InvitesTable = ({ projects, data }: Props) => {
if (!data) {
return (
<div className="flex flex-col gap-2">
- <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4"></div>
- <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4"></div>
- <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4"></div>
- <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4"></div>
- <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4"></div>
+ <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4" />
+ <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4" />
+ <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4" />
+ <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4" />
+ <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4" />
</div>
);
}
diff --git a/apps/dashboard/src/components/settings/members/columns.tsx b/apps/dashboard/src/components/settings/members/columns.tsx
index 23ff9cac8..93ed5b036 100644
--- a/apps/dashboard/src/components/settings/members/columns.tsx
+++ b/apps/dashboard/src/components/settings/members/columns.tsx
@@ -1,4 +1,3 @@
-import { useState } from 'react';
import { TooltipComplete } from '@/components/tooltip-complete';
import { Button } from '@/components/ui/button';
import { ComboboxAdvanced } from '@/components/ui/combobox-advanced';
@@ -12,6 +11,7 @@ import { api } from '@/trpc/client';
import type { ColumnDef, Row } from '@tanstack/react-table';
import { MoreHorizontalIcon } from 'lucide-react';
import { useRouter } from 'next/navigation';
+import { useState } from 'react';
import { toast } from 'sonner';
import type { IServiceMember, IServiceProject } from '@openpanel/db';
@@ -77,7 +77,7 @@ function AccessCell({
projects: IServiceProject[];
}) {
const [access, setAccess] = useState<string[]>(
- row.original.access.map((item) => item.projectId)
+ row.original.access.map((item) => item.projectId),
);
const mutation = api.organization.updateMemberAccess.useMutation();
@@ -106,13 +106,13 @@ function ActionsCell({ row }: { row: Row<IServiceMember> }) {
const revoke = api.organization.removeMember.useMutation({
onSuccess() {
toast.success(
- `${row.original.user?.firstName} has been removed from the organization`
+ `${row.original.user?.firstName} has been removed from the organization`,
);
router.refresh();
},
onError() {
toast.error(
- `Failed to remove ${row.original.user?.firstName} from the organization`
+ `Failed to remove ${row.original.user?.firstName} from the organization`,
);
},
});
diff --git a/apps/dashboard/src/components/settings/members/index.tsx b/apps/dashboard/src/components/settings/members/index.tsx
index b08e74637..41aed16de 100644
--- a/apps/dashboard/src/components/settings/members/index.tsx
+++ b/apps/dashboard/src/components/settings/members/index.tsx
@@ -21,11 +21,11 @@ export const MembersTable = ({ projects, data }: Props) => {
if (!data) {
return (
<div className="flex flex-col gap-2">
- <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4"></div>
- <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4"></div>
- <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4"></div>
- <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4"></div>
- <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4"></div>
+ <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4" />
+ <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4" />
+ <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4" />
+ <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4" />
+ <div className="card h-[74px] w-full animate-pulse items-center justify-between rounded-lg p-4" />
</div>
);
}
diff --git a/apps/dashboard/src/components/stats.tsx b/apps/dashboard/src/components/stats.tsx
index ce455320d..ed3850d05 100644
--- a/apps/dashboard/src/components/stats.tsx
+++ b/apps/dashboard/src/components/stats.tsx
@@ -12,7 +12,7 @@ export function Stats({
<div
className={cn(
'grid overflow-hidden rounded border bg-background @xl:grid-cols-3 @4xl:grid-cols-6',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/dashboard/src/components/syntax.tsx b/apps/dashboard/src/components/syntax.tsx
index 441c97b13..d243199bd 100644
--- a/apps/dashboard/src/components/syntax.tsx
+++ b/apps/dashboard/src/components/syntax.tsx
@@ -16,6 +16,7 @@ export default function Syntax({ code }: SyntaxProps) {
return (
<div className="group relative">
<button
+ type="button"
className="absolute right-1 top-1 rounded bg-card p-2 opacity-0 transition-opacity group-hover:opacity-100"
onClick={() => {
clipboard(code);
diff --git a/apps/dashboard/src/components/time-window-picker.tsx b/apps/dashboard/src/components/time-window-picker.tsx
index d4cab455e..7abab4860 100644
--- a/apps/dashboard/src/components/time-window-picker.tsx
+++ b/apps/dashboard/src/components/time-window-picker.tsx
@@ -1,4 +1,3 @@
-import { useCallback, useEffect, useRef } from 'react';
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
@@ -14,6 +13,7 @@ import { pushModal, useOnPushModal } from '@/modals';
import { cn } from '@/utils/cn';
import { bind } from 'bind-event-listener';
import { CalendarIcon } from 'lucide-react';
+import { useCallback, useEffect, useRef } from 'react';
import { timeWindows } from '@openpanel/constants';
import type { IChartRange } from '@openpanel/validation';
@@ -21,9 +21,9 @@ import type { IChartRange } from '@openpanel/validation';
function shouldIgnoreKeypress(event: KeyboardEvent) {
const tagName = (event?.target as HTMLElement)?.tagName;
const modifierPressed =
- event.ctrlKey || event.metaKey || event.altKey || event.keyCode == 229;
+ event.ctrlKey || event.metaKey || event.altKey || event.keyCode === 229;
const isTyping =
- event.isComposing || tagName == 'INPUT' || tagName == 'TEXTAREA';
+ event.isComposing || tagName === 'INPUT' || tagName === 'TEXTAREA';
return modifierPressed || isTyping;
}
@@ -47,10 +47,9 @@ export function TimeWindowPicker({
className,
}: Props) {
const isDateRangerPickerOpen = useRef(false);
- useOnPushModal(
- 'DateRangerPicker',
- (open) => (isDateRangerPickerOpen.current = open)
- );
+ useOnPushModal('DateRangerPicker', (open) => {
+ isDateRangerPickerOpen.current = open;
+ });
const timeWindow = timeWindows[value ?? '30d'];
const handleCustom = useCallback(() => {
@@ -78,7 +77,7 @@ export function TimeWindowPicker({
}
const match = Object.values(timeWindows).find(
- (tw) => event.key === tw.shortcut.toLowerCase()
+ (tw) => event.key === tw.shortcut.toLowerCase(),
);
if (match?.key === 'custom') {
handleCustom();
diff --git a/apps/dashboard/src/components/ui/RenderDots.tsx b/apps/dashboard/src/components/ui/RenderDots.tsx
index 267c42e7c..6fbd1c61c 100644
--- a/apps/dashboard/src/components/ui/RenderDots.tsx
+++ b/apps/dashboard/src/components/ui/RenderDots.tsx
@@ -27,7 +27,10 @@ export function RenderDots({
<div {...props} className={cn('flex items-center gap-1', className)}>
{parts.slice(-sliceAt).map((str, index) => {
return (
- <div className="flex items-center gap-1" key={str + index}>
+ <div
+ className="flex items-center gap-1"
+ key={str + (index as number)}
+ >
{index !== 0 && (
<ChevronRight className="relative top-[0.9px] !h-3 !w-3 flex-shrink-0" />
)}
diff --git a/apps/dashboard/src/components/ui/accordion.tsx b/apps/dashboard/src/components/ui/accordion.tsx
index 8bc3a4858..655134f29 100644
--- a/apps/dashboard/src/components/ui/accordion.tsx
+++ b/apps/dashboard/src/components/ui/accordion.tsx
@@ -1,7 +1,7 @@
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as AccordionPrimitive from '@radix-ui/react-accordion';
import { ChevronDown } from 'lucide-react';
+import * as React from 'react';
const Accordion = AccordionPrimitive.Root;
@@ -26,7 +26,7 @@ const AccordionTrigger = React.forwardRef<
ref={ref}
className={cn(
'flex flex-1 items-center justify-between py-4 font-medium transition-all [&[data-state=closed]]:hover:bg-muted/30 [&[data-state=open]>svg]:rotate-180',
- className
+ className,
)}
{...props}
>
diff --git a/apps/dashboard/src/components/ui/alert-dialog.tsx b/apps/dashboard/src/components/ui/alert-dialog.tsx
index 94237d757..4dda51914 100644
--- a/apps/dashboard/src/components/ui/alert-dialog.tsx
+++ b/apps/dashboard/src/components/ui/alert-dialog.tsx
@@ -1,9 +1,9 @@
'use client';
-import * as React from 'react';
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/utils/cn';
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
+import * as React from 'react';
const AlertDialog = AlertDialogPrimitive.Root;
@@ -18,7 +18,7 @@ const AlertDialogOverlay = React.forwardRef<
<AlertDialogPrimitive.Overlay
className={cn(
'fixed inset-0 z-50 bg-card/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
- className
+ className,
)}
{...props}
ref={ref}
@@ -36,7 +36,7 @@ const AlertDialogContent = React.forwardRef<
ref={ref}
className={cn(
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full',
- className
+ className,
)}
{...props}
/>
@@ -51,7 +51,7 @@ const AlertDialogHeader = ({
<div
className={cn(
'flex flex-col space-y-2 text-center sm:text-left',
- className
+ className,
)}
{...props}
/>
@@ -65,7 +65,7 @@ const AlertDialogFooter = ({
<div
className={cn(
'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
- className
+ className,
)}
{...props}
/>
@@ -118,7 +118,7 @@ const AlertDialogCancel = React.forwardRef<
className={cn(
buttonVariants({ variant: 'outline' }),
'mt-2 sm:mt-0',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/dashboard/src/components/ui/alert.tsx b/apps/dashboard/src/components/ui/alert.tsx
index 639d3ddf1..922f42315 100644
--- a/apps/dashboard/src/components/ui/alert.tsx
+++ b/apps/dashboard/src/components/ui/alert.tsx
@@ -1,7 +1,7 @@
-import * as React from 'react';
import { cn } from '@/utils/cn';
import { cva } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
+import * as React from 'react';
const alertVariants = cva(
'relative w-full rounded-lg border p-4 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7',
@@ -16,7 +16,7 @@ const alertVariants = cva(
defaultVariants: {
variant: 'default',
},
- }
+ },
);
const Alert = React.forwardRef<
diff --git a/apps/dashboard/src/components/ui/avatar.tsx b/apps/dashboard/src/components/ui/avatar.tsx
index e4664e5e8..24ffd735b 100644
--- a/apps/dashboard/src/components/ui/avatar.tsx
+++ b/apps/dashboard/src/components/ui/avatar.tsx
@@ -1,8 +1,8 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as AvatarPrimitive from '@radix-ui/react-avatar';
+import * as React from 'react';
const Avatar = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Root>,
@@ -12,7 +12,7 @@ const Avatar = React.forwardRef<
ref={ref}
className={cn(
'relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full ',
- className
+ className,
)}
{...props}
/>
@@ -39,7 +39,7 @@ const AvatarFallback = React.forwardRef<
ref={ref}
className={cn(
'flex h-full w-full items-center justify-center rounded-full bg-primary text-white',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/dashboard/src/components/ui/badge.tsx b/apps/dashboard/src/components/ui/badge.tsx
index 4877f82b8..6388c05f7 100644
--- a/apps/dashboard/src/components/ui/badge.tsx
+++ b/apps/dashboard/src/components/ui/badge.tsx
@@ -1,9 +1,9 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import { cva } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
+import type * as React from 'react';
const badgeVariants = cva(
'inline-flex h-[20px] items-center rounded-full border px-2 text-sm font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
@@ -25,7 +25,7 @@ const badgeVariants = cva(
defaultVariants: {
variant: 'default',
},
- }
+ },
);
export interface BadgeProps
diff --git a/apps/dashboard/src/components/ui/button.tsx b/apps/dashboard/src/components/ui/button.tsx
index 934ce8986..224c16619 100644
--- a/apps/dashboard/src/components/ui/button.tsx
+++ b/apps/dashboard/src/components/ui/button.tsx
@@ -1,6 +1,5 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import { Slot } from '@radix-ui/react-slot';
import { cva } from 'class-variance-authority';
@@ -8,6 +7,7 @@ import type { VariantProps } from 'class-variance-authority';
import type { LucideIcon } from 'lucide-react';
import { Loader2 } from 'lucide-react';
import Link from 'next/link';
+import * as React from 'react';
const buttonVariants = cva(
'inline-flex flex-shrink-0 select-none items-center justify-center whitespace-nowrap rounded-md font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
@@ -35,7 +35,7 @@ const buttonVariants = cva(
variant: 'default',
size: 'sm',
},
- }
+ },
);
export interface ButtonProps
@@ -61,10 +61,10 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
responsive,
...props
},
- ref
+ ref,
) => {
const Comp = asChild ? Slot : 'button';
- const Icon = loading ? Loader2 : icon ?? null;
+ const Icon = loading ? Loader2 : (icon ?? null);
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
@@ -78,7 +78,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
'h-4 w-4 flex-shrink-0',
loading && 'animate-spin',
size !== 'icon' && responsive && 'mr-0 sm:mr-2',
- size !== 'icon' && !responsive && 'mr-2'
+ size !== 'icon' && !responsive && 'mr-2',
)}
/>
)}
@@ -89,7 +89,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
)}
</Comp>
);
- }
+ },
);
Button.displayName = 'Button';
Button.defaultProps = {
@@ -122,9 +122,9 @@ const LinkButton = React.forwardRef<
href,
...props
},
- ref
+ ref,
) => {
- const Icon = loading ? Loader2 : icon ?? null;
+ const Icon = loading ? Loader2 : (icon ?? null);
return (
<Link
href={href}
@@ -138,7 +138,7 @@ const LinkButton = React.forwardRef<
className={cn(
'mr-2 h-4 w-4 flex-shrink-0',
responsive && 'mr-0 sm:mr-2',
- loading && 'animate-spin'
+ loading && 'animate-spin',
)}
/>
)}
@@ -149,7 +149,7 @@ const LinkButton = React.forwardRef<
)}
</Link>
);
- }
+ },
);
LinkButton.displayName = 'LinkButton';
diff --git a/apps/dashboard/src/components/ui/calendar.tsx b/apps/dashboard/src/components/ui/calendar.tsx
index 6881753db..5f07ea357 100644
--- a/apps/dashboard/src/components/ui/calendar.tsx
+++ b/apps/dashboard/src/components/ui/calendar.tsx
@@ -1,7 +1,7 @@
-import * as React from 'react';
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/utils/cn';
import { ChevronLeft, ChevronRight } from 'lucide-react';
+import type * as React from 'react';
import { DayPicker } from 'react-day-picker';
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
@@ -24,7 +24,7 @@ function Calendar({
nav: 'space-x-1 flex items-center',
nav_button: cn(
buttonVariants({ variant: 'outline' }),
- 'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100'
+ 'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100',
),
nav_button_previous: 'absolute left-1',
nav_button_next: 'absolute right-1',
@@ -36,7 +36,7 @@ function Calendar({
cell: 'h-9 w-9 text-center p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20',
day: cn(
buttonVariants({ variant: 'ghost' }),
- 'h-9 w-9 p-0 font-normal aria-selected:opacity-100'
+ 'h-9 w-9 p-0 font-normal aria-selected:opacity-100',
),
day_range_end: 'day-range-end',
day_selected:
diff --git a/apps/dashboard/src/components/ui/carousel.tsx b/apps/dashboard/src/components/ui/carousel.tsx
index cc9bb130d..3e4a93823 100644
--- a/apps/dashboard/src/components/ui/carousel.tsx
+++ b/apps/dashboard/src/components/ui/carousel.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
import { Button } from '@/components/ui/button';
import { cn } from '@/utils/cn';
import useEmblaCarousel from 'embla-carousel-react';
import type { UseEmblaCarouselType } from 'embla-carousel-react';
import { ArrowLeft, ArrowRight } from 'lucide-react';
+import * as React from 'react';
type CarouselApi = UseEmblaCarouselType[1];
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
@@ -52,14 +52,14 @@ const Carousel = React.forwardRef<
children,
...props
},
- ref
+ ref,
) => {
const [carouselRef, api] = useEmblaCarousel(
{
...opts,
axis: orientation === 'horizontal' ? 'x' : 'y',
},
- plugins
+ plugins,
);
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
const [canScrollNext, setCanScrollNext] = React.useState(false);
@@ -91,7 +91,7 @@ const Carousel = React.forwardRef<
scrollNext();
}
},
- [scrollPrev, scrollNext]
+ [scrollPrev, scrollNext],
);
React.useEffect(() => {
@@ -142,7 +142,7 @@ const Carousel = React.forwardRef<
</div>
</CarouselContext.Provider>
);
- }
+ },
);
Carousel.displayName = 'Carousel';
@@ -159,7 +159,7 @@ const CarouselContent = React.forwardRef<
className={cn(
'flex',
orientation === 'horizontal' ? '' : 'flex-col',
- className
+ className,
)}
{...props}
/>
@@ -182,7 +182,7 @@ const CarouselItem = React.forwardRef<
className={cn(
'min-w-0 shrink-0 grow-0 basis-full',
orientation === 'horizontal' ? 'pl-4' : 'pt-4',
- className
+ className,
)}
{...props}
/>
@@ -206,7 +206,7 @@ const CarouselPrevious = React.forwardRef<
orientation === 'horizontal'
? 'left-6 top-1/2 -translate-y-1/2'
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
- className
+ className,
)}
disabled={!canScrollPrev}
onClick={scrollPrev}
@@ -235,7 +235,7 @@ const CarouselNext = React.forwardRef<
orientation === 'horizontal'
? 'right-6 top-1/2 -translate-y-1/2'
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
- className
+ className,
)}
disabled={!canScrollNext}
onClick={scrollNext}
diff --git a/apps/dashboard/src/components/ui/checkbox.tsx b/apps/dashboard/src/components/ui/checkbox.tsx
index 930d5afa6..407f05828 100644
--- a/apps/dashboard/src/components/ui/checkbox.tsx
+++ b/apps/dashboard/src/components/ui/checkbox.tsx
@@ -1,16 +1,16 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
import { Check } from 'lucide-react';
+import * as React from 'react';
export const DumpCheckbox = ({ checked }: { checked: boolean }) => {
return (
<div
className={cn(
'block h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
- checked && 'bg-primary text-primary-foreground'
+ checked && 'bg-primary text-primary-foreground',
)}
>
<div className="flex items-center justify-center text-current">
@@ -28,7 +28,7 @@ const Checkbox = React.forwardRef<
ref={ref}
className={cn(
'block h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
- className
+ className,
)}
{...props}
>
@@ -48,7 +48,7 @@ const CheckboxInput = React.forwardRef<
<label
className={cn(
'flex min-h-10 cursor-pointer select-none gap-4 rounded-md border border-border px-3 py-[0.5rem]',
- className
+ className,
)}
>
<Checkbox ref={ref} {...props} className="relative top-0.5" />
diff --git a/apps/dashboard/src/components/ui/combobox-advanced.tsx b/apps/dashboard/src/components/ui/combobox-advanced.tsx
index bbff676c7..0d34771be 100644
--- a/apps/dashboard/src/components/ui/combobox-advanced.tsx
+++ b/apps/dashboard/src/components/ui/combobox-advanced.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
import { Badge } from '@/components/ui/badge';
import { Command, CommandInput, CommandItem } from '@/components/ui/command';
import { cn } from '@/utils/cn';
import { ChevronsUpDownIcon } from 'lucide-react';
import VirtualList from 'rc-virtual-list';
+import * as React from 'react';
import { useOnClickOutside } from 'usehooks-ts';
import { Button } from './button';
@@ -40,7 +40,7 @@ export function ComboboxAdvanced({
(typeof item.label === 'string' &&
item.label.toLowerCase().includes(inputValue.toLowerCase())) ||
(typeof item.value === 'string' &&
- item.value.toLowerCase().includes(inputValue.toLowerCase()))
+ item.value.toLowerCase().includes(inputValue.toLowerCase())),
);
const renderItem = (item: IItem) => {
@@ -56,7 +56,7 @@ export function ComboboxAdvanced({
onChange(
value.includes(item.value)
? value.filter((s) => s !== item.value)
- : [...value, item.value]
+ : [...value, item.value],
);
}}
className={'flex cursor-pointer items-center gap-2'}
diff --git a/apps/dashboard/src/components/ui/combobox.tsx b/apps/dashboard/src/components/ui/combobox.tsx
index 5edeca77e..3008e8485 100644
--- a/apps/dashboard/src/components/ui/combobox.tsx
+++ b/apps/dashboard/src/components/ui/combobox.tsx
@@ -1,6 +1,5 @@
'use client';
-import * as React from 'react';
import type { ButtonProps } from '@/components/ui/button';
import { Button } from '@/components/ui/button';
import {
@@ -18,6 +17,7 @@ import { cn } from '@/utils/cn';
import type { LucideIcon } from 'lucide-react';
import { Check, ChevronsUpDown } from 'lucide-react';
import VirtualList from 'rc-virtual-list';
+import * as React from 'react';
export interface ComboboxProps<T> {
placeholder: string;
@@ -66,7 +66,7 @@ export function Combobox<T extends string>({
const [search, setSearch] = React.useState('');
function find(value: string) {
return items.find(
- (item) => item.value.toLowerCase() === value.toLowerCase()
+ (item) => item.value.toLowerCase() === value.toLowerCase(),
);
}
@@ -82,13 +82,13 @@ export function Combobox<T extends string>({
className={cn(
'justify-between',
!!error && 'border-destructive',
- className
+ className,
)}
>
<div className="flex min-w-0 items-center">
{Icon ? <Icon size={16} className="mr-2 shrink-0" /> : null}
<span className="overflow-hidden text-ellipsis whitespace-nowrap">
- {value ? find(value)?.label ?? 'No match' : placeholder}
+ {value ? (find(value)?.label ?? 'No match') : placeholder}
</span>
</div>
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
@@ -147,7 +147,7 @@ export function Combobox<T extends string>({
<Check
className={cn(
'mr-2 h-4 w-4 flex-shrink-0',
- value === item.value ? 'opacity-100' : 'opacity-0'
+ value === item.value ? 'opacity-100' : 'opacity-0',
)}
/>
{item.label}
diff --git a/apps/dashboard/src/components/ui/command.tsx b/apps/dashboard/src/components/ui/command.tsx
index 852cdfc9a..8c7d2b81c 100644
--- a/apps/dashboard/src/components/ui/command.tsx
+++ b/apps/dashboard/src/components/ui/command.tsx
@@ -1,11 +1,11 @@
'use client';
-import * as React from 'react';
import { Dialog, DialogContent } from '@/components/ui/dialog';
import { cn } from '@/utils/cn';
import type { DialogProps } from '@radix-ui/react-dialog';
import { Command as CommandPrimitive } from 'cmdk';
import { Search } from 'lucide-react';
+import * as React from 'react';
const Command = React.forwardRef<
React.ElementRef<typeof CommandPrimitive>,
@@ -15,7 +15,7 @@ const Command = React.forwardRef<
ref={ref}
className={cn(
'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',
- className
+ className,
)}
{...props}
/>
@@ -46,7 +46,7 @@ const CommandInput = React.forwardRef<
ref={ref}
className={cn(
'flex h-11 w-full rounded-md bg-transparent py-3 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
- className
+ className,
)}
{...props}
/>
@@ -85,7 +85,7 @@ const CommandGroup = React.forwardRef<
ref={ref}
className={cn(
'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-sm [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground',
- className
+ className,
)}
{...props}
/>
@@ -113,7 +113,7 @@ const CommandItem = React.forwardRef<
ref={ref}
className={cn(
'relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
- className
+ className,
)}
data-disabled={props.disabled}
{...props}
@@ -130,7 +130,7 @@ const CommandShortcut = ({
<span
className={cn(
'ml-auto text-sm tracking-widest text-muted-foreground',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/dashboard/src/components/ui/dialog.tsx b/apps/dashboard/src/components/ui/dialog.tsx
index 6c570c7d0..dcdb0e27b 100644
--- a/apps/dashboard/src/components/ui/dialog.tsx
+++ b/apps/dashboard/src/components/ui/dialog.tsx
@@ -1,9 +1,9 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as DialogPrimitive from '@radix-ui/react-dialog';
import { X } from 'lucide-react';
+import * as React from 'react';
const Dialog = DialogPrimitive.Root;
@@ -21,7 +21,7 @@ const DialogOverlay = React.forwardRef<
ref={ref}
className={cn(
'fixed inset-0 z-50 bg-black/20 backdrop-blur-[1px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
- className
+ className,
)}
{...props}
/>
@@ -42,7 +42,7 @@ const DialogContent = React.forwardRef<
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full',
className,
'max-h-screen overflow-y-auto', // Ensure the dialog is scrollable if it exceeds the screen height
- 'mt-auto' // Add margin-top: auto for all screen sizes
+ 'mt-auto', // Add margin-top: auto for all screen sizes
)}
{...props}
>
@@ -59,7 +59,7 @@ const DialogHeader = ({
<div
className={cn(
'flex flex-col space-y-1.5 text-center sm:text-left',
- className
+ className,
)}
{...props}
/>
@@ -73,7 +73,7 @@ const DialogFooter = ({
<div
className={cn(
'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',
- className
+ className,
)}
{...props}
/>
@@ -88,7 +88,7 @@ const DialogTitle = React.forwardRef<
ref={ref}
className={cn(
'text-lg font-semibold leading-none tracking-tight',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/dashboard/src/components/ui/dropdown-menu.tsx b/apps/dashboard/src/components/ui/dropdown-menu.tsx
index 996fcb68e..7aca6330a 100644
--- a/apps/dashboard/src/components/ui/dropdown-menu.tsx
+++ b/apps/dashboard/src/components/ui/dropdown-menu.tsx
@@ -1,9 +1,9 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
import { Check, ChevronRight, Circle } from 'lucide-react';
+import * as React from 'react';
const DropdownMenu = DropdownMenuPrimitive.Root;
@@ -28,7 +28,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
className={cn(
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none focus:bg-accent data-[state=open]:bg-accent',
inset && 'pl-8',
- className
+ className,
)}
{...props}
>
@@ -47,7 +47,7 @@ const DropdownMenuSubContent = React.forwardRef<
ref={ref}
className={cn(
'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
- className
+ className,
)}
{...props}
/>
@@ -65,7 +65,7 @@ const DropdownMenuContent = React.forwardRef<
sideOffset={sideOffset}
className={cn(
'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
- className
+ className,
)}
{...props}
/>
@@ -84,7 +84,7 @@ const DropdownMenuItem = React.forwardRef<
className={cn(
'relative flex min-h-8 cursor-pointer select-none items-center rounded-sm px-2 py-1.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:mr-2',
inset && 'pl-8',
- className
+ className,
)}
{...props}
/>
@@ -99,7 +99,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<
ref={ref}
className={cn(
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
- className
+ className,
)}
checked={checked}
{...props}
@@ -123,7 +123,7 @@ const DropdownMenuRadioItem = React.forwardRef<
ref={ref}
className={cn(
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
- className
+ className,
)}
{...props}
>
@@ -171,7 +171,7 @@ const DropdownMenuShortcut = ({
<span
className={cn(
'ml-auto font-mono text-sm tracking-widest opacity-60',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/dashboard/src/components/ui/gradient-background.tsx b/apps/dashboard/src/components/ui/gradient-background.tsx
index 96a2c6f4d..24b718ec8 100644
--- a/apps/dashboard/src/components/ui/gradient-background.tsx
+++ b/apps/dashboard/src/components/ui/gradient-background.tsx
@@ -14,7 +14,7 @@ export function GradientBackground({
<div
className={cn(
'from-def-200 rounded-md bg-gradient-to-tr to-white',
- className
+ className,
)}
{...props}
>
diff --git a/apps/dashboard/src/components/ui/input-otp.tsx b/apps/dashboard/src/components/ui/input-otp.tsx
index 1618961fb..736fcda50 100644
--- a/apps/dashboard/src/components/ui/input-otp.tsx
+++ b/apps/dashboard/src/components/ui/input-otp.tsx
@@ -1,7 +1,7 @@
-import * as React from 'react';
import { cn } from '@/utils/cn';
import { OTPInput, OTPInputContext } from 'input-otp';
import { Dot } from 'lucide-react';
+import * as React from 'react';
const InputOTP = React.forwardRef<
React.ElementRef<typeof OTPInput>,
@@ -11,7 +11,7 @@ const InputOTP = React.forwardRef<
ref={ref}
containerClassName={cn(
'flex items-center gap-2 has-[:disabled]:opacity-50',
- containerClassName
+ containerClassName,
)}
className={cn('disabled:cursor-not-allowed', className)}
{...props}
@@ -40,7 +40,7 @@ const InputOTPSlot = React.forwardRef<
className={cn(
'relative flex h-10 w-10 items-center justify-center border-y border-r border-input transition-all first:rounded-l-md first:border-l last:rounded-r-md',
isActive && 'z-10 ring-2 ring-ring ring-offset-background',
- className
+ className,
)}
{...props}
>
diff --git a/apps/dashboard/src/components/ui/input.tsx b/apps/dashboard/src/components/ui/input.tsx
index 4f1903526..795416d69 100644
--- a/apps/dashboard/src/components/ui/input.tsx
+++ b/apps/dashboard/src/components/ui/input.tsx
@@ -1,9 +1,9 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import type { VariantProps } from 'class-variance-authority';
import { cva } from 'class-variance-authority';
+import * as React from 'react';
const inputVariant = cva(
'file: flex w-full rounded-md border border-input bg-card ring-offset-background file:border-0 file:bg-transparent file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50',
@@ -18,7 +18,7 @@ const inputVariant = cva(
defaultVariants: {
size: 'sm',
},
- }
+ },
);
export type InputProps = VariantProps<typeof inputVariant> &
@@ -35,13 +35,13 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
type={type}
className={cn(
inputVariant({ size, className }),
- !!error && 'border-destructive'
+ !!error && 'border-destructive',
)}
ref={ref}
{...props}
/>
);
- }
+ },
);
Input.displayName = 'Input';
diff --git a/apps/dashboard/src/components/ui/key-value.tsx b/apps/dashboard/src/components/ui/key-value.tsx
index 1a8c657cb..33aac5f10 100644
--- a/apps/dashboard/src/components/ui/key-value.tsx
+++ b/apps/dashboard/src/components/ui/key-value.tsx
@@ -16,7 +16,7 @@ export function KeyValue({ href, onClick, name, value }: KeyValueProps) {
<Component
className={cn(
'group flex min-w-0 max-w-full divide-x self-start overflow-hidden rounded-md border border-border text-sm font-medium transition-transform',
- clickable && 'hover:-translate-y-0.5'
+ clickable && 'hover:-translate-y-0.5',
)}
{...{ href, onClick }}
>
@@ -24,7 +24,7 @@ export function KeyValue({ href, onClick, name, value }: KeyValueProps) {
<div
className={cn(
'font-mono overflow-hidden text-ellipsis whitespace-nowrap bg-card p-1 px-2 text-highlight',
- clickable && 'group-hover:underline'
+ clickable && 'group-hover:underline',
)}
>
{value}
diff --git a/apps/dashboard/src/components/ui/label.tsx b/apps/dashboard/src/components/ui/label.tsx
index 07652deb4..015145f0b 100644
--- a/apps/dashboard/src/components/ui/label.tsx
+++ b/apps/dashboard/src/components/ui/label.tsx
@@ -1,13 +1,13 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as LabelPrimitive from '@radix-ui/react-label';
import { cva } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
+import * as React from 'react';
const labelVariants = cva(
- 'mb-2 block font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
+ 'mb-2 block font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
);
const Label = React.forwardRef<
diff --git a/apps/dashboard/src/components/ui/popover.tsx b/apps/dashboard/src/components/ui/popover.tsx
index 68538cf50..0f0b24a38 100644
--- a/apps/dashboard/src/components/ui/popover.tsx
+++ b/apps/dashboard/src/components/ui/popover.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as PopoverPrimitive from '@radix-ui/react-popover';
+import * as React from 'react';
const Popover = PopoverPrimitive.Root;
@@ -19,7 +19,7 @@ const PopoverContent = React.forwardRef<
sideOffset={sideOffset}
className={cn(
'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
- className
+ className,
)}
style={{
boxShadow: '0 0 0 9000px rgba(0, 0, 0, 0.05)',
diff --git a/apps/dashboard/src/components/ui/progress.tsx b/apps/dashboard/src/components/ui/progress.tsx
index 59dc72f44..66b2f5e3d 100644
--- a/apps/dashboard/src/components/ui/progress.tsx
+++ b/apps/dashboard/src/components/ui/progress.tsx
@@ -1,7 +1,7 @@
-import * as React from 'react';
import { cn } from '@/utils/cn';
import { round } from '@/utils/math';
import * as ProgressPrimitive from '@radix-ui/react-progress';
+import * as React from 'react';
const Progress = React.forwardRef<
React.ElementRef<typeof ProgressPrimitive.Root>,
@@ -14,9 +14,9 @@ const Progress = React.forwardRef<
ref={ref}
className={cn(
'relative h-4 w-full min-w-16 overflow-hidden rounded bg-def-200 shadow-sm',
- size == 'sm' && 'h-2',
- size == 'lg' && 'h-8',
- className
+ size === 'sm' && 'h-2',
+ size === 'lg' && 'h-8',
+ className,
)}
{...props}
>
@@ -27,7 +27,7 @@ const Progress = React.forwardRef<
background: color,
}}
/>
- {value && size != 'sm' && (
+ {value && size !== 'sm' && (
<div className="z-5 absolute bottom-0 top-0 flex items-center px-2 text-sm font-semibold">
<div>{round(value, 2)}%</div>
</div>
diff --git a/apps/dashboard/src/components/ui/radio-group.tsx b/apps/dashboard/src/components/ui/radio-group.tsx
index f7d29fd7e..e9c63f291 100644
--- a/apps/dashboard/src/components/ui/radio-group.tsx
+++ b/apps/dashboard/src/components/ui/radio-group.tsx
@@ -1,7 +1,7 @@
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
import { Circle } from 'lucide-react';
+import * as React from 'react';
const RadioGroup = React.forwardRef<
React.ElementRef<typeof RadioGroupPrimitive.Root>,
@@ -26,7 +26,7 @@ const RadioGroupItem = React.forwardRef<
ref={ref}
className={cn(
'aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
- className
+ className,
)}
{...props}
>
diff --git a/apps/dashboard/src/components/ui/scroll-area.tsx b/apps/dashboard/src/components/ui/scroll-area.tsx
index b2c7836c2..ca1f26684 100644
--- a/apps/dashboard/src/components/ui/scroll-area.tsx
+++ b/apps/dashboard/src/components/ui/scroll-area.tsx
@@ -1,8 +1,8 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
+import * as React from 'react';
const ScrollArea = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
@@ -35,14 +35,14 @@ const ScrollBar = React.forwardRef<
'h-full w-2.5 border-l border-l-transparent p-[1px]',
orientation === 'horizontal' &&
'h-2.5 flex-col border-t border-t-transparent p-[1px]',
- className
+ className,
)}
{...props}
>
<ScrollAreaPrimitive.ScrollAreaThumb
className={cn(
'relative rounded-full bg-border',
- orientation === 'vertical' && 'flex-1'
+ orientation === 'vertical' && 'flex-1',
)}
/>
</ScrollAreaPrimitive.ScrollAreaScrollbar>
diff --git a/apps/dashboard/src/components/ui/sheet.tsx b/apps/dashboard/src/components/ui/sheet.tsx
index ae068e88a..fd19f5412 100644
--- a/apps/dashboard/src/components/ui/sheet.tsx
+++ b/apps/dashboard/src/components/ui/sheet.tsx
@@ -1,11 +1,11 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as SheetPrimitive from '@radix-ui/react-dialog';
import { cva } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
import { XIcon } from 'lucide-react';
+import * as React from 'react';
const Sheet = SheetPrimitive.Root;
@@ -22,7 +22,7 @@ const SheetOverlay = React.forwardRef<
<SheetPrimitive.Overlay
className={cn(
'fixed inset-0 z-50 bg-black/20 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
- className
+ className,
)}
{...props}
ref={ref}
@@ -46,7 +46,7 @@ const sheetVariants = cva(
defaultVariants: {
side: 'right',
},
- }
+ },
);
interface SheetContentProps
@@ -88,7 +88,7 @@ const SheetHeader = ({
<div
className={cn(
'relative -m-6 mb-6 flex justify-between rounded-t-lg border-b bg-def-100 p-6',
- className
+ className,
)}
{...props}
style={{
@@ -97,7 +97,7 @@ const SheetHeader = ({
backgroundRepeat: 'repeat',
}}
>
- <div className="absolute inset-0 bg-gradient-to-r from-def-100/95 to-def-100/80"></div>
+ <div className="absolute inset-0 bg-gradient-to-r from-def-100/95 to-def-100/80" />
<div className="row relative w-full items-start justify-between">
{children}
</div>
@@ -112,7 +112,7 @@ const SheetFooter = ({
<div
className={cn(
'mt-auto flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/dashboard/src/components/ui/switch.tsx b/apps/dashboard/src/components/ui/switch.tsx
index 65814cafd..81ea33cf3 100644
--- a/apps/dashboard/src/components/ui/switch.tsx
+++ b/apps/dashboard/src/components/ui/switch.tsx
@@ -1,8 +1,8 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as SwitchPrimitives from '@radix-ui/react-switch';
+import * as React from 'react';
const Switch = React.forwardRef<
React.ElementRef<typeof SwitchPrimitives.Root>,
@@ -11,14 +11,14 @@ const Switch = React.forwardRef<
<SwitchPrimitives.Root
className={cn(
'data-[state=checked]:bg-highlight peer inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-input',
- className
+ className,
)}
{...props}
ref={ref}
>
<SwitchPrimitives.Thumb
className={cn(
- 'pointer-events-none block h-3 w-3 rounded-full bg-card shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0'
+ 'pointer-events-none block h-3 w-3 rounded-full bg-card shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0',
)}
/>
</SwitchPrimitives.Root>
diff --git a/apps/dashboard/src/components/ui/table.tsx b/apps/dashboard/src/components/ui/table.tsx
index a04429a10..307c984e8 100644
--- a/apps/dashboard/src/components/ui/table.tsx
+++ b/apps/dashboard/src/components/ui/table.tsx
@@ -1,7 +1,7 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
+import * as React from 'react';
const Table = React.forwardRef<
HTMLTableElement,
@@ -61,7 +61,7 @@ const TableRow = React.forwardRef<
ref={ref}
className={cn(
'transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted',
- className
+ className,
)}
{...props}
/>
@@ -76,7 +76,7 @@ const TableHead = React.forwardRef<
ref={ref}
className={cn(
'h-10 whitespace-nowrap border-b border-border bg-def-100 px-4 text-left align-middle font-semibold text-muted-foreground shadow-[0_0_0_0.5px] shadow-border [&:has([role=checkbox])]:pr-0',
- className
+ className,
)}
{...props}
/>
@@ -91,7 +91,7 @@ const TableCell = React.forwardRef<
ref={ref}
className={cn(
'h-12 whitespace-nowrap px-4 align-middle shadow-[0_0_0_0.5px] shadow-border',
- className
+ className,
)}
{...props}
/>
@@ -122,7 +122,7 @@ export function TableSkeleton({
<TableHeader>
<TableRow>
{Array.from({ length: cols }).map((_, j) => (
- <TableHead key={j}>
+ <TableHead key={j as number}>
<div className="h-4 w-1/4 animate-pulse rounded-full bg-def-300" />
</TableHead>
))}
@@ -130,9 +130,9 @@ export function TableSkeleton({
</TableHeader>
<TableBody>
{Array.from({ length: rows }).map((_, i) => (
- <TableRow key={i}>
+ <TableRow key={i as number}>
{Array.from({ length: cols }).map((_, j) => (
- <TableCell key={j}>
+ <TableCell key={(j + i) as number}>
<div className="h-4 w-1/4 min-w-20 animate-pulse rounded-full bg-def-300" />
</TableCell>
))}
diff --git a/apps/dashboard/src/components/ui/tabs.tsx b/apps/dashboard/src/components/ui/tabs.tsx
index 6ad9c77f3..c7c493c0a 100644
--- a/apps/dashboard/src/components/ui/tabs.tsx
+++ b/apps/dashboard/src/components/ui/tabs.tsx
@@ -1,6 +1,6 @@
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as TabsPrimitive from '@radix-ui/react-tabs';
+import * as React from 'react';
const Tabs = TabsPrimitive.Root;
@@ -12,7 +12,7 @@ const TabsList = React.forwardRef<
ref={ref}
className={cn(
'inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground',
- className
+ className,
)}
{...props}
/>
@@ -27,7 +27,7 @@ const TabsTrigger = React.forwardRef<
ref={ref}
className={cn(
'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:shadow-sm',
- className
+ className,
)}
{...props}
/>
@@ -42,7 +42,7 @@ const TabsContent = React.forwardRef<
ref={ref}
className={cn(
'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/dashboard/src/components/ui/textarea.tsx b/apps/dashboard/src/components/ui/textarea.tsx
index 62bf261fb..9cab8bc52 100644
--- a/apps/dashboard/src/components/ui/textarea.tsx
+++ b/apps/dashboard/src/components/ui/textarea.tsx
@@ -1,5 +1,5 @@
-import * as React from 'react';
import { cn } from '@/utils/cn';
+import * as React from 'react';
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
@@ -9,13 +9,13 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
<textarea
className={cn(
'flex min-h-[80px] w-full rounded-md border border-input bg-card px-3 py-2 ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
- className
+ className,
)}
ref={ref}
{...props}
/>
);
- }
+ },
);
Textarea.displayName = 'Textarea';
diff --git a/apps/dashboard/src/components/ui/toast.tsx b/apps/dashboard/src/components/ui/toast.tsx
index 36665fbfd..e2b69fa5c 100644
--- a/apps/dashboard/src/components/ui/toast.tsx
+++ b/apps/dashboard/src/components/ui/toast.tsx
@@ -1,11 +1,11 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as ToastPrimitives from '@radix-ui/react-toast';
import { cva } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
import { X } from 'lucide-react';
+import * as React from 'react';
const ToastProvider = ToastPrimitives.Provider;
@@ -17,7 +17,7 @@ const ToastViewport = React.forwardRef<
ref={ref}
className={cn(
'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',
- className
+ className,
)}
{...props}
/>
@@ -37,7 +37,7 @@ const toastVariants = cva(
defaultVariants: {
variant: 'default',
},
- }
+ },
);
const Toast = React.forwardRef<
@@ -63,7 +63,7 @@ const ToastAction = React.forwardRef<
ref={ref}
className={cn(
'inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 font-medium ring-offset-background transition-colors hover:bg-def-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive',
- className
+ className,
)}
{...props}
/>
@@ -78,7 +78,7 @@ const ToastClose = React.forwardRef<
ref={ref}
className={cn(
'absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',
- className
+ className,
)}
toast-close=""
{...props}
diff --git a/apps/dashboard/src/components/ui/toggle-group.tsx b/apps/dashboard/src/components/ui/toggle-group.tsx
index a2981b22c..421a9b907 100644
--- a/apps/dashboard/src/components/ui/toggle-group.tsx
+++ b/apps/dashboard/src/components/ui/toggle-group.tsx
@@ -1,8 +1,8 @@
-import * as React from 'react';
import { toggleVariants } from '@/components/ui/toggle';
import { cn } from '@/utils/cn';
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
-import { VariantProps } from 'class-variance-authority';
+import type { VariantProps } from 'class-variance-authority';
+import * as React from 'react';
const ToggleGroupContext = React.createContext<
VariantProps<typeof toggleVariants>
@@ -44,7 +44,7 @@ const ToggleGroupItem = React.forwardRef<
variant: context.variant || variant,
size: context.size || size,
}),
- className
+ className,
)}
{...props}
>
diff --git a/apps/dashboard/src/components/ui/toggle.tsx b/apps/dashboard/src/components/ui/toggle.tsx
index 361f74014..cf5a487a8 100644
--- a/apps/dashboard/src/components/ui/toggle.tsx
+++ b/apps/dashboard/src/components/ui/toggle.tsx
@@ -1,8 +1,8 @@
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as TogglePrimitive from '@radix-ui/react-toggle';
import { cva } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
+import * as React from 'react';
const toggleVariants = cva(
'inline-flex items-center justify-center rounded-md font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground',
@@ -23,7 +23,7 @@ const toggleVariants = cva(
variant: 'default',
size: 'default',
},
- }
+ },
);
const Toggle = React.forwardRef<
diff --git a/apps/dashboard/src/components/ui/tooltip.tsx b/apps/dashboard/src/components/ui/tooltip.tsx
index 4be77548d..b2ede6362 100644
--- a/apps/dashboard/src/components/ui/tooltip.tsx
+++ b/apps/dashboard/src/components/ui/tooltip.tsx
@@ -1,8 +1,8 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
+import * as React from 'react';
const TooltipProvider = TooltipPrimitive.Provider;
@@ -23,11 +23,11 @@ const TooltipContent = React.forwardRef<
sideOffset={sideOffset}
className={cn(
'z-50 overflow-hidden rounded-md border bg-popover-foreground px-3 py-1.5 text-popover shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
- className
+ className,
)}
{...props}
/>
- )
+ ),
);
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
diff --git a/apps/dashboard/src/components/widget-table.tsx b/apps/dashboard/src/components/widget-table.tsx
index cdf5c573a..78415440c 100644
--- a/apps/dashboard/src/components/widget-table.tsx
+++ b/apps/dashboard/src/components/widget-table.tsx
@@ -21,7 +21,7 @@ export const WidgetTableHead = ({
<thead
className={cn(
'text-def-1000 sticky top-0 z-10 border-b border-border bg-def-100 [&_th:last-child]:text-right [&_th]:whitespace-nowrap [&_th]:p-4 [&_th]:py-2 [&_th]:text-left [&_th]:font-medium',
- className
+ className,
)}
>
{children}
diff --git a/apps/dashboard/src/components/widget.tsx b/apps/dashboard/src/components/widget.tsx
index 52141e7c1..89511dab3 100644
--- a/apps/dashboard/src/components/widget.tsx
+++ b/apps/dashboard/src/components/widget.tsx
@@ -10,7 +10,7 @@ export function WidgetHead({ children, className }: WidgetHeadProps) {
<div
className={cn(
'border-b border-border p-4 [&_.title]:whitespace-nowrap [&_.title]:font-medium',
- className
+ className,
)}
>
{children}
@@ -33,7 +33,7 @@ export function WidgetTitle({
className={cn(
'relative flex items-center gap-4',
className,
- !!Icon && 'pl-12'
+ !!Icon && 'pl-12',
)}
>
{Icon && (
diff --git a/apps/dashboard/src/env.mjs b/apps/dashboard/src/env.mjs
index 2a95a8b13..b25d1ae3c 100644
--- a/apps/dashboard/src/env.mjs
+++ b/apps/dashboard/src/env.mjs
@@ -11,8 +11,8 @@ export const env = createEnv({
.string()
.url()
.refine(
- (str) => !str.includes('YOUR_MYSQL_URL_HERE'),
- 'You forgot to change the default URL'
+ (str) => !str.includes('DATABASE_URL'),
+ 'You forgot to change the default URL',
),
NODE_ENV: z
.enum(['development', 'test', 'production'])
diff --git a/apps/dashboard/src/hocs/with-loading-widget.tsx b/apps/dashboard/src/hocs/with-loading-widget.tsx
index a3689b5c1..aa2972fb6 100644
--- a/apps/dashboard/src/hocs/with-loading-widget.tsx
+++ b/apps/dashboard/src/hocs/with-loading-widget.tsx
@@ -1,6 +1,6 @@
-import { Suspense } from 'react';
import { Widget, WidgetHead } from '@/components/widget';
import { cn } from '@/utils/cn';
+import { Suspense } from 'react';
const withLoadingWidget = <P,>(Component: React.ComponentType<P>) => {
const WithLoadingWidget: React.ComponentType<P> = (props) => {
@@ -14,7 +14,7 @@ const withLoadingWidget = <P,>(Component: React.ComponentType<P>) => {
typeof props === 'object' &&
'className' in props &&
typeof props.className === 'string' &&
- props?.className
+ props?.className,
)}
>
<WidgetHead>
diff --git a/apps/dashboard/src/hocs/with-suspense.tsx b/apps/dashboard/src/hocs/with-suspense.tsx
index b1376d1c8..3fb922737 100644
--- a/apps/dashboard/src/hocs/with-suspense.tsx
+++ b/apps/dashboard/src/hocs/with-suspense.tsx
@@ -2,7 +2,7 @@ import { Suspense } from 'react';
const withSuspense = <P,>(
Component: React.ComponentType<P>,
- Fallback: React.ComponentType<P>
+ Fallback: React.ComponentType<P>,
) => {
const WithSuspense: React.ComponentType<P> = (props) => {
const fallback = <Fallback {...(props as any)} />;
diff --git a/apps/dashboard/src/hooks/useCursor.ts b/apps/dashboard/src/hooks/useCursor.ts
index 3b76b58ae..12e890eb2 100644
--- a/apps/dashboard/src/hooks/useCursor.ts
+++ b/apps/dashboard/src/hooks/useCursor.ts
@@ -1,5 +1,5 @@
-import { useTransition } from 'react';
import { parseAsInteger, useQueryState } from 'nuqs';
+import { useTransition } from 'react';
import { useDebounceValue } from './useDebounceValue';
@@ -9,7 +9,7 @@ export function useCursor() {
'cursor',
parseAsInteger
.withOptions({ shallow: false, history: 'push', startTransition })
- .withDefault(0)
+ .withDefault(0),
);
return {
cursor,
@@ -23,7 +23,7 @@ export type UseDebouncedCursor = ReturnType<typeof useDebouncedCursor>;
export function useDebouncedCursor() {
const [cursor, setCursor] = useQueryState(
'cursor',
- parseAsInteger.withDefault(0)
+ parseAsInteger.withDefault(0),
);
const debouncedCursor = useDebounceValue(cursor, 200);
return {
diff --git a/apps/dashboard/src/hooks/useDebounceFn.ts b/apps/dashboard/src/hooks/useDebounceFn.ts
index ccd82d79a..0afb6871d 100644
--- a/apps/dashboard/src/hooks/useDebounceFn.ts
+++ b/apps/dashboard/src/hooks/useDebounceFn.ts
@@ -1,13 +1,11 @@
-import { useEffect } from 'react';
import debounce from 'lodash.debounce';
+import { useEffect } from 'react';
export function useDebounceFn<T>(fn: T, ms = 500): T {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
const debouncedFn = debounce(fn as any, ms);
useEffect(() => {
return () => {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
debouncedFn.cancel();
};
});
diff --git a/apps/dashboard/src/hooks/useDebounceState.ts b/apps/dashboard/src/hooks/useDebounceState.ts
index 7660eeb98..87c03e488 100644
--- a/apps/dashboard/src/hooks/useDebounceState.ts
+++ b/apps/dashboard/src/hooks/useDebounceState.ts
@@ -1,5 +1,5 @@
-import { useCallback, useEffect, useMemo, useState } from 'react';
import debounce from 'lodash.debounce';
+import { useCallback, useEffect, useMemo, useState } from 'react';
interface DebouncedState<T> {
value: T;
@@ -10,13 +10,13 @@ interface DebouncedState<T> {
export function useDebounceState<T>(
initialValue: T,
delay = 500,
- options?: Parameters<typeof debounce>[2]
+ options?: Parameters<typeof debounce>[2],
): DebouncedState<T> {
const [value, setValue] = useState<T>(initialValue);
const [debouncedValue, _setDebouncedValue] = useState<T>(initialValue);
const setDebouncedValue = useMemo(
() => debounce(_setDebouncedValue, delay, options),
- []
+ [],
);
useEffect(() => {
setDebouncedValue(value);
diff --git a/apps/dashboard/src/hooks/useEventNames.ts b/apps/dashboard/src/hooks/useEventNames.ts
index 93fcff47e..f98901c98 100644
--- a/apps/dashboard/src/hooks/useEventNames.ts
+++ b/apps/dashboard/src/hooks/useEventNames.ts
@@ -1,7 +1,7 @@
import { api } from '@/trpc/client';
export function useEventNames(
- params: Parameters<typeof api.chart.events.useQuery>[0]
+ params: Parameters<typeof api.chart.events.useQuery>[0],
) {
const query = api.chart.events.useQuery(params, {
staleTime: 1000 * 60 * 10,
diff --git a/apps/dashboard/src/hooks/useEventProperties.ts b/apps/dashboard/src/hooks/useEventProperties.ts
index 31737b888..2b256db69 100644
--- a/apps/dashboard/src/hooks/useEventProperties.ts
+++ b/apps/dashboard/src/hooks/useEventProperties.ts
@@ -4,7 +4,7 @@ import type { UseQueryOptions } from '@tanstack/react-query';
export function useEventProperties(
params: RouterInputs['chart']['properties'],
- options?: UseQueryOptions<RouterInputs['chart']['properties']>
+ options?: UseQueryOptions<RouterInputs['chart']['properties']>,
): string[] {
const query = api.chart.properties.useQuery(params, {
staleTime: 1000 * 60 * 10,
diff --git a/apps/dashboard/src/hooks/useEventQueryFilters.ts b/apps/dashboard/src/hooks/useEventQueryFilters.ts
index 7e29a35e0..de212d8ca 100644
--- a/apps/dashboard/src/hooks/useEventQueryFilters.ts
+++ b/apps/dashboard/src/hooks/useEventQueryFilters.ts
@@ -1,4 +1,3 @@
-import { useCallback } from 'react';
import type { Options as NuqsOptions } from 'nuqs';
import {
createParser,
@@ -6,6 +5,7 @@ import {
parseAsString,
useQueryState,
} from 'nuqs';
+import { useCallback } from 'react';
import type { IChartEventFilterOperator } from '@openpanel/validation';
@@ -34,7 +34,7 @@ export const eventQueryFiltersParser = createParser({
return value
.map(
(filter) =>
- `${filter.id},${filter.operator},${filter.value.map((v) => encodeURIComponent(v.trim())).join('|')}`
+ `${filter.id},${filter.operator},${filter.value.map((v) => encodeURIComponent(v.trim())).join('|')}`,
)
.join(';');
},
@@ -46,7 +46,7 @@ export function useEventQueryFilters(options: NuqsOptions = {}) {
eventQueryFiltersParser.withDefault([]).withOptions({
...nuqsOptions,
...options,
- })
+ }),
);
const setFilter = useCallback(
@@ -59,7 +59,7 @@ export function useEventQueryFilters(options: NuqsOptions = {}) {
| undefined
| null
| (string | number | boolean | undefined | null)[],
- operator: IChartEventFilterOperator = 'is'
+ operator: IChartEventFilterOperator = 'is',
) => {
setFilters((prev) => {
const exists = prev.find((filter) => filter.name === name);
@@ -99,14 +99,14 @@ export function useEventQueryFilters(options: NuqsOptions = {}) {
];
});
},
- [setFilters]
+ [setFilters],
);
return [filters, setFilter, setFilters] as const;
}
export const eventQueryNamesFilter = parseAsArrayOf(parseAsString).withDefault(
- []
+ [],
);
export function useEventQueryNamesFilter(options: NuqsOptions = {}) {
diff --git a/apps/dashboard/src/hooks/useFormatDateInterval.ts b/apps/dashboard/src/hooks/useFormatDateInterval.ts
index d00f9fec1..e57022116 100644
--- a/apps/dashboard/src/hooks/useFormatDateInterval.ts
+++ b/apps/dashboard/src/hooks/useFormatDateInterval.ts
@@ -27,6 +27,6 @@ export function useFormatDateInterval(interval: IInterval) {
return (date: Date | string) =>
formatDateInterval(
interval,
- typeof date === 'string' ? new Date(date) : date
+ typeof date === 'string' ? new Date(date) : date,
);
}
diff --git a/apps/dashboard/src/hooks/useNumerFormatter.ts b/apps/dashboard/src/hooks/useNumerFormatter.ts
index ac260fbdf..adace0299 100644
--- a/apps/dashboard/src/hooks/useNumerFormatter.ts
+++ b/apps/dashboard/src/hooks/useNumerFormatter.ts
@@ -46,7 +46,7 @@ export function useNumber() {
},
formatWithUnit: (
value: number | null | undefined,
- unit?: string | null
+ unit?: string | null,
) => {
if (isNil(value)) {
return 'N/A';
diff --git a/apps/dashboard/src/hooks/useProfileValues.ts b/apps/dashboard/src/hooks/useProfileValues.ts
index 181181cd5..d850f6fa4 100644
--- a/apps/dashboard/src/hooks/useProfileValues.ts
+++ b/apps/dashboard/src/hooks/useProfileValues.ts
@@ -8,7 +8,7 @@ export function useProfileValues(projectId: string, property: string) {
},
{
staleTime: 1000 * 60 * 10,
- }
+ },
);
return query.data?.values ?? [];
diff --git a/apps/dashboard/src/hooks/usePropertyValues.ts b/apps/dashboard/src/hooks/usePropertyValues.ts
index ce544a291..227b8e128 100644
--- a/apps/dashboard/src/hooks/usePropertyValues.ts
+++ b/apps/dashboard/src/hooks/usePropertyValues.ts
@@ -1,7 +1,7 @@
import { api } from '@/trpc/client';
export function usePropertyValues(
- params: Parameters<typeof api.chart.values.useQuery>[0]
+ params: Parameters<typeof api.chart.values.useQuery>[0],
) {
const query = api.chart.values.useQuery(params, {
staleTime: 1000 * 60 * 10,
diff --git a/apps/dashboard/src/hooks/useRechartDataModel.ts b/apps/dashboard/src/hooks/useRechartDataModel.ts
index c04999411..08e3e1b6b 100644
--- a/apps/dashboard/src/hooks/useRechartDataModel.ts
+++ b/apps/dashboard/src/hooks/useRechartDataModel.ts
@@ -1,8 +1,8 @@
'use client';
-import { useMemo } from 'react';
import type { IChartData } from '@/trpc/client';
import { getChartColor } from '@/utils/theme';
+import { useMemo } from 'react';
export type IRechartPayloadItem = {
id: string;
@@ -45,7 +45,7 @@ export function useRechartDataModel(series: IChartData['series']) {
}
return acc2;
},
- {} as Record<string, any>
+ {} as Record<string, any>,
),
};
}, {}),
diff --git a/apps/dashboard/src/hooks/useThrottle.ts b/apps/dashboard/src/hooks/useThrottle.ts
index 0ad7dd34f..0a89a3242 100644
--- a/apps/dashboard/src/hooks/useThrottle.ts
+++ b/apps/dashboard/src/hooks/useThrottle.ts
@@ -1,5 +1,5 @@
-import { useCallback, useEffect, useRef } from 'react';
import throttle from 'lodash.throttle';
+import { useCallback, useEffect, useRef } from 'react';
export function useThrottle(cb: () => void, delay: number) {
const options = { leading: true, trailing: false }; // add custom lodash options
@@ -10,6 +10,6 @@ export function useThrottle(cb: () => void, delay: number) {
});
return useCallback(
throttle(() => cbRef.current(), delay, options),
- [delay]
+ [delay],
);
}
diff --git a/apps/dashboard/src/hooks/useVisibleSeries.ts b/apps/dashboard/src/hooks/useVisibleSeries.ts
index 957b1362e..27e6bbd56 100644
--- a/apps/dashboard/src/hooks/useVisibleSeries.ts
+++ b/apps/dashboard/src/hooks/useVisibleSeries.ts
@@ -1,18 +1,18 @@
'use client';
-import { useEffect, useMemo, useState } from 'react';
import type { IChartData } from '@/trpc/client';
+import { useEffect, useMemo, useState } from 'react';
export type IVisibleSeries = ReturnType<typeof useVisibleSeries>['series'];
export function useVisibleSeries(data: IChartData, limit?: number | undefined) {
const max = limit ?? 5;
const [visibleSeries, setVisibleSeries] = useState<string[]>(
- data?.series?.slice(0, max).map((serie) => serie.id) ?? []
+ data?.series?.slice(0, max).map((serie) => serie.id) ?? [],
);
useEffect(() => {
setVisibleSeries(
- data?.series?.slice(0, max).map((serie) => serie.id) ?? []
+ data?.series?.slice(0, max).map((serie) => serie.id) ?? [],
);
}, [data, max]);
diff --git a/apps/dashboard/src/hooks/useWS.ts b/apps/dashboard/src/hooks/useWS.ts
index a53474b10..52fb7688b 100644
--- a/apps/dashboard/src/hooks/useWS.ts
+++ b/apps/dashboard/src/hooks/useWS.ts
@@ -1,8 +1,8 @@
'use client';
-import { use, useEffect, useMemo, useState } from 'react';
import { useAuth } from '@clerk/nextjs';
import debounce from 'lodash.debounce';
+import { use, useEffect, useMemo, useState } from 'react';
import useWebSocket from 'react-use-websocket';
import { getSuperJson } from '@openpanel/common';
@@ -16,7 +16,7 @@ type UseWSOptions = {
export default function useWS<T>(
path: string,
onMessage: (event: T) => void,
- options?: UseWSOptions
+ options?: UseWSOptions,
) {
const auth = useAuth();
const ws = String(process.env.NEXT_PUBLIC_API_URL)
diff --git a/apps/dashboard/src/middleware.ts b/apps/dashboard/src/middleware.ts
index 44ac17806..c907252f8 100644
--- a/apps/dashboard/src/middleware.ts
+++ b/apps/dashboard/src/middleware.ts
@@ -19,7 +19,7 @@ export default clerkMiddleware(
},
{
debug: !!process.env.CLERK_DEBUG,
- }
+ },
);
export const config = {
diff --git a/apps/dashboard/src/modals/AddClient.tsx b/apps/dashboard/src/modals/AddClient.tsx
index 70ec70998..74a7bfdda 100644
--- a/apps/dashboard/src/modals/AddClient.tsx
+++ b/apps/dashboard/src/modals/AddClient.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useState } from 'react';
import AnimateHeight from '@/components/animate-height';
import { CreateClientSuccess } from '@/components/clients/create-client-success';
import TagInput from '@/components/forms/tag-input';
@@ -17,6 +16,7 @@ import { cn } from '@/utils/cn';
import { zodResolver } from '@hookform/resolvers/zod';
import { SaveIcon } from 'lucide-react';
import { useRouter } from 'next/navigation';
+import { useState } from 'react';
import type { SubmitHandler } from 'react-hook-form';
import { Controller, useForm } from 'react-hook-form';
import { toast } from 'sonner';
@@ -90,6 +90,7 @@ export default function AddClient(props: Props) {
className={cn(buttonVariants({ variant: 'secondary' }), 'flex-1')}
href="https://docs.openpanel.dev/docs"
target="_blank"
+ rel="noreferrer"
>
Read docs
</a>
@@ -171,7 +172,7 @@ export default function AddClient(props: Props) {
}
return `https://${trimmed}`;
})
- .join(',')
+ .join(','),
);
}}
/>
@@ -265,37 +266,3 @@ export default function AddClient(props: Props) {
</ModalContent>
);
}
-
-{
- /* <div>
- <div className="text-lg">
- Select your framework and we'll generate a client for you.
- </div>
- <div className="flex flex-wrap gap-2 mt-8">
- <FeatureButton
- name="React"
- logo="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/React-icon.svg/2300px-React-icon.svg.png"
- />
- <FeatureButton
- name="React Native"
- logo="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/React-icon.svg/2300px-React-icon.svg.png"
- />
- <FeatureButton
- name="Next.js"
- logo="https://static-00.iconduck.com/assets.00/nextjs-icon-512x512-y563b8iq.png"
- />
- <FeatureButton
- name="Remix"
- logo="https://www.datocms-assets.com/205/1642515307-square-logo.svg"
- />
- <FeatureButton
- name="Vue"
- logo="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ0UhQnp6TUPCwAr3ruTEwBDiTN5HLAWaoUD3AJIgtepQ&s"
- />
- <FeatureButton
- name="HTML"
- logo="https://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/240px-HTML5_logo_and_wordmark.svg.png"
- />
- </div>
-</div> */
-}
diff --git a/apps/dashboard/src/modals/DateRangerPicker.tsx b/apps/dashboard/src/modals/DateRangerPicker.tsx
index 219162e50..11dca618b 100644
--- a/apps/dashboard/src/modals/DateRangerPicker.tsx
+++ b/apps/dashboard/src/modals/DateRangerPicker.tsx
@@ -1,8 +1,8 @@
-import { useState } from 'react';
import { Button } from '@/components/ui/button';
import { Calendar } from '@/components/ui/calendar';
import { useBreakpoint } from '@/hooks/useBreakpoint';
import { subMonths } from 'date-fns';
+import { useState } from 'react';
import { popModal } from '.';
import { ModalContent, ModalHeader } from './Modal/Container';
@@ -28,7 +28,7 @@ export default function DateRangerPicker({
mode="range"
defaultMonth={subMonths(
startDate ? new Date(startDate) : new Date(),
- isBelowSm ? 0 : 1
+ isBelowSm ? 0 : 1,
)}
selected={{
from: startDate,
diff --git a/apps/dashboard/src/modals/EditClient.tsx b/apps/dashboard/src/modals/EditClient.tsx
index 4f834dff0..fd9a9db4f 100644
--- a/apps/dashboard/src/modals/EditClient.tsx
+++ b/apps/dashboard/src/modals/EditClient.tsx
@@ -106,7 +106,7 @@ export default function EditClient({
}
return `https://${trimmed}`;
})
- .join(',')
+ .join(','),
);
}}
/>
diff --git a/apps/dashboard/src/modals/FunnelStepDetails.tsx b/apps/dashboard/src/modals/FunnelStepDetails.tsx
index 0adf986f4..efbcbe72d 100644
--- a/apps/dashboard/src/modals/FunnelStepDetails.tsx
+++ b/apps/dashboard/src/modals/FunnelStepDetails.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useEffect, useRef, useState } from 'react';
import { ListPropertiesIcon } from '@/components/events/list-properties-icon';
import { Pagination } from '@/components/pagination';
import { ProfileAvatar } from '@/components/profiles/profile-avatar';
@@ -13,6 +12,7 @@ import { api } from '@/trpc/client';
import { getProfileName } from '@/utils/getters';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
+import { useEffect, useRef, useState } from 'react';
import type { IChartInput } from '@openpanel/validation';
@@ -47,7 +47,7 @@ export default function FunnelStepDetails(props: Props) {
return (
<DialogContent className="p-0">
<div className="p-4">
- <ModalHeader title="Profiles"></ModalHeader>
+ <ModalHeader title="Profiles" />
<Pagination
count={data.length}
take={50}
diff --git a/apps/dashboard/src/modals/Instructions.tsx b/apps/dashboard/src/modals/Instructions.tsx
index 888acde11..5338e91da 100644
--- a/apps/dashboard/src/modals/Instructions.tsx
+++ b/apps/dashboard/src/modals/Instructions.tsx
@@ -88,7 +88,7 @@ const Instructions = ({ framework, client }: Props) => {
return (
<div className="flex flex-col gap-4">
<p>Install dependencies</p>
- <Syntax code={`pnpm install @openpanel/nextjs`} />
+ <Syntax code={'pnpm install @openpanel/nextjs'} />
<p>Add OpenPanelComponent to your root layout</p>
<Syntax
code={`import { OpenPanelComponent } from '@openpanel/nextjs';
@@ -128,7 +128,7 @@ useOpenPanel().track('my_event', { foo: 'bar' });
return (
<div className="flex flex-col gap-4">
<p>Install dependencies</p>
- <Syntax code={`composer require bleckert/openpanel-laravel`} />
+ <Syntax code={'composer require bleckert/openpanel-laravel'} />
<p>Add environment variables</p>
<Syntax
code={`OPENPANEL_CLIENT_ID=${clientId}
@@ -164,6 +164,7 @@ $openpanel->event(
href="https://twitter.com/tbleckert"
target="_blank"
className="underline"
+ rel="noreferrer"
>
@tbleckert
</a>{' '}
@@ -216,7 +217,7 @@ $openpanel->event(
return (
<div className="flex flex-col gap-4">
<strong>Install dependencies</strong>
- <Syntax code={`npm install @openpanel/express`} />
+ <Syntax code={'npm install @openpanel/express'} />
<strong>Usage</strong>
<p>Connect the middleware to your app.</p>
@@ -259,7 +260,7 @@ app.listen(3000, () => {
return (
<div className="flex flex-col gap-4">
<strong>Install dependencies</strong>
- <Syntax code={`pnpm install @openpanel/sdk`} />
+ <Syntax code={'pnpm install @openpanel/sdk'} />
<strong>Create a instance</strong>
<p>
@@ -360,6 +361,7 @@ op.decrement({ name: 'app_opened', profile_id: '123', value: 5 }); // decrement
href="https://github.com/Openpanel-dev/examples/tree/main/expo-app"
target="_blank"
className="underline"
+ rel="noreferrer"
>
example app
</a>{' '}
diff --git a/apps/dashboard/src/modals/Modal/Container.tsx b/apps/dashboard/src/modals/Modal/Container.tsx
index 271895faf..4626b9632 100644
--- a/apps/dashboard/src/modals/Modal/Container.tsx
+++ b/apps/dashboard/src/modals/Modal/Container.tsx
@@ -33,7 +33,7 @@ export function ModalHeader({
<div
className={cn(
'relative -m-6 mb-6 flex justify-between rounded-t-lg border-b bg-def-100 p-6',
- className
+ className,
)}
style={{
backgroundImage: `url("data:image/svg+xml,<svg id='patternId' width='100%' height='100%' xmlns='http://www.w3.org/2000/svg'><defs><pattern id='a' patternUnits='userSpaceOnUse' width='20' height='20' patternTransform='scale(2) rotate(85)'><rect x='0' y='0' width='100%' height='100%' fill='hsla(0, 0%, 100%, 0)'/><path d='M 10,-2.55e-7 V 20 Z M -1.1677362e-8,10 H 20 Z' stroke-width='0.5' stroke='hsla(259, 0%, 52%, 0.46)' fill='none'/></pattern></defs><rect width='800%' height='800%' transform='translate(0,0)' fill='url(%23a)'/></svg>")`,
@@ -41,7 +41,7 @@ export function ModalHeader({
backgroundRepeat: 'repeat',
}}
>
- <div className="absolute inset-0 bg-gradient-to-r from-def-100/95 to-def-100/80"></div>
+ <div className="absolute inset-0 bg-gradient-to-r from-def-100/95 to-def-100/80" />
<div className="row relative w-full items-start justify-between">
<div className="col mt-1 flex-1 gap-2">
<div className="text-3xl font-semibold">{title}</div>
diff --git a/apps/dashboard/src/modals/SaveReport.tsx b/apps/dashboard/src/modals/SaveReport.tsx
index f5df533f4..34426c89d 100644
--- a/apps/dashboard/src/modals/SaveReport.tsx
+++ b/apps/dashboard/src/modals/SaveReport.tsx
@@ -44,7 +44,7 @@ export default function SaveReport({ report }: SaveReportProps) {
router.push(
`/${organizationSlug}/${projectId}/reports/${
res.id
- }?${searchParams?.toString()}`
+ }?${searchParams?.toString()}`,
);
},
});
diff --git a/apps/dashboard/src/modals/VerifyEmail.tsx b/apps/dashboard/src/modals/VerifyEmail.tsx
index a9814ebb4..6d39f38de 100644
--- a/apps/dashboard/src/modals/VerifyEmail.tsx
+++ b/apps/dashboard/src/modals/VerifyEmail.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useState } from 'react';
import {
InputOTP,
InputOTPGroup,
@@ -9,6 +8,7 @@ import {
import { getClerkError } from '@/utils/clerk-error';
import { useSignUp } from '@clerk/nextjs';
import { useRouter } from 'next/navigation';
+import { useState } from 'react';
import { toast } from 'sonner';
import { popModal } from '.';
@@ -51,7 +51,7 @@ export default function VerifyEmail({ email }: Props) {
const completeSignUp = await signUp.attemptEmailAddressVerification(
{
code,
- }
+ },
);
if (completeSignUp.status !== 'complete') {
diff --git a/apps/dashboard/src/modals/edit-event.tsx b/apps/dashboard/src/modals/edit-event.tsx
index 7a6461fc3..f8819c8ae 100644
--- a/apps/dashboard/src/modals/edit-event.tsx
+++ b/apps/dashboard/src/modals/edit-event.tsx
@@ -1,4 +1,3 @@
-import { useEffect, useState } from 'react';
import {
EventIconColors,
EventIconMapper,
@@ -15,6 +14,7 @@ import { useQueryClient } from '@tanstack/react-query';
import { getQueryKey } from '@trpc/react-query';
import { AnimatePresence, motion } from 'framer-motion';
import { UndoIcon } from 'lucide-react';
+import { useEffect, useState } from 'react';
import { toast } from 'sonner';
import { popModal } from '.';
@@ -96,6 +96,7 @@ export default function EditEvent({ id }: Props) {
<div className={iconGrid}>
{Object.entries(EventIconMapper).map(([name, Icon]) => (
<button
+ type="button"
key={name}
onClick={() => {
setIcon(name);
@@ -105,7 +106,7 @@ export default function EditEvent({ id }: Props) {
'inline-flex h-8 w-8 flex-shrink-0 cursor-pointer items-center justify-center rounded-md bg-def-200 transition-all',
name === selectedIcon
? 'scale-110 ring-1 ring-black'
- : '[&_svg]:opacity-50'
+ : '[&_svg]:opacity-50',
)}
>
<Icon size={16} />
@@ -123,7 +124,7 @@ export default function EditEvent({ id }: Props) {
>
<div className="row mb-4 items-center justify-between">
<div className="font-medium leading-none">Pick a color</div>
- <button onClick={() => setStep('icon')}>
+ <button type="button" onClick={() => setStep('icon')}>
<Badge variant="muted">
Select icon
<UndoIcon className="ml-1 h-3 w-3" />
@@ -133,6 +134,7 @@ export default function EditEvent({ id }: Props) {
<div className={iconGrid}>
{EventIconColors.map((color) => (
<button
+ type="button"
key={color}
onClick={() => {
setColor(color);
@@ -140,7 +142,7 @@ export default function EditEvent({ id }: Props) {
className={cn(
'flex h-8 w-8 flex-shrink-0 cursor-pointer items-center justify-center rounded-md transition-all',
color === selectedColor ? 'ring-1 ring-black' : '',
- getBg(color)
+ getBg(color),
)}
>
{SelectedIcon ? (
diff --git a/apps/dashboard/src/modals/event-details.tsx b/apps/dashboard/src/modals/event-details.tsx
index a700d9442..d907ab8ed 100644
--- a/apps/dashboard/src/modals/event-details.tsx
+++ b/apps/dashboard/src/modals/event-details.tsx
@@ -158,7 +158,7 @@ export default function EventDetails({ id }: Props) {
setFilter(
`properties.${item.name}`,
item.value ? String(item.value) : '',
- 'is'
+ 'is',
);
}}
/>
@@ -184,6 +184,7 @@ export default function EventDetails({ id }: Props) {
<div className="mb-2 flex justify-between font-medium">
<div>Similar events</div>
<button
+ type="button"
className="text-muted-foreground hover:underline"
onClick={() => {
setEvents([event.name]);
diff --git a/apps/dashboard/src/styles/globals.css b/apps/dashboard/src/styles/globals.css
index b75b5e01e..6317da651 100644
--- a/apps/dashboard/src/styles/globals.css
+++ b/apps/dashboard/src/styles/globals.css
@@ -110,9 +110,7 @@
.shine {
background-repeat: no-repeat;
- background-position:
- -120px -120px,
- 0 0;
+ background-position: -120px -120px, 0 0;
background-image: linear-gradient(
0 0,
rgba(255, 255, 255, 0.2) 0%,
@@ -120,16 +118,12 @@
rgba(255, 255, 255, 0.8) 45%,
rgba(255, 255, 255, 0) 50%
);
- background-size:
- 250% 250%,
- 100% 100%;
+ background-size: 250% 250%, 100% 100%;
transition: background-position 0s ease;
}
.shine:hover {
- background-position:
- 0 0,
- 0 0;
+ background-position: 0 0, 0 0;
transition-duration: 0.5s;
}
diff --git a/apps/dashboard/src/trpc/client.tsx b/apps/dashboard/src/trpc/client.tsx
index 729f60a54..9f47d04c3 100644
--- a/apps/dashboard/src/trpc/client.tsx
+++ b/apps/dashboard/src/trpc/client.tsx
@@ -31,7 +31,7 @@ export function handleError(error: TRPCClientErrorBase<any>) {
}
export function handleErrorToastOptions(options: ExternalToast) {
- return function (error: TRPCClientErrorBase<any>) {
+ return (error: TRPCClientErrorBase<any>) => {
toast('Error', {
description: error.message,
...options,
diff --git a/apps/dashboard/src/types/react-simple-map.d.ts b/apps/dashboard/src/types/react-simple-map.d.ts
index 0320ef8be..41edac521 100644
--- a/apps/dashboard/src/types/react-simple-map.d.ts
+++ b/apps/dashboard/src/types/react-simple-map.d.ts
@@ -1,222 +1,267 @@
-import type { GeoPath, GeoProjection } from "d3-geo";
-import type { D3ZoomEvent } from "d3-zoom";
-import type { Feature } from "geojson";
-import type * as React from "react";
+import type { GeoPath, GeoProjection } from 'd3-geo';
+import type { D3ZoomEvent } from 'd3-zoom';
+import type { Feature } from 'geojson';
+import type * as React from 'react';
-declare module 'react-simple-maps' {
+declare module 'react-simple-maps' {
export type Point = [number, number];
-
+
export interface ProjectionConfig {
- scale?: number | undefined;
- center?: [number, number] | undefined;
- parallels?: [number, number] | undefined;
- rotate?: [number, number, number] | undefined;
+ scale?: number | undefined;
+ center?: [number, number] | undefined;
+ parallels?: [number, number] | undefined;
+ rotate?: [number, number, number] | undefined;
}
- export type ProjectionFunction = (width: number, height: number, config: ProjectionConfig) => GeoProjection;
-
- export interface ComposableMapProps extends React.SVGAttributes<SVGSVGElement> {
- children?: React.ReactNode;
- /**
- * @default 800
- */
- width?: number | undefined;
- /**
- * @default 600
- */
- height?: number | undefined;
- /**
- * @default "geoEqualEarth"
- */
- projection?: string | ProjectionFunction | undefined;
- /**
- * @default {}
- */
- projectionConfig?: ProjectionConfig | undefined;
+ export type ProjectionFunction = (
+ width: number,
+ height: number,
+ config: ProjectionConfig,
+ ) => GeoProjection;
+
+ export interface ComposableMapProps
+ extends React.SVGAttributes<SVGSVGElement> {
+ children?: React.ReactNode;
+ /**
+ * @default 800
+ */
+ width?: number | undefined;
+ /**
+ * @default 600
+ */
+ height?: number | undefined;
+ /**
+ * @default "geoEqualEarth"
+ */
+ projection?: string | ProjectionFunction | undefined;
+ /**
+ * @default {}
+ */
+ projectionConfig?: ProjectionConfig | undefined;
}
-
+
export interface Position {
- x: number;
- y: number;
- last: Point;
- zoom: number;
- dragging: boolean;
- zooming: boolean;
+ x: number;
+ y: number;
+ last: Point;
+ zoom: number;
+ dragging: boolean;
+ zooming: boolean;
}
-
+
export interface ZoomableGroupProps extends React.SVGAttributes<SVGGElement> {
- children?: React.ReactNode;
- /**
- * @default [0, 0]
- */
- center?: Point | undefined;
- /**
- * @default 1
- */
- zoom?: number | undefined;
- /**
- * @default 1
- */
- minZoom?: number | undefined;
- /**
- * @default 5
- */
- maxZoom?: number | undefined;
- /**
- * @default 0.025
- */
- zoomSensitivity?: number | undefined;
- /**
- * @default false
- */
- disablePanning?: boolean | undefined;
- /**
- * @default false
- */
- disableZooming?: boolean | undefined;
- onMoveStart?:
- | ((position: { coordinates: [number, number]; zoom: number }, event: D3ZoomEvent<SVGElement, any>) => void)
- | undefined;
- onMove?:
- | ((
- position: { x: number; y: number; zoom: number; dragging: WheelEvent },
- event: D3ZoomEvent<SVGElement, any>,
- ) => void)
- | undefined;
- onMoveEnd?:
- | ((position: { coordinates: [number, number]; zoom: number }, event: D3ZoomEvent<SVGElement, any>) => void)
- | undefined;
- filterZoomEvent?: ((element: SVGElement) => boolean) | undefined;
- translateExtent?: [[number, number], [number, number]] | undefined;
+ children?: React.ReactNode;
+ /**
+ * @default [0, 0]
+ */
+ center?: Point | undefined;
+ /**
+ * @default 1
+ */
+ zoom?: number | undefined;
+ /**
+ * @default 1
+ */
+ minZoom?: number | undefined;
+ /**
+ * @default 5
+ */
+ maxZoom?: number | undefined;
+ /**
+ * @default 0.025
+ */
+ zoomSensitivity?: number | undefined;
+ /**
+ * @default false
+ */
+ disablePanning?: boolean | undefined;
+ /**
+ * @default false
+ */
+ disableZooming?: boolean | undefined;
+ onMoveStart?:
+ | ((
+ position: { coordinates: [number, number]; zoom: number },
+ event: D3ZoomEvent<SVGElement, any>,
+ ) => void)
+ | undefined;
+ onMove?:
+ | ((
+ position: {
+ x: number;
+ y: number;
+ zoom: number;
+ dragging: WheelEvent;
+ },
+ event: D3ZoomEvent<SVGElement, any>,
+ ) => void)
+ | undefined;
+ onMoveEnd?:
+ | ((
+ position: { coordinates: [number, number]; zoom: number },
+ event: D3ZoomEvent<SVGElement, any>,
+ ) => void)
+ | undefined;
+ filterZoomEvent?: ((element: SVGElement) => boolean) | undefined;
+ translateExtent?: [[number, number], [number, number]] | undefined;
}
-
+
interface GeographiesChildrenArgument {
- geographies: any[];
- path: GeoPath;
- projection: GeoProjection;
+ geographies: any[];
+ path: GeoPath;
+ projection: GeoProjection;
}
-
- export interface GeographiesProps extends Omit<React.SVGAttributes<SVGGElement>, "children"> {
- parseGeographies?: ((features: Feature<any, any>[]) => Feature<any, any>[]) | undefined;
- geography?: string | Record<string, any> | string[] | undefined;
- children?: ((data: GeographiesChildrenArgument) => void) | undefined;
+
+ export interface GeographiesProps
+ extends Omit<React.SVGAttributes<SVGGElement>, 'children'> {
+ parseGeographies?:
+ | ((features: Feature<any, any>[]) => Feature<any, any>[])
+ | undefined;
+ geography?: string | Record<string, any> | string[] | undefined;
+ children?: ((data: GeographiesChildrenArgument) => void) | undefined;
}
-
+
export interface GeographyProps
- extends Pick<React.SVGProps<SVGPathElement>, Exclude<keyof React.SVGProps<SVGPathElement>, "style">>
- {
- geography?: any;
- style?: {
+ extends Pick<
+ React.SVGProps<SVGPathElement>,
+ Exclude<keyof React.SVGProps<SVGPathElement>, 'style'>
+ > {
+ geography?: any;
+ style?:
+ | {
default?: React.CSSProperties | undefined;
hover?: React.CSSProperties | undefined;
pressed?: React.CSSProperties | undefined;
- } | undefined;
- onMouseEnter?: ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void) | undefined;
- onMouseLeave?: ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void) | undefined;
- onMouseDown?: ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void) | undefined;
- onMouseUp?: ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void) | undefined;
- onFocus?: ((event: React.FocusEvent<SVGPathElement>) => void) | undefined;
- onBlur?: ((event: React.FocusEvent<SVGPathElement>) => void) | undefined;
+ }
+ | undefined;
+ onMouseEnter?:
+ | ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void)
+ | undefined;
+ onMouseLeave?:
+ | ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void)
+ | undefined;
+ onMouseDown?:
+ | ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void)
+ | undefined;
+ onMouseUp?:
+ | ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void)
+ | undefined;
+ onFocus?: ((event: React.FocusEvent<SVGPathElement>) => void) | undefined;
+ onBlur?: ((event: React.FocusEvent<SVGPathElement>) => void) | undefined;
}
-
+
export interface MarkerProps
- extends Pick<React.SVGProps<SVGPathElement>, Exclude<keyof React.SVGProps<SVGPathElement>, "style">>
- {
- children?: React.ReactNode;
- coordinates?: Point | undefined;
- style?: {
+ extends Pick<
+ React.SVGProps<SVGPathElement>,
+ Exclude<keyof React.SVGProps<SVGPathElement>, 'style'>
+ > {
+ children?: React.ReactNode;
+ coordinates?: Point | undefined;
+ style?:
+ | {
default?: React.CSSProperties | undefined;
hover?: React.CSSProperties | undefined;
pressed?: React.CSSProperties | undefined;
- } | undefined;
- onMouseEnter?: ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void) | undefined;
- onMouseLeave?: ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void) | undefined;
- onMouseDown?: ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void) | undefined;
- onMouseUp?: ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void) | undefined;
- onFocus?: ((event: React.FocusEvent<SVGPathElement>) => void) | undefined;
- onBlur?: ((event: React.FocusEvent<SVGPathElement>) => void) | undefined;
+ }
+ | undefined;
+ onMouseEnter?:
+ | ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void)
+ | undefined;
+ onMouseLeave?:
+ | ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void)
+ | undefined;
+ onMouseDown?:
+ | ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void)
+ | undefined;
+ onMouseUp?:
+ | ((event: React.MouseEvent<SVGPathElement, MouseEvent>) => void)
+ | undefined;
+ onFocus?: ((event: React.FocusEvent<SVGPathElement>) => void) | undefined;
+ onBlur?: ((event: React.FocusEvent<SVGPathElement>) => void) | undefined;
}
-
+
export interface AnnotationProps extends React.SVGProps<SVGGElement> {
- children?: React.ReactNode;
- subject?: Point | undefined;
- connectorProps: React.SVGProps<SVGPathElement>;
- /**
- * @default 30
- */
- dx?: number | string | undefined;
- /**
- * @default 30
- */
- dy?: number | string | undefined;
- /**
- * @default 0
- */
- curve?: number | undefined;
+ children?: React.ReactNode;
+ subject?: Point | undefined;
+ connectorProps: React.SVGProps<SVGPathElement>;
+ /**
+ * @default 30
+ */
+ dx?: number | string | undefined;
+ /**
+ * @default 30
+ */
+ dy?: number | string | undefined;
+ /**
+ * @default 0
+ */
+ curve?: number | undefined;
}
-
+
export interface GraticuleProps extends React.SVGProps<SVGPathElement> {
- /**
- * @default [10, 10]
- */
- step?: Point | undefined;
- /**
- * @default "currentcolor"
- */
- stroke?: string | undefined;
- /**
- * @default "transparent"
- */
- fill?: string | undefined;
+ /**
+ * @default [10, 10]
+ */
+ step?: Point | undefined;
+ /**
+ * @default "currentcolor"
+ */
+ stroke?: string | undefined;
+ /**
+ * @default "transparent"
+ */
+ fill?: string | undefined;
}
-
+
export interface LineProps
- extends Pick<React.SVGProps<SVGPathElement>, Exclude<keyof React.SVGProps<SVGPathElement>, "from" | "to">>
- {
- /**
- * @default [0, 0]
- */
- from?: Point | undefined;
- /**
- * @default [0, 0]
- */
- to?: Point | undefined;
- /**
- * @default [[0, 0], [0, 0]]
- */
- coordinates?: Point[] | undefined;
- /**
- * @default "currentcolor"
- */
- stroke?: string | undefined;
- /**
- * @default 3
- */
- strokeWidth?: number | string | undefined;
- /**
- * @default "transparent"
- */
- fill?: string | undefined;
+ extends Pick<
+ React.SVGProps<SVGPathElement>,
+ Exclude<keyof React.SVGProps<SVGPathElement>, 'from' | 'to'>
+ > {
+ /**
+ * @default [0, 0]
+ */
+ from?: Point | undefined;
+ /**
+ * @default [0, 0]
+ */
+ to?: Point | undefined;
+ /**
+ * @default [[0, 0], [0, 0]]
+ */
+ coordinates?: Point[] | undefined;
+ /**
+ * @default "currentcolor"
+ */
+ stroke?: string | undefined;
+ /**
+ * @default 3
+ */
+ strokeWidth?: number | string | undefined;
+ /**
+ * @default "transparent"
+ */
+ fill?: string | undefined;
}
-
+
interface SphereProps extends React.SVGProps<SVGPathElement> {
- /**
- * @default "rsm-sphere"
- */
- id: string;
- /**
- * @default "transparent"
- */
- fill: string;
- /**
- * @default "currentcolor"
- */
- stroke: string;
- /**
- * @default 0.5
- */
- strokeWidth: number;
+ /**
+ * @default "rsm-sphere"
+ */
+ id: string;
+ /**
+ * @default "transparent"
+ */
+ fill: string;
+ /**
+ * @default "currentcolor"
+ */
+ stroke: string;
+ /**
+ * @default 0.5
+ */
+ strokeWidth: number;
}
-
+
declare const ComposableMap: React.FunctionComponent<ComposableMapProps>;
declare const ZoomableGroup: React.FunctionComponent<ZoomableGroupProps>;
declare const Geographies: React.FunctionComponent<GeographiesProps>;
@@ -228,13 +273,24 @@ declare module 'react-simple-maps' {
declare const Sphere: React.FunctionComponent<SphereProps>;
declare const useZoomPan: (options: {
- center: Point,
- zoom: number
- filterZoomEvent?: () => boolean
+ center: Point;
+ zoom: number;
+ filterZoomEvent?: () => boolean;
}) => {
- mapRef: React.MutableRefObject<SVGGElement | null>,
- transformString: string,
- }
-
- export { useZoomPan, Annotation, ComposableMap, Geographies, Geography, Graticule, Line, Marker, Sphere, ZoomableGroup };
+ mapRef: React.MutableRefObject<SVGGElement | null>;
+ transformString: string;
+ };
+
+ export {
+ useZoomPan,
+ Annotation,
+ ComposableMap,
+ Geographies,
+ Geography,
+ Graticule,
+ Line,
+ Marker,
+ Sphere,
+ ZoomableGroup,
+ };
}
diff --git a/apps/dashboard/src/utils/getters.ts b/apps/dashboard/src/utils/getters.ts
index bbdf35660..773ba29ac 100644
--- a/apps/dashboard/src/utils/getters.ts
+++ b/apps/dashboard/src/utils/getters.ts
@@ -2,7 +2,7 @@ import type { IServiceProfile } from '@openpanel/db';
export function getProfileName(
profile: IServiceProfile | undefined | null,
- short = true
+ short = true,
) {
if (!profile) {
return '';
@@ -10,7 +10,7 @@ export function getProfileName(
if (!profile.isExternal) {
if (short) {
- return profile.id.slice(0, 4) + '...' + profile.id.slice(-4);
+ return `${profile.id.slice(0, 4)}...${profile.id.slice(-4)}`;
}
return profile.id;
}
diff --git a/apps/dashboard/src/utils/math.ts b/apps/dashboard/src/utils/math.ts
index 23ea02961..e75c1964d 100644
--- a/apps/dashboard/src/utils/math.ts
+++ b/apps/dashboard/src/utils/math.ts
@@ -1 +1 @@
-export * from '@openpanel/common/src/math'
\ No newline at end of file
+export * from '@openpanel/common/src/math';
diff --git a/apps/dashboard/src/utils/truncate.ts b/apps/dashboard/src/utils/truncate.ts
index 9cecae764..5a3e9af39 100644
--- a/apps/dashboard/src/utils/truncate.ts
+++ b/apps/dashboard/src/utils/truncate.ts
@@ -2,5 +2,5 @@ export function truncate(str: string, len: number) {
if (str.length <= len) {
return str;
}
- return str.slice(0, len) + '...';
+ return `${str.slice(0, len)}...`;
}
diff --git a/apps/dashboard/tailwind.config.js b/apps/dashboard/tailwind.config.js
index 5369e9a06..5a028b5f9 100644
--- a/apps/dashboard/tailwind.config.js
+++ b/apps/dashboard/tailwind.config.js
@@ -45,7 +45,7 @@ const config = {
darkMode: 'class',
safelist: [
...colors.flatMap((color) =>
- ['text', 'bg'].map((prefix) => `${prefix}-chart-${color}`)
+ ['text', 'bg'].map((prefix) => `${prefix}-chart-${color}`),
),
...twColors.flatMap((color) => {
return twColorVariants.flatMap((variant) => {
diff --git a/apps/docs/.gitignore b/apps/docs/.gitignore
index 2971a0bd6..04424e485 100644
--- a/apps/docs/.gitignore
+++ b/apps/docs/.gitignore
@@ -26,9 +26,6 @@ next-env.d.ts
# debug
npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-.pnpm-debug.log*
# local env files
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
diff --git a/apps/docs/Dockerfile b/apps/docs/Dockerfile
index 07931d80e..3ad574279 100644
--- a/apps/docs/Dockerfile
+++ b/apps/docs/Dockerfile
@@ -21,7 +21,6 @@ COPY package.json package.json
COPY pnpm-lock.yaml pnpm-lock.yaml
COPY pnpm-workspace.yaml pnpm-workspace.yaml
COPY apps/docs/package.json apps/docs/package.json
-COPY patches patches
# BUILD
FROM base AS build
diff --git a/apps/docs/package.json b/apps/docs/package.json
index 6b7bf7469..39c93b87e 100644
--- a/apps/docs/package.json
+++ b/apps/docs/package.json
@@ -6,8 +6,6 @@
"dev": "rm -rf .next && pnpm with-env next dev",
"build": "next build",
"start": "next start",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{tsx,mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env -c --"
},
@@ -19,28 +17,13 @@
"react-dom": "18.2.0"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/node": "^18.16.0",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
- "@typescript-eslint/eslint-plugin": "^6.6.0",
- "@typescript-eslint/parser": "^6.6.0",
"autoprefixer": "^10.4.18",
- "eslint": "^8.48.0",
"postcss": "^8.4.35",
- "prettier": "^3.0.3",
"tailwindcss": "^3.4.1",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base",
- "@openpanel/eslint-config/react",
- "@openpanel/eslint-config/nextjs"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/apps/docs/postcss.config.js b/apps/docs/postcss.config.js
index 33ad091d2..12a703d90 100644
--- a/apps/docs/postcss.config.js
+++ b/apps/docs/postcss.config.js
@@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
},
-}
+};
diff --git a/apps/docs/src/components/web-sdk-config.mdx b/apps/docs/src/components/web-sdk-config.mdx
index 3ffae7e9b..5acd49078 100644
--- a/apps/docs/src/components/web-sdk-config.mdx
+++ b/apps/docs/src/components/web-sdk-config.mdx
@@ -2,5 +2,5 @@
- `trackScreenViews` - If true, the library will automatically track screen views (default: false)
- `trackOutgoingLinks` - If true, the library will automatically track outgoing links (default: false)
-- `trackAttributes` - If true, you can trigger events by using html attributes (`<button data-track="your_event" />`) (default: false)
+- `trackAttributes` - If true, you can trigger events by using html attributes (`<button type="button" data-track="your_event" />`) (default: false)
diff --git a/apps/docs/src/pages/_meta.json b/apps/docs/src/pages/_meta.json
index 184d54121..36f549087 100644
--- a/apps/docs/src/pages/_meta.json
+++ b/apps/docs/src/pages/_meta.json
@@ -7,4 +7,4 @@
"title": "Documentation",
"type": "page"
}
-}
\ No newline at end of file
+}
diff --git a/apps/docs/src/pages/docs/_meta.json b/apps/docs/src/pages/docs/_meta.json
index 3b5cfbadb..dad273d68 100644
--- a/apps/docs/src/pages/docs/_meta.json
+++ b/apps/docs/src/pages/docs/_meta.json
@@ -3,4 +3,4 @@
"sdks": "SDKs",
"migration": "Migrations",
"self-hosting": "Self-hosting"
-}
\ No newline at end of file
+}
diff --git a/apps/docs/src/pages/docs/migration/_meta.json b/apps/docs/src/pages/docs/migration/_meta.json
index 8d08ce710..d3e230c3a 100644
--- a/apps/docs/src/pages/docs/migration/_meta.json
+++ b/apps/docs/src/pages/docs/migration/_meta.json
@@ -1,3 +1,3 @@
{
"beta-v1": "Beta to v1"
-}
\ No newline at end of file
+}
diff --git a/apps/docs/src/pages/docs/sdks/_meta.json b/apps/docs/src/pages/docs/sdks/_meta.json
index 2a2ea555d..4ed62a21c 100644
--- a/apps/docs/src/pages/docs/sdks/_meta.json
+++ b/apps/docs/src/pages/docs/sdks/_meta.json
@@ -16,4 +16,4 @@
"javascript": "JavaScript",
"api": "API",
"export": "Export"
-}
\ No newline at end of file
+}
diff --git a/apps/docs/src/pages/docs/sdks/nextjs.mdx b/apps/docs/src/pages/docs/sdks/nextjs.mdx
index 3aac156a7..5916e4d7c 100644
--- a/apps/docs/src/pages/docs/sdks/nextjs.mdx
+++ b/apps/docs/src/pages/docs/sdks/nextjs.mdx
@@ -99,7 +99,7 @@ import { useOpenPanel } from '@openpanel/nextjs';
function YourComponent() {
const op = useOpenPanel();
- return <button onClick={() => op.track('my_event', { foo: 'bar' })}>Trigger event</button>
+ return <button type="button" onClick={() => op.track('my_event', { foo: 'bar' })}>Trigger event</button>
}
```
diff --git a/apps/docs/src/pages/docs/sdks/script.mdx b/apps/docs/src/pages/docs/sdks/script.mdx
index c706b6ef3..a56436a56 100644
--- a/apps/docs/src/pages/docs/sdks/script.mdx
+++ b/apps/docs/src/pages/docs/sdks/script.mdx
@@ -36,13 +36,13 @@ Just insert this snippet and replace `YOUR_CLIENT_ID` with your client id.
You can track events with two different methods: by calling the `window.op('track')` directly or by adding `data-track` attributes to your HTML elements.
```html filename="index.html"
-<button onclick="window.op('track', 'my_event', { foo: 'bar' })">
+<button type="button" onclick="window.op('track', 'my_event', { foo: 'bar' })">
Track event
</button>
```
```html filename="index.html"
-<button data-track="my_event" data-foo="bar">Track event</button>
+<button type="button" data-track="my_event" data-foo="bar">Track event</button>
```
### Identifying Users
diff --git a/apps/docs/src/pages/docs/self-hosting/_meta.json b/apps/docs/src/pages/docs/self-hosting/_meta.json
index 02dc5fd7a..315088871 100644
--- a/apps/docs/src/pages/docs/self-hosting/_meta.json
+++ b/apps/docs/src/pages/docs/self-hosting/_meta.json
@@ -1,3 +1,3 @@
{
"index": "Get started"
-}
\ No newline at end of file
+}
diff --git a/apps/docs/theme.config.jsx b/apps/docs/theme.config.jsx
index 38c48f2f7..0ac091897 100644
--- a/apps/docs/theme.config.jsx
+++ b/apps/docs/theme.config.jsx
@@ -42,7 +42,7 @@ export default {
content={domain.replace('https://', '')}
/>
<meta name="twitter:url" content={domain} />
- <meta name="og:type" content={`site`} />
+ <meta name="og:type" content={'site'} />
<meta name="og:url" content={canonicalUrl} />
<meta name="og:title" content={`${title} - Openpanel Docs`} />
<meta property="og:description" content={description} />
@@ -75,7 +75,7 @@ export default {
<a
href="https://twitter.com/CarlLindesvard"
target="_blank"
- rel="nofollow"
+ rel="noreferrer nofollow"
>
Carl
</a>
diff --git a/apps/public/.gitignore b/apps/public/.gitignore
index 2971a0bd6..04424e485 100644
--- a/apps/public/.gitignore
+++ b/apps/public/.gitignore
@@ -26,9 +26,6 @@ next-env.d.ts
# debug
npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-.pnpm-debug.log*
# local env files
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
diff --git a/apps/public/Dockerfile b/apps/public/Dockerfile
index 2bc148777..c891b06df 100644
--- a/apps/public/Dockerfile
+++ b/apps/public/Dockerfile
@@ -31,7 +31,6 @@ COPY packages/common/package.json packages/common/package.json
COPY packages/constants/package.json packages/constants/package.json
COPY packages/validation/package.json packages/validation/package.json
COPY packages/sdks/sdk/package.json packages/sdks/sdk/package.json
-COPY patches patches
# BUILD
FROM base AS build
diff --git a/apps/public/package.json b/apps/public/package.json
index 536620f79..3c1ef43a7 100644
--- a/apps/public/package.json
+++ b/apps/public/package.json
@@ -6,8 +6,6 @@
"dev": "rm -rf .next && pnpm with-env next dev",
"build": "next build",
"start": "next start",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{tsx,mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env -c --"
},
@@ -44,34 +42,15 @@
"zod": "^3.22.4"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@tailwindcss/typography": "^0.5.10",
"@types/node": "^18.16.0",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@types/react-syntax-highlighter": "^15.5.9",
- "@typescript-eslint/eslint-plugin": "^6.6.0",
- "@typescript-eslint/parser": "^6.6.0",
"autoprefixer": "^10.4.14",
- "eslint": "^8.48.0",
"postcss": "^8.4.27",
- "prettier": "^3.0.3",
- "prettier-plugin-tailwindcss": "^0.5.1",
"tailwindcss": "^3.3.3",
"typescript": "^5.2.2"
- },
- "ct3aMetadata": {
- "initVersion": "7.21.0"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base",
- "@openpanel/eslint-config/react",
- "@openpanel/eslint-config/nextjs"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/apps/public/src/app/(static)/privacy/page.tsx b/apps/public/src/app/(static)/privacy/page.tsx
index 7bbbeef31..71c7a2d56 100644
--- a/apps/public/src/app/(static)/privacy/page.tsx
+++ b/apps/public/src/app/(static)/privacy/page.tsx
@@ -114,7 +114,7 @@ export default function Page() {
<strong>Website</strong> refers to Openpanel, accessible from{' '}
<a
href="https://openpanel.com"
- rel="external nofollow noopener"
+ rel="noreferrer external nofollow noopener"
target="_blank"
>
https://openpanel.com
@@ -206,7 +206,7 @@ export default function Page() {
<a
href="https://www.termsfeed.com/blog/cookies/#What_Are_Cookies"
target="_blank"
- rel="nofollow"
+ rel="noreferrer nofollow"
>
here
</a>
diff --git a/apps/public/src/app/(static)/terms/page.tsx b/apps/public/src/app/(static)/terms/page.tsx
index 859d39aea..024dd6365 100644
--- a/apps/public/src/app/(static)/terms/page.tsx
+++ b/apps/public/src/app/(static)/terms/page.tsx
@@ -112,7 +112,7 @@ export default function Page() {
<strong>Website</strong> refers to Openpanel, accessible from{' '}
<a
href="https://openpanel.dev"
- rel="external nofollow noopener"
+ rel="noreferrer external nofollow noopener"
target="_blank"
>
https://openpanel.dev
diff --git a/apps/public/src/app/animated-text.tsx b/apps/public/src/app/animated-text.tsx
index db38de13b..86af446ef 100644
--- a/apps/public/src/app/animated-text.tsx
+++ b/apps/public/src/app/animated-text.tsx
@@ -19,7 +19,6 @@ const AnimatedText = ({ texts }: Props) => {
index === 0 ? 3000 : 2000,
];
}, [] as any[]);
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
@@ -36,7 +35,7 @@ const AnimatedText = ({ texts }: Props) => {
preRenderFirstString={true}
sequence={sequence}
wrapper="span"
- repeat={Infinity}
+ repeat={Number.POSITIVE_INFINITY}
omitDeletionAnimation
/>
</span>
diff --git a/apps/public/src/app/copy.tsx b/apps/public/src/app/copy.tsx
index 13e58ae85..478bb935c 100644
--- a/apps/public/src/app/copy.tsx
+++ b/apps/public/src/app/copy.tsx
@@ -28,7 +28,7 @@ export function Heading1({ children, className }: Props) {
<h1
className={cn(
'font-serif text-4xl font-bold !leading-tight text-slate-900 md:text-5xl',
- className
+ className,
)}
>
{children}
@@ -41,7 +41,7 @@ export function Heading2({ children, className }: Props) {
<h2
className={cn(
'font-serif text-4xl font-bold text-slate-900 md:text-5xl',
- className
+ className,
)}
>
{children}
@@ -54,7 +54,7 @@ export function Heading3({ children, className }: Props) {
<h3
className={cn(
'font-serif text-2xl font-bold text-slate-900 md:text-3xl',
- className
+ className,
)}
>
{children}
@@ -67,7 +67,7 @@ export function Heading4({ children, className }: Props) {
<h3
className={cn(
'font-serif text-xl font-bold text-slate-900 md:text-2xl',
- className
+ className,
)}
>
{children}
diff --git a/apps/public/src/app/features.tsx b/apps/public/src/app/features.tsx
index 82eda9835..db132a9b2 100644
--- a/apps/public/src/app/features.tsx
+++ b/apps/public/src/app/features.tsx
@@ -123,7 +123,7 @@ export function Feature({
<div
className={cn(
'container flex min-h-[300px] items-center justify-between gap-16 max-md:flex-col-reverse',
- !even && 'md:flex-row-reverse'
+ !even && 'md:flex-row-reverse',
)}
>
<div className="flex w-full flex-col">
diff --git a/apps/public/src/app/footer.tsx b/apps/public/src/app/footer.tsx
index 10d2e425f..ebd3fe14d 100644
--- a/apps/public/src/app/footer.tsx
+++ b/apps/public/src/app/footer.tsx
@@ -8,7 +8,7 @@ import { Heading2, Lead2 } from './copy';
export default function Footer() {
return (
<footer className="bg-blue-darker relative mt-40 text-white">
- <div className="absolute inset-0 h-full w-full bg-[radial-gradient(circle,rgba(255,255,255,0.2)_0%,rgba(255,255,255,0)_100%)]"></div>
+ <div className="absolute inset-0 h-full w-full bg-[radial-gradient(circle,rgba(255,255,255,0.2)_0%,rgba(255,255,255,0)_100%)]" />
<div className="container relative flex flex-col items-center text-center">
<div className="my-24">
<Heading2 className="mb-2 text-white">Get early access</Heading2>
@@ -40,7 +40,7 @@ export default function Footer() {
</div>
</div>
<div className="relative z-10 -mt-8">
- <div className="h-px w-full bg-[radial-gradient(circle,rgba(255,255,255,0.7)_0%,rgba(255,255,255,0.7)_50%,rgba(255,255,255,0)_100%)]"></div>
+ <div className="h-px w-full bg-[radial-gradient(circle,rgba(255,255,255,0.7)_0%,rgba(255,255,255,0.7)_50%,rgba(255,255,255,0)_100%)]" />
<div className="bg-blue-darker p-4">
<div className="container">
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
@@ -56,7 +56,7 @@ export default function Footer() {
className="hover:underline"
href="https://twitter.com/CarlLindesvard"
target="_blank"
- rel="nofollow"
+ rel="noreferrer nofollow"
>
Follow on X
</a>
diff --git a/apps/public/src/app/hero.tsx b/apps/public/src/app/hero.tsx
index fab4cbae9..51f38f34d 100644
--- a/apps/public/src/app/hero.tsx
+++ b/apps/public/src/app/hero.tsx
@@ -1,6 +1,6 @@
import { ALink } from '@/components/ui/button';
-import { chQuery, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, chQuery } from '@openpanel/db';
import { cacheable } from '../../../../packages/redis';
import AnimatedText from './animated-text';
@@ -8,15 +8,15 @@ import { Heading1, Lead2 } from './copy';
function shortNumber(num: number) {
if (num < 1e3) return num;
- if (num >= 1e3 && num < 1e6) return +(num / 1e3).toFixed(1) + 'K';
- if (num >= 1e6 && num < 1e9) return +(num / 1e6).toFixed(1) + 'M';
- if (num >= 1e9 && num < 1e12) return +(num / 1e9).toFixed(1) + 'B';
- if (num >= 1e12) return +(num / 1e12).toFixed(1) + 'T';
+ if (num >= 1e3 && num < 1e6) return `${+(num / 1e3).toFixed(1)}K`;
+ if (num >= 1e6 && num < 1e9) return `${+(num / 1e6).toFixed(1)}M`;
+ if (num >= 1e9 && num < 1e12) return `${+(num / 1e9).toFixed(1)}B`;
+ if (num >= 1e12) return `${+(num / 1e12).toFixed(1)}T`;
}
const getProjectsWithCount = cacheable(async () => {
const projects = await chQuery<{ project_id: string; count: number }>(
- `SELECT project_id, count(*) as count from ${TABLE_NAMES.events} GROUP by project_id order by count()`
+ `SELECT project_id, count(*) as count from ${TABLE_NAMES.events} GROUP by project_id order by count()`,
);
return projects;
@@ -28,7 +28,7 @@ export async function Hero() {
const eventCount = projects.reduce((acc, { count }) => acc + count, 0);
return (
<div className="relative overflow-hidden">
- {/* <div className="bg-blue-50 w-2/5 h-full absolute top-0 right-0"></div> */}
+ {/* <div className="bg-blue-50 w-2/5 h-full absolute top-0 right-0"/> */}
<div className="container relative flex min-h-[700px] flex-col items-center gap-4 max-md:pt-32 md:h-screen md:flex-row md:gap-8">
<div className="flex-1 max-md:text-center sm:min-w-[350px] lg:min-w-[400px]">
<div className="mb-4 flex justify-center md:justify-start">
diff --git a/apps/public/src/app/join-waitlist-hero.tsx b/apps/public/src/app/join-waitlist-hero.tsx
index d4266eccb..e72df1fed 100644
--- a/apps/public/src/app/join-waitlist-hero.tsx
+++ b/apps/public/src/app/join-waitlist-hero.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useEffect, useState } from 'react';
import { Button } from '@/components/ui/button';
import {
Dialog,
@@ -11,6 +10,7 @@ import {
DialogTitle,
} from '@/components/ui/dialog';
import { cn } from '@/utils/cn';
+import { useEffect, useState } from 'react';
interface JoinWaitlistProps {
className?: string;
@@ -66,7 +66,7 @@ export function JoinWaitlistHero({ className }: JoinWaitlistProps) {
placeholder="Enter your email"
className={cn(
'text-blue-darker h-12 w-full rounded-md border border-slate-100 bg-white px-4 shadow-sm outline-none ring-black focus:ring-1',
- className
+ className,
)}
value={value}
onChange={(e) => setValue(e.target.value)}
diff --git a/apps/public/src/app/join-waitlist.tsx b/apps/public/src/app/join-waitlist.tsx
index c05145ece..e974a410d 100644
--- a/apps/public/src/app/join-waitlist.tsx
+++ b/apps/public/src/app/join-waitlist.tsx
@@ -1,6 +1,5 @@
'use client';
-import { useEffect, useState } from 'react';
import { Button } from '@/components/ui/button';
import {
Dialog,
@@ -11,6 +10,7 @@ import {
DialogTitle,
} from '@/components/ui/dialog';
import { cn } from '@/utils/cn';
+import { useEffect, useState } from 'react';
interface JoinWaitlistProps {
className?: string;
@@ -66,7 +66,7 @@ export function JoinWaitlist({ className }: JoinWaitlistProps) {
placeholder="Enter your email"
className={cn(
'text-blue-darker h-12 w-full rounded-md border border-slate-100 bg-white px-4 shadow-sm outline-none ring-black focus:ring-1',
- className
+ className,
)}
value={value}
onChange={(e) => setValue(e.target.value)}
diff --git a/apps/public/src/app/layout.tsx b/apps/public/src/app/layout.tsx
index 3618a3a82..61a0c4931 100644
--- a/apps/public/src/app/layout.tsx
+++ b/apps/public/src/app/layout.tsx
@@ -42,7 +42,7 @@ export default function RootLayout({
className={cn(
'grainy min-h-screen font-sans text-slate-900 antialiased',
head.variable,
- body.variable
+ body.variable,
)}
>
<Navbar darkText />
diff --git a/apps/public/src/app/navbar.tsx b/apps/public/src/app/navbar.tsx
index 7dfd27612..bdfe44fa2 100644
--- a/apps/public/src/app/navbar.tsx
+++ b/apps/public/src/app/navbar.tsx
@@ -18,7 +18,7 @@ export function Navbar({ darkText = false, className }: Props) {
className={cn(
'fixed left-0 right-0 top-0 z-10 z-50 flex h-20 items-center border-b border-border bg-white',
textColor,
- className
+ className,
)}
>
<div className="container flex items-center justify-between py-4">
@@ -28,13 +28,17 @@ export function Navbar({ darkText = false, className }: Props) {
<Link href="/#pricing" data-event="click_pricing">
Pricing
</Link>
- <a href="https://docs.openpanel.dev" target="_blank">
+ <a href="https://docs.openpanel.dev" target="_blank" rel="noreferrer">
Docs
</a>
- <a href="https://git.new/openpanel" target="_blank">
+ <a href="https://git.new/openpanel" target="_blank" rel="noreferrer">
Github
</a>
- <a href="https://dashboard.openpanel.dev" target="_blank">
+ <a
+ href="https://dashboard.openpanel.dev"
+ target="_blank"
+ rel="noreferrer"
+ >
Sign in
</a>
</nav>
diff --git a/apps/public/src/app/punch-lines.tsx b/apps/public/src/app/punch-lines.tsx
index bf449ed53..6e2851bc1 100644
--- a/apps/public/src/app/punch-lines.tsx
+++ b/apps/public/src/app/punch-lines.tsx
@@ -130,7 +130,7 @@ const items = [
export function PunchLines() {
return (
<div className="bg-blue-darker relative py-32">
- <div className="absolute inset-0 h-full w-full bg-[radial-gradient(circle,rgba(255,255,255,0.2)_0%,rgba(255,255,255,0)_100%)]"></div>
+ <div className="absolute inset-0 h-full w-full bg-[radial-gradient(circle,rgba(255,255,255,0.2)_0%,rgba(255,255,255,0)_100%)]" />
<div className="relative">
<Heading2 className="mb-16 text-center text-white">
Not convinced?
@@ -147,7 +147,7 @@ export function PunchLines() {
<div
className={cn(
'mb-4 flex h-14 w-14 items-center justify-center rounded-full',
- item.color
+ item.color,
)}
style={{ background: item.color }}
>
diff --git a/apps/public/src/app/social-proof/social-proof.tsx b/apps/public/src/app/social-proof/social-proof.tsx
index 26d7ec5cb..9b859b5ff 100644
--- a/apps/public/src/app/social-proof/social-proof.tsx
+++ b/apps/public/src/app/social-proof/social-proof.tsx
@@ -69,5 +69,5 @@ export function SocialProof({ className, count }: JoinWaitlistProps) {
);
}
-// <div class="flex flex-col gap-y-2 mt-5 lg:mt-3"><p class="text-gray-700 dark:text-gray-100 text-sm w-24 text-start font-semibold whitespace-nowrap">What users think</p><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1744063824431370240/BbVtyCiy_normal.png" alt="feedback_0"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Been a long time Mixpanel user and without a doubt there's a bunch of room to innovate. I'm confident Openpanel is on the right path! ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-flame w-5 h-5 text-red-600 fill-orange-400 animate-pulse"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"></path></svg></div><img class="w-5 h-5 rounded-full border border-2 border-red-500" src="https://pbs.twimg.com/profile_images/1751607056316944384/8E4F88FL_normal.jpg" alt="feedback_1"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ I have used Openpanel for the last 6 months (since I’m the creator) for 3 different sites/apps. It’s a great analytics product that has everything you need. Still lacking a native app but will work hard to make that a reality! ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1701887174042324992/g2GBIQay_normal.jpg" alt="feedback_2"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ would be cool if it was easier to edit text after image is generated ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-flame w-5 h-5 text-red-600 fill-orange-400 animate-pulse"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"></path></svg></div><img class="w-5 h-5 rounded-full border border-2 border-red-500" src="https://pbs.twimg.com/profile_images/1194368464946974728/1D2biimN_normal.jpg" alt="feedback_3"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Awesome product, very easy to use and understand. I miss a native app and the documentation could be improved. Otherwise I love it. ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://lh3.googleusercontent.com/a/ACg8ocIWiGTd3nWE5etp-CFhxrTKFvSLSJJd7pPmiM9SNJ9sAg=s96-c" alt="feedback_4"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ I have used Open panel since the private beta and i'm super impressed by the product already, the speed after you give feedback to actually get the features is truly amazing! Can't wait to see where Openpanel are in 6 months! ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://lh3.googleusercontent.com/a/ACg8ocKymAw_YoIrfoGp-bWMlDsXgM6St0dzaVJ7m_lGNXDtrA=s96-c" alt="feedback_5"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Impressively fast UI and easy to integrate! Added it alongside my current analytics tool for my native app in less than an hour. ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1735771119980879872/Mx5MlB9e_normal.jpg" alt="feedback_6"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Im using plausible and find it pleasing but limited.
-// Im looking forward to trying out Openpanel, the demo pictures and the page look professional. The listed features seem to be broader then plausible. :) ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1767459527006334976/unbMENPG_normal.jpg" alt="feedback_7"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Incredibly easy to implement and a joy to use. 5/5 would recommend. ”</span></div></div>
+// <div class="flex flex-col gap-y-2 mt-5 lg:mt-3"><p class="text-gray-700 dark:text-gray-100 text-sm w-24 text-start font-semibold whitespace-nowrap">What users think</p><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1744063824431370240/BbVtyCiy_normal.png" alt="feedback_0"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Been a long time Mixpanel user and without a doubt there's a bunch of room to innovate. I'm confident Openpanel is on the right path! ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-flame w-5 h-5 text-red-600 fill-orange-400 animate-pulse"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"></path></svg/><img class="w-5 h-5 rounded-full border border-2 border-red-500" src="https://pbs.twimg.com/profile_images/1751607056316944384/8E4F88FL_normal.jpg" alt="feedback_1"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ I have used Openpanel for the last 6 months (since I’m the creator) for 3 different sites/apps. It’s a great analytics product that has everything you need. Still lacking a native app but will work hard to make that a reality! ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1701887174042324992/g2GBIQay_normal.jpg" alt="feedback_2"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ would be cool if it was easier to edit text after image is generated ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-flame w-5 h-5 text-red-600 fill-orange-400 animate-pulse"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"></path></svg/><img class="w-5 h-5 rounded-full border border-2 border-red-500" src="https://pbs.twimg.com/profile_images/1194368464946974728/1D2biimN_normal.jpg" alt="feedback_3"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Awesome product, very easy to use and understand. I miss a native app and the documentation could be improved. Otherwise I love it. ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://lh3.googleusercontent.com/a/ACg8ocIWiGTd3nWE5etp-CFhxrTKFvSLSJJd7pPmiM9SNJ9sAg=s96-c" alt="feedback_4"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ I have used Open panel since the private beta and i'm super impressed by the product already, the speed after you give feedback to actually get the features is truly amazing! Can't wait to see where Openpanel are in 6 months! ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://lh3.googleusercontent.com/a/ACg8ocKymAw_YoIrfoGp-bWMlDsXgM6St0dzaVJ7m_lGNXDtrA=s96-c" alt="feedback_5"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Impressively fast UI and easy to integrate! Added it alongside my current analytics tool for my native app in less than an hour. ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1735771119980879872/Mx5MlB9e_normal.jpg" alt="feedback_6"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Im using plausible and find it pleasing but limited.
+// Im looking forward to trying out Openpanel, the demo pictures and the page look professional. The listed features seem to be broader then plausible. :) ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1767459527006334976/unbMENPG_normal.jpg" alt="feedback_7"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Incredibly easy to implement and a joy to use. 5/5 would recommend. ”</span/></div>
diff --git a/apps/public/src/components/ui/button.tsx b/apps/public/src/components/ui/button.tsx
index 940d3d42c..f717b69ba 100644
--- a/apps/public/src/components/ui/button.tsx
+++ b/apps/public/src/components/ui/button.tsx
@@ -1,12 +1,12 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import { Slot } from '@radix-ui/react-slot';
import { cva } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
import type { LucideIcon } from 'lucide-react';
import { Loader2 } from 'lucide-react';
+import * as React from 'react';
const buttonVariants = cva(
'inline-flex flex-shrink-0 items-center justify-center whitespace-nowrap rounded-md font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
@@ -35,7 +35,7 @@ const buttonVariants = cva(
variant: 'default',
size: 'default',
},
- }
+ },
);
export interface ButtonProps
@@ -59,10 +59,10 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
icon,
...props
},
- ref
+ ref,
) => {
const Comp = asChild ? Slot : 'button';
- const Icon = loading ? Loader2 : icon ?? null;
+ const Icon = loading ? Loader2 : (icon ?? null);
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
@@ -76,7 +76,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
{children}
</Comp>
);
- }
+ },
);
Button.displayName = 'Button';
Button.defaultProps = {
diff --git a/apps/public/src/components/ui/carousel.tsx b/apps/public/src/components/ui/carousel.tsx
index 77b0ad67b..c5cef4c62 100644
--- a/apps/public/src/components/ui/carousel.tsx
+++ b/apps/public/src/components/ui/carousel.tsx
@@ -1,9 +1,9 @@
-import * as React from 'react';
import { Button } from '@/components/ui/button';
import { cn } from '@/utils/cn';
import useEmblaCarousel from 'embla-carousel-react';
import type { UseEmblaCarouselType } from 'embla-carousel-react';
import { ArrowLeft, ArrowRight } from 'lucide-react';
+import * as React from 'react';
type CarouselApi = UseEmblaCarouselType[1];
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
@@ -52,14 +52,14 @@ const Carousel = React.forwardRef<
children,
...props
},
- ref
+ ref,
) => {
const [carouselRef, api] = useEmblaCarousel(
{
...opts,
axis: orientation === 'horizontal' ? 'x' : 'y',
},
- plugins
+ plugins,
);
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
const [canScrollNext, setCanScrollNext] = React.useState(false);
@@ -91,7 +91,7 @@ const Carousel = React.forwardRef<
scrollNext();
}
},
- [scrollPrev, scrollNext]
+ [scrollPrev, scrollNext],
);
React.useEffect(() => {
@@ -130,19 +130,18 @@ const Carousel = React.forwardRef<
canScrollNext,
}}
>
- <div
+ <section
ref={ref}
onKeyDownCapture={handleKeyDown}
className={cn('relative', className)}
- role="region"
aria-roledescription="carousel"
{...props}
>
{children}
- </div>
+ </section>
</CarouselContext.Provider>
);
- }
+ },
);
Carousel.displayName = 'Carousel';
@@ -159,7 +158,7 @@ const CarouselContent = React.forwardRef<
className={cn(
'flex',
orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',
- className
+ className,
)}
{...props}
/>
@@ -182,7 +181,7 @@ const CarouselItem = React.forwardRef<
className={cn(
'min-w-0 shrink-0 grow-0 basis-full',
orientation === 'horizontal' ? 'pl-4' : 'pt-4',
- className
+ className,
)}
{...props}
/>
@@ -206,7 +205,7 @@ const CarouselPrevious = React.forwardRef<
orientation === 'horizontal'
? '-left-12 top-1/2 -translate-y-1/2'
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
- className
+ className,
)}
disabled={!canScrollPrev}
onClick={scrollPrev}
@@ -235,7 +234,7 @@ const CarouselNext = React.forwardRef<
orientation === 'horizontal'
? '-right-12 top-1/2 -translate-y-1/2'
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
- className
+ className,
)}
disabled={!canScrollNext}
onClick={scrollNext}
diff --git a/apps/public/src/components/ui/dialog.tsx b/apps/public/src/components/ui/dialog.tsx
index 42d8a40aa..1b29f84ed 100644
--- a/apps/public/src/components/ui/dialog.tsx
+++ b/apps/public/src/components/ui/dialog.tsx
@@ -1,9 +1,9 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as DialogPrimitive from '@radix-ui/react-dialog';
import { X } from 'lucide-react';
+import * as React from 'react';
const Dialog = DialogPrimitive.Root;
@@ -21,7 +21,7 @@ const DialogOverlay = React.forwardRef<
ref={ref}
className={cn(
'fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
- className
+ className,
)}
{...props}
/>
@@ -38,7 +38,7 @@ const DialogContent = React.forwardRef<
ref={ref}
className={cn(
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-100%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full md:translate-y-[-50%]',
- className
+ className,
)}
{...props}
>
@@ -59,7 +59,7 @@ const DialogHeader = ({
<div
className={cn(
'flex flex-col space-y-1.5 text-center sm:text-left',
- className
+ className,
)}
{...props}
/>
@@ -73,7 +73,7 @@ const DialogFooter = ({
<div
className={cn(
'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
- className
+ className,
)}
{...props}
/>
@@ -88,7 +88,7 @@ const DialogTitle = React.forwardRef<
ref={ref}
className={cn(
'text-lg font-semibold leading-none tracking-tight',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/public/src/components/ui/input.tsx b/apps/public/src/components/ui/input.tsx
index 1d26768b0..d578701ca 100644
--- a/apps/public/src/components/ui/input.tsx
+++ b/apps/public/src/components/ui/input.tsx
@@ -1,7 +1,7 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
+import * as React from 'react';
export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {
error?: string | undefined;
@@ -15,13 +15,13 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
className={cn(
'file: flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 ring-offset-background file:border-0 file:bg-transparent file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
className,
- !!error && 'border-destructive'
+ !!error && 'border-destructive',
)}
ref={ref}
{...props}
/>
);
- }
+ },
);
Input.displayName = 'Input';
diff --git a/apps/public/src/components/ui/popover.tsx b/apps/public/src/components/ui/popover.tsx
index b86795cd0..9e46f04a8 100644
--- a/apps/public/src/components/ui/popover.tsx
+++ b/apps/public/src/components/ui/popover.tsx
@@ -1,8 +1,8 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as PopoverPrimitive from '@radix-ui/react-popover';
+import * as React from 'react';
const Popover = PopoverPrimitive.Root;
@@ -19,7 +19,7 @@ const PopoverContent = React.forwardRef<
sideOffset={sideOffset}
className={cn(
'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/public/src/components/ui/tooltip.tsx b/apps/public/src/components/ui/tooltip.tsx
index 355816999..40ee10a2d 100644
--- a/apps/public/src/components/ui/tooltip.tsx
+++ b/apps/public/src/components/ui/tooltip.tsx
@@ -1,8 +1,8 @@
'use client';
-import * as React from 'react';
import { cn } from '@/utils/cn';
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
+import * as React from 'react';
const TooltipProvider = TooltipPrimitive.Provider;
@@ -19,7 +19,7 @@ const TooltipContent = React.forwardRef<
sideOffset={sideOffset}
className={cn(
'z-50 overflow-hidden rounded-md border bg-black px-3 py-1.5 text-popover shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
- className
+ className,
)}
{...props}
/>
diff --git a/apps/public/src/env.mjs b/apps/public/src/env.mjs
index df287104f..0746a0818 100644
--- a/apps/public/src/env.mjs
+++ b/apps/public/src/env.mjs
@@ -11,8 +11,8 @@ export const env = createEnv({
.string()
.url()
.refine(
- (str) => !str.includes('YOUR_MYSQL_URL_HERE'),
- 'You forgot to change the default URL'
+ (str) => !str.includes('DATABASE_URL'),
+ 'You forgot to change the default URL',
),
NODE_ENV: z
.enum(['development', 'test', 'production'])
diff --git a/apps/public/src/styles/globals.css b/apps/public/src/styles/globals.css
index 404dd36eb..21d149b4d 100644
--- a/apps/public/src/styles/globals.css
+++ b/apps/public/src/styles/globals.css
@@ -110,15 +110,7 @@ strong {
transparent 50%,
transparent 100%
);
- background-position:
- left top,
- left bottom,
- left top,
- right top;
+ background-position: left top, left bottom, left top, right top;
background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
- background-size:
- 15px 2px,
- 15px 2px,
- 2px 15px,
- 2px 15px;
+ background-size: 15px 2px, 15px 2px, 2px 15px, 2px 15px;
}
diff --git a/apps/public/tailwind.config.js b/apps/public/tailwind.config.js
index 91caa7f6b..dfd83a9c0 100644
--- a/apps/public/tailwind.config.js
+++ b/apps/public/tailwind.config.js
@@ -17,9 +17,9 @@ const config = {
},
extend: {
colors: {
- ['blue-light']: '#2C97FE',
- ['blue-dark']: '#111F46',
- ['blue-darker']: '#051030',
+ 'blue-light': '#2C97FE',
+ 'blue-dark': '#111F46',
+ 'blue-darker': '#051030',
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
diff --git a/apps/worker/Dockerfile b/apps/worker/Dockerfile
index 0fbd102fd..9623dc0ab 100644
--- a/apps/worker/Dockerfile
+++ b/apps/worker/Dockerfile
@@ -29,8 +29,6 @@ COPY packages/queue/package.json ./packages/queue/
COPY packages/logger/package.json ./packages/logger/
COPY packages/common/package.json ./packages/common/
COPY packages/constants/package.json ./packages/constants/
-# Patches
-COPY patches ./patches
# BUILD
FROM base AS build
diff --git a/apps/worker/package.json b/apps/worker/package.json
index 434ff107e..15585f2b3 100644
--- a/apps/worker/package.json
+++ b/apps/worker/package.json
@@ -6,8 +6,6 @@
"testing": "WORKER_PORT=9999 pnpm dev",
"start": "node dist/index.js",
"build": "rm -rf dist && tsup",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -27,24 +25,13 @@
"uuid": "^9.0.1"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/express": "^4.17.21",
"@types/ramda": "^0.29.6",
"@types/sqlstring": "^2.3.2",
"@types/ua-parser-js": "^0.7.39",
"@types/uuid": "^9.0.8",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/apps/worker/scripts/debug.ts b/apps/worker/scripts/debug.ts
deleted file mode 100644
index 604223e01..000000000
--- a/apps/worker/scripts/debug.ts
+++ /dev/null
@@ -1,150 +0,0 @@
-import { escape } from 'sqlstring';
-
-import type { IClickhouseEvent } from '@openpanel/db';
-import { chQuery, eventBuffer, TABLE_NAMES } from '@openpanel/db';
-import { sessionsQueue } from '@openpanel/queue/src/queues';
-import { getRedisCache, getRedisQueue } from '@openpanel/redis';
-
-async function debugStalledEvents() {
- const keys = await getRedisQueue().keys('bull:sessions:sessionEnd*');
- const delayedZRange = await getRedisQueue().zrange(
- 'bull:sessions:delayed',
- 0,
- -1,
- 'WITHSCORES'
- );
- const delayedValues = delayedZRange.reduce(
- (acc, item, index, array) => {
- if (index % 2 === 0) {
- acc[item] = Number(array[index + 1]) / 0x1000;
- }
- return acc;
- },
- {} as Record<string, number>
- );
- const opKeys = await getRedisCache().keys('op:*');
- const stalledEvents = await getRedisCache().lrange(
- 'op:buffer:events:stalled',
- 0,
- -1
- );
- // keys.forEach((key) => {
- // console.log(key);
- // });
- // console.log('--------------------');
-
- const queue = await eventBuffer.getQueue(-1);
-
- queue
- .filter((item) => item.event.name === 'screen_view')
- .forEach((item) => {
- const date = new Date(item.event.created_at.replace(' ', 'T') + 'Z');
- const match = keys.find((key) => {
- return item.event.device_id && key.includes(item.event.device_id);
- });
- if (match) {
- // console.log(
- // date.toISOString(),
- // item.event.name,
- // item.event.device,
- // item.event.session_id,
- // item.event.profile_id,
- // item.event.device_id,
- // match
- // );
- } else {
- console.log(
- 'NO MATCH FOUND!',
- date.toISOString(),
- item.event.name,
- '[SID]',
- item.event.session_id,
- '[PID]',
- item.event.profile_id,
- '[DID]',
- item.event.device_id
- );
- console.log(item.event);
- console.log('');
-
- // console.log('Not in queue!');
- // log§
- }
- });
-
- if (stalledEvents.length > 0) {
- const res = await chQuery(
- `SELECT * FROM ${TABLE_NAMES.events} WHERE id IN (${stalledEvents.map((item) => escape(JSON.parse(item).id)).join(',')})`
- );
-
- stalledEvents.forEach((item) => {
- const event = JSON.parse(item) as IClickhouseEvent;
- const date = new Date(event.created_at.replace(' ', 'T') + 'Z');
- console.log(
- 'STALLED!',
- date.toISOString(),
- event.name,
- '[IN_DB]',
- res.find((item) => item.id === event.id) ? 'YES' : 'NO',
- '[ID]',
- event.id,
- '[SID]',
- event.session_id,
- '[PID]',
- event.profile_id,
- '[DID]',
- event.device_id
- );
- // console.log(event);
- });
- }
-
- console.log('OP Keys', opKeys);
-
- console.log('Queue', queue.length);
- console.log('Session Ends', keys.length);
- console.log('Stalled Events', stalledEvents.length);
-
- // keys.forEach((key) => {
- // if (key.includes('e1b233e69bcd2132ec7bf343004d4b01')) {
- // console.log(key);
- // }
- // });
-
- const delayedJobs = await sessionsQueue.getDelayed();
- console.log('delayedJobs', delayedJobs.length);
- delayedJobs.sort((a, b) => a.timestamp + a.delay - (b.timestamp + b.delay));
- let delayedJobsCount = 0;
- delayedJobs.forEach((job) => {
- if (!job.id) {
- return;
- }
- const timestamp = delayedValues[job.id];
- if (!timestamp) {
- return;
- }
- const date = new Date(timestamp);
- // if date is in the past
- // if (date.getTime() - 1000 * 60 * 5 < Date.now()) {
- if (date.getTime() < Date.now()) {
- delayedJobsCount++;
- console.log(
- date.toLocaleString('sv-SE'),
- 'https://op.coderax.se/worker/queue/sessions/' +
- encodeURIComponent(job.id)
- );
- }
- });
-
- console.log('delayedJobsCount', delayedJobsCount);
-}
-
-async function main() {
- if (process.argv[2] === 'stalled') {
- await debugStalledEvents();
- }
-
- process.exit(0);
-}
-
-main();
diff --git a/apps/worker/src/index.ts b/apps/worker/src/index.ts
index 95441ba97..167941fea 100644
--- a/apps/worker/src/index.ts
+++ b/apps/worker/src/index.ts
@@ -15,14 +15,14 @@ import { sessionsJob } from './jobs/sessions';
import { register } from './metrics';
import { logger } from './utils/logger';
-const PORT = parseInt(process.env.WORKER_PORT || '3000', 10);
+const PORT = Number.parseInt(process.env.WORKER_PORT || '3000', 10);
const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath('/');
const app = express();
const workerOptions: WorkerOptions = {
connection: getRedisQueue(),
- concurrency: parseInt(process.env.CONCURRENCY || '1', 10),
+ concurrency: Number.parseInt(process.env.CONCURRENCY || '1', 10),
};
async function start() {
@@ -30,7 +30,7 @@ async function start() {
const sessionsWorker = new Worker(
sessionsQueue.name,
sessionsJob,
- workerOptions
+ workerOptions,
);
const cronWorker = new Worker(cronQueue.name, cronJob, workerOptions);
@@ -110,7 +110,9 @@ async function start() {
});
}
- process.exit(isNaN(+evtOrExitCodeOrError) ? 1 : +evtOrExitCodeOrError);
+ process.exit(
+ Number.isNaN(+evtOrExitCodeOrError) ? 1 : +evtOrExitCodeOrError,
+ );
}
[
@@ -132,7 +134,7 @@ async function start() {
].forEach((evt) =>
process.on(evt, (evt) => {
exitHandler(evt);
- })
+ }),
);
await cronQueue.add(
@@ -147,7 +149,7 @@ async function start() {
utc: true,
pattern: '0 0 * * *',
},
- }
+ },
);
await cronQueue.add(
@@ -160,10 +162,10 @@ async function start() {
jobId: 'flushEvents',
repeat: {
every: process.env.BATCH_INTERVAL
- ? parseInt(process.env.BATCH_INTERVAL, 10)
+ ? Number.parseInt(process.env.BATCH_INTERVAL, 10)
: 1000 * 10,
},
- }
+ },
);
await cronQueue.add(
@@ -177,7 +179,7 @@ async function start() {
repeat: {
every: 2 * 1000,
},
- }
+ },
);
if (process.env.SELF_HOSTED && process.env.NODE_ENV === 'production') {
@@ -192,7 +194,7 @@ async function start() {
repeat: {
pattern: '0 0 * * *',
},
- }
+ },
);
}
diff --git a/apps/worker/src/jobs/cron.ping.ts b/apps/worker/src/jobs/cron.ping.ts
index 051f77ad6..65263b78d 100644
--- a/apps/worker/src/jobs/cron.ping.ts
+++ b/apps/worker/src/jobs/cron.ping.ts
@@ -1,8 +1,8 @@
-import { chQuery, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, chQuery } from '@openpanel/db';
export async function ping() {
const [res] = await chQuery<{ count: number }>(
- `SELECT COUNT(*) as count FROM ${TABLE_NAMES.events}`
+ `SELECT COUNT(*) as count FROM ${TABLE_NAMES.events}`,
);
if (typeof res?.count === 'number') {
diff --git a/apps/worker/src/jobs/cron.salt.ts b/apps/worker/src/jobs/cron.salt.ts
index 07beb3a50..617405c6f 100644
--- a/apps/worker/src/jobs/cron.salt.ts
+++ b/apps/worker/src/jobs/cron.salt.ts
@@ -1,4 +1,4 @@
-import { generateSalt } from '@openpanel/common';
+import { generateSalt } from '@openpanel/common/server';
import { db, getCurrentSalt } from '@openpanel/db';
export async function salt() {
diff --git a/apps/worker/src/jobs/events.create-session-end.ts b/apps/worker/src/jobs/events.create-session-end.ts
index d7b08f79a..6dc2b372c 100644
--- a/apps/worker/src/jobs/events.create-session-end.ts
+++ b/apps/worker/src/jobs/events.create-session-end.ts
@@ -3,19 +3,19 @@ import { last } from 'ramda';
import { getTime } from '@openpanel/common';
import {
+ TABLE_NAMES,
createEvent,
eventBuffer,
getEvents,
- TABLE_NAMES,
} from '@openpanel/db';
import type { EventsQueuePayloadCreateSessionEnd } from '@openpanel/queue';
export async function createSessionEnd(
- job: Job<EventsQueuePayloadCreateSessionEnd>
+ job: Job<EventsQueuePayloadCreateSessionEnd>,
) {
const payload = job.data.payload;
const eventsInBuffer = await eventBuffer.findMany(
- (item) => item.event.session_id === payload.sessionId
+ (item) => item.event.session_id === payload.sessionId,
);
const sql = `
@@ -39,7 +39,7 @@ export async function createSessionEnd(
const eventsInDb = await getEvents(sql);
// sort last inserted first
const events = [...eventsInBuffer, ...eventsInDb].sort(
- (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
+ (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(),
);
events.map((event, index) => {
@@ -51,7 +51,7 @@ export async function createSessionEnd(
`DeviceId: ${event.deviceId}`,
`Profile: ${event.profileId}`,
`Path: ${event.path}`,
- ].join('\n')
+ ].join('\n'),
);
});
diff --git a/apps/worker/src/jobs/events.incoming-event.ts b/apps/worker/src/jobs/events.incoming-event.ts
index b5f7d314c..ab0303824 100644
--- a/apps/worker/src/jobs/events.incoming-event.ts
+++ b/apps/worker/src/jobs/events.incoming-event.ts
@@ -128,7 +128,7 @@ export async function incomingEvent(job: Job<EventsQueuePayloadIncomingEvent>) {
{
delay: SESSION_END_TIMEOUT,
jobId: sessionEndJobId,
- }
+ },
);
}
@@ -178,7 +178,7 @@ export async function incomingEvent(job: Job<EventsQueuePayloadIncomingEvent>) {
function getSessionEndWithPriority(
priority: boolean,
- count = 0
+ count = 0,
): typeof getSessionEnd {
return async (args) => {
const res = await getSessionEnd(args);
@@ -208,13 +208,13 @@ async function getSessionEnd({
previousDeviceId: string;
}) {
const sessionEndKeys = await getRedisQueue().keys(
- `*:sessionEnd:${projectId}:*`
+ `*:sessionEnd:${projectId}:*`,
);
const sessionEndJobCurrentDeviceId = await findJobByPrefix(
sessionsQueue,
sessionEndKeys,
- `sessionEnd:${projectId}:${currentDeviceId}:`
+ `sessionEnd:${projectId}:${currentDeviceId}:`,
);
if (sessionEndJobCurrentDeviceId) {
return { deviceId: currentDeviceId, job: sessionEndJobCurrentDeviceId };
@@ -223,7 +223,7 @@ async function getSessionEnd({
const sessionEndJobPreviousDeviceId = await findJobByPrefix(
sessionsQueue,
sessionEndKeys,
- `sessionEnd:${projectId}:${previousDeviceId}:`
+ `sessionEnd:${projectId}:${previousDeviceId}:`,
);
if (sessionEndJobPreviousDeviceId) {
return { deviceId: previousDeviceId, job: sessionEndJobPreviousDeviceId };
diff --git a/apps/worker/src/jobs/events.ts b/apps/worker/src/jobs/events.ts
index 627a59803..549b77bc2 100644
--- a/apps/worker/src/jobs/events.ts
+++ b/apps/worker/src/jobs/events.ts
@@ -1,7 +1,7 @@
import type { Job } from 'bullmq';
import { escape } from 'sqlstring';
-import { chQuery, db, TABLE_NAMES } from '@openpanel/db';
+import { TABLE_NAMES, chQuery, db } from '@openpanel/db';
import type {
EventsQueuePayload,
EventsQueuePayloadCreateSessionEnd,
@@ -24,7 +24,7 @@ export async function eventsJob(job: Job<EventsQueuePayload>) {
}
return await createSessionEnd(
- job as Job<EventsQueuePayloadCreateSessionEnd>
+ job as Job<EventsQueuePayloadCreateSessionEnd>,
);
}
}
@@ -32,7 +32,7 @@ export async function eventsJob(job: Job<EventsQueuePayload>) {
async function updateEventsCount(projectId: string) {
const res = await chQuery<{ count: number }>(
- `SELECT count(*) as count FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(projectId)}`
+ `SELECT count(*) as count FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(projectId)}`,
);
const count = res[0]?.count;
if (count) {
diff --git a/apps/worker/src/metrics.ts b/apps/worker/src/metrics.ts
index c667e99a3..cd7a0b75f 100644
--- a/apps/worker/src/metrics.ts
+++ b/apps/worker/src/metrics.ts
@@ -18,7 +18,7 @@ queues.forEach((queue) => {
const metric = await queue.getActiveCount();
this.set(metric);
},
- })
+ }),
);
register.registerMetric(
@@ -29,7 +29,7 @@ queues.forEach((queue) => {
const metric = await queue.getDelayedCount();
this.set(metric);
},
- })
+ }),
);
register.registerMetric(
@@ -40,7 +40,7 @@ queues.forEach((queue) => {
const metric = await queue.getFailedCount();
this.set(metric);
},
- })
+ }),
);
register.registerMetric(
@@ -51,7 +51,7 @@ queues.forEach((queue) => {
const metric = await queue.getCompletedCount();
this.set(metric);
},
- })
+ }),
);
register.registerMetric(
@@ -62,7 +62,7 @@ queues.forEach((queue) => {
const metric = await queue.getWaitingCount();
this.set(metric);
},
- })
+ }),
);
});
@@ -78,7 +78,7 @@ buffers.forEach((buffer) => {
const metric = await getRedisCache().llen(`op:buffer:${buffer}`);
this.set(metric);
},
- })
+ }),
);
register.registerMetric(
@@ -87,10 +87,10 @@ buffers.forEach((buffer) => {
help: 'Number of users in the users array',
async collect() {
const metric = await getRedisCache().llen(
- `op:buffer:${buffer}:stalled`
+ `op:buffer:${buffer}:stalled`,
);
this.set(metric);
},
- })
+ }),
);
});
diff --git a/apps/worker/src/utils/parse-referrer.ts b/apps/worker/src/utils/parse-referrer.ts
index 7f035bb64..6e4d86af1 100644
--- a/apps/worker/src/utils/parse-referrer.ts
+++ b/apps/worker/src/utils/parse-referrer.ts
@@ -26,7 +26,7 @@ export function parseReferrer(url: string | undefined) {
}
export function getReferrerWithQuery(
- query: Record<string, string> | undefined
+ query: Record<string, string> | undefined,
) {
if (!query) {
return null;
@@ -40,7 +40,7 @@ export function getReferrerWithQuery(
const match =
Object.values(referrers).find(
- (referrer) => referrer.name.toLowerCase() === source.toLowerCase()
+ (referrer) => referrer.name.toLowerCase() === source.toLowerCase(),
) || referrers[source];
if (match) {
diff --git a/apps/worker/src/utils/parse-user-agent.ts b/apps/worker/src/utils/parse-user-agent.ts
index af469ee7d..b7e8666d3 100644
--- a/apps/worker/src/utils/parse-user-agent.ts
+++ b/apps/worker/src/utils/parse-user-agent.ts
@@ -71,7 +71,7 @@ const userAgentServerList = [
function isServer(userAgent: string) {
const match = userAgentServerList.some((server) =>
- userAgent.toLowerCase().includes(server.toLowerCase())
+ userAgent.toLowerCase().includes(server.toLowerCase()),
);
if (match) {
return true;
@@ -83,15 +83,15 @@ function isServer(userAgent: string) {
export function getDevice(ua: string) {
const mobile1 =
/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(
- ua
+ ua,
);
const mobile2 =
/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(
- ua.slice(0, 4)
+ ua.slice(0, 4),
);
const tablet =
/tablet|ipad|android(?!.*mobile)|xoom|sch-i800|kindle|silk|playbook/i.test(
- ua
+ ua,
);
if (mobile1 || mobile2) {
diff --git a/biome.json b/biome.json
new file mode 100644
index 000000000..c1894cdbd
--- /dev/null
+++ b/biome.json
@@ -0,0 +1,60 @@
+{
+ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
+ "organizeImports": {
+ "enabled": true
+ },
+ "files": {
+ "ignore": [
+ "node_modules",
+ "tmp",
+ ".next",
+ "dist",
+ "coverage",
+ "op.js",
+ "op1.js",
+ "*.css"
+ ]
+ },
+ "linter": {
+ "enabled": true,
+ "rules": {
+ "recommended": true,
+ "a11y": {
+ "noSvgWithoutTitle": "off",
+ "useAltText": "off",
+ "noLabelWithoutControl": "off",
+ "useFocusableInteractive": "off",
+ "useSemanticElements": "off"
+ },
+ "style": {
+ "noNonNullAssertion": "off"
+ },
+ "correctness": {
+ "useExhaustiveDependencies": "off"
+ },
+ "performance": {
+ "noDelete": "off",
+ "noAccumulatingSpread": "off"
+ },
+ "suspicious": {
+ "noExplicitAny": "off",
+ "noShadowRestrictedNames": "off"
+ },
+ "security": {
+ "noDangerouslySetInnerHtml": "off"
+ },
+ "complexity": {
+ "noForEach": "off"
+ }
+ }
+ },
+ "formatter": {
+ "indentStyle": "space",
+ "indentWidth": 2
+ },
+ "javascript": {
+ "formatter": {
+ "quoteStyle": "single"
+ }
+ }
+}
diff --git a/package.json b/package.json
index f24a65ea4..ab39abc28 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,6 @@
"license": "MIT",
"author": "Carl-Gerhard Lindesvärd",
"packageManager": "[email protected]",
- "module": "index.ts",
"scripts": {
"dock:up": "docker compose up -d",
"dock:down": "docker compose down",
@@ -15,26 +14,34 @@
"migrate": "pnpm -r --filter db run migrate",
"migrate:deploy": "pnpm -r --filter db run migrate:deploy",
"dev": "pnpm -r --parallel testing",
- "format": "pnpm -r format --cache --cache-location=\"node_modules/.cache/.prettiercache\"",
- "format:fix": "pnpm -r format --write --cache --cache-location=\"node_modules/.cache/.prettiercache\"",
- "lint": "pnpm -r lint",
- "lint:fix": "pnpm -r lint --fix",
+ "format": "biome format .",
+ "format:fix": "biome format --write .",
+ "lint": "biome check .",
+ "lint:fix": "biome check --write .",
"lint:workspace": "pnpm dlx sherif@latest",
"typecheck": "pnpm -r typecheck"
},
"dependencies": {
"@hyperdx/node-opentelemetry": "^0.8.1",
- "@openpanel/prettier-config": "^0.1.0",
"dotenv-cli": "^7.3.0",
- "prettier": "^3.0.3",
"semver": "^7.5.4",
"typescript": "^5.2.2",
"winston": "^3.14.2"
},
- "prettier": "@openpanel/prettier-config",
- "pnpm": {
- "patchedDependencies": {
- "@bull-board/[email protected]": "patches/@[email protected]"
- }
+ "trustedDependencies": [
+ "@biomejs/biome",
+ "@clerk/shared",
+ "@prisma/client",
+ "@prisma/engines",
+ "bcrypt",
+ "esbuild",
+ "lodepng",
+ "msgpackr-extract",
+ "prisma",
+ "protobufjs",
+ "sharp"
+ ],
+ "devDependencies": {
+ "@biomejs/biome": "1.9.1"
}
-}
\ No newline at end of file
+}
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 80e12f948..18197094f 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -7,8 +7,6 @@
},
"scripts": {
"build": "rm -rf dist && tsup",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -23,23 +21,12 @@
},
"devDependencies": {
"@openpanel/db": "workspace:^",
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/sdk": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/node": "^20.14.10",
"@types/progress": "^2.0.7",
"@types/ramda": "^0.30.1",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts
index 26d6c7d6c..872aa7311 100644
--- a/packages/cli/src/cli.ts
+++ b/packages/cli/src/cli.ts
@@ -9,7 +9,7 @@ function cli() {
},
{
permissive: true,
- }
+ },
);
const [command] = args._;
diff --git a/packages/cli/src/importer/importer.ts b/packages/cli/src/importer/importer.ts
index 7c81beff2..9076566f3 100644
--- a/packages/cli/src/importer/importer.ts
+++ b/packages/cli/src/importer/importer.ts
@@ -1,9 +1,9 @@
-import { randomUUID } from 'crypto';
-import fs from 'fs';
-import os from 'os';
-import path from 'path';
-import readline from 'readline';
-import zlib from 'zlib';
+import { randomUUID } from 'node:crypto';
+import fs from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';
+import readline from 'node:readline';
+import zlib from 'node:zlib';
import Progress from 'progress';
import { assocPath, prop, uniqBy } from 'ramda';
@@ -37,17 +37,17 @@ function stripMixpanelProperties(obj: Record<string, unknown>) {
return Object.fromEntries(
Object.entries(obj).filter(
([key]) =>
- !key.match(/^(\$|mp_)/) && !['time', 'distinct_id'].includes(key)
- )
+ !key.match(/^(\$|mp_)/) && !['time', 'distinct_id'].includes(key),
+ ),
);
}
async function* parseJsonStream(
- fileStream: fs.ReadStream
+ fileStream: fs.ReadStream,
): AsyncGenerator<any, void, unknown> {
const rl = readline.createInterface({
input: fileStream,
- crlfDelay: Infinity,
+ crlfDelay: Number.POSITIVE_INFINITY,
});
let buffer = '';
@@ -100,7 +100,7 @@ function generateSessionEvents(events: IImportedEvent[]): Session[] {
events.sort(
(a, b) =>
- new Date(a.created_at).getTime() - new Date(b.created_at).getTime()
+ new Date(a.created_at).getTime() - new Date(b.created_at).getTime(),
);
for (const event of events) {
@@ -172,7 +172,7 @@ function generateSessionEvents(events: IImportedEvent[]): Session[] {
sessionList = sessionList.filter(
(session) =>
session.sessionId !== deviceSession?.sessionId &&
- session.sessionId !== profileSession?.sessionId
+ session.sessionId !== profileSession?.sessionId,
);
sessionList.push(unifiedSession);
}
@@ -201,7 +201,7 @@ function createEventObject(event: IMixpanelEvent): IImportedEvent {
return {
profile_id: event.properties.distinct_id
? String(event.properties.distinct_id).replace(/^\$device:/, '')
- : event.properties.$device_id ?? '',
+ : (event.properties.$device_id ?? ''),
name: event.event,
created_at: new Date(event.properties.time * 1000).toISOString(),
properties: {
@@ -284,7 +284,7 @@ function processEvents(events: IImportedEvent[]): IImportedEvent[] {
...session.firstEvent,
id: randomUUID(),
created_at: new Date(
- new Date(session.firstEvent.created_at).getTime() - 1000
+ new Date(session.firstEvent.created_at).getTime() - 1000,
).toISOString(),
session_id: session.sessionId,
name: 'session_start',
@@ -292,19 +292,19 @@ function processEvents(events: IImportedEvent[]): IImportedEvent[] {
...uniqBy(
prop('id'),
session.events.map((event) =>
- assocPath(['session_id'], session.sessionId, event)
- )
+ assocPath(['session_id'], session.sessionId, event),
+ ),
),
session.lastEvent && {
...session.lastEvent,
id: randomUUID(),
created_at: new Date(
- new Date(session.lastEvent.created_at).getTime() + 1000
+ new Date(session.lastEvent.created_at).getTime() + 1000,
).toISOString(),
session_id: session.sessionId,
name: 'session_end',
},
- ].filter((item): item is IImportedEvent => !!item)
+ ].filter((item): item is IImportedEvent => !!item),
);
return [
@@ -325,7 +325,7 @@ async function sendBatchToAPI(
apiUrl: string;
clientId: string;
clientSecret: string;
- }
+ },
) {
async function request() {
const res = await fetch(`${apiUrl}/import/events`, {
@@ -356,9 +356,9 @@ async function sendBatchToAPI(
fs.writeFileSync(
path.join(
os.tmpdir(),
- `openpanel/failed-import-batch-${batch[0]?.created_at ? new Date(batch[0]?.created_at).toISOString() : Date.now()}.json`
+ `openpanel/failed-import-batch-${batch[0]?.created_at ? new Date(batch[0]?.created_at).toISOString() : Date.now()}.json`,
),
- JSON.stringify(batch, null, 2)
+ JSON.stringify(batch, null, 2),
);
}
}
@@ -380,7 +380,7 @@ async function processFiles({
{
total: files.length,
width: 20,
- }
+ },
);
let savedEvents = 0;
let currentBatch: IImportedEvent[] = [];
@@ -415,8 +415,8 @@ async function processFiles({
apiUrl,
clientId,
clientSecret,
- })
- )
+ }),
+ ),
);
apiBatching = [];
}
@@ -462,6 +462,6 @@ export async function importFiles({
const endTime = Date.now();
console.log(
- `\nProcessing completed in ${(endTime - startTime) / 1000} seconds`
+ `\nProcessing completed in ${(endTime - startTime) / 1000} seconds`,
);
}
diff --git a/packages/cli/src/importer/index.ts b/packages/cli/src/importer/index.ts
index 3cc88e1ff..fcd1f196b 100644
--- a/packages/cli/src/importer/index.ts
+++ b/packages/cli/src/importer/index.ts
@@ -1,4 +1,4 @@
-import path from 'path';
+import path from 'node:path';
import arg from 'arg';
import { glob } from 'glob';
@@ -17,7 +17,7 @@ export default async function importer() {
},
{
permissive: true,
- }
+ },
);
if (!args['--glob']) {
@@ -40,7 +40,7 @@ export default async function importer() {
const files = allFiles.slice(
args['--from'] ?? 0,
- args['--to'] ?? Number.MAX_SAFE_INTEGER
+ args['--to'] ?? Number.MAX_SAFE_INTEGER,
);
if (args['--dry-run']) {
diff --git a/packages/cli/tsup.config.ts b/packages/cli/tsup.config.ts
index 7355fc666..25f856f02 100644
--- a/packages/cli/tsup.config.ts
+++ b/packages/cli/tsup.config.ts
@@ -1,6 +1,8 @@
import { defineConfig } from 'tsup';
-import config from '@openpanel/tsconfig/tsup.config.json' assert { type: 'json' };
+import config from '@openpanel/tsconfig/tsup.config.json' assert {
+ type: 'json',
+};
export default defineConfig({
...(config as any),
diff --git a/packages/common/index.ts b/packages/common/index.ts
index 9d1ed4316..3b8137de9 100644
--- a/packages/common/index.ts
+++ b/packages/common/index.ts
@@ -1,5 +1,3 @@
-export * from './src/crypto';
-export * from './src/profileId';
export * from './src/date';
export * from './src/object';
export * from './src/names';
diff --git a/packages/common/package.json b/packages/common/package.json
index e2dda80a6..9b6d4e70c 100644
--- a/packages/common/package.json
+++ b/packages/common/package.json
@@ -3,8 +3,6 @@
"version": "0.0.1",
"main": "index.ts",
"scripts": {
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -18,22 +16,11 @@
"unique-names-generator": "^4.7.1"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@openpanel/validation": "workspace:*",
"@types/node": "^18.16.0",
"@types/ramda": "^0.29.6",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"prisma": "^5.1.1",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/common/src/crypto.ts b/packages/common/server/crypto.ts
similarity index 96%
rename from packages/common/src/crypto.ts
rename to packages/common/server/crypto.ts
index d19738308..fa20c68d4 100644
--- a/packages/common/src/crypto.ts
+++ b/packages/common/server/crypto.ts
@@ -3,7 +3,7 @@ import {
randomBytes,
scrypt,
timingSafeEqual,
-} from 'crypto';
+} from 'node:crypto';
export function generateSalt() {
return randomBytes(16).toString('hex');
@@ -16,7 +16,7 @@ export function generateSalt() {
*/
export async function hashPassword(
password: string,
- keyLength = 32
+ keyLength = 32,
): Promise<string> {
return new Promise((resolve, reject) => {
// generate random 16 bytes long salt - recommended by NodeJS Docs
@@ -38,7 +38,7 @@ export async function hashPassword(
export async function verifyPassword(
password: string,
hash: string,
- keyLength = 32
+ keyLength = 32,
): Promise<boolean> {
return new Promise((resolve, reject) => {
const [salt, hashKey] = hash.split('.');
diff --git a/packages/common/server/index.ts b/packages/common/server/index.ts
new file mode 100644
index 000000000..e5fd0d200
--- /dev/null
+++ b/packages/common/server/index.ts
@@ -0,0 +1,2 @@
+export * from './crypto';
+export * from './profileId';
diff --git a/packages/common/src/profileId.ts b/packages/common/server/profileId.ts
similarity index 100%
rename from packages/common/src/profileId.ts
rename to packages/common/server/profileId.ts
diff --git a/packages/common/src/fill-series.ts b/packages/common/src/fill-series.ts
index fe2abd88d..6c996717c 100644
--- a/packages/common/src/fill-series.ts
+++ b/packages/common/src/fill-series.ts
@@ -84,7 +84,7 @@ export function completeSerie(
data: ISerieDataItem[],
_startDate: string,
_endDate: string,
- interval: IInterval
+ interval: IInterval,
) {
const startDate = parseISO(_startDate);
const endDate = parseISO(_endDate);
diff --git a/packages/common/src/get-previous-metric.ts b/packages/common/src/get-previous-metric.ts
index a1aafa306..00be60771 100644
--- a/packages/common/src/get-previous-metric.ts
+++ b/packages/common/src/get-previous-metric.ts
@@ -6,7 +6,7 @@ import { round } from './math';
export function getPreviousMetric(
current: number,
- previous: number | null | undefined
+ previous: number | null | undefined,
): PreviousValue {
if (isNil(previous)) {
return undefined;
@@ -20,7 +20,7 @@ export function getPreviousMetric(
: 0) -
1) *
100,
- 1
+ 1,
);
return {
diff --git a/packages/common/src/math.ts b/packages/common/src/math.ts
index 25d6545eb..06707264d 100644
--- a/packages/common/src/math.ts
+++ b/packages/common/src/math.ts
@@ -1,14 +1,14 @@
import { isNumber } from 'mathjs';
export const round = (num: number, decimals = 2) => {
- const factor = Math.pow(10, decimals);
+ const factor = 10 ** decimals;
return Math.round((num + Number.EPSILON) * factor) / factor;
};
export const average = (arr: (number | null)[]) => {
const filtered = arr.filter(
(n): n is number =>
- isNumber(n) && !Number.isNaN(n) && Number.isFinite(n) && n !== 0
+ isNumber(n) && !Number.isNaN(n) && Number.isFinite(n) && n !== 0,
);
const avg = filtered.reduce((p, c) => p + c, 0) / filtered.length;
return Number.isNaN(avg) ? 0 : avg;
diff --git a/packages/common/src/object.ts b/packages/common/src/object.ts
index 6ba6d816c..aa51a9570 100644
--- a/packages/common/src/object.ts
+++ b/packages/common/src/object.ts
@@ -3,7 +3,7 @@ import superjson from 'superjson';
export function toDots(
obj: Record<string, unknown>,
- path = ''
+ path = '',
): Record<string, string> {
return Object.entries(obj).reduce((acc, [key, value]) => {
if (typeof value === 'object' && value !== null) {
@@ -26,7 +26,7 @@ export function toDots(
}
export function toObject(
- obj: Record<string, string | undefined>
+ obj: Record<string, string | undefined>,
): Record<string, unknown> {
let result: Record<string, unknown> = {};
Object.entries(obj).forEach(([key, value]) => {
diff --git a/packages/common/src/slug.ts b/packages/common/src/slug.ts
index 2c4480020..f93bae733 100644
--- a/packages/common/src/slug.ts
+++ b/packages/common/src/slug.ts
@@ -9,7 +9,7 @@ const slugify = (str: string) => {
.replace('Å', 'A')
.replace('Ä', 'A')
.replace('Ö', 'O'),
- { lower: true, strict: true, trim: true }
+ { lower: true, strict: true, trim: true },
);
};
diff --git a/packages/common/src/url.ts b/packages/common/src/url.ts
index 1de5133b6..43d31ef0a 100644
--- a/packages/common/src/url.ts
+++ b/packages/common/src/url.ts
@@ -1,5 +1,5 @@
export function parseSearchParams(
- params: URLSearchParams
+ params: URLSearchParams,
): Record<string, string> | undefined {
const result: Record<string, string> = {};
for (const [key, value] of params.entries()) {
@@ -39,7 +39,7 @@ export function parsePath(path?: string): {
export function isSameDomain(
url1: string | undefined,
- url2: string | undefined
+ url2: string | undefined,
) {
if (!url1 || !url2) {
return false;
diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json
index a291eef2f..23a69125d 100644
--- a/packages/common/tsconfig.json
+++ b/packages/common/tsconfig.json
@@ -3,7 +3,8 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
- "@/*": ["./src/*"]
+ "@/*": ["./src/*"],
+ "@/server/*": ["./src/server/*"]
},
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
},
diff --git a/packages/constants/index.ts b/packages/constants/index.ts
index 34acc98a2..73ee9f67e 100644
--- a/packages/constants/index.ts
+++ b/packages/constants/index.ts
@@ -155,7 +155,7 @@ export const metrics = {
} as const;
export function isMinuteIntervalEnabledByRange(
- range: keyof typeof timeWindows
+ range: keyof typeof timeWindows,
) {
return range === '30min' || range === 'lastHour';
}
@@ -165,13 +165,15 @@ export function isHourIntervalEnabledByRange(range: keyof typeof timeWindows) {
}
export function getDefaultIntervalByRange(
- range: keyof typeof timeWindows
+ range: keyof typeof timeWindows,
): keyof typeof intervals {
if (range === '30min' || range === 'lastHour') {
return 'minute';
- } else if (range === 'today') {
+ }
+ if (range === 'today') {
return 'hour';
- } else if (
+ }
+ if (
range === '7d' ||
range === '30d' ||
range === 'lastMonth' ||
@@ -184,12 +186,13 @@ export function getDefaultIntervalByRange(
export function getDefaultIntervalByDates(
startDate: string | null,
- endDate: string | null
+ endDate: string | null,
): null | keyof typeof intervals {
if (startDate && endDate) {
if (isSameDay(startDate, endDate)) {
return 'hour';
- } else if (isSameMonth(startDate, endDate)) {
+ }
+ if (isSameMonth(startDate, endDate)) {
return 'day';
}
return 'month';
diff --git a/packages/constants/package.json b/packages/constants/package.json
index 35f916195..e49fc6717 100644
--- a/packages/constants/package.json
+++ b/packages/constants/package.json
@@ -3,25 +3,12 @@
"version": "0.0.1",
"main": "index.ts",
"scripts": {
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"date-fns": "^3.3.1",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"prisma": "^5.1.1",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
+ }
}
diff --git a/packages/db/package.json b/packages/db/package.json
index a9d3fc649..5890d7c22 100644
--- a/packages/db/package.json
+++ b/packages/db/package.json
@@ -9,8 +9,6 @@
"migrate:deploy:db": "pnpm with-env prisma migrate deploy",
"migrate:deploy:ch": "pnpm goose up",
"migrate:deploy": "pnpm migrate:deploy:db && pnpm migrate:deploy:ch",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env -c --"
},
@@ -29,23 +27,12 @@
"uuid": "^9.0.1"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/node": "^18.16.0",
"@types/ramda": "^0.29.6",
"@types/sqlstring": "^2.3.2",
"@types/uuid": "^9.0.8",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"prisma": "^5.1.1",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/db/src/buffers/bot-buffer.ts b/packages/db/src/buffers/bot-buffer.ts
index 48b1f678e..576464684 100644
--- a/packages/db/src/buffers/bot-buffer.ts
+++ b/packages/db/src/buffers/bot-buffer.ts
@@ -1,4 +1,4 @@
-import { ch, TABLE_NAMES } from '../clickhouse-client';
+import { TABLE_NAMES, ch } from '../clickhouse-client';
import type { IClickhouseBotEvent } from '../services/event.service';
import type {
Find,
diff --git a/packages/db/src/buffers/buffer.ts b/packages/db/src/buffers/buffer.ts
index 7658de82c..55dbc8c0e 100644
--- a/packages/db/src/buffers/buffer.ts
+++ b/packages/db/src/buffers/buffer.ts
@@ -17,20 +17,20 @@ export type OnCompleted<T> =
export type ProcessQueue<T> = (data: QueueItem<T>[]) => Promise<number[]>;
export type Find<T, R = unknown> = (
- callback: (item: QueueItem<T>) => boolean
+ callback: (item: QueueItem<T>) => boolean,
) => Promise<R | null>;
export type FindMany<T, R = unknown> = (
- callback: (item: QueueItem<T>) => boolean
+ callback: (item: QueueItem<T>) => boolean,
) => Promise<R[]>;
const getError = (e: unknown) => {
if (e instanceof Error) {
return [
- 'Name: ' + e.name,
- 'Message: ' + e.message,
- 'Stack: ' + e.stack,
- 'Cause: ' + (e.cause ? String(e.cause) : ''),
+ `Name: ${e.name}`,
+ `Message: ${e.message}`,
+ `Stack: ${e.stack}`,
+ `Cause: ${e.cause ? String(e.cause) : ''}`,
].join('\n');
}
return 'Unknown error';
@@ -59,13 +59,13 @@ export abstract class RedisBuffer<T> {
this.table = options.table;
this.batchSize = options.batchSize;
this.disableAutoFlush = options.disableAutoFlush;
- this.logger = createLogger({ name: `buffer` }).child({
+ this.logger = createLogger({ name: 'buffer' }).child({
table: this.table,
});
}
public getKey(name?: string) {
- const key = this.prefix + ':' + this.table;
+ const key = `${this.prefix}:${this.table}`;
if (name) {
return `${key}:${name}`;
}
@@ -78,12 +78,12 @@ export abstract class RedisBuffer<T> {
const length = await getRedisCache().llen(this.getKey());
this.logger.debug(
- `Inserted item into buffer ${this.table}. Current length: ${length}`
+ `Inserted item into buffer ${this.table}. Current length: ${length}`,
);
if (!this.disableAutoFlush && this.batchSize && length >= this.batchSize) {
this.logger.info(
- `Buffer ${this.table} reached batch size (${this.batchSize}). Flushing...`
+ `Buffer ${this.table} reached batch size (${this.batchSize}). Flushing...`,
);
this.flush();
}
@@ -99,7 +99,7 @@ export abstract class RedisBuffer<T> {
}
this.logger.info(
- `Flushing ${queue.length} items from buffer ${this.table}`
+ `Flushing ${queue.length} items from buffer ${this.table}`,
);
try {
@@ -112,19 +112,19 @@ export abstract class RedisBuffer<T> {
if (this.onCompleted) {
const res = await this.onCompleted(data);
this.logger.info(
- `Completed processing ${res.length} items from buffer ${this.table}`
+ `Completed processing ${res.length} items from buffer ${this.table}`,
);
return { count: res.length, data: res };
}
this.logger.info(
- `Processed ${indexes.length} items from buffer ${this.table}`
+ `Processed ${indexes.length} items from buffer ${this.table}`,
);
return { count: indexes.length, data: indexes };
} catch (e) {
this.logger.error(
`Failed to process queue while flushing buffer ${this.table}:`,
- e
+ e,
);
const timestamp = new Date().getTime();
await getRedisCache().hset(this.getKey(`failed:${timestamp}`), {
@@ -133,13 +133,13 @@ export abstract class RedisBuffer<T> {
retries: 0,
});
this.logger.warn(
- `Stored ${queue.length} failed items in ${this.getKey(`failed:${timestamp}`)}`
+ `Stored ${queue.length} failed items in ${this.getKey(`failed:${timestamp}`)}`,
);
}
} catch (e) {
this.logger.error(
`Failed to get queue while flushing buffer ${this.table}:`,
- e
+ e,
);
}
}
@@ -152,7 +152,7 @@ export abstract class RedisBuffer<T> {
multi.lrem(this.getKey(), 0, DELETE);
await multi.exec();
this.logger.debug(
- `Deleted ${indexes.length} items from buffer ${this.table}`
+ `Deleted ${indexes.length} items from buffer ${this.table}`,
);
}
@@ -165,7 +165,7 @@ export abstract class RedisBuffer<T> {
}))
.filter((item): item is QueueItem<T> => item.event !== null);
this.logger.debug(
- `Retrieved ${result.length} items from buffer ${this.table}`
+ `Retrieved ${result.length} items from buffer ${this.table}`,
);
return result;
}
diff --git a/packages/db/src/buffers/event-buffer.ts b/packages/db/src/buffers/event-buffer.ts
index efab17d89..590050b6a 100644
--- a/packages/db/src/buffers/event-buffer.ts
+++ b/packages/db/src/buffers/event-buffer.ts
@@ -4,7 +4,7 @@ import SuperJSON from 'superjson';
import { deepMergeObjects } from '@openpanel/common';
import { getRedisCache, getRedisPub } from '@openpanel/redis';
-import { ch, TABLE_NAMES } from '../clickhouse-client';
+import { TABLE_NAMES, ch } from '../clickhouse-client';
import { transformEvent } from '../services/event.service';
import type {
IClickhouseEvent,
@@ -22,7 +22,7 @@ import { RedisBuffer } from './buffer';
const sortOldestFirst = (
a: QueueItem<IClickhouseEvent>,
- b: QueueItem<IClickhouseEvent>
+ b: QueueItem<IClickhouseEvent>,
) =>
new Date(a.event.created_at).getTime() -
new Date(b.event.created_at).getTime();
@@ -37,25 +37,25 @@ export class EventBuffer extends RedisBuffer<IClickhouseEvent> {
public onInsert?: OnInsert<IClickhouseEvent> | undefined = (event) => {
getRedisPub().publish(
'event:received',
- SuperJSON.stringify(transformEvent(event))
+ SuperJSON.stringify(transformEvent(event)),
);
if (event.profile_id) {
getRedisCache().set(
`live:event:${event.project_id}:${event.profile_id}`,
'',
'EX',
- 60 * 5
+ 60 * 5,
);
}
};
public onCompleted?: OnCompleted<IClickhouseEvent> | undefined = (
- savedEvents
+ savedEvents,
) => {
for (const event of savedEvents) {
getRedisPub().publish(
'event:saved',
- SuperJSON.stringify(transformEvent(event))
+ SuperJSON.stringify(transformEvent(event)),
);
}
@@ -76,7 +76,7 @@ export class EventBuffer extends RedisBuffer<IClickhouseEvent> {
queue
.filter(
(item) =>
- item.event.name !== 'screen_view' || item.event.device === 'server'
+ item.event.name !== 'screen_view' || item.event.device === 'server',
)
.forEach((item) => {
// Find the last event with data and merge it with the current event
@@ -93,7 +93,7 @@ export class EventBuffer extends RedisBuffer<IClickhouseEvent> {
const event = deepMergeObjects<IClickhouseEvent>(
omit(['properties', 'duration'], lastEventWithData?.event || {}),
- item.event
+ item.event,
);
if (lastEventWithData) {
@@ -111,8 +111,8 @@ export class EventBuffer extends RedisBuffer<IClickhouseEvent> {
(item) => item.event.session_id,
queue.filter(
(item) =>
- item.event.name === 'screen_view' && item.event.device !== 'server'
- )
+ item.event.name === 'screen_view' && item.event.device !== 'server',
+ ),
);
// Iterate over each group
@@ -125,7 +125,7 @@ export class EventBuffer extends RedisBuffer<IClickhouseEvent> {
const hasSessionEnd = queue.find(
(item) =>
item.event.name === 'session_end' &&
- item.event.session_id === sessionId
+ item.event.session_id === sessionId,
);
screenViews
@@ -187,7 +187,7 @@ export class EventBuffer extends RedisBuffer<IClickhouseEvent> {
};
public findMany: FindMany<IClickhouseEvent, IServiceEvent> = async (
- callback
+ callback,
) => {
return this.getQueue(-1)
.then((queue) => {
diff --git a/packages/db/src/buffers/profile-buffer.ts b/packages/db/src/buffers/profile-buffer.ts
index 4488888da..208a1f0bb 100644
--- a/packages/db/src/buffers/profile-buffer.ts
+++ b/packages/db/src/buffers/profile-buffer.ts
@@ -3,7 +3,7 @@ import { mergeDeepRight } from 'ramda';
import { toDots } from '@openpanel/common';
import { getRedisCache } from '@openpanel/redis';
-import { ch, chQuery, TABLE_NAMES } from '../clickhouse-client';
+import { TABLE_NAMES, ch, chQuery } from '../clickhouse-client';
import type {
IClickhouseProfile,
IServiceProfile,
@@ -35,13 +35,13 @@ export class ProfileBuffer extends RedisBuffer<IClickhouseProfile> {
const cleanedQueue = this.combineQueueItems(queue);
const redisProfiles = await this.getCachedProfiles(cleanedQueue);
const dbProfiles = await this.fetchDbProfiles(
- cleanedQueue.filter((_, index) => !redisProfiles[index])
+ cleanedQueue.filter((_, index) => !redisProfiles[index]),
);
const values = this.createProfileValues(
cleanedQueue,
redisProfiles,
- dbProfiles
+ dbProfiles,
);
if (values.length > 0) {
@@ -55,7 +55,7 @@ export class ProfileBuffer extends RedisBuffer<IClickhouseProfile> {
private matchPartialObject(
full: any,
partial: any,
- options: { ignore: string[] }
+ options: { ignore: string[] },
): boolean {
if (typeof partial !== 'object' || partial === null) {
return partial === full;
@@ -78,7 +78,7 @@ export class ProfileBuffer extends RedisBuffer<IClickhouseProfile> {
}
private combineQueueItems(
- queue: QueueItem<IClickhouseProfile>[]
+ queue: QueueItem<IClickhouseProfile>[],
): QueueItem<IClickhouseProfile>[] {
const itemsToClickhouse = new Map<string, QueueItem<IClickhouseProfile>>();
@@ -92,11 +92,11 @@ export class ProfileBuffer extends RedisBuffer<IClickhouseProfile> {
}
private async getCachedProfiles(
- cleanedQueue: QueueItem<IClickhouseProfile>[]
+ cleanedQueue: QueueItem<IClickhouseProfile>[],
): Promise<(IClickhouseProfile | null)[]> {
const redisCache = getRedisCache();
const keys = cleanedQueue.map(
- (item) => `profile:${item.event.project_id}:${item.event.id}`
+ (item) => `profile:${item.event.project_id}:${item.event.id}`,
);
const cachedProfiles = await redisCache.mget(...keys);
return cachedProfiles.map((profile) => {
@@ -109,7 +109,7 @@ export class ProfileBuffer extends RedisBuffer<IClickhouseProfile> {
}
private async fetchDbProfiles(
- cleanedQueue: QueueItem<IClickhouseProfile>[]
+ cleanedQueue: QueueItem<IClickhouseProfile>[],
): Promise<IClickhouseProfile[]> {
if (cleanedQueue.length === 0) {
return [];
@@ -122,21 +122,21 @@ export class ProfileBuffer extends RedisBuffer<IClickhouseProfile> {
WHERE
(id, project_id) IN (${cleanedQueue.map((item) => `('${item.event.id}', '${item.event.project_id}')`).join(',')})
ORDER BY
- created_at DESC`
+ created_at DESC`,
);
}
private createProfileValues(
cleanedQueue: QueueItem<IClickhouseProfile>[],
redisProfiles: (IClickhouseProfile | null)[],
- dbProfiles: IClickhouseProfile[]
+ dbProfiles: IClickhouseProfile[],
): IClickhouseProfile[] {
return cleanedQueue
.map((item, index) => {
const cachedProfile = redisProfiles[index];
const dbProfile = dbProfiles.find(
(p) =>
- p.id === item.event.id && p.project_id === item.event.project_id
+ p.id === item.event.id && p.project_id === item.event.project_id,
);
const profile = cachedProfile || dbProfile;
@@ -150,7 +150,7 @@ export class ProfileBuffer extends RedisBuffer<IClickhouseProfile> {
},
{
ignore: ['created_at'],
- }
+ },
)
) {
console.log('Ignoring profile', item.event.id);
@@ -182,14 +182,14 @@ export class ProfileBuffer extends RedisBuffer<IClickhouseProfile> {
multi.setex(
`profile:${value.project_id}:${value.id}`,
60 * 30, // 30 minutes
- JSON.stringify(value)
+ JSON.stringify(value),
);
});
await multi.exec();
}
private async insertIntoClickhouse(
- values: IClickhouseProfile[]
+ values: IClickhouseProfile[],
): Promise<void> {
await ch.insert({
table: TABLE_NAMES.profiles,
@@ -199,7 +199,7 @@ export class ProfileBuffer extends RedisBuffer<IClickhouseProfile> {
}
public findMany: FindMany<IClickhouseProfile, IServiceProfile> = async (
- callback
+ callback,
) => {
return this.getQueue(-1)
.then((queue) => {
diff --git a/packages/db/src/clickhouse-client.ts b/packages/db/src/clickhouse-client.ts
index 96e9f946e..e469dd22b 100644
--- a/packages/db/src/clickhouse-client.ts
+++ b/packages/db/src/clickhouse-client.ts
@@ -53,19 +53,19 @@ export const ch = new Proxy(originalCh, {
error.message.includes('socket hang up') ||
error.message.includes('Timeout error'))
) {
- childLogger.error(`Captured error`, {
+ childLogger.error('Captured error', {
error,
});
await new Promise((resolve) => setTimeout(resolve, 500));
try {
// Retry once
- childLogger.info(`Retrying query`);
+ childLogger.info('Retrying query');
if (property in target) {
// @ts-expect-error
return await target[property](...args);
}
} catch (retryError) {
- logger.error(`Retry failed`, retryError);
+ logger.error('Retry failed', retryError);
throw retryError; // Rethrow or handle as needed
}
} else {
@@ -85,7 +85,7 @@ export const ch = new Proxy(originalCh, {
});
export async function chQueryWithMeta<T extends Record<string, any>>(
- query: string
+ query: string,
): Promise<ResponseJSON<T>> {
const start = Date.now();
const res = await ch.query({
@@ -102,7 +102,7 @@ export async function chQueryWithMeta<T extends Record<string, any>>(
...acc,
[key]:
item[key] && meta?.type.includes('Int')
- ? parseFloat(item[key] as string)
+ ? Number.parseFloat(item[key] as string)
: item[key],
};
}, {} as T);
@@ -120,14 +120,14 @@ export async function chQueryWithMeta<T extends Record<string, any>>(
}
export async function chQuery<T extends Record<string, any>>(
- query: string
+ query: string,
): Promise<T[]> {
return (await chQueryWithMeta<T>(query)).data;
}
export function formatClickhouseDate(
_date: Date | string,
- skipTime = false
+ skipTime = false,
): string {
const date = typeof _date === 'string' ? new Date(_date) : _date;
if (skipTime) {
@@ -153,5 +153,5 @@ export function toDate(str: string, interval?: IInterval) {
}
export function convertClickhouseDateToJs(date: string) {
- return new Date(date.replace(' ', 'T') + 'Z');
+ return new Date(`${date.replace(' ', 'T')}Z`);
}
diff --git a/packages/db/src/services/chart.service.ts b/packages/db/src/services/chart.service.ts
index c7123f035..111f56105 100644
--- a/packages/db/src/services/chart.service.ts
+++ b/packages/db/src/services/chart.service.ts
@@ -7,8 +7,8 @@ import type {
} from '@openpanel/validation';
import {
- formatClickhouseDate,
TABLE_NAMES,
+ formatClickhouseDate,
toDate,
} from '../clickhouse-client';
import { createSqlBuilder } from '../sql-builder';
@@ -32,7 +32,7 @@ export function getSelectPropertyKey(property: string) {
if (property.startsWith('properties.')) {
if (property.includes('*')) {
return `arrayMap(x -> trim(x), mapValues(mapExtractKeyLike(properties, ${escape(
- transformPropertyKey(property)
+ transformPropertyKey(property),
)})))`;
}
return `properties['${property.replace(/^properties\./, '')}']`;
@@ -64,7 +64,7 @@ export function getChartSql({
sb.select.label_0 = `'*' as label_0`;
}
- sb.select.count = `count(*) as count`;
+ sb.select.count = 'count(*) as count';
switch (interval) {
case 'minute': {
sb.select.date = `toStartOfMinute(toTimeZone(created_at, '${getTimezoneFromDateString(startDate)}')) as date`;
@@ -111,15 +111,16 @@ export function getChartSql({
});
if (event.segment === 'user') {
- sb.select.count = `countDistinct(profile_id) as count`;
+ sb.select.count = 'countDistinct(profile_id) as count';
}
if (event.segment === 'session') {
- sb.select.count = `countDistinct(session_id) as count`;
+ sb.select.count = 'countDistinct(session_id) as count';
}
if (event.segment === 'user_average') {
- sb.select.count = `COUNT(*)::float / COUNT(DISTINCT profile_id)::float as count`;
+ sb.select.count =
+ 'COUNT(*)::float / COUNT(DISTINCT profile_id)::float as count';
}
if (event.segment === 'property_sum' && event.property) {
@@ -136,7 +137,7 @@ export function getChartSql({
sb.from = `(
SELECT DISTINCT ON (profile_id) * from ${TABLE_NAMES.events} WHERE ${join(
sb.where,
- ' AND '
+ ' AND ',
)}
ORDER BY profile_id, created_at DESC
) as subQuery`;
@@ -157,9 +158,9 @@ export function getEventFiltersWhereClause(filters: IChartEventFilter[]) {
if (name === 'has_profile') {
if (value.includes('true')) {
- where[id] = `profile_id != device_id`;
+ where[id] = 'profile_id != device_id';
} else {
- where[id] = `profile_id = device_id`;
+ where[id] = 'profile_id = device_id';
}
return;
}
@@ -211,7 +212,7 @@ export function getEventFiltersWhereClause(filters: IChartEventFilter[]) {
where[id] = value
.map(
(val) =>
- `${whereFrom} LIKE ${escape(`%${String(val).trim()}%`)}`
+ `${whereFrom} LIKE ${escape(`%${String(val).trim()}%`)}`,
)
.join(' OR ');
}
@@ -226,7 +227,7 @@ export function getEventFiltersWhereClause(filters: IChartEventFilter[]) {
where[id] = value
.map(
(val) =>
- `${whereFrom} NOT LIKE ${escape(`%${String(val).trim()}%`)}`
+ `${whereFrom} NOT LIKE ${escape(`%${String(val).trim()}%`)}`,
)
.join(' OR ');
}
@@ -240,7 +241,8 @@ export function getEventFiltersWhereClause(filters: IChartEventFilter[]) {
} else {
where[id] = value
.map(
- (val) => `${whereFrom} LIKE ${escape(`${String(val).trim()}%`)}`
+ (val) =>
+ `${whereFrom} LIKE ${escape(`${String(val).trim()}%`)}`,
)
.join(' OR ');
}
@@ -254,7 +256,8 @@ export function getEventFiltersWhereClause(filters: IChartEventFilter[]) {
} else {
where[id] = value
.map(
- (val) => `${whereFrom} LIKE ${escape(`%${String(val).trim()}`)}`
+ (val) =>
+ `${whereFrom} LIKE ${escape(`%${String(val).trim()}`)}`,
)
.join(' OR ');
}
@@ -268,7 +271,7 @@ export function getEventFiltersWhereClause(filters: IChartEventFilter[]) {
} else {
where[id] = value
.map(
- (val) => `match(${whereFrom}, ${escape(String(val).trim())})`
+ (val) => `match(${whereFrom}, ${escape(String(val).trim())})`,
)
.join(' OR ');
}
@@ -306,7 +309,7 @@ export function getEventFiltersWhereClause(filters: IChartEventFilter[]) {
case 'doesNotContain': {
where[id] = value
.map(
- (val) => `${name} NOT LIKE ${escape(`%${String(val).trim()}%`)}`
+ (val) => `${name} NOT LIKE ${escape(`%${String(val).trim()}%`)}`,
)
.join(' OR ');
break;
diff --git a/packages/db/src/services/event.service.ts b/packages/db/src/services/event.service.ts
index cde761aa7..077bd632a 100644
--- a/packages/db/src/services/event.service.ts
+++ b/packages/db/src/services/event.service.ts
@@ -8,11 +8,11 @@ import type { IChartEventFilter } from '@openpanel/validation';
import { botBuffer, eventBuffer } from '../buffers';
import {
+ TABLE_NAMES,
ch,
chQuery,
convertClickhouseDateToJs,
formatClickhouseDate,
- TABLE_NAMES,
} from '../clickhouse-client';
import type { EventMeta, Prisma } from '../prisma-client';
import { db } from '../prisma-client';
@@ -211,7 +211,7 @@ function maskString(str: string, mask = '*') {
}
export function transformMinimalEvent(
- event: IServiceEvent
+ event: IServiceEvent,
): IServiceEventMinimal {
return {
id: event.id,
@@ -242,7 +242,7 @@ export async function getLiveVisitors(projectId: string) {
export async function getEvents(
sql: string,
- options: GetEventsOptions = {}
+ options: GetEventsOptions = {},
): Promise<IServiceEvent[]> {
const events = await chQuery<IClickhouseEvent>(sql);
const projectId = events[0]?.project_id;
@@ -278,7 +278,7 @@ export async function createEvent(payload: IServiceCreateEventPayload) {
payload.profileId = payload.deviceId;
}
console.log(
- `create event ${payload.name} for [deviceId]: ${payload.deviceId} [profileId]: ${payload.profileId} [projectId]: ${payload.projectId} [path]: ${payload.path}`
+ `create event ${payload.name} for [deviceId]: ${payload.deviceId} [profileId]: ${payload.profileId} [projectId]: ${payload.projectId} [path]: ${payload.path}`,
);
if (payload.profileId !== '') {
@@ -389,7 +389,7 @@ export async function getEventList({
os: true,
browser: true,
},
- incomingSelect ?? {}
+ incomingSelect ?? {},
);
if (select.id) {
@@ -491,7 +491,7 @@ export async function getEventList({
if (events && events.length > 0) {
sb.where.events = `name IN (${join(
events.map((event) => escape(event)),
- ','
+ ',',
)})`;
}
@@ -537,7 +537,7 @@ export async function getEventsCount({
if (events && events.length > 0) {
sb.where.events = `name IN (${join(
events.map((event) => escape(event)),
- ','
+ ',',
)})`;
}
@@ -549,7 +549,7 @@ export async function getEventsCount({
}
const res = await chQuery<{ count: number }>(
- getSql().replace('*', 'count(*) as count')
+ getSql().replace('*', 'count(*) as count'),
);
return res[0]?.count ?? 0;
@@ -593,7 +593,7 @@ export async function getLastScreenViewFromProfileId({
}
const eventInBuffer = await eventBuffer.find(
- (item) => item.event.profile_id === profileId
+ (item) => item.event.profile_id === profileId,
);
if (eventInBuffer) {
@@ -602,7 +602,7 @@ export async function getLastScreenViewFromProfileId({
const [eventInDb] = profileId
? await getEvents(
- `SELECT * FROM ${TABLE_NAMES.events} WHERE name = 'screen_view' AND profile_id = ${escape(profileId)} AND project_id = ${escape(projectId)} AND created_at >= now() - INTERVAL 30 MINUTE ORDER BY created_at DESC LIMIT 1`
+ `SELECT * FROM ${TABLE_NAMES.events} WHERE name = 'screen_view' AND profile_id = ${escape(profileId)} AND project_id = ${escape(projectId)} AND created_at >= now() - INTERVAL 30 MINUTE ORDER BY created_at DESC LIMIT 1`,
)
: [];
diff --git a/packages/db/src/services/id.service.ts b/packages/db/src/services/id.service.ts
index 28dfb1f12..3060532c8 100644
--- a/packages/db/src/services/id.service.ts
+++ b/packages/db/src/services/id.service.ts
@@ -4,7 +4,7 @@ import { db } from '../prisma-client';
export async function getId(
tableName: 'project' | 'dashboard' | 'organization',
- name: string
+ name: string,
) {
const newId = slug(name);
if (!db[tableName]) {
diff --git a/packages/db/src/services/profile.service.ts b/packages/db/src/services/profile.service.ts
index e96d2d099..0a7c8d213 100644
--- a/packages/db/src/services/profile.service.ts
+++ b/packages/db/src/services/profile.service.ts
@@ -7,10 +7,10 @@ import type { IChartEventFilter } from '@openpanel/validation';
import { profileBuffer } from '../buffers';
import {
+ TABLE_NAMES,
ch,
chQuery,
formatClickhouseDate,
- TABLE_NAMES,
} from '../clickhouse-client';
import { createSqlBuilder } from '../sql-builder';
@@ -49,7 +49,7 @@ export async function getProfileById(id: string, projectId: string) {
}
const [profile] = await chQuery<IClickhouseProfile>(
- `SELECT * FROM ${TABLE_NAMES.profiles} WHERE id = ${escape(String(id))} AND project_id = ${escape(projectId)} ORDER BY created_at DESC LIMIT 1`
+ `SELECT * FROM ${TABLE_NAMES.profiles} WHERE id = ${escape(String(id))} AND project_id = ${escape(projectId)} ORDER BY created_at DESC LIMIT 1`,
);
if (!profile) {
@@ -82,7 +82,7 @@ export async function getProfiles(ids: string[], projectId: string) {
WHERE
project_id = ${escape(projectId)} AND
id IN (${filteredIds.map((id) => escape(id)).join(',')})
- `
+ `,
);
return data.map(transformProfile);
@@ -251,7 +251,7 @@ export async function getProfileId({
profile_id: string;
project_id: string;
}>(
- `SELECT * FROM ${TABLE_NAMES.alias} WHERE project_id = '${projectId}' AND (alias = '${profileId}' OR profile_id = '${profileId}')`
+ `SELECT * FROM ${TABLE_NAMES.alias} WHERE project_id = '${projectId}' AND (alias = '${profileId}' OR profile_id = '${profileId}')`,
);
if (res[0]) {
diff --git a/packages/db/src/services/project.service.ts b/packages/db/src/services/project.service.ts
index 41d574bff..67d4b696a 100644
--- a/packages/db/src/services/project.service.ts
+++ b/packages/db/src/services/project.service.ts
@@ -87,7 +87,7 @@ export async function getCurrentProjects(organizationSlug: string) {
if (access.length > 0) {
return projects.filter((project) =>
- access.some((a) => a.projectId === project.id)
+ access.some((a) => a.projectId === project.id),
);
}
diff --git a/packages/db/src/services/reports.service.ts b/packages/db/src/services/reports.service.ts
index dbce45463..1cad4cfce 100644
--- a/packages/db/src/services/reports.service.ts
+++ b/packages/db/src/services/reports.service.ts
@@ -19,20 +19,20 @@ export type IServiceReport = Awaited<ReturnType<typeof getReportById>>;
export function transformFilter(
filter: Partial<IChartEventFilter>,
- index: number
+ index: number,
): IChartEventFilter {
return {
id: filter.id ?? alphabetIds[index] ?? 'A',
name: filter.name ?? 'Unknown Filter',
operator: filter.operator ?? 'is',
value:
- typeof filter.value === 'string' ? [filter.value] : filter.value ?? [],
+ typeof filter.value === 'string' ? [filter.value] : (filter.value ?? []),
};
}
export function transformReportEvent(
event: Partial<IChartEvent>,
- index: number
+ index: number,
): IChartEvent {
return {
segment: event.segment ?? 'event',
@@ -45,7 +45,7 @@ export function transformReportEvent(
}
export function transformReport(
- report: DbReport
+ report: DbReport,
): IChartProps & { id: string } {
return {
id: report.id,
diff --git a/packages/db/src/services/retention.service.ts b/packages/db/src/services/retention.service.ts
index c8e617e5b..64e6b24df 100644
--- a/packages/db/src/services/retention.service.ts
+++ b/packages/db/src/services/retention.service.ts
@@ -1,6 +1,6 @@
import { escape } from 'sqlstring';
-import { chQuery, TABLE_NAMES } from '../clickhouse-client';
+import { TABLE_NAMES, chQuery } from '../clickhouse-client';
type IGetWeekRetentionInput = {
projectId: string;
diff --git a/packages/db/src/services/salt.service.ts b/packages/db/src/services/salt.service.ts
index 43ef63833..0bf6167de 100644
--- a/packages/db/src/services/salt.service.ts
+++ b/packages/db/src/services/salt.service.ts
@@ -1,4 +1,4 @@
-import { generateSalt } from '@openpanel/common';
+import { generateSalt } from '@openpanel/common/server';
import { db } from '../prisma-client';
@@ -61,17 +61,14 @@ export async function createInitialSalts() {
} else {
console.log('Error getting salts', error);
if (retryCount < MAX_RETRIES) {
- const delay = BASE_DELAY * Math.pow(2, retryCount);
+ const delay = BASE_DELAY * 2 ** retryCount;
console.log(
- `Retrying in ${delay}ms... (Attempt ${retryCount + 1}/${MAX_RETRIES})`
+ `Retrying in ${delay}ms... (Attempt ${retryCount + 1}/${MAX_RETRIES})`,
);
await new Promise((resolve) => setTimeout(resolve, delay));
return createSaltsWithRetry(retryCount + 1);
- } else {
- throw new Error(
- `Failed to create salts after ${MAX_RETRIES} attempts`
- );
}
+ throw new Error(`Failed to create salts after ${MAX_RETRIES} attempts`);
}
}
};
diff --git a/packages/db/src/sql-builder.ts b/packages/db/src/sql-builder.ts
index da625fdcf..8d82fbdfa 100644
--- a/packages/db/src/sql-builder.ts
+++ b/packages/db/src/sql-builder.ts
@@ -27,16 +27,16 @@ export function createSqlBuilder() {
};
const getWhere = () =>
- Object.keys(sb.where).length ? 'WHERE ' + join(sb.where, ' AND ') : '';
+ Object.keys(sb.where).length ? `WHERE ${join(sb.where, ' AND ')}` : '';
const getHaving = () =>
- Object.keys(sb.having).length ? 'HAVING ' + join(sb.having, ' AND ') : '';
+ Object.keys(sb.having).length ? `HAVING ${join(sb.having, ' AND ')}` : '';
const getFrom = () => `FROM ${sb.from}`;
const getSelect = () =>
- 'SELECT ' + (Object.keys(sb.select).length ? join(sb.select, ', ') : '*');
+ `SELECT ${Object.keys(sb.select).length ? join(sb.select, ', ') : '*'}`;
const getGroupBy = () =>
- Object.keys(sb.groupBy).length ? 'GROUP BY ' + join(sb.groupBy, ', ') : '';
+ Object.keys(sb.groupBy).length ? `GROUP BY ${join(sb.groupBy, ', ')}` : '';
const getOrderBy = () =>
- Object.keys(sb.orderBy).length ? 'ORDER BY ' + join(sb.orderBy, ', ') : '';
+ Object.keys(sb.orderBy).length ? `ORDER BY ${join(sb.orderBy, ', ')}` : '';
const getLimit = () => (sb.limit ? `LIMIT ${sb.limit}` : '');
const getOffset = () => (sb.offset ? `OFFSET ${sb.offset}` : '');
diff --git a/packages/logger/index.ts b/packages/logger/index.ts
index d0cd7a744..aac0481c8 100644
--- a/packages/logger/index.ts
+++ b/packages/logger/index.ts
@@ -22,7 +22,7 @@ export function createLogger({ name }: { name: string }): ILogger {
HyperDX.getWinstonTransport(logLevel, {
detectResources: true,
service,
- })
+ }),
);
}
@@ -34,7 +34,7 @@ export function createLogger({ name }: { name: string }): ILogger {
// Add ISO levels of logging from PINO
levels: Object.assign(
{ fatal: 0, warn: 4, trace: 7 },
- winston.config.syslog.levels
+ winston.config.syslog.levels,
),
});
diff --git a/packages/logger/package.json b/packages/logger/package.json
index d727976b9..8b4a6edd1 100644
--- a/packages/logger/package.json
+++ b/packages/logger/package.json
@@ -3,8 +3,6 @@
"version": "0.0.1",
"main": "index.ts",
"scripts": {
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -12,20 +10,9 @@
"winston": "^3.14.2"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"date-fns": "^3.3.1",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"prisma": "^5.1.1",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/queue/package.json b/packages/queue/package.json
index 7579e8f6e..d867fa812 100644
--- a/packages/queue/package.json
+++ b/packages/queue/package.json
@@ -3,8 +3,6 @@
"version": "0.0.1",
"main": "index.ts",
"scripts": {
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -14,19 +12,8 @@
},
"devDependencies": {
"@openpanel/sdk": "workspace:*",
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/node": "^18.16.0",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/queue/src/utils.ts b/packages/queue/src/utils.ts
index 83cb20530..5518a4cb1 100644
--- a/packages/queue/src/utils.ts
+++ b/packages/queue/src/utils.ts
@@ -3,12 +3,12 @@ import type { Queue } from 'bullmq';
export async function findJobByPrefix<T>(
queue: Queue<T, any, string>,
keys: string[],
- matcher: string
+ matcher: string,
) {
const getTime = (val?: string) => {
if (!val) return null;
const match = val.match(/:(\d+)$/);
- return match?.[1] ? parseInt(match[1], 10) : null;
+ return match?.[1] ? Number.parseInt(match[1], 10) : null;
};
const filtered = keys
.filter((key) => key.includes(matcher))
diff --git a/packages/redis/cachable.ts b/packages/redis/cachable.ts
index d39c48fa8..3017ab190 100644
--- a/packages/redis/cachable.ts
+++ b/packages/redis/cachable.ts
@@ -2,7 +2,7 @@ import { getRedisCache } from './redis';
export function cacheable<T extends (...args: any) => any>(
fn: T,
- expireInSec: number
+ expireInSec: number,
) {
const cachePrefix = `cachable:${fn.name}`;
function stringify(obj: unknown): string {
@@ -14,7 +14,7 @@ export function cacheable<T extends (...args: any) => any>(
if (typeof obj === 'function') return obj.toString();
if (Array.isArray(obj)) {
- return '[' + obj.map(stringify).join(',') + ']';
+ return `[${obj.map(stringify).join(',')}]`;
}
if (typeof obj === 'object') {
@@ -29,9 +29,9 @@ export function cacheable<T extends (...args: any) => any>(
}
const getKey = (...args: Parameters<T>) =>
`${cachePrefix}:${stringify(args)}`;
- const cachedFn = async function (
+ const cachedFn = async (
...args: Parameters<T>
- ): Promise<Awaited<ReturnType<T>>> {
+ ): Promise<Awaited<ReturnType<T>>> => {
// JSON.stringify here is not bullet proof since ordering of object keys matters etc
const key = getKey(...args);
const cached = await getRedisCache().get(key);
@@ -52,7 +52,7 @@ export function cacheable<T extends (...args: any) => any>(
};
cachedFn.getKey = getKey;
- cachedFn.clear = async function (...args: Parameters<T>) {
+ cachedFn.clear = async (...args: Parameters<T>) => {
const key = getKey(...args);
return getRedisCache().del(key);
};
diff --git a/packages/redis/package.json b/packages/redis/package.json
index 391da1bb8..1bc227f80 100644
--- a/packages/redis/package.json
+++ b/packages/redis/package.json
@@ -3,29 +3,15 @@
"version": "0.0.1",
"main": "index.ts",
"scripts": {
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
- "typecheck": "tsc --noEmit",
- "with-env": "dotenv -e ../../.env -c --"
+ "typecheck": "tsc --noEmit"
},
"dependencies": {
"ioredis": "^5.4.1"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/node": "^18.16.0",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"prisma": "^5.1.1",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/redis/redis.ts b/packages/redis/redis.ts
index 7abc06dac..2c78a5203 100644
--- a/packages/redis/redis.ts
+++ b/packages/redis/redis.ts
@@ -9,7 +9,7 @@ export { Redis };
const createRedisClient = (
url: string,
- overrides: RedisOptions = {}
+ overrides: RedisOptions = {},
): Redis => {
const client = new Redis(url, { ...options, ...overrides });
@@ -58,7 +58,7 @@ export function getRedisQueue() {
enableReadyCheck: false,
maxRetriesPerRequest: null,
enableOfflineQueue: true,
- }
+ },
);
}
diff --git a/packages/sdks/_info/package.json b/packages/sdks/_info/package.json
index d45255fee..6094323f5 100644
--- a/packages/sdks/_info/package.json
+++ b/packages/sdks/_info/package.json
@@ -3,25 +3,11 @@
"version": "0.0.1",
"main": "index.ts",
"scripts": {
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
- "typecheck": "tsc --noEmit",
- "with-env": "dotenv -e ../../.env -c --"
+ "typecheck": "tsc --noEmit"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"prisma": "^5.1.1",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
+ }
}
diff --git a/packages/sdks/express/index.ts b/packages/sdks/express/index.ts
index fa0d1e4c3..2fe2ee9f7 100644
--- a/packages/sdks/express/index.ts
+++ b/packages/sdks/express/index.ts
@@ -7,7 +7,6 @@ import { OpenPanel } from '@openpanel/sdk';
export * from '@openpanel/sdk';
declare global {
- // eslint-disable-next-line @typescript-eslint/no-namespace
namespace Express {
export interface Request {
op: OpenPanel;
diff --git a/packages/sdks/express/package.json b/packages/sdks/express/package.json
index d2e576688..8e5150da7 100644
--- a/packages/sdks/express/package.json
+++ b/packages/sdks/express/package.json
@@ -4,8 +4,6 @@
"module": "index.ts",
"scripts": {
"build": "rm -rf dist && tsup",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -16,21 +14,10 @@
"express": "^3.0.0 || ^4.0.0"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/express": "^4.17.21",
"@types/request-ip": "^0.0.41",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/sdks/express/tsup.config.ts b/packages/sdks/express/tsup.config.ts
index f27e56176..741f5d96d 100644
--- a/packages/sdks/express/tsup.config.ts
+++ b/packages/sdks/express/tsup.config.ts
@@ -1,6 +1,8 @@
import { defineConfig } from 'tsup';
-import config from '@openpanel/tsconfig/tsup.config.json' assert { type: 'json' };
+import config from '@openpanel/tsconfig/tsup.config.json' assert {
+ type: 'json',
+};
export default defineConfig({
...(config as any),
diff --git a/packages/sdks/nextjs/index.tsx b/packages/sdks/nextjs/index.tsx
index af22f8f08..cbc94cc49 100644
--- a/packages/sdks/nextjs/index.tsx
+++ b/packages/sdks/nextjs/index.tsx
@@ -1,5 +1,5 @@
-import React from 'react';
import Script from 'next/script';
+import React from 'react';
import type {
DecrementPayload,
@@ -100,7 +100,7 @@ export function useOpenPanel() {
}
function track(name: string, properties?: TrackProperties) {
- window.op && window.op('track', name, properties);
+ window.op?.('track', name, properties);
}
function screenView(properties: TrackProperties) {
@@ -108,11 +108,11 @@ function screenView(properties: TrackProperties) {
}
function identify(payload: IdentifyPayload) {
- window.op && window.op('identify', payload);
+ window.op?.('identify', payload);
}
function increment(payload: IncrementPayload) {
- window.op && window.op('increment', payload);
+ window.op?.('increment', payload);
}
function decrement(payload: DecrementPayload) {
@@ -120,5 +120,5 @@ function decrement(payload: DecrementPayload) {
}
function clear() {
- window.op && window.op('clear');
+ window.op?.('clear');
}
diff --git a/packages/sdks/nextjs/package.json b/packages/sdks/nextjs/package.json
index 6d6f3b7b9..fbd05da31 100644
--- a/packages/sdks/nextjs/package.json
+++ b/packages/sdks/nextjs/package.json
@@ -4,8 +4,6 @@
"module": "index.ts",
"scripts": {
"build": "rm -rf dist && tsup",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -17,20 +15,9 @@
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/react": "^18.2.20",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/sdks/nextjs/tsup.config.ts b/packages/sdks/nextjs/tsup.config.ts
index e0359da36..92058ef8b 100644
--- a/packages/sdks/nextjs/tsup.config.ts
+++ b/packages/sdks/nextjs/tsup.config.ts
@@ -1,6 +1,8 @@
import { defineConfig } from 'tsup';
-import config from '@openpanel/tsconfig/tsup.config.json' assert { type: 'json' };
+import config from '@openpanel/tsconfig/tsup.config.json' assert {
+ type: 'json',
+};
export default defineConfig({
...(config as any),
diff --git a/packages/sdks/react-native/index.ts b/packages/sdks/react-native/index.ts
index e45d51d5d..7aa2baf3c 100644
--- a/packages/sdks/react-native/index.ts
+++ b/packages/sdks/react-native/index.ts
@@ -1,6 +1,6 @@
-import { AppState, Platform } from 'react-native';
import * as Application from 'expo-application';
import Constants from 'expo-constants';
+import { AppState, Platform } from 'react-native';
import type { OpenPanelOptions, TrackProperties } from '@openpanel/sdk';
import { OpenPanel as OpenPanelBase } from '@openpanel/sdk';
diff --git a/packages/sdks/react-native/package.json b/packages/sdks/react-native/package.json
index 49de301d0..d3468116b 100644
--- a/packages/sdks/react-native/package.json
+++ b/packages/sdks/react-native/package.json
@@ -4,20 +4,14 @@
"module": "index.ts",
"scripts": {
"build": "rm -rf dist && tsup",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@openpanel/sdk": "1.0.0-local"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/node": "^20.14.12",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
},
@@ -25,12 +19,5 @@
"expo-application": "^5",
"expo-constants": "14 - 16",
"react-native": "0.73 - 0.74"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/sdks/react-native/tsup.config.ts b/packages/sdks/react-native/tsup.config.ts
index 16a91b68d..a7a3f5e7e 100644
--- a/packages/sdks/react-native/tsup.config.ts
+++ b/packages/sdks/react-native/tsup.config.ts
@@ -1,6 +1,8 @@
import { defineConfig } from 'tsup';
-import config from '@openpanel/tsconfig/tsup.config.json' assert { type: 'json' };
+import config from '@openpanel/tsconfig/tsup.config.json' assert {
+ type: 'json',
+};
export default defineConfig({
...(config as any),
diff --git a/packages/sdks/sdk/package.json b/packages/sdks/sdk/package.json
index 824ad37fb..58816dcfe 100644
--- a/packages/sdks/sdk/package.json
+++ b/packages/sdks/sdk/package.json
@@ -4,26 +4,13 @@
"module": "index.ts",
"scripts": {
"build": "rm -rf dist && tsup",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/node": "^20.14.12",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/sdks/sdk/src/api.ts b/packages/sdks/sdk/src/api.ts
index 53e936d69..1e8e7858e 100644
--- a/packages/sdks/sdk/src/api.ts
+++ b/packages/sdks/sdk/src/api.ts
@@ -44,7 +44,7 @@ export class Api {
url: string,
data: ReqBody,
options: FetchOptions,
- attempt: number
+ attempt: number,
): Promise<ResBody | null> {
try {
const response = await fetch(url, {
@@ -65,7 +65,7 @@ export class Api {
return responseText ? JSON.parse(responseText) : null;
} catch (error) {
if (attempt < this.maxRetries) {
- const delay = this.initialRetryDelay * Math.pow(2, attempt);
+ const delay = this.initialRetryDelay * 2 ** attempt;
await new Promise((resolve) => setTimeout(resolve, delay));
return this.post<ReqBody, ResBody>(url, data, options, attempt + 1);
}
@@ -77,7 +77,7 @@ export class Api {
async fetch<ReqBody, ResBody>(
path: string,
data: ReqBody,
- options: FetchOptions = {}
+ options: FetchOptions = {},
): Promise<ResBody | null> {
const url = `${this.baseUrl}${path}`;
return this.post<ReqBody, ResBody>(url, data, options, 0);
diff --git a/packages/sdks/sdk/tsup.config.ts b/packages/sdks/sdk/tsup.config.ts
index 76b96e47b..2624fc700 100644
--- a/packages/sdks/sdk/tsup.config.ts
+++ b/packages/sdks/sdk/tsup.config.ts
@@ -1,5 +1,7 @@
import { defineConfig } from 'tsup';
-import config from '@openpanel/tsconfig/tsup.config.json' assert { type: 'json' };
+import config from '@openpanel/tsconfig/tsup.config.json' assert {
+ type: 'json',
+};
export default defineConfig(config as any);
diff --git a/packages/sdks/web/package.json b/packages/sdks/web/package.json
index fb2711bba..98e0c6440 100644
--- a/packages/sdks/web/package.json
+++ b/packages/sdks/web/package.json
@@ -4,28 +4,15 @@
"module": "index.ts",
"scripts": {
"build": "rm -rf dist && tsup",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@openpanel/sdk": "1.0.0-local"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/node": "^20.14.12",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/sdks/web/src/index.ts b/packages/sdks/web/src/index.ts
index 3995f0bc0..e15734bf4 100644
--- a/packages/sdks/web/src/index.ts
+++ b/packages/sdks/web/src/index.ts
@@ -1,5 +1,3 @@
-/* eslint-disable @typescript-eslint/unbound-method */
-
import type {
OpenPanelOptions as OpenPanelBaseOptions,
TrackProperties,
@@ -18,7 +16,7 @@ export type OpenPanelOptions = OpenPanelBaseOptions & {
function toCamelCase(str: string) {
return str.replace(/([-_][a-z])/gi, ($1) =>
- $1.toUpperCase().replace('-', '').replace('_', '')
+ $1.toUpperCase().replace('-', '').replace('_', ''),
);
}
@@ -108,7 +106,7 @@ export class OpenPanel extends OpenPanelBase {
return ret;
};
- window.addEventListener('popstate', function () {
+ window.addEventListener('popstate', () => {
window.dispatchEvent(new Event('locationchange'));
});
@@ -155,7 +153,7 @@ export class OpenPanel extends OpenPanelBase {
screenView(path: string, properties?: TrackProperties): void;
screenView(
pathOrProperties?: string | TrackProperties,
- propertiesOrUndefined?: TrackProperties
+ propertiesOrUndefined?: TrackProperties,
): void {
if (this.isServer()) {
return;
diff --git a/packages/sdks/web/tsup.config.ts b/packages/sdks/web/tsup.config.ts
index dc618f175..aaf83a9fe 100644
--- a/packages/sdks/web/tsup.config.ts
+++ b/packages/sdks/web/tsup.config.ts
@@ -1,6 +1,8 @@
import { defineConfig } from 'tsup';
-import config from '@openpanel/tsconfig/tsup.config.json' assert { type: 'json' };
+import config from '@openpanel/tsconfig/tsup.config.json' assert {
+ type: 'json',
+};
export default defineConfig({
...(config as any),
diff --git a/packages/trpc/package.json b/packages/trpc/package.json
index c9ac59b53..9fec4155d 100644
--- a/packages/trpc/package.json
+++ b/packages/trpc/package.json
@@ -3,8 +3,6 @@
"version": "0.0.1",
"main": "index.ts",
"scripts": {
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -27,22 +25,11 @@
"zod": "^3.22.4"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/node": "^18.16.0",
"@types/ramda": "^0.29.6",
"@types/sqlstring": "^2.3.2",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"prisma": "^5.1.1",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/trpc/src/access.ts b/packages/trpc/src/access.ts
index 32162d258..3c0b90b3c 100644
--- a/packages/trpc/src/access.ts
+++ b/packages/trpc/src/access.ts
@@ -43,7 +43,7 @@ export async function getProjectAccess({
export const getOrganizationAccessCached = cacheable(
getOrganizationAccess,
- 60 * 5
+ 60 * 5,
);
export async function getOrganizationAccess({
userId,
diff --git a/packages/trpc/src/routers/chart.helpers.ts b/packages/trpc/src/routers/chart.helpers.ts
index 1f1f9229b..d9470fe5f 100644
--- a/packages/trpc/src/routers/chart.helpers.ts
+++ b/packages/trpc/src/routers/chart.helpers.ts
@@ -29,13 +29,13 @@ import {
import type { ISerieDataItem } from '@openpanel/common';
import { alphabetIds } from '@openpanel/constants';
import {
+ TABLE_NAMES,
chQuery,
createSqlBuilder,
formatClickhouseDate,
getChartSql,
getEventFiltersWhereClause,
getProfiles,
- TABLE_NAMES,
} from '@openpanel/db';
import type {
FinalChart,
@@ -53,7 +53,7 @@ function getEventLegend(event: IChartEvent) {
export function withFormula(
{ formula, events }: IChartInput,
- series: Awaited<ReturnType<typeof getChartSerie>>
+ series: Awaited<ReturnType<typeof getChartSerie>>,
) {
if (!formula) {
return series;
@@ -131,7 +131,7 @@ export function withFormula(
const toDynamicISODateWithTZ = (
date: string,
blueprint: string,
- interval: IInterval
+ interval: IInterval,
) => {
// If we have a space in the date we know it's a date with time
if (date.includes(' ')) {
@@ -324,8 +324,8 @@ export async function getFunnelData({
repeat({}, diff - 1).map((_, index) => ({
count: acc[acc.length - 1]?.count ?? 0,
level: item.level + index + 1,
- }))
- )
+ })),
+ ),
);
}
@@ -337,7 +337,7 @@ export async function getFunnelData({
},
];
},
- [] as typeof funnelRes
+ [] as typeof funnelRes,
);
const totalSessions = last(filledFunnelRes)?.count ?? 0;
@@ -367,7 +367,7 @@ export async function getFunnelData({
dropoffCount: number;
dropoffPercent: number;
previousCount: number;
- }[]
+ }[],
);
return {
@@ -432,7 +432,7 @@ export async function getFunnelStep({
return getProfiles(
res.map((r) => r.id),
- projectId
+ projectId,
);
}
@@ -444,7 +444,7 @@ export async function getChartSerie(payload: IGetChartDataInput) {
getChartSql({
...payload,
breakdowns: [],
- })
+ }),
);
}
return result;
@@ -452,7 +452,7 @@ export async function getChartSerie(payload: IGetChartDataInput) {
return getSeries()
.then((data) =>
- completeSerie(data, payload.startDate, payload.endDate, payload.interval)
+ completeSerie(data, payload.startDate, payload.endDate, payload.interval),
)
.then((series) => {
return Object.keys(series).map((key) => {
@@ -470,7 +470,7 @@ export async function getChartSerie(payload: IGetChartDataInput) {
date: toDynamicISODateWithTZ(
item.date,
payload.startDate,
- payload.interval
+ payload.interval,
),
})),
};
@@ -486,8 +486,8 @@ export async function getChartSeries(input: IChartInputWithDates) {
getChartSerie({
...input,
event,
- })
- )
+ }),
+ ),
)
).flat();
@@ -512,7 +512,7 @@ export async function getChart(input: IChartInput) {
getChartSeries({
...input,
...previousPeriod,
- })
+ }),
);
}
@@ -529,11 +529,11 @@ export async function getChart(input: IChartInput) {
const final: FinalChart = {
series: series.map((serie, index) => {
const eventIndex = input.events.findIndex(
- (event) => event.id === serie.event.id
+ (event) => event.id === serie.event.id,
);
const alphaId = alphabetIds[eventIndex];
const previousSerie = previousSeries?.find(
- (prevSerie) => getSerieId(prevSerie) === getSerieId(serie)
+ (prevSerie) => getSerieId(prevSerie) === getSerieId(serie),
);
const metrics = {
sum: sum(serie.data.map((item) => item.count)),
@@ -561,30 +561,30 @@ export async function getChart(input: IChartInput) {
metrics.sum,
previousSerie
? sum(previousSerie?.data.map((item) => item.count))
- : null
+ : null,
),
average: getPreviousMetric(
metrics.average,
previousSerie
? round(
average(
- previousSerie?.data.map((item) => item.count)
+ previousSerie?.data.map((item) => item.count),
),
- 2
+ 2,
)
- : null
+ : null,
),
min: getPreviousMetric(
metrics.sum,
previousSerie
? min(previousSerie?.data.map((item) => item.count))
- : null
+ : null,
),
max: getPreviousMetric(
metrics.sum,
previousSerie
? max(previousSerie?.data.map((item) => item.count))
- : null
+ : null,
),
},
}
@@ -596,7 +596,7 @@ export async function getChart(input: IChartInput) {
previous: previousSerie?.data[index]
? getPreviousMetric(
item.count ?? 0,
- previousSerie?.data[index]?.count ?? null
+ previousSerie?.data[index]?.count ?? null,
)
: undefined,
})),
@@ -617,16 +617,15 @@ export async function getChart(input: IChartInput) {
const sumA = a.data.reduce((acc, item) => acc + (item.count ?? 0), 0);
const sumB = b.data.reduce((acc, item) => acc + (item.count ?? 0), 0);
return sumB - sumA;
- } else {
- return b.metrics[input.metric] - a.metrics[input.metric];
}
+ return b.metrics[input.metric] - a.metrics[input.metric];
})
.slice(offset, limit ? offset + limit : series.length);
final.metrics.sum = sum(final.series.map((item) => item.metrics.sum));
final.metrics.average = round(
average(final.series.map((item) => item.metrics.average)),
- 2
+ 2,
);
final.metrics.min = min(final.series.map((item) => item.metrics.min));
final.metrics.max = max(final.series.map((item) => item.metrics.max));
@@ -634,26 +633,26 @@ export async function getChart(input: IChartInput) {
final.metrics.previous = {
sum: getPreviousMetric(
final.metrics.sum,
- sum(final.series.map((item) => item.metrics.previous?.sum?.value ?? 0))
+ sum(final.series.map((item) => item.metrics.previous?.sum?.value ?? 0)),
),
average: getPreviousMetric(
final.metrics.average,
round(
average(
final.series.map(
- (item) => item.metrics.previous?.average?.value ?? 0
- )
+ (item) => item.metrics.previous?.average?.value ?? 0,
+ ),
),
- 2
- )
+ 2,
+ ),
),
min: getPreviousMetric(
final.metrics.min,
- min(final.series.map((item) => item.metrics.previous?.min?.value ?? 0))
+ min(final.series.map((item) => item.metrics.previous?.min?.value ?? 0)),
),
max: getPreviousMetric(
final.metrics.max,
- max(final.series.map((item) => item.metrics.previous?.max?.value ?? 0))
+ max(final.series.map((item) => item.metrics.previous?.max?.value ?? 0)),
),
};
}
diff --git a/packages/trpc/src/routers/chart.ts b/packages/trpc/src/routers/chart.ts
index 85981e127..d498287a2 100644
--- a/packages/trpc/src/routers/chart.ts
+++ b/packages/trpc/src/routers/chart.ts
@@ -3,12 +3,12 @@ import { escape } from 'sqlstring';
import { z } from 'zod';
import {
+ TABLE_NAMES,
chQuery,
createSqlBuilder,
db,
formatClickhouseDate,
getSelectPropertyKey,
- TABLE_NAMES,
toDate,
} from '@openpanel/db';
import { zChartInput, zRange, zTimeInterval } from '@openpanel/validation';
@@ -33,12 +33,12 @@ export const chartRouter = createTRPCRouter({
interval: zTimeInterval,
startDate: z.string().nullish(),
endDate: z.string().nullish(),
- })
+ }),
)
.query(async ({ input: { projectId, ...input } }) => {
const { startDate, endDate } = getChartStartEndDate(input);
const events = await chQuery<{ name: string }>(
- `SELECT DISTINCT name FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(projectId)} AND ${toDate('created_at', input.interval)} BETWEEN ${toDate(formatClickhouseDate(startDate), input.interval)} AND ${toDate(formatClickhouseDate(endDate), input.interval)};`
+ `SELECT DISTINCT name FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(projectId)} AND ${toDate('created_at', input.interval)} BETWEEN ${toDate(formatClickhouseDate(startDate), input.interval)} AND ${toDate(formatClickhouseDate(endDate), input.interval)};`,
);
return [
@@ -58,7 +58,7 @@ export const chartRouter = createTRPCRouter({
interval: zTimeInterval,
startDate: z.string().nullish(),
endDate: z.string().nullish(),
- })
+ }),
)
.query(async ({ input: { projectId, event, ...input } }) => {
const { startDate, endDate } = getChartStartEndDate(input);
@@ -66,7 +66,7 @@ export const chartRouter = createTRPCRouter({
`SELECT distinct mapKeys(properties) as keys from ${TABLE_NAMES.events} where ${
event && event !== '*' ? `name = ${escape(event)} AND ` : ''
} project_id = ${escape(projectId)} AND
- ${toDate('created_at', input.interval)} BETWEEN ${toDate(formatClickhouseDate(startDate), input.interval)} AND ${toDate(formatClickhouseDate(endDate), input.interval)};`
+ ${toDate('created_at', input.interval)} BETWEEN ${toDate(formatClickhouseDate(startDate), input.interval)} AND ${toDate(formatClickhouseDate(endDate), input.interval)};`,
);
const properties = events
@@ -93,12 +93,12 @@ export const chartRouter = createTRPCRouter({
'browser_version',
'device',
'brand',
- 'model'
+ 'model',
);
return pipe(
sort<string>((a, b) => a.length - b.length),
- uniq
+ uniq,
)(properties);
}),
@@ -112,7 +112,7 @@ export const chartRouter = createTRPCRouter({
interval: zTimeInterval,
startDate: z.string().nullish(),
endDate: z.string().nullish(),
- })
+ }),
)
.query(async ({ input: { event, property, projectId, ...input } }) => {
const { startDate, endDate } = getChartStartEndDate(input);
@@ -136,7 +136,7 @@ export const chartRouter = createTRPCRouter({
(data: typeof events) => map(prop('values'), data),
flatten,
uniq,
- sort((a, b) => a.length - b.length)
+ sort((a, b) => a.length - b.length),
)(events);
return {
@@ -166,7 +166,7 @@ export const chartRouter = createTRPCRouter({
.input(
zChartInput.extend({
step: z.number(),
- })
+ }),
)
.query(async ({ input }) => {
const currentPeriod = getChartStartEndDate(input);
diff --git a/packages/trpc/src/routers/client.ts b/packages/trpc/src/routers/client.ts
index 21cd8e0fc..95d2eba9b 100644
--- a/packages/trpc/src/routers/client.ts
+++ b/packages/trpc/src/routers/client.ts
@@ -1,10 +1,11 @@
-import crypto from 'crypto';
+import crypto from 'node:crypto';
import { z } from 'zod';
-import { hashPassword, stripTrailingSlash } from '@openpanel/common';
+import { stripTrailingSlash } from '@openpanel/common';
import type { Prisma } from '@openpanel/db';
import { db } from '@openpanel/db';
+import { hashPassword } from '@openpanel/common/server';
import { getClientAccess } from '../access';
import { TRPCAccessError } from '../errors';
import { createTRPCRouter, protectedProcedure } from '../trpc';
@@ -17,7 +18,7 @@ export const clientRouter = createTRPCRouter({
name: z.string(),
cors: z.string().nullable(),
crossDomain: z.boolean().optional(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const access = await getClientAccess({
@@ -49,7 +50,7 @@ export const clientRouter = createTRPCRouter({
cors: z.string().nullable(),
crossDomain: z.boolean().optional(),
type: z.enum(['read', 'write', 'root']).optional(),
- })
+ }),
)
.mutation(async ({ input }) => {
const secret = `sec_${crypto.randomBytes(10).toString('hex')}`;
@@ -75,7 +76,7 @@ export const clientRouter = createTRPCRouter({
.input(
z.object({
id: z.string(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const access = await getClientAccess({
diff --git a/packages/trpc/src/routers/dashboard.ts b/packages/trpc/src/routers/dashboard.ts
index 266c31c2c..daa836e6e 100644
--- a/packages/trpc/src/routers/dashboard.ts
+++ b/packages/trpc/src/routers/dashboard.ts
@@ -18,7 +18,7 @@ export const dashboardRouter = createTRPCRouter({
.input(
z.object({
projectId: z.string(),
- })
+ }),
)
.query(({ input }) => {
return getDashboardsByProjectId(input.projectId);
@@ -28,7 +28,7 @@ export const dashboardRouter = createTRPCRouter({
z.object({
name: z.string(),
projectId: z.string(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const access = await getProjectAccess({
@@ -61,7 +61,7 @@ export const dashboardRouter = createTRPCRouter({
z.object({
id: z.string(),
name: z.string(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const dashboard = await db.dashboard.findUniqueOrThrow({
@@ -93,7 +93,7 @@ export const dashboardRouter = createTRPCRouter({
z.object({
id: z.string(),
forceDelete: z.boolean().optional(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const dashboard = await db.dashboard.findUniqueOrThrow({
@@ -132,7 +132,7 @@ export const dashboardRouter = createTRPCRouter({
switch (error.code) {
case PrismaError.ForeignConstraintViolation:
throw new Error(
- 'Cannot delete dashboard with associated reports'
+ 'Cannot delete dashboard with associated reports',
);
default:
throw new Error('Unknown error deleting dashboard');
diff --git a/packages/trpc/src/routers/event.ts b/packages/trpc/src/routers/event.ts
index 33939b019..c2e0be04a 100644
--- a/packages/trpc/src/routers/event.ts
+++ b/packages/trpc/src/routers/event.ts
@@ -3,13 +3,13 @@ import { escape } from 'sqlstring';
import { z } from 'zod';
import {
+ TABLE_NAMES,
chQuery,
convertClickhouseDateToJs,
db,
getEventList,
getEvents,
getTopPages,
- TABLE_NAMES,
} from '@openpanel/db';
import { zChartEventFilter } from '@openpanel/validation';
@@ -26,7 +26,7 @@ export const eventRouter = createTRPCRouter({
icon: z.string().optional(),
color: z.string().optional(),
conversion: z.boolean().optional(),
- })
+ }),
)
.mutation(
async ({ input: { projectId, name, icon, color, conversion } }) => {
@@ -40,7 +40,7 @@ export const eventRouter = createTRPCRouter({
create: { projectId, name, icon, color, conversion },
update: { icon, color, conversion },
});
- }
+ },
),
byId: protectedProcedure
@@ -48,14 +48,14 @@ export const eventRouter = createTRPCRouter({
z.object({
id: z.string(),
projectId: z.string(),
- })
+ }),
)
.query(async ({ input: { id, projectId } }) => {
const res = await getEvents(
`SELECT * FROM ${TABLE_NAMES.events} WHERE id = ${escape(id)} AND project_id = ${escape(projectId)};`,
{
meta: true,
- }
+ },
);
if (!res?.[0]) {
@@ -81,7 +81,7 @@ export const eventRouter = createTRPCRouter({
endDate: z.date().optional(),
meta: z.boolean().optional(),
profile: z.boolean().optional(),
- })
+ }),
)
.query(async ({ input }) => {
return getEventList(input);
@@ -90,7 +90,7 @@ export const eventRouter = createTRPCRouter({
.input(
z.object({
projectId: z.string(),
- })
+ }),
)
.query(async ({ input: { projectId } }) => {
const conversions = await db.eventMeta.findMany({
@@ -109,7 +109,7 @@ export const eventRouter = createTRPCRouter({
{
profile: true,
meta: true,
- }
+ },
);
}),
@@ -119,7 +119,7 @@ export const eventRouter = createTRPCRouter({
projectId: z.string(),
cursor: z.number().optional(),
limit: z.number().default(8),
- })
+ }),
)
.query(async ({ input: { projectId, cursor, limit }, ctx }) => {
if (ctx.session.userId) {
@@ -151,12 +151,12 @@ export const eventRouter = createTRPCRouter({
path: string;
created_at: string;
}>(
- `SELECT * FROM ${TABLE_NAMES.events_bots} WHERE project_id = ${escape(projectId)} ORDER BY created_at DESC LIMIT ${limit} OFFSET ${(cursor ?? 0) * limit}`
+ `SELECT * FROM ${TABLE_NAMES.events_bots} WHERE project_id = ${escape(projectId)} ORDER BY created_at DESC LIMIT ${limit} OFFSET ${(cursor ?? 0) * limit}`,
),
chQuery<{
count: number;
}>(
- `SELECT count(*) as count FROM ${TABLE_NAMES.events_bots} WHERE project_id = ${escape(projectId)}`
+ `SELECT count(*) as count FROM ${TABLE_NAMES.events_bots} WHERE project_id = ${escape(projectId)}`,
),
]);
@@ -176,7 +176,7 @@ export const eventRouter = createTRPCRouter({
cursor: z.number().optional(),
take: z.number().default(20),
search: z.string().optional(),
- })
+ }),
)
.query(async ({ input }) => {
return getTopPages(input);
@@ -186,19 +186,19 @@ export const eventRouter = createTRPCRouter({
.input(
z.object({
projectId: z.string(),
- })
+ }),
)
.query(async ({ input }) => {
const res = await chQuery<{ origin: string }>(
`SELECT DISTINCT origin FROM ${TABLE_NAMES.events} WHERE project_id = ${escape(
- input.projectId
- )} AND origin IS NOT NULL AND origin != '' AND toDate(created_at) > now() - INTERVAL 30 DAY ORDER BY origin ASC`
+ input.projectId,
+ )} AND origin IS NOT NULL AND origin != '' AND toDate(created_at) > now() - INTERVAL 30 DAY ORDER BY origin ASC`,
);
return res.sort((a, b) =>
a.origin
.replace(/https?:\/\//, '')
- .localeCompare(b.origin.replace(/https?:\/\//, ''))
+ .localeCompare(b.origin.replace(/https?:\/\//, '')),
);
}),
});
diff --git a/packages/trpc/src/routers/onboarding.ts b/packages/trpc/src/routers/onboarding.ts
index 23c737c3b..6bbf36084 100644
--- a/packages/trpc/src/routers/onboarding.ts
+++ b/packages/trpc/src/routers/onboarding.ts
@@ -1,16 +1,17 @@
-import crypto from 'crypto';
+import crypto from 'node:crypto';
import type { z } from 'zod';
-import { hashPassword, stripTrailingSlash } from '@openpanel/common';
+import { stripTrailingSlash } from '@openpanel/common';
import { db, getId, getOrganizationBySlug, getUserById } from '@openpanel/db';
import type { ProjectType } from '@openpanel/db';
import { zOnboardingProject } from '@openpanel/validation';
+import { hashPassword } from '@openpanel/common/server';
import { createTRPCRouter, protectedProcedure } from '../trpc';
async function createOrGetOrganization(
input: z.infer<typeof zOnboardingProject>,
- userId: string
+ userId: string,
) {
if (input.organizationSlug) {
return await getOrganizationBySlug(input.organizationSlug);
diff --git a/packages/trpc/src/routers/organization.ts b/packages/trpc/src/routers/organization.ts
index 6bbbe36b5..dcf931b80 100644
--- a/packages/trpc/src/routers/organization.ts
+++ b/packages/trpc/src/routers/organization.ts
@@ -15,7 +15,7 @@ export const organizationRouter = createTRPCRouter({
z.object({
id: z.string(),
name: z.string(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const access = await getOrganizationAccess({
@@ -86,7 +86,7 @@ export const organizationRouter = createTRPCRouter({
.input(
z.object({
memberId: z.string(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const member = await db.member.findUniqueOrThrow({
@@ -107,7 +107,7 @@ export const organizationRouter = createTRPCRouter({
const invitationId = pathOr<string | undefined>(
undefined,
['meta', 'invitationId'],
- member
+ member,
);
if (invitationId) {
@@ -130,7 +130,7 @@ export const organizationRouter = createTRPCRouter({
z.object({
organizationId: z.string(),
userId: z.string(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
if (ctx.session.userId === input.userId) {
@@ -168,7 +168,7 @@ export const organizationRouter = createTRPCRouter({
userId: z.string(),
organizationSlug: z.string(),
access: z.array(z.string()),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const access = await getOrganizationAccess({
diff --git a/packages/trpc/src/routers/profile.ts b/packages/trpc/src/routers/profile.ts
index 5a34642fe..53d38fee3 100644
--- a/packages/trpc/src/routers/profile.ts
+++ b/packages/trpc/src/routers/profile.ts
@@ -3,11 +3,11 @@ import { escape } from 'sqlstring';
import { z } from 'zod';
import {
+ TABLE_NAMES,
chQuery,
createSqlBuilder,
getProfileList,
getProfiles,
- TABLE_NAMES,
} from '@openpanel/db';
import { createTRPCRouter, protectedProcedure } from '../trpc';
@@ -17,7 +17,7 @@ export const profileRouter = createTRPCRouter({
.input(z.object({ projectId: z.string() }))
.query(async ({ input: { projectId } }) => {
const events = await chQuery<{ keys: string[] }>(
- `SELECT distinct mapKeys(properties) as keys from ${TABLE_NAMES.profiles} where project_id = ${escape(projectId)};`
+ `SELECT distinct mapKeys(properties) as keys from ${TABLE_NAMES.profiles} where project_id = ${escape(projectId)};`,
);
const properties = events
@@ -30,7 +30,7 @@ export const profileRouter = createTRPCRouter({
return pipe(
sort<string>((a, b) => a.length - b.length),
- uniq
+ uniq,
)(properties);
}),
@@ -42,7 +42,7 @@ export const profileRouter = createTRPCRouter({
take: z.number().default(50),
search: z.string().optional(),
// filters: z.array(zChartEventFilter).default([]),
- })
+ }),
)
.query(async ({ input: { projectId, cursor, take, search } }) => {
return getProfileList({ projectId, cursor, take, search });
@@ -55,15 +55,15 @@ export const profileRouter = createTRPCRouter({
cursor: z.number().optional(),
take: z.number().default(50),
// filters: z.array(zChartEventFilter).default([]),
- })
+ }),
)
.query(async ({ input: { projectId, cursor, take } }) => {
const res = await chQuery<{ profile_id: string; count: number }>(
- `SELECT profile_id, count(*) as count from ${TABLE_NAMES.events} where profile_id != '' and project_id = ${escape(projectId)} group by profile_id order by count() DESC LIMIT ${take} ${cursor ? `OFFSET ${cursor * take}` : ''}`
+ `SELECT profile_id, count(*) as count from ${TABLE_NAMES.events} where profile_id != '' and project_id = ${escape(projectId)} group by profile_id order by count() DESC LIMIT ${take} ${cursor ? `OFFSET ${cursor * take}` : ''}`,
);
const profiles = await getProfiles(
res.map((r) => r.profile_id),
- projectId
+ projectId,
);
return (
res
@@ -83,7 +83,7 @@ export const profileRouter = createTRPCRouter({
z.object({
property: z.string(),
projectId: z.string(),
- })
+ }),
)
.query(async ({ input: { property, projectId } }) => {
const { sb, getSql } = createSqlBuilder();
@@ -91,7 +91,7 @@ export const profileRouter = createTRPCRouter({
sb.where.project_id = `project_id = ${escape(projectId)}`;
if (property.startsWith('properties.')) {
sb.select.values = `distinct arrayMap(x -> trim(x), mapValues(mapExtractKeyLike(properties, ${escape(
- property.replace(/^properties\./, '').replace('.*.', '.%.')
+ property.replace(/^properties\./, '').replace('.*.', '.%.'),
)}))) as values`;
} else {
sb.select.values = `${property} as values`;
@@ -103,7 +103,7 @@ export const profileRouter = createTRPCRouter({
(data: typeof profiles) => map(prop('values'), data),
flatten,
uniq,
- sort((a, b) => a.length - b.length)
+ sort((a, b) => a.length - b.length),
)(profiles);
return {
diff --git a/packages/trpc/src/routers/project.ts b/packages/trpc/src/routers/project.ts
index c9183d1a4..ca0b570ba 100644
--- a/packages/trpc/src/routers/project.ts
+++ b/packages/trpc/src/routers/project.ts
@@ -11,7 +11,7 @@ export const projectRouter = createTRPCRouter({
.input(
z.object({
organizationSlug: z.string().nullable(),
- })
+ }),
)
.query(async ({ input: { organizationSlug } }) => {
if (organizationSlug === null) return [];
@@ -23,7 +23,7 @@ export const projectRouter = createTRPCRouter({
z.object({
id: z.string(),
name: z.string(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const access = await getProjectAccess({
@@ -49,7 +49,7 @@ export const projectRouter = createTRPCRouter({
z.object({
name: z.string().min(1),
organizationSlug: z.string(),
- })
+ }),
)
.mutation(async ({ input: { name, organizationSlug } }) => {
return db.project.create({
@@ -65,7 +65,7 @@ export const projectRouter = createTRPCRouter({
.input(
z.object({
id: z.string(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const access = await getProjectAccess({
diff --git a/packages/trpc/src/routers/reference.ts b/packages/trpc/src/routers/reference.ts
index bca56abee..b45fde233 100644
--- a/packages/trpc/src/routers/reference.ts
+++ b/packages/trpc/src/routers/reference.ts
@@ -21,7 +21,7 @@ export const referenceRouter = createTRPCRouter({
date: new Date(datetime),
},
});
- }
+ },
),
delete: protectedProcedure
.input(z.object({ id: z.string() }))
@@ -54,7 +54,7 @@ export const referenceRouter = createTRPCRouter({
startDate: z.string().nullish(),
endDate: z.string().nullish(),
range: zRange,
- })
+ }),
)
.query(({ input: { projectId, ...input } }) => {
const { startDate, endDate } = getChartStartEndDate(input);
diff --git a/packages/trpc/src/routers/report.ts b/packages/trpc/src/routers/report.ts
index cc774067f..dc0eab54a 100644
--- a/packages/trpc/src/routers/report.ts
+++ b/packages/trpc/src/routers/report.ts
@@ -13,7 +13,7 @@ export const reportRouter = createTRPCRouter({
z.object({
report: zReportInput.omit({ projectId: true }),
dashboardId: z.string(),
- })
+ }),
)
.mutation(async ({ input: { report, dashboardId }, ctx }) => {
const dashboard = await db.dashboard.findUniqueOrThrow({
@@ -52,7 +52,7 @@ export const reportRouter = createTRPCRouter({
z.object({
reportId: z.string(),
report: zReportInput.omit({ projectId: true }),
- })
+ }),
)
.mutation(async ({ input: { report, reportId }, ctx }) => {
const dbReport = await db.report.findUniqueOrThrow({
@@ -91,7 +91,7 @@ export const reportRouter = createTRPCRouter({
.input(
z.object({
reportId: z.string(),
- })
+ }),
)
.mutation(async ({ input: { reportId }, ctx }) => {
const report = await db.report.findUniqueOrThrow({
diff --git a/packages/trpc/src/routers/ticket.ts b/packages/trpc/src/routers/ticket.ts
index 3f6c8fefc..0870d29e5 100644
--- a/packages/trpc/src/routers/ticket.ts
+++ b/packages/trpc/src/routers/ticket.ts
@@ -15,7 +15,7 @@ export const ticketRouter = createTRPCRouter({
subject: z.string(),
body: z.string(),
meta: z.record(z.string(), z.unknown()),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
if (!API_KEY) {
diff --git a/packages/trpc/src/routers/user.ts b/packages/trpc/src/routers/user.ts
index 08379283d..5edc6e9f1 100644
--- a/packages/trpc/src/routers/user.ts
+++ b/packages/trpc/src/routers/user.ts
@@ -11,7 +11,7 @@ export const userRouter = createTRPCRouter({
z.object({
firstName: z.string(),
lastName: z.string(),
- })
+ }),
)
.mutation(async ({ input, ctx }) => {
const [updatedUser] = await Promise.all([
diff --git a/packages/trpc/src/trpc.ts b/packages/trpc/src/trpc.ts
index 67a232049..3faf1cc3e 100644
--- a/packages/trpc/src/trpc.ts
+++ b/packages/trpc/src/trpc.ts
@@ -1,5 +1,5 @@
import { getAuth } from '@clerk/fastify';
-import { initTRPC, TRPCError } from '@trpc/server';
+import { TRPCError, initTRPC } from '@trpc/server';
import type { CreateFastifyContextOptions } from '@trpc/server/adapters/fastify';
import { has } from 'ramda';
import superjson from 'superjson';
@@ -21,10 +21,9 @@ export function createContext({ req, res }: CreateFastifyContextOptions) {
options: {
maxAge: number;
path: string;
- }
+ },
) => {
// @ts-ignore
- // eslint-disable-next-line
res.setCookie(key, value, options);
},
};
diff --git a/packages/validation/package.json b/packages/validation/package.json
index f947162f1..c9ec92d0c 100644
--- a/packages/validation/package.json
+++ b/packages/validation/package.json
@@ -3,8 +3,6 @@
"version": "0.0.1",
"main": "index.ts",
"scripts": {
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -12,20 +10,9 @@
"zod": "^3.22.4"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
"@types/node": "^18.16.0",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"prisma": "^5.1.1",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
+ }
}
diff --git a/packages/validation/src/index.ts b/packages/validation/src/index.ts
index 989215899..3392a47e3 100644
--- a/packages/validation/src/index.ts
+++ b/packages/validation/src/index.ts
@@ -10,7 +10,7 @@ import {
} from '@openpanel/constants';
export function objectToZodEnums<K extends string>(
- obj: Record<K, any>
+ obj: Record<K, any>,
): [K, ...K[]] {
const [firstKey, ...otherKeys] = Object.keys(obj) as K[];
return [firstKey!, ...otherKeys];
@@ -139,12 +139,12 @@ export const zOnboardingProject = z
data.app === false &&
data.backend === false
) {
- ['app', 'backend', 'website'].forEach((key) => {
+ for (const key of ['app', 'backend', 'website']) {
ctx.addIssue({
code: 'custom',
message: 'At least one type must be selected',
path: [key],
});
- });
+ }
}
});
diff --git a/patches/@[email protected] b/patches/@[email protected]
deleted file mode 100644
index aef1acb47..000000000
--- a/patches/@[email protected]
+++ /dev/null
@@ -1,40 +0,0 @@
-diff --git a/dist/src/queueAdapters/bullMQ.js b/dist/src/queueAdapters/bullMQ.js
-index 3e5a2e61c9600459678fda0e29397faee7db9a1e..6cf94ac4384d86d99f292c8f296d4b95ab8f2d19 100644
---- a/dist/src/queueAdapters/bullMQ.js
-+++ b/dist/src/queueAdapters/bullMQ.js
-@@ -21,11 +21,31 @@ class BullMQAdapter extends base_1.BaseAdapter {
- addJob(name, data, options) {
- return this.queue.add(name, data, options);
- }
-- getJob(id) {
-- return this.queue.getJob(id);
-+ getDelayedScoreName() {
-+ return `${this.queue.opts.prefix}:${this.queue.name}:delayed`;
-+ }
-+ transformJob(job, actualDelay) {
-+ job.opts.delay = actualDelay ? actualDelay - job.timestamp : job.delay
-+ return job
-+ }
-+ async getJob(id) {
-+ const client = await this.queue.client
-+ const job = await this.queue.getJob(id);
-+ if(job) {
-+ const score = await client.zscore(this.getDelayedScoreName(), id)
-+ return this.transformJob(job, score ? score / 0x1000 : null)
-+ }
-+ return undefined
- }
-- getJobs(jobStatuses, start, end) {
-- return this.queue.getJobs(jobStatuses, start, end);
-+ async getJobs(jobStatuses, start, end) {
-+ const jobs = await this.queue.getJobs(jobStatuses, start, end);
-+ if(jobs.length === 0) {
-+ return []
-+ }
-+ const client = await this.queue.client
-+ const scores = await client.zmscore(this.getDelayedScoreName(), jobs.filter(job => job && typeof job === 'object').map(job => job.id))
-+ const delays = jobs.map((_, i) => scores[i] !== null ? scores[i] / 0x1000 : null)
-+ return jobs.map((job, i) => this.transformJob(job, delays[i]))
- }
- getJobCounts() {
- return this.queue.getJobCounts();
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4dd0434d4..17dcaf499 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -4,11 +4,6 @@ settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
-patchedDependencies:
- '@bull-board/[email protected]':
- hash: 2tcfhzw2ff463lkb7lih3qz7qq
- path: patches/@[email protected]
-
importers:
.:
@@ -16,15 +11,9 @@ importers:
'@hyperdx/node-opentelemetry':
specifier: ^0.8.1
version: 0.8.1
- '@openpanel/prettier-config':
- specifier: ^0.1.0
- version: link:tooling/prettier
dotenv-cli:
specifier: ^7.3.0
version: 7.3.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
semver:
specifier: ^7.5.4
version: 7.6.0
@@ -34,6 +23,10 @@ importers:
winston:
specifier: ^3.14.2
version: 3.14.2
+ devDependencies:
+ '@biomejs/biome':
+ specifier: 1.9.1
+ version: 1.9.1
apps/api:
dependencies:
@@ -119,12 +112,6 @@ importers:
specifier: ^3.22.4
version: 3.22.4
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/sdk':
specifier: workspace:*
version: link:../../packages/sdks/sdk
@@ -152,12 +139,6 @@ importers:
'@types/ws':
specifier: ^8.5.10
version: 8.5.10
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
tsup:
specifier: ^7.2.0
version: 7.3.0([email protected])
@@ -357,7 +338,7 @@ importers:
specifier: ^3.0.1
version: 3.0.1
next:
- specifier: ~14.2.1
+ specifier: 14.2.1
version: 14.2.1(@opentelemetry/[email protected])([email protected])([email protected])
next-auth:
specifier: ^4.24.5
@@ -459,12 +440,6 @@ importers:
specifier: ^3.22.4
version: 3.22.4
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/trpc':
specifier: workspace:*
version: link:../../packages/trpc
@@ -504,27 +479,12 @@ importers:
'@types/sqlstring':
specifier: ^2.3.2
version: 2.3.2
- '@typescript-eslint/eslint-plugin':
- specifier: ^6.21.0
- version: 6.21.0(@typescript-eslint/[email protected])([email protected])([email protected])
- '@typescript-eslint/parser':
- specifier: ^6.21.0
autoprefixer:
specifier: ^10.4.17
version: 10.4.18([email protected])
- eslint:
- specifier: ^8.56.0
- version: 8.56.0
postcss:
specifier: ^8.4.35
version: 8.4.35
- prettier:
- specifier: ^3.2.5
- version: 3.2.5
- prettier-plugin-tailwindcss:
- specifier: ^0.5.11
- version: 0.5.11(@ianvs/[email protected])([email protected])
tailwindcss:
specifier: ^3.4.1
version: 3.4.1
@@ -550,12 +510,6 @@ importers:
specifier: 18.2.0
version: 18.2.0([email protected])
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
@@ -568,24 +522,12 @@ importers:
'@types/react-dom':
specifier: ^18.2.7
version: 18.2.19
- '@typescript-eslint/eslint-plugin':
- specifier: ^6.6.0
- version: 6.21.0(@typescript-eslint/[email protected])([email protected])([email protected])
- '@typescript-eslint/parser':
- specifier: ^6.6.0
autoprefixer:
specifier: ^10.4.18
version: 10.4.18([email protected])
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
postcss:
specifier: ^8.4.35
version: 8.4.35
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
tailwindcss:
specifier: ^3.4.1
version: 3.4.1
@@ -686,12 +628,6 @@ importers:
specifier: ^3.22.4
version: 3.22.4
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
@@ -710,27 +646,12 @@ importers:
'@types/react-syntax-highlighter':
specifier: ^15.5.9
version: 15.5.11
- '@typescript-eslint/eslint-plugin':
- specifier: ^6.6.0
- version: 6.21.0(@typescript-eslint/[email protected])([email protected])([email protected])
- '@typescript-eslint/parser':
- specifier: ^6.6.0
autoprefixer:
specifier: ^10.4.14
version: 10.4.17([email protected])
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
postcss:
specifier: ^8.4.27
version: 8.4.35
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
- prettier-plugin-tailwindcss:
- specifier: ^0.5.1
- version: 0.5.11(@ianvs/[email protected])([email protected])
tailwindcss:
specifier: ^3.3.3
version: 3.4.1
@@ -742,7 +663,7 @@ importers:
dependencies:
'@bull-board/api':
specifier: 5.21.0
- version: 5.21.0(patch_hash=2tcfhzw2ff463lkb7lih3qz7qq)(@bull-board/[email protected])
+ version: 5.21.0(@bull-board/[email protected])
'@bull-board/express':
specifier: 5.21.0
version: 5.21.0
@@ -783,12 +704,6 @@ importers:
specifier: ^9.0.1
version: 9.0.1
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
@@ -807,12 +722,6 @@ importers:
'@types/uuid':
specifier: ^9.0.8
version: 9.0.8
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
tsup:
specifier: ^7.2.0
version: 7.3.0([email protected])
@@ -850,12 +759,6 @@ importers:
'@openpanel/db':
specifier: workspace:^
version: link:../db
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/sdk':
specifier: workspace:*
version: link:../sdks/sdk
@@ -871,12 +774,6 @@ importers:
'@types/ramda':
specifier: ^0.30.1
version: 0.30.1
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
tsup:
specifier: ^7.2.0
version: 7.3.0([email protected])
@@ -911,12 +808,6 @@ importers:
specifier: ^4.7.1
version: 4.7.1
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
@@ -929,12 +820,6 @@ importers:
'@types/ramda':
specifier: ^0.29.6
version: 0.29.10
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
prisma:
specifier: ^5.1.1
version: 5.9.1
@@ -944,24 +829,12 @@ importers:
packages/constants:
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
date-fns:
specifier: ^3.3.1
version: 3.3.1
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
prisma:
specifier: ^5.1.1
version: 5.9.1
@@ -1008,12 +881,6 @@ importers:
specifier: ^9.0.1
version: 9.0.1
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
@@ -1029,12 +896,6 @@ importers:
'@types/uuid':
specifier: ^9.0.8
version: 9.0.8
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
prisma:
specifier: ^5.1.1
version: 5.9.1
@@ -1051,24 +912,12 @@ importers:
specifier: ^3.14.2
version: 3.14.2
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
date-fns:
specifier: ^3.3.1
version: 3.3.1
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
prisma:
specifier: ^5.1.1
version: 5.9.1
@@ -1088,12 +937,6 @@ importers:
specifier: ^5.8.7
version: 5.8.7
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/sdk':
specifier: workspace:*
version: link:../sdks/sdk
@@ -1103,12 +946,6 @@ importers:
'@types/node':
specifier: ^18.16.0
version: 18.19.17
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
typescript:
specifier: ^5.2.2
version: 5.3.3
@@ -1119,24 +956,12 @@ importers:
specifier: ^5.4.1
version: 5.4.1
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
'@types/node':
specifier: ^18.16.0
version: 18.19.17
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
prisma:
specifier: ^5.1.1
version: 5.9.1
@@ -1146,21 +971,9 @@ importers:
packages/sdks/_info:
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../../tooling/typescript
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
prisma:
specifier: ^5.1.1
version: 5.9.1
@@ -1180,12 +993,6 @@ importers:
specifier: ^3.3.0
version: 3.3.0
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../../tooling/typescript
@@ -1195,12 +1002,6 @@ importers:
'@types/request-ip':
specifier: ^0.0.41
version: 0.0.41
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
tsup:
specifier: ^7.2.0
version: 7.3.0([email protected])
@@ -1223,24 +1024,12 @@ importers:
specifier: ^16.8.0 || ^17.0.0 || ^18.0.0
version: 18.2.0([email protected])
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../../tooling/typescript
'@types/react':
specifier: ^18.2.20
version: 18.2.56
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
tsup:
specifier: ^7.2.0
version: 7.3.0([email protected])
@@ -1263,24 +1052,12 @@ importers:
specifier: 0.73 - 0.74
version: 0.73.6(@babel/[email protected])(@babel/[email protected])([email protected])
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../../tooling/typescript
'@types/node':
specifier: ^20.14.12
version: 20.14.12
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
tsup:
specifier: ^7.2.0
version: 7.3.0([email protected])
@@ -1290,24 +1067,12 @@ importers:
packages/sdks/sdk:
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../../tooling/typescript
'@types/node':
specifier: ^20.14.12
version: 20.14.12
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
tsup:
specifier: ^7.2.0
version: 7.3.0([email protected])
@@ -1321,24 +1086,12 @@ importers:
specifier: 1.0.0-local
version: link:../sdk
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../../tooling/typescript
'@types/node':
specifier: ^20.14.12
version: 20.14.12
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
tsup:
specifier: ^7.2.0
version: 7.3.0([email protected])
@@ -1400,12 +1153,6 @@ importers:
specifier: ^3.22.4
version: 3.22.4
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
@@ -1418,12 +1165,6 @@ importers:
'@types/sqlstring':
specifier: ^2.3.2
version: 2.3.2
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
prisma:
specifier: ^5.1.1
version: 5.9.1
@@ -1440,24 +1181,12 @@ importers:
specifier: ^3.22.4
version: 3.22.4
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../../tooling/eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../../tooling/prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
'@types/node':
specifier: ^18.16.0
version: 18.19.17
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
prisma:
specifier: ^5.1.1
version: 5.9.1
@@ -1465,80 +1194,6 @@ importers:
specifier: ^5.2.2
version: 5.3.3
- tooling/eslint:
- dependencies:
- '@next/eslint-plugin-next':
- specifier: ^14.0.4
- version: 14.1.0
- '@types/eslint':
- specifier: ^8.44.2
- version: 8.56.2
- '@typescript-eslint/eslint-plugin':
- specifier: ^6.6.0
- version: 6.21.0(@typescript-eslint/[email protected])([email protected])([email protected])
- '@typescript-eslint/parser':
- specifier: ^6.6.0
- eslint-config-next:
- specifier: ^14.0.4
- eslint-config-prettier:
- specifier: ^9.0.0
- version: 9.1.0([email protected])
- eslint-config-turbo:
- specifier: ^1.10.13
- version: 1.12.4([email protected])
- eslint-plugin-import:
- specifier: ^2.28.1
- version: 2.29.1(@typescript-eslint/[email protected])([email protected])([email protected])
- eslint-plugin-jsx-a11y:
- specifier: ^6.7.1
- version: 6.8.0([email protected])
- eslint-plugin-react:
- specifier: ^7.33.2
- version: 7.33.2([email protected])
- eslint-plugin-react-hooks:
- specifier: ^4.6.0
- version: 4.6.0([email protected])
- devDependencies:
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../prettier
- '@openpanel/tsconfig':
- specifier: workspace:*
- version: link:../typescript
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
- typescript:
- specifier: ^5.2.2
- version: 5.3.3
-
- tooling/prettier:
- dependencies:
- '@ianvs/prettier-plugin-sort-imports':
- specifier: ^4.1.0
- version: 4.1.1([email protected])
- prettier-plugin-tailwindcss:
- specifier: ^0.5.11
- version: 0.5.11(@ianvs/[email protected])([email protected])
- devDependencies:
- '@openpanel/tsconfig':
- specifier: workspace:*
- version: link:../typescript
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
- typescript:
- specifier: ^5.2.2
- version: 5.3.3
-
tooling/publish:
dependencies:
arg:
@@ -1548,30 +1203,15 @@ importers:
specifier: ^7.5.4
version: 7.6.0
devDependencies:
- '@openpanel/eslint-config':
- specifier: workspace:*
- version: link:../eslint
- '@openpanel/prettier-config':
- specifier: workspace:*
- version: link:../prettier
'@openpanel/tsconfig':
specifier: workspace:*
version: link:../typescript
- '@types/eslint':
- specifier: ^8.44.2
- version: 8.56.2
'@types/node':
specifier: ^18.16.0
version: 18.19.17
'@types/semver':
specifier: ^7.5.4
version: 7.5.7
- eslint:
- specifier: ^8.48.0
- version: 8.56.0
- prettier:
- specifier: ^3.0.3
- version: 3.2.5
typescript:
specifier: ^5.2.2
version: 5.3.3
@@ -1587,6 +1227,7 @@ packages:
/@aashutoshrathi/[email protected]:
resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==}
engines: {node: '>=0.10.0'}
+ dev: false
resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}
@@ -1598,6 +1239,7 @@ packages:
dependencies:
'@jridgewell/gen-mapping': 0.3.3
'@jridgewell/trace-mapping': 0.3.22
+ dev: false
resolution: {integrity: sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==}
@@ -1611,10 +1253,12 @@ packages:
dependencies:
'@babel/highlight': 7.23.4
chalk: 2.4.2
+ dev: false
resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==}
engines: {node: '>=6.9.0'}
+ dev: false
resolution: {integrity: sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==}
@@ -1637,6 +1281,7 @@ packages:
semver: 6.3.1
transitivePeerDependencies:
- supports-color
+ dev: false
resolution: {integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==}
@@ -1646,6 +1291,7 @@ packages:
'@jridgewell/gen-mapping': 0.3.3
'@jridgewell/trace-mapping': 0.3.22
jsesc: 2.5.2
+ dev: false
resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==}
@@ -1670,6 +1316,7 @@ packages:
browserslist: 4.23.0
lru-cache: 5.1.1
semver: 6.3.1
+ dev: false
resolution: {integrity: sha512-2XpP2XhkXzgxecPNEEK8Vz8Asj9aRxt08oKOqtiZoqV2UGZ5T+EkyP9sXQ9nwMxBIG34a7jmasVqoMop7VdPUw==}
@@ -1719,6 +1366,7 @@ packages:
resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==}
engines: {node: '>=6.9.0'}
+ dev: false
resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==}
@@ -1726,12 +1374,14 @@ packages:
dependencies:
'@babel/template': 7.23.9
'@babel/types': 7.23.9
+ dev: false
resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.23.9
+ dev: false
resolution: {integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==}
@@ -1745,6 +1395,7 @@ packages:
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.23.9
+ dev: false
resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==}
@@ -1758,6 +1409,7 @@ packages:
'@babel/helper-simple-access': 7.22.5
'@babel/helper-split-export-declaration': 7.22.6
'@babel/helper-validator-identifier': 7.22.20
+ dev: false
resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==}
@@ -1800,6 +1452,7 @@ packages:
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.23.9
+ dev: false
resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==}
@@ -1813,18 +1466,22 @@ packages:
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.23.9
+ dev: false
resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==}
engines: {node: '>=6.9.0'}
+ dev: false
resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==}
engines: {node: '>=6.9.0'}
+ dev: false
resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==}
engines: {node: '>=6.9.0'}
+ dev: false
resolution: {integrity: sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==}
@@ -1844,6 +1501,7 @@ packages:
'@babel/types': 7.23.9
transitivePeerDependencies:
- supports-color
+ dev: false
resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==}
@@ -1852,6 +1510,7 @@ packages:
'@babel/helper-validator-identifier': 7.22.20
chalk: 2.4.2
js-tokens: 4.0.0
+ dev: false
resolution: {integrity: sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==}
@@ -1859,6 +1518,7 @@ packages:
hasBin: true
dependencies:
'@babel/types': 7.23.9
+ dev: false
/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.23.3(@babel/[email protected]):
resolution: {integrity: sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ==}
@@ -3047,6 +2707,7 @@ packages:
'@babel/code-frame': 7.23.5
'@babel/parser': 7.23.9
'@babel/types': 7.23.9
+ dev: false
resolution: {integrity: sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==}
@@ -3064,6 +2725,7 @@ packages:
globals: 11.12.0
transitivePeerDependencies:
- supports-color
+ dev: false
resolution: {integrity: sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==}
@@ -3072,12 +2734,101 @@ packages:
'@babel/helper-string-parser': 7.23.4
'@babel/helper-validator-identifier': 7.22.20
to-fast-properties: 2.0.0
+ dev: false
+
+ /@biomejs/[email protected]:
+ resolution: {integrity: sha512-Ps0Rg0zg3B1zpx+zQHMz5b0n0PBNCAaXttHEDTVrJD5YXR6Uj3T+abTDgeS3wsu4z5i2whqcE1lZxGyWH4bZYg==}
+ engines: {node: '>=14.21.3'}
+ hasBin: true
+ requiresBuild: true
+ optionalDependencies:
+ '@biomejs/cli-darwin-arm64': 1.9.1
+ '@biomejs/cli-darwin-x64': 1.9.1
+ '@biomejs/cli-linux-arm64': 1.9.1
+ '@biomejs/cli-linux-arm64-musl': 1.9.1
+ '@biomejs/cli-linux-x64': 1.9.1
+ '@biomejs/cli-linux-x64-musl': 1.9.1
+ '@biomejs/cli-win32-arm64': 1.9.1
+ '@biomejs/cli-win32-x64': 1.9.1
+ dev: true
+
+ /@biomejs/[email protected]:
+ resolution: {integrity: sha512-js0brHswq/BoeKgfSEUJYOjUOlML6p65Nantti+PsoQ61u9+YVGIZ7325LK7iUpDH8KVJT+Bx7K2b/6Q//W1Pw==}
+ engines: {node: '>=14.21.3'}
+ cpu: [arm64]
+ os: [darwin]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/[email protected]:
+ resolution: {integrity: sha512-2zVyjUg5rN0k8XrytkubQWLbp2r/AS5wPhXs4vgVjvqbLnzo32EGX8p61gzroF2dH9DCUCfskdrigCGqNdEbpg==}
+ engines: {node: '>=14.21.3'}
+ cpu: [x64]
+ os: [darwin]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/[email protected]:
+ resolution: {integrity: sha512-L/JmXKvhsZ1lTgqOr3tWkzuY/NRppdIscHeC9aaiR72WjnBgJS94mawl9BWmGB3aWBc0q6oSDWnBS7617EMMmA==}
+ engines: {node: '>=14.21.3'}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/[email protected]:
+ resolution: {integrity: sha512-QgxwfnG+r2aer5RNGR67Ey91Tv7xXW8E9YckHhwuyWjdLEvKWkrSJrhVG/6ub0kVvTSNkYOuT/7/jMOFBuUbRA==}
+ engines: {node: '>=14.21.3'}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/[email protected]:
+ resolution: {integrity: sha512-gY+eFLIAW45v3WicQHicvjRfA0ntMZHx7h937bXwBMFNFoKmB6rMi6+fKQ6/hiS6juhsFxZdZIz20m15s49J6A==}
+ engines: {node: '>=14.21.3'}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/[email protected]:
+ resolution: {integrity: sha512-F0INygtzI2L2n2R1KtYHGr3YWDt9Up1zrUluwembM+iJ1dXN3qzlSb7deFUsSJm4FaIPriqs6Xa56ukdQW6UeQ==}
+ engines: {node: '>=14.21.3'}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/[email protected]:
+ resolution: {integrity: sha512-7Jahxar3OB+aTPOgXisMJmMKMsjcK+UmdlG3UIOQjzN/ZFEsPV+GT3bfrVjZDQaCw/zes0Cqd7VTWFjFTC/+MQ==}
+ engines: {node: '>=14.21.3'}
+ cpu: [arm64]
+ os: [win32]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/[email protected]:
+ resolution: {integrity: sha512-liSRWjWzFhyG7s1jg/Bbv9FL+ha/CEd5tFO3+dFIJNplL4TnvAivtyfRVi/tu/pNjISbV1k9JwdBewtAKAgA0w==}
+ engines: {node: '>=14.21.3'}
+ cpu: [x64]
+ os: [win32]
+ requiresBuild: true
+ dev: true
+ optional: true
/@braintree/[email protected]:
resolution: {integrity: sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==}
dev: false
- /@bull-board/[email protected](patch_hash=2tcfhzw2ff463lkb7lih3qz7qq)(@bull-board/[email protected]):
+ /@bull-board/[email protected](@bull-board/[email protected]):
resolution: {integrity: sha512-27tjptwgRgP1G5jT+POjiZZOP3LgdIM4XdfEWfa6t5E0CYImL4EjmdiFo5lhbHhYKZ842VhIpHuNcPk8nY3K9A==}
peerDependencies:
'@bull-board/ui': 5.21.0
@@ -3085,12 +2836,11 @@ packages:
'@bull-board/ui': 5.21.0
redis-info: 3.1.0
dev: false
- patched: true
/@bull-board/[email protected]:
resolution: {integrity: sha512-iBPBJq8KYebYrN4YvdSvEfOxjYYJfWycilAfNDSikyI3rJKOBRq34BmDnQj6Jn1ytssBb+vvZ35+bCSbbhFB3w==}
dependencies:
- '@bull-board/api': 5.21.0(patch_hash=2tcfhzw2ff463lkb7lih3qz7qq)(@bull-board/[email protected])
+ '@bull-board/api': 5.21.0(@bull-board/[email protected])
'@bull-board/ui': 5.21.0
ejs: 3.1.10
express: 4.19.2
@@ -3101,7 +2851,7 @@ packages:
/@bull-board/[email protected]:
resolution: {integrity: sha512-eH8QQwIHgCXxNEmlg9EZr3fSvno/bdbgBGfSQO5s9c9n9eDEaKX46ambKSPvgFPtwSdiV1AYQEa/3fGSebVIxg==}
dependencies:
- '@bull-board/api': 5.21.0(patch_hash=2tcfhzw2ff463lkb7lih3qz7qq)(@bull-board/[email protected])
+ '@bull-board/api': 5.21.0(@bull-board/[email protected])
dev: false
@@ -3566,17 +3316,19 @@ packages:
dependencies:
eslint: 8.56.0
eslint-visitor-keys: 3.4.3
+ dev: false
/@eslint-community/[email protected]:
resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==}
engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
+ dev: false
resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
ajv: 6.12.6
- debug: 4.3.4
+ debug: 4.3.7
espree: 9.6.1
globals: 13.24.0
ignore: 5.3.1
@@ -3586,10 +3338,12 @@ packages:
strip-json-comments: 3.1.1
transitivePeerDependencies:
- supports-color
+ dev: false
resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dev: false
resolution: {integrity: sha512-Ydf4LidRB/EBI+YrB+cVLqIseiRfjUI/AeHBgjGMtq3GroraDu81OV7zqophRgupngoL3iS3JUMDMnxO7g39qA==}
@@ -4106,19 +3860,24 @@ packages:
/@humanwhocodes/[email protected]:
resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==}
engines: {node: '>=10.10.0'}
+ deprecated: Use @eslint/config-array instead
dependencies:
'@humanwhocodes/object-schema': 2.0.2
- debug: 4.3.4
+ debug: 4.3.7
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
+ dev: false
/@humanwhocodes/[email protected]:
resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==}
engines: {node: '>=12.22'}
+ dev: false
/@humanwhocodes/[email protected]:
resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==}
+ deprecated: Use @eslint/object-schema instead
+ dev: false
/@hyperdx/[email protected](@opentelemetry/[email protected]):
resolution: {integrity: sha512-Jgk7JY5J07Mq9fgXApGVhSkS4+WdzzRcWLReAZhxgo46KShxE6w614mFqUSnuo+z6ghlehsy4ForViUfxrFyew==}
@@ -4196,25 +3955,6 @@ packages:
- supports-color
dev: false
- resolution: {integrity: sha512-kJhXq63ngpTQ2dxgf5GasbPJWsJA3LgoOdd7WGhpUSzLgLgI4IsIzYkbJf9kmpOHe7Vdm/o3PcRA3jmizXUuAQ==}
- peerDependencies:
- '@vue/compiler-sfc': '>=3.0.0'
- prettier: 2 || 3
- peerDependenciesMeta:
- '@vue/compiler-sfc':
- optional: true
- dependencies:
- '@babel/core': 7.23.9
- '@babel/generator': 7.23.6
- '@babel/parser': 7.23.9
- '@babel/traverse': 7.23.9
- '@babel/types': 7.23.9
- prettier: 3.2.5
- semver: 7.6.0
- transitivePeerDependencies:
- - supports-color
-
resolution: {integrity: sha512-itHBs1rPmsmGF9p4qRe++CzCgd+kFYktnsoR1sbIAfsRMrJZau0Tt1AH9KVnufc2/tU02Gf6Ibujx+15qRE03w==}
engines: {glibc: '>=2.26', node: ^18.17.0 || ^20.3.0 || >=21.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0', yarn: '>=3.2.0'}
@@ -4753,12 +4493,6 @@ packages:
glob: 7.1.7
dev: false
- resolution: {integrity: sha512-x4FavbNEeXx/baD/zC/SdrvkjSby8nBn8KcCREqk6UuwvwoAPZmaV8TFCAuo/cpovBRTIY67mHhe86MQQm/68Q==}
- dependencies:
- glob: 10.3.10
- dev: false
-
resolution: {integrity: sha512-nUDn7TOGcIeyQni6lZHfzNoo9S0euXnu0jhsbMOmMJUBfgsnESdjN97kM7cBqQxZa8L/bM9om/S5/1dzCrW6wQ==}
engines: {node: '>= 10'}
@@ -8452,12 +8186,6 @@ packages:
'@types/ms': 0.7.34
dev: false
- resolution: {integrity: sha512-uQDwm1wFHmbBbCZCqAlq6Do9LYwByNZHWzXppSnay9SuwJ+VRbjkbLABer54kcPnMSlG6Fdiy2yaFXm/z9Z5gw==}
- dependencies:
- '@types/estree': 1.0.5
- '@types/json-schema': 7.0.15
-
resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==}
dependencies:
@@ -8532,9 +8260,6 @@ packages:
resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==}
dev: false
- resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
-
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
dev: false
@@ -8738,6 +8463,7 @@ packages:
resolution: {integrity: sha512-/wdoPq1QqkSj9/QOeKkFquEuPzQbHTWAMPH/PaUMB+JuR31lXhlWXRZ52IpfDYVlDOUBvX09uBrPwxGT1hjNBg==}
+ dev: true
resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==}
@@ -8816,34 +8542,6 @@ packages:
'@types/yargs-parser': 21.0.3
dev: false
- /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]):
- resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==}
- engines: {node: ^16.0.0 || >=18.0.0}
- peerDependencies:
- '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha
- eslint: ^7.0.0 || ^8.0.0
- typescript: '*'
- peerDependenciesMeta:
- typescript:
- optional: true
- dependencies:
- '@eslint-community/regexpp': 4.10.0
- '@typescript-eslint/parser': 6.21.0([email protected])([email protected])
- '@typescript-eslint/scope-manager': 6.21.0
- '@typescript-eslint/type-utils': 6.21.0([email protected])([email protected])
- '@typescript-eslint/utils': 6.21.0([email protected])([email protected])
- '@typescript-eslint/visitor-keys': 6.21.0
- debug: 4.3.4
- eslint: 8.56.0
- graphemer: 1.4.0
- ignore: 5.3.1
- natural-compare: 1.4.0
- semver: 7.6.0
- ts-api-utils: 1.2.1([email protected])
- typescript: 5.3.3
- transitivePeerDependencies:
- - supports-color
-
resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -8864,26 +8562,6 @@ packages:
- supports-color
dev: false
- resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==}
- engines: {node: ^16.0.0 || >=18.0.0}
- peerDependencies:
- eslint: ^7.0.0 || ^8.0.0
- typescript: '*'
- peerDependenciesMeta:
- typescript:
- optional: true
- dependencies:
- '@typescript-eslint/scope-manager': 6.21.0
- '@typescript-eslint/types': 6.21.0
- '@typescript-eslint/typescript-estree': 6.21.0([email protected])
- '@typescript-eslint/visitor-keys': 6.21.0
- debug: 4.3.4
- eslint: 8.56.0
- typescript: 5.3.3
- transitivePeerDependencies:
- - supports-color
-
/@typescript-eslint/[email protected]:
resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -8892,41 +8570,11 @@ packages:
'@typescript-eslint/visitor-keys': 5.62.0
dev: false
- /@typescript-eslint/[email protected]:
- resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==}
- engines: {node: ^16.0.0 || >=18.0.0}
- dependencies:
- '@typescript-eslint/types': 6.21.0
- '@typescript-eslint/visitor-keys': 6.21.0
-
- resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==}
- engines: {node: ^16.0.0 || >=18.0.0}
- peerDependencies:
- eslint: ^7.0.0 || ^8.0.0
- typescript: '*'
- peerDependenciesMeta:
- typescript:
- optional: true
- dependencies:
- '@typescript-eslint/typescript-estree': 6.21.0([email protected])
- '@typescript-eslint/utils': 6.21.0([email protected])([email protected])
- debug: 4.3.4
- eslint: 8.56.0
- ts-api-utils: 1.2.1([email protected])
- typescript: 5.3.3
- transitivePeerDependencies:
- - supports-color
-
/@typescript-eslint/[email protected]:
resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: false
- /@typescript-eslint/[email protected]:
- resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==}
- engines: {node: ^16.0.0 || >=18.0.0}
-
/@typescript-eslint/[email protected]([email protected]):
resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -8935,57 +8583,18 @@ packages:
peerDependenciesMeta:
typescript:
optional: true
- dependencies:
- '@typescript-eslint/types': 5.62.0
- '@typescript-eslint/visitor-keys': 5.62.0
- debug: 4.3.4
- globby: 11.1.0
- is-glob: 4.0.3
- semver: 7.6.0
- tsutils: 3.21.0([email protected])
- typescript: 5.3.3
- transitivePeerDependencies:
- - supports-color
- dev: false
-
- /@typescript-eslint/[email protected]([email protected]):
- resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==}
- engines: {node: ^16.0.0 || >=18.0.0}
- peerDependencies:
- typescript: '*'
- peerDependenciesMeta:
- typescript:
- optional: true
- dependencies:
- '@typescript-eslint/types': 6.21.0
- '@typescript-eslint/visitor-keys': 6.21.0
- debug: 4.3.4
- globby: 11.1.0
- is-glob: 4.0.3
- minimatch: 9.0.3
- semver: 7.6.0
- ts-api-utils: 1.2.1([email protected])
- typescript: 5.3.3
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==}
- engines: {node: ^16.0.0 || >=18.0.0}
- peerDependencies:
- eslint: ^7.0.0 || ^8.0.0
- dependencies:
- '@eslint-community/eslint-utils': 4.4.0([email protected])
- '@types/json-schema': 7.0.15
- '@types/semver': 7.5.7
- '@typescript-eslint/scope-manager': 6.21.0
- '@typescript-eslint/types': 6.21.0
- '@typescript-eslint/typescript-estree': 6.21.0([email protected])
- eslint: 8.56.0
+ dependencies:
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/visitor-keys': 5.62.0
+ debug: 4.3.4
+ globby: 11.1.0
+ is-glob: 4.0.3
semver: 7.6.0
+ tsutils: 3.21.0([email protected])
+ typescript: 5.3.3
transitivePeerDependencies:
- supports-color
- - typescript
+ dev: false
/@typescript-eslint/[email protected]:
resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==}
@@ -8995,15 +8604,9 @@ packages:
eslint-visitor-keys: 3.4.3
dev: false
- /@typescript-eslint/[email protected]:
- resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==}
- engines: {node: ^16.0.0 || >=18.0.0}
- dependencies:
- '@typescript-eslint/types': 6.21.0
- eslint-visitor-keys: 3.4.3
-
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
+ dev: false
resolution: {integrity: sha512-PUxhtBh7/8167HJK6WqBv6Z0piuiaZHQGYbhwpNL9aIQmLROPEdaUYkY4wh45wPQXcTpnd11l0q3Pw+TI11pdw==}
@@ -9072,11 +8675,13 @@ packages:
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
acorn: 8.11.3
+ dev: false
resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==}
engines: {node: '>=0.4.0'}
hasBin: true
+ dev: false
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
@@ -9122,6 +8727,7 @@ packages:
fast-json-stable-stringify: 2.1.0
json-schema-traverse: 0.4.1
uri-js: 4.4.1
+ dev: false
resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==}
@@ -9173,6 +8779,7 @@ packages:
engines: {node: '>=4'}
dependencies:
color-convert: 1.9.3
+ dev: false
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
@@ -9243,6 +8850,7 @@ packages:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
+ dev: false
resolution: {integrity: sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==}
@@ -9706,6 +9314,7 @@ packages:
dependencies:
balanced-match: 1.0.2
concat-map: 0.0.1
+ dev: false
resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
@@ -9880,6 +9489,7 @@ packages:
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
engines: {node: '>=6'}
+ dev: false
resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}
@@ -9922,6 +9532,7 @@ packages:
ansi-styles: 3.2.1
escape-string-regexp: 1.0.5
supports-color: 5.5.0
+ dev: false
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
@@ -9929,6 +9540,7 @@ packages:
dependencies:
ansi-styles: 4.3.0
supports-color: 7.2.0
+ dev: false
resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==}
@@ -10167,6 +9779,7 @@ packages:
resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
dependencies:
color-name: 1.1.3
+ dev: false
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
@@ -10176,6 +9789,7 @@ packages:
resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==}
+ dev: false
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
@@ -10300,6 +9914,7 @@ packages:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
+ dev: false
resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==}
@@ -10331,6 +9946,7 @@ packages:
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
+ dev: false
resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==}
@@ -10892,6 +10508,7 @@ packages:
optional: true
dependencies:
ms: 2.1.2
+ dev: false
resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==}
@@ -10903,7 +10520,6 @@ packages:
optional: true
dependencies:
ms: 2.1.3
- dev: false
resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}
@@ -10948,6 +10564,7 @@ packages:
resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
+ dev: false
resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
@@ -11103,6 +10720,7 @@ packages:
engines: {node: '>=6.0.0'}
dependencies:
esutils: 2.0.3
+ dev: false
resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==}
@@ -11276,14 +10894,6 @@ packages:
once: 1.4.0
dev: false
- resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==}
- engines: {node: '>=10.13.0'}
- dependencies:
- graceful-fs: 4.2.11
- tapable: 2.2.1
- dev: false
-
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
engines: {node: '>=0.12'}
@@ -11482,6 +11092,7 @@ packages:
resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}
engines: {node: '>=0.8.0'}
+ dev: false
resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==}
@@ -11491,6 +11102,7 @@ packages:
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
engines: {node: '>=10'}
+ dev: false
resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==}
@@ -11535,31 +11147,6 @@ packages:
- supports-color
dev: false
- resolution: {integrity: sha512-SBX2ed7DoRFXC6CQSLc/SbLY9Ut6HxNB2wPTcoIWjUMd7aF7O/SIE7111L8FdZ9TXsNV4pulUDnfthpyPtbFUg==}
- peerDependencies:
- eslint: ^7.23.0 || ^8.0.0
- typescript: '>=3.3.1'
- peerDependenciesMeta:
- typescript:
- optional: true
- dependencies:
- '@next/eslint-plugin-next': 14.1.0
- '@rushstack/eslint-patch': 1.7.2
- '@typescript-eslint/parser': 6.21.0([email protected])([email protected])
- eslint: 8.56.0
- eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])
- eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])([email protected])
- eslint-plugin-jsx-a11y: 6.8.0([email protected])
- eslint-plugin-react: 7.33.2([email protected])
- eslint-plugin-react-hooks: 4.6.0([email protected])
- typescript: 5.3.3
- transitivePeerDependencies:
- - eslint-import-resolver-webpack
- - supports-color
- dev: false
-
resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==}
hasBin: true
@@ -11569,24 +11156,6 @@ packages:
eslint: 8.56.0
dev: false
- resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==}
- hasBin: true
- peerDependencies:
- eslint: '>=7.0.0'
- dependencies:
- eslint: 8.56.0
- dev: false
-
- resolution: {integrity: sha512-5hqEaV6PNmAYLL4RTmq74OcCt8pgzOLnfDVPG/7PUXpQ0Mpz0gr926oCSFukywKKXjdum3VHD84S7Z9A/DqTAw==}
- peerDependencies:
- eslint: '>6.6.0'
- dependencies:
- eslint: 8.56.0
- eslint-plugin-turbo: 1.12.4([email protected])
- dev: false
-
resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==}
dependencies:
@@ -11615,30 +11184,7 @@ packages:
- supports-color
dev: false
- resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==}
- engines: {node: ^14.18.0 || >=16.0.0}
- peerDependencies:
- eslint: '*'
- eslint-plugin-import: '*'
- dependencies:
- debug: 4.3.4
- enhanced-resolve: 5.15.0
- eslint: 8.56.0
- eslint-module-utils: 2.8.0(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])
- eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])([email protected])
- fast-glob: 3.3.2
- get-tsconfig: 4.7.2
- is-core-module: 2.13.1
- is-glob: 4.0.3
- transitivePeerDependencies:
- - '@typescript-eslint/parser'
- - eslint-import-resolver-node
- - eslint-import-resolver-webpack
- - supports-color
- dev: false
-
resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==}
engines: {node: '>=4'}
peerDependencies:
@@ -11659,11 +11205,11 @@ packages:
eslint-import-resolver-webpack:
optional: true
dependencies:
- '@typescript-eslint/parser': 6.21.0([email protected])([email protected])
+ '@typescript-eslint/parser': 5.62.0([email protected])([email protected])
debug: 3.2.7
eslint: 8.56.0
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])
+ eslint-import-resolver-typescript: 2.7.1([email protected])([email protected])
transitivePeerDependencies:
- supports-color
dev: false
@@ -11687,42 +11233,7 @@ packages:
doctrine: 2.1.0
eslint: 8.56.0
eslint-import-resolver-node: 0.3.9
- eslint-module-utils: 2.8.0(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])
- hasown: 2.0.1
- is-core-module: 2.13.1
- is-glob: 4.0.3
- minimatch: 3.1.2
- object.fromentries: 2.0.7
- object.groupby: 1.0.2
- object.values: 1.1.7
- semver: 6.3.1
- tsconfig-paths: 3.15.0
- transitivePeerDependencies:
- - eslint-import-resolver-typescript
- - eslint-import-resolver-webpack
- - supports-color
- dev: false
-
- resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==}
- engines: {node: '>=4'}
- peerDependencies:
- '@typescript-eslint/parser': '*'
- eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8
- peerDependenciesMeta:
- '@typescript-eslint/parser':
- optional: true
- dependencies:
- '@typescript-eslint/parser': 6.21.0([email protected])([email protected])
- array-includes: 3.1.7
- array.prototype.findlastindex: 1.2.4
- array.prototype.flat: 1.3.2
- array.prototype.flatmap: 1.3.2
- debug: 3.2.7
- doctrine: 2.1.0
- eslint: 8.56.0
- eslint-import-resolver-node: 0.3.9
- eslint-module-utils: 2.8.0(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])
+ eslint-module-utils: 2.8.0(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])
hasown: 2.0.1
is-core-module: 2.13.1
is-glob: 4.0.3
@@ -11820,25 +11331,18 @@ packages:
string.prototype.matchall: 4.0.10
dev: false
- resolution: {integrity: sha512-3AGmXvH7E4i/XTWqBrcgu+G7YKZJV/8FrEn79kTd50ilNsv+U3nS2IlcCrQB6Xm2m9avGD9cadLzKDR1/UF2+g==}
- peerDependencies:
- eslint: '>6.6.0'
- dependencies:
- dotenv: 16.0.3
- eslint: 8.56.0
- dev: false
-
resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
esrecurse: 4.3.0
estraverse: 5.3.0
+ dev: false
resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dev: false
resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==}
@@ -11856,7 +11360,7 @@ packages:
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.3
- debug: 4.3.4
+ debug: 4.3.7
doctrine: 3.0.0
escape-string-regexp: 4.0.0
eslint-scope: 7.2.2
@@ -11885,6 +11389,7 @@ packages:
text-table: 0.2.0
transitivePeerDependencies:
- supports-color
+ dev: false
resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==}
@@ -11893,6 +11398,7 @@ packages:
acorn: 8.11.3
acorn-jsx: 5.3.2([email protected])
eslint-visitor-keys: 3.4.3
+ dev: false
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
@@ -11905,16 +11411,19 @@ packages:
engines: {node: '>=0.10'}
dependencies:
estraverse: 5.3.0
+ dev: false
resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
engines: {node: '>=4.0'}
dependencies:
estraverse: 5.3.0
+ dev: false
resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
engines: {node: '>=4.0'}
+ dev: false
resolution: {integrity: sha512-+5Ba/xGGS6mnwFbXIuQiDPTbuTxuMCooq3arVv7gPZtYpjp+VXH/NkHAP35OOefPhNG/UGqU3vt/LTABwcHX0w==}
@@ -11965,6 +11474,7 @@ packages:
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
engines: {node: '>=0.10.0'}
+ dev: false
resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
@@ -12244,6 +11754,7 @@ packages:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
+ dev: false
resolution: {integrity: sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==}
@@ -12262,6 +11773,7 @@ packages:
resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
+ dev: false
resolution: {integrity: sha512-7Nnm9UPa7SfHRbHVA1kJQrGXCRzB7LMlAAqHXQFkEQqueJm1V8owm0FsE/2Do55/4CcdhwiLQERaKomOnKQkyA==}
@@ -12277,6 +11789,7 @@ packages:
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
+ dev: false
resolution: {integrity: sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==}
@@ -12405,6 +11918,7 @@ packages:
engines: {node: ^10.12.0 || >=12.0.0}
dependencies:
flat-cache: 3.2.0
+ dev: false
resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==}
@@ -12487,6 +12001,7 @@ packages:
dependencies:
locate-path: 6.0.0
path-exists: 4.0.0
+ dev: false
resolution: {integrity: sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==}
@@ -12505,9 +12020,11 @@ packages:
flatted: 3.2.9
keyv: 4.5.4
rimraf: 3.0.2
+ dev: false
resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==}
+ dev: false
resolution: {integrity: sha512-c5o/+Um8aqCSOXGcZoqZOm+NqtVwNsvVpWv6lfmSclU954O3wvQKxxK8zj74fPaSJbXpSLTs4PRhh+wnoCXnKg==}
@@ -12666,6 +12183,7 @@ packages:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
+ dev: false
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
@@ -12743,6 +12261,7 @@ packages:
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
engines: {node: '>=6.9.0'}
+ dev: false
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
@@ -12795,12 +12314,6 @@ packages:
get-intrinsic: 1.2.4
dev: false
- resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==}
- dependencies:
- resolve-pkg-maps: 1.0.0
- dev: false
-
resolution: {integrity: sha512-7yetJWqbS9sbn0vIfliPsFgoXMKn/YMF+Wuiog97x+urnSRRRZ7xB+uVkwGKzRgq9CDFfMQnE9ruL5DHv9c6Xg==}
engines: {node: '>=6'}
@@ -12839,18 +12352,6 @@ packages:
resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==}
dev: false
- resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==}
- engines: {node: '>=16 || 14 >=14.17'}
- hasBin: true
- dependencies:
- foreground-child: 3.1.1
- jackspeak: 2.3.6
- minimatch: 9.0.3
- minipass: 7.0.4
- path-scurry: 1.10.1
- dev: false
-
resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==}
hasBin: true
@@ -12909,16 +12410,19 @@ packages:
minimatch: 3.1.2
once: 1.4.0
path-is-absolute: 1.0.1
+ dev: false
resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==}
engines: {node: '>=4'}
+ dev: false
resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}
engines: {node: '>=8'}
dependencies:
type-fest: 0.20.2
+ dev: false
resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==}
@@ -12950,6 +12454,7 @@ packages:
resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
+ dev: false
resolution: {integrity: sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==}
@@ -12996,10 +12501,12 @@ packages:
resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
engines: {node: '>=4'}
+ dev: false
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
engines: {node: '>=8'}
+ dev: false
resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==}
@@ -13342,6 +12849,7 @@ packages:
dependencies:
parent-module: 1.0.1
resolve-from: 4.0.0
+ dev: false
resolution: {integrity: sha512-Lk+qzWmiQuRPPulGQeK5qq0v32k2bHnWrRPFgqyvhw7Kkov5L6MOLOIU3pcWeujc9W4q54Cp3Q2WV16eQkc7Bg==}
@@ -13355,6 +12863,7 @@ packages:
resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
engines: {node: '>=0.8.19'}
+ dev: false
resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==}
@@ -13371,9 +12880,11 @@ packages:
dependencies:
once: 1.4.0
wrappy: 1.0.2
+ dev: false
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
+ dev: false
resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
@@ -13686,6 +13197,7 @@ packages:
resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}
engines: {node: '>=8'}
+ dev: false
resolution: {integrity: sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==}
@@ -13836,15 +13348,6 @@ packages:
set-function-name: 2.0.1
dev: false
- resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==}
- engines: {node: '>=14'}
- dependencies:
- '@isaacs/cliui': 8.0.2
- optionalDependencies:
- '@pkgjs/parseargs': 0.11.0
- dev: false
-
resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==}
dependencies:
@@ -13986,6 +13489,7 @@ packages:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
+ dev: false
resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
@@ -14000,6 +13504,7 @@ packages:
hasBin: true
dependencies:
argparse: 2.0.1
+ dev: false
resolution: {integrity: sha512-rS46PvsjYmdmuz1OAWXY/1kCYG7pnf1TBqeTiOJr1iDz7s5DLxxC9n/ZMknLDxzYzNVfI7R95MH10emSSG1Wuw==}
@@ -14048,6 +13553,7 @@ packages:
resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==}
engines: {node: '>=4'}
hasBin: true
+ dev: false
resolution: {integrity: sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==}
@@ -14057,6 +13563,7 @@ packages:
resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
+ dev: false
resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==}
@@ -14084,6 +13591,7 @@ packages:
resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
+ dev: false
resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
@@ -14091,6 +13599,7 @@ packages:
resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
+ dev: false
resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
@@ -14107,6 +13616,7 @@ packages:
resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
engines: {node: '>=6'}
hasBin: true
+ dev: false
resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==}
@@ -14185,6 +13695,7 @@ packages:
resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==}
dependencies:
json-buffer: 3.0.1
+ dev: false
resolution: {integrity: sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==}
@@ -14235,6 +13746,7 @@ packages:
dependencies:
prelude-ls: 1.2.1
type-check: 0.4.0
+ dev: false
resolution: {integrity: sha512-qkFCeloXCOMpmEdZ/MV91P8AT4fjwFXWaAFz3lUeStM8RcoM1ks4J/F8r1b3r6y/H4u3ACEJ1T+Gv5bopj7oDA==}
@@ -14377,6 +13889,7 @@ packages:
engines: {node: '>=10'}
dependencies:
p-locate: 5.0.0
+ dev: false
resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
@@ -14558,12 +14071,14 @@ packages:
resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
dependencies:
yallist: 3.1.1
+ dev: false
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
dependencies:
yallist: 4.0.0
+ dev: false
resolution: {integrity: sha512-rTXZFILl2Y4d1SG9p1Mdcf17AcPvPvpc/egFIzUrp7IUy60MUQo3Oi1mu8LGYXUVwuRZYsSMt3csHRW5mAovJg==}
@@ -15574,6 +15089,7 @@ packages:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
dependencies:
brace-expansion: 1.1.11
+ dev: false
resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
@@ -15582,12 +15098,6 @@ packages:
brace-expansion: 2.0.1
dev: false
- resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==}
- engines: {node: '>=16 || 14 >=14.17'}
- dependencies:
- brace-expansion: 2.0.1
-
resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==}
engines: {node: '>=16 || 14 >=14.17'}
@@ -15631,11 +15141,6 @@ packages:
engines: {node: '>=8'}
dev: false
- resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==}
- engines: {node: '>=16 || 14 >=14.17'}
- dev: false
-
resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}
engines: {node: '>=16 || 14 >=14.17'}
@@ -15686,10 +15191,10 @@ packages:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
+ dev: false
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
- dev: false
resolution: {integrity: sha512-SdzXp4kD/Qf8agZ9+iTu6eql0m3kWm1A2y1hkpTeVNENutaB0BwHlSvAIaMxwntmRUAUjon2V4L8Z/njd0Ct8A==}
@@ -15749,6 +15254,7 @@ packages:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
+ dev: false
resolution: {integrity: sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==}
@@ -16286,6 +15792,7 @@ packages:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
dependencies:
wrappy: 1.0.2
+ dev: false
resolution: {integrity: sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==}
@@ -16349,6 +15856,7 @@ packages:
levn: 0.4.1
prelude-ls: 1.2.1
type-check: 0.4.0
+ dev: false
resolution: {integrity: sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg==}
@@ -16412,6 +15920,7 @@ packages:
engines: {node: '>=10'}
dependencies:
yocto-queue: 0.1.0
+ dev: false
resolution: {integrity: sha512-H0jc0q1vOzlEk0TqAKXKZxdl7kX3OFUzCnNVUnq5Pc3DGo0kpeaMuPqxQn235HibwBEb0/pm9dgKTjXy66fBkg==}
@@ -16439,6 +15948,7 @@ packages:
engines: {node: '>=10'}
dependencies:
p-limit: 3.1.0
+ dev: false
resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==}
@@ -16460,6 +15970,7 @@ packages:
engines: {node: '>=6'}
dependencies:
callsites: 3.1.0
+ dev: false
resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==}
@@ -16549,10 +16060,12 @@ packages:
resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
engines: {node: '>=8'}
+ dev: false
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
engines: {node: '>=0.10.0'}
+ dev: false
resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==}
@@ -16566,14 +16079,6 @@ packages:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
- resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==}
- engines: {node: '>=16 || 14 >=14.17'}
- dependencies:
- lru-cache: 10.2.0
- minipass: 7.1.2
- dev: false
-
resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==}
engines: {node: '>=16 || 14 >=14.18'}
@@ -16828,63 +16333,7 @@ packages:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'}
-
- resolution: {integrity: sha512-AvI/DNyMctyyxGOjyePgi/gqj5hJYClZ1avtQvLlqMT3uDZkRbi4HhGUpok3DRzv9z7Lti85Kdj3s3/1CeNI0w==}
- engines: {node: '>=14.21.3'}
- peerDependencies:
- '@ianvs/prettier-plugin-sort-imports': '*'
- '@prettier/plugin-pug': '*'
- '@shopify/prettier-plugin-liquid': '*'
- '@trivago/prettier-plugin-sort-imports': '*'
- prettier: ^3.0
- prettier-plugin-astro: '*'
- prettier-plugin-css-order: '*'
- prettier-plugin-import-sort: '*'
- prettier-plugin-jsdoc: '*'
- prettier-plugin-marko: '*'
- prettier-plugin-organize-attributes: '*'
- prettier-plugin-organize-imports: '*'
- prettier-plugin-style-order: '*'
- prettier-plugin-svelte: '*'
- prettier-plugin-twig-melody: '*'
- peerDependenciesMeta:
- '@ianvs/prettier-plugin-sort-imports':
- optional: true
- '@prettier/plugin-pug':
- optional: true
- '@shopify/prettier-plugin-liquid':
- optional: true
- '@trivago/prettier-plugin-sort-imports':
- optional: true
- prettier-plugin-astro:
- optional: true
- prettier-plugin-css-order:
- optional: true
- prettier-plugin-import-sort:
- optional: true
- prettier-plugin-jsdoc:
- optional: true
- prettier-plugin-marko:
- optional: true
- prettier-plugin-organize-attributes:
- optional: true
- prettier-plugin-organize-imports:
- optional: true
- prettier-plugin-style-order:
- optional: true
- prettier-plugin-svelte:
- optional: true
- prettier-plugin-twig-melody:
- optional: true
- dependencies:
- '@ianvs/prettier-plugin-sort-imports': 4.1.1([email protected])
- prettier: 3.2.5
-
- resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==}
- engines: {node: '>=14'}
- hasBin: true
+ dev: false
resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==}
@@ -17959,15 +17408,12 @@ packages:
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'}
+ dev: false
resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
engines: {node: '>=8'}
- resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
- dev: false
-
resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==}
engines: {node: '>=10'}
@@ -18057,6 +17503,7 @@ packages:
hasBin: true
dependencies:
glob: 7.2.3
+ dev: false
resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==}
@@ -18206,6 +17653,7 @@ packages:
resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
hasBin: true
+ dev: false
resolution: {integrity: sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==}
@@ -18227,6 +17675,7 @@ packages:
hasBin: true
dependencies:
lru-cache: 6.0.0
+ dev: false
resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==}
@@ -18728,6 +18177,7 @@ packages:
resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
engines: {node: '>=8'}
+ dev: false
resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==}
@@ -18822,12 +18272,14 @@ packages:
engines: {node: '>=4'}
dependencies:
has-flag: 3.0.0
+ dev: false
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
engines: {node: '>=8'}
dependencies:
has-flag: 4.0.0
+ dev: false
resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
@@ -18920,11 +18372,6 @@ packages:
transitivePeerDependencies:
- ts-node
- resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==}
- engines: {node: '>=6'}
- dev: false
-
resolution: {integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==}
engines: {node: '>=10'}
@@ -19005,6 +18452,7 @@ packages:
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
+ dev: false
resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}
@@ -19079,6 +18527,7 @@ packages:
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
engines: {node: '>=4'}
+ dev: false
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
@@ -19136,14 +18585,6 @@ packages:
resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==}
dev: false
- resolution: {integrity: sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==}
- engines: {node: '>=16'}
- peerDependencies:
- typescript: '>=4.2.0'
- dependencies:
- typescript: 5.3.3
-
resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==}
engines: {node: '>=6.10'}
@@ -19203,7 +18644,7 @@ packages:
bundle-require: 4.0.2([email protected])
cac: 6.7.14
chokidar: 3.6.0
- debug: 4.3.4
+ debug: 4.3.7
esbuild: 0.19.12
execa: 5.1.1
globby: 11.1.0
@@ -19235,6 +18676,7 @@ packages:
engines: {node: '>= 0.8.0'}
dependencies:
prelude-ls: 1.2.1
+ dev: false
resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==}
@@ -19249,6 +18691,7 @@ packages:
resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
engines: {node: '>=10'}
+ dev: false
resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
@@ -19579,6 +19022,7 @@ packages:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
dependencies:
punycode: 2.3.1
+ dev: false
resolution: {integrity: sha512-EGXjXJZhIHiQMK2pQukuFcL303nskqIRzWvPvV5O8miOfwoUb9G+a/Cld60kUyeaybEI94wvVClT10DtfeAExA==}
@@ -19969,6 +19413,7 @@ packages:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
+ dev: false
resolution: {integrity: sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==}
@@ -20069,9 +19514,11 @@ packages:
resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
+ dev: false
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
+ dev: false
resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==}
@@ -20123,6 +19570,7 @@ packages:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
+ dev: false
resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==}
diff --git a/self-hosting/package.json b/self-hosting/package.json
index a5243de89..821d0635e 100644
--- a/self-hosting/package.json
+++ b/self-hosting/package.json
@@ -19,4 +19,4 @@
"devDependencies": {
"@types/bcrypt": "^5.0.2"
}
-}
\ No newline at end of file
+}
diff --git a/self-hosting/pnpm-lock.yaml b/self-hosting/pnpm-lock.yaml
index 185ea7b94..298fde24a 100644
--- a/self-hosting/pnpm-lock.yaml
+++ b/self-hosting/pnpm-lock.yaml
@@ -16,7 +16,7 @@ dependencies:
version: 5.1.1
inquirer:
specifier: ^9.3.1
- version: 9.3.1
+ version: 9.3.6
jiti:
specifier: ^1.21.6
version: 1.21.6
@@ -31,8 +31,8 @@ devDependencies:
packages:
- /@inquirer/[email protected]:
- resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==}
+ /@inquirer/[email protected]:
+ resolution: {integrity: sha512-yfZzps3Cso2UbM7WlxKwZQh2Hs6plrbjs1QnzQDZhK2DgyCo6D8AaHps9olkNcUFlcYERMqU3uJSp1gmy3s/qQ==}
engines: {node: '>=18'}
dev: false
@@ -57,7 +57,7 @@ packages:
resolution: {integrity: sha512-6atioO8Y75fNcbmj0G7UjI9lXN2pQ/IGJ2FWT4a/btd0Lk9lQalHLKhkgKVZ3r+spnmWUKfbMi1GEe9wyHQfNQ==}
dependencies:
- '@types/node': 20.14.9
+ '@types/node': 22.5.5
dev: true
@@ -71,15 +71,15 @@ packages:
resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==}
dev: false
- resolution: {integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==}
+ resolution: {integrity: sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==}
dependencies:
- undici-types: 5.26.5
+ undici-types: 6.19.8
resolution: {integrity: sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==}
dependencies:
- '@types/node': 20.14.9
+ '@types/node': 22.5.5
dev: false
@@ -90,7 +90,7 @@ packages:
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
engines: {node: '>= 6.0.0'}
dependencies:
- debug: 4.3.6
+ debug: 4.3.7
transitivePeerDependencies:
- supports-color
dev: false
@@ -236,8 +236,8 @@ packages:
resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==}
dev: false
- resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==}
+ resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
@@ -245,7 +245,7 @@ packages:
supports-color:
optional: true
dependencies:
- ms: 2.1.2
+ ms: 2.1.3
dev: false
@@ -329,7 +329,7 @@ packages:
engines: {node: '>= 6'}
dependencies:
agent-base: 6.0.2
- debug: 4.3.6
+ debug: 4.3.7
transitivePeerDependencies:
- supports-color
dev: false
@@ -357,22 +357,22 @@ packages:
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
dev: false
- resolution: {integrity: sha512-A5IdVr1I04XqPlwrGgTJMKmzRg5ropqNpSeqo0vj1ZmluSCNSFaPZz4eazdPrhVcZfej7fCEYvD2NYa1KjkTJA==}
+ resolution: {integrity: sha512-riK/iQB2ctwkpWYgjjWIRv3MBLt2gzb2Sj0JNQNbyTXgyXsLWcDPJ5WS5ZDTCx7BRFnJsARtYh+58fjP5M2Y0Q==}
engines: {node: '>=18'}
dependencies:
- '@inquirer/figures': 1.0.3
+ '@inquirer/figures': 1.0.6
ansi-escapes: 4.3.2
cli-width: 4.1.0
external-editor: 3.1.0
mute-stream: 1.0.0
ora: 5.4.1
- picocolors: 1.0.1
run-async: 3.0.0
rxjs: 7.8.1
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi: 6.2.0
+ yoctocolors-cjs: 2.1.2
dev: false
@@ -454,8 +454,8 @@ packages:
hasBin: true
dev: false
- resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
+ resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
dev: false
@@ -540,10 +540,6 @@ packages:
engines: {node: '>=0.10.0'}
dev: false
- resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==}
- dev: false
-
resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
engines: {node: '>= 6'}
@@ -577,7 +573,7 @@ packages:
resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==}
dependencies:
- tslib: 2.6.3
+ tslib: 2.7.0
dev: false
@@ -659,8 +655,8 @@ packages:
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
dev: false
- resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==}
+ resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==}
dev: false
@@ -668,8 +664,8 @@ packages:
engines: {node: '>=10'}
dev: false
- resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
+ resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==}
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
@@ -714,3 +710,8 @@ packages:
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
dev: false
+
+ resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==}
+ engines: {node: '>=18'}
+ dev: false
diff --git a/self-hosting/quiz.ts b/self-hosting/quiz.ts
index 01f9acea3..85757295b 100644
--- a/self-hosting/quiz.ts
+++ b/self-hosting/quiz.ts
@@ -1,6 +1,6 @@
-import fs from 'fs';
-import os from 'os';
-import path from 'path';
+import fs from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';
import bcrypt from 'bcrypt';
import inquirer from 'inquirer';
import yaml from 'js-yaml';
@@ -19,7 +19,7 @@ function writeCaddyfile(domainName: string, basicAuthPassword: string) {
const caddyfileTemplatePath = path.resolve(
__dirname,
'caddy',
- 'Caddyfile.template'
+ 'Caddyfile.template',
);
const caddyfilePath = path.resolve(__dirname, 'caddy', 'Caddyfile');
fs.writeFileSync(
@@ -29,12 +29,12 @@ function writeCaddyfile(domainName: string, basicAuthPassword: string) {
.replaceAll('$DOMAIN_NAME', domainName.replace(/https?:\/\//, ''))
.replaceAll(
'$BASIC_AUTH_PASSWORD',
- bcrypt.hashSync(basicAuthPassword, 10)
+ bcrypt.hashSync(basicAuthPassword, 10),
)
.replaceAll(
'$SSL_CONFIG',
- domainName.includes('localhost:443') ? '\n\ttls internal' : ''
- )
+ domainName.includes('localhost:443') ? '\n\ttls internal' : '',
+ ),
);
}
@@ -61,7 +61,7 @@ function searchAndReplaceDockerCompose(replacements: [string, string][]) {
const dockerComposeContent = fs.readFileSync(dockerComposePath, 'utf-8');
const dockerComposeReplaced = replacements.reduce(
(acc, [search, replace]) => acc.replaceAll(search, replace),
- dockerComposeContent
+ dockerComposeContent,
);
fs.writeFileSync(dockerComposePath, dockerComposeReplaced);
@@ -75,7 +75,7 @@ function removeServiceFromDockerCompose(serviceName: string) {
const dockerCompose = yaml.load(dockerComposeContent) as DockerComposeFile;
// Remove the service
- if (dockerCompose.services && dockerCompose.services[serviceName]) {
+ if (dockerCompose.services[serviceName]) {
delete dockerCompose.services[serviceName];
console.log(`Service '${serviceName}' has been removed.`);
} else {
@@ -124,7 +124,7 @@ function writeEnvFile(envs: {
const envPath = path.resolve(__dirname, '.env');
const envTemplate = fs.readFileSync(envTemplatePath, 'utf-8');
- let newEnvFile = envTemplate
+ const newEnvFile = envTemplate
.replace('$CLICKHOUSE_URL', envs.CLICKHOUSE_URL)
.replace('$REDIS_URL', envs.REDIS_URL)
.replace('$DATABASE_URL', envs.DATABASE_URL)
@@ -132,11 +132,11 @@ function writeEnvFile(envs: {
.replace('$NEXT_PUBLIC_DASHBOARD_URL', stripTrailingSlash(envs.DOMAIN_NAME))
.replace(
'$NEXT_PUBLIC_API_URL',
- `${stripTrailingSlash(envs.DOMAIN_NAME)}/api`
+ `${stripTrailingSlash(envs.DOMAIN_NAME)}/api`,
)
.replace(
'$NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY',
- envs.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
+ envs.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
)
.replace('$CLERK_SECRET_KEY', envs.CLERK_SECRET_KEY)
.replace('$CLERK_SIGNING_SECRET', envs.CLERK_SIGNING_SECRET);
@@ -148,7 +148,7 @@ function writeEnvFile(envs: {
.filter((line) => {
return !line.includes('=""');
})
- .join('\n')
+ .join('\n'),
);
}
@@ -166,7 +166,7 @@ async function initiateOnboarding() {
"With that said let's get started! 🤠",
'',
`Hey and welcome to Openpanel's self-hosting setup! 🚀\n`,
- `Before you continue, please make sure you have the following:`,
+ 'Before you continue, please make sure you have the following:',
`${T}1. Docker and Docker Compose installed on your machine.`,
`${T}2. A domain name that you can use for this setup and point it to this machine's ip`,
`${T}3. A Clerk.com account`,
@@ -177,11 +177,11 @@ async function initiateOnboarding() {
];
console.log(
- '******************************************************************************\n'
+ '******************************************************************************\n',
);
console.log(message.join('\n'));
console.log(
- '\n******************************************************************************'
+ '\n******************************************************************************',
);
// Domain name
@@ -332,7 +332,7 @@ async function initiateOnboarding() {
default: os.cpus().length,
message: 'How many CPUs do you have?',
validate: (value) => {
- const parsed = parseInt(value, 10);
+ const parsed = Number.parseInt(value, 10);
if (Number.isNaN(parsed)) {
return 'Please enter a valid number';
@@ -377,7 +377,7 @@ async function initiateOnboarding() {
REDIS_URL: envs.REDIS_URL || 'redis://op-kv:6379',
DATABASE_URL:
envs.DATABASE_URL ||
- `postgresql://postgres:postgres@op-db:5432/postgres?schema=public`,
+ 'postgresql://postgres:postgres@op-db:5432/postgres?schema=public',
DOMAIN_NAME: domainNameResponse.domainName,
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:
clerkResponse.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY || '',
@@ -388,7 +388,7 @@ async function initiateOnboarding() {
console.log('Updating docker-compose.yml file...\n');
fs.copyFileSync(
path.resolve(__dirname, 'docker-compose.template.yml'),
- path.resolve(__dirname, 'docker-compose.yml')
+ path.resolve(__dirname, 'docker-compose.yml'),
);
if (envs.CLICKHOUSE_URL) {
@@ -434,7 +434,7 @@ async function initiateOnboarding() {
`Start OpenPanel with "./start" inside the self-hosting directory`,
'',
'',
- ].join('\n')
+ ].join('\n'),
);
}
diff --git a/tooling/eslint/base.js b/tooling/eslint/base.js
deleted file mode 100644
index 5ae37e64f..000000000
--- a/tooling/eslint/base.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/** @type {import("eslint").Linter.Config} */
-const config = {
- extends: [
- 'turbo',
- 'eslint:recommended',
- 'plugin:@typescript-eslint/recommended-type-checked',
- 'plugin:@typescript-eslint/stylistic-type-checked',
- 'prettier',
- ],
- env: {
- es2022: true,
- node: true,
- },
- parser: '@typescript-eslint/parser',
- parserOptions: {
- project: true,
- },
- plugins: ['@typescript-eslint', 'import'],
- rules: {
- 'turbo/no-undeclared-env-vars': 'off',
- '@typescript-eslint/no-unused-vars': [
- 'warn',
- { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
- ],
- '@typescript-eslint/consistent-type-imports': [
- 'warn',
- { prefer: 'type-imports', fixStyle: 'separate-type-imports' },
- ],
- '@typescript-eslint/no-misused-promises': [
- 2,
- { checksVoidReturn: { attributes: false } },
- ],
- 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
- '@typescript-eslint/no-empty-function': 'off',
- '@typescript-eslint/no-floating-promises': 'off',
- '@typescript-eslint/no-explicit-any': 'warn',
- '@typescript-eslint/ban-ts-comment': 'off',
- '@typescript-eslint/no-unsafe-return': 'off',
- '@typescript-eslint/no-unsafe-assignment': 'warn',
- '@typescript-eslint/no-unsafe-member-access': 'warn',
- '@typescript-eslint/no-unsafe-argument': 'warn',
- '@typescript-eslint/prefer-nullish-coalescing': 'off',
- '@typescript-eslint/prefer-interface': 'off',
- '@typescript-eslint/consistent-type-definitions': 'off',
- },
- ignorePatterns: [
- '**/.eslintrc.cjs',
- '**/*.config.js',
- '**/*.config.cjs',
- '.next',
- 'dist',
- 'public',
- 'pnpm-lock.yaml',
- ],
- reportUnusedDisableDirectives: true,
-};
-
-module.exports = config;
diff --git a/tooling/eslint/nextjs.js b/tooling/eslint/nextjs.js
deleted file mode 100644
index b37cc5b53..000000000
--- a/tooling/eslint/nextjs.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/** @type {import('eslint').Linter.Config} */
-const config = {
- extends: ['next'],
- rules: {
- '@next/next/no-html-link-for-pages': 'off',
- '@next/next/no-img-element': 'off',
- },
-};
-
-module.exports = config;
diff --git a/tooling/eslint/package.json b/tooling/eslint/package.json
deleted file mode 100644
index 3cde3c6ab..000000000
--- a/tooling/eslint/package.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "name": "@openpanel/eslint-config",
- "version": "0.1.0",
- "private": true,
- "license": "MIT",
- "files": [
- "./base.js",
- "./nextjs.js",
- "./react.js"
- ],
- "scripts": {
- "clean": "rm -rf .turbo node_modules",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
- "typecheck": "tsc --noEmit"
- },
- "dependencies": {
- "@next/eslint-plugin-next": "^14.0.4",
- "@types/eslint": "^8.44.2",
- "@typescript-eslint/eslint-plugin": "^6.6.0",
- "@typescript-eslint/parser": "^6.6.0",
- "eslint-config-next": "^14.0.4",
- "eslint-config-prettier": "^9.0.0",
- "eslint-config-turbo": "^1.10.13",
- "eslint-plugin-import": "^2.28.1",
- "eslint-plugin-jsx-a11y": "^6.7.1",
- "eslint-plugin-react": "^7.33.2",
- "eslint-plugin-react-hooks": "^4.6.0"
- },
- "devDependencies": {
- "@openpanel/prettier-config": "workspace:*",
- "@openpanel/tsconfig": "workspace:*",
- "@types/eslint": "^8.44.2",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
- "typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "./base.js"
- ]
- },
- "prettier": "@openpanel/prettier-config"
-}
diff --git a/tooling/eslint/react.js b/tooling/eslint/react.js
deleted file mode 100644
index 3324e6468..000000000
--- a/tooling/eslint/react.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/** @type {import('eslint').Linter.Config} */
-const config = {
- extends: [
- 'plugin:react/recommended',
- 'plugin:react-hooks/recommended',
- 'plugin:jsx-a11y/recommended',
- ],
- rules: {
- 'react/prop-types': 'off',
- 'react/no-unknown-property': 'off',
- 'jsx-a11y/click-events-have-key-events': 'off',
- 'jsx-a11y/label-has-associated-control': 'off',
- },
- globals: {
- React: 'writable',
- },
- settings: {
- react: {
- version: 'detect',
- },
- },
- env: {
- browser: true,
- },
-};
-
-module.exports = config;
diff --git a/tooling/eslint/tsconfig.json b/tooling/eslint/tsconfig.json
deleted file mode 100644
index fb0dc1a37..000000000
--- a/tooling/eslint/tsconfig.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "@openpanel/tsconfig/base.json",
- "compilerOptions": {
- "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
- },
- "include": ["."],
- "exclude": ["node_modules"]
-}
diff --git a/tooling/prettier/index.mjs b/tooling/prettier/index.mjs
deleted file mode 100644
index c0fb43b81..000000000
--- a/tooling/prettier/index.mjs
+++ /dev/null
@@ -1,41 +0,0 @@
-import { fileURLToPath } from 'url';
-
-/** @typedef {import("prettier").Config} PrettierConfig */
-/** @typedef {import("prettier-plugin-tailwindcss").PluginOptions} TailwindConfig */
-/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig */
-
-/** @type { PrettierConfig | SortImportsConfig | TailwindConfig } */
-const config = {
- plugins: [
- '@ianvs/prettier-plugin-sort-imports',
- 'prettier-plugin-tailwindcss',
- ],
- tailwindConfig: fileURLToPath(
- new URL('../../apps/dashboard/tailwind.config.js', import.meta.url)
- ),
- tailwindFunctions: ['cn', 'cva'],
- importOrder: [
- '^(react/(.*)$)|^(react$)|^(react-native(.*)$)',
- '<THIRD_PARTY_MODULES>',
- '',
- '^@openpanel/(.*)$',
- '',
- '^~/',
- '^[../]',
- '^[./]',
- ],
- importOrderParserPlugins: [
- 'typescript',
- 'jsx',
- 'decorators-legacy',
- 'importAssertions',
- ],
- importOrderTypeScriptVersion: '4.4.0',
- singleQuote: true,
- semi: true,
- trailingComma: 'es5',
- printWidth: 80,
- tabWidth: 2,
-};
-
-export default config;
diff --git a/tooling/prettier/package.json b/tooling/prettier/package.json
deleted file mode 100644
index c96988f94..000000000
--- a/tooling/prettier/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "@openpanel/prettier-config",
- "version": "0.1.0",
- "private": true,
- "main": "index.mjs",
- "type": "module",
- "scripts": {
- "clean": "rm -rf .turbo node_modules"
- },
- "dependencies": {
- "@ianvs/prettier-plugin-sort-imports": "^4.1.0",
- "prettier-plugin-tailwindcss": "^0.5.11"
- },
- "devDependencies": {
- "@openpanel/tsconfig": "workspace:*",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
- "typescript": "^5.2.2"
- }
-}
diff --git a/tooling/prettier/tsconfig.json b/tooling/prettier/tsconfig.json
deleted file mode 100644
index 1ac3efcc5..000000000
--- a/tooling/prettier/tsconfig.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "extends": "@openpanel/tsconfig/base.json",
- "compilerOptions": {
- "checkJs": false,
- "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
- },
- "include": ["."],
- "exclude": ["node_modules"]
-}
diff --git a/tooling/publish/package.json b/tooling/publish/package.json
index 221aa058a..721f08cff 100644
--- a/tooling/publish/package.json
+++ b/tooling/publish/package.json
@@ -4,9 +4,7 @@
"private": true,
"license": "MIT",
"scripts": {
- "publish": "pnpm dlx ts-node publish.ts",
- "lint": "eslint .",
- "format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
+ "publish": "pnpm run publish.ts",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -14,21 +12,9 @@
"semver": "^7.5.4"
},
"devDependencies": {
- "@openpanel/eslint-config": "workspace:*",
- "@openpanel/prettier-config": "workspace:*",
"@openpanel/tsconfig": "workspace:*",
- "@types/eslint": "^8.44.2",
"@types/node": "^18.16.0",
"@types/semver": "^7.5.4",
- "eslint": "^8.48.0",
- "prettier": "^3.0.3",
"typescript": "^5.2.2"
- },
- "eslintConfig": {
- "root": true,
- "extends": [
- "@openpanel/eslint-config/base"
- ]
- },
- "prettier": "@openpanel/prettier-config"
+ }
}
diff --git a/tooling/publish/publish.ts b/tooling/publish/publish.ts
index f3f1986cb..65d636915 100644
--- a/tooling/publish/publish.ts
+++ b/tooling/publish/publish.ts
@@ -11,7 +11,7 @@ interface PackageJson {
version: string;
dependencies?: Record<string, string>;
devDependencies?: Record<string, string>;
- [key: string]: any;
+ [key: string]: unknown;
}
interface PackageInfo extends PackageJson {
@@ -60,7 +60,7 @@ const getNextVersion = (version: string, type: ReleaseType): string => {
// Core functions
const loadPackages = (
- releaseType: ReleaseType
+ releaseType: ReleaseType,
): Record<string, PackageInfo> => {
const sdksPath = workspacePath('./packages/sdks');
const sdks = fs
@@ -72,7 +72,7 @@ const loadPackages = (
sdks.map((sdk) => {
const pkgPath = path.join(sdksPath, sdk, 'package.json');
const pkgJson = JSON.parse(
- fs.readFileSync(pkgPath, 'utf-8')
+ fs.readFileSync(pkgPath, 'utf-8'),
) as PackageJson;
const version = pkgJson.version.replace(/-local$/, '');
return [
@@ -84,22 +84,22 @@ const loadPackages = (
localPath: `./packages/sdks/${sdk}`,
},
];
- })
+ }),
);
};
const findDependents = (
packages: Record<string, PackageInfo>,
- targetName: string
+ targetName: string,
): string[] => {
const dependents = new Set([targetName]);
const findDeps = (name: string) => {
- Object.entries(packages).forEach(([pkgName, pkg]) => {
+ for (const [pkgName, pkg] of Object.entries(packages)) {
if (pkg.dependencies?.[name] && !dependents.has(pkgName)) {
dependents.add(pkgName);
findDeps(pkgName);
}
- });
+ }
};
findDeps(targetName);
return Array.from(dependents);
@@ -108,7 +108,7 @@ const findDependents = (
const updatePackageJsonForRelease = (
packages: Record<string, PackageInfo>,
name: string,
- dependents: string[]
+ dependents: string[],
): void => {
const { nextVersion, localPath, ...restPkgJson } = packages[name]!;
const newPkgJson: PackageJson = {
@@ -144,8 +144,8 @@ const updatePackageJsonForRelease = (
? packages[depName]?.nextVersion ||
depVersion.replace(/-local$/, '')
: depVersion.replace(/-local$/, ''),
- ]
- )
+ ],
+ ),
),
};
@@ -157,7 +157,7 @@ const updatePackageJsonForRelease = (
const buildPackages = (
packages: Record<string, PackageInfo>,
- dependents: string[]
+ dependents: string[],
): void => {
const versionEnvs = dependents.map((dep) => {
const envName = dep
@@ -167,26 +167,26 @@ const buildPackages = (
return `--env.${envName}_VERSION=${packages[dep]!.nextVersion}`;
});
- dependents.forEach((dep) => {
+ for (const dep of dependents) {
console.log(`🔨 Building ${dep}`);
const cmd = `pnpm build ${versionEnvs.join(' ')}`;
console.log(` Running: ${cmd}`);
execSync(cmd, {
cwd: workspacePath(packages[dep]!.localPath),
});
- });
+ }
};
const publishPackages = (
packages: Record<string, PackageInfo>,
dependents: string[],
- config: PublishConfig
+ config: PublishConfig,
): void => {
if (config.test) {
execSync('rm -rf ~/.local/share/verdaccio/storage/@openpanel');
}
- dependents.forEach((dep) => {
+ for (const dep of dependents) {
console.log(`🚀 Publishing ${dep} to ${config.registry}`);
execSync(`npm publish --access=public --registry ${config.registry}`, {
cwd: workspacePath(packages[dep]!.localPath),
@@ -194,15 +194,15 @@ const publishPackages = (
if (dep === '@openpanel/web') {
execSync(
- `cp ${workspacePath('packages/sdks/web/dist/src/tracker.global.js')} ${workspacePath('./apps/public/public/op1.js')}`
+ `cp ${workspacePath('packages/sdks/web/dist/src/tracker.global.js')} ${workspacePath('./apps/public/public/op1.js')}`,
);
}
- });
+ }
};
const restoreAndUpdateLocal = (
packages: Record<string, PackageInfo>,
- dependents: string[]
+ dependents: string[],
): void => {
const filesToRestore = dependents
.map((dep) => workspacePath(packages[dep]!.localPath))
@@ -211,7 +211,7 @@ const restoreAndUpdateLocal = (
execSync(`git checkout ${filesToRestore}`);
- dependents.forEach((dep) => {
+ for (const dep of dependents) {
const { nextVersion, localPath, ...restPkgJson } = packages[dep]!;
console.log(`🚀 Updating ${dep} (${nextVersion}-local)`);
@@ -227,8 +227,8 @@ const restoreAndUpdateLocal = (
: packages[depName]
? `${packages[depName]!.version}-local`
: depVersion,
- ]
- )
+ ],
+ ),
),
devDependencies: Object.fromEntries(
Object.entries(restPkgJson.devDependencies || {}).map(
@@ -239,13 +239,13 @@ const restoreAndUpdateLocal = (
: packages[depName]
? `${packages[depName]!.version}-local`
: depVersion,
- ]
- )
+ ],
+ ),
),
};
savePackageJson(workspacePath(`${localPath}/package.json`), updatedPkgJson);
- });
+ }
};
function main() {
@@ -268,7 +268,7 @@ function main() {
if (!RELEASE_TYPES.includes(args['--type'] as ReleaseType)) {
return exit(
- `Invalid release type. Valid types are: ${RELEASE_TYPES.join(', ')}`
+ `Invalid release type. Valid types are: ${RELEASE_TYPES.join(', ')}`,
);
}
@@ -282,12 +282,12 @@ function main() {
const dependents = findDependents(packages, target.name);
- dependents.forEach((dep) => {
+ for (const dep of dependents) {
console.log(
- `📦 ${dep} · Old Version: ${packages[dep]!.version} · Next Version: ${packages[dep]!.nextVersion}`
+ `📦 ${dep} · Old Version: ${packages[dep]!.version} · Next Version: ${packages[dep]!.nextVersion}`,
);
updatePackageJsonForRelease(packages, dep, dependents);
- });
+ }
buildPackages(packages, dependents);
diff --git a/tooling/typescript/package.json b/tooling/typescript/package.json
index a3b08c251..07508dd83 100644
--- a/tooling/typescript/package.json
+++ b/tooling/typescript/package.json
@@ -2,11 +2,7 @@
"name": "@openpanel/tsconfig",
"version": "0.1.0",
"private": true,
- "files": [
- "base.json",
- "sdk.json",
- "tsup.config.json"
- ],
+ "files": ["base.json", "sdk.json", "tsup.config.json"],
"devDependencies": {
"tsup": "^7.2.0"
}
diff --git a/tooling/typescript/tsup.config.json b/tooling/typescript/tsup.config.json
index 412c9d5bb..290dc84b1 100644
--- a/tooling/typescript/tsup.config.json
+++ b/tooling/typescript/tsup.config.json
@@ -1,14 +1,9 @@
{
- "entry": [
- "index.ts"
- ],
- "format": [
- "cjs",
- "esm"
- ],
+ "entry": ["index.ts"],
+ "format": ["cjs", "esm"],
"dts": true,
"splitting": false,
"sourcemap": false,
"clean": true,
"minify": true
-}
\ No newline at end of file
+}