Skip to content

Commit

Permalink
Merge pull request #1422 from samchon/feat/nextra-v3
Browse files Browse the repository at this point in the history
Adapt nextra v3 update
  • Loading branch information
samchon authored Dec 11, 2024
2 parents 768db51 + 52ba5a8 commit 1e1ead2
Show file tree
Hide file tree
Showing 39 changed files with 763 additions and 795 deletions.
2 changes: 1 addition & 1 deletion website/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
6 changes: 4 additions & 2 deletions website/next.config.js → website/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const withNextra = require("nextra")({
import nextra from "nextra";

const withNextra = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});
Expand All @@ -18,4 +20,4 @@ const config = {
},
],
};
module.exports = config;
export default config;
8 changes: 4 additions & 4 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"@samchon/openapi": "latest",
"lz-string": "^1.5.0",
"monaco-editor": "^0.50.0",
"next": "^14.2.3",
"nextra": "^2.13.4",
"nextra-theme-docs": "^2.13.4",
"next": "^15.1.0",
"nextra": "^3.2.5",
"nextra-theme-docs": "^3.2.5",
"path": "^0.12.7",
"prettier": "^3.2.5",
"react": "^18.2.0",
Expand All @@ -49,7 +49,7 @@
"@types/prettier": "^3.0.0",
"@types/react": "^18.0.35",
"gh-pages": "^5.0.0",
"next-sitemap": "^4.0.7",
"next-sitemap": "^4.2.3",
"process": "^0.11.10",
"rimraf": "^5.0.0",
"ts-loader": "^9.5.1",
Expand Down
19 changes: 19 additions & 0 deletions website/pages/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default {
index: {
title: "Introduction",
type: "page",
hidden: true,
display: "hidden",
theme: {
layout: "full",
},
},
docs: {
title: "📖 Guide Documents",
type: "page",
},
playground: {
title: "💻 Playground",
type: "page",
},
};
19 changes: 0 additions & 19 deletions website/pages/_meta.json

This file was deleted.

37 changes: 37 additions & 0 deletions website/pages/docs/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
export default {
index: "🙋🏻‍♂️ Introduction",
setup: "📦 Setup",
pure: "⛲ Pure TypeScript",

"-- features": {
type: "separator",
title: "📖 Features",
},
validators: "Runtime Validators",
json: "Enhanced JSON",
llm: "LLM Function Calling",
protobuf: "Protocol Buffer",
random: "Random Generator",
misc: "Miscellaneous",

"-- appendix": {
type: "separator",
title: "🔗 Appendix",
},
utilization: "Utilization Cases",
api: {
title: "⇲ API Documents",
href: "/api",
newWindow: true,
},
benchmark: {
title: "⇲ Benchmark Result",
href: "https://github.com/samchon/typia/tree/master/benchmark/results/AMD%20Ryzen%209%207940HS%20w%20Radeon%20780M%20Graphics",
newWindow: true,
},
articles: {
title: "⇲ dev.to Articles",
href: "https://dev.to/samchon/series/22474",
newWindow: true,
},
};
37 changes: 0 additions & 37 deletions website/pages/docs/_meta.json

This file was deleted.

5 changes: 5 additions & 0 deletions website/pages/docs/json/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
schema: "JSON Schema",
stringify: "stringify() functions",
parse: "parse() functions",
};
5 changes: 0 additions & 5 deletions website/pages/docs/json/_meta.json

This file was deleted.

50 changes: 25 additions & 25 deletions website/pages/docs/json/parse.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tabs, Tab } from 'nextra-theme-docs'
import { Tabs } from 'nextra/components'

## `parse()` functions
<Tabs items={[
Expand All @@ -7,16 +7,16 @@ import { Tabs, Tab } from 'nextra-theme-docs'
<code>IValidation.ts</code>,
<code>Primitive.ts</code>
]}>
<Tab>
<Tabs.Tab>
```typescript copy
export namespace json {
export function isParse<T>(input: string): Primitive<T> | null;
export function assertParse<T>(input: string): Primitive<T>;
export function validateParse<T>(input: string): IValidation<Primitive<T>>;
}
```
</Tab>
<Tab>
</Tabs.Tab>
<Tabs.Tab>
```typescript copy
export class TypeGuardError extends Error {
public readonly method: string;
Expand All @@ -25,8 +25,8 @@ export class TypeGuardError extends Error {
public readonly value: any;
}
```
</Tab>
<Tab>
</Tabs.Tab>
<Tabs.Tab>
```typescript copy
export type IValidation<T> = IValidation.ISuccess<T> | IValidation.IFailure;
export namespace IValidation {
Expand All @@ -46,8 +46,8 @@ export namespace IValidation {
}
}
```
</Tab>
<Tab>
</Tabs.Tab>
<Tabs.Tab>
```typescript showLineNumbers copy
/**
* Primitive type of JSON.
Expand Down Expand Up @@ -185,7 +185,7 @@ interface IJsonable<T> {
toJSON(): T;
}
```
</Tab>
</Tabs.Tab>
</Tabs>

Type safe JSON parser.
Expand All @@ -201,7 +201,7 @@ If you want to know every type error infos detaily, you can use `typia.json.vali
Look at the below code, then you may understand how the `typia.json.assertParse<T>()` function works.

<Tabs items={['TypeScript Source Code', 'Compiled JavaScript File']}>
<Tab>
<Tabs.Tab>
```typescript copy filename="examples/src/assertParse.ts" showLineNumbers
import typia, { tags } from "typia";

Expand All @@ -219,8 +219,8 @@ interface IMember {
tags.Maximum<100>;
}
```
</Tab>
<Tab>
</Tabs.Tab>
<Tabs.Tab>
```javascript filename="examples/bin/assertParse.js" showLineNumbers
import * as __typia_transform__randomFormatUuid from "typia/lib/internal/_randomFormatUuid.js";
import * as __typia_transform__randomFormatEmail from "typia/lib/internal/_randomFormatEmail.js";
Expand Down Expand Up @@ -393,8 +393,8 @@ const parsed = (() => {
})()(json);
console.log(json === JSON.stringify(parsed)); // true
```
</Tab>
<Tab>
</Tabs.Tab>
<Tabs.Tab>
```typescript showLineNumbers copy
/**
* Primitive type of JSON.
Expand Down Expand Up @@ -532,7 +532,7 @@ interface IJsonable<T> {
toJSON(): T;
}
```
</Tab>
</Tabs.Tab>
</Tabs>
Expand All @@ -545,7 +545,7 @@ interface IJsonable<T> {
<code>IValidation.ts</code>,
<code>Primitive.ts</code>
]}>
<Tab>
<Tabs.Tab>
```typescript copy
export namespace json {
export function createIsParse<T>(): (input: string) => Primitive<T> | null;
Expand All @@ -555,8 +555,8 @@ export namespace json {
) => IValidation<Primitive<T>>;
}
```
</Tab>
<Tab>
</Tabs.Tab>
<Tabs.Tab>
```typescript copy
export class TypeGuardError extends Error {
public readonly method: string;
Expand All @@ -565,8 +565,8 @@ export class TypeGuardError extends Error {
public readonly value: any;
}
```
</Tab>
<Tab>
</Tabs.Tab>
<Tabs.Tab>
```typescript copy
export type IValidation<T> = IValidation.ISuccess<T> | IValidation.IFailure;
export namespace IValidation {
Expand All @@ -586,7 +586,7 @@ export namespace IValidation {
}
}
```
</Tab>
</Tabs.Tab>
</Tabs>
Reusable `typia.json.isParse<T>()` function generators.
Expand All @@ -596,7 +596,7 @@ If you repeat to call `typia.json.isParse<T>()` function on the same type, size
Just look at the code below, then you may understand how to use it.
<Tabs items={['TypeScript Source Code', 'Compiled JavaScript File']}>
<Tab>
<Tabs.Tab>
```typescript copy filename="examples/src/createIsParse.ts" showLineNumbers
import typia, { tags } from "typia";

Expand All @@ -611,8 +611,8 @@ interface IMember {
tags.Maximum<100>;
}
```
</Tab>
<Tab>
</Tabs.Tab>
<Tabs.Tab>
```javascript filename="examples/bin/createIsParse.js" showLineNumbers
import * as __typia_transform__isFormatUuid from "typia/lib/internal/_isFormatUuid.js";
import * as __typia_transform__isFormatEmail from "typia/lib/internal/_isFormatEmail.js";
Expand All @@ -636,5 +636,5 @@ export const parseMember = (() => {
};
})();
```
</Tab>
</Tabs.Tab>
</Tabs>
Loading

0 comments on commit 1e1ead2

Please sign in to comment.