Skip to content

Commit 315fd94

Browse files
committed
Prepare v3 docs update
1 parent 8c22930 commit 315fd94

File tree

26 files changed

+1391
-571
lines changed

26 files changed

+1391
-571
lines changed

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"start": "env NODE_ENV=development ts-node -r tsconfig-paths/register devServer.ts"
1515
},
1616
"dependencies": {
17-
"@date-fns/date-fns-db": "^0.0.14",
17+
"@date-fns/docs": "0.4.0",
1818
"@nyancss/css-modules-loader": "^1.1.0",
1919
"@nyancss/react": "^1.3.0",
2020
"@sentry/browser": "^5.30.0",
@@ -34,7 +34,7 @@
3434
"@types/webpack-dev-middleware": "^4.1.0",
3535
"@types/webpack-hot-middleware": "^2.25.3",
3636
"@types/webpack-node-externals": "^2.5.0",
37-
"@typesaurus/preact": "^4.0.0",
37+
"@typesaurus/preact": "6.0.0-alpha.4",
3838
"assets-webpack-plugin": "^7.0.0",
3939
"body-parser": "^1.19.0",
4040
"copy-webpack-plugin": "^7.0.0",
@@ -45,9 +45,9 @@
4545
"enzyme-adapter-preact-pure": "^2.2.3",
4646
"express": "^4.17.1",
4747
"file-loader": "^6.1.0",
48-
"firebase": "^8.2.2",
49-
"firebase-admin": "^9.4.2",
50-
"firebase-functions": "^3.13.0",
48+
"firebase": "^9.15.0",
49+
"firebase-admin": "^11.4.1",
50+
"firebase-functions": "^4.1.1",
5151
"firebase-tools": "^9.2.0",
5252
"html-webpack-plugin": "^5.2.0",
5353
"husky": "^4.3.0",
@@ -66,13 +66,14 @@
6666
"remarkable": "^2.0.1",
6767
"reset.css": "^2.0.2",
6868
"style-loader": "^1.2.1",
69-
"ts-loader": "^8.0.3",
70-
"ts-node": "^9.1.1",
69+
"ts-loader": "^9.4.2",
70+
"ts-node": "^10.9.1",
7171
"tsconfig-paths": "^3.9.0",
7272
"tsconfig-paths-webpack-plugin": "^3.3.0",
7373
"tslint": "~6.1.3",
74-
"typesaurus": "^7.1.0",
75-
"typescript": "^4.0.2",
74+
"typeroo": "^0.9.0",
75+
"typesaurus": "10.0.0-alpha.40",
76+
"typescript": "^4.9.4",
7677
"webpack": "^5.24.2",
7778
"webpack-cli": "^4.1.0",
7879
"webpack-dev-middleware": "^4.1.0",

src/ui/components/DocParams/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { h, FunctionComponent, Fragment } from 'preact'
2-
import { JSDocParam, JSDocType } from '@date-fns/date-fns-db'
2+
import { JSDocParam, JSDocType } from '@date-fns/docs/db'
33
import { Markdown } from '~/ui/components/Markdown'
44
import { OptionalLabel, PropsLabel } from './style.css'
55

src/ui/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Docs } from '~/ui/screens/Docs'
66
import { NotFound } from '~/ui/screens/NotFound'
77
import 'reset.css/reset.css?global'
88
import './global.css?global'
9-
import { DEFAULT_SUBMODULE } from '@date-fns/date-fns-db'
9+
import { defaultSubmodule } from '@date-fns/docs/db'
1010

1111
const win = typeof window !== 'undefined' ? window : undefined
1212

@@ -24,7 +24,7 @@ export const UI = () => {
2424
case 'docs':
2525
return (
2626
<Docs
27-
selectedSubmodule={DEFAULT_SUBMODULE}
27+
selectedSubmodule={defaultSubmodule}
2828
selectedPage={location.params.page}
2929
/>
3030
)
@@ -40,7 +40,7 @@ export const UI = () => {
4040
case 'versionDocs':
4141
return (
4242
<Docs
43-
selectedSubmodule={DEFAULT_SUBMODULE}
43+
selectedSubmodule={defaultSubmodule}
4444
selectedPage={location.params.page}
4545
selectedVersion={location.params.version}
4646
/>

src/ui/router/DocLinkContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createContext } from 'preact'
2-
import { DEFAULT_SUBMODULE } from '@date-fns/date-fns-db'
2+
import { defaultSubmodule } from '@date-fns/docs/db'
33
import { DocLinkParams } from '~/ui/router/docLink'
44

55
export const DocLinkContext = createContext<Omit<DocLinkParams, 'page'>>({
6-
submodule: DEFAULT_SUBMODULE,
6+
submodule: defaultSubmodule,
77
})

src/ui/router/docLink.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DEFAULT_SUBMODULE, Submodule } from '@date-fns/date-fns-db'
1+
import { defaultSubmodule, Submodule } from '@date-fns/docs/db'
22
import { AppRouteRef } from '~/ui/router'
33

44
export interface DocLinkParams {
@@ -11,7 +11,7 @@ export function docLink({
1111
submodule,
1212
version,
1313
}: DocLinkParams): AppRouteRef {
14-
if (!submodule || submodule === DEFAULT_SUBMODULE) {
14+
if (!submodule || submodule === defaultSubmodule) {
1515
return version
1616
? {
1717
name: 'versionDocs',

src/ui/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Submodule } from '@date-fns/date-fns-db'
1+
import { Submodule } from '@date-fns/docs/db'
22
import { createRouter, InferRouteRef, route } from '@switcher/preact'
33

44
export const appRoutes = [

src/ui/screens/Docs/Doc/Content.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { h, FunctionComponent } from 'preact'
2-
import { Page } from '@date-fns/date-fns-db'
3-
import { parse } from 'json-bond'
2+
import { Page } from '@date-fns/docs/db'
3+
import { parse } from 'typeroo/json'
44
import { JSDoc } from './JSDoc'
55
import { MarkdownDoc } from './MarkdownDoc'
66

@@ -10,8 +10,16 @@ interface Props {
1010

1111
export const Content: FunctionComponent<Props> = ({ page }) => {
1212
switch (page.type) {
13+
case 'tsdoc':
14+
return (
15+
<pre>
16+
<code>{JSON.stringify(page)}</code>
17+
</pre>
18+
)
19+
1320
case 'jsdoc':
1421
return <JSDoc doc={parse(page.doc)} />
22+
1523
case 'markdown':
1624
return <MarkdownDoc markdown={page.markdown} />
1725
}

src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { h, FunctionComponent } from 'preact'
2-
import { JSDocParam } from '@date-fns/date-fns-db'
2+
import { JSDocParam } from '@date-fns/docs/db'
33
import { DocParams } from '~/ui/components/DocParams'
44
import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor'
55

src/ui/screens/Docs/Doc/JSDoc/Exceptions/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { h, FunctionComponent } from 'preact'
2-
import { JSDocTypedAttribute } from '@date-fns/date-fns-db'
2+
import { JSDocAttribute } from '@date-fns/docs/db'
33
import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor'
44
import { Markdown } from '~/ui/components/Markdown'
55

66
interface Props {
7-
exceptions: JSDocTypedAttribute[]
7+
exceptions: JSDocAttribute[]
88
}
99

1010
export const Exceptions: FunctionComponent<Props> = ({ exceptions }) => (

src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { h, FunctionComponent } from 'preact'
2-
import { JSDocParam } from '@date-fns/date-fns-db'
2+
import { JSDocParam } from '@date-fns/docs/db'
33
import { DocParams } from '~/ui/components/DocParams'
44
import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor'
55

0 commit comments

Comments
 (0)