๐ Nuxt client for `@hey-api/openapi-ts` codegen.
++ + + +
+ +## GitHub Integration (coming soon) + +Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations.html). + +## Migration Guides + +[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating.html#openapi-typescript-codegen) diff --git a/packages/client-nuxt/package.json b/packages/client-nuxt/package.json new file mode 100644 index 000000000..ad328a6be --- /dev/null +++ b/packages/client-nuxt/package.json @@ -0,0 +1,74 @@ +{ + "name": "@hey-api/client-nuxt", + "version": "0.1.0", + "description": "๐ Nuxt client for `@hey-api/openapi-ts` codegen.", + "homepage": "https://heyapi.dev/", + "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", + "author": { + "email": "lubos@heyapi.dev", + "name": "Hey API", + "url": "https://heyapi.dev" + }, + "funding": "https://github.com/sponsors/hey-api", + "keywords": [ + "client", + "fetch", + "http", + "javascript", + "nuxt", + "openapi", + "react", + "rest", + "svelte", + "swagger", + "typescript", + "vue" + ], + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" + }, + "sideEffects": false, + "files": [ + "dist", + "LICENSE.md", + "src" + ], + "scripts": { + "build": "tsup && pnpm check-exports", + "check-exports": "attw --pack .", + "dev": "tsup --watch", + "prepublishOnly": "pnpm build", + "test:coverage": "vitest run --coverage", + "test:update": "vitest watch --update", + "test:watch": "vitest watch", + "test": "vitest run", + "typecheck": "vitest --typecheck --watch=false" + }, + "peerDependencies": { + "nuxt": ">= 3.0.0 < 4" + }, + "devDependencies": { + "nuxt": "3.15.0" + } +} diff --git a/packages/client-nuxt/src/__tests__/index.test.ts b/packages/client-nuxt/src/__tests__/index.test.ts new file mode 100644 index 000000000..de88d72d3 --- /dev/null +++ b/packages/client-nuxt/src/__tests__/index.test.ts @@ -0,0 +1,50 @@ +import { describe, expect, it } from 'vitest'; + +import { createClient } from '../index'; + +describe('buildUrl', () => { + const client = createClient(); + + const scenarios: { + options: Parameters