Enhance @llmtxt packages and improve SPA support#5
Conversation
| }; | ||
|
|
||
| function normalizeBaseUrl(baseUrl: string): string { | ||
| return baseUrl.replace(/\/+$/, ''); |
| return html | ||
| .replace(/<script[\s\S]*?<\/script>/gi, '') | ||
| .replace(/<style[\s\S]*?<\/style>/gi, '') | ||
| .replace(/<\/(p|div|section|article|h\d|li|ul|ol|br)\s*>/gi, '\n') | ||
| .replace(/<[^>]+>/g, '') |
| return html | ||
| .replace(/<script[\s\S]*?<\/script>/gi, '') | ||
| .replace(/<style[\s\S]*?<\/style>/gi, '') |
| return html | ||
| .replace(/<script[\s\S]*?<\/script>/gi, '') |
| return html | ||
| .replace(/<script[\s\S]*?<\/script>/gi, '') | ||
| .replace(/<style[\s\S]*?<\/style>/gi, '') | ||
| .replace(/<\/(p|div|section|article|h\d|li|ul|ol|br)\s*>/gi, '\n') | ||
| .replace(/<[^>]+>/g, '') | ||
| .replace(/ /g, ' ') | ||
| .replace(/&/g, '&') |
|
|
||
| function stripHtmlToText(html: string): string { | ||
| return html | ||
| .replace(/<script[\s\S]*?<\/script>/gi, '') |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (8)
📒 Files selected for processing (55)
📝 WalkthroughWalkthroughThis PR performs a comprehensive namespace migration from ChangesNamespace migration and React package launch
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This pull request introduces a new example React application demonstrating how to use
@llmtxt/reactto generate AI-friendly documentation for SPAs, and updates documentation and configuration to use the correct package naming (@llmtxt/*) throughout the repository. It also adds a sample.npmrc.examplefor npm publishing, and improves the main and example READMEs with clearer instructions and new sections for React integration.Major additions and improvements:
React Example App:
examples/my-react-app/— a comprehensive Vite + React + React Router demo showcasing@llmtxt/reactintegration, including 11+ pages, a documentation generator script, and full setup instructions. [1] [2] [3] [4] [5] [6]Documentation and package naming:
@llmstxt/*to@llmtxt/*in the mainREADME.md, example READMEs, and code snippets to ensure consistency and correct usage. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]New documentation sections:
README.md, with step-by-step instructions for integrating@llmtxt/reactin SPAs.Configuration and publishing:
.npmrc.examplefor npm registry and token configuration, aiding package publishing and local development.Other improvements:
.gitignoreand ESLint config in the new React example for best practices and developer experience. [1] [2]These changes provide a clear example for React SPA users, ensure correct package references, and improve the onboarding and publishing experience.<!--
😀 Wonderful! Thank you for opening a pull request.
Please fill in the information below to expedite the review
and (hopefully) merge of your change.
-->
Description of change
Pull-Request Checklist
mainbranchnpm run lintpasses with this changenpm run testpasses with this changeFixes #0000Summary by CodeRabbit
Release Notes
New Features
@llmtxt/reactpackage for generating documentation files from React single-page applications at build time without requiring a backend.Documentation
@llmtxtpackage namespace.Chores