Skip to content

Commit cc85646

Browse files
author
Andrea Cosentino
committed
refactor: update plugin name
1 parent 9f69a7a commit cc85646

36 files changed

Lines changed: 5956 additions & 5956 deletions

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Features
1111

12-
- Initial release of vite-plugin-ws-rest-fs-api
12+
- Initial release of vite-plugin-universal-api
1313
- File-System based API for serving mock data from filesystem
1414
- REST API handlers for custom programmatic responses
1515
- WebSocket support with rooms and broadcast capabilities
@@ -29,4 +29,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- Examples and use cases
3030
- VitePress documentation site setup
3131

32-
[1.0.0]: https://github.com/nDriaDev/vite-plugin-ws-rest-fs-api/releases/tag/v1.0.0
32+
[1.0.0]: https://github.com/nDriaDev/vite-plugin-universal-api/releases/tag/v1.0.0

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<div align="center">
2-
<a href="https://vite-plugin-ws-rest-fs-api.ndria.dev/">
3-
<img src="https://raw.githubusercontent.com/nDriaDev/vite-plugin-ws-rest-fs-api/main/resources/img/logo_hd.png" alt="Go to web site">
2+
<a href="https://vite-plugin-universal-api.ndria.dev/">
3+
<img src="https://raw.githubusercontent.com/nDriaDev/vite-plugin-universal-api/main/resources/img/logo_hd.png" alt="Go to web site">
44
</a>
55
<br>
66

7-
# vite-plugin-ws-rest-fs-api
7+
# vite-plugin-universal-api
88

99
### Seamless Mock APIs, Accelerate Your Development Journey
1010

11-
[![npm version](https://img.shields.io/npm/v/%40ndriadev/vite-plugin-ws-rest-fs-api?color=orange&style=for-the-badge)](https://www.npmjs.com/package/%40ndriadev/vite-plugin-ws-rest-fs-api)
12-
![npm bundle size](https://img.shields.io/bundlephobia/minzip/%40ndriadev%2Fvite-plugin-ws-rest-fs-api?style=for-the-badge&label=SIZE&color=yellow)
13-
[![npm downloads](https://img.shields.io/npm/dt/%40ndriadev/vite-plugin-ws-rest-fs-api?label=DOWNLOADS&style=for-the-badge&color=red)](https://www.npmjs.com/package/%40ndriadev/vite-plugin-ws-rest-fs-api)
11+
[![npm version](https://img.shields.io/npm/v/%40ndriadev/vite-plugin-universal-api?color=orange&style=for-the-badge)](https://www.npmjs.com/package/%40ndriadev/vite-plugin-universal-api)
12+
![npm bundle size](https://img.shields.io/bundlephobia/minzip/%40ndriadev%2Fvite-plugin-universal-api?style=for-the-badge&label=SIZE&color=yellow)
13+
[![npm downloads](https://img.shields.io/npm/dt/%40ndriadev/vite-plugin-universal-api?label=DOWNLOADS&style=for-the-badge&color=red)](https://www.npmjs.com/package/%40ndriadev/vite-plugin-universal-api)
1414
[![License: MIT](https://img.shields.io/badge/LICENSE-MIT-blue.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
1515

1616
![Statements](https://img.shields.io/badge/statements-100%25-brightgreen.svg?style=for-the-badge)
@@ -58,7 +58,7 @@
5858

5959
## 🎯 Overview
6060

61-
**vite-plugin-ws-rest-fs-api** is a comprehensive Vite plugin that transforms your development server into a powerful mock backend. It provides three complementary approaches to handle API requests:
61+
**vite-plugin-universal-api** is a comprehensive Vite plugin that transforms your development server into a powerful mock backend. It provides three complementary approaches to handle API requests:
6262

6363
1. **📁 File-System Based API** - Automatically serve mock data from your file system
6464
2. **🔄 REST API Handlers** - Define custom programmatic handlers for dynamic responses
@@ -117,13 +117,13 @@ Perfect for frontend developers who need to:
117117

118118
```bash
119119
# pnpm (recommended)
120-
pnpm add -D @ndriadev/vite-plugin-ws-rest-fs-api
120+
pnpm add -D @ndriadev/vite-plugin-universal-api
121121

122122
# npm
123-
npm install -D @ndriadev/vite-plugin-ws-rest-fs-api
123+
npm install -D @ndriadev/vite-plugin-universal-api
124124

125125
# yarn
126-
yarn add -D @ndriadev/vite-plugin-ws-rest-fs-api
126+
yarn add -D @ndriadev/vite-plugin-universal-api
127127
```
128128

129129
### Requirements
@@ -140,7 +140,7 @@ yarn add -D @ndriadev/vite-plugin-ws-rest-fs-api
140140
```typescript
141141
// vite.config.ts
142142
import { defineConfig } from 'vite';
143-
import mockApi from '@ndriadev/vite-plugin-ws-rest-fs-api';
143+
import mockApi from '@ndriadev/vite-plugin-universal-api';
144144

145145
export default defineConfig({
146146
plugins: [
@@ -175,7 +175,7 @@ curl http://localhost:5173/api/users
175175
### Basic Options
176176

177177
```typescript
178-
interface ApiWsRestFsOptions {
178+
interface UniversalApiOptions {
179179
/**
180180
* Disable the entire plugin
181181
* @default false
@@ -300,7 +300,7 @@ interface RestHandler {
300300
/**
301301
* Handler function or 'FS' for file-system routing
302302
*/
303-
handle: 'FS' | ((req: ApiWsRestFsRequest, res: ServerResponse) => void | Promise<void>);
303+
handle: 'FS' | ((req: UniversalApiRequest, res: ServerResponse) => void | Promise<void>);
304304

305305
/**
306306
* Disable this specific handler
@@ -317,7 +317,7 @@ interface RestHandler {
317317
* For 'FS' handlers: function called before reading the file
318318
* Can modify path, check permissions, etc.
319319
*/
320-
preHandle?: (req: ApiWsRestFsRequest, res: ServerResponse) => {
320+
preHandle?: (req: UniversalApiRequest, res: ServerResponse) => {
321321
continueHandle: boolean;
322322
path?: string;
323323
} | Promise<{...}>;
@@ -326,7 +326,7 @@ interface RestHandler {
326326
* For 'FS' handlers: function called after reading the file
327327
* Can transform data, add headers, etc.
328328
*/
329-
postHandle?: (req: ApiWsRestFsRequest, res: ServerResponse, data: any) => {
329+
postHandle?: (req: UniversalApiRequest, res: ServerResponse, data: any) => {
330330
continueHandle: boolean;
331331
data?: any;
332332
} | Promise<{...}>;
@@ -1171,12 +1171,12 @@ handlers: [
11711171

11721172
## 📚 API Reference
11731173

1174-
### Request Object (ApiWsRestFsRequest)
1174+
### Request Object (UniversalApiRequest)
11751175

11761176
Extended `IncomingMessage` with additional properties:
11771177

11781178
```typescript
1179-
interface ApiWsRestFsRequest extends IncomingMessage {
1179+
interface UniversalApiRequest extends IncomingMessage {
11801180
/** Parsed request body (JSON, form data, etc.) */
11811181
body: any;
11821182

@@ -1554,7 +1554,7 @@ Response sent
15541554

15551555
```typescript
15561556
type MiddlewareFunction = (
1557-
req: ApiWsRestFsRequest,
1557+
req: UniversalApiRequest,
15581558
res: ServerResponse,
15591559
next: () => void
15601560
) => void | Promise<void>;
@@ -1573,7 +1573,7 @@ Example use cases:
15731573
```typescript
15741574
type ErrorHandlerFunction = (
15751575
err: any,
1576-
req: ApiWsRestFsRequest | IncomingMessage,
1576+
req: UniversalApiRequest | IncomingMessage,
15771577
res: ServerResponse,
15781578
next: (err?: any) => void
15791579
) => void | Promise<void>;
@@ -2070,8 +2070,8 @@ This will log:
20702070

20712071
## 📞 Support
20722072

2073-
- **Issues:** [GitHub Issues](https://github.com/nDriaDev/vite-plugin-ws-rest-fs-api/issues)
2074-
- **Discussions:** [GitHub Discussions](https://github.com/nDriaDev/vite-plugin-ws-rest-fs-api/discussions)
2073+
- **Issues:** [GitHub Issues](https://github.com/nDriaDev/vite-plugin-universal-api/issues)
2074+
- **Discussions:** [GitHub Discussions](https://github.com/nDriaDev/vite-plugin-universal-api/discussions)
20752075
- **Email:** info@ndria.dev
20762076

20772077
---
@@ -2081,6 +2081,6 @@ This will log:
20812081
<div align="center">
20822082

20832083

2084-
If you find this plugin useful, please consider giving it a ⭐ on [GitHub](https://github.com/nDriaDev/vite-plugin-ws-rest-fs-api)!
2084+
If you find this plugin useful, please consider giving it a ⭐ on [GitHub](https://github.com/nDriaDev/vite-plugin-universal-api)!
20852085

20862086
</div>

build.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineBuildConfig } from 'unbuild';
22

33
export default defineBuildConfig({
4-
name: "vite-plugin-ws-rest-fs-api",
4+
name: "vite-plugin-universal-api",
55
entries: ['src/index'],
66
externals: ['vite'],
77
clean: true,

docs/.vitepress/config.mts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const __filename = fileURLToPath(import.meta.url);
1010
const __dirname = dirname(__filename);
1111
// https://vitepress.dev/reference/site-config
1212
export default defineConfig({
13-
title: "vite-plugin-ws-rest-fs-api",
13+
title: "vite-plugin-universal-api",
1414
description: "Mock WebSocket, REST and File-based APIs for Vite",
1515
base: "/",
1616
buildEnd() {
@@ -102,8 +102,8 @@ export default defineConfig({
102102
]
103103
},
104104
socialLinks: [
105-
{ icon: 'github', link: 'https://github.com/nDriaDev/vite-plugin-ws-rest-fs-api' },
106-
{ icon: 'npm', link: 'https://www.npmjs.com/package/@ndriadev/vite-plugin-ws-rest-fs-api' },
105+
{ icon: 'github', link: 'https://github.com/nDriaDev/vite-plugin-universal-api' },
106+
{ icon: 'npm', link: 'https://www.npmjs.com/package/@ndriadev/vite-plugin-universal-api' },
107107
{ icon: 'googlehome', link: 'https://ndria.dev' }
108108
],
109109
footer: {
@@ -117,7 +117,7 @@ export default defineConfig({
117117
head: [
118118
['link', { rel: 'icon', type: 'image/png', href: '/logo.png' }],
119119
['meta', { property: 'og:type', content: 'website' }],
120-
['meta', { property: 'og:title', content: 'vite-plugin-ws-rest-fs-api' }],
120+
['meta', { property: 'og:title', content: 'vite-plugin-universal-api' }],
121121
['meta', { property: 'og:description', content: 'Mock WebSocket, REST and File-based APIs for Vite' }],
122122
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
123123
],

0 commit comments

Comments
 (0)