Skip to content
Merged
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,42 @@ npm install
npm start
```

#### GitHub Token

The documentation build requires a GitHub Personal Access Token to fetch Ionic Framework release notes. The build will still work locally without it (release notes will be empty), but it's required for Vercel preview and production builds.

**Local Development:**

1. Create a [fine-grained Personal Access Token](https://github.com/settings/personal-access-tokens/new) with:

- **Repository access**: Public repositories (read-only)
- **Expiration**: 366 days (update annually)

2. Add the token to your shell profile (`~/.zshrc`, `~/.bashrc`, etc.):

```sh
export GITHUB_TOKEN=github_pat_...
```

3. Reload your shell or run `source ~/.zshrc` (or equivalent)

**Vercel:**

1. Create a [fine-grained Personal Access Token](https://github.com/settings/personal-access-tokens/new) with the same settings as above, but with:

- **Owner**: ionic-team organization (not your personal account)

2. Add the token to Vercel project settings:

- Go to your project on Vercel
- Navigate to **Settings → Environment Variables**
- Add `GITHUB_TOKEN` with the token value
- Select Production and Preview environments

3. Redeploy the project for the token to take effect

Without the token, the build will fail with an error message indicating the token is missing.

### Linting Documentation

This repository uses [Prettier](https://prettier.io/), an opinionated code formatter, in order to keep consistent formatting throughout the documentation. Run the following command to automatically fix all formatting, and then push any changes:
Expand Down
191 changes: 0 additions & 191 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"node": ">=20.0.0"
},
"scripts": {
"prebuild": "npm run generate-markdown; scripts/i18n.sh; if [ -n \"$CROWDIN_PERSONAL_TOKEN\" ]; then npm run crowdin:sync; fi",
"prebuild": "npm run generate-markdown && scripts/i18n.sh && if [ -n \"$CROWDIN_PERSONAL_TOKEN\" ]; then npm run crowdin:sync; fi",
"build": "npm run build:${VERCEL_ENV:-preview}",
"build:preview": "docusaurus build --locale en",
"build:production": "docusaurus build",
"clear": "docusaurus clear",
"crowdin:sync": "docusaurus write-translations && crowdin upload && crowdin download",
"deploy": "docusaurus deploy",
"docusaurus": "docusaurus",
"generate-markdown": "node scripts/native.mjs && concurrently \"node scripts/cli.mjs\" \"node scripts/release-notes.mjs\"",
"generate-markdown": "node scripts/native.mjs && node scripts/cli.mjs && node scripts/release-notes.mjs",
Comment thread
brandyscarney marked this conversation as resolved.
"lint": "npm run prettier -- --write",
"serve": "docusaurus serve",
"playground:new": "hygen playground new",
Expand Down Expand Up @@ -48,7 +48,6 @@
"@stackblitz/sdk": "^1.6.0",
"@tippyjs/react": "^4.2.6",
"clsx": "^1.1.1",
"concurrently": "^6.2.0",
"crowdin": "^3.5.0",
"docusaurus-plugin-copy-page-button": "^0.8.2",
"docusaurus-plugin-module-alias": "^0.0.2",
Expand Down
1 change: 1 addition & 0 deletions scripts/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const commandToKebab = (str) =>
const { commands } = cliJSON;

commands.map(writePage);
console.log(`📟 CLI Commands Generated`);
})();

function writePage(page) {
Expand Down
5 changes: 2 additions & 3 deletions scripts/native.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { writeFileSync } from 'fs';
import fetch from 'node-fetch';

// replace with latest once it's relased
const tag = 'latest';

const pluginApis = [
Expand Down Expand Up @@ -51,7 +50,7 @@ function createApiPage(pluginId, readme, pkgJson) {

/**
* Cleanup and transform JSDoc content for compatibility with MDX/Docusaurus:
*
*
* - Remove HTML comments (`<!-- ... -->`) which are not valid in MDX and will cause parsing errors.
* - Escape `{` characters inside <code> blocks because MDX treats `{}` as JavaScript expressions. Unescaped `{` inside code blocks can cause parsing errors.
* - Convert JSDoc-style {@link URL|Text} and {@link URL} to proper Markdown links:
Expand Down Expand Up @@ -97,7 +96,7 @@ async function getPkgJsonData(pluginId) {

async function main() {
await Promise.all(pluginApis.map(buildPluginApiDocs));
console.log(`Plugin API Files Updated 🎸`);
console.log(`🔌 Capacitor Plugins Generated`);
}

function toTitleCase(str) {
Expand Down
Loading
Loading