Skip to content

Commit

Permalink
refactor(architecture): rework to split core and all clients
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed Nov 16, 2022
1 parent ad1598c commit d58108b
Show file tree
Hide file tree
Showing 163 changed files with 11,447 additions and 211 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
extends: ['prettier'],
root: true,
extends: ['prettier', 'turbo'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ typings/
/.idea

package-lock.json
tests/generated/**
tests/generated/**
.turbo
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
. "$(dirname "$0")/_/husky.sh"

yarn lint
yarn test --run
yarn test:ci
yarn format:staged
111 changes: 20 additions & 91 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,85 +1,45 @@
{
"name": "orval",
"description": "A swagger client generator for typescript",
"version": "6.10.3",
"name": "orval-workspaces",
"namespace": "@orval",
"version": "6.11.0-alpha.1",
"license": "MIT",
"files": [
"dist"
"workspaces": [
"packages/*"
],
"bin": {
"orval": "dist/bin/orval.js"
},
"main": "dist/index.js",
"keywords": [
"rest",
"client",
"swagger",
"open-api",
"fetch",
"data fetching",
"code-generation",
"angular",
"react",
"react-query",
"svelte",
"svelte-query",
"vue",
"vue-query",
"msw",
"mock",
"axios",
"vue-query",
"vue",
"swr"
],
"author": {
"name": "Victor Bury",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://github.com/anymaniax/orval"
},
"private": true,
"scripts": {
"build": "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --minify --clean --dts --splitting",
"dev": "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --watch src --onSuccess 'yarn generate-api'",
"lint": "eslint src/**/*.ts",
"test": "vitest --global test.ts",
"old-build": "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --minify --clean --dts --splitting",
"old-dev": "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --watch src --onSuccess 'yarn generate-api'",
"old-lint": "eslint src/**/*.ts",
"old-test": "vitest --global test.ts",
"format": "prettier --write .",
"format:staged": "pretty-quick --staged",
"prerelease": "yarn build && cd ./tests && yarn generate && yarn build",
"release": "dotenv release-it",
"postrelease": "yarn build && yarn update-samples",
"generate-api": "node ./dist/bin/orval.js --config ./samples/react-query/basic/orval.config.ts --watch",
"prepare": "husky install && cd ./samples/react-query/basic && yarn",
"commitlint": "commitlint",
"update-samples": "zx ./scripts/update-samples.mjs"
"update-samples": "zx ./scripts/update-samples.mjs",
"build": "turbo run build",
"test": "turbo run test",
"test:ci": "turbo run test -- --run",
"lint": "turbo run lint",
"dev": "turbo run dev"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@faker-js/faker": "^7.4.0",
"@release-it/conventional-changelog": "^5.0.0",
"@types/chalk": "^2.2.0",
"@types/commander": "^2.12.2",
"@types/fs-extra": "^9.0.13",
"@types/inquirer": "^8.2.2",
"@types/lodash.get": "^4.4.7",
"@types/lodash.omit": "^4.5.7",
"@types/lodash.omitby": "^4.6.7",
"@types/lodash.uniq": "^4.5.7",
"@types/lodash.uniqby": "^4.7.7",
"@types/lodash.uniqwith": "^4.5.7",
"@types/micromatch": "^4.0.2",
"@types/node": "^18.7.3",
"@types/prettier": "^2.7.0",
"@types/request": "^2.48.8",
"@types/validator": "^13.7.5",
"@release-it/conventional-changelog": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"dotenv-cli": "^6.0.0",
"esbuild-plugin-alias": "^0.2.1",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-turbo": "^0.0.4",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
Expand All @@ -89,40 +49,9 @@
"release-it": "^15.3.0",
"rimraf": "^3.0.2",
"tsup": "^6.2.2",
"turbo": "^1.6.3",
"typescript": "^4.7.4",
"vitest": "^0.6.3",
"zx": "^7.0.8"
},
"dependencies": {
"@apidevtools/swagger-parser": "^10.1.0",
"acorn": "^8.8.0",
"cac": "^6.7.12",
"chalk": "^4.1.2",
"chokidar": "^3.5.3",
"compare-versions": "^4.1.3",
"cuid": "^2.1.8",
"debug": "^4.3.4",
"esbuild": "^0.15.3",
"esutils": "2.0.3",
"execa": "^5.1.1",
"find-up": "5.0.0",
"fs-extra": "^10.1.0",
"globby": "11.1.0",
"ibm-openapi-validator": "^0.88.0",
"inquirer": "^8.2.4",
"lodash.get": "^4.4.2",
"lodash.omit": "^4.5.0",
"lodash.omitby": "^4.6.0",
"lodash.uniq": "^4.5.0",
"lodash.uniqby": "^4.7.0",
"lodash.uniqwith": "^4.5.0",
"micromatch": "^4.0.5",
"openapi3-ts": "^3.0.0",
"string-argv": "^0.3.1",
"swagger2openapi": "^7.0.8",
"tsconfck": "^2.0.1",
"upath": "^2.0.1",
"url": "^0.11.0",
"validator": "^13.7.0"
}
}
28 changes: 28 additions & 0 deletions packages/angular/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[![npm version](https://badge.fury.io/js/orval.svg)](https://badge.fury.io/js/orval)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![tests](https://github.com/anymaniax/orval/actions/workflows/tests.yaml/badge.svg)](https://github.com/anymaniax/orval/actions/workflows/tests.yaml)

<p align="center">
<img src="./logo/orval-logo-horizontal.svg?raw=true" width="500" height="160" alt="orval - Restfull Client Generator" />
</p>
<h1 align="center">
Visit <a href="https://orval.dev" target="_blank">orval.dev</a> for docs, guides, API and beer!
</h1>

### Code Generation

`orval` is able to generate client with appropriate type-signatures (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in `yaml` or `json` formats.

`Generate`, `valid`, `cache` and `mock` in your React, Vue, Svelte and Angular applications all with your OpenAPI specification.

### Samples

You can find below some samples

- [react app](https://github.com/anymaniax/orval/tree/master/samples/react-app)
- [react query](https://github.com/anymaniax/orval/tree/master/samples/react-query)
- [svelte query](https://github.com/anymaniax/orval/tree/master/samples/svelte-query)
- [vue query](https://github.com/anymaniax/orval/tree/master/samples/vue-query)
- [react app with swr](https://github.com/anymaniax/orval/tree/master/samples/react-app-with-swr)
- [nx fastify react](https://github.com/anymaniax/orval/tree/master/samples/nx-fastify-react)
- [angular app](https://github.com/anymaniax/orval/tree/master/samples/angular-app)
18 changes: 18 additions & 0 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@orval/angular",
"version": "6.11.0-alpha.1",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsup ./src/index.ts --target node12 --minify --clean --dts --splitting",
"dev": "tsup ./src/index.ts --target node12 --clean --watch src",
"lint": "eslint src/**/*.ts"
},
"dependencies": {
"@orval/core": "6.11.0-alpha.1"
}
}
Loading

0 comments on commit d58108b

Please sign in to comment.