-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #456 from hey-api/feat/client-axios
Client packages 📦
- Loading branch information
Showing
49 changed files
with
1,788 additions
and
428 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
import { defineConfig } from 'vitepress'; | ||
|
||
export default defineConfig({ | ||
title: 'Hey API', | ||
lastUpdated: false, | ||
sitemap: { | ||
hostname: 'https://heyapi.vercel.app', | ||
head: [ | ||
['link', { href: '/logo.png', rel: 'icon', type: 'image/png' }], | ||
['meta', { content: 'website', property: 'og:type' }], | ||
['meta', { content: 'en', property: 'og:locale' }], | ||
[ | ||
'meta', | ||
{ | ||
content: | ||
'Turn your OpenAPI specification into a beautiful TypeScript client', | ||
property: 'og:title', | ||
}, | ||
], | ||
['meta', { content: 'OpenAPI TypeScript', property: 'og:site_name' }], | ||
['meta', { content: '/logo.png', property: 'og:image' }], | ||
['meta', { content: 'https://heyapi.vercel.app', property: 'og:url' }], | ||
[ | ||
'script', | ||
{}, | ||
'window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };', | ||
], | ||
['script', { defer: '', src: '/_vercel/insights/script.js' }], | ||
], | ||
lastUpdated: false, | ||
sitemap: { | ||
hostname: 'https://heyapi.vercel.app', | ||
}, | ||
themeConfig: { | ||
externalLinkIcon: true, | ||
logo: '/logo.png', | ||
search: { | ||
provider: 'local', | ||
}, | ||
head: [ | ||
['link', { rel: 'icon', type: 'image/png', href: '/logo.png' }], | ||
['meta', { property: 'og:type', content: 'website' }], | ||
['meta', { property: 'og:locale', content: 'en' }], | ||
['meta', { property: 'og:title', content: 'Turn your OpenAPI specification into a beautiful TypeScript client' }], | ||
['meta', { property: 'og:site_name', content: 'OpenAPI TypeScript' }], | ||
['meta', { property: 'og:image', content: '/logo.png' }], | ||
['meta', { property: 'og:url', content: 'https://heyapi.vercel.app' }], | ||
['script', {}, 'window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };'], | ||
['script', { defer: '', src: '/_vercel/insights/script.js' }], | ||
socialLinks: [ | ||
{ icon: 'npm', link: 'https://npmjs.com/package/@hey-api/openapi-ts' }, | ||
{ icon: 'github', link: 'https://github.com/hey-api/openapi-ts' }, | ||
], | ||
themeConfig: { | ||
externalLinkIcon: true, | ||
logo: '/logo.png', | ||
socialLinks: [ | ||
{ icon: 'npm', link: 'https://npmjs.com/package/@hey-api/openapi-ts' }, | ||
{ icon: 'github', link: 'https://github.com/hey-api/openapi-ts' }, | ||
], | ||
search: { | ||
provider: 'local', | ||
} | ||
} | ||
}, | ||
title: 'Hey API', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
:root { | ||
--c-gradient-start: #d486b8; | ||
--vp-c-brand-1: #a37ab4; | ||
--vp-c-brand-2: #d486b8; | ||
--vp-c-brand-3: #a37ab4; | ||
--c-gradient-start: #d486b8; | ||
--vp-c-brand-1: #a37ab4; | ||
--vp-c-brand-2: #d486b8; | ||
--vp-c-brand-3: #a37ab4; | ||
} | ||
|
||
html.dark { | ||
--c-gradient-start: #86b9b0; | ||
--vp-c-bg: #001b2e; | ||
--vp-c-bg-alt: #041421; | ||
--vp-c-bg-soft: #041421; | ||
--vp-c-brand-1: #b3cde4; | ||
--vp-c-brand-2: #b3cde4; | ||
--vp-c-brand-3: #537692; | ||
--c-gradient-start: #86b9b0; | ||
--vp-c-bg: #001b2e; | ||
--vp-c-bg-alt: #041421; | ||
--vp-c-bg-soft: #041421; | ||
--vp-c-brand-1: #b3cde4; | ||
--vp-c-brand-2: #b3cde4; | ||
--vp-c-brand-3: #537692; | ||
} | ||
|
||
.soon { | ||
background-color: var(--vp-button-brand-bg); | ||
border-radius: 1em; | ||
color: var(--vp-button-brand-text); | ||
font-size: .6em; | ||
padding: .2em .4em; | ||
position: relative; | ||
text-transform: lowercase; | ||
top: -1em; | ||
background-color: var(--vp-button-brand-bg); | ||
border-radius: 1em; | ||
color: var(--vp-button-brand-text); | ||
font-size: 0.6em; | ||
padding: 0.2em 0.4em; | ||
position: relative; | ||
text-transform: lowercase; | ||
top: -1em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import DefaultTheme from 'vitepress/theme'; | ||
import './custom.css'; | ||
|
||
import DefaultTheme from 'vitepress/theme'; | ||
|
||
export default DefaultTheme; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# openapi-ts-docs | ||
# @hey-api/docs | ||
|
||
## 0.5.2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"name": "@hey-api/client-axios", | ||
"version": "0.1.0", | ||
"private": true, | ||
"type": "module", | ||
"description": "Type-safe Axios client for your openapi-ts types", | ||
"homepage": "https://heyapi.vercel.app/", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/hey-api/openapi-ts.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/hey-api/openapi-ts/issues" | ||
}, | ||
"license": "MIT", | ||
"keywords": [ | ||
"axios", | ||
"client", | ||
"codegen", | ||
"generator", | ||
"javascript", | ||
"openapi", | ||
"react", | ||
"svelte", | ||
"swagger", | ||
"typescript", | ||
"vue" | ||
], | ||
"main": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"build-bundle": "rollup --config rollup.config.ts --configPlugin typescript", | ||
"build-types-check": "tsc --project tsconfig.check.json", | ||
"build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp", | ||
"build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src", | ||
"build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check", | ||
"build": "pnpm clean && pnpm build-bundle && pnpm build-types", | ||
"clean": "rimraf dist coverage node_modules/.cache", | ||
"dev": "rimraf dist && pnpm build-bundle --watch", | ||
"prepublishOnly": "pnpm build", | ||
"test:coverage": "vitest run --coverage", | ||
"test:update": "vitest watch --update", | ||
"test:watch": "vitest watch", | ||
"test": "vitest run", | ||
"typecheck": "tsc --noEmit" | ||
}, | ||
"engines": { | ||
"node": "^18.0.0 || >=20.0.0" | ||
}, | ||
"dependencies": { | ||
"@hey-api/client-core": "workspace:*" | ||
}, | ||
"peerDependencies": { | ||
"axios": ">= 1.0.0 < 2" | ||
}, | ||
"devDependencies": { | ||
"axios": "1.6.8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { readFileSync } from 'node:fs'; | ||
import path from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
|
||
import commonjs from '@rollup/plugin-commonjs'; | ||
import terser from '@rollup/plugin-terser'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import type { RollupOptions } from 'rollup'; | ||
import { defineConfig } from 'rollup'; | ||
|
||
const __dirname = fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
const pkg = JSON.parse( | ||
readFileSync(new URL('./package.json', import.meta.url)).toString(), | ||
); | ||
|
||
export const externalDependencies = [ | ||
...Object.keys(pkg.dependencies ?? {}), | ||
...Object.keys(pkg.peerDependencies ?? {}), | ||
]; | ||
|
||
function createConfig(isProduction: boolean) { | ||
return defineConfig({ | ||
external: externalDependencies, | ||
input: path.resolve(__dirname, 'src/index.ts'), | ||
output: { | ||
file: path.resolve(__dirname, 'dist/index.cjs'), | ||
format: 'cjs', | ||
}, | ||
plugins: [ | ||
typescript({ | ||
declaration: false, | ||
tsconfig: path.resolve(__dirname, 'src/tsconfig.json'), | ||
}), | ||
commonjs({ | ||
sourceMap: false, | ||
}), | ||
isProduction && terser(), | ||
], | ||
}); | ||
} | ||
|
||
export default (commandLineArgs: any): RollupOptions[] => { | ||
const isDev = commandLineArgs.watch; | ||
const isProduction = !isDev; | ||
return defineConfig([createConfig(isProduction)]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { defineConfig } from 'rollup'; | ||
import dts from 'rollup-plugin-dts'; | ||
|
||
import { externalDependencies } from './rollup.config'; | ||
|
||
export default defineConfig({ | ||
external: externalDependencies, | ||
input: { | ||
index: './temp/index.d.ts', | ||
}, | ||
output: { | ||
dir: './dist', | ||
format: 'cjs', | ||
}, | ||
plugins: [dts({ respectExternal: true })], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
describe('Axios client', () => { | ||
it('works', () => { | ||
expect(1).toBe(1); | ||
}); | ||
}); |
Oops, something went wrong.