From 88becdd827dc029492f7608ff0168d8a73bb138a Mon Sep 17 00:00:00 2001 From: Qingyu Wang Date: Sun, 2 Mar 2025 20:28:49 +0800 Subject: [PATCH 1/2] chore(rspeedy): update `README.md` --- .changeset/free-planets-poke.md | 5 ++ packages/rspeedy/core/README.md | 4 + packages/rspeedy/plugin-qrcode/README.md | 95 ++++++++++++++++++++++++ packages/rspeedy/plugin-react/README.md | 34 ++++++++- 4 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 .changeset/free-planets-poke.md create mode 100644 packages/rspeedy/plugin-qrcode/README.md diff --git a/.changeset/free-planets-poke.md b/.changeset/free-planets-poke.md new file mode 100644 index 0000000000..c6521accbf --- /dev/null +++ b/.changeset/free-planets-poke.md @@ -0,0 +1,5 @@ +--- +"@lynx-js/qrcode-rsbuild-plugin": patch +--- + +Add `README.md`. diff --git a/packages/rspeedy/core/README.md b/packages/rspeedy/core/README.md index c392c6e271..db37f25880 100644 --- a/packages/rspeedy/core/README.md +++ b/packages/rspeedy/core/README.md @@ -24,3 +24,7 @@ Visit [Rspeedy Website](https://lynxjs.org/rspeedy/index) to view the full docum ## Contributing Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/contributing.md) to make sure you have a smooth experience contributing to Rspeedy. + +## License + +Rspeedy is Apache-2.0 licensed. diff --git a/packages/rspeedy/plugin-qrcode/README.md b/packages/rspeedy/plugin-qrcode/README.md new file mode 100644 index 0000000000..c28080f7e6 --- /dev/null +++ b/packages/rspeedy/plugin-qrcode/README.md @@ -0,0 +1,95 @@ +

+ Rspeedy Logo +

+ +

+ + + + + license + +

+ +A Rsbuild plugin that generates and displays QR codes for Lynx bundles directly in the terminal. + +## Getting Started + +```bash +npm install -D @lynx-js/qrcode-rsbuild-plugin +``` + +## Usage + +The QRCode Rsbuild Plugin allows you to display QR codes in your terminal for easy access to your application on mobile devices during development. + + + +```js +import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin' + +export default { + plugins: [pluginQRCode()], +} +``` + +## Options + +### `schema` + +Type: `(url: string) => string | Record`\ +Default: `(url) => ({ http: url })` + +The `schema` option allows you to customize the URL format displayed in the QR code. + + + +```js +import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin' +import { defineConfig } from '@lynx-js/rspeedy' + +export default defineConfig({ + plugins: [ + pluginQRCode({ + schema(url) { + return `lynx://${url}?dev=1` + }, + }), + ], +}) +``` + +You can also define multiple schemas to switch between them by pressing `a` in the terminal: + + + +```js +import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin' +import { defineConfig } from '@lynx-js/rspeedy' + +export default defineConfig({ + plugins: [ + pluginQRCode({ + schema(url) { + return { + http: url, + foo: `foo://lynx?url=${encodeURIComponent(url)}&dev=1`, + bar: `bar://lynx?url=${encodeURIComponent(url)}`, + } + }, + }), + ], +}) +``` + +## Documentation + +Visit [Lynx Website](https://lynxjs.org/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.html) to view the full documentation. + +## Contributing + +Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/contributing.md) to make sure you have a smooth experience contributing to this project. + +## License + +Rspeedy is Apache-2.0 licensed. diff --git a/packages/rspeedy/plugin-react/README.md b/packages/rspeedy/plugin-react/README.md index bb46e4ff84..5d57ded670 100644 --- a/packages/rspeedy/plugin-react/README.md +++ b/packages/rspeedy/plugin-react/README.md @@ -1,11 +1,29 @@ -A Rspeedy plugin to integrate with ReactLynx. +

+ Rspeedy Logo +

+ +

+ + + + + license + +

+ +A Rsbuild plugin to integrate with ReactLynx. + +## Getting Started + +```bash +npm install -D @lynx-js/react-rsbuild-plugin +``` ## Getting Started + + ```js -// Copyright 2024 The Lynx Authors. All rights reserved. -// Licensed under the Apache License Version 2.0 that can be found in the -// LICENSE file in the root directory of this source tree. import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin' import { defineConfig } from '@lynx-js/rspeedy' @@ -16,6 +34,14 @@ export default defineConfig({ }) ``` +## Documentation + +Visit [Lynx Website](https://lynxjs.org/api/rspeedy/react-rsbuild-plugin.pluginreactlynx.html) to view the full documentation. + +## Contributing + +Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/contributing.md) to make sure you have a smooth experience contributing to this project. + ## License Rspeedy is Apache-2.0 licensed. From 4cde7565b5d4f0d4969f98ef9822ea2d2cac2125 Mon Sep 17 00:00:00 2001 From: Qingyu Wang Date: Sun, 2 Mar 2025 20:36:25 +0800 Subject: [PATCH 2/2] chore: update descriptions --- packages/rspeedy/core/README.md | 4 +++- packages/rspeedy/plugin-qrcode/README.md | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/rspeedy/core/README.md b/packages/rspeedy/core/README.md index db37f25880..071b2e7d2b 100644 --- a/packages/rspeedy/core/README.md +++ b/packages/rspeedy/core/README.md @@ -11,6 +11,8 @@

+The built tool for Lynx. + ## Getting Started ```bash @@ -19,7 +21,7 @@ npm create rspeedy@latest ## Documentation -Visit [Rspeedy Website](https://lynxjs.org/rspeedy/index) to view the full documentation. +Visit [Lynx Website](https://lynxjs.org/rspeedy/index) to view the full documentation. ## Contributing diff --git a/packages/rspeedy/plugin-qrcode/README.md b/packages/rspeedy/plugin-qrcode/README.md index c28080f7e6..3e09fa2891 100644 --- a/packages/rspeedy/plugin-qrcode/README.md +++ b/packages/rspeedy/plugin-qrcode/README.md @@ -21,8 +21,6 @@ npm install -D @lynx-js/qrcode-rsbuild-plugin ## Usage -The QRCode Rsbuild Plugin allows you to display QR codes in your terminal for easy access to your application on mobile devices during development. - ```js