Skip to content

Commit f338f3d

Browse files
atrakhConvex, Inc.
authored and
Convex, Inc.
committed
dashboard: Move self hosted dashboard app to it's own package (#33816)
- Updates dashboard-common to actually build instead of having `dashboard` read live from the source - Make `npm run start` work and update Dockerfile.dashboard - Update most relative imports to absolute imports (use tsc-alias to make this work) with a real build. I used a codemod for this, so there are some places where a relative import would have been cleaner, but this was the quickest way to get the change done GitOrigin-RevId: 3631bedbca9fb6634032ab2bd4bc0f34fb18a1e8
1 parent 7f0e8af commit f338f3d

File tree

288 files changed

+1635
-1041
lines changed

Some content is hidden

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

288 files changed

+1635
-1041
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
!/npm-packages*/*
1717
!/scripts/*
1818

19+
# Never use a build cache for the docker image
20+
/npm-packages/common/config/rush/build-cache.json
21+
1922
# Re-exclude common build/cache directories that might exist under the included directories above.
2023
# Docker uses the last matching-pattern for any file.
2124
# Node/NPM

npm-packages/common/config/rush/pnpm-lock.yaml

+169-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

npm-packages/dashboard-common/.eslintrc.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ module.exports = {
166166
},
167167
overrides: [
168168
{
169-
files: ["src/pages/**/*.tsx", "src/**/*.stories.tsx"],
169+
files: ["src/**/*.stories.tsx"],
170170
rules: {
171171
"import/no-default-export": "off",
172172
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"incrementalBuildIgnoredGlobs": [],
3+
"disableBuildCacheForProject": false,
4+
"operationSettings": [
5+
{
6+
"operationName": "build",
7+
"outputFolderNames": ["dist"]
8+
}
9+
]
10+
}

npm-packages/dashboard-common/jest.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const createJestConfig = nextJest({
66

77
const customJestConfig = {
88
moduleDirectories: ["node_modules", "src"],
9+
testPathIgnorePatterns: ["dist"],
910
testEnvironment: "jest-environment-jsdom",
1011
setupFilesAfterEnv: ["<rootDir>/setupTests.ts"],
1112
moduleNameMapper: {

npm-packages/dashboard-common/next-env.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33

44
// NOTE: This file should not be edited
55
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
6+
7+
declare module "*.png" {
8+
const value: string;
9+
export default value;
10+
}

npm-packages/dashboard-common/package.json

+9-13
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,18 @@
22
"name": "dashboard-common",
33
"version": "0.1.0",
44
"private": true,
5-
"exports": {
6-
".": {
7-
"types": "./src/index.js",
8-
"default": "./src/index"
9-
}
10-
},
5+
"type": "module",
6+
"main": "./dist/index.js",
7+
"types": "./dist/index.d.ts",
8+
"sideEffects": false,
119
"scripts": {
12-
"dev": "npm run build:generated && next dev --port 6790",
13-
"build": "npm run build:generated && tsc --noEmit",
10+
"build": "npm run build:generated && tsc && tsc-alias",
1411
"build:generated": "python3 scripts/build-convexServerTypes.py",
15-
"build:next": "npm run build:generated && next build",
1612
"test": "npm run build:generated && jest",
17-
"start": "next start",
1813
"storybook": "storybook dev -s ./public -p 6006",
1914
"build-storybook": "storybook build",
20-
"lint": "next lint --max-warnings 0 --dir src/ && tsc",
21-
"lint:fix": "next lint --fix --max-warnings 0 --dir src/"
15+
"lint": "eslint ./src --ext .js,.jsx,.ts,.tsx --ignore-pattern '**/*.stories.tsx'",
16+
"lint:fix": "eslint --fix ./src --ext .js,.jsx,.ts,.tsx --ignore-pattern '**/*.stories.tsx'"
2217
},
2318
"dependencies": {
2419
"@floating-ui/react": "^0.27.0",
@@ -96,6 +91,7 @@
9691
"@testing-library/user-event": "~14.4.3",
9792
"@types/jest": "^27.0.0",
9893
"@types/lodash": "~4.17.0",
94+
"@types/next": "~9.0.0",
9995
"@types/node": "^18.17.0",
10096
"@types/prettier-old-sync": "npm:@types/[email protected]",
10197
"@types/react": "^18.0.0",
@@ -127,8 +123,8 @@
127123
"prettier": "3.4.2",
128124
"prettier-plugin-tailwindcss": "~0.3.0",
129125
"storybook": "^7.6.16",
130-
"tailwind-scrollbar": "3.0.3",
131126
"tailwindcss": "^3.2.4",
127+
"tsc-alias": "~1.8.10",
132128
"typescript": "~5.0.3"
133129
}
134130
}

0 commit comments

Comments
 (0)