Skip to content

Commit

Permalink
Merge pull request #952 from samchon/features/param-title
Browse files Browse the repository at this point in the history
Supports parameter directly commented.
  • Loading branch information
samchon authored Jul 11, 2024
2 parents 787ffdd + 5c886ca commit 8440b05
Show file tree
Hide file tree
Showing 127 changed files with 1,330 additions and 281 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: pnpm/action-setup@v4
with:
version: 8

- name: test
working-directory: ./test
run: npm start

- name: migrate
working-directory: ./packages/migrate
run: pnpm install && npm run build && npm run test
run: npm install && npm run build && npm run test
3 changes: 0 additions & 3 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: pnpm/action-setup@v4
with:
version: 8
- name: Root Install
run: npm run package:tgz
- name: Build
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ Nestia is a set of helper libraries for NestJS, supporting below features:
- SDK library generator for clients
- Mockup Simulator for client applications
- Automatic E2E test functions generator
- `@nestia/e2e`
- Test program utilizing e2e test functions
- Benchmark program using e2e test functions
- `@nestia/e2e`: Test program utilizing e2e test functions
- `@nestia/benchmark`: Benchmark program using e2e test functions
- `@nestia/migrate`: OpenAPI generator from Swagger to NestJS/SDK
- `@nestia/editor`: Swagger-UI with Online TypeScript Editor
- `nestia`: Just CLI (command line interface) tool
Expand Down
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"reflect-metadata": "^0.2.2",
"tgrid": "^1.0.2",
"tstl": "^3.0.0",
"typia": "^6.4.2"
"typia": "^6.4.3"
},
"devDependencies": {
"@types/autocannon": "^7.9.0",
Expand Down
4 changes: 2 additions & 2 deletions deploy/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const setup = (tag) => (version) => (directory) => {
) {
if (tag === "tgz" && fs.existsSync(`${directory}/node_modules/${key}`))
try {
execute(directory)(`pnpm uninstall ${key}`);
execute(directory)(`npm uninstall ${key}`);
} catch {}
record[key] =
tag === "tgz"
Expand All @@ -51,7 +51,7 @@ const setup = (tag) => (version) => (directory) => {
// SETUP UPDATED DEPENDENCIES
fs.writeFileSync(file, JSON.stringify(info, null, 2), "utf8");
// execute(directory)("npm cache clean --force");
execute(directory)(`pnpm install`);
execute(directory)(`npm install`);
};

const deploy = (tag) => (version) => (name) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@nestia/station",
"version": "3.5.0",
"version": "3.6.1",
"description": "Nestia station",
"scripts": {
"build": "node build/index.js",
Expand Down
87 changes: 87 additions & 0 deletions packages/benchmark/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Nestia
![Nestia Logo](https://nestia.io/logo.png)

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
[![Downloads](https://img.shields.io/npm/dm/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
[![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)
[![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)
[![Discord Badge](https://img.shields.io/badge/discord-NestJS/Nestia-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.com/channels/520622812742811698/1197293125434093701)](https://discord.com/channels/520622812742811698/1181877086797967420)

Nestia is a set of helper libraries for NestJS, supporting below features:

- `@nestia/core`:
- Super-fast/easy decorators
- Advanced WebSocket routes
- `@nestia/sdk`:
- Swagger generator evolved than ever
- SDK library generator for clients
- Mockup Simulator for client applications
- Automatic E2E test functions generator
- `@nestia/e2e`: Test program utilizing e2e test functions
- `@nestia/benchmark`: Benchmark program using e2e test functions
- `@nestia/migrate`: OpenAPI generator from Swagger to NestJS/SDK
- `@nestia/editor`: Swagger-UI with Online TypeScript Editor
- `nestia`: Just CLI (command line interface) tool

> [!NOTE]
>
> - **Only one line** required, with pure TypeScript type
> - Enhance performance **30x** up
> - Runtime validator is **20,000x faster** than `class-validator`
> - JSON serialization is **200x faster** than `class-transformer`
> - Software Development Kit
> - Collection of typed `fetch` functions with DTO structures like [tRPC](https://trpc.io/)
> - Mockup simulator means embedded backend simulator in the SDK
> - similar with [msw](https://mswjs.io/), but fully automated
![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)

> Left is NestJS server code, and right is client (frontend) code utilizing SDK



## Sponsors and Backers
Thanks for your support.

Your donation would encourage `nestia` development.

[![Backers](https://opencollective.com/nestia/backers.svg?avatarHeight=75&width=600)](https://opencollective.com/nestia)




## Guide Documents
Check out the document in the [website](https://nestia.io/docs/):

### 🏠 Home
- [Introduction](https://nestia.io/docs/)
- [Setup](https://nestia.io/docs/setup/)
- [Pure TypeScript](https://nestia.io/docs/pure)

### 📖 Features
- Core Library
- [WebSocketRoute](https://nestia.io/docs/core/WebSocketRoute)
- [TypedRoute](https://nestia.io/docs/core/TypedRoute/)
- [TypedBody](https://nestia.io/docs/core/TypedBody/)
- [TypedParam](https://nestia.io/docs/core/TypedParam/)
- [TypedQuery](https://nestia.io/docs/core/TypedQuery/)
- [TypedHeaders](https://nestia.io/docs/core/TypedHeaders/)
- [TypedException](https://nestia.io/docs/core/TypedException/)
- Generators
- [Swagger Documents](https://nestia.io/docs/sdk/swagger/)
- [Software Development Kit](https://nestia.io/docs/sdk/sdk/)
- [E2E Functions](https://nestia.io/docs/sdk/e2e/)
- [Mockup Simulator](https://nestia.io/docs/sdk/simulator/)
- E2E Testing
- [Why E2E Test?](https://nestia.io/docs/e2e/why/)
- [Test Program Development](https://nestia.io/docs/e2e/development/)
- [Performance Benchmark](https://nestia.io/docs/e2e/benchmark/)
- [Swagger to NestJS](https://nestia.io/docs/migrate/)
- [TypeScript Swagger Editor](https://nestia.io/docs/editor/)

### 🔗 Appendix
- [API Documents](https://nestia.io/api)
- [⇲ Benchmark Result](https://github.com/samchon/nestia/tree/master/benchmark/results/11th%20Gen%20Intel(R)%20Core(TM)%20i5-1135G7%20%40%202.40GHz)
- [`dev.to` Articles](https://dev.to/samchon/series/22751)
8 changes: 4 additions & 4 deletions packages/benchmark/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/benchmark",
"version": "0.1.0",
"version": "0.1.1",
"description": "NestJS Performance Benchmark Program",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand All @@ -22,9 +22,9 @@
"author": "Jeongho Nam",
"license": "MIT",
"devDependencies": {
"@nestia/core": "^3.5.0",
"@nestia/core": "^3.6.1",
"@nestia/e2e": "^0.7.0",
"@nestia/sdk": "^3.5.0",
"@nestia/sdk": "^3.6.1",
"@nestjs/common": "^10.3.10",
"@nestjs/core": "^10.3.10",
"@nestjs/platform-express": "^10.3.10",
Expand All @@ -38,7 +38,7 @@
"uuid": "^10.0.0"
},
"dependencies": {
"@nestia/fetcher": "^3.5.0",
"@nestia/fetcher": "^3.6.1",
"tgrid": "^1.0.2",
"tstl": "^3.0.0"
},
Expand Down
5 changes: 2 additions & 3 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ Nestia is a set of helper libraries for NestJS, supporting below features:
- SDK library generator for clients
- Mockup Simulator for client applications
- Automatic E2E test functions generator
- `@nestia/e2e`
- Test program utilizing e2e test functions
- Benchmark program using e2e test functions
- `@nestia/e2e`: Test program utilizing e2e test functions
- `@nestia/benchmark`: Benchmark program using e2e test functions
- `@nestia/migrate`: OpenAPI generator from Swagger to NestJS/SDK
- `@nestia/editor`: Swagger-UI with Online TypeScript Editor
- `nestia`: Just CLI (command line interface) tool
Expand Down
12 changes: 6 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/core",
"version": "3.5.0",
"version": "3.6.1",
"description": "Super-fast validation decorators of NestJS",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -36,10 +36,10 @@
},
"homepage": "https://nestia.io",
"dependencies": {
"@nestia/fetcher": "../fetcher/nestia-fetcher-3.5.0.tgz",
"@nestia/fetcher": "^3.6.1",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"@samchon/openapi": "^0.3.0",
"@samchon/openapi": "^0.3.4",
"detect-ts-node": "^1.0.5",
"get-function-location": "^2.0.0",
"glob": "^7.2.0",
Expand All @@ -49,16 +49,16 @@
"reflect-metadata": ">=0.1.12",
"rxjs": ">=6.0.3",
"tgrid": "^1.0.0",
"typia": "^6.4.2",
"typia": "^6.4.3",
"ws": "^7.5.3"
},
"peerDependencies": {
"@nestia/fetcher": ">=3.5.0",
"@nestia/fetcher": ">=3.6.1",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"reflect-metadata": ">=0.1.12",
"rxjs": ">=6.0.3",
"typia": ">=6.4.2 <7.0.0"
"typia": ">=6.4.3 <7.0.0"
},
"devDependencies": {
"@fastify/multipart": "^8.1.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/fetcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ Nestia is a set of helper libraries for NestJS, supporting below features:
- SDK library generator for clients
- Mockup Simulator for client applications
- Automatic E2E test functions generator
- `@nestia/e2e`
- Test program utilizing e2e test functions
- Benchmark program using e2e test functions
- `@nestia/e2e`: Test program utilizing e2e test functions
- `@nestia/benchmark`: Benchmark program using e2e test functions
- `@nestia/migrate`: OpenAPI generator from Swagger to NestJS/SDK
- `@nestia/editor`: Swagger-UI with Online TypeScript Editor
- `nestia`: Just CLI (command line interface) tool
Expand Down
4 changes: 2 additions & 2 deletions packages/fetcher/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/fetcher",
"version": "3.5.0",
"version": "3.6.1",
"description": "Fetcher library of Nestia SDK",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -43,6 +43,6 @@
"src"
],
"dependencies": {
"@samchon/openapi": "^0.3.0"
"@samchon/openapi": "^0.3.4"
}
}
5 changes: 2 additions & 3 deletions packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ Nestia is a set of helper libraries for NestJS, supporting below features:
- SDK library generator for clients
- Mockup Simulator for client applications
- Automatic E2E test functions generator
- `@nestia/e2e`
- Test program utilizing e2e test functions
- Benchmark program using e2e test functions
- `@nestia/e2e`: Test program utilizing e2e test functions
- `@nestia/benchmark`: Benchmark program using e2e test functions
- `@nestia/migrate`: OpenAPI generator from Swagger to NestJS/SDK
- `@nestia/editor`: Swagger-UI with Online TypeScript Editor
- `nestia`: Just CLI (command line interface) tool
Expand Down
16 changes: 8 additions & 8 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/sdk",
"version": "3.5.0",
"version": "3.6.1",
"description": "Nestia SDK and Swagger generator",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -32,9 +32,9 @@
},
"homepage": "https://nestia.io",
"dependencies": {
"@nestia/fetcher": "../fetcher/nestia-fetcher-3.5.0.tgz",
"@nestia/core": "../core/nestia-core-3.5.0.tgz",
"@samchon/openapi": "^0.3.0",
"@nestia/fetcher": "^3.6.1",
"@nestia/core": "^3.6.1",
"@samchon/openapi": "^0.3.4",
"cli": "^1.0.1",
"get-function-location": "^2.0.0",
"glob": "^7.2.0",
Expand All @@ -44,16 +44,16 @@
"tsconfck": "^2.0.1",
"tsconfig-paths": "^4.1.1",
"tstl": "^3.0.0",
"typia": "^6.4.2"
"typia": "^6.4.3"
},
"peerDependencies": {
"@nestia/fetcher": ">=3.5.0",
"@nestia/core": ">=3.5.0",
"@nestia/fetcher": ">=3.6.1",
"@nestia/core": ">=3.6.1",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"reflect-metadata": ">=0.1.12",
"ts-node": ">=10.6.0",
"typia": ">=6.4.2 <7.0.0"
"typia": ">=6.4.3 <7.0.0"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/src/analyses/TypedHttpOperationAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ export namespace TypedHttpOperationAnalyzer {
optional,
type: tuple!.type,
typeName: tuple!.typeName,
description: CommentFactory.description(props.symbol),
jsDocTags: props.symbol.getJsDocTags(),
};
};
}
Expand Down
21 changes: 6 additions & 15 deletions packages/sdk/src/generates/SwaggerGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ITypedHttpRoute } from "../structures/ITypedHttpRoute";
import { ITypedWebSocketRoute } from "../structures/ITypedWebSocketRoute";
import { FileRetriever } from "../utils/FileRetriever";
import { MapUtil } from "../utils/MapUtil";
import { SwaggerDescriptionGenerator } from "./internal/SwaggerDescriptionGenerator";
import { SwaggerSchemaGenerator } from "./internal/SwaggerSchemaGenerator";

export namespace SwaggerGenerator {
Expand Down Expand Up @@ -388,21 +389,11 @@ export namespace SwaggerGenerator {
) !== undefined,
)
.map((tag) => tag.text!.find((elem) => elem.kind === "text")!.text);
const description: string | undefined = route.description?.length
? route.description
: undefined;
const summary: string | undefined = (() => {
if (description === undefined) return undefined;

const [explicit] = getJsDocTexts("summary");
if (explicit?.length) return explicit;

const index: number = description.indexOf("\n");
const top: string = (
index === -1 ? description : description.substring(0, index)
).trim();
return top.endsWith(".") ? top.substring(0, top.length - 1) : undefined;
})();
const { summary, description } = SwaggerDescriptionGenerator.generate({
description: route.description,
jsDocTags: route.jsDocTags,
kind: "summary",
});
const deprecated = route.jsDocTags.find(
(tag) => tag.name === "deprecated",
);
Expand Down
Loading

0 comments on commit 8440b05

Please sign in to comment.