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..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,8 +21,12 @@ 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 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..3e09fa2891 --- /dev/null +++ b/packages/rspeedy/plugin-qrcode/README.md @@ -0,0 +1,93 @@ +

+ 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 + + + +```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.