Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5315de4
added my tutorial cliamtic
MoX678 Feb 24, 2025
ecc5827
First
MoX678 Feb 26, 2025
de25f47
Modified the docs
MoX678 Feb 26, 2025
f6a3bec
Merge branch 'metacall:master' into master
MoX678 Nov 24, 2025
a19cf8a
intiai implementation
MoX678 Nov 24, 2025
31d3850
Add pull-requests permission to CI workflow
MoX678 Nov 24, 2025
9643e52
Merge pull request #1 from MoX678/feature/improve-ci-cd
MoX678 Nov 24, 2025
da7c0a4
remove the old
MoX678 Nov 24, 2025
2e353ca
Remove GitHub Actions workflow for Docusaurus deployment
MoX678 Nov 24, 2025
ec245c4
trigger deploy
MoX678 Nov 24, 2025
a3bedf1
12
MoX678 Nov 24, 2025
00031d1
change main to master
MoX678 Nov 24, 2025
a17f1f6
Update baseUrl in Docusaurus config for correct deployment path
MoX678 Nov 24, 2025
eb004b0
trigger preview 1
MoX678 Nov 24, 2025
93a8e44
Inject dynamic baseUrl into Docusaurus config for pull requests
MoX678 Nov 24, 2025
7ea6ab5
Remove redundant checkout step in build preview workflow
MoX678 Nov 24, 2025
85147b2
Refactor build preview workflow: rename checkout step and simplify co…
MoX678 Nov 24, 2025
297f9c4
Refactor Docusaurus config: update navigation links to use "to" for i…
MoX678 Nov 24, 2025
d779351
Merge branch 'master' into test-trigger-preview
MoX678 Nov 24, 2025
a9cca8f
trigger preview 1
MoX678 Nov 24, 2025
4c53aaa
Refactor build preview workflow: streamline baseUrl injection and cle…
MoX678 Nov 24, 2025
e8324df
Merge pull request #2 from MoX678/test-trigger-preview
MoX678 Nov 24, 2025
2acaa6c
Update docusaurus.config.js
MoX678 Nov 24, 2025
bfd25a5
Delete dummy.txt
MoX678 Nov 24, 2025
2433bcb
Update Docusaurus configuration for deployment
MoX678 Nov 24, 2025
bbdb98b
Add deploy workflow configuration
MoX678 Nov 24, 2025
f00a6ab
try prettier checks
MoX678 Nov 25, 2025
03baa2f
try prettier checks 2
MoX678 Nov 25, 2025
4ec5309
add husky to check before commiting
MoX678 Nov 25, 2025
a405332
remove deprecates and resolve build
MoX678 Nov 25, 2025
f0611a2
make node version 22
MoX678 Nov 25, 2025
f78a73a
spilt to parallel jobs
MoX678 Nov 25, 2025
08420a3
add caching between jops
MoX678 Nov 25, 2025
2745a80
add names for better formatting
MoX678 Nov 25, 2025
20a561a
Use single quotes, improve general configuration, improve ci."
viferga Nov 25, 2025
df99cb9
Trying to make work the ci.
viferga Nov 25, 2025
4f64747
Using double quotes again.
viferga Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.docusaurus
build
static
43 changes: 43 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// .eslintrc.js
module.exports = {
root: true,
extends: [
"plugin:@docusaurus/recommended",
"plugin:mdx/recommended",
"plugin:import/recommended",
],
plugins: ["@docusaurus", "mdx", "import"],
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},

settings: {
react: {
version: "detect",
},
// Fix for import resolution if you keep getting import errors
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
rules: {
"@docusaurus/no-untranslated-text": "off",
"@docusaurus/string-literal-i18n-messages": "error",

// Suggest using Docusaurus headings, but don't error out
"@docusaurus/prefer-docusaurus-heading": "warn",

// Import rules
"import/no-unresolved": [
"error",
{ ignore: ["^@theme", "^@docusaurus", "^@site"] },
],
"import/no-named-as-default": "off",
},
};
139 changes: 110 additions & 29 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,134 @@
name: Test and Deploy Docusaurus
name: Docs CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
branches: [master]
pull_request:
types: [opened, synchronize, reopened, closed]

permissions:
contents: write
pages: write
id-token: write
pull-requests: write

jobs:
build:
name: Build Docusaurus
name: Build Site
if: github.event.action != 'closed'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
node-version: 22

- name: Cache npm dependencies
uses: actions/cache@v4
with:
node-version: 18
cache: npm
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: npm ci
- name: Build website
run: npm ci --prefer-offline

- name: Lint Code (ESLint)
run: npm run lint

- name: Check Formatting (Prettier)
run: npm run format

- name: Inject correct baseUrl into docusaurus.config.js
id: inject
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
BASE_URL="/${{ github.event.repository.name }}/pr-${{ github.event.number }}/"
else
BASE_URL="/${{ github.event.repository.name }}/"
fi

echo "Using baseUrl=$BASE_URL"
echo "baseUrl=$BASE_URL" >> $GITHUB_OUTPUT

sed -i "s|baseUrl: '.*'|baseUrl: '$BASE_URL'|" docusaurus.config.js

- name: Build Docusaurus site
run: npm run build

- name: Upload Build Artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
- name: Upload site build as artifact
uses: actions/upload-artifact@v4
with:
name: docusaurus-build
path: build

deploy:
name: Deploy to GitHub Pages
name: Deploy Preview
needs: build
if: github.event_name != 'pull_request'
if: github.event.action != 'closed'
runs-on: ubuntu-latest

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: docusaurus-build
path: build

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
- name: Determine deploy target
id: vars
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "destination_dir=pr-${{ github.event.number }}" >> $GITHUB_OUTPUT
echo "url=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-${{ github.event.number }}/" >> $GITHUB_OUTPUT
else
echo "destination_dir=." >> $GITHUB_OUTPUT
echo "url=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/" >> $GITHUB_OUTPUT
fi

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
publish_branch: gh-pages
destination_dir: ${{ steps.vars.outputs.destination_dir }}
keep_files: true

- name: Comment preview link on PR
if: github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: docusaurus-preview
message: |
🚀 **Preview Deployed**
🔗 [View Preview](${{ steps.vars.outputs.url }})

cleanup:
name: Cleanup Preview
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages

- name: Remove PR preview directory
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

if [ -d "pr-${{ github.event.pull_request.number }}" ]; then
git rm -rf pr-${{ github.event.pull_request.number }}
git commit -m "🧹 Remove preview for PR #${{ github.event.pull_request.number }}"
git push
else
echo "Directory pr-${{ github.event.pull_request.number }} not found, skipping cleanup"
fi
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
echo "▶ Running Prettier..."
npx lint-staged
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
2 changes: 1 addition & 1 deletion docs/tutorials/treetraversal.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import DocusaurusTreeVisualization from "@site/src/components/TreeTraversal/DocusaurusWrapper";
import DocusaurusTreeVisualization from '@site/src/components/TreeTraversal/DocusaurusWrapper';

# Traversing a Polyglot Tree with MetaCall
import StarRepo from '@site/src/components/StarRepo';
Expand Down
Loading
Loading