From 972538e1fbc6b934cd5ed2382d59551d11e11389 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Mon, 7 Aug 2023 19:43:52 +0900 Subject: [PATCH] Enhance #744 - silent setup and enhanced documentation. A tiny change does not affect on main setup logic. So, this commit would be published with next patch. --- src/executable/TypiaSetupWizard.ts | 16 +++++++----- src/executable/setup/CommandExecutor.ts | 3 +-- website/pages/docs/setup.mdx | 10 ++++---- website/public/sitemap-0.xml | 34 ++++++++++++------------- 4 files changed, 33 insertions(+), 30 deletions(-) diff --git a/src/executable/TypiaSetupWizard.ts b/src/executable/TypiaSetupWizard.ts index deb934caf2..096e79498b 100644 --- a/src/executable/TypiaSetupWizard.ts +++ b/src/executable/TypiaSetupWizard.ts @@ -93,6 +93,7 @@ export namespace TypiaSetupWizard { (message: string) => async ( choices: Choice[], + filter?: (choice: string) => Choice, ): Promise => { questioned.value = true; return ( @@ -101,7 +102,7 @@ export namespace TypiaSetupWizard { name: name, message: message, choices: choices, - filter: (value) => value.split(" ")[0], + filter, }) )[name]; }; @@ -135,11 +136,14 @@ export namespace TypiaSetupWizard { return action(async (options) => { pack.manager = options.manager ??= await select("manager")( "Package Manager", - )([ - "npm" as const, - "pnpm" as const, - "yarn (berry is not supported)" as "yarn", - ]); + )( + [ + "npm" as const, + "pnpm" as const, + "yarn (berry is not supported)" as "yarn", + ], + (value) => value.split(" ")[0] as "yarn", + ); options.project ??= await configure(); if (questioned.value) console.log(""); diff --git a/src/executable/setup/CommandExecutor.ts b/src/executable/setup/CommandExecutor.ts index 8a5c2daba6..61d869b4d7 100644 --- a/src/executable/setup/CommandExecutor.ts +++ b/src/executable/setup/CommandExecutor.ts @@ -3,7 +3,6 @@ import cp from "child_process"; export namespace CommandExecutor { export const run = (str: string): void => { console.log(str); - cp.execSync(str, { stdio: "inherit" }); - // @todo - rollback to ignore + cp.execSync(str, { stdio: "ignore" }); }; } diff --git a/website/pages/docs/setup.mdx b/website/pages/docs/setup.mdx index 547125aeac..4a4a1a4e75 100644 --- a/website/pages/docs/setup.mdx +++ b/website/pages/docs/setup.mdx @@ -15,7 +15,7 @@ npx typia setup ```bash filename="Terminal" showLineNumbers copy pnpm install typia -pnpm typia setup +pnpm typia setup --manager pnpm ``` @@ -146,14 +146,14 @@ npx typia setup ```bash filename="Terminal" copy showLineNumbers pnpm install --save typia -pnpm typia setup +pnpm typia setup --manager pnpm ``` ```bash filename="Terminal" copy showLineNumbers # YARN BERRY IS NOT SUPPORTED yarn add typia -yarn typia setup +yarn typia setup --manager yarn ``` @@ -391,7 +391,7 @@ npm install --save-dev webpack webpack-cli ```bash filename="Terminal" copy showLineNumbers # TYPIA pnpm install typia -pnpm typia setup +pnpm typia setup --manager pnpm # WEBPACK + TS-LOADER pnpm install --save-dev ts-loader @@ -405,7 +405,7 @@ pnpm install --save-dev webpack webpack-cli ############################## # TYPIA yarn add typia -yarn typia setup +yarn typia setup --manager yarn # WEBPACK + TS-LOADER yarn add -D ts-loader diff --git a/website/public/sitemap-0.xml b/website/public/sitemap-0.xml index 77d622f5b5..0323f51e2d 100644 --- a/website/public/sitemap-0.xml +++ b/website/public/sitemap-0.xml @@ -1,20 +1,20 @@ -https://typia.io/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/json/parse/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/json/schema/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/json/stringify/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/miscellaneous/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/pure/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/random/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/setup/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/utilization/nestjs/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/utilization/prisma/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/utilization/trpc/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/validators/assert/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/validators/comment-tags/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/validators/is/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/docs/validators/validate/2023-08-07T08:56:20.582Zdaily0.7 -https://typia.io/playground/2023-08-07T08:56:20.582Zdaily0.7 +https://typia.io/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/json/parse/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/json/schema/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/json/stringify/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/miscellaneous/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/pure/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/random/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/setup/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/utilization/nestjs/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/utilization/prisma/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/utilization/trpc/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/validators/assert/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/validators/comment-tags/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/validators/is/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/docs/validators/validate/2023-08-07T10:43:15.494Zdaily0.7 +https://typia.io/playground/2023-08-07T10:43:15.494Zdaily0.7 \ No newline at end of file