Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/refactor-component/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ cd packages/app && yarn ci:unit # Unit tests (or the appropriate package)
make e2e # E2E tests — re-run the same tests from step 1 to catch regressions
```

If lint fails with import-sort or formatting errors, run `npx oxlint --fix <file>` and `npx prettier --write <file>` from the package directory and re-check. If there are unused-import warnings, remove the unused imports manually.
If lint fails with import-sort or formatting errors, run `npx oxlint --fix <file>` and `npx oxfmt <file>` from the package directory and re-check. If there are unused-import warnings, remove the unused imports manually.

If an E2E test fails, investigate whether the failure is related to the refactoring (e.g. a broken import path at runtime) or a pre-existing flake. Fix refactoring-related failures before presenting the result. The E2E tests identified in step 1 are the most important — if those pass, the refactor is safe.

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ jobs:
yarn.lock
.yarn/**
.yarnrc.yml
.prettierrc
.prettierignore
.oxfmtrc.json
tsconfig.base.json
nx.json
- name: Setup Docker Buildx
Expand Down
19 changes: 19 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "avoid",
"proseWrap": "always",
"sortPackageJson": false,
"ignorePatterns": [
"dist",
"coverage",
".volumes",
"packages/api/openapi.json"
]
}
8 changes: 0 additions & 8 deletions .prettierignore

This file was deleted.

11 changes: 0 additions & 11 deletions .prettierrc

This file was deleted.

3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"clinyong.vscode-css-modules",
"streetsidesoftware.code-spell-checker",
"oxc.oxc-vscode",
"stylelint.vscode-stylelint",
"esbenp.prettier-vscode"
"stylelint.vscode-stylelint"
]
}
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"source.fixAll.stylelint": "always"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[scss]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint"
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[css]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint"
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"stylelint.validate": ["css", "postcss", "scss"],
"cssVariables.lookupFiles": [
Expand Down
3 changes: 2 additions & 1 deletion agent_docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ the OpenAPI spec and `yarn lint:openapi` to validate it.

`scripts/ci/check-openapi-sync.sh` (run by `make ci-lint` and by CI) fails if the
committed spec is stale. `swaggerOptions` in `src/utils/swagger.ts` is also an
input, and the spec is in `.prettierignore` because docgen owns its formatting.
input, and the spec is in `ignorePatterns` in `.oxfmtrc.json` because docgen owns
its formatting.

### MCP Server (`src/mcp/`)

Expand Down
2 changes: 1 addition & 1 deletion agent_docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ does not overlap with CI integration tests (14320-40098) or the dev stack

The project uses Husky + lint-staged to automatically run:

- Prettier for formatting
- oxfmt for formatting (`.oxfmtrc.json`)
- oxlint for linting (each file with its package's `.oxlintrc.json`)
- API doc generation (for external API changes)

Expand Down
2 changes: 1 addition & 1 deletion docker/hyperdx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ FROM node:${NODE_VERSION}-alpine AS node_base
WORKDIR /app

COPY .yarn ./.yarn
COPY .yarnrc.yml yarn.lock package.json nx.json .prettierrc .prettierignore ./tsconfig.base.json ./
COPY .yarnrc.yml yarn.lock package.json nx.json .oxfmtrc.json ./tsconfig.base.json ./
# Only copy package.json for workspace resolution during yarn install;
# full source is copied in the build stages that need it.
COPY ./packages/common-utils/package.json ./packages/common-utils/package.json
Expand Down
3 changes: 1 addition & 2 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
],
"sharedGlobals": [
"{workspaceRoot}/tsconfig.base.json",
"{workspaceRoot}/.prettierrc",
"{workspaceRoot}/.prettierignore",
"{workspaceRoot}/.oxfmtrc.json",
"{workspaceRoot}/package.json",
"{workspaceRoot}/yarn.lock",
"{workspaceRoot}/.nvmrc"
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"knip": "^6.19.0",
"lint-staged": "^13.1.2",
"nx": "23.3.2",
"oxfmt": "^0.78.0",
"oxlint": "^1.92.0",
"oxlint-plugin-eslint": "^1.93.0",
"oxlint-tsgolint": "^7.0.2006",
"prettier": "3.3.3",
"tslib": "^2.6.0"
},
"scripts": {
Expand Down Expand Up @@ -60,16 +60,16 @@
},
"lint-staged": {
"packages/api/src/{routers/external-api/**/*.ts,utils/swagger.ts}": [
"prettier --write --ignore-unknown",
"oxfmt --no-error-on-unmatched-pattern",
"node scripts/ci/oxlint-warnings.mjs --staged --fix",
"sh -c 'cd packages/api && yarn run lint:openapi && git add openapi.json'"
],
"**/*.{ts,tsx}": [
"prettier --write --ignore-unknown",
"oxfmt --no-error-on-unmatched-pattern",
"node scripts/ci/oxlint-warnings.mjs --staged --fix"
],
"**/*.{mdx,json,yml}": [
"prettier --write --ignore-unknown"
"**/*.{mdx,json,yml,css,scss}": [
"oxfmt --no-error-on-unmatched-pattern"
]
},
"packageManager": "yarn@4.13.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM node:22.23.4-alpine AS base
WORKDIR /app

COPY .yarn ./.yarn
COPY .yarnrc.yml yarn.lock package.json nx.json .prettierrc .prettierignore ./tsconfig.base.json ./
COPY .yarnrc.yml yarn.lock package.json nx.json .oxfmtrc.json ./tsconfig.base.json ./
# Only copy package.json for workspace resolution during yarn install;
# full source is copied in the build stages that need it.
COPY ./packages/common-utils/package.json ./packages/common-utils/package.json
Expand Down
4 changes: 2 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
"dev-task": "DOTENV_CONFIG_PATH=.env.development nodemon --exec 'ts-node' --transpile-only -r tsconfig-paths/register -r dotenv-expand/config -r ./src/telemetry.ts ./src/tasks/index.ts",
"build": "rimraf ./build && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && cp -r ./src/opamp/proto ./build/opamp/",
"build:vercel": "rimraf ./build && tsc -p tsconfig.vercel.json && tsc-alias -p tsconfig.vercel.json && cp -r ./src/opamp/proto ./build/opamp/",
"lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 302 && yarn run -T prettier --check --log-level warn 'src/**/*.ts' 'scripts/**/*.ts'",
"lint:fix": "yarn run -T oxlint --fix && yarn run -T prettier --write --log-level warn 'src/**/*.ts' 'scripts/**/*.ts'",
"lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 302 && yarn run -T oxfmt --check 'src/**/*.ts' 'scripts/**/*.ts'",
"lint:fix": "yarn run -T oxlint --fix && yarn run -T oxfmt 'src/**/*.ts' 'scripts/**/*.ts'",
"ci:lint": "yarn lint && yarn tsc --noEmit && yarn lint:openapi",
"ci:unit": "jest --ci --coverage",
"dev:unit": "jest --watch",
Expand Down
4 changes: 2 additions & 2 deletions packages/api/scripts/seed-alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ async function seed(count: number, tag: string) {
name: string;
tags: string[];
}[] = [];
for (let remaining = savedSearchAlertTotal; remaining > 0; ) {
for (let remaining = savedSearchAlertTotal; remaining > 0;) {
const alerts = Math.min(
remaining,
randomInt(1, MAX_ALERTS_PER_SAVED_SEARCH),
Expand Down Expand Up @@ -381,7 +381,7 @@ async function seed(count: number, tag: string) {
alertedTiles: { id: string; displayName: string }[];
tags: string[];
}[] = [];
for (let remaining = tileAlertTotal; remaining > 0; ) {
for (let remaining = tileAlertTotal; remaining > 0;) {
const index = dashboardPlans.length;
const tileCount = randomInt(1, MAX_TILES_PER_DASHBOARD);
const tiles = Array.from({ length: tileCount }, (_, tileIndex) =>
Expand Down
6 changes: 4 additions & 2 deletions packages/api/src/models/savedSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ type ExternalSavedSearch = {
updatedAt?: string;
};

export interface ISavedSearch
extends Omit<z.infer<typeof SavedSearchSchema>, 'source'> {
export interface ISavedSearch extends Omit<
z.infer<typeof SavedSearchSchema>,
'source'
> {
_id: ObjectId;
team: ObjectId;
source: ObjectId;
Expand Down
5 changes: 0 additions & 5 deletions packages/app/.prettierignore

This file was deleted.

2 changes: 1 addition & 1 deletion packages/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apk add --no-cache libc6-compat
WORKDIR /app

COPY .yarn ./.yarn
COPY .yarnrc.yml yarn.lock package.json nx.json .prettierrc .prettierignore ./tsconfig.base.json ./
COPY .yarnrc.yml yarn.lock package.json nx.json .oxfmtrc.json ./tsconfig.base.json ./
# Only copy package.json for workspace resolution during yarn install;
# full source is copied in the build stages that need it.
COPY ./packages/common-utils/package.json ./packages/common-utils/package.json
Expand Down
5 changes: 2 additions & 3 deletions packages/app/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
export async function register() {
// The edge build drops this branch, so it never bundles the Node.js SDK
if (process.env.NEXT_RUNTIME === 'nodejs') {
const { startNextServerTelemetry } = await import(
'@/utils/nextServerTelemetry'
);
const { startNextServerTelemetry } =
await import('@/utils/nextServerTelemetry');
await startNextServerTelemetry();
}
}
6 changes: 2 additions & 4 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"build:clickhouse": "NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_PUBLIC_CLICKHOUSE_BUILD=true next build --webpack && node scripts/prepare-clickhouse-build-export.js",
"run:clickhouse": "test -d out && npx rimraf tmp && mkdir tmp && cp -r out tmp/clickstack && echo 'visit http://localhost:3000/clickstack to start' && npx serve tmp -l 3000 || echo 'run build:clickhouse first'",
"start": "next start",
"lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 576 && yarn run -T prettier --check --log-level warn '**/*.{ts,tsx}'",
"lint:fix": "yarn run -T oxlint --fix && yarn run -T prettier --write --log-level warn '**/*.{ts,tsx}'",
"lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 576 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'",
"lint:fix": "yarn run -T oxlint --fix && yarn run -T oxfmt '**/*.{ts,tsx,css,scss}'",
"lint:styles": "stylelint **/*/*.{css,scss}",
"ci:lint": "yarn lint && yarn tsc --noEmit && yarn lint:styles --quiet",
"ci:unit": "jest --ci --coverage",
Expand Down Expand Up @@ -147,13 +147,11 @@
"postcss": "^8.5.23",
"postcss-preset-mantine": "^1.18.0",
"postcss-simple-vars": "^7.0.0",
"prettier": "3.3.3",
"rimraf": "^4.4.1",
"serve": "^14.0.0",
"storybook": "^10.6.2",
"stylelint": "^16.26.1",
"stylelint-config-standard-scss": "^16.0.0",
"stylelint-prettier": "^5.0.3",
"ts-jest": "^29.4.11",
"typescript": "^6.0.3"
},
Expand Down
4 changes: 1 addition & 3 deletions packages/app/src/DBDashboardImportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,7 @@ const appliesToSourceKinds = (
* The source kinds a filter of this type can read its dropdown values from, or
* `undefined` for a filter that reads no source at all.
*/
const filterSourceKinds = (
filter: DashboardFilter,
): SourceKind[] | undefined =>
const filterSourceKinds = (filter: DashboardFilter): SourceKind[] | undefined =>
isPrometheusLabelFilter(filter)
? [SourceKind.Promql]
: isQueryExpressionFilter(filter)
Expand Down
7 changes: 4 additions & 3 deletions packages/app/src/DBDashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2991,16 +2991,17 @@ function DBDashboardPage({
const hasTiles = dashboard && dashboard.tiles.length > 0;
const hasSavedDefaults = Boolean(
dashboard?.savedQuery ||
dashboard?.savedFilterValues?.length ||
dashboard?.savedDateRange,
dashboard?.savedFilterValues?.length ||
dashboard?.savedDateRange,
);

const dashboardMeta =
!isLocalDashboard && dashboard ? (
<Text size="xs" c="dimmed" style={{ flexShrink: 0 }}>
{dashboard.createdBy && (
<span>
Created by {dashboard.createdBy.name || dashboard.createdBy.email}.{' '}
Created by {dashboard.createdBy.name || dashboard.createdBy.email}
.{' '}
</span>
)}
{dashboard.updatedAt && (
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/DBSearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2571,7 +2571,8 @@ function DBSearchPageContent() {
{savedSearch.createdBy && (
<span>
Created by{' '}
{savedSearch.createdBy.name || savedSearch.createdBy.email}.{' '}
{savedSearch.createdBy.name || savedSearch.createdBy.email}
.{' '}
</span>
)}
{savedSearch.updatedAt && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,24 +260,22 @@ function usePromqlSourceKeys(
);

return useQueries({
queries: sources.map(
(source): UseQueryOptions<string[]> => ({
queryKey: [
'adhoc-filter-promql-keys',
source.id,
seconds.start,
seconds.end,
],
queryFn: async () => {
const labels = await fetchPromqlLabelNames(
promqlLookupParams(source, seconds, attribution),
);
return labels.filter(label => label !== '__name__');
},
staleTime: STALE_TIME_MS,
placeholderData: keepPreviousData,
}),
),
queries: sources.map((source): UseQueryOptions<string[]> => ({
queryKey: [
'adhoc-filter-promql-keys',
source.id,
seconds.start,
seconds.end,
],
queryFn: async () => {
const labels = await fetchPromqlLabelNames(
promqlLookupParams(source, seconds, attribution),
);
return labels.filter(label => label !== '__name__');
},
staleTime: STALE_TIME_MS,
placeholderData: keepPreviousData,
})),
combine: combineKeys,
});
}
Expand Down Expand Up @@ -340,25 +338,23 @@ function usePromqlSourceValues(
const seconds = toPromqlSeconds(dateRange);

return useQueries({
queries: sources.map(
(source): UseQueryOptions<string[]> => ({
queryKey: [
'adhoc-filter-promql-values',
source.id,
key,
seconds.start,
seconds.end,
],
queryFn: () =>
fetchPromqlLabelValues({
label: key,
...promqlLookupParams(source, seconds, attribution),
}),
enabled: !!key,
staleTime: STALE_TIME_MS,
retry: false,
}),
),
queries: sources.map((source): UseQueryOptions<string[]> => ({
queryKey: [
'adhoc-filter-promql-values',
source.id,
key,
seconds.start,
seconds.end,
],
queryFn: () =>
fetchPromqlLabelValues({
label: key,
...promqlLookupParams(source, seconds, attribution),
}),
enabled: !!key,
staleTime: STALE_TIME_MS,
retry: false,
})),
combine: combineValues,
});
}
Expand Down
Loading
Loading