Skip to content

Commit fe3b9b1

Browse files
committed
fix: Update tsconfigs to resolve IDE type errors
1 parent c48f418 commit fe3b9b1

18 files changed

+120
-75
lines changed

.changeset/afraid-onions-pump.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@hyperdx/common-utils": patch
3+
"@hyperdx/api": patch
4+
"@hyperdx/app": patch
5+
---
6+
7+
fix: Update tsconfigs to resolve IDE type errors

docker/hyperdx/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ FROM node:${NODE_VERSION}-alpine AS node_base
2222
WORKDIR /app
2323

2424
COPY .yarn ./.yarn
25-
COPY .yarnrc.yml yarn.lock package.json nx.json .prettierrc .prettierignore ./
25+
COPY .yarnrc.yml yarn.lock package.json nx.json .prettierrc .prettierignore ./tsconfig.base.json ./
2626
COPY ./packages/common-utils ./packages/common-utils
27-
COPY ./packages/api/jest.config.js ./packages/api/tsconfig.json ./packages/api/package.json ./packages/api/
28-
COPY ./packages/app/jest.config.js ./packages/app/tsconfig.json ./packages/app/tsconfig.test.json ./packages/app/package.json ./packages/app/next.config.js ./packages/app/mdx.d.ts ./packages/app/.eslintrc.js ./packages/app/
27+
COPY ./packages/api/jest.config.js ./packages/api/tsconfig.json ./packages/api/tsconfig.build.json ./packages/api/package.json ./packages/api/
28+
COPY ./packages/app/jest.config.js ./packages/app/tsconfig.json ./packages/app/tsconfig.build.json ./packages/app/package.json ./packages/app/next.config.js ./packages/app/mdx.d.ts ./packages/app/.eslintrc.js ./packages/app/
2929

3030
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
3131
RUN apk add --no-cache libc6-compat

packages/api/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
plugins: ['@typescript-eslint', 'prettier', 'simple-import-sort'],
66
parserOptions: {
77
tsconfigRootDir: __dirname,
8-
project: ['./tsconfig.json', './tsconfig.test.json'],
8+
project: ['./tsconfig.json'],
99
},
1010
extends: [
1111
'eslint:recommended',

packages/api/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ FROM node:22.16.0-alpine AS base
44
WORKDIR /app
55

66
COPY .yarn ./.yarn
7-
COPY .yarnrc.yml yarn.lock package.json nx.json .prettierrc .prettierignore ./
7+
COPY .yarnrc.yml yarn.lock package.json nx.json .prettierrc .prettierignore ./tsconfig.base.json ./
88
COPY ./packages/common-utils ./packages/common-utils
9-
COPY ./packages/api/jest.config.js ./packages/api/tsconfig.json ./packages/api/package.json ./packages/api/
9+
COPY ./packages/api/jest.config.js ./packages/api/tsconfig.json ./packages/api/tsconfig.build.json ./packages/api/package.json ./packages/api/
1010
RUN yarn install --mode=skip-build && yarn cache clean
1111

1212

packages/api/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"start": "node ./dist/index.js",
9494
"dev": "DOTENV_CONFIG_PATH=.env.development nodemon --signal SIGTERM -e ts,json --exec 'ts-node' --transpile-only -r tsconfig-paths/register -r dotenv-expand/config -r '@hyperdx/node-opentelemetry/build/src/tracing' ./src/index.ts",
9595
"dev-task": "DOTENV_CONFIG_PATH=.env.development nodemon --signal SIGTERM -e ts,json --exec 'ts-node' --transpile-only -r tsconfig-paths/register -r dotenv-expand/config -r '@hyperdx/node-opentelemetry/build/src/tracing' ./src/tasks/index.ts",
96-
"build": "tsc && tsc-alias && esbuild ../../node_modules/@hyperdx/node-opentelemetry/build/src/tracing --bundle --minify --platform=node --outfile=dist/tracing.js && esbuild ./build/src/index.js ./build/src/tasks/index.js --bundle --minify --platform=node --target=node22 --outdir=dist --alias:@='./src' && mkdir -p dist/opamp && cp -r src/opamp/proto dist/opamp/proto && rimraf ./build",
96+
"build": "tsc -p ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json && esbuild ../../node_modules/@hyperdx/node-opentelemetry/build/src/tracing --bundle --minify --platform=node --outfile=dist/tracing.js && esbuild ./build/src/index.js ./build/src/tasks/index.js --bundle --minify --platform=node --target=node22 --outdir=dist --alias:@='./src' && mkdir -p dist/opamp && cp -r src/opamp/proto dist/opamp/proto && rimraf ./build",
9797
"lint": "npx eslint --quiet . --ext .ts",
9898
"lint:fix": "npx eslint . --ext .ts --fix",
9999
"ci:lint": "yarn lint && yarn tsc --noEmit",
@@ -105,4 +105,4 @@
105105
"dev:migrate-ch": "migrate -database 'clickhouse://localhost:9000?database=default&x-multi-statement=true' -path ./migrations/ch up",
106106
"docgen": "ts-node scripts/generate-api-docs.ts"
107107
}
108-
}
108+
}

packages/api/tsconfig.build.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": [
4+
"src",
5+
"migrations",
6+
"scripts"
7+
],
8+
"exclude": [
9+
"node_modules",
10+
"**/*.test.ts"
11+
]
12+
}

packages/api/tsconfig.json

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
11
{
2+
"extends": "../../tsconfig.base.json",
23
"compilerOptions": {
34
"baseUrl": "./src",
45
"paths": {
5-
"@/*": ["./*"]
6+
"@/*": [
7+
"./*"
8+
]
69
},
710
"rootDir": ".",
8-
"allowSyntheticDefaultImports": true,
9-
"downlevelIteration": true,
10-
"esModuleInterop": true,
11-
"forceConsistentCasingInFileNames": true,
12-
"importHelpers": true,
13-
"lib": ["ES2022", "dom"],
14-
"module": "Node16",
15-
"moduleResolution": "node",
16-
"noFallthroughCasesInSwitch": true,
17-
"noImplicitAny": false,
18-
"noImplicitReturns": false,
19-
"noImplicitThis": false,
20-
"noUnusedLocals": false,
21-
"noUnusedParameters": false,
2211
"outDir": "build",
23-
"skipLibCheck": false,
24-
"sourceMap": true,
25-
"strict": true,
26-
"target": "ES2022"
2712
},
28-
"include": ["src", "migrations", "scripts"],
29-
"exclude": ["node_modules", "**/*.test.ts"]
30-
}
13+
"include": [
14+
"src",
15+
"migrations",
16+
"scripts"
17+
],
18+
"exclude": [
19+
"node_modules"
20+
]
21+
}

packages/api/tsconfig.test.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/app/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
plugins: ['simple-import-sort', '@typescript-eslint', 'prettier'],
55
parserOptions: {
66
tsconfigRootDir: __dirname,
7-
project: ['./tsconfig.json', './tsconfig.test.json'],
7+
project: ['./tsconfig.json'],
88
},
99
extends: [
1010
'next',

packages/app/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ RUN apk add --no-cache libc6-compat
55
WORKDIR /app
66

77
COPY .yarn ./.yarn
8-
COPY .yarnrc.yml yarn.lock package.json nx.json .prettierrc .prettierignore ./
8+
COPY .yarnrc.yml yarn.lock package.json nx.json .prettierrc .prettierignore ./tsconfig.base.json ./
99
COPY ./packages/common-utils ./packages/common-utils
10-
COPY ./packages/app/jest.config.js ./packages/app/tsconfig.json ./packages/app/tsconfig.test.json ./packages/app/package.json ./packages/app/next.config.js ./packages/app/mdx.d.ts ./packages/app/.eslintrc.js ./packages/app/
10+
COPY ./packages/app/jest.config.js ./packages/app/tsconfig.json ./packages/app/tsconfig.build.json ./packages/app/package.json ./packages/app/next.config.js ./packages/app/mdx.d.ts ./packages/app/.eslintrc.js ./packages/app/
1111
RUN yarn install --mode=skip-build && yarn cache clean
1212

1313

0 commit comments

Comments
 (0)