From c8fd1384fa23d74d7dd72aad4915f20b00d7f35f Mon Sep 17 00:00:00 2001 From: Ryan Florence Date: Tue, 19 Nov 2024 11:40:47 -0700 Subject: [PATCH] docs: adjusted READMEs for the api docs generator --- README.md | 47 ++++++++-------------- packages/create-react-router/README.md | 2 - packages/react-router-architect/README.md | 4 +- packages/react-router-cloudflare/README.md | 4 +- packages/react-router-dev/README.md | 4 +- packages/react-router-dom/README.md | 7 +++- packages/react-router-express/README.md | 4 +- packages/react-router-fs-routes/README.md | 4 +- packages/react-router-node/README.md | 4 +- packages/react-router-serve/README.md | 4 +- packages/react-router/README.md | 8 +++- packages/react-router/tsup.config.ts | 6 ++- 12 files changed, 39 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index ebc5397c2b..1e910f7517 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,28 @@ -# Welcome to React Router · [![npm package][npm-badge]][npm] [![build][build-badge]][build] +[![npm package][npm-badge]][npm] [![build][build-badge]][build] [npm-badge]: https://img.shields.io/npm/v/react-router-dom.svg?style=flat-square [npm]: https://www.npmjs.org/package/react-router-dom [build-badge]: https://img.shields.io/github/actions/workflow/status/remix-run/react-router/test.yml?branch=dev&style=square [build]: https://github.com/remix-run/react-router/actions/workflows/test.yml -React Router is a lightweight, fully-featured routing library for the [React](https://reactjs.org) JavaScript library. React Router runs anywhere React runs; on the web, on the server with node.js, or on any other Javascript platform that supports the [Web Fetch API][fetch-api]. +React Router is a multi-strategy router for React bridging the gap from React 18 to React 19. You can use it maximally as a React framework or minimally as a library with your own architecture. -If you're new to React Router, we recommend you start with [the tutorial](https://reactrouter.com/en/main/start/tutorial). - -If you're migrating to v6 from v5 (or v4, which is the same as v5), check out [the migration guide](/docs/upgrading/v5.md). If you're migrating from Reach Router, check out [the migration guide for Reach Router](/docs/upgrading/reach.md). If you need to find the code for v5, [it is on the `v5` branch](https://github.com/remix-run/react-router/tree/v5). - -Documentation for v6 can be found [on our website](https://reactrouter.com/). - -## Contributing - -There are many different ways to contribute to React Router's development. If you're interested, check out [our contributing guidelines](CONTRIBUTING.md) to learn how you can get involved. +- [Getting Started - Framework](https://reactrouter.com/start/framework/installation) +- [Getting Started - Library](https://react.router.com/start/library/installation) +- [Upgrade from v6](https://reactrouter.com/upgrading/v6) +- [Upgrade from Remix](https://reactrouter.com/upgrading/remix) +- [Changelog](https://github.com/remix-run/react-router/blob/main/CHANGELOG.md) ## Packages -This repository is a monorepo containing the following packages: - -- [`@react-router/dev`](/packages/react-router-dev) -- [`@react-router/express`](/packages/react-router-express) -- [`@react-router/node`](/packages/react-router-node) -- [`@react-router/serve`](/packages/react-router-serve) -- [`react-router`](/packages/react-router) -- [`react-router-dom`](/packages/react-router-dom) - -## Changes - -Detailed release notes for a given version can be found [on our releases page](https://github.com/remix-run/react-router/releases). - -## Funding - -You may provide financial support for this project by donating [via Open Collective](https://opencollective.com/react-router). Thank you for your support! - -## About +- [react-router](./modules/react_router) +- [@react-router/dev](./modules/_react_router_dev) +- [@react-router/node](./modules/_react_router_node) +- [@react-router/cloudflare](./modules/_react_router_cloudflare) +- [@react-router/serve](./modules/_react_router_serve) +- [@react-router/fs-routes](./modules/_react_router_fs_routes) -React Router is developed and maintained by [Remix Software](https://remix.run) and many [amazing contributors](https://github.com/remix-run/react-router/graphs/contributors). +## Previous Versions -[fetch-api]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API +- [v6](https://reactrouter.com/v6) +- [v5](https://v5.reactrouter.com/) diff --git a/packages/create-react-router/README.md b/packages/create-react-router/README.md index 8fcf3653e9..50f449f3b9 100644 --- a/packages/create-react-router/README.md +++ b/packages/create-react-router/README.md @@ -1,5 +1,3 @@ -# create-react-router - Create a new React Router app. ```sh diff --git a/packages/react-router-architect/README.md b/packages/react-router-architect/README.md index 897dbdc8f1..f42337f1fb 100644 --- a/packages/react-router-architect/README.md +++ b/packages/react-router-architect/README.md @@ -1,6 +1,4 @@ -# @react-router/architect - -Architect server request handler for React Router. +[Architect](https://arc.codes) server request handler for React Router. ```bash npm install @react-router/architect diff --git a/packages/react-router-cloudflare/README.md b/packages/react-router-cloudflare/README.md index 9c8b6b051b..6ecbecb41d 100644 --- a/packages/react-router-cloudflare/README.md +++ b/packages/react-router-cloudflare/README.md @@ -1,6 +1,4 @@ -# @react-router/cloudflare - -Cloudflare platform abstractions for [React Router.](https://reactrouter.com) +Cloudflare platform abstractions for React Router ```bash npm install @react-router/cloudflare @cloudflare/workers-types diff --git a/packages/react-router-dev/README.md b/packages/react-router-dev/README.md index 9cb7bfc251..5629001a4e 100644 --- a/packages/react-router-dev/README.md +++ b/packages/react-router-dev/README.md @@ -1,6 +1,4 @@ -# @react-router/dev - -Dev tools and CLI for [React Router.](https://github.com/remix-run/react-router) +Dev tools and CLI for React Router that enables framework features through bundler integration like server rendering, code splitting, HMR, etc. ```sh npm install @react-router/dev diff --git a/packages/react-router-dom/README.md b/packages/react-router-dom/README.md index bd8108f900..d7bfd79188 100644 --- a/packages/react-router-dom/README.md +++ b/packages/react-router-dom/README.md @@ -1,3 +1,6 @@ -# React Router DOM +This package simply re-exports everything from `react-router` to smooth the upgrade path for v6 applications. Once upgraded you can change all of your imports and remove it from your dependencies: -The `react-router-dom` package is deprecated and only kept around for backwards-compatibility. It re-exports everything from the `react-router` package - you should convert your applications to import everything from `react-router` in v7 and beyond. +```diff +-import { Routes } from "react-router-dom" ++import { Routes } from "react-router" +``` diff --git a/packages/react-router-express/README.md b/packages/react-router-express/README.md index b949e57465..63c3de6441 100644 --- a/packages/react-router-express/README.md +++ b/packages/react-router-express/README.md @@ -1,6 +1,4 @@ -# @react-router/express - -[Express](https://expressjs.com) server request handler for [React Router.](https://github.com/remix-run/react-router) +[Express](https://expressjs.com) server request handler for React Router. ```sh npm install @react-router/express diff --git a/packages/react-router-fs-routes/README.md b/packages/react-router-fs-routes/README.md index d8f961b45b..a3fdebfd6e 100644 --- a/packages/react-router-fs-routes/README.md +++ b/packages/react-router-fs-routes/README.md @@ -1,6 +1,4 @@ -# @react-router/fs-routes - -File system routing conventions for [React Router](https://github.com/remix-run/react-router), for use within `routes.ts`. +File system routing conventions for React Router ```sh npm install @react-router/fs-routes diff --git a/packages/react-router-node/README.md b/packages/react-router-node/README.md index 6478831278..f789859826 100644 --- a/packages/react-router-node/README.md +++ b/packages/react-router-node/README.md @@ -1,6 +1,4 @@ -# @react-router/node - -Node.js platform abstractions for [React Router.](https://github.com/remix-run/react-router) +Node.js platform abstractions for React Router ```sh npm install @react-router/node diff --git a/packages/react-router-serve/README.md b/packages/react-router-serve/README.md index 7215d98987..fbee27bc9d 100644 --- a/packages/react-router-serve/README.md +++ b/packages/react-router-serve/README.md @@ -1,6 +1,4 @@ -# @react-router/serve - -Production application server for [React Router.](https://github.com/remix-run/react-router) +Node.js application server for React Router ```sh npm install @react-router/serve diff --git a/packages/react-router/README.md b/packages/react-router/README.md index 33140afe94..b0d8de42df 100644 --- a/packages/react-router/README.md +++ b/packages/react-router/README.md @@ -1,3 +1,7 @@ -# React Router +`react-router` is the primary package in the React Router project. -The `react-router` package is the heart of [React Router](https://github.com/remix-run/react-router) and provides all the core functionality. +## Installation + +```sh +npm i react-router +``` diff --git a/packages/react-router/tsup.config.ts b/packages/react-router/tsup.config.ts index d673ae2657..5d93e3e81b 100644 --- a/packages/react-router/tsup.config.ts +++ b/packages/react-router/tsup.config.ts @@ -40,4 +40,8 @@ const config = (enableDevWarnings: boolean) => }, ]); -export default defineConfig([...config(false), ...config(true)]); +export default defineConfig([ + // @ts-expect-error + ...config(false), + ...config(true), +]);