Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript Migration and Adjustments #11

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
15 changes: 9 additions & 6 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ name: documentation
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '20.x'
- name: Test Build
run: |
cd eigr_io
Expand All @@ -26,10 +29,10 @@ jobs:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '20.x'
- name: Release to GitHub Pages
env:
USE_SSH: false
Expand Down
20 changes: 11 additions & 9 deletions eigr_io/docusaurus.config.js β†’ eigr_io/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
const config: Config = {
title: 'eigr.io',
tagline: 'A Serverless Runtime on the BEAM',
url: 'https://eigr.io',
Expand Down Expand Up @@ -89,17 +89,17 @@ module.exports = {
copyright: `Copyright Β© ${new Date().getFullYear()} – eigr.io | graphics design by <a href="https://ursulahitz.com">ursulahitz.com</a>`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['elixir', 'java', 'protobuf'],
},
},
} satisfies Preset.ThemeConfig,
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
sidebarPath: require.resolve('./sidebars.ts'),
// Please change this to your repo.
editUrl:
'https://github.com/eigr/eigr.github.io/edit/main/website/',
Expand All @@ -113,7 +113,7 @@ module.exports = {
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
} satisfies Preset.Options,
],
[
'docusaurus-protobuffet',
Expand All @@ -131,3 +131,5 @@ module.exports = {
],
],
};

export default config;
26 changes: 15 additions & 11 deletions eigr_io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^2.1.0",
"@docusaurus/preset-classic": "^2.1.0",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1",
"docusaurus-protobuffet": "^0.3.2",
"file-loader": "^6.2.0",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"url-loader": "^4.1.1"
"@docusaurus/core": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.1",
"@mdx-js/react": "^3.0.0",
"@svgr/webpack": "^8.1.0",
"clsx": "^2.0.0",
"docusaurus-protobuffet": "^0.3.3",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.2",
"react-dom": "^18.0.2"
},
"browserslist": {
"production": [
Expand All @@ -37,5 +35,11 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.1",
"@docusaurus/tsconfig": "^3.0.1",
"@docusaurus/types": "^3.0.1",
"typescript": "^5.3.3"
}
}
13 changes: 9 additions & 4 deletions eigr_io/sidebars.js β†’ eigr_io/sidebars.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';

/**
* Creating a sidebar enables you to:
- create an ordered group of docs
Expand All @@ -8,19 +10,22 @@

Create as many sidebars as you want.
*/

module.exports = {
const eigrSidebar: SidebarsConfig = {
// By default, Docusaurus generates a sidebar from the docs folder structure
eigrSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
tutorialSidebar: [
'intro',
'hello',
{
type: 'category',
label: 'Documentation',
items: ['hello'],
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
*/
};

export default eigrSidebar;
4 changes: 2 additions & 2 deletions eigr_io/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
--ifm-color-primary-light: #fe1a7b;
--ifm-color-primary-lighter: #fe2782;
--ifm-color-primary-lightest: #fe4d98;
--ifm-code-font-size: 85%;
--ifm-font-size-base: 80%;
--ifm-code-font-size: 90%;
--ifm-font-size-base: 95%;
}

.docusaurus-highlight-code-line {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function HomepageHeader() {
<Link
className="button button--secondary button--lg"
to="https://eigr.io/docs/projects-spawn/spawn-introduction/">
Get Started with Spawn"
Get Started with Spawn
</Link>
</div>
</div>
Expand Down
7 changes: 7 additions & 0 deletions eigr_io/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": "."
}
}
Loading