Skip to content

Commit

Permalink
Merge pull request #915 from samchon/features/setup
Browse files Browse the repository at this point in the history
Enhance guide documents of setup page
  • Loading branch information
samchon authored Dec 30, 2023
2 parents f3f01bb + 9ff73ef commit 5ee0a5e
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 28 deletions.
8 changes: 4 additions & 4 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
"prettier": "^2.8.8",
"rimraf": "^5.0.0",
"ts-node": "^10.9.1",
"typia": "^5.3.7-dev.20231230"
"typia": "^5.3.7"
}
}
79 changes: 76 additions & 3 deletions website/pages/docs/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,9 @@ pnpm install --save-dev webpack webpack-cli
</Tab>
<Tab>
```bash filename="Terminal" copy showLineNumbers
##############################
###########################################
# YARN BERRY IS NOT SUPPORTED
##############################
###########################################
# TYPIA
yarn add typia
yarn typia setup --manager yarn
Expand All @@ -456,7 +456,7 @@ yarn add -D webpack webpack-cli

When you're using `webpack` as a bundler, you can still utilize the [transformation](#transformation) mode.

Just install `ts-loader` as well as `webpack`, and configure `webpack.config.js` file like below, that's all.
Just install `ts-loader` as well as `webpack`, and configure `webpack.config.js` file like below.

```javascript filename="webpack.config.js" copy showLineNumbers
const path = require("path");
Expand Down Expand Up @@ -490,3 +490,76 @@ module.exports = {
},
};
```

From now on, you can build the single JS file just by running the `npx webpack` command. By the way, when removing `devDependencies` for `--production` install, never forget to add the `--ignore-scripts` option to prevent the `prepare` script.

<Tabs items={['npm', 'pnpm', 'yarn']}>
<Tab>
```bash filename="Terminal" copy showLineNumbers
npx webpack
npm ci --omit=dev --ignore-scripts
```
</Tab>
<Tab>
```bash filename="Terminal" copy showLineNumbers
pnpm webpack
pnpm install --production --ignore-scripts
```
</Tab>
<Tab>
```bash filename="Terminal" copy showLineNumbers
yarn webpack
rm -rf node_modules
yarn install --production --ignore-scripts --immutable
```
</Tab>
</Tabs>

Additionally, if you're using `typia` in the NodeJS project especially for the backend development, *Setup Guide Documents* of [`nestia`](https://github.com/samchon/nestia) would be helpful. Even though you're not using NestJS, you can still utilize below documents, and "Single JS file only" mode would be especially helpful for you.

- [Nestia > Setup > Webpack](https://nestia.io/docs/setup/#webpack)
- [With `node_modules`](https://nestia.io/docs/setup/#with-node_modules)
- [Single JS file only](https://nestia.io/docs/setup/#single-js-file-only)


## NX
<Tabs items={['npm', 'pnpm', 'yarn']}>
<Tab>
```bash filename="Terminal" copy showLineNumbers
npm install --save typia
npx typia setup
```
</Tab>
<Tab>
```bash filename="Terminal" copy showLineNumbers
pnpm install --save typia
pnpm typia setup --manager pnpm
```
</Tab>
<Tab>
```bash filename="Terminal" copy showLineNumbers
# YARN BERRY IS NOT SUPPORTED
yarn add typia
yarn typia setup --manager yarn
```
</Tab>
</Tabs>

After install `typia` like above, you have to modify `project.json` on each app like below.

```javascript filename="project.json" showLineNumbers copy
"targets": {
"build": {
...
"options": {
...
"target": "node",
"compiler": "tsc",
"transformers": [
"typia/lib/transform",
]
}
},
...
}
```
40 changes: 20 additions & 20 deletions website/public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?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-12-29T05:39:38.586Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/parse/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/schema/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/stringify/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/misc/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/protobuf/decode/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/protobuf/encode/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/protobuf/message/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/pure/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/random/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/setup/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/nestjs/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/prisma/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/trpc/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/assert/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/is/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/tags/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/validate/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/playground/</loc><lastmod>2023-12-29T05:39:38.587Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/</loc><lastmod>2023-12-30T15:49:02.590Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/parse/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/schema/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/json/stringify/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/misc/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/protobuf/decode/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/protobuf/encode/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/protobuf/message/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/pure/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/random/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/setup/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/nestjs/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/prisma/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/utilization/trpc/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/assert/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/is/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/tags/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/docs/validators/validate/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://typia.io/playground/</loc><lastmod>2023-12-30T15:49:02.591Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>

0 comments on commit 5ee0a5e

Please sign in to comment.