diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml index 8bf6114500..82d89255ae 100644 --- a/.github/workflows/rust-tests.yml +++ b/.github/workflows/rust-tests.yml @@ -63,4 +63,11 @@ jobs: run: cargo run --features runtime-env --manifest-path server/Cargo.toml --bin redoc_ci > openapi.json - name: Vaccum lint run: vacuum lint openapi.json -r '.github/rules.yaml' -d + - name: Copy OpenAPI spec to sdk folder + run: cp openapi.json ./clients/ts-sdk/openapi.json + - name: Build the TS SDK + working-directory: ./clients/ts-sdk + run: yarn && yarn build:clean + - name: Typecheck all frontends + run: yarn && yarn typecheck diff --git a/clients/ts-sdk/package.json b/clients/ts-sdk/package.json index 1f8c1a29d5..632daccc7b 100644 --- a/clients/ts-sdk/package.json +++ b/clients/ts-sdk/package.json @@ -10,7 +10,7 @@ "license": "MIT", "scripts": { "lint": "eslint 'src/**/*.ts'", - "build:clean": "rm tsconfig.tsbuildinfo && rm -rf dist && yarn type:gen && yarn build", + "build:clean": "rm -f tsconfig.tsbuildinfo && rm -rf dist && yarn type:gen && yarn build", "build": "yarn build:src && yarn type:dts", "build:src": "node ./scripts/build.js", "type:gen": "node ./scripts/genClient.js", diff --git a/frontends/analytics/package.json b/frontends/analytics/package.json index 929b484cd7..d948c71c41 100644 --- a/frontends/analytics/package.json +++ b/frontends/analytics/package.json @@ -9,7 +9,8 @@ "preview": "vite preview", "lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\"", "lint:only": "eslint --fix \"src/**/*.{js,ts,jsx,tsx,}\"", - "lint:CI": "eslint --fix --output-file eslint_report.json --format json \"src/**/*.{js,ts,jsx,tsx,}\"" + "lint:CI": "eslint --fix --output-file eslint_report.json --format json \"src/**/*.{js,ts,jsx,tsx,}\"", + "typecheck": "tsc --noEmit" }, "dependencies": { "@nozbe/microfuzz": "^1.0.0", diff --git a/frontends/chat/package.json b/frontends/chat/package.json index 49f0fbe001..875b55281c 100644 --- a/frontends/chat/package.json +++ b/frontends/chat/package.json @@ -9,7 +9,8 @@ "preview": "vite preview", "lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\"", "lint:only": "eslint --fix \"src/**/*.{js,ts,jsx,tsx,}\"", - "lint:CI": "eslint --fix --output-file eslint_report.json --format json \"src/**/*.{js,ts,jsx,tsx,}\"" + "lint:CI": "eslint --fix --output-file eslint_report.json --format json \"src/**/*.{js,ts,jsx,tsx,}\"", + "typecheck": "tsc --noEmit" }, "dependencies": { "@corvu/resizable": "^0.2.2", diff --git a/frontends/dashboard/package.json b/frontends/dashboard/package.json index 913cbd1838..306c166ab5 100644 --- a/frontends/dashboard/package.json +++ b/frontends/dashboard/package.json @@ -9,7 +9,8 @@ "preview": "vite preview", "lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\"", "lint:only": "eslint --fix \"src/**/*.{js,ts,jsx,tsx,}\"", - "lint:CI": "eslint --fix --output-file eslint_report.json --format json \"src/**/*.{js,ts,jsx,tsx,}\"" + "lint:CI": "eslint --fix --output-file eslint_report.json --format json \"src/**/*.{js,ts,jsx,tsx,}\"", + "typecheck": "tsc --noEmit" }, "dependencies": { "@nozbe/microfuzz": "^1.0.0", diff --git a/frontends/search/package.json b/frontends/search/package.json index 7e13f68835..45bf39873f 100644 --- a/frontends/search/package.json +++ b/frontends/search/package.json @@ -8,7 +8,8 @@ "preview": "vite preview", "lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,}\"", "lint:only": "eslint --fix \"src/**/*.{js,ts,jsx,tsx,}\"", - "lint:CI": "eslint --fix --output-file eslint_report.json --format json \"src/**/*.{js,ts,jsx,tsx,}\"" + "lint:CI": "eslint --fix --output-file eslint_report.json --format json \"src/**/*.{js,ts,jsx,tsx,}\"", + "typecheck": "tsc --noEmit" }, "description": "The admin client for Trieve Search (https://search.trieve.ai)", "dependencies": { diff --git a/package.json b/package.json index 1482ade590..32185047bd 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "build": "turbo build", "build:clean-client": "./convenience.sh -c", "lint": "turbo lint", - "lint:CI": "turbo lint:CI" + "lint:CI": "turbo lint:CI", + "typecheck": "turbo typecheck" }, "repository": "git@github.com:devflowinc/trieve.git", "author": "Drew Harris ", diff --git a/turbo.json b/turbo.json index f9bc30d0c8..b44b87c0e8 100644 --- a/turbo.json +++ b/turbo.json @@ -3,24 +3,41 @@ "ui": "tui", "tasks": { "build": { - "outputs": ["dist/**"], - "dependsOn": ["^build"] + "outputs": [ + "dist/**" + ], + "dependsOn": [ + "^build" + ] }, "lint": { "cache": false, - "dependsOn": ["^build"] + "dependsOn": [ + "^build" + ] }, "lint:CI": { "cache": false, - "dependsOn": ["^build"] + "dependsOn": [ + "^build" + ] + }, + "typecheck": { + "dependsOn": [ + "^build" + ] }, "dev": { "persistent": true, "cache": false, - "dependsOn": ["trieve-ts-sdk#build"] + "dependsOn": [ + "trieve-ts-sdk#build" + ] }, "trieve-ts-sdk#build": { - "outputs": ["dist"] + "outputs": [ + "dist" + ] } } }