这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/short-phones-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hey-api/openapi-ts': patch
---

fix(cli): move cli script to typescript
8 changes: 4 additions & 4 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pnpm --filter @example/openapi-ts-fetch dev
# Server starts on http://localhost:5173/

# Run CLI tool directly
node packages/openapi-ts/bin/index.cjs --help
node packages/openapi-ts/dist/run.js --help
# or after building
npx @hey-api/openapi-ts --help
```
Expand Down Expand Up @@ -85,14 +85,14 @@ After making changes, ALWAYS validate with these scenarios:

```bash
# Test CLI help
node packages/openapi-ts/bin/index.cjs --help
node packages/openapi-ts/dist/run.js --help

# Test CLI version
node packages/openapi-ts/bin/index.cjs --version
node packages/openapi-ts/dist/run.js --version

# Test basic code generation with a simple OpenAPI spec
# Create a minimal test spec and generate client code
node packages/openapi-ts/bin/index.cjs -i path/to/spec.json -o ./test-output --plugins "@hey-api/client-fetch" "@hey-api/typescript"
node packages/openapi-ts/dist/run.js -i path/to/spec.json -o ./test-output --plugins "@hey-api/client-fetch" "@hey-api/typescript"
```

2. **Example Application Test**:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ jobs:
- name: Build packages
run: pnpm build --filter="@hey-api/**"

- name: Build examples
if: matrix.node-version == '24.10.0' && matrix.os == 'ubuntu-latest'
run: pnpm build --filter="@example/**"

- name: Check examples generated code
if: matrix.node-version == '24.10.0' && matrix.os == 'ubuntu-latest'
run: pnpm examples:check

- name: Build examples
if: matrix.node-version == '24.10.0' && matrix.os == 'ubuntu-latest'
run: pnpm build --filter="@example/**"

- name: Run linter
run: pnpm lint

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ coverage
.turbo

# test files
.gen/
test/generated

# debug files
Expand Down
9 changes: 3 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@
"request": "launch",
"name": "openapi-ts",
"skipFiles": ["<node_internals>/**"],
"cwd": "${workspaceFolder}/dev",
"runtimeExecutable": "node",
"runtimeArgs": [],
"program": "${workspaceFolder}/packages/openapi-ts/bin/index.cjs",
"args": [
"-f",
"${workspaceFolder}/packages/openapi-ts-tests/main/test/openapi-ts.config.ts"
]
"runtimeArgs": ["-r", "ts-node/register/transpile-only"],
"program": "${workspaceFolder}/packages/openapi-ts/src/cli.ts"
}
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// @ts-ignore
import { defineConfig, utils } from '@hey-api/openapi-ts';

import { getSpecsPath } from '../../utils';
// @ts-ignore
import { myClientPlugin } from './custom/client/plugin';
import { myClientPlugin } from '../packages/openapi-ts-tests/main/test/custom/client/plugin';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import myClientPlugin.
import { getSpecsPath } from '../packages/openapi-ts-tests/utils';

// @ts-ignore
// eslint-disable-next-line arrow-body-style
Expand Down Expand Up @@ -96,14 +96,14 @@
// importFileExtension: '.ts',
// // indexFile: false,
// // lint: 'eslint',
// path: path.resolve(__dirname, 'generated', 'sample'),
// path: path.resolve(__dirname, '.gen'),
// tsConfigPath: path.resolve(
// __dirname,
// 'tsconfig',
// 'tsconfig.nodenext.json',
// ),
// },
path.resolve(__dirname, 'generated', 'sample'),
'.gen',
],
parser: {
filters: {
Expand Down Expand Up @@ -478,7 +478,7 @@
// // level: 'debug',
// path: './logs',
// },
// output: path.resolve(__dirname, 'generated', 'sample'),
// output: '.gen',
// },
];
});
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"@config/vite-base": "workspace:*",
"@eslint/js": "9.32.0",
"@hey-api/custom-client": "workspace:*",
"@hey-api/openapi-ts": "workspace:*",
"@types/node": "22.10.5",
"@typescript-eslint/eslint-plugin": "8.29.1",
"@vitest/coverage-v8": "3.1.1",
Expand All @@ -65,6 +66,7 @@
"prettier": "3.4.2",
"rollup": "4.31.0",
"rollup-plugin-dts": "6.1.1",
"ts-node": "10.9.2",
"tsdown": "0.15.8",
"turbo": "2.5.8",
"typescript": "5.9.3",
Expand Down
1 change: 1 addition & 0 deletions packages/openapi-ts-tests/main/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ coverage
.env

# test files
.gen/
test/generated
generated/
Loading
Loading