diff --git a/.changeset/grumpy-singers-taste.md b/.changeset/grumpy-singers-taste.md new file mode 100644 index 00000000..319d6aca --- /dev/null +++ b/.changeset/grumpy-singers-taste.md @@ -0,0 +1,7 @@ +--- +"@nft-team/eslint-config": patch +"@nft-team/react": patch +"@nft-team/core": patch +--- + +docs: typedoc 세팅, ts docs 작성 및 문서 업데이트 diff --git a/.yarn/cache/@microsoft-tsdoc-config-npm-0.16.2-30fd115d09-12b0d70315.zip b/.yarn/cache/@microsoft-tsdoc-config-npm-0.16.2-30fd115d09-12b0d70315.zip new file mode 100644 index 00000000..34a3d9b6 Binary files /dev/null and b/.yarn/cache/@microsoft-tsdoc-config-npm-0.16.2-30fd115d09-12b0d70315.zip differ diff --git a/.yarn/cache/@microsoft-tsdoc-npm-0.14.2-9988282153-b167c89e91.zip b/.yarn/cache/@microsoft-tsdoc-npm-0.14.2-9988282153-b167c89e91.zip new file mode 100644 index 00000000..a2a6438a Binary files /dev/null and b/.yarn/cache/@microsoft-tsdoc-npm-0.14.2-9988282153-b167c89e91.zip differ diff --git a/.yarn/cache/ansi-sequence-parser-npm-1.1.0-166d719777-75f4d3a4c5.zip b/.yarn/cache/ansi-sequence-parser-npm-1.1.0-166d719777-75f4d3a4c5.zip new file mode 100644 index 00000000..6960fd8a Binary files /dev/null and b/.yarn/cache/ansi-sequence-parser-npm-1.1.0-166d719777-75f4d3a4c5.zip differ diff --git a/.yarn/cache/docusaurus-plugin-typedoc-npm-0.19.2-57760b271b-347c1b6b50.zip b/.yarn/cache/docusaurus-plugin-typedoc-npm-0.19.2-57760b271b-347c1b6b50.zip new file mode 100644 index 00000000..2a73083d Binary files /dev/null and b/.yarn/cache/docusaurus-plugin-typedoc-npm-0.19.2-57760b271b-347c1b6b50.zip differ diff --git a/.yarn/cache/eslint-plugin-tsdoc-npm-0.2.17-a48e3f007d-d143a5f1c5.zip b/.yarn/cache/eslint-plugin-tsdoc-npm-0.2.17-a48e3f007d-d143a5f1c5.zip new file mode 100644 index 00000000..cc7a60d2 Binary files /dev/null and b/.yarn/cache/eslint-plugin-tsdoc-npm-0.2.17-a48e3f007d-d143a5f1c5.zip differ diff --git a/.yarn/cache/jju-npm-1.4.0-670678eaa3-3790481bd2.zip b/.yarn/cache/jju-npm-1.4.0-670678eaa3-3790481bd2.zip new file mode 100644 index 00000000..bb6aee95 Binary files /dev/null and b/.yarn/cache/jju-npm-1.4.0-670678eaa3-3790481bd2.zip differ diff --git a/.yarn/cache/lunr-npm-2.3.9-fa3aa9c2d6-176719e24f.zip b/.yarn/cache/lunr-npm-2.3.9-fa3aa9c2d6-176719e24f.zip new file mode 100644 index 00000000..6c28307c Binary files /dev/null and b/.yarn/cache/lunr-npm-2.3.9-fa3aa9c2d6-176719e24f.zip differ diff --git a/.yarn/cache/marked-npm-4.3.0-e7ef9e874f-0db6817893.zip b/.yarn/cache/marked-npm-4.3.0-e7ef9e874f-0db6817893.zip new file mode 100644 index 00000000..3c26c0a5 Binary files /dev/null and b/.yarn/cache/marked-npm-4.3.0-e7ef9e874f-0db6817893.zip differ diff --git a/.yarn/cache/resolve-npm-1.19.0-1c75f25c98-a05b356e47.zip b/.yarn/cache/resolve-npm-1.19.0-1c75f25c98-a05b356e47.zip new file mode 100644 index 00000000..b36f49b5 Binary files /dev/null and b/.yarn/cache/resolve-npm-1.19.0-1c75f25c98-a05b356e47.zip differ diff --git a/.yarn/cache/resolve-patch-b488a667f9-2443b94d34.zip b/.yarn/cache/resolve-patch-b488a667f9-2443b94d34.zip new file mode 100644 index 00000000..2f32aeaa Binary files /dev/null and b/.yarn/cache/resolve-patch-b488a667f9-2443b94d34.zip differ diff --git a/.yarn/cache/shiki-npm-0.14.3-bbc09f85cf-a4dd98e3b2.zip b/.yarn/cache/shiki-npm-0.14.3-bbc09f85cf-a4dd98e3b2.zip new file mode 100644 index 00000000..1d174cea Binary files /dev/null and b/.yarn/cache/shiki-npm-0.14.3-bbc09f85cf-a4dd98e3b2.zip differ diff --git a/.yarn/cache/typedoc-npm-0.24.8-7f9229d7f2-a46a14497f.zip b/.yarn/cache/typedoc-npm-0.24.8-7f9229d7f2-a46a14497f.zip new file mode 100644 index 00000000..75003496 Binary files /dev/null and b/.yarn/cache/typedoc-npm-0.24.8-7f9229d7f2-a46a14497f.zip differ diff --git a/.yarn/cache/typedoc-plugin-markdown-npm-3.15.3-e7ba3f2cc0-845d890794.zip b/.yarn/cache/typedoc-plugin-markdown-npm-3.15.3-e7ba3f2cc0-845d890794.zip new file mode 100644 index 00000000..1e6107d3 Binary files /dev/null and b/.yarn/cache/typedoc-plugin-markdown-npm-3.15.3-e7ba3f2cc0-845d890794.zip differ diff --git a/.yarn/cache/vscode-oniguruma-npm-1.7.0-07cc55fbcc-53519d91d9.zip b/.yarn/cache/vscode-oniguruma-npm-1.7.0-07cc55fbcc-53519d91d9.zip new file mode 100644 index 00000000..e13937b2 Binary files /dev/null and b/.yarn/cache/vscode-oniguruma-npm-1.7.0-07cc55fbcc-53519d91d9.zip differ diff --git a/.yarn/cache/vscode-textmate-npm-8.0.0-2deb0cc7cf-127780dfea.zip b/.yarn/cache/vscode-textmate-npm-8.0.0-2deb0cc7cf-127780dfea.zip new file mode 100644 index 00000000..90c4ffb4 Binary files /dev/null and b/.yarn/cache/vscode-textmate-npm-8.0.0-2deb0cc7cf-127780dfea.zip differ diff --git a/README.md b/README.md index 00610ebe..eccc4609 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ - + ## 📚 Libraries diff --git a/apps/docs/babel.config.js b/apps/docs/babel.config.js index e00595da..4e3997ee 100644 --- a/apps/docs/babel.config.js +++ b/apps/docs/babel.config.js @@ -1,3 +1,6 @@ module.exports = { - presets: [require.resolve('@docusaurus/core/lib/babel/preset')], + presets: [ + require.resolve('@docusaurus/core/lib/babel/preset'), + ['@babel/preset-react', { runtime: 'automatic' }], + ], }; diff --git a/apps/docs/blog/2019-05-28-first-blog-post.md b/apps/docs/blog/2019-05-28-first-blog-post.md deleted file mode 100644 index 02f3f81b..00000000 --- a/apps/docs/blog/2019-05-28-first-blog-post.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -slug: first-blog-post -title: First Blog Post -authors: - name: Gao Wei - title: Docusaurus Core Team - url: https://github.com/wgao19 - image_url: https://github.com/wgao19.png -tags: [hola, docusaurus] ---- - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet diff --git a/apps/docs/blog/2019-05-29-long-blog-post.md b/apps/docs/blog/2019-05-29-long-blog-post.md deleted file mode 100644 index 26ffb1b1..00000000 --- a/apps/docs/blog/2019-05-29-long-blog-post.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -slug: long-blog-post -title: Long Blog Post -authors: endi -tags: [hello, docusaurus] ---- - -This is the summary of a very long blog post, - -Use a `` comment to limit blog post size in the list view. - - - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet diff --git a/apps/docs/blog/2021-08-01-mdx-blog-post.mdx b/apps/docs/blog/2021-08-01-mdx-blog-post.mdx deleted file mode 100644 index c04ebe32..00000000 --- a/apps/docs/blog/2021-08-01-mdx-blog-post.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -slug: mdx-blog-post -title: MDX Blog Post -authors: [slorber] -tags: [docusaurus] ---- - -Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/). - -:::tip - -Use the power of React to create interactive blog posts. - -```js - -``` - - - -::: diff --git a/apps/docs/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg b/apps/docs/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg deleted file mode 100644 index 11bda092..00000000 Binary files a/apps/docs/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg and /dev/null differ diff --git a/apps/docs/blog/2021-08-26-welcome/index.md b/apps/docs/blog/2021-08-26-welcome/index.md deleted file mode 100644 index 9455168f..00000000 --- a/apps/docs/blog/2021-08-26-welcome/index.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -slug: welcome -title: Welcome -authors: [slorber, yangshun] -tags: [facebook, hello, docusaurus] ---- - -[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog). - -Simply add Markdown files (or folders) to the `blog` directory. - -Regular blog authors can be added to `authors.yml`. - -The blog post date can be extracted from filenames, such as: - -- `2019-05-30-welcome.md` -- `2019-05-30-welcome/index.md` - -A blog post folder can be convenient to co-locate blog post images: - -![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg) - -The blog supports tags as well! - -**And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config. diff --git a/apps/docs/blog/authors.yml b/apps/docs/blog/authors.yml deleted file mode 100644 index bcb29915..00000000 --- a/apps/docs/blog/authors.yml +++ /dev/null @@ -1,17 +0,0 @@ -endi: - name: Endilie Yacop Sucipto - title: Maintainer of Docusaurus - url: https://github.com/endiliey - image_url: https://github.com/endiliey.png - -yangshun: - name: Yangshun Tay - title: Front End Engineer @ Facebook - url: https://github.com/yangshun - image_url: https://github.com/yangshun.png - -slorber: - name: Sébastien Lorber - title: Docusaurus maintainer - url: https://sebastienlorber.com - image_url: https://github.com/slorber.png diff --git a/apps/docs/docs/api/_category_.yml b/apps/docs/docs/api/_category_.yml new file mode 100644 index 00000000..24a46026 --- /dev/null +++ b/apps/docs/docs/api/_category_.yml @@ -0,0 +1 @@ +label: "API" \ No newline at end of file diff --git a/apps/docs/docs/api/index.md b/apps/docs/docs/api/index.md new file mode 100644 index 00000000..5b1bc5d8 --- /dev/null +++ b/apps/docs/docs/api/index.md @@ -0,0 +1,31 @@ +--- +id: "index" +title: "Documentation" +sidebar_label: "Readme" +sidebar_position: 0 +custom_edit_url: null +--- + +# 🚧 WIP 🚧 @nft-team frontend-libraries + + + + + + + + + +## 📚 Libraries +- [@nft-team/react](https://github.com/mbti-nf-team/frontend-libraries/tree/main/packages/react) + - [npm](https://www.npmjs.com/package/@nft-team/react) +- [@nft-team/core](https://github.com/mbti-nf-team/frontend-libraries/tree/main/packages/core) + - [npm](https://www.npmjs.com/package/@nft-team/core) +- [@nft-team/eslint-config](https://github.com/mbti-nf-team/frontend-libraries/tree/main/packages/eslint) + - [npm](https://www.npmjs.com/package/@nft-team/eslint-config) + +## 🐛 Bug reporting +[Issues](https://github.com/mbti-nf-team/frontend-libraries/issues) + +## 🔒 LICENSE +This Project is [MIT licensed](https://github.com/mbti-nf-team/frontend-libraries/blob/main/LICENSE). diff --git a/apps/docs/docs/api/modules.md b/apps/docs/docs/api/modules.md new file mode 100644 index 00000000..fb9cc6e3 --- /dev/null +++ b/apps/docs/docs/api/modules.md @@ -0,0 +1,9 @@ +--- +id: "modules" +title: "Documentation" +sidebar_label: "Table of Contents" +sidebar_position: 0.5 +hide_table_of_contents: true +custom_edit_url: null +--- + diff --git a/apps/docs/docs/api/modules/_category_.yml b/apps/docs/docs/api/modules/_category_.yml new file mode 100644 index 00000000..63f9c4e4 --- /dev/null +++ b/apps/docs/docs/api/modules/_category_.yml @@ -0,0 +1,2 @@ +label: "Modules" +position: 1 \ No newline at end of file diff --git a/apps/docs/docs/api/modules/nft_team_core.md b/apps/docs/docs/api/modules/nft_team_core.md new file mode 100644 index 00000000..b9ebaf82 --- /dev/null +++ b/apps/docs/docs/api/modules/nft_team_core.md @@ -0,0 +1,176 @@ +--- +id: "nft_team_core" +title: "Module: @nft-team/core" +sidebar_label: "@nft-team/core" +sidebar_position: 0 +custom_edit_url: null +--- + +## Functions + +### checkEmpty + +▸ **checkEmpty**<`T`\>(`value?`): `T`[] + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value?` | `T`[] | + +#### Returns + +`T`[] + +#### Defined in + +[utils.ts:44](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/core/src/utils.ts#L44) + +___ + +### checkNumber + +▸ **checkNumber**(`value?`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value?` | ``null`` \| `number` | + +#### Returns + +`number` + +#### Defined in + +[utils.ts:26](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/core/src/utils.ts#L26) + +___ + +### emptyAThenB + +▸ **emptyAThenB**(`b`, `a?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `string` | +| `a?` | ``null`` \| `string` | + +#### Returns + +`string` + +#### Defined in + +[utils.ts:34](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/core/src/utils.ts#L34) + +___ + +### generateArrayOfNumber + +▸ **generateArrayOfNumber**(`length`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `length` | `number` | + +#### Returns + +`number`[] + +#### Defined in + +[utils.ts:64](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/core/src/utils.ts#L64) + +___ + +### isEmpty + +▸ **isEmpty**<`T`\>(`value?`): `boolean` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value?` | `T`[] | + +#### Returns + +`boolean` + +#### Defined in + +[utils.ts:52](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/core/src/utils.ts#L52) + +___ + +### removeNullable + +▸ **removeNullable**(`value?`, `replacementValue?`): `string` + +**`Description`** + +`null`이나 `undefined`값이 존재하는 경우 빈문자열로 대체하거나 새로운 문자열로 대체합니다. (오로지 `string` 타입으로 반환) + +```ts +const value = undefined; +const result = removeNullable(value, 'newValue'); +``` + +**`Example`** + +```ts +console.log(result); // 'newValue'; +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `value?` | ``null`` \| `string` | 첫 번째 인자 `string` \| `null` \| `undefined` | +| `replacementValue?` | `string` | 두 번째 인자에 값이 존재하는 경우 첫 번째 인자가 `null` 또는 `undefined`인 경우 두번째 인자로 문자열 대체 | + +#### Returns + +`string` + +#### Defined in + +[utils.ts:14](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/core/src/utils.ts#L14) + +___ + +### trueOrFalse + +▸ **trueOrFalse**(`value?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value?` | ``null`` \| `string` \| `number` \| `boolean` | + +#### Returns + +`boolean` + +#### Defined in + +[utils.ts:36](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/core/src/utils.ts#L36) diff --git a/apps/docs/docs/api/modules/nft_team_react.md b/apps/docs/docs/api/modules/nft_team_react.md new file mode 100644 index 00000000..db2460dd --- /dev/null +++ b/apps/docs/docs/api/modules/nft_team_react.md @@ -0,0 +1,223 @@ +--- +id: "nft_team_react" +title: "Module: @nft-team/react" +sidebar_label: "@nft-team/react" +sidebar_position: 0 +custom_edit_url: null +--- + +## Functions + +### ClientOnly + +▸ **ClientOnly**(`«destructured»`): `ReactElement` \| ``null`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `«destructured»` | `Object` | +| › `children?` | `ReactNode` | + +#### Returns + +`ReactElement` \| ``null`` + +#### Defined in + +[packages/react/src/components/ClientOnly.tsx:5](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/react/src/components/ClientOnly.tsx#L5) + +___ + +### DelayRenderComponent + +▸ **DelayRenderComponent**(`«destructured»`): ``null`` \| `Element` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `«destructured»` | `PropsWithChildren`<`Props`\> | + +#### Returns + +``null`` \| `Element` + +#### Defined in + +[packages/react/src/components/DelayRenderComponent.tsx:11](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/react/src/components/DelayRenderComponent.tsx#L11) + +___ + +### GlobalPortal + +▸ **GlobalPortal**(`«destructured»`): ``null`` \| `ReactPortal` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `«destructured»` | `PropsWithChildren`<`Props`\> | + +#### Returns + +``null`` \| `ReactPortal` + +#### Defined in + +[packages/react/src/components/GlobalPortal.tsx:10](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/react/src/components/GlobalPortal.tsx#L10) + +___ + +### useActionKeyEvent + +▸ **useActionKeyEvent**<`T`, `U`\>(`targetKeys`, `callback?`): `ActionKeyEvent`<`T`, `U`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Element` | +| `U` | extends `unknown`[] = [] | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetKeys` | `string` \| `string`[] | +| `callback?` | (`event`: `KeyboardEvent`<`T`\>, ...`args`: `U`) => `void` | + +#### Returns + +`ActionKeyEvent`<`T`, `U`\> + +#### Defined in + +[packages/react/src/hooks/useActionKeyEvent.ts:6](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/react/src/hooks/useActionKeyEvent.ts#L6) + +___ + +### useBoolean + +▸ **useBoolean**(`initialValue?`): [`boolean`, () => `void`, () => `void`, (`nextValue?`: `boolean`) => `void`] + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `initialValue` | `boolean` | `false` | + +#### Returns + +[`boolean`, () => `void`, () => `void`, (`nextValue?`: `boolean`) => `void`] + +#### Defined in + +[packages/react/src/hooks/useBoolean.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/react/src/hooks/useBoolean.ts#L3) + +___ + +### useDebounce + +▸ **useDebounce**<`T`\>(`value`, `delay?`): `T` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value` | `T` | +| `delay?` | `number` | + +#### Returns + +`T` + +#### Defined in + +[packages/react/src/hooks/useDebounce.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/react/src/hooks/useDebounce.ts#L3) + +___ + +### useIsMounted + +▸ **useIsMounted**(): `boolean` + +#### Returns + +`boolean` + +#### Defined in + +[packages/react/src/hooks/useIsMounted.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/react/src/hooks/useIsMounted.ts#L3) + +___ + +### useIsomorphicLayoutEffect + +▸ **useIsomorphicLayoutEffect**(`effect`, `deps?`): `void` + +Accepts a function that contains imperative, possibly effectful code. + +**`Version`** + +16.8.0 + +**`See`** + +https://react.dev/reference/react/useEffect + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `effect` | `EffectCallback` | Imperative function that can return a cleanup function | +| `deps?` | `DependencyList` | If present, effect will only activate if the values in the list change. | + +#### Returns + +`void` + +#### Defined in + +node_modules/@types/react/ts5.0/index.d.ts:1064 + +___ + +### useResizeViewportHeight + +▸ **useResizeViewportHeight**(): `void` + +#### Returns + +`void` + +#### Defined in + +[packages/react/src/hooks/useResizeViewportHeight.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/react/src/hooks/useResizeViewportHeight.ts#L3) + +___ + +### useTimeout + +▸ **useTimeout**(`callback`, `delay`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callback` | () => `void` | +| `delay` | ``null`` \| `number` | + +#### Returns + +`void` + +#### Defined in + +[packages/react/src/hooks/useTimeout.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/91b0747/packages/react/src/hooks/useTimeout.ts#L5) diff --git a/apps/docs/docusaurus.config.js b/apps/docs/docusaurus.config.js index 0173d9fb..d559294d 100644 --- a/apps/docs/docusaurus.config.js +++ b/apps/docs/docusaurus.config.js @@ -23,6 +23,18 @@ const config = { defaultLocale: 'ko', locales: ['ko'], }, + plugins: [ + [ + 'docusaurus-plugin-typedoc', + { + entryPoints: ['../../packages/react', '../../packages/core'], + entryPointStrategy: 'packages', + sidebar: { + fullNames: true, + }, + }, + ], + ], presets: [ [ 'classic', @@ -67,9 +79,14 @@ const config = { position: 'left', label: 'Tutorial', }, - { to: '/blog', label: 'Blog', position: 'left' }, { - href: 'https://github.com/facebook/docusaurus', + to: 'docs/api/', + activeBasePath: 'docs', + label: 'API', + position: 'left', + }, + { + href: 'https://github.com/mbti-nf-team/frontend-libraries', label: 'GitHub', position: 'right', }, @@ -107,13 +124,9 @@ const config = { { title: 'More', items: [ - { - label: 'Blog', - to: '/blog', - }, { label: 'GitHub', - href: 'https://github.com/facebook/docusaurus', + href: 'https://github.com/mbti-nf-team/frontend-libraries', }, ], }, diff --git a/apps/docs/package.json b/apps/docs/package.json index f4a88bda..8d88c6c1 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -26,6 +26,9 @@ "devDependencies": { "@docusaurus/module-type-aliases": "2.4.1", "@tsconfig/docusaurus": "^1.0.5", + "docusaurus-plugin-typedoc": "^0.19.2", + "typedoc": "^0.24.8", + "typedoc-plugin-markdown": "^3.15.3", "typescript": "^4.7.4" }, "browserslist": { diff --git a/apps/docs/src/pages/index.tsx b/apps/docs/src/pages/index.tsx index 305139fb..5d61bedb 100644 --- a/apps/docs/src/pages/index.tsx +++ b/apps/docs/src/pages/index.tsx @@ -1,14 +1,13 @@ -import React from 'react'; -import clsx from 'clsx'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import Layout from '@theme/Layout'; import HomepageFeatures from '@site/src/components/HomepageFeatures'; +import Layout from '@theme/Layout'; +import clsx from 'clsx'; import styles from './index.module.css'; function HomepageHeader() { - const {siteConfig} = useDocusaurusContext(); + const { siteConfig } = useDocusaurusContext(); return (
@@ -17,7 +16,8 @@ function HomepageHeader() {
+ to="/docs/intro" + > Docusaurus Tutorial - 5min ⏱️
@@ -27,11 +27,12 @@ function HomepageHeader() { } export default function Home(): JSX.Element { - const {siteConfig} = useDocusaurusContext(); + const { siteConfig } = useDocusaurusContext(); return ( + description="Description will go into a meta tag in " + >
diff --git a/apps/docs/tsconfig.json b/apps/docs/tsconfig.json index 99188299..81058c0c 100644 --- a/apps/docs/tsconfig.json +++ b/apps/docs/tsconfig.json @@ -2,6 +2,7 @@ // This file is not used in compilation. It is here just for a nice editor experience. "extends": "@tsconfig/docusaurus/tsconfig.json", "compilerOptions": { - "baseUrl": "." + "baseUrl": ".", + "jsx": "preserve", }, } diff --git a/packages/core/.eslintrc.js b/packages/core/.eslintrc.js index a72d4c1c..70630e78 100644 --- a/packages/core/.eslintrc.js +++ b/packages/core/.eslintrc.js @@ -11,6 +11,7 @@ module.exports = { 'dist/', 'coverage/', ], + plugins: ['eslint-plugin-tsdoc'], extends: ['@nft-team/eslint-config'], overrides: [ { @@ -32,5 +33,6 @@ module.exports = { 'import/export': 'off', 'import/prefer-default-export': 'off', 'import/no-extraneous-dependencies': 'off', + 'tsdoc/syntax': 'warn', }, }; diff --git a/packages/core/package.json b/packages/core/package.json index 95d61dd5..b8697cb1 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -31,6 +31,7 @@ "@types/jest": "^29.5.2", "@types/jest-plugin-context": "^2.9.5", "eslint": "^8.44.0", + "eslint-plugin-tsdoc": "^0.2.17", "given2": "^2.1.7", "jest": "^29.5.0", "jest-environment-jsdom": "^29.5.0", diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index 2345bdb1..f3e4cc79 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -1,3 +1,16 @@ +/** + * @description `null`이나 `undefined`값이 존재하는 경우 빈문자열로 대체하거나 새로운 문자열로 대체합니다. (오로지 `string` 타입으로 반환) + * + * ```ts + * const value = undefined; + * const result = removeNullable(value, 'newValue'); + * ``` + * @example + * console.log(result); // 'newValue'; + * @param value - 첫 번째 인자 `string` | `null` | `undefined` + * @param replacementValue - 두 번째 인자에 값이 존재하는 경우 첫 번째 인자가 `null` 또는 `undefined`인 경우 두번째 인자로 문자열 대체 + * @returns + */ export const removeNullable = (value?: string | null, replacementValue?: string): string => { if (value) { return value; diff --git a/packages/core/typedoc.json b/packages/core/typedoc.json new file mode 100644 index 00000000..d07bd2a3 --- /dev/null +++ b/packages/core/typedoc.json @@ -0,0 +1,5 @@ +{ + "extends": ["../../typedoc.base.json"], + "entryPoints": ["src/index.ts"], + "out": "./docs" +} diff --git a/packages/eslint/index.js b/packages/eslint/index.js index 01061a85..2df1b4c4 100644 --- a/packages/eslint/index.js +++ b/packages/eslint/index.js @@ -29,9 +29,6 @@ module.exports = { }, ecmaVersion: 12, sourceType: 'module', - babelOptions: { - presets: [require.resolve('next/babel')], - }, }, overrides: [ { diff --git a/packages/react/typedoc.json b/packages/react/typedoc.json new file mode 100644 index 00000000..d07bd2a3 --- /dev/null +++ b/packages/react/typedoc.json @@ -0,0 +1,5 @@ +{ + "extends": ["../../typedoc.base.json"], + "entryPoints": ["src/index.ts"], + "out": "./docs" +} diff --git a/typedoc.base.json b/typedoc.base.json new file mode 100644 index 00000000..daa58cb2 --- /dev/null +++ b/typedoc.base.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "includeVersion": true +} diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 00000000..b4e0342d --- /dev/null +++ b/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": ["packages/*"], + "name": "@nft-team/frontend-libraries", + "entryPointStrategy": "packages", + "includeVersion": true +} diff --git a/yarn.lock b/yarn.lock index 2297ebc4..6bf91504 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3227,6 +3227,25 @@ __metadata: languageName: node linkType: hard +"@microsoft/tsdoc-config@npm:0.16.2": + version: 0.16.2 + resolution: "@microsoft/tsdoc-config@npm:0.16.2" + dependencies: + "@microsoft/tsdoc": 0.14.2 + ajv: ~6.12.6 + jju: ~1.4.0 + resolve: ~1.19.0 + checksum: 12b0d703154076bcaac75ca42e804e4fc292672396441e54346d7eadd0d6b57f90980eda2b1bab89b224af86da34a2389f9054002e282011e795ca5919a4386f + languageName: node + linkType: hard + +"@microsoft/tsdoc@npm:0.14.2": + version: 0.14.2 + resolution: "@microsoft/tsdoc@npm:0.14.2" + checksum: b167c89e916ba73ee20b9c9d5dba6aa3a0de25ed3d50050e8a344dca7cd43cb2e1059bd515c820369b6e708901dd3fda476a42bc643ca74a35671ce77f724a3a + languageName: node + linkType: hard + "@nft-team/core@workspace:packages/core": version: 0.0.0-use.local resolution: "@nft-team/core@workspace:packages/core" @@ -3238,6 +3257,7 @@ __metadata: "@types/jest": ^29.5.2 "@types/jest-plugin-context": ^2.9.5 eslint: ^8.44.0 + eslint-plugin-tsdoc: ^0.2.17 given2: ^2.1.7 jest: ^29.5.0 jest-environment-jsdom: ^29.5.0 @@ -4877,7 +4897,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.10.0, ajv@npm:^6.12.2, ajv@npm:^6.12.4, ajv@npm:^6.12.5": +"ajv@npm:^6.10.0, ajv@npm:^6.12.2, ajv@npm:^6.12.4, ajv@npm:^6.12.5, ajv@npm:~6.12.6": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -4982,6 +5002,13 @@ __metadata: languageName: node linkType: hard +"ansi-sequence-parser@npm:^1.1.0": + version: 1.1.0 + resolution: "ansi-sequence-parser@npm:1.1.0" + checksum: 75f4d3a4c555655a698aec05b5763cbddcd16ccccdbfd178fb0aa471ab74fdf98e031b875ef26e64be6a95cf970c89238744b26de6e34af97f316d5186b1df53 + languageName: node + linkType: hard + "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -7196,9 +7223,12 @@ __metadata: "@mdx-js/react": ^1.6.22 "@tsconfig/docusaurus": ^1.0.5 clsx: ^1.2.1 + docusaurus-plugin-typedoc: ^0.19.2 prism-react-renderer: ^1.3.5 react: ^17.0.2 react-dom: ^17.0.2 + typedoc: ^0.24.8 + typedoc-plugin-markdown: ^3.15.3 typescript: ^4.7.4 languageName: unknown linkType: soft @@ -7221,6 +7251,16 @@ __metadata: languageName: node linkType: hard +"docusaurus-plugin-typedoc@npm:^0.19.2": + version: 0.19.2 + resolution: "docusaurus-plugin-typedoc@npm:0.19.2" + peerDependencies: + typedoc: ">=0.24.0" + typedoc-plugin-markdown: ">=3.15.0" + checksum: 347c1b6b509e14dabbb8b4d1224682ea2281995a60b4cf48e456dbbdbcecb4b73cf4fe3e031f1e01ae72dfb3bec935c6eaac7e4ddf3f63587fad2ac8ea028cec + languageName: node + linkType: hard + "dom-accessibility-api@npm:^0.5.6, dom-accessibility-api@npm:^0.5.9": version: 0.5.16 resolution: "dom-accessibility-api@npm:0.5.16" @@ -7920,6 +7960,16 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-tsdoc@npm:^0.2.17": + version: 0.2.17 + resolution: "eslint-plugin-tsdoc@npm:0.2.17" + dependencies: + "@microsoft/tsdoc": 0.14.2 + "@microsoft/tsdoc-config": 0.16.2 + checksum: d143a5f1c5967812d75f246ae2776cb030f6e7966b981406c9df9352a9ab02b035f294cedb30054eac2c4a217ee4ab2ed9fb76292bdccda9438e54d2d7b0146e + languageName: node + linkType: hard + "eslint-plugin-unused-imports@npm:^2.0.0": version: 2.0.0 resolution: "eslint-plugin-unused-imports@npm:2.0.0" @@ -9082,7 +9132,7 @@ __metadata: languageName: node linkType: hard -"handlebars@npm:^4.4.3": +"handlebars@npm:^4.4.3, handlebars@npm:^4.7.7": version: 4.7.7 resolution: "handlebars@npm:4.7.7" dependencies: @@ -9914,7 +9964,7 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.11.0, is-core-module@npm:^2.12.0, is-core-module@npm:^2.9.0": +"is-core-module@npm:^2.1.0, is-core-module@npm:^2.11.0, is-core-module@npm:^2.12.0, is-core-module@npm:^2.9.0": version: 2.12.1 resolution: "is-core-module@npm:2.12.1" dependencies: @@ -10926,6 +10976,13 @@ __metadata: languageName: node linkType: hard +"jju@npm:~1.4.0": + version: 1.4.0 + resolution: "jju@npm:1.4.0" + checksum: 3790481bd2b7827dd6336e6e3dc2dcc6d425679ba7ebde7b679f61dceb4457ea0cda330972494de608571f4973c6dfb5f70fab6f3c5037dbab19ac449a60424f + languageName: node + linkType: hard + "joi@npm:^17.6.0": version: 17.9.2 resolution: "joi@npm:17.9.2" @@ -11480,6 +11537,13 @@ __metadata: languageName: node linkType: hard +"lunr@npm:^2.3.9": + version: 2.3.9 + resolution: "lunr@npm:2.3.9" + checksum: 176719e24fcce7d3cf1baccce9dd5633cd8bdc1f41ebe6a180112e5ee99d80373fe2454f5d4624d437e5a8319698ca6837b9950566e15d2cae5f2a543a3db4b8 + languageName: node + linkType: hard + "lz-string@npm:^1.5.0": version: 1.5.0 resolution: "lz-string@npm:1.5.0" @@ -11558,6 +11622,15 @@ __metadata: languageName: node linkType: hard +"marked@npm:^4.3.0": + version: 4.3.0 + resolution: "marked@npm:4.3.0" + bin: + marked: bin/marked.js + checksum: 0db6817893952c3ec710eb9ceafb8468bf5ae38cb0f92b7b083baa13d70b19774674be04db5b817681fa7c5c6a088f61300815e4dd75a59696f4716ad69f6260 + languageName: node + linkType: hard + "mdast-squeeze-paragraphs@npm:^4.0.0": version: 4.0.0 resolution: "mdast-squeeze-paragraphs@npm:4.0.0" @@ -12729,7 +12802,7 @@ __metadata: languageName: node linkType: hard -"path-parse@npm:^1.0.7": +"path-parse@npm:^1.0.6, path-parse@npm:^1.0.7": version: 1.0.7 resolution: "path-parse@npm:1.0.7" checksum: 49abf3d81115642938a8700ec580da6e830dde670be21893c62f4e10bd7dd4c3742ddc603fe24f898cba7eb0c6bc1777f8d9ac14185d34540c6d4d80cd9cae8a @@ -14253,6 +14326,16 @@ __metadata: languageName: node linkType: hard +"resolve@npm:~1.19.0": + version: 1.19.0 + resolution: "resolve@npm:1.19.0" + dependencies: + is-core-module: ^2.1.0 + path-parse: ^1.0.6 + checksum: a05b356e47b85ad3613d9e2a39a824f3c27f4fcad9c9ff6c7cc71a2e314c5904a90ab37481ad0069d03cab9eaaac6eb68aca1bc3355fdb05f1045cd50e2aacea + languageName: node + linkType: hard + "resolve@patch:resolve@^1.1.6#~builtin, resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.12.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin, resolve@patch:resolve@^1.3.2#~builtin": version: 1.22.3 resolution: "resolve@patch:resolve@npm%3A1.22.3#~builtin::version=1.22.3&hash=c3c19d" @@ -14279,6 +14362,16 @@ __metadata: languageName: node linkType: hard +"resolve@patch:resolve@~1.19.0#~builtin": + version: 1.19.0 + resolution: "resolve@patch:resolve@npm%3A1.19.0#~builtin::version=1.19.0&hash=c3c19d" + dependencies: + is-core-module: ^2.1.0 + path-parse: ^1.0.6 + checksum: 2443b94d347e6946c87c85faf13071f605e609e0b54784829b0ed2b917d050bfc1cbaf4ecc6453f224cfa7d0c5dcd97cbb273454cd210bee68e4af15c1a5abc9 + languageName: node + linkType: hard + "responselike@npm:^1.0.2": version: 1.0.2 resolution: "responselike@npm:1.0.2" @@ -14763,6 +14856,18 @@ __metadata: languageName: node linkType: hard +"shiki@npm:^0.14.1": + version: 0.14.3 + resolution: "shiki@npm:0.14.3" + dependencies: + ansi-sequence-parser: ^1.1.0 + jsonc-parser: ^3.2.0 + vscode-oniguruma: ^1.7.0 + vscode-textmate: ^8.0.0 + checksum: a4dd98e3b2a5dd8be207448f111ffb9ad2ed6c530f215714d8b61cbf91ec3edbabb09109b8ec58a26678aacd24e8161d5a9bc0c1fa1b4f64b27ceb180cbd0c89 + languageName: node + linkType: hard + "side-channel@npm:^1.0.4": version: 1.0.4 resolution: "side-channel@npm:1.0.4" @@ -16003,6 +16108,33 @@ __metadata: languageName: node linkType: hard +"typedoc-plugin-markdown@npm:^3.15.3": + version: 3.15.3 + resolution: "typedoc-plugin-markdown@npm:3.15.3" + dependencies: + handlebars: ^4.7.7 + peerDependencies: + typedoc: ">=0.24.0" + checksum: 845d8907948a7ea9f3eed31d8c2f1a4053569fb763f5c5187d06ecbffd247c6a6e532eaf0ec09d11f09eabbf26a3df8646c96fc3ac1a836cc9af273fa0e53413 + languageName: node + linkType: hard + +"typedoc@npm:^0.24.8": + version: 0.24.8 + resolution: "typedoc@npm:0.24.8" + dependencies: + lunr: ^2.3.9 + marked: ^4.3.0 + minimatch: ^9.0.0 + shiki: ^0.14.1 + peerDependencies: + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x + bin: + typedoc: bin/typedoc + checksum: a46a14497f789fb3594e6c3af2e45276934ac46df40b7ed15a504ee51dc7a8013a2ffb3a54fd73abca6a2b71f97d3ec9ad356fa9aa81d29743e4645a965a2ae0 + languageName: node + linkType: hard + "typescript@npm:^4.5.2, typescript@npm:^4.7.4": version: 4.9.5 resolution: "typescript@npm:4.9.5" @@ -16526,6 +16658,20 @@ __metadata: languageName: node linkType: hard +"vscode-oniguruma@npm:^1.7.0": + version: 1.7.0 + resolution: "vscode-oniguruma@npm:1.7.0" + checksum: 53519d91d90593e6fb080260892e87d447e9b200c4964d766772b5053f5699066539d92100f77f1302c91e8fc5d9c772fbe40fe4c90f3d411a96d5a9b1e63f42 + languageName: node + linkType: hard + +"vscode-textmate@npm:^8.0.0": + version: 8.0.0 + resolution: "vscode-textmate@npm:8.0.0" + checksum: 127780dfea89559d70b8326df6ec344cfd701312dd7f3f591a718693812b7852c30b6715e3cfc8b3200a4e2515b4c96f0843c0eacc0a3020969b5de262c2a4bb + languageName: node + linkType: hard + "w3c-xmlserializer@npm:^4.0.0": version: 4.0.0 resolution: "w3c-xmlserializer@npm:4.0.0"