diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e0f0acf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: CI +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + name: Build & Typecheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: npm + - run: npm install + - run: npm run compile + - run: npm run prod:build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f74722e..dbee44d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js 18.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x - run: npm install diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..3c03207 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c0e5f0a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,94 @@ +# Contributing to quantecon-theme-src + +Thank you for your interest in contributing to the QuantEcon theme! + +## Prerequisites + +- **Node.js** ≥ 18 (see `.nvmrc`) +- **npm** 8.x (see `packageManager` in `package.json`) + +## Development Setup + +```bash +# Clone the repository +git clone https://github.com/QuantEcon/quantecon-theme-src.git +cd quantecon-theme-src + +# Install dependencies +npm install + +# Start the development server (with hot reload) +npm run dev +``` + +The dev server runs at `http://localhost:3000` by default. + +## Available Scripts + +| Command | Description | +| ------------------- | ------------------------------------------------ | +| `npm run dev` | Start dev server with CSS watch + hot reload | +| `npm run prod:build`| Production build (CSS + Thebe assets + Remix) | +| `npm run compile` | TypeScript type-check (`tsc --noEmit`) | +| `npm run format` | Format code with Prettier | +| `npm run clean` | Remove build artifacts | + +## Project Structure + +``` +app/ + backend/ # Server-side loaders (Remix loader functions) + components/ # React components (toolbar/, sidebar, page layout) + hooks/ # Custom React hooks + routes/ # Remix route modules + root.tsx # App shell (document head, theme providers) +styles/ + app.css # Tailwind CSS entry point +public/ # Static assets (logos, Thebe bundles) +patches/ # patch-package patches for upstream fixes +``` + +## Making Changes + +1. **Create a branch** from `main`: + ```bash + git checkout -b feat/my-feature + ``` + +2. **Run type-checking** before committing: + ```bash + npm run compile + ``` + +3. **Test a production build** to catch build-time issues: + ```bash + npm run prod:build + ``` + +4. **Open a Pull Request** against `main`. CI will run type-check and build automatically. + +## Commit Convention + +We use conventional commits: + +- `fix:` — Bug fixes +- `feat:` — New features +- `chore:` — Maintenance (deps, config, CI) +- `docs:` — Documentation only +- `ci:` — CI/workflow changes + +## Releases + +Releases are managed via [Changesets](https://github.com/changesets/changesets). To propose a version bump: + +```bash +npm run changeset +``` + +Follow the prompts, then commit the generated changeset file with your PR. + +## Notes + +- The theme is built on [Remix v1](https://remix.run/) and [@myst-theme](https://github.com/jupyter-book/myst-theme). +- Tailwind CSS is used for styling — see `tailwind.config.js` for the theme configuration. +- TypeScript strict mode is enabled — all code must pass `tsc --noEmit`. diff --git a/app/components/ProjectFrontmatter.tsx b/app/components/ProjectFrontmatter.tsx index 3838070..b18ab7f 100644 --- a/app/components/ProjectFrontmatter.tsx +++ b/app/components/ProjectFrontmatter.tsx @@ -43,7 +43,7 @@ export function ProjectFrontmatter({ )} {authors && ( -