@platformatic/watt-admin 0.6.0-alpha.2 → 0.6.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.d.ts +3 -0
- package/lib/start.d.ts +3 -0
- package/lib/start.js +6 -1
- package/package.json +3 -2
- package/renovate.json +17 -0
- package/watt.json +16 -8
- package/web/backend/global.d.ts +17 -0
- package/web/backend/plugins/metrics.ts +15 -0
- package/web/backend/plugins/websocket.ts +6 -0
- package/web/backend/routes/metrics.ts +46 -0
- package/web/backend/routes/proxy.ts +41 -0
- package/web/backend/routes/root.ts +204 -0
- package/web/backend/routes/ws.ts +45 -0
- package/web/backend/schemas/index.ts +226 -0
- package/web/backend/utils/bytes.ts +1 -0
- package/web/backend/utils/client.openapi.ts +29 -0
- package/web/backend/utils/constants.ts +4 -0
- package/web/backend/utils/metrics-helpers.ts +89 -0
- package/web/backend/utils/metrics.ts +202 -0
- package/web/backend/utils/rps.ts +3 -0
- package/web/backend/utils/runtimes.ts +21 -0
- package/web/backend/utils/states.ts +3 -0
- package/web/frontend/dist/index.html +470 -466
- package/web/frontend/index.d.ts +4 -0
- package/web/frontend/playwright.config.ts +27 -0
- package/web/frontend/postcss.config.ts +14 -0
- package/CLAUDE.md +0 -32
- package/tsconfig.json +0 -22
- package/web/backend/tsconfig.json +0 -24
- package/web/frontend/tsconfig.json +0 -30
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineConfig, devices } from '@playwright/test'
|
|
2
|
+
|
|
3
|
+
const PORT = process.env.PORT || '5042'
|
|
4
|
+
const baseURL = `http://127.0.0.1:${PORT}`
|
|
5
|
+
const timeout = 60000
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
testDir: './test/e2e',
|
|
9
|
+
fullyParallel: true,
|
|
10
|
+
reporter: 'html',
|
|
11
|
+
use: { baseURL, trace: 'on-first-retry' },
|
|
12
|
+
projects: [
|
|
13
|
+
{
|
|
14
|
+
name: 'chromium',
|
|
15
|
+
use: { ...devices['Desktop Chrome'] },
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
webServer: {
|
|
19
|
+
command: 'cd ../.. && npm run clean && npm run build && npm run start',
|
|
20
|
+
url: baseURL,
|
|
21
|
+
timeout,
|
|
22
|
+
stdout: 'pipe',
|
|
23
|
+
stderr: 'pipe',
|
|
24
|
+
env: { PORT, INCLUDE_ADMIN: '1' }
|
|
25
|
+
},
|
|
26
|
+
timeout
|
|
27
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { join } from 'path'
|
|
4
|
+
|
|
5
|
+
const __dirname = import.meta.dirname
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
plugins: {
|
|
9
|
+
tailwindcss: {
|
|
10
|
+
config: join(__dirname, '..', '..', 'node_modules', '@platformatic', 'ui-components', 'tailwind.config.cjs')
|
|
11
|
+
},
|
|
12
|
+
autoprefixer: {}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/CLAUDE.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Watt Admin Development Guide
|
|
2
|
-
|
|
3
|
-
## Build/Test/Lint Commands
|
|
4
|
-
```bash
|
|
5
|
-
# Development
|
|
6
|
-
npm run dev # Start development server
|
|
7
|
-
npm run build # Build for production
|
|
8
|
-
npm run start # Start in production mode
|
|
9
|
-
npm run clean # Remove build artifacts
|
|
10
|
-
|
|
11
|
-
# Testing
|
|
12
|
-
npm run test # Run all tests
|
|
13
|
-
npm run test:cli # Run CLI tests only
|
|
14
|
-
npm run test:backend # Run backend tests only
|
|
15
|
-
npm run test:frontend # Run frontend tests only
|
|
16
|
-
node --test test/path/to/file.test.js # Run single Node.js test file
|
|
17
|
-
cd web/frontend && vitest run path/to/file.test.ts # Run single frontend test
|
|
18
|
-
|
|
19
|
-
# Linting
|
|
20
|
-
npm run lint # Lint all code
|
|
21
|
-
npm run lint:fix # Fix linting issues automatically
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Code Style Guidelines
|
|
25
|
-
- **Formatting**: Project uses neostandard via ESLint (strict mode)
|
|
26
|
-
- **TypeScript**: Use explicit types for function params, returns, interfaces
|
|
27
|
-
- **Imports**: Group related imports, alphabetize within groups
|
|
28
|
-
- **Naming**: camelCase for variables/functions, PascalCase for components/classes/interfaces/types
|
|
29
|
-
- **Error Handling**: Log errors with fastify.log, handle async errors with try/catch
|
|
30
|
-
- **React**: Functional components with hooks, use React.ReactElement return types
|
|
31
|
-
- **Testing**: Node.js test module for backend, Vitest for frontend
|
|
32
|
-
- **Backend**: Follow Fastify conventions with typed routes using JsonSchemaToTsProvider
|
package/tsconfig.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "fastify-tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"sourceMap": true,
|
|
5
|
-
"pretty": true,
|
|
6
|
-
"noEmitOnError": true,
|
|
7
|
-
"incremental": true,
|
|
8
|
-
"outDir": "dist",
|
|
9
|
-
"noUnusedParameters": true,
|
|
10
|
-
"verbatimModuleSyntax": true
|
|
11
|
-
},
|
|
12
|
-
"watchOptions": {
|
|
13
|
-
"watchFile": "fixedPollingInterval",
|
|
14
|
-
"watchDirectory": "fixedPollingInterval",
|
|
15
|
-
"fallbackPolling": "dynamicPriority",
|
|
16
|
-
"synchronousWatchDirectory": true,
|
|
17
|
-
"excludeDirectories": [
|
|
18
|
-
"**/node_modules",
|
|
19
|
-
"dist"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "fastify-tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"sourceMap": true,
|
|
5
|
-
"pretty": true,
|
|
6
|
-
"noEmit": true,
|
|
7
|
-
"allowImportingTsExtensions": true,
|
|
8
|
-
"noEmitOnError": true,
|
|
9
|
-
"incremental": true,
|
|
10
|
-
"outDir": "dist",
|
|
11
|
-
"noUnusedParameters": true,
|
|
12
|
-
"verbatimModuleSyntax": true
|
|
13
|
-
},
|
|
14
|
-
"watchOptions": {
|
|
15
|
-
"watchFile": "fixedPollingInterval",
|
|
16
|
-
"watchDirectory": "fixedPollingInterval",
|
|
17
|
-
"fallbackPolling": "dynamicPriority",
|
|
18
|
-
"synchronousWatchDirectory": true,
|
|
19
|
-
"excludeDirectories": [
|
|
20
|
-
"**/node_modules",
|
|
21
|
-
"dist"
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"verbatimModuleSyntax": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"resolveJsonModule": true,
|
|
14
|
-
"isolatedModules": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
"jsx": "react-jsx",
|
|
17
|
-
|
|
18
|
-
/* Linting */
|
|
19
|
-
"strict": true,
|
|
20
|
-
"noImplicitAny": true,
|
|
21
|
-
"noUnusedLocals": true,
|
|
22
|
-
"noUnusedParameters": true,
|
|
23
|
-
"noFallthroughCasesInSwitch": true,
|
|
24
|
-
|
|
25
|
-
/* Paths */
|
|
26
|
-
"baseUrl": "."
|
|
27
|
-
},
|
|
28
|
-
"include": ["src", "*.d.ts"],
|
|
29
|
-
"references": [{ "path": "./tsconfig.node.json" }]
|
|
30
|
-
}
|