@slingr/cli 0.0.3 → 0.0.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/LICENSE.txt +202 -0
- package/README.md +490 -319
- package/bin/dev.cmd +2 -2
- package/bin/dev.js +5 -5
- package/bin/run.cmd +2 -2
- package/bin/run.js +4 -4
- package/bin/slingr +1 -0
- package/dist/commands/build.d.ts +20 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +206 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/create-app.d.ts +0 -1
- package/dist/commands/create-app.d.ts.map +1 -1
- package/dist/commands/create-app.js +38 -57
- package/dist/commands/create-app.js.map +1 -1
- package/dist/commands/debug.d.ts +28 -0
- package/dist/commands/debug.d.ts.map +1 -0
- package/dist/commands/debug.js +474 -0
- package/dist/commands/debug.js.map +1 -0
- package/dist/commands/ds.d.ts +14 -1
- package/dist/commands/ds.d.ts.map +1 -1
- package/dist/commands/ds.js +450 -121
- package/dist/commands/ds.js.map +1 -1
- package/dist/commands/gql.d.ts +1 -1
- package/dist/commands/gql.d.ts.map +1 -1
- package/dist/commands/gql.js +190 -184
- package/dist/commands/gql.js.map +1 -1
- package/dist/commands/infra/down.d.ts.map +1 -1
- package/dist/commands/infra/down.js +8 -7
- package/dist/commands/infra/down.js.map +1 -1
- package/dist/commands/infra/up.d.ts.map +1 -1
- package/dist/commands/infra/up.js +8 -7
- package/dist/commands/infra/up.js.map +1 -1
- package/dist/commands/infra/update.d.ts +1 -0
- package/dist/commands/infra/update.d.ts.map +1 -1
- package/dist/commands/infra/update.js +33 -69
- package/dist/commands/infra/update.js.map +1 -1
- package/dist/commands/run.d.ts +29 -2
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +628 -130
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +34 -71
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/sync-metadata.d.ts +15 -0
- package/dist/commands/sync-metadata.d.ts.map +1 -0
- package/dist/commands/sync-metadata.js +225 -0
- package/dist/commands/sync-metadata.js.map +1 -0
- package/dist/commands/users.d.ts +30 -0
- package/dist/commands/users.d.ts.map +1 -0
- package/dist/commands/users.js +472 -0
- package/dist/commands/users.js.map +1 -0
- package/dist/commands/views.d.ts +11 -0
- package/dist/commands/views.d.ts.map +1 -0
- package/dist/commands/views.js +73 -0
- package/dist/commands/views.js.map +1 -0
- package/dist/projectStructure.d.ts +2 -2
- package/dist/projectStructure.d.ts.map +1 -1
- package/dist/projectStructure.js +281 -69
- package/dist/projectStructure.js.map +1 -1
- package/dist/scripts/generate-metadata.d.ts +13 -0
- package/dist/scripts/generate-metadata.d.ts.map +1 -0
- package/dist/scripts/generate-metadata.js +412 -0
- package/dist/scripts/generate-metadata.js.map +1 -0
- package/dist/scripts/generate-metadata.ts +498 -0
- package/dist/scripts/generate-schema.d.ts +1 -1
- package/dist/scripts/generate-schema.js +168 -74
- package/dist/scripts/generate-schema.js.map +1 -1
- package/dist/scripts/generate-schema.ts +258 -143
- package/dist/templates/.env.template +23 -0
- package/dist/templates/.firebaserc.template +5 -0
- package/dist/templates/.github/copilot-instructions.md.template +652 -17
- package/dist/templates/backend/Dockerfile.template +30 -0
- package/dist/templates/config/datasource.ts.template +12 -9
- package/dist/templates/config/jest.config.ts +30 -30
- package/dist/templates/config/jest.setup.ts +1 -1
- package/dist/templates/config/tsconfig.json.template +50 -29
- package/dist/templates/dataSources/mysql.ts.template +16 -13
- package/dist/templates/dataSources/postgres.ts.template +15 -13
- package/dist/templates/dataset-generator-script.ts.template +139 -139
- package/dist/templates/datasets/mysql-default/.slingr-schema.json.template +5 -0
- package/dist/templates/datasets/mysql-default/Address.jsonl.template +3 -3
- package/dist/templates/datasets/mysql-default/App.jsonl.template +4 -4
- package/dist/templates/datasets/mysql-default/Company.jsonl.template +3 -3
- package/dist/templates/datasets/mysql-default/Person.jsonl.template +2 -2
- package/dist/templates/datasets/mysql-default/User.jsonl.template +1 -0
- package/dist/templates/datasets/mysql-default/instructions.md.template +1 -0
- package/dist/templates/datasets/postgres-default/.slingr-schema.json.template +5 -0
- package/dist/templates/datasets/postgres-default/Address.jsonl.template +3 -3
- package/dist/templates/datasets/postgres-default/App.jsonl.template +4 -4
- package/dist/templates/datasets/postgres-default/Company.jsonl.template +3 -3
- package/dist/templates/datasets/postgres-default/Person.jsonl.template +2 -2
- package/dist/templates/datasets/postgres-default/User.jsonl.template +1 -0
- package/dist/templates/datasets/postgres-default/instructions.md.template +1 -0
- package/dist/templates/docker-compose.prod-test.yml.template +32 -0
- package/dist/templates/docker-compose.yml.template +24 -0
- package/dist/templates/docs/app-description.md.template +33 -33
- package/dist/templates/firebase.json.template +68 -0
- package/dist/templates/frontend/.umirc.ts.template +23 -0
- package/dist/templates/frontend/package.json.template +45 -0
- package/dist/templates/frontend/public/config.json +6 -0
- package/dist/templates/frontend/public/logo.svg +6 -0
- package/dist/templates/frontend/src/app.tsx.template +44 -0
- package/dist/templates/frontend/src/global.less.template +117 -0
- package/dist/templates/frontend/src/layouts/MainLayout.tsx.template +75 -0
- package/dist/templates/frontend/src/types/graphql-augmentation.d.ts.template +44 -0
- package/dist/templates/frontend/src/views/customViews/user/UserCreateView.tsx.template +18 -0
- package/dist/templates/frontend/src/views/customViews/user/UserEditView.tsx.template +29 -0
- package/dist/templates/frontend/src/views/customViews/user/UserReadView.tsx.template +24 -0
- package/dist/templates/frontend/src/views/customViews/user/UserTableView.tsx.template +38 -0
- package/dist/templates/frontend/src/views/customViews/welcome.tsx.template +34 -0
- package/dist/templates/frontend/tsconfig.json.template +50 -0
- package/dist/templates/gql/codegen.yml.template +25 -25
- package/dist/templates/gql/index.ts.template +17 -24
- package/dist/templates/gql/operations.graphql.template +30 -30
- package/dist/templates/ops/README.md.template +1045 -0
- package/dist/templates/ops/cloudbuild.yaml.template +161 -0
- package/dist/templates/ops/scripts/_utils.js.template +217 -0
- package/dist/templates/ops/scripts/deploy.js.template +145 -0
- package/dist/templates/ops/scripts/setup-gcp.js.template +330 -0
- package/dist/templates/ops/scripts/setup-secrets.js.template +76 -0
- package/dist/templates/ops/scripts/test-prod-local.js.template +49 -0
- package/dist/templates/package.json.template +50 -38
- package/dist/templates/pnpm-workspace.yaml.template +3 -0
- package/dist/templates/prompt-analysis.md.template +110 -110
- package/dist/templates/prompt-script-generation.md.template +258 -258
- package/dist/templates/src/Address.ts.template +28 -31
- package/dist/templates/src/App.ts.template +17 -61
- package/dist/templates/src/Company.ts.template +41 -47
- package/dist/templates/src/Models.test.ts.template +654 -654
- package/dist/templates/src/Person.test.ts.template +289 -289
- package/dist/templates/src/Person.ts.template +90 -105
- package/dist/templates/src/actions/index.ts.template +11 -11
- package/dist/templates/src/auth/permissions.ts.template +34 -0
- package/dist/templates/src/data/App.ts.template +48 -0
- package/dist/templates/src/data/User.ts.template +35 -0
- package/dist/templates/src/types/gql.d.ts.template +17 -17
- package/dist/templates/vscode/extensions.json +4 -3
- package/dist/templates/vscode/settings.json +17 -11
- package/dist/templates/workspace-package.json.template +21 -0
- package/dist/utils/buildCache.d.ts +12 -0
- package/dist/utils/buildCache.d.ts.map +1 -0
- package/dist/utils/buildCache.js +102 -0
- package/dist/utils/buildCache.js.map +1 -0
- package/dist/utils/checkFramework.d.ts +27 -0
- package/dist/utils/checkFramework.d.ts.map +1 -0
- package/dist/utils/checkFramework.js +104 -0
- package/dist/utils/checkFramework.js.map +1 -0
- package/dist/utils/datasourceParser.d.ts +11 -0
- package/dist/utils/datasourceParser.d.ts.map +1 -1
- package/dist/utils/datasourceParser.js +154 -56
- package/dist/utils/datasourceParser.js.map +1 -1
- package/dist/utils/dockerManager.d.ts +25 -0
- package/dist/utils/dockerManager.d.ts.map +1 -0
- package/dist/utils/dockerManager.js +281 -0
- package/dist/utils/dockerManager.js.map +1 -0
- package/dist/utils/infraFileParser.d.ts +26 -0
- package/dist/utils/infraFileParser.d.ts.map +1 -0
- package/dist/utils/infraFileParser.js +75 -0
- package/dist/utils/infraFileParser.js.map +1 -0
- package/dist/utils/jsonlLoader.d.ts +91 -12
- package/dist/utils/jsonlLoader.d.ts.map +1 -1
- package/dist/utils/jsonlLoader.js +674 -63
- package/dist/utils/jsonlLoader.js.map +1 -1
- package/dist/utils/model-analyzer.d.ts.map +1 -1
- package/dist/utils/model-analyzer.js +67 -13
- package/dist/utils/model-analyzer.js.map +1 -1
- package/dist/utils/userManagement.d.ts +57 -0
- package/dist/utils/userManagement.d.ts.map +1 -0
- package/dist/utils/userManagement.js +288 -0
- package/dist/utils/userManagement.js.map +1 -0
- package/dist/utils/viewsGenerator.d.ts +15 -0
- package/dist/utils/viewsGenerator.d.ts.map +1 -0
- package/dist/utils/viewsGenerator.js +311 -0
- package/dist/utils/viewsGenerator.js.map +1 -0
- package/oclif.manifest.json +445 -20
- package/package.json +29 -26
- package/src/templates/.env.template +23 -0
- package/src/templates/.firebaserc.template +5 -0
- package/src/templates/.github/copilot-instructions.md.template +652 -17
- package/src/templates/backend/Dockerfile.template +30 -0
- package/src/templates/config/datasource.ts.template +12 -9
- package/src/templates/config/jest.config.ts +30 -30
- package/src/templates/config/jest.setup.ts +1 -1
- package/src/templates/config/tsconfig.json.template +50 -29
- package/src/templates/dataSources/mysql.ts.template +16 -13
- package/src/templates/dataSources/postgres.ts.template +15 -13
- package/src/templates/dataset-generator-script.ts.template +139 -139
- package/src/templates/datasets/mysql-default/.slingr-schema.json.template +5 -0
- package/src/templates/datasets/mysql-default/Address.jsonl.template +3 -3
- package/src/templates/datasets/mysql-default/App.jsonl.template +4 -4
- package/src/templates/datasets/mysql-default/Company.jsonl.template +3 -3
- package/src/templates/datasets/mysql-default/Person.jsonl.template +2 -2
- package/src/templates/datasets/mysql-default/User.jsonl.template +1 -0
- package/src/templates/datasets/mysql-default/instructions.md.template +1 -0
- package/src/templates/datasets/postgres-default/.slingr-schema.json.template +5 -0
- package/src/templates/datasets/postgres-default/Address.jsonl.template +3 -3
- package/src/templates/datasets/postgres-default/App.jsonl.template +4 -4
- package/src/templates/datasets/postgres-default/Company.jsonl.template +3 -3
- package/src/templates/datasets/postgres-default/Person.jsonl.template +2 -2
- package/src/templates/datasets/postgres-default/User.jsonl.template +1 -0
- package/src/templates/datasets/postgres-default/instructions.md.template +1 -0
- package/src/templates/docker-compose.prod-test.yml.template +32 -0
- package/src/templates/docker-compose.yml.template +24 -0
- package/src/templates/docs/app-description.md.template +33 -33
- package/src/templates/firebase.json.template +68 -0
- package/src/templates/frontend/.umirc.ts.template +23 -0
- package/src/templates/frontend/package.json.template +45 -0
- package/src/templates/frontend/public/config.json +6 -0
- package/src/templates/frontend/public/logo.svg +6 -0
- package/src/templates/frontend/src/app.tsx.template +44 -0
- package/src/templates/frontend/src/global.less.template +117 -0
- package/src/templates/frontend/src/layouts/MainLayout.tsx.template +75 -0
- package/src/templates/frontend/src/types/graphql-augmentation.d.ts.template +44 -0
- package/src/templates/frontend/src/views/customViews/user/UserCreateView.tsx.template +18 -0
- package/src/templates/frontend/src/views/customViews/user/UserEditView.tsx.template +29 -0
- package/src/templates/frontend/src/views/customViews/user/UserReadView.tsx.template +24 -0
- package/src/templates/frontend/src/views/customViews/user/UserTableView.tsx.template +38 -0
- package/src/templates/frontend/src/views/customViews/welcome.tsx.template +34 -0
- package/src/templates/frontend/tsconfig.json.template +50 -0
- package/src/templates/gql/codegen.yml.template +25 -25
- package/src/templates/gql/index.ts.template +17 -24
- package/src/templates/gql/operations.graphql.template +30 -30
- package/src/templates/ops/README.md.template +1045 -0
- package/src/templates/ops/cloudbuild.yaml.template +161 -0
- package/src/templates/ops/scripts/_utils.js.template +217 -0
- package/src/templates/ops/scripts/deploy.js.template +145 -0
- package/src/templates/ops/scripts/setup-gcp.js.template +330 -0
- package/src/templates/ops/scripts/setup-secrets.js.template +76 -0
- package/src/templates/ops/scripts/test-prod-local.js.template +49 -0
- package/src/templates/package.json.template +50 -38
- package/src/templates/pnpm-workspace.yaml.template +3 -0
- package/src/templates/prompt-analysis.md.template +110 -110
- package/src/templates/prompt-script-generation.md.template +258 -258
- package/src/templates/src/Address.ts.template +28 -31
- package/src/templates/src/App.ts.template +17 -61
- package/src/templates/src/Company.ts.template +41 -47
- package/src/templates/src/Models.test.ts.template +654 -654
- package/src/templates/src/Person.test.ts.template +289 -289
- package/src/templates/src/Person.ts.template +90 -105
- package/src/templates/src/actions/index.ts.template +11 -11
- package/src/templates/src/auth/permissions.ts.template +34 -0
- package/src/templates/src/data/App.ts.template +48 -0
- package/src/templates/src/data/User.ts.template +35 -0
- package/src/templates/src/types/gql.d.ts.template +17 -17
- package/src/templates/vscode/extensions.json +4 -3
- package/src/templates/vscode/settings.json +17 -11
- package/src/templates/workspace-package.json.template +21 -0
- package/dist/templates/src/index.ts +0 -66
- package/src/templates/src/index.ts +0 -66
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# docker-compose.prod-test.yml
|
|
2
|
+
# Extends docker-compose.yml to also run the backend as a production container.
|
|
3
|
+
# Use this to verify the Docker build and runtime config locally before deploying to GCP.
|
|
4
|
+
#
|
|
5
|
+
# Usage (from app root):
|
|
6
|
+
# docker compose -f docker-compose.yml -f docker-compose.prod-test.yml up --build
|
|
7
|
+
#
|
|
8
|
+
# The backend connects to the same DB container as local dev.
|
|
9
|
+
# DB_SYNCHRONIZE=true creates tables on first run (safe for local testing).
|
|
10
|
+
|
|
11
|
+
services:
|
|
12
|
+
backend:
|
|
13
|
+
build:
|
|
14
|
+
context: .
|
|
15
|
+
dockerfile: backend/Dockerfile
|
|
16
|
+
ports:
|
|
17
|
+
- "3000:3000"
|
|
18
|
+
environment:
|
|
19
|
+
PORT: "3000"
|
|
20
|
+
HOST: "0.0.0.0"
|
|
21
|
+
NODE_ENV: production
|
|
22
|
+
DB_HOST: {{DATASOURCE_NAME}}-db
|
|
23
|
+
DB_PORT: "{{#if_postgres}}5432{{/if_postgres}}{{#if_mysql}}3306{{/if_mysql}}"
|
|
24
|
+
DB_USER: "{{#if_postgres}}postgres{{/if_postgres}}{{#if_mysql}}root{{/if_mysql}}"
|
|
25
|
+
DB_PASSWORD: "{{#if_postgres}}postgres{{/if_postgres}}{{#if_mysql}}root{{/if_mysql}}"
|
|
26
|
+
DB_NAME: "{{APP_NAME}}"
|
|
27
|
+
DB_SYNCHRONIZE: "true"
|
|
28
|
+
JWT_SECRET: "local-test-secret-not-for-production"
|
|
29
|
+
depends_on:
|
|
30
|
+
{{DATASOURCE_NAME}}-db:
|
|
31
|
+
condition: service_healthy
|
|
32
|
+
restart: on-failure
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
services:
|
|
2
|
+
{{DATASOURCE_NAME}}-db:
|
|
3
|
+
environment:
|
|
4
|
+
{{#if_postgres}}POSTGRES_DB: {{APP_NAME}}
|
|
5
|
+
POSTGRES_PASSWORD: postgres
|
|
6
|
+
POSTGRES_USER: postgres{{/if_postgres}}{{#if_mysql}}MYSQL_DATABASE: {{APP_NAME}}
|
|
7
|
+
MYSQL_PASSWORD: mysql
|
|
8
|
+
MYSQL_ROOT_PASSWORD: mysql
|
|
9
|
+
MYSQL_USER: mysql{{/if_mysql}}
|
|
10
|
+
healthcheck:
|
|
11
|
+
interval: 2s
|
|
12
|
+
retries: 15
|
|
13
|
+
start_period: 10s
|
|
14
|
+
test:
|
|
15
|
+
- CMD-SHELL
|
|
16
|
+
- {{#if_postgres}}pg_isready -U postgres{{/if_postgres}}{{#if_mysql}}mysqladmin ping -h localhost{{/if_mysql}}
|
|
17
|
+
timeout: 5s
|
|
18
|
+
image: {{#if_postgres}}postgres:15-alpine{{/if_postgres}}{{#if_mysql}}mysql:8-oracle{{/if_mysql}}
|
|
19
|
+
ports:
|
|
20
|
+
- '{{#if_postgres}}5433{{/if_postgres}}{{#if_mysql}}3307{{/if_mysql}}:{{#if_postgres}}5432{{/if_postgres}}{{#if_mysql}}3306{{/if_mysql}}'
|
|
21
|
+
volumes:
|
|
22
|
+
- {{DATASOURCE_NAME}}-data:/var/lib/{{#if_postgres}}postgresql{{/if_postgres}}{{#if_mysql}}mysql{{/if_mysql}}/data
|
|
23
|
+
volumes:
|
|
24
|
+
{{DATASOURCE_NAME}}-data: null
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# {{APP_NAME}}
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
{{DESCRIPTION}}
|
|
5
|
-
|
|
6
|
-
## Application Type
|
|
7
|
-
{{APP_TYPE}}
|
|
8
|
-
|
|
9
|
-
## Architecture
|
|
10
|
-
- **Backend**: {{HAS_BACKEND}}
|
|
11
|
-
- **Frontend**: {{HAS_FRONTEND}}
|
|
12
|
-
- **Database**: {{DB_TYPE}}
|
|
13
|
-
|
|
14
|
-
## Getting Started
|
|
15
|
-
|
|
16
|
-
1. Install dependencies:
|
|
17
|
-
```bash
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
2. Start development:
|
|
22
|
-
```bash
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
3. Build for production:
|
|
27
|
-
```bash
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Development
|
|
32
|
-
- Use TypeScript for all development
|
|
33
|
-
- Follow the established patterns in the `src/data` directory
|
|
1
|
+
# {{APP_NAME}}
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
{{DESCRIPTION}}
|
|
5
|
+
|
|
6
|
+
## Application Type
|
|
7
|
+
{{APP_TYPE}}
|
|
8
|
+
|
|
9
|
+
## Architecture
|
|
10
|
+
- **Backend**: {{HAS_BACKEND}}
|
|
11
|
+
- **Frontend**: {{HAS_FRONTEND}}
|
|
12
|
+
- **Database**: {{DB_TYPE}}
|
|
13
|
+
|
|
14
|
+
## Getting Started
|
|
15
|
+
|
|
16
|
+
1. Install dependencies:
|
|
17
|
+
```bash
|
|
18
|
+
pnpm install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. Start development:
|
|
22
|
+
```bash
|
|
23
|
+
pnpm run dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
3. Build for production:
|
|
27
|
+
```bash
|
|
28
|
+
pnpm run build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Development
|
|
32
|
+
- Use TypeScript for all development
|
|
33
|
+
- Follow the established patterns in the `src/data` directory
|
|
34
34
|
- Refer to the GitHub Copilot instructions in `.github/copilot-instructions.md`
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hosting": {
|
|
3
|
+
"public": "frontend/dist",
|
|
4
|
+
"ignore": [
|
|
5
|
+
"firebase.json",
|
|
6
|
+
"**/.*",
|
|
7
|
+
"**/node_modules/**"
|
|
8
|
+
],
|
|
9
|
+
"rewrites": [
|
|
10
|
+
{
|
|
11
|
+
"source": "/graphql",
|
|
12
|
+
"run": {
|
|
13
|
+
"serviceId": "{{APP_NAME}}-backend",
|
|
14
|
+
"region": "us-central1"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"source": "/auth/**",
|
|
19
|
+
"run": {
|
|
20
|
+
"serviceId": "{{APP_NAME}}-backend",
|
|
21
|
+
"region": "us-central1"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"source": "/files/**",
|
|
26
|
+
"run": {
|
|
27
|
+
"serviceId": "{{APP_NAME}}-backend",
|
|
28
|
+
"region": "us-central1"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"source": "/data/**",
|
|
33
|
+
"run": {
|
|
34
|
+
"serviceId": "{{APP_NAME}}-backend",
|
|
35
|
+
"region": "us-central1"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"source": "**",
|
|
40
|
+
"destination": "/index.html"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"headers": [
|
|
44
|
+
{
|
|
45
|
+
"source": "**/*.@(js|css|map)",
|
|
46
|
+
"headers": [
|
|
47
|
+
{
|
|
48
|
+
"key": "Cache-Control",
|
|
49
|
+
"value": "public, max-age=31536000, immutable"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"source": "**",
|
|
55
|
+
"headers": [
|
|
56
|
+
{
|
|
57
|
+
"key": "X-Frame-Options",
|
|
58
|
+
"value": "SAMEORIGIN"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"key": "X-Content-Type-Options",
|
|
62
|
+
"value": "nosniff"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import baseConfig from '@slingr/framework-frontend/ui/config/umi.config';
|
|
2
|
+
import { defineConfig } from '@umijs/max';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
...baseConfig,
|
|
7
|
+
// Configure aliases to resolve peer dependencies from consuming app
|
|
8
|
+
alias: {
|
|
9
|
+
'@apollo/client/link/context': path.dirname(require.resolve('@apollo/client/package.json')) + '/link/context',
|
|
10
|
+
'@apollo/client/react': path.dirname(require.resolve('@apollo/client/package.json')) + '/react',
|
|
11
|
+
// Use $ for exact-match only. Without $, webpack treats this as a prefix
|
|
12
|
+
// alias and redirects @apollo/client/utilities/invariant (and every other
|
|
13
|
+
// sub-path) to the resolved entry file, breaking internal apollo imports.
|
|
14
|
+
'@apollo/client$': require.resolve('@apollo/client'),
|
|
15
|
+
},
|
|
16
|
+
// Keep class/function names intact so the view registry works after minification.
|
|
17
|
+
// Without this, constructor.name returns a mangled single-letter in production,
|
|
18
|
+
// breaking registerView / getViewClass lookups (e.g. "TaskCreateView" → "e").
|
|
19
|
+
jsMinifierOptions: {
|
|
20
|
+
keepNames: true,
|
|
21
|
+
},
|
|
22
|
+
// Remove manual routes - let custom views be auto-discovered
|
|
23
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{APP_NAME}}-frontend",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Slingr frontend views for {{APP_NAME}}",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "max dev",
|
|
7
|
+
"build": "pnpm run type-check && max build",
|
|
8
|
+
"type-check": "tsc --noEmit"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"slingr",
|
|
12
|
+
"ui"
|
|
13
|
+
],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@ant-design/icons": "^6.1.0",
|
|
18
|
+
"@ant-design/pro-components": "3.1.10-0",
|
|
19
|
+
"@apollo/client": "^4.0.11",
|
|
20
|
+
"@slingr/framework-frontend": "latest",
|
|
21
|
+
"@umijs/bundler-utoopack": "^4.6.32",
|
|
22
|
+
"@umijs/max": "^4.6.32",
|
|
23
|
+
"antd": "6.3.2",
|
|
24
|
+
"antd-style": "^4.1.0",
|
|
25
|
+
"classnames": "^2.5.1",
|
|
26
|
+
"dayjs": "^1.11.13",
|
|
27
|
+
"graphql": "^16.12.0",
|
|
28
|
+
"react": "18.3.1",
|
|
29
|
+
"react-dom": "18.3.1",
|
|
30
|
+
"rxjs": "^7.8.1",
|
|
31
|
+
"umi-presets-pro": "^2.0.3"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/fs-extra": "^11.0.4",
|
|
35
|
+
"@types/react": "^18.3.18",
|
|
36
|
+
"@types/react-dom": "^18.3.5",
|
|
37
|
+
"glob": "^11.0.0",
|
|
38
|
+
"ts-node": "^10.9.2",
|
|
39
|
+
"typescript": "^5.6.3"
|
|
40
|
+
},
|
|
41
|
+
"overrides": {
|
|
42
|
+
"@types/react": "^18.3.18",
|
|
43
|
+
"@types/react-dom": "^18.3.5"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="512" height="512">
|
|
3
|
+
<path d="M0 0 C3.49019058 0.00686373 6.98033832 -0.00372653 10.47052002 -0.01193976 C17.28636318 -0.02520217 24.10210661 -0.02243307 30.91795349 -0.01370184 C36.46282766 -0.00689595 42.00767411 -0.00602105 47.55255127 -0.00927329 C48.3450679 -0.00973299 49.13758453 -0.01019269 49.95411682 -0.01066632 C51.56465658 -0.0116256 53.17519634 -0.01259824 54.78573608 -0.01358409 C69.84850156 -0.02211603 84.91121205 -0.01233846 99.97396851 0.00381701 C112.86737777 0.01721819 125.76070597 0.01488947 138.65411377 0.00106072 C153.66706677 -0.01503405 168.67997171 -0.02129226 183.69293213 -0.01210248 C185.29718017 -0.01114695 186.90142822 -0.01020383 188.50567627 -0.00927329 C189.29476883 -0.00881046 190.08386139 -0.00834764 190.89686584 -0.00787079 C196.4279395 -0.00529256 201.95898238 -0.00962655 207.49005127 -0.01671195 C214.2408072 -0.02517063 220.99145863 -0.02275584 227.74220276 -0.00686972 C231.17920677 0.00095477 234.61603726 0.00420565 238.05303955 -0.00581717 C251.69362221 -0.03598372 264.75112803 -0.0081189 278.02911377 3.39217401 C278.92011276 3.61806018 279.81111176 3.84394635 280.72911072 4.07667756 C282.79956979 4.62963535 284.8144435 5.26054762 286.84161377 5.95467401 C287.9454541 6.33148309 287.9454541 6.33148309 289.07159424 6.71590447 C322.95567395 18.85465965 348.57739257 43.82093746 363.93780518 75.97078729 C365.65214291 79.77454603 367.1236871 83.63060319 368.46661377 87.57967401 C368.68929932 88.2303283 368.91198486 88.8809826 369.14141846 89.55135369 C369.85579459 91.81556279 370.44567857 94.09034075 371.02911377 96.39217401 C371.28139771 97.37878644 371.53368166 98.36539887 371.79361057 99.38190866 C374.64767727 112.28835759 374.46649112 125.13752333 374.43594682 138.30442405 C374.4311642 141.78651722 374.44376951 145.26855786 374.45396423 148.75063348 C374.47105989 155.55177024 374.47201146 162.35281423 374.46675133 169.15396687 C374.46269051 174.6892732 374.46417573 180.22455236 374.46949959 185.75985742 C374.47024801 186.55121916 374.47099643 187.3425809 374.47176753 188.1579233 C374.4732992 189.76620013 374.47483755 191.37447696 374.4763825 192.98275378 C374.49007453 208.0265612 374.48469347 223.07031646 374.47319729 238.11412266 C374.46327176 251.83454828 374.47619968 265.55483892 374.50013148 279.27524373 C374.5245977 293.41005593 374.53411174 307.54480546 374.52747875 321.67963839 C374.52400275 329.59652929 374.52611049 337.51331655 374.54372978 345.43019128 C374.55854646 352.1706066 374.55896521 358.91084528 374.54165887 365.65125749 C374.53322283 369.08070818 374.53081415 372.50984467 374.54631042 375.93927789 C374.68606003 415.0569671 364.00350509 448.42600395 336.15411377 476.76717401 C322.27312768 490.38779659 305.25302889 500.56866184 286.84161377 506.82967401 C286.19095947 507.05235955 285.54030518 507.2750451 284.86993408 507.50447869 C282.60574166 508.21884956 280.33090264 508.80864363 278.02911377 509.39217401 C277.04323776 509.64464206 276.05736176 509.89711011 275.04161072 510.15722871 C262.11566771 513.01857161 249.24500276 512.82280265 236.05822754 512.78434801 C232.56803696 512.77748428 229.07788922 512.78807454 225.58770752 512.79628778 C218.77186436 512.80955018 211.95612093 512.80678108 205.14027405 512.79804985 C199.59539987 512.79124396 194.05055343 512.79036906 188.50567627 512.7936213 C187.71315964 512.794081 186.92064301 512.7945407 186.10411072 512.79501433 C184.49357096 512.79597361 182.8830312 512.79694625 181.27249146 512.7979321 C166.20972598 512.80646404 151.14701549 512.79668648 136.08425903 512.780531 C123.19084977 512.76712982 110.29752157 512.76945854 97.40411377 512.78328729 C82.39116077 512.79938206 67.37825583 512.80564028 52.36529541 512.7964505 C50.76104737 512.79549496 49.15679932 512.79455185 47.55255127 512.7936213 C46.76345871 512.79315848 45.97436615 512.79269565 45.16136169 512.7922188 C39.63028804 512.78964057 34.09924516 512.79397456 28.56817627 512.80105996 C21.81742034 512.80951864 15.06676891 512.80710385 8.31602478 512.79121773 C4.87902077 512.78339324 1.44219028 512.78014237 -1.99481201 512.79016519 C-15.63539467 512.82033174 -28.69290049 512.79246691 -41.97088623 509.39217401 C-42.86188522 509.16628783 -43.75288422 508.94040166 -44.67088318 508.70767045 C-46.74134225 508.15471266 -48.75621596 507.52380039 -50.78338623 506.82967401 C-51.88722656 506.45286492 -51.88722656 506.45286492 -53.0133667 506.06844354 C-86.89744641 493.92968836 -112.51916503 468.96341055 -127.87957764 436.81356072 C-129.59391537 433.00980198 -131.06545956 429.15374482 -132.40838623 425.20467401 C-132.63107178 424.55401971 -132.85375732 423.90336541 -133.08319092 423.23299432 C-133.79756179 420.9688019 -134.38735586 418.69396287 -134.97088623 416.39217401 C-135.22335428 415.406298 -135.47582233 414.42042199 -135.73594093 413.40467095 C-138.59728384 400.47872795 -138.40151488 387.608063 -138.36306024 374.42128778 C-138.3561965 370.93109719 -138.36678676 367.44094946 -138.375 363.95076776 C-138.3882624 357.1349246 -138.38549331 350.31918117 -138.37676208 343.50333428 C-138.36995619 337.95846011 -138.36908129 332.41361367 -138.37233353 326.86873651 C-138.37302308 325.67996156 -138.37302308 325.67996156 -138.37372655 324.46717095 C-138.37468584 322.85663119 -138.37565848 321.24609144 -138.37664433 319.63555169 C-138.38517627 304.57278621 -138.3753987 289.51007572 -138.35924323 274.44731927 C-138.34584205 261.55391001 -138.34817076 248.66058181 -138.36199951 235.76717401 C-138.37809428 220.75422101 -138.3843525 205.74131607 -138.37516272 190.72835565 C-138.37420718 189.12410761 -138.37326407 187.51985956 -138.37233353 185.91561151 C-138.3718707 185.12651895 -138.37140787 184.33742639 -138.37093102 183.52442193 C-138.3683528 177.99334828 -138.37268678 172.46230539 -138.37977219 166.93123651 C-138.38823086 160.18048058 -138.38581608 153.42982914 -138.36992995 146.67908502 C-138.36210547 143.24208101 -138.35885459 139.80525051 -138.36887741 136.36824822 C-138.39904396 122.72766556 -138.37117914 109.67015974 -134.97088623 96.39217401 C-134.63205697 95.05567552 -134.63205697 95.05567552 -134.28638268 93.69217706 C-133.73342489 91.62171799 -133.10251262 89.60684428 -132.40838623 87.57967401 C-132.15718018 86.84378045 -131.90597412 86.1078869 -131.64715576 85.34969354 C-119.50840058 51.46561382 -94.54212277 25.8438952 -62.39227295 10.4834826 C-58.5885142 8.76914487 -54.73245705 7.29760068 -50.78338623 5.95467401 C-50.13273193 5.73198846 -49.48207764 5.50930291 -48.81170654 5.27986932 C-46.54751412 4.56549845 -44.2726751 3.97570438 -41.97088623 3.39217401 C-40.49207222 3.01347193 -40.49207222 3.01347193 -38.98338318 2.6271193 C-26.05744017 -0.2342236 -13.18677522 -0.03845464 0 0 Z " fill="#FEFEFE" transform="translate(137.97088623046875,-0.39217400550842285)"/>
|
|
4
|
+
<path d="M0 0 C15.37221225 -0.76312054 29.7208661 1.67635974 41.84375 11.86694336 C45.76329232 15.55832105 49.61742839 19.4464617 49.875 25.11303711 C49.51724641 30.0115094 48.1889472 32.47676212 44.78515625 36.13647461 C42.33356663 37.48367172 40.03435117 38.60212249 37.46875 39.66772461 C36.7484964 39.98042297 36.0282428 40.29312134 35.28616333 40.61529541 C33.74020938 41.28526323 32.1916906 41.94933809 30.64089966 42.60803223 C26.53785626 44.35299459 22.45609027 46.14664998 18.37109375 47.93334961 C17.55151688 48.29044006 16.73194 48.64753052 15.88752747 49.01544189 C-21.01712668 65.12643717 -58.13403601 84.80699473 -87.21484375 113.13647461 C-88.42527344 114.23668945 -88.42527344 114.23668945 -89.66015625 115.35913086 C-102.845337 127.67274881 -110.71228031 144.8013929 -111.5390625 162.74584961 C-112.16017791 185.6302987 -106.98375281 205.91643895 -91.21484375 223.13647461 C-90.69792969 223.72170898 -90.18101562 224.30694336 -89.6484375 224.90991211 C-72.2090348 243.52942476 -47.51411458 256.34996015 -25.17578125 267.95288086 C-23.15157855 269.17466058 -21.70005704 270.29630468 -20.21484375 272.13647461 C-19.87943193 276.24526946 -20.5035631 278.14494283 -22.91015625 281.49975586 C-37.39098212 298.1864423 -58.81776509 311.22288546 -81.21484375 313.13647461 C-91.26035233 313.60284998 -101.48529866 313.98175334 -111.21484375 311.13647461 C-112.65923828 310.7690918 -112.65923828 310.7690918 -114.1328125 310.39428711 C-143.62477868 302.27591396 -169.9069759 281.34096525 -191.21484375 260.13647461 C-192.03855469 259.31880615 -192.03855469 259.31880615 -192.87890625 258.48461914 C-213.22619338 238.03289243 -225.64221444 211.18297046 -225.58984375 182.07397461 C-225.46341996 145.66392233 -207.05448017 119.97182776 -182.15234375 94.94897461 C-181.49169922 94.28365723 -180.83105469 93.61833984 -180.15039062 92.93286133 C-176.22847932 89.02358255 -172.19552602 85.30152391 -168.00317383 81.68408203 C-165.82255988 79.79699509 -163.70814948 77.84301881 -161.58984375 75.88647461 C-155.38388505 70.30299809 -148.86672202 65.17383527 -142.21484375 60.13647461 C-141.53389648 59.62036621 -140.85294922 59.10425781 -140.15136719 58.57250977 C-128.65085012 49.91946383 -116.74200269 42.21839913 -104.21484375 35.13647461 C-103.39177734 34.66999512 -102.56871094 34.20351562 -101.72070312 33.72290039 C-77.45344591 20.12847807 -51.58053287 10.73913815 -24.71484375 3.82397461 C-23.24591675 3.4414856 -23.24591675 3.4414856 -21.74731445 3.05126953 C-14.49916059 1.24799825 -7.43950358 0.45840856 0 0 Z " fill="#0073D2" transform="translate(287.21484375,61.863525390625)"/>
|
|
5
|
+
<path d="M0 0 C5.69487372 4.69251011 11.05478942 9.73974003 16.390625 14.83203125 C17.04417969 15.43273437 17.69773437 16.0334375 18.37109375 16.65234375 C38.56653419 35.74447034 50.43613442 61.48332882 51.6640625 89.1015625 C52.17821863 109.2858115 48.20856317 127.92598011 38.328125 145.64453125 C37.84956055 146.5581543 37.84956055 146.5581543 37.36132812 147.49023438 C30.5312685 159.78933625 19.66761247 169.88268075 9.77490234 179.70849609 C7.88532053 181.58730548 6.00674595 183.47664979 4.12890625 185.3671875 C-2.81463701 192.31823649 -9.89995396 198.73207224 -17.609375 204.83203125 C-18.68876666 205.75399278 -19.76181713 206.68351064 -20.82421875 207.625 C-41.15333623 225.5041234 -64.51335188 238.76889756 -88.609375 250.83203125 C-89.72723389 251.39470703 -89.72723389 251.39470703 -90.86767578 251.96875 C-101.31669764 257.14492026 -112.25698041 260.89114067 -123.296875 264.58203125 C-123.99230408 264.8149588 -124.68773315 265.04788635 -125.40423584 265.28787231 C-135.05133869 268.5018174 -144.7370046 271.38692168 -154.609375 273.83203125 C-155.50825439 274.05624756 -156.40713379 274.28046387 -157.33325195 274.51147461 C-163.88121487 275.99008915 -170.28887223 276.16499428 -176.984375 276.14453125 C-178.03109375 276.16064453 -179.0778125 276.17675781 -180.15625 276.19335938 C-194.14437416 276.20199402 -206.94931707 272.59804676 -217.171875 262.70703125 C-220.8059056 258.94456298 -222.88837219 255.7715373 -223.046875 250.45703125 C-223.08683594 249.72742188 -223.12679687 248.9978125 -223.16796875 248.24609375 C-222.33423641 244.64297077 -220.26095011 242.29550552 -217.609375 239.83203125 C-214.81316786 238.09943791 -211.87255912 236.82855648 -208.84765625 235.546875 C-207.99231796 235.16868622 -207.13697968 234.79049744 -206.25572205 234.40084839 C-204.42856304 233.5943886 -202.59838567 232.79473844 -200.76550293 232.00137329 C-195.98122143 229.92885212 -191.22050994 227.80338323 -186.45703125 225.68359375 C-185.04609695 225.05796288 -185.04609695 225.05796288 -183.60665894 224.41969299 C-143.20870676 206.45243525 -83.76716792 178.8513622 -66.63671875 134.78515625 C-60.28360668 116.52297858 -59.84931871 99.17221048 -65.609375 80.83203125 C-66.0425 79.44564453 -66.0425 79.44564453 -66.484375 78.03125 C-77.20378668 48.0264682 -110.40247074 28.24068039 -137.3203125 14.3828125 C-138.09060791 13.98529785 -138.86090332 13.5877832 -139.65454102 13.17822266 C-141.12300152 12.4277851 -142.59719073 11.68841166 -144.07788086 10.96240234 C-148.20612705 8.8675906 -151.23911639 6.98157247 -153.609375 2.83203125 C-153.47727846 -2.97141005 -149.3924226 -6.20092078 -145.609375 -10.16796875 C-145.00867188 -10.83183594 -144.40796875 -11.49570313 -143.7890625 -12.1796875 C-100.87661237 -57.87516264 -40.72126334 -32.83520603 0 0 Z " fill="#0073D2" transform="translate(398.609375,174.16796875)"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{APP_NAME}} - Runtime Configuration
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import enUS from 'antd/locale/en_US';
|
|
6
|
+
import '../generated/gql';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
layoutConfig,
|
|
10
|
+
createInitialState,
|
|
11
|
+
createPatchClientRoutes,
|
|
12
|
+
createRootContainer
|
|
13
|
+
} from '@slingr/framework-frontend';
|
|
14
|
+
import { customViewsContext } from '../generated/context';
|
|
15
|
+
|
|
16
|
+
import MainLayout from './layouts/MainLayout';
|
|
17
|
+
|
|
18
|
+
export const getInitialState = createInitialState({
|
|
19
|
+
appName: '{{APP_NAME}}',
|
|
20
|
+
appVersion: '1.0.0',
|
|
21
|
+
layoutSettings: {
|
|
22
|
+
logo: '/logo.svg',
|
|
23
|
+
navTheme: 'light',
|
|
24
|
+
fixedHeader: false,
|
|
25
|
+
fixSiderbar: true,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export function layout(layoutParams: any) {
|
|
30
|
+
return layoutConfig(layoutParams);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const antd = (memo: any) => ({
|
|
34
|
+
...memo,
|
|
35
|
+
locale: enUS,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export const patchClientRoutes = createPatchClientRoutes({
|
|
40
|
+
viewsContext: customViewsContext,
|
|
41
|
+
defaultLayout: MainLayout,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const rootContainer: (container: React.ReactNode) => React.ReactNode = createRootContainer();
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Remove padding only from cards that contain tables (DataTable component)
|
|
2
|
+
.ant-card:has(.slingr-data-table) .ant-card-body,
|
|
3
|
+
.ant-pro-card:has(.slingr-data-table) .ant-pro-card-body {
|
|
4
|
+
padding: 0 !important;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ant-pro-page-container-children-container {
|
|
8
|
+
padding:0 !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ant-pro-page-container .ant-pro-page-container-warp-page-header {
|
|
12
|
+
padding-block-start: 8px;
|
|
13
|
+
padding-block-end: 16px;
|
|
14
|
+
padding-inline-start: 30px;
|
|
15
|
+
padding-inline-end: 40px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Ensure parent card body has no padding when it contains a table
|
|
19
|
+
.ant-card-body:has(.slingr-data-table),
|
|
20
|
+
.ant-pro-card-body:has(.slingr-data-table) {
|
|
21
|
+
padding: 0 !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Add padding to grid content that contains forms (not tables)
|
|
25
|
+
.ant-pro-grid-content:has(.ant-form):not(:has(.slingr-data-table)),
|
|
26
|
+
.ant-pro-grid-content:has(.ant-pro-form):not(:has(.slingr-data-table)) {
|
|
27
|
+
padding-inline: 30px !important;
|
|
28
|
+
padding-bottom: 45px !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Fallback: Add padding to cards that contain forms (not tables)
|
|
32
|
+
.ant-card:has(.ant-form):not(:has(.slingr-data-table)) .ant-card-body,
|
|
33
|
+
.ant-pro-card:has(.ant-pro-form):not(:has(.slingr-data-table)) .ant-pro-card-body {
|
|
34
|
+
padding: 24px !important;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ant-pro-query-filter {
|
|
38
|
+
padding: 16px !important;
|
|
39
|
+
padding-bottom: 0 !important;
|
|
40
|
+
width: 100% !important;
|
|
41
|
+
max-width: 100% !important;
|
|
42
|
+
margin-left: 0 !important;
|
|
43
|
+
margin-right: 0 !important;
|
|
44
|
+
|
|
45
|
+
.ant-form-item {
|
|
46
|
+
margin-bottom: 12px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ant-form-item-label {
|
|
50
|
+
flex: 0 0 auto !important;
|
|
51
|
+
max-width: none !important;
|
|
52
|
+
white-space: nowrap !important;
|
|
53
|
+
overflow: visible !important;
|
|
54
|
+
|
|
55
|
+
label {
|
|
56
|
+
line-height: 1.5 !important;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ant-form-item-control {
|
|
61
|
+
flex-grow: 1;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ant-pro-query-filter-actions {
|
|
66
|
+
flex-shrink: 0;
|
|
67
|
+
|
|
68
|
+
// Hide empty label in actions form item (mobile view optimization)
|
|
69
|
+
.ant-form-item-label {
|
|
70
|
+
display: none !important;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Fix row negative margins
|
|
75
|
+
.ant-row {
|
|
76
|
+
margin-left: 0 !important;
|
|
77
|
+
margin-right: 0 !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Fix column padding
|
|
81
|
+
.ant-col {
|
|
82
|
+
padding-left: 8px !important;
|
|
83
|
+
padding-right: 8px !important;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Fix filter form within ProTable - reduce spacing
|
|
88
|
+
.ant-pro-table {
|
|
89
|
+
.ant-pro-card-body {
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
|
|
92
|
+
.ant-pro-query-filter {
|
|
93
|
+
padding: 16px 24px !important;
|
|
94
|
+
padding-bottom: 8px !important;
|
|
95
|
+
margin-bottom: 8px !important;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ant-pro-table-search {
|
|
100
|
+
margin-block-end: 8px !important;
|
|
101
|
+
background: #ffffff;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Ensure form container adapts to available space
|
|
106
|
+
.ant-pro-form .ant-form-item-label > label {
|
|
107
|
+
overflow: hidden !important;
|
|
108
|
+
text-overflow: ellipsis !important;
|
|
109
|
+
white-space: nowrap !important;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Responsive: reduce row-gap on mobile
|
|
113
|
+
@media (max-width: 768px) {
|
|
114
|
+
.ant-pro-query-filter-row {
|
|
115
|
+
row-gap: 8px !important;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
BaseLayout,
|
|
4
|
+
Layout,
|
|
5
|
+
viewButton,
|
|
6
|
+
myProfileButton,
|
|
7
|
+
menu,
|
|
8
|
+
menuDivider,
|
|
9
|
+
Navigation,
|
|
10
|
+
ContentWidth,
|
|
11
|
+
} from '@slingr/framework-frontend';
|
|
12
|
+
import { HomeOutlined, UserOutlined } from '@ant-design/icons';
|
|
13
|
+
|
|
14
|
+
@Layout()
|
|
15
|
+
export default class MainLayout extends BaseLayout {
|
|
16
|
+
override navigation: Navigation = 'mix';
|
|
17
|
+
override contentWidth: ContentWidth = 'fluid';
|
|
18
|
+
|
|
19
|
+
override features: LayoutFeatures = {
|
|
20
|
+
header: true,
|
|
21
|
+
footer: false,
|
|
22
|
+
mainMenu: true,
|
|
23
|
+
secondaryMenu: false,
|
|
24
|
+
userMenu: true,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
override header: LayoutHeaderConfig = {
|
|
28
|
+
title: '{{APP_NAME}}',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
override mainMenu: MainMenuConfig = {
|
|
32
|
+
menu: menu({
|
|
33
|
+
items: [
|
|
34
|
+
viewButton({
|
|
35
|
+
elementId: 'welcome',
|
|
36
|
+
view: () => require('../views/customViews/welcome').default,
|
|
37
|
+
label: 'Home',
|
|
38
|
+
icon: <HomeOutlined />,
|
|
39
|
+
}),
|
|
40
|
+
viewButton({
|
|
41
|
+
elementId: 'users',
|
|
42
|
+
view: () => require('../views/customViews/user/UserTableView').default,
|
|
43
|
+
label: 'Users',
|
|
44
|
+
icon: <UserOutlined />,
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
override userMenu: UserMenuConfig = {
|
|
51
|
+
menu: menu({
|
|
52
|
+
items: [
|
|
53
|
+
myProfileButton({
|
|
54
|
+
elementId: 'my-profile',
|
|
55
|
+
view: () => require('../views/customViews/user/UserReadView').default,
|
|
56
|
+
label: 'My Profile',
|
|
57
|
+
icon: <UserOutlined />,
|
|
58
|
+
}),
|
|
59
|
+
menuDivider(),
|
|
60
|
+
],
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
override onMenuClick() {
|
|
65
|
+
console.log('[{{APP_NAME}}] Menu item clicked');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
override onMenuCollapse(collapsed: boolean): void {
|
|
69
|
+
console.log('[{{APP_NAME}}] Menu ' + (collapsed ? 'collapsed' : 'uncollapsed'));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
override onPageSwitch() {
|
|
73
|
+
console.log('[{{APP_NAME}}] Page switched');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL Type Augmentation
|
|
3
|
+
*
|
|
4
|
+
* This file augments the framework's GraphQL query builder types with
|
|
5
|
+
* application-specific operation names from the generated GraphQL schema.
|
|
6
|
+
*
|
|
7
|
+
* This enables compile-time validation of operation names when using:
|
|
8
|
+
* - uiQuery()
|
|
9
|
+
* - uiMutation()
|
|
10
|
+
* - dataQuery()
|
|
11
|
+
* - dataMutation()
|
|
12
|
+
*
|
|
13
|
+
* With this augmentation, you'll get:
|
|
14
|
+
* - TypeScript errors for invalid operation names
|
|
15
|
+
* - IntelliSense autocomplete for valid operations
|
|
16
|
+
* - Better developer experience and type safety
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // ✅ Valid - compiles fine
|
|
21
|
+
* uiQuery('UiUserFindBy')
|
|
22
|
+
* dataMutation('UserCreate')
|
|
23
|
+
*
|
|
24
|
+
* // ❌ Invalid - TypeScript compilation error
|
|
25
|
+
* uiQuery('InvalidOperationName')
|
|
26
|
+
* dataMutation('NonExistentMutation')
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import type { Query, Mutation } from '@gql/types';
|
|
31
|
+
|
|
32
|
+
declare module '@slingr/framework-frontend' {
|
|
33
|
+
/**
|
|
34
|
+
* Augment GraphQLQuery with application's Query type.
|
|
35
|
+
* This enables validation for uiQuery() and dataQuery().
|
|
36
|
+
*/
|
|
37
|
+
export interface GraphQLQuery extends Query {}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Augment GraphQLMutation with application's Mutation type.
|
|
41
|
+
* This enables validation for uiMutation() and dataMutation().
|
|
42
|
+
*/
|
|
43
|
+
export interface GraphQLMutation extends Mutation {}
|
|
44
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CreateView, CreateViewComponent, FormViewFields, FormViewLayout } from '@slingr/framework-frontend';
|
|
2
|
+
import { User } from '@gql';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* UserCreateView
|
|
6
|
+
*
|
|
7
|
+
* Default create form view for the User model.
|
|
8
|
+
* Path: /users/new
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
@CreateView<User>({
|
|
12
|
+
model: 'User',
|
|
13
|
+
path: '/users/new',
|
|
14
|
+
})
|
|
15
|
+
export default class UserCreateView extends CreateViewComponent<User> {
|
|
16
|
+
override fields?: FormViewFields<User> = ['firstName', 'lastName', 'email', 'status', 'roles'];
|
|
17
|
+
override formLayout?: FormViewLayout = 'oneColumn';
|
|
18
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EditView, EditViewComponent, FormViewFields, FormViewLayout, FieldNamesOf, toolbar } from '@slingr/framework-frontend';
|
|
2
|
+
import { User } from '@gql';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* UserEditView
|
|
6
|
+
*
|
|
7
|
+
* Default edit form view for the User model.
|
|
8
|
+
* Path: /users/:id/edit
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
@EditView<User>({
|
|
12
|
+
model: 'User',
|
|
13
|
+
path: '/users/:id/edit',
|
|
14
|
+
})
|
|
15
|
+
export default class UserEditView extends EditViewComponent<User> {
|
|
16
|
+
override fields?: FormViewFields<User> = ['firstName', 'lastName', 'fullName', 'email', 'status', 'roles'];
|
|
17
|
+
override formLayout?: FormViewLayout = 'oneColumn';
|
|
18
|
+
override formProps = {
|
|
19
|
+
layout: 'horizontal' as const,
|
|
20
|
+
labelCol: { span: 2 },
|
|
21
|
+
};
|
|
22
|
+
override toolbar = {
|
|
23
|
+
buttons: [
|
|
24
|
+
toolbar<User>()
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
override refreshTriggers?: FieldNamesOf<User>[] = ['firstName', 'lastName', 'email', 'fullName'];
|
|
28
|
+
}
|
|
29
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReadView, ReadViewComponent, toolbar } from '@slingr/framework-frontend';
|
|
2
|
+
import type { FormViewFields, FormViewLayout } from '@slingr/framework-frontend';
|
|
3
|
+
import { User } from '@gql';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* UserReadView
|
|
7
|
+
*
|
|
8
|
+
* Default read view for the User model.
|
|
9
|
+
* Path: /users/:id/view
|
|
10
|
+
*/
|
|
11
|
+
@ReadView<User>({
|
|
12
|
+
model: 'User',
|
|
13
|
+
path: '/users/:id/view',
|
|
14
|
+
})
|
|
15
|
+
export default class UserReadView extends ReadViewComponent<User> {
|
|
16
|
+
override fields?: FormViewFields<User> = ['firstName', 'lastName', 'fullName', 'email', 'status', 'roles', 'createdAt', 'updatedAt'];
|
|
17
|
+
override formLayout?: FormViewLayout = 'oneColumn';
|
|
18
|
+
override toolbar = {
|
|
19
|
+
buttons: [
|
|
20
|
+
toolbar<User>(),
|
|
21
|
+
UserReadView.toolbar.closeButton(),
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
}
|