|
1 | | -# Website |
| 1 | +# MetaCall Documentation |
2 | 2 |
|
3 | | -This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. |
| 3 | +A documentation website for the MetaCall project, built with **Docusaurus v3**. |
| 4 | +This repository contains the full documentation source, components, custom MDX, UI enhancements, and CI/CD workflows for automatic preview deployments. |
4 | 5 |
|
5 | | -### Installation |
| 6 | +--- |
6 | 7 |
|
7 | | -``` |
8 | | -$ yarn |
9 | | -``` |
| 8 | +## 📦 Installation |
10 | 9 |
|
11 | | -### Local Development |
| 10 | +This project requires **Node.js ≥ 20** (CI uses Node 22). |
12 | 11 |
|
| 12 | +```bash |
| 13 | +npm install |
13 | 14 | ``` |
14 | | -$ yarn start |
| 15 | + |
| 16 | +Or with CI-friendly clean install: |
| 17 | + |
| 18 | +```bash |
| 19 | +npm ci |
15 | 20 | ``` |
16 | 21 |
|
17 | | -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. |
| 22 | +--- |
18 | 23 |
|
19 | | -### Build |
| 24 | +## 🧞 Scripts |
20 | 25 |
|
| 26 | +### Development |
| 27 | + |
| 28 | +```bash |
| 29 | +npm run dev # Start Docusaurus dev server |
| 30 | +npm start # Alias for dev |
| 31 | +npm run build # Build static site |
| 32 | +npm run serve # Serve build locally |
21 | 33 | ``` |
22 | | -$ yarn build |
| 34 | + |
| 35 | +### Maintenance |
| 36 | + |
| 37 | +```bash |
| 38 | +npm run lint # Lint code with ESLint |
| 39 | +npm run lint:fix # Lint + fix |
| 40 | +npm run format # Check formatting with Prettier |
| 41 | +npm run format:fix # Auto-format |
| 42 | +npm run clear # Clear Docusaurus cache |
| 43 | +npm run swizzle # Swizzle theme components |
| 44 | +npm run write-translations |
| 45 | +npm run write-heading-ids |
23 | 46 | ``` |
24 | 47 |
|
25 | | -This command generates static content into the `build` directory and can be served using any static contents hosting service. |
| 48 | +--- |
| 49 | + |
| 50 | +## 🧭 Deployment & CI |
26 | 51 |
|
27 | | -### Deployment |
| 52 | +This repository uses a GitHub Actions workflow with three jobs: |
28 | 53 |
|
29 | | -Using SSH: |
| 54 | +### **1. Build** |
| 55 | +- Runs on every push to `master` and every PR. |
| 56 | +- Installs dependencies, lints, formats, injects correct `baseUrl`, and builds the site. |
| 57 | +- Stores the build as an artifact. |
| 58 | + |
| 59 | +### **2. Deploy Preview** |
| 60 | +- For PRs, a preview is automatically deployed to GitHub Pages under: |
30 | 61 |
|
31 | 62 | ``` |
32 | | -$ USE_SSH=true yarn deploy |
| 63 | +https://<owner>.github.io/<repo>/pr-<PR_NUMBER>/ |
33 | 64 | ``` |
34 | 65 |
|
35 | | -Not using SSH: |
| 66 | +- A sticky PR comment is automatically added with the preview URL. |
36 | 67 |
|
| 68 | +### **3. Cleanup** |
| 69 | +- When a PR is closed, its preview directory is removed from the `gh-pages` branch. |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +## 🤝 Contributing |
| 74 | + |
| 75 | +We welcome contributions from both **internal maintainers** and **external contributors**. |
| 76 | +Because of GitHub permissions limitations, the preview workflow differs slightly depending on who you are. |
| 77 | + |
| 78 | +### 🟢 If you are an existing contributor with write access |
| 79 | + |
| 80 | +You can contribute normally: |
| 81 | + |
| 82 | +1. Fork or create a branch directly in the main repo. |
| 83 | +2. Open a Pull Request to `master`. |
| 84 | +3. A **preview deployment** will automatically appear in your PR. |
| 85 | + |
| 86 | +No additional actions required. |
| 87 | + |
| 88 | +### 🔵 If you are an external contributor |
| 89 | + |
| 90 | +You can still get PR preview deployments, but you must use this workflow: |
| 91 | + |
| 92 | +1. **Fork** the repository. |
| 93 | +2. Make your changes in your fork. |
| 94 | +3. Create a **Pull Request inside your own fork** (fork → fork). |
| 95 | + This PR will generate **its own PR preview site**. |
| 96 | +4. Then create a **new Pull Request to the main repository** (fork → upstream). |
| 97 | +5. In that PR, **include a link** to the PR in your fork. |
| 98 | + |
| 99 | +This allows maintainers to: |
| 100 | + |
| 101 | +- View your exact changes |
| 102 | +- Access your preview deployment |
| 103 | +- Safely review contributions without requiring additional permissions |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## 🧪 Local Development Tips |
| 108 | + |
| 109 | +- Use `npm run dev` for instant hot reload. |
| 110 | +- If docs are not updating, try: |
| 111 | + |
| 112 | +```bash |
| 113 | +npm run clear |
37 | 114 | ``` |
38 | | -$ GIT_USER=<Your GitHub username> yarn deploy |
39 | | -``` |
40 | 115 |
|
41 | | -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
| 116 | +- Follow ESLint + Prettier rules (CI enforces them). |
| 117 | + |
| 118 | +--- |
| 119 | + |
| 120 | +## 📄 License |
| 121 | + |
| 122 | + |
| 123 | +This project is licensed under the Apache License 2.0. You can find the full license text here: |
| 124 | +➡️ [LICENSE](LICENSE) |
| 125 | + |
0 commit comments