Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ on:
branches: [main, master, develop]

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build docs
run: pnpm run build:docs

build-and-smoke:
runs-on: ubuntu-latest
services:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Docs

on:
push:
branches: [main, master]
paths:
- 'docs/**'
- 'pnpm-lock.yaml'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:

concurrency:
group: deploy-docs-${{ github.ref }}
cancel-in-progress: true

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build docs
run: pnpm run build:docs
env:
DOCS_SITE_URL: ${{ vars.DOCS_SITE_URL }}

- name: Deploy to Vercel
run: npx vercel@latest deploy build --prod --yes --token=${{ secrets.VERCEL_TOKEN }}
working-directory: docs
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ tsconfig.tsbuildinfo
# Production (root output only; do not use bare `build` — toolkit/src/theme/build is source)
/build

# Build outputs (cli/desktop compiles, electron packaging, theme preview, etc.)
out
desktop/release/
.next-preview/
playwright-report/

# Generated files
.docusaurus
docs/build
.cache-loader

# Misc
Expand Down
4 changes: 2 additions & 2 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const config: Config = {
tagline: 'One package. Your CMS in about a minute.',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://reactpress.surge.sh',
// Set the production url of your site here (override via DOCS_SITE_URL in CI/Vercel)
url: process.env.DOCS_SITE_URL ?? 'https://reactpress.surge.sh',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"deploy:vercel": "pnpm build && vercel deploy build --prod",
"deploy:surge": "pnpm build && surge build/ reactpress.surge.sh",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
Expand Down
7 changes: 7 additions & 0 deletions docs/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"installCommand": "cd .. && pnpm install --frozen-lockfile",
"buildCommand": "cd .. && pnpm run build:docs",
"outputDirectory": "build",
"framework": null
}
73 changes: 73 additions & 0 deletions themes/npm-catalog.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/fecommunity/reactpress/blob/master/themes/npm-catalog.schema.json",
"title": "ReactPress npm Theme Catalog Anchor",
"description": "Standard package.json with dependencies pointing at the theme npm package, plus reactpress.theme for admin catalog metadata.",
"type": "object",
"required": ["name", "reactpress"],
"properties": {
"$schema": {
"type": "string",
"examples": ["../npm-catalog.schema.json"]
},
"name": {
"type": "string",
"minLength": 1,
"description": "Anchor package name (catalog id; may differ from the theme npm package)."
},
"version": { "type": "string" },
"private": { "type": "boolean" },
"description": { "type": "string" },
"author": { "type": "string" },
"homepage": { "type": "string", "format": "uri" },
"license": { "type": "string" },
"dependencies": {
"type": "object",
"minProperties": 1,
"additionalProperties": { "type": "string", "minLength": 1 },
"description": "Standard package.json dependencies. The first entry is the theme package to install."
},
"reactpress": {
"type": "object",
"required": ["theme"],
"additionalProperties": false,
"properties": {
"theme": {
"type": "object",
"required": ["id", "name"],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
"description": "Runtime theme slug (.reactpress/runtime/{id}/)."
},
"name": {
"type": "string",
"minLength": 1,
"description": "Display name in admin theme list."
},
"version": {
"type": "string",
"description": "Catalog version label; defaults to dependencies version."
},
"description": { "type": "string" },
"author": { "type": "string" },
"authorUri": { "type": "string", "format": "uri" },
"themeUri": { "type": "string", "format": "uri" },
"previewUrl": { "type": "string", "format": "uri" },
"cover": { "type": "string" },
"tags": {
"type": "array",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true
},
"featured": { "type": "boolean" },
"requires": { "type": "string", "examples": [">=3.0.0"] }
}
}
}
}
},
"additionalProperties": true
}
16 changes: 16 additions & 0 deletions themes/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@fecommunity/reactpress-themes",
"version": "1.0.0",
"private": true,
"description": "ReactPress theme registry — local sources and npm catalog anchors",
"license": "MIT",
"scripts": {
"add:starter": "node ../cli/bin/reactpress.js theme add reactpress-theme-starter",
"list": "node ../cli/bin/reactpress.js theme list",
"sync:catalog": "node ../scripts/sync-theme-catalog.mjs"
},
"reactpress": {
"local": ["hello-world"],
"npm": ["theme-starter"]
}
}
Loading