Skip to content

Commit bb504c5

Browse files
authored
Merge pull request #1686 from hey-api/ci/turbo
ci: add turborepo
2 parents 6787e25 + f102df1 commit bb504c5

File tree

24 files changed

+427
-687
lines changed

24 files changed

+427
-687
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535
run: pnpm install
3636

3737
- name: Build packages
38-
run: pnpm --filter './packages/**' run build
38+
run: pnpm build --filter="@hey-api/**"
3939

4040
- name: Build examples
4141
if: matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest'
42-
run: pnpm --filter './examples/**' --filter '!./examples/openapi-ts-sample' run build
42+
run: pnpm build --filter="@examples/**"
4343

4444
- name: Run linter
4545
run: pnpm lint

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ coverage
1616
.nuxt
1717
.output
1818
.svelte-kit
19+
.turbo
1920

2021
# test files
2122
test/generated

examples/openapi-ts-tanstack-svelte-query/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323
"@fontsource/fira-mono": "5.0.0",
2424
"@hey-api/openapi-ts": "workspace:*",
2525
"@neoconfetti/svelte": "2.0.0",
26-
"@sveltejs/adapter-auto": "3.0.0",
27-
"@sveltejs/kit": "2.8.3",
28-
"@sveltejs/vite-plugin-svelte": "3.0.0",
26+
"@sveltejs/adapter-auto": "4.0.0",
27+
"@sveltejs/kit": "2.17.1",
28+
"@sveltejs/vite-plugin-svelte": "5.0.3",
2929
"@types/eslint": "9.6.0",
3030
"eslint": "9.17.0",
3131
"eslint-config-prettier": "9.1.0",
3232
"eslint-plugin-svelte": "2.36.0",
3333
"globals": "15.14.0",
3434
"prettier": "3.4.2",
3535
"prettier-plugin-svelte": "3.1.2",
36-
"svelte": "4.2.19",
37-
"svelte-check": "3.6.0",
36+
"svelte": "5.19.9",
37+
"svelte-check": "4.1.4",
3838
"typescript": "5.5.3",
3939
"typescript-eslint": "8.19.1",
4040
"vite": "6.0.9",

examples/openapi-ts-tanstack-svelte-query/vite.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { sveltekit } from '@sveltejs/kit/vite';
22
import { defineConfig } from 'vitest/config';
33

44
export default defineConfig({
5-
plugins: [sveltekit()],
5+
// @ts-ignore
6+
plugins: [
7+
// @ts-expect-error
8+
sveltekit(),
9+
],
610
test: {
711
include: ['src/**/*.{test,spec}.{js,ts}'],
812
},

examples/openapi-ts-tanstack-vue-query/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"openapi-ts": "openapi-ts",
1313
"preview": "vite preview",
1414
"test:unit": "vitest",
15-
"typecheck:old": "vue-tsc --build --force",
16-
"typecheck": "vue-tsc --version"
15+
"typecheck": "vue-tsc --build --force"
1716
},
1817
"dependencies": {
1918
"@hey-api/client-fetch": "workspace:*",

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@
2020
"funding": "https://github.com/sponsors/hey-api",
2121
"type": "module",
2222
"scripts": {
23-
"build": "pnpm --recursive --filter '!./examples/openapi-ts-sample' build",
23+
"build": "turbo run build --filter=\"!@example/openapi-ts-sample\"",
2424
"changeset": "changeset",
2525
"client": "sh ./scripts/client.sh",
26-
"docs": "pnpm --filter @hey-api/docs --",
2726
"example": "sh ./scripts/example.sh",
2827
"format": "prettier --write .",
2928
"lint:fix": "prettier --check --write . && eslint . --fix",
3029
"lint": "prettier --check . && eslint .",
31-
"openapi-ts": "pnpm --filter @hey-api/openapi-ts --",
30+
"openapi-ts": "turbo run $1 --filter=\"@hey-api/openapi-ts\"",
3231
"prepare": "husky",
33-
"test:coverage": "pnpm --recursive test:coverage",
34-
"test:e2e": "pnpm --recursive test:e2e",
35-
"test:update": "pnpm --recursive test:update",
36-
"test": "pnpm --recursive test",
37-
"typecheck": "pnpm --recursive --filter '!./examples/openapi-ts-sample' typecheck"
32+
"test:coverage": "turbo run test:coverage",
33+
"test:e2e": "turbo run test:e2e",
34+
"test:update": "turbo run test:update",
35+
"test": "turbo run test",
36+
"typecheck": "turbo run typecheck --filter=\"!@example/openapi-ts-sample\"",
37+
"vitepress": "turbo run $1 --filter=\"@hey-api/docs\""
3838
},
3939
"engines": {
4040
"node": "^18.18.0 || ^20.9.0 || >=22.11.0"
@@ -60,6 +60,7 @@
6060
"rollup": "4.31.0",
6161
"rollup-plugin-dts": "6.1.1",
6262
"tsup": "8.3.5",
63+
"turbo": "2.4.0",
6364
"typescript": "5.5.3",
6465
"typescript-eslint": "8.19.1",
6566
"vitest": "1.6.0"

packages/openapi-ts/src/createClient.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ export const createClient = async ({
4848
let context: IR.Context | undefined;
4949

5050
if (data) {
51-
if (_watch) {
52-
console.clear();
53-
console.log(`⏳ Input changed, generating from ${inputPath}`);
54-
} else {
55-
console.log(`⏳ Generating from ${inputPath}`);
51+
if (config.logs.level !== 'silent') {
52+
if (_watch) {
53+
console.clear();
54+
console.log(`⏳ Input changed, generating from ${inputPath}`);
55+
} else {
56+
console.log(`⏳ Generating from ${inputPath}`);
57+
}
5658
}
5759

5860
Performance.start('parser');
@@ -83,10 +85,12 @@ export const createClient = async ({
8385
if (!config.dryRun) {
8486
processOutput({ config });
8587

86-
const outputPath = process.env.INIT_CWD
87-
? `./${path.relative(process.env.INIT_CWD, config.output.path)}`
88-
: config.output.path;
89-
console.log(`🚀 Done! Your output is in ${outputPath}`);
88+
if (config.logs.level !== 'silent') {
89+
const outputPath = process.env.INIT_CWD
90+
? `./${path.relative(process.env.INIT_CWD, config.output.path)}`
91+
: config.output.path;
92+
console.log(`🚀 Done! Your output is in ${outputPath}`);
93+
}
9094
}
9195
Performance.end('postprocess');
9296
}

packages/openapi-ts/src/openApi/2.0.x/parser/operation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ export const parseOperation = ({
331331
securitySchemesMap: Map<string, SecuritySchemeObject>;
332332
}) => {
333333
ensureUniqueOperationId({
334+
context,
334335
id: operation.operationId,
335336
method,
336337
operationIds,

packages/openapi-ts/src/openApi/3.0.x/parser/operation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ export const parseOperation = ({
222222
securitySchemesMap: Map<string, SecuritySchemeObject>;
223223
}) => {
224224
ensureUniqueOperationId({
225+
context,
225226
id: operation.operationId,
226227
method,
227228
operationIds,

packages/openapi-ts/src/openApi/3.1.x/parser/operation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ export const parseOperation = ({
207207
securitySchemesMap: Map<string, SecuritySchemeObject>;
208208
}) => {
209209
ensureUniqueOperationId({
210+
context,
210211
id: operation.operationId,
211212
method,
212213
operationIds,

0 commit comments

Comments
 (0)