Skip to content

Commit

Permalink
Merge pull request #25 from nemuvski/update/docs
Browse files Browse the repository at this point in the history
ドキュメントサイト: docusaurus v3 アップグレード
  • Loading branch information
nemuvski authored Dec 29, 2023
2 parents b62a920 + ae2abfc commit 42a3694
Show file tree
Hide file tree
Showing 26 changed files with 3,073 additions and 3,507 deletions.
6,213 changes: 2,887 additions & 3,326 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

124 changes: 0 additions & 124 deletions website/docusaurus.config.js

This file was deleted.

126 changes: 126 additions & 0 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import type { Config } from '@docusaurus/types'
import type * as Preset from '@docusaurus/preset-classic'
import { themes } from 'prism-react-renderer'

const config: Config = {
title: '@itsumono',
url: 'https://itsumono.netlify.app',
baseUrl: '/',
tagline: 'サクッといつものを導入',
titleDelimiter: '—',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/logo.png',
projectName: 'itsumono',
i18n: {
defaultLocale: 'ja',
locales: ['ja'],
},

presets: [
[
'classic',
{
docs: {
path: 'packages',
routeBasePath: 'packages',
breadcrumbs: false,
sidebarPath: require.resolve('./sidebars.js'),
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
} satisfies Preset.Options,
],
],

themes: [
[
require.resolve('@easyops-cn/docusaurus-search-local'),
/** @see {@link https://github.com/easyops-cn/docusaurus-search-local#theme-options} */
{
hashed: true,
indexDocs: true,
indexBlog: false,
indexPages: false,
language: ['en', 'ja'],
docsRouteBasePath: '/packages',
docsDir: 'packages',
},
],
],

themeConfig: {
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
navbar: {
title: '@itsumono',
logo: {
alt: '@itsumono',
src: 'img/logo.png',
},
items: [
{
type: 'doc',
docId: 'index',
position: 'left',
label: 'パッケージ',
},
{
href: 'https://github.com/nemuvski/itsumono',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
logo: {
alt: '@itsumono',
src: 'img/logo.png',
href: '/',
width: 48,
height: 48,
},
links: [
{
title: 'パッケージ',
items: [
{
label: '@itsumono/utils',
to: 'packages/utils',
},
{
label: '@itsumono/react',
to: 'packages/react',
},
],
},
{
title: 'その他',
items: [
{
label: 'GitHub',
to: 'https://github.com/nemuvski/itsumono',
},
{
label: '開発者',
to: 'https://github.com/nemuvski',
},
],
},
],
copyright: `Copyright © 2022 @itsumono`,
},
prism: {
theme: themes.oceanicNext,
// デフォルト以外に含む言語
additionalLanguages: ['bash'],
},
} satisfies Preset.ThemeConfig,
}

export default config
32 changes: 16 additions & 16 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "website",
"version": "0.0.0",
"engines": {
"node": ">=16.14.0"
"node": ">=18.0"
},
"scripts": {
"start": "docusaurus start",
Expand All @@ -18,24 +18,24 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@docusaurus/core": "^2.4.1",
"@docusaurus/preset-classic": "^2.4.1",
"@docusaurus/theme-classic": "^2.4.1",
"@easyops-cn/docusaurus-search-local": "^0.35.0",
"@mdx-js/react": "^1.6.22",
"@docusaurus/core": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.1",
"@docusaurus/theme-classic": "^3.0.1",
"@easyops-cn/docusaurus-search-local": "^0.40.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.0.6",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"prism-react-renderer": "^2.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@algolia/client-search": "^4.19.1",
"@docusaurus/module-type-aliases": "^2.4.1",
"@docusaurus/plugin-content-docs": "^2.4.1",
"@docusaurus/types": "^2.4.1",
"@tsconfig/docusaurus": "^2.0.0",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.11",
"@algolia/client-search": "^4.22.0",
"@docusaurus/module-type-aliases": "^3.0.1",
"@docusaurus/plugin-content-docs": "^3.0.1",
"@docusaurus/tsconfig": "^3.0.1",
"@docusaurus/types": "^3.0.1",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"typedoc": "^0.25.4",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "^5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions website/packages/react/components/Either.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ sidebar_label: "Either"
custom_edit_url: null
---

**Either**(`props`, `context?`): ``null`` \| `ReactElement`<`any`, `any`\>
**Either**(`props`, `context?`): ``null`` \| `ReactElement`\<`any`, `any`\>

条件式がtrue/falseで出力する内容を切り替えるコンポーネント

**`Example`**

```ts
```tsx
<Either
test={someCondition}
match={'testの条件式がtrueの時の出力内容'}
Expand All @@ -31,4 +31,4 @@ custom_edit_url: null

## Returns

``null`` \| `ReactElement`<`any`, `any`\>
``null`` \| `ReactElement`\<`any`, `any`\>
8 changes: 4 additions & 4 deletions website/packages/react/components/Maybe.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ sidebar_label: "Maybe"
custom_edit_url: null
---

**Maybe**(`props`, `context?`): ``null`` \| `ReactElement`<`any`, `any`\>
**Maybe**(`props`, `context?`): ``null`` \| `ReactElement`\<`any`, `any`\>

条件式がtrueになった場合のみ子要素を出力するコンポーネント

**`Example`**

```ts
```tsx
<Maybe test={someCondition}>
<span>hello!</span>
</Maybe>
Expand All @@ -21,9 +21,9 @@ custom_edit_url: null

| Name | Type |
| :------ | :------ |
| `props` | `PropsWithChildren`<{ `test?`: ``null`` \| `boolean` }\> |
| `props` | `PropsWithChildren`\<\{ `test?`: ``null`` \| `boolean` \}\> |
| `context?` | `any` |

## Returns

``null`` \| `ReactElement`<`any`, `any`\>
``null`` \| `ReactElement`\<`any`, `any`\>
6 changes: 3 additions & 3 deletions website/packages/react/namespaces/RC.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ ___

### WithChildren

**WithChildren**<`Props`\>: `FC`<`PropsWithChildren`<`Props`\>\>
**WithChildren**\<`Props`\>: `FC`\<`PropsWithChildren`\<`Props`\>\>

子要素を持つ(childrenプロパティあり)コンポーネントの型

**`Example`**

```ts
```tsx
const YourComponent: RC.WithChildren<{ value: string }> = ({ value, children }) => {
// コンポーネントの内容
}
Expand All @@ -46,7 +46,7 @@ ___

### WithoutChildren

**WithoutChildren**<`Props`\>: `FC`<`Props`\>
**WithoutChildren**\<`Props`\>: `FC`\<`Props`\>

子要素を持たない(childrenプロパティなし)コンポーネントの型

Expand Down
2 changes: 1 addition & 1 deletion website/packages/utils/functions/cls.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cls({ hello: true, world: false })

| Name | Type |
| :------ |:--------------------------------------|
| `value` | `undefined` \| ``null`` \| `string` \| `number` \| `boolean` \| `Record`<`string`, `undefined` \| ``null`` \| `boolean`\> \| (`undefined` \| ``null`` \| `string` \| `number` \| `boolean` \| `Record`<`string`, `undefined` \| ``null`` \| `boolean`\>)[] |
| `value` | `undefined` \| ``null`` \| `string` \| `number` \| `boolean` \| `Record`\<`string`, `undefined` \| ``null`` \| `boolean`\> \| (`undefined` \| ``null`` \| `string` \| `number` \| `boolean` \| `Record`\<`string`, `undefined` \| ``null`` \| `boolean`\>)[] |
| `options?` | [`ClsOptions`](../types/ClsOptions.md) |

#### Returns
Expand Down
2 changes: 1 addition & 1 deletion website/packages/utils/functions/containParamInUrl.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_label: "containParamInUrl"
custom_edit_url: null
---

**containParamInUrl**<`P`\>(`url`, `paramName`): `boolean`
**containParamInUrl**\<`P`\>(`url`, `paramName`): `boolean`

引数urlで指定したパラメータ名が存在する場合はTrueを返却
※ パラメータがとる値によらない点に注意
Expand Down
Loading

0 comments on commit 42a3694

Please sign in to comment.