Skip to content

Commit 613fed1

Browse files
committed
switch to typescript + sass, add typings
1 parent 951973d commit 613fed1

File tree

13 files changed

+438
-306
lines changed

13 files changed

+438
-306
lines changed

docusaurus.config.js

Lines changed: 88 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -10,102 +10,106 @@ module.exports = {
1010
favicon: "img/fastj/fastj_icon.png",
1111
organizationName: "fastjengine",
1212
projectName: "fastjengine.github.io",
13-
themeConfig: {
14-
prism: {
15-
additionalLanguages: ["java", "groovy", "kotlin"],
16-
},
17-
colorMode: {
18-
defaultMode: "dark",
19-
disableSwitch: false,
20-
respectPrefersColorScheme: false,
21-
switchConfig: {
22-
darkIcon: "🌙",
23-
lightIcon: "❄️",
13+
plugins: ["docusaurus-plugin-sass"],
14+
themeConfig:
15+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
16+
({
17+
prism: {
18+
additionalLanguages: ["java", "groovy", "kotlin"],
2419
},
25-
},
26-
navbar: {
27-
logo: {
28-
alt: "FastJ Logo",
29-
src: "svg/fastj_icon.svg",
30-
},
31-
items: [
32-
{
33-
type: "doc",
34-
docId: "intro",
35-
position: "left",
36-
label: "Wiki",
37-
},
38-
{
39-
href: "https://javadoc.io/doc/io.github.lucasstarsz.fastj/fastj-library",
40-
label: "API Docs",
41-
position: "left",
42-
},
43-
{
44-
to: "/news",
45-
label: "News",
46-
position: "left",
47-
},
48-
{
49-
href: "https://github.com/fastjengine/FastJ/",
50-
label: "GitHub",
51-
position: "right",
52-
},
53-
],
54-
},
55-
footer: {
56-
style: "dark",
57-
links: [
58-
{
59-
title: "Docs",
60-
items: [
61-
{
62-
label: "Wiki",
63-
to: "/wiki/intro",
64-
},
65-
{
66-
label: "API Docs",
67-
href: "https://api.fastj.dev",
68-
},
69-
],
20+
colorMode: {
21+
defaultMode: "dark",
22+
disableSwitch: false,
23+
respectPrefersColorScheme: false,
24+
switchConfig: {
25+
darkIcon: "🌙",
26+
lightIcon: "❄️",
7027
},
71-
{
72-
title: "Community",
73-
items: [
74-
{
75-
label: "FastJ Discord",
76-
href: "https://discord.gg/FTWsYVSDv6",
77-
},
78-
],
79-
},
80-
{
81-
title: "More",
82-
items: [
83-
{
84-
label: "News",
85-
to: "/news",
86-
},
87-
{
88-
label: "GitHub",
89-
href: "https://fastj.dev/",
90-
},
91-
],
28+
},
29+
navbar: {
30+
logo: {
31+
alt: "FastJ Logo",
32+
src: "svg/fastj_icon.svg",
9233
},
93-
],
94-
copyright: `Copyright © ${new Date().getFullYear()} Andrew Dey. Built with Docusaurus.
34+
items: [
35+
{
36+
type: "doc",
37+
docId: "intro",
38+
position: "left",
39+
label: "Wiki",
40+
},
41+
{
42+
href: "https://javadoc.io/doc/io.github.lucasstarsz.fastj/fastj-library",
43+
label: "API Docs",
44+
position: "left",
45+
},
46+
{
47+
to: "/news",
48+
label: "News",
49+
position: "left",
50+
},
51+
{
52+
href: "https://github.com/fastjengine/FastJ/",
53+
label: "GitHub",
54+
position: "right",
55+
},
56+
],
57+
},
58+
footer: {
59+
style: "dark",
60+
links: [
61+
{
62+
title: "Docs",
63+
items: [
64+
{
65+
label: "Wiki",
66+
to: "/wiki/intro",
67+
},
68+
{
69+
label: "API Docs",
70+
href: "https://api.fastj.dev",
71+
},
72+
],
73+
},
74+
{
75+
title: "Community",
76+
items: [
77+
{
78+
label: "FastJ Discord",
79+
href: "https://discord.gg/FTWsYVSDv6",
80+
},
81+
],
82+
},
83+
{
84+
title: "More",
85+
items: [
86+
{
87+
label: "News",
88+
to: "/news",
89+
},
90+
{
91+
label: "GitHub",
92+
href: "https://fastj.dev/",
93+
},
94+
],
95+
},
96+
],
97+
copyright: `Copyright © ${new Date().getFullYear()} Andrew Dey. Built with Docusaurus.
9598
<br/>
9699
Hand + Feather, Windows, macOS, and Linux icons originally made by
97100
<a href="https://www.freepik.com" title="Freepik">Freepik</a>
98101
from
99102
<a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>,
100103
and modified by me.`,
101-
},
102-
},
104+
},
105+
}),
103106
presets: [
104107
[
105108
"@docusaurus/preset-classic",
106-
{
109+
/** @type {import('@docusaurus/preset-classic').Options} */
110+
({
107111
theme: {
108-
customCss: require.resolve("./src/css/custom.css"),
112+
customCss: require.resolve("./src/css/custom.scss"),
109113
},
110114
blog: {
111115
path: "news",
@@ -124,7 +128,7 @@ module.exports = {
124128
editUrl:
125129
"https://github.com/fastjengine/fastjengine.github.io/edit/main/",
126130
},
127-
},
131+
}),
128132
],
129133
],
130134
};

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
"@docusaurus/preset-classic": "^2.0.0-beta.4",
1919
"@mdx-js/react": "^1.6.21",
2020
"clsx": "^1.1.1",
21+
"docusaurus-plugin-sass": "^0.2.1",
2122
"react": "^17.0.2",
22-
"react-dom": "^17.0.2"
23+
"react-dom": "^17.0.2",
24+
"sass": "^1.42.1"
2325
},
2426
"browserslist": {
2527
"production": [
@@ -32,5 +34,13 @@
3234
"last 1 firefox version",
3335
"last 1 safari version"
3436
]
37+
},
38+
"devDependencies": {
39+
"@docusaurus/module-type-aliases": "^2.0.0-beta.6",
40+
"@tsconfig/docusaurus": "^1.0.4",
41+
"@types/react": "^17.0.27",
42+
"@types/react-helmet": "^6.1.3",
43+
"@types/react-router-dom": "^5.3.1",
44+
"typescript": "^4.4.3"
3545
}
3646
}

src/components/HomepageFeatures.js

Lines changed: 0 additions & 72 deletions
This file was deleted.

src/components/HomepageFeatures.module.css renamed to src/components/HomepageFeatures.module.scss

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
align-items: center;
66
padding: 2rem 1rem;
77
width: 100%;
8-
}
9-
10-
.featureMedia {
11-
height: 200px;
12-
width: 200px;
13-
}
148

15-
@media screen and (max-width: 966px) {
16-
.features {
9+
@media screen and (max-width: 966px) {
1710
padding: 2rem 2rem;
1811
}
12+
13+
.featureMedia {
14+
height: 200px;
15+
width: 200px;
16+
}
1917
}

0 commit comments

Comments
 (0)