Skip to content

feat(ssg): add SSG pre-rendering support with render loop#11

Closed
lemyskaman wants to merge 39 commits into
mainfrom
feat/ssg-pre-rendering-support
Closed

feat(ssg): add SSG pre-rendering support with render loop#11
lemyskaman wants to merge 39 commits into
mainfrom
feat/ssg-pre-rendering-support

Conversation

@lemyskaman

Copy link
Copy Markdown
Member

Summary

This PR adds build-time pre-rendering (SSG) support to the vite-plugin-flatwave-react plugin, along with a client-side render loop for SPA-like navigation.

Changes

SSG Pre-rendering Support

  • Added plugin that generates static HTML at build time
  • New option in plugin configuration to enable SSG
  • Supports custom SSR entry point via option
  • Generates sitemap.xml, robots.txt, and route-manifest.json
  • Prerendered routes are emitted as static assets during

Render Loop (Client-side)

  • Added export from
  • Client-side navigation without full page reloads
  • Scroll management and history integration
  • React Context-based page context provider

Plugin Exports (package.json)

    • Client render loop entry point
    • Render utilities
    • Server entry for SSR
    • Content indexing utilities
    • Virtual module types (existing)

Example App Updates

  • Updated to use render loop
  • Added prerender script and SSR entry point
  • Configured SSG in vite.config.ts

Documentation

  • Updated README with SSG pre-rendering documentation
  • Renamed design doc to ARCHITECTURE.md

Breaking Changes

  • None - all new features are opt-in via configuration

Testing

  • Added e2e tests for full pipeline
  • Added unit tests for prerenderer and template
  • Integration tests for plugin

Conventional Commit

feat: add SSG pre-rendering support with render loop

lemyskaman and others added 30 commits March 22, 2026 21:02
…flow

Implement the Vite plugin for Markdown-driven i18n React static sites, including content scanning, parsing, validation, virtual content APIs, React hooks, SEO metadata helpers, route manifest output, sitemap generation, and robots.txt generation. Add the basic React example app, Docker development/build/static infrastructure, end-to-end coverage, npm package metadata, package README and license files, and the GitHub Actions npm release workflow. Configure the workflow to publish with provenance, support trusted publishing or NPM_TOKEN fallback, and bump only the patch version on merged PRs to main while preserving major and minor versions from the PR.
Replace the patch-bump + token workflow with Conventional-Commits versioning and tokenless OIDC trusted publishing on merge to main. Local one-time/rare publishes and the dry-run run on the host via a momentary nvm Node switch; routine releases run natively in CI.

Co-Authored-By: Oz <oz-agent@warp.dev>
feat(automation)!: basic scaffolding for linting formating and pipelines
…components--vite-plugin-flatwave-react-workspace

chore(main): release 1.0.0
…#4)

* adding release please (verify why another github wrk actions)

* fix: Resolve publishing pipeline conflicts and CI issues

- Remove OIDC from release.yml, add NODE_AUTH_TOKEN for NPM_TOKEN auth
- Delete conflicting release-please.yml and .release-please-manifest.json
- Move test-matrix to PR-only, add HUSKY=0 to npm ci steps
- Remove Node 20 from matrix (unsupported by engine>=22)
- Add AI tool directories to .gitignore

* style: Fix CHANGELOG.md formatting for Prettier

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…emantic-release prepare (#5)

* Initial plan

* fix: Avoid npm registry lookup during semantic-release prepare

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Initial plan

* fix(release): Enable OIDC trusted publishing in release workflow

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Scope package to @kamansoft npm org, fix all CI/CD pipeline issues, first npm publish done.
…al commit pipeline

Remove NPM_TOKEN from release workflow; authenticate via npm OIDC trusted publishing. Complete docs rewrite and merge strategy enforcement.
…dure

Documents enforce_admins: true branch protection and the stale-tag cleanup procedure. Updates status banner to reflect fully locked pipeline.
… details

- Accurate current state: OIDC trusted publishing is active, NPM_TOKEN removed
- Complete npmjs.com settings: trusted publisher form values, publishing access
- Complete GitHub settings: branch protection rules with correct check names,
  secrets status (NPM_TOKEN can be deleted)
- All commands executed during setup with explanations
- Orphaned tag cleanup procedure documented
- Expanded troubleshooting: stale pending checks, orphaned tags, self-hosted
  runner limitation, manual workflow trigger
- Add PrerenderOptions type with routes, exclude, stream, template options
- Create prerender module (renderer, template, component registry)
- Add SSR entry template (templates/entry-server.tsx)
- Implement createPrerenderer() for external pre-rendering pipeline
- Update plugin to support prerender option and skip HTML generation during build
- Add example app SSR entry with markdown-it rendering
- Add build + prerender scripts to example package.json
- Add comprehensive test suite:
  - Unit tests for prerender module (renderer, template)
  - Integration tests for full plugin behavior with Vite
  - E2E tests validating pre-rendered HTML output
  - Test fixtures with multi-locale content

Closes: #SSG-pre-rendering
… to ARCHITECTURE.md

- Add comprehensive SSG pre-rendering documentation to README.md
  - Two-step build process explanation
  - SSR entry template example
  - Pre-render script setup
  - Configuration options
  - Pre-rendered output structure
  - Updated project structure diagram

- Update design document to reflect actual implemented state
  - Rename from Flatwave-Content-Plugin-Requirements-Proposal-Design-Report.md to ARCHITECTURE.md
  - Convert from proposal to implemented architecture documentation
  - Add mermaid diagrams for plugin pipeline
  - Document actual module structure and data models
  - Include SSR build + pre-render step details
  - Add testing strategy and deployment sections
@lemyskaman lemyskaman force-pushed the feat/ssg-pre-rendering-support branch from aea6a9c to 20ca641 Compare June 19, 2026 16:39
@lemyskaman lemyskaman changed the title feat: add SSG pre-rendering support with render loop feat(ssg): add SSG pre-rendering support with render loop Jun 19, 2026
@lemyskaman lemyskaman marked this pull request as ready for review June 19, 2026 16:47
@lemyskaman lemyskaman marked this pull request as draft June 19, 2026 16:53
Root cause: examples/basic-react-site/package.json still referenced
unscoped 'vite-plugin-flatwave-react@0.1.0' instead of the scoped
'@kamansoft/vite-plugin-flatwave-react' workspace package. npm ci
tried to fetch the unscoped package from the npm registry (404).

Changes:
- Fix unscoped package reference in example package.json
- Add build output dirs to eslint ignore list
- Remove unused imports and fix lint errors across source/test files
- Add eslint-disable comments for intentional React.ComponentType<any> usage
- Fix example files to use @kamansoft/vite-plugin-flatwave-react scoped name
- Update e2e test to run prerender step before serving
- Fix virtual-content-ssr.ts to exclude from example tsconfig (SSR-only)
- Add @types/markdown-it and vite/client types to example tsconfig
@lemyskaman lemyskaman closed this Jun 19, 2026
@lemyskaman lemyskaman force-pushed the feat/ssg-pre-rendering-support branch from d06432d to 7f5fdd4 Compare June 19, 2026 18:05
@lemyskaman lemyskaman deleted the feat/ssg-pre-rendering-support branch June 20, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants