Skip to content

Commit

Permalink
Enhance #744 - silent setup and enhanced documentation.
Browse files Browse the repository at this point in the history
A tiny change does not affect on main setup logic.

So, this commit would be published with next patch.
  • Loading branch information
samchon committed Aug 7, 2023
1 parent a296a8e commit 972538e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 30 deletions.
16 changes: 10 additions & 6 deletions src/executable/TypiaSetupWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export namespace TypiaSetupWizard {
(message: string) =>
async <Choice extends string>(
choices: Choice[],
filter?: (choice: string) => Choice,
): Promise<Choice> => {
questioned.value = true;
return (
Expand All @@ -101,7 +102,7 @@ export namespace TypiaSetupWizard {
name: name,
message: message,
choices: choices,
filter: (value) => value.split(" ")[0],
filter,
})
)[name];
};
Expand Down Expand Up @@ -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("");
Expand Down
3 changes: 1 addition & 2 deletions src/executable/setup/CommandExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
};
}
10 changes: 5 additions & 5 deletions website/pages/docs/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npx typia setup
<Tab>
```bash filename="Terminal" showLineNumbers copy
pnpm install typia
pnpm typia setup
pnpm typia setup --manager pnpm
```
</Tab>
<Tab>
Expand Down Expand Up @@ -146,14 +146,14 @@ npx typia setup
<Tab>
```bash filename="Terminal" copy showLineNumbers
pnpm install --save typia
pnpm typia setup
pnpm typia setup --manager pnpm
```
</Tab>
<Tab>
```bash filename="Terminal" copy showLineNumbers
# YARN BERRY IS NOT SUPPORTED
yarn add typia
yarn typia setup
yarn typia setup --manager yarn
```
</Tab>
</Tabs>
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
34 changes: 17 additions & 17 deletions website/public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://typia.io/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/parse/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/schema/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/stringify/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/miscellaneous/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/pure/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/random/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/setup/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/nestjs/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/prisma/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/trpc/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/assert/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/comment-tags/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/is/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/validate/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/playground/</loc><lastmod>2023-08-07T08:56:20.582Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/parse/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/schema/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/stringify/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/miscellaneous/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/pure/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/random/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/setup/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/nestjs/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/prisma/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/trpc/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/assert/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/comment-tags/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/is/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/validate/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/playground/</loc><lastmod>2023-08-07T10:43:15.494Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>

0 comments on commit 972538e

Please sign in to comment.