Skip to content

Commit

Permalink
add react-query for github
Browse files Browse the repository at this point in the history
  • Loading branch information
zenghongtu committed Feb 11, 2023
1 parent e0eefd6 commit 79f0651
Show file tree
Hide file tree
Showing 10 changed files with 79,219 additions and 23 deletions.
24 changes: 24 additions & 0 deletions openapi-codegen.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { defineConfig } from '@openapi-codegen/cli';
import {
generateReactQueryComponents,
generateSchemaTypes,
} from '@openapi-codegen/typescript';
export default defineConfig({
github: {
from: {
source: 'url',
url: 'https://api.apis.guru/v2/specs/github.com/1.1.4/openapi.yaml',
},
outputDir: './src/github',
to: async (context) => {
const filenamePrefix = 'github';
const { schemasFiles } = await generateSchemaTypes(context, {
filenamePrefix,
});
await generateReactQueryComponents(context, {
filenamePrefix,
schemasFiles,
});
},
},
});
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"dev:swan": "npm run build:swan -- --watch",
"dev:tt": "npm run build:tt -- --watch",
"dev:weapp": "npm run build:weapp -- --watch",
"format": "prettier --write \"src/**/*.{ts,tsx}\""
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
"gen:github": "openapi-codegen gen github"
},
"browserslist": [
"last 3 versions",
Expand All @@ -33,6 +34,7 @@
],
"dependencies": {
"@babel/runtime": "^7.7.7",
"@tanstack/react-query": "^4.24.4",
"@tarojs/components": "3.6.0",
"@tarojs/helper": "3.6.0",
"@tarojs/plugin-framework-react": "3.6.0",
Expand All @@ -58,10 +60,13 @@
"redux": "^4.2.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.4.2",
"taro-ui": "3.1.0-beta.4"
"taro-ui": "3.1.0-beta.4",
"zustand": "^4.3.3"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@openapi-codegen/cli": "^2.0.0",
"@openapi-codegen/typescript": "^6.1.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
"@tarojs/cli": "3.6.0",
"@tarojs/webpack5-runner": "3.6.0",
Expand Down
Loading

0 comments on commit 79f0651

Please sign in to comment.