From 4b2e1d55b6eec130738bd6111ca1a2c23db92a89 Mon Sep 17 00:00:00 2001 From: m0_37981569 Date: Sun, 14 Jun 2026 20:31:36 +0800 Subject: [PATCH 1/2] feat: add npm theme catalog schema and package.json for theme management - Introduced a new JSON schema for the npm theme catalog, defining the structure and required properties for theme packages. - Created a package.json file for the ReactPress theme registry, including scripts for theme management and local sources. - Updated .gitignore to exclude build outputs and generated files, ensuring cleaner repository management. --- .gitignore | 6 +++ themes/npm-catalog.schema.json | 73 ++++++++++++++++++++++++++++++++++ themes/package.json | 16 ++++++++ 3 files changed, 95 insertions(+) create mode 100644 themes/npm-catalog.schema.json create mode 100644 themes/package.json diff --git a/.gitignore b/.gitignore index 00a6285..b440e1b 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,12 @@ 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 .cache-loader diff --git a/themes/npm-catalog.schema.json b/themes/npm-catalog.schema.json new file mode 100644 index 0000000..725ac98 --- /dev/null +++ b/themes/npm-catalog.schema.json @@ -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 +} diff --git a/themes/package.json b/themes/package.json new file mode 100644 index 0000000..aa4f9b1 --- /dev/null +++ b/themes/package.json @@ -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"] + } +} From b1d66b3c55430d99c0e7f1a5501b8793f3e2afd5 Mon Sep 17 00:00:00 2001 From: m0_37981569 Date: Sun, 14 Jun 2026 20:35:07 +0800 Subject: [PATCH 2/2] feat: implement CI/CD for documentation deployment - Added a GitHub Actions workflow for building and deploying documentation to Vercel on push to main or master branches. - Updated docusaurus.config.ts to allow dynamic setting of the production URL via environment variable. - Introduced new scripts in package.json for deploying to Vercel. - Created vercel.json configuration for Vercel deployment settings. - Updated .gitignore to exclude build outputs from the repository. --- .github/workflows/ci.yml | 20 ++++++++++++++ .github/workflows/deploy-docs.yml | 45 +++++++++++++++++++++++++++++++ .gitignore | 1 + docs/docusaurus.config.ts | 4 +-- docs/package.json | 1 + docs/vercel.json | 7 +++++ 6 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy-docs.yml create mode 100644 docs/vercel.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe6f513..4d546e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..ddff131 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -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 diff --git a/.gitignore b/.gitignore index b440e1b..b17d4ca 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ playwright-report/ # Generated files .docusaurus +docs/build .cache-loader # Misc diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 68292a9..e221a49 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -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 // pathname under which your site is served // For GitHub pages deployment, it is often '//' baseUrl: '/', diff --git a/docs/package.json b/docs/package.json index 6652871..9404276 100644 --- a/docs/package.json +++ b/docs/package.json @@ -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", diff --git a/docs/vercel.json b/docs/vercel.json new file mode 100644 index 0000000..1b3412c --- /dev/null +++ b/docs/vercel.json @@ -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 +}