From 0437d6aada195a27e6a21a8ba3857854ba82319a Mon Sep 17 00:00:00 2001 From: Shreeyash Shrestha Date: Tue, 19 Nov 2024 14:43:23 +0545 Subject: [PATCH] Add ts files in "generated" on knip --- .../{workflows => }/pull_request_template.md | 0 Dockerfile | 4 +-- docker-compose-with-backend.yml | 2 +- env.sample | 5 ++++ env.ts | 22 +++++++++------ index.html | 3 +-- knip.json | 16 ----------- knip.jsonc | 18 +++++++++++++ package.json | 27 +++++++------------ pnpm-lock.yaml | 6 ++--- src/App/index.tsx | 16 ++++++----- type.template.tsx | 16 ----------- 12 files changed, 62 insertions(+), 73 deletions(-) rename .github/{workflows => }/pull_request_template.md (100%) create mode 100644 env.sample delete mode 100644 knip.json create mode 100644 knip.jsonc delete mode 100644 type.template.tsx diff --git a/.github/workflows/pull_request_template.md b/.github/pull_request_template.md similarity index 100% rename from .github/workflows/pull_request_template.md rename to .github/pull_request_template.md diff --git a/Dockerfile b/Dockerfile index 5b63b5cb..da63263c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,7 @@ FROM node:18-bullseye RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ - git bash g++ make iproute2 \ - && rm -rf /var/lib/apt/lists/* - + git bash g++ make \ RUN npm install -g pnpm WORKDIR /code diff --git a/docker-compose-with-backend.yml b/docker-compose-with-backend.yml index 492af476..d936724f 100644 --- a/docker-compose-with-backend.yml +++ b/docker-compose-with-backend.yml @@ -7,7 +7,7 @@ services: environment: APP_TITLE: ${APP_TITLE:-CMS} APP_GRAPHQL_ENDPOINT: ${APP_GRAPHQL_ENDPOINT:-http://localhost:8001/graphql/} - APP_GRAPHQL_CODEGEN_ENDPOINT: ${APP_GRAPHQL_CODEGEN_ENDPOINT:-http://web:8001/graphql/} + APP_GRAPHQL_CODEGEN_ENDPOINT: ${APP_GRAPHQL_CODEGEN_ENDPOINT:-./backend/schema.graphql} volumes: - ../:/code ports: diff --git a/env.sample b/env.sample new file mode 100644 index 00000000..a7a91f47 --- /dev/null +++ b/env.sample @@ -0,0 +1,5 @@ +COMPOSE_FILE= + +APP_TITLE= +APP_GRAPHQL_CODEGEN_ENDPOINT= +APP_GRAPHQL_ENDPOINT= diff --git a/env.ts b/env.ts index 3a233f53..535eb732 100644 --- a/env.ts +++ b/env.ts @@ -1,9 +1,15 @@ -import { - defineConfig, - Schema, -} from '@julr/vite-plugin-validate-env'; +import { Schema } from '@julr/vite-plugin-validate-env'; -export default defineConfig({ - COMPOSE_FILE: Schema.string.optional(), - APP_TITLE: Schema.string.optional(), -}); +const envConfig = { + validator: 'builtin', + debug: true, + schema: { + // NOTE: We need to replace with URL + APP_GRAPHQL_ENDPOINT: Schema.string(), + + // NOTE: It is not used for now + APP_TITLE: Schema.string.optional(), + }, +}; + +export default envConfig; diff --git a/index.html b/index.html index 5d8267dd..d2d5a3cd 100644 --- a/index.html +++ b/index.html @@ -21,8 +21,7 @@ %APP_TITLE% - - +