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/afraid-news-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'openapi-ts-request': patch
---

fix: refactor test cases to use vitest as testing framework
5 changes: 5 additions & 0 deletions .changeset/eager-books-throw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'openapi-ts-request': patch
---

fix: 生成的类型缺少namespace问题
5 changes: 5 additions & 0 deletions .changeset/sharp-bees-stay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'openapi-ts-request': patch
---

style: prefer type import
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
'test',
'*.cjs',
'openapi-ts-request.config.ts',
'vitest.config.ts',
],
plugins: [],
parserOptions: {
Expand All @@ -21,5 +22,6 @@ module.exports = {
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
},
};
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Installing Dependencies
run: pnpm install

- name: Running unit Test
run: pnpm run test:unit
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: pnpm install

- name: Running Test
run: pnpm run test
- name: Running unit Test
run: pnpm run test:unit

- name: Running Build
run: pnpm run build
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# pnpm test
# pnpm test:unit
2 changes: 1 addition & 1 deletion README-en_US.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export default {
1. learn [Pull Request]("https://help.github.com/articles/using-pull-requests") specification
2. fork this repository
3. create a new branch to modify the code:`git checkout -b my-branch main`
4. make sure your code passes all test cases (new functional test cases need to be added for new features):`pnpm test`
4. make sure your code passes all test cases (new functional test cases need to be added for new features):`pnpm test:unit`
5. create a changeset file using the command:`pnpm changeset`
6. submit your changes using commit (must follow commitlint specification)
7. submit Pull Request
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ export default {
1. 熟悉 [Pull Request]("https://help.github.com/articles/using-pull-requests") 规范
2. fork 此仓库
3. 开一个新分支修改代码:`git checkout -b my-branch main`
4. 确保你的代码可以通过所有测试用例(新增功能需要添加新的功能测试用例):`pnpm test`
4. 确保你的代码可以通过所有测试用例(新增功能需要添加新的功能测试用例):`pnpm test:unit`
5. 创建 changeset 文件通过命令:`pnpm changeset`
6. 使用 commit 提交你的修改(需遵循 commitlint 规范)
7. 发起 Pull Request
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"changeset": "changeset",
"lint": "eslint ./src --report-unused-disable-directives --max-warnings=0",
"lint:fix": "eslint ./src --report-unused-disable-directives --max-warnings=0 --fix",
"test:unit": "vitest",
"test": "rm -rf ./test/apis/ ./test/mocks && npm run build && cd ./test && node ./test.js && cd ..",
"test:new": "npm run build && cd ./test && node ./test.js && cd ..",
"test:windows": "rimraf ./test/apis/ ./test/mocks && npm run build && cd ./test && node ./test.js && cd ..",
Expand Down Expand Up @@ -81,8 +82,10 @@
"husky": "^9.0.11",
"lint-staged": "^16.0.0",
"openapi-types": "^12.1.3",
"sanitize-filename": "^1.6.3",
"ts-node": "^10.9.2",
"typescript": "5.8.3"
"typescript": "5.8.3",
"vitest": "^3.2.4"
},
"keywords": [
"openapi",
Expand Down
Loading