Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies #1115

Merged
merged 27 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fd1a189
`NestiaEditorModule`
samchon Nov 2, 2024
fd658dd
Merge pull request #1095 from samchon/feat/editor-module
samchon Nov 2, 2024
f195946
Update uploader.png
samchon Nov 2, 2024
5ac4469
Change html
samchon Nov 3, 2024
072e27f
Upgrade "typescript-transform-paths"
samchon Nov 5, 2024
7add92b
Remove package-lock.json of migrate
samchon Nov 5, 2024
5dc8571
Merge pull request #1096 from samchon/feat/typescript
samchon Nov 6, 2024
a421edc
Bump the nestjs group in /test with 5 updates
dependabot[bot] Nov 6, 2024
a5fcaae
Merge pull request #1098 from samchon/dependabot/npm_and_yarn/test/ne…
dependabot[bot] Nov 6, 2024
97bb590
Update @nestjs/swagger requirement in /test in the nestjs group
dependabot[bot] Nov 7, 2024
8ced830
Merge pull request #1100 from samchon/dependabot/npm_and_yarn/test/ne…
dependabot[bot] Nov 8, 2024
c9d4a27
Update @nestjs/swagger requirement in /test in the nestjs group
dependabot[bot] Nov 8, 2024
d5379f4
Merge pull request #1101 from samchon/dependabot/npm_and_yarn/test/ne…
dependabot[bot] Nov 9, 2024
f9fd2cc
Upgrade `typia` and `@samchon/openapi`
samchon Nov 11, 2024
d45d37d
Merge pull request #1102 from samchon/feat/typia
samchon Nov 11, 2024
9243a2c
Fix #1094: skip validation when no request body
samchon Nov 11, 2024
7c79b77
Fix test program level bug, the optional query parameter
samchon Nov 11, 2024
8e66379
Complete v3.19 update with `editor` and `migrate`.
samchon Nov 11, 2024
972fa92
Merge pull request #1103 from samchon/feat/request-body-optional
samchon Nov 11, 2024
ed59b4c
Bump the nestjs group in /test with 5 updates
dependabot[bot] Nov 15, 2024
40321e0
Merge pull request #1105 from samchon/dependabot/npm_and_yarn/test/ne…
dependabot[bot] Nov 16, 2024
40ac3e1
Updating docs for Nx
KyleBastien Nov 23, 2024
5130ba0
Merge pull request #1110 from KyleBastien/master
samchon Nov 23, 2024
bf45e3b
Change setup strategy.
samchon Nov 25, 2024
aeca37a
Merge pull request #1111 from samchon/feat/cli
samchon Nov 25, 2024
a383a42
Upgrade dependencies
samchon Nov 27, 2024
0556994
Test program execution to merge with master
samchon Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ updates:
- dependency-name: ts-node
- dependency-name: ts-patch
- dependency-name: typescript
- dependency-name: typescript-transform-paths
groups:
NestJS:
patterns:
Expand All @@ -38,4 +39,5 @@ updates:
patterns:
- "ts-node"
- "ts-patch"
- "typescript"
- "typescript"
- "typescript-transform-paths"
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.3",
"tstl": "^3.0.0",
"typia": "^7.0.0-dev.20241022-2"
"typia": "^7.0.0-dev.20241027-2"
},
"devDependencies": {
"@types/autocannon": "^7.9.0",
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": "4.0.0-dev.20241022",
"version": "4.0.0-dev.20241027",
"description": "Nestia station",
"scripts": {
"build": "node build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"ts-patch": "^3.2.1",
"typescript": "5.5.4",
"typescript-transform-paths": "^3.4.7",
"typia": "^7.0.0-dev.20241022-2",
"typia": "^7.0.0-dev.20241027-2",
"uuid": "^10.0.0"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nestia",
"version": "6.2.0",
"version": "6.3.0",
"description": "Nestia CLI tool",
"main": "bin/index.js",
"bin": {
Expand Down Expand Up @@ -42,7 +42,7 @@
"@types/inquirer": "^9.0.3",
"@types/node": "^18.11.16",
"rimraf": "^3.0.2",
"typescript": "^5.6.2"
"typescript": "~5.6.3"
},
"files": [
"bin",
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": "4.0.0-dev.20241022",
"version": "4.0.0-dev.20241027",
"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-4.0.0-dev.20241022.tgz",
"@nestia/fetcher": "../fetcher/nestia-fetcher-4.0.0-dev.20241027.tgz",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"@samchon/openapi": "^1.1.0",
"@samchon/openapi": "^2.0.0-dev.20241127-2",
"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": "^7.0.0-dev.20241022-2",
"typia": "^7.0.0-dev.20241027-2",
"ws": "^7.5.3"
},
"peerDependencies": {
"@nestia/fetcher": ">=4.0.0-dev.20241022",
"@nestia/fetcher": ">=4.0.0-dev.20241027",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"reflect-metadata": ">=0.1.12",
"rxjs": ">=6.0.3",
"typia": ">=7.0.0-dev.20241022-2 <8.0.0"
"typia": ">=7.0.0-dev.20241027-2 <8.0.0"
},
"devDependencies": {
"@fastify/multipart": "^8.1.0",
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/decorators/PlainBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type express from "express";
import type { FastifyRequest } from "fastify";

import { get_text_body } from "./internal/get_text_body";
import { is_request_body_undefined } from "./internal/is_request_body_undefined";
import { validate_request_body } from "./internal/validate_request_body";

/**
Expand Down Expand Up @@ -51,7 +52,12 @@ export function PlainBody(
const request: express.Request | FastifyRequest = context
.switchToHttp()
.getRequest();
if (!isTextPlain(request.headers["content-type"]))
if (
is_request_body_undefined(request) &&
(checker ?? (() => null))(undefined as any) === null
)
return undefined;
else if (!isTextPlain(request.headers["content-type"]))
throw new BadRequestException(`Request body type is not "text/plain".`);
const value: string = await get_text_body(request);
if (checker) {
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/decorators/TypedBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type express from "express";
import type { FastifyRequest } from "fastify";

import { IRequestBodyValidator } from "../options/IRequestBodyValidator";
import { is_request_body_undefined } from "./internal/is_request_body_undefined";
import { validate_request_body } from "./internal/validate_request_body";

/**
Expand Down Expand Up @@ -34,7 +35,9 @@ export function TypedBody<T>(
const request: express.Request | FastifyRequest = context
.switchToHttp()
.getRequest();
if (isApplicationJson(request.headers["content-type"]) === false)
if (is_request_body_undefined(request) && checker(undefined as T) === null)
return undefined;
else if (isApplicationJson(request.headers["content-type"]) === false)
throw new BadRequestException(
`Request body type is not "application/json".`,
);
Expand Down
14 changes: 14 additions & 0 deletions packages/core/src/decorators/internal/is_request_body_undefined.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type express from "express";
import type { FastifyRequest } from "fastify";

/**
* @internal
*/
export const is_request_body_undefined = (
request: express.Request | FastifyRequest,
): boolean =>
request.headers["content-type"] === undefined &&
(request.body === undefined ||
(typeof request.body === "object" &&
request.body !== null &&
Object.keys(request.body).length === 0));
1 change: 0 additions & 1 deletion packages/core/src/programmers/PlainBodyProgrammer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const validate = (metadata: Metadata): string[] => {
.reduce((a, b) => a + b, 0);
if (expected === 0 || expected !== metadata.size())
insert(`only string type is allowed`);
if (metadata.isRequired() === false) insert(`do not allow undefindable type`);
if (metadata.nullable === true) insert(`do not allow nullable type`);
else if (metadata.any === true) insert(`do not allow any type`);

Expand Down
88 changes: 5 additions & 83 deletions packages/core/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,85 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */

/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"lib": [
"DOM",
"ES2015"
], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
"sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "../../test/node_modules/@nestia/core/lib", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */

/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */

/* Additional Checks */
"noUnusedLocals": true, /* Report errors on unused locals. */
"noUnusedParameters": true, /* Report errors on unused parameters. */
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */

/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
"types": [
"node",
"reflect-metadata"
], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */

/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */

/* Experimental Options */
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
"emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
"stripInternal": true,

/* Advanced Options */
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
"plugins": [
{
"transform": "typia/lib/transform",
"functional": true,
}
],
"newLine": "LF",
},
"include": ["src"]
}
"target": "ES2015",
"outDir": "../../test/node_modules/@nestia/core/lib"
}
}
2 changes: 1 addition & 1 deletion packages/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"ts-patch": "^3.2.1",
"typescript": "^5.5.3",
"typescript-transform-paths": "^3.4.7",
"typia": "^7.0.0-dev.20241022-2"
"typia": "^7.0.0-dev.20241027-2"
},
"files": [
"lib",
Expand Down
18 changes: 13 additions & 5 deletions packages/editor/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "@nestia/editor",
"version": "0.6.2",
"version": "0.8.0",
"typings": "lib/index.d.ts",
"main": "lib/index.js",
"module": "lib/index.mjs",
"scripts": {
"build:lib": "tsc --project tsconfig.lib.json && rollup -c",
"build:static": "tsc -b && vite build",
"build": "npm run build:static && npm run build:lib",
"build:static": "rimraf dist && tsc -b && vite build",
"build:lib": "rimraf lib && tsc --project tsconfig.lib.json && rollup -c",
"dev": "vite",
"lint": "eslint .",
"preview": "vite preview"
Expand All @@ -33,18 +34,23 @@
"homepage": "https://nestia.io",
"dependencies": {
"@mui/material": "^5.15.6",
"@nestia/migrate": "^0.19.0",
"@nestia/migrate": "^0.20.0",
"@stackblitz/sdk": "^1.11.0",
"js-yaml": "^4.1.0",
"prettier": "^3.3.3",
"react-mui-fileuploader": "^0.5.2",
"typia": "^6.11.3"
"typia": "^6.12.0"
},
"devDependencies": {
"@eslint/js": "^9.13.0",
"@nestjs/common": "^10.4.6",
"@nestjs/core": "^10.4.6",
"@nestjs/platform-express": "^10.4.6",
"@nestjs/platform-fastify": "^10.4.6",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.1",
"@types/js-yaml": "^4.0.9",
"@types/node": "^22.8.6",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
Expand All @@ -55,6 +61,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rollup": "^4.24.2",
"ts-node": "^10.9.2",
"typescript": "^5.6.2",
"typescript-eslint": "^8.10.0",
"vite": "^5.4.9"
Expand All @@ -63,6 +70,7 @@
"README.md",
"LICENSE",
"package.json",
"dist",
"lib",
"src"
]
Expand Down
Loading