diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c73cc92..2802382 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,7 +4,37 @@ on: - main jobs: + docs: + runs-on: ubuntu-latest + env: + CI: true + steps: + - uses: actions/checkout@v4 + with: + submodules: "true" + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: yarn install + working-directory: math-blocks + run: yarn install + - name: yarn build-tsc + working-directory: math-blocks + run: yarn build-tsc + - name: yarn typedoc + working-directory: math-blocks + run: yarn typedoc + - name: Upload Docs artifact + uses: actions/upload-pages-artifact@v4 + with: + path: ./docs/ + name: docs + build: + needs: docs + permissions: + actions: read # to access artifacts from the build job runs-on: ubuntu-latest env: CI: true @@ -34,8 +64,13 @@ jobs: run: yarn install --frozen-lockfile - name: yarn build run: yarn build + - name: download artifact + uses: actions/download-artifact@v4 + with: + name: docs + path: ./dist/docs - name: Upload Page Artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v4 with: path: ./dist/ diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..860b598 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,92 @@ +name: Node CI + +on: + push: + branches: + - main + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + env: + CI: true + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v4 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Cache node modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-node_modules- + - name: yarn install + run: yarn install + - name: lint + run: yarn lint + + build: + runs-on: ubuntu-latest + env: + CI: true + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v4 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Cache node modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-node_modules- + - name: yarn install + run: yarn install + - name: yarn build + run: yarn build + + docs: + runs-on: ubuntu-latest + env: + CI: true + steps: + - uses: actions/checkout@v4 + with: + submodules: "true" + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: yarn install + working-directory: math-blocks + run: yarn install + - name: yarn build-tsc + working-directory: math-blocks + run: yarn build-tsc + - name: yarn typedoc + working-directory: math-blocks + run: yarn typedoc diff --git a/.gitignore b/.gitignore index a0b4026..76b35e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules dist +.buildcache .vscode .DS_Store .vite diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..df2b9be --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "math-blocks"] + path = math-blocks + url = git@github.com:math-blocks/math-blocks.git diff --git a/eslint.config.js b/eslint.config.js index 092408a..31db88a 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,28 +1,28 @@ -import js from '@eslint/js' -import globals from 'globals' -import reactHooks from 'eslint-plugin-react-hooks' -import reactRefresh from 'eslint-plugin-react-refresh' -import tseslint from 'typescript-eslint' +import js from "@eslint/js"; +import globals from "globals"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import tseslint from "typescript-eslint"; export default tseslint.config( - { ignores: ['dist'] }, + { ignores: ["dist", "math-blocks"] }, { extends: [js.configs.recommended, ...tseslint.configs.recommended], - files: ['**/*.{ts,tsx}'], + files: ["**/*.{ts,tsx}"], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { - 'react-hooks': reactHooks, - 'react-refresh': reactRefresh, + "react-hooks": reactHooks, + "react-refresh": reactRefresh, }, rules: { ...reactHooks.configs.recommended.rules, - 'react-refresh/only-export-components': [ - 'warn', + "react-refresh/only-export-components": [ + "warn", { allowConstantExport: true }, ], }, - }, -) + } +); diff --git a/math-blocks b/math-blocks new file mode 160000 index 0000000..71cc61a --- /dev/null +++ b/math-blocks @@ -0,0 +1 @@ +Subproject commit 71cc61aa9db3e4440296550494140d907aa3ba17 diff --git a/src/homepage.tsx b/src/homepage.tsx new file mode 100644 index 0000000..ca4aee4 --- /dev/null +++ b/src/homepage.tsx @@ -0,0 +1,25 @@ +import { Link } from "react-router-dom"; + +const Homepage = () => { + return ( +