From aee652f6c9ff42e692db9a14eefe4abe3197692c Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Fri, 1 Jul 2022 13:47:59 -0700 Subject: [PATCH] Reorganize README and LICENSE files --- README.md | 63 ++++------------- .../babel-plugin-react-native-web/LICENSE | 21 ++++++ .../babel-plugin-react-native-web/README.md | 2 +- packages/benchmarks/LICENSE | 21 ++++++ packages/benchmarks/README.md | 4 +- packages/dom-event-testing-library/LICENSE | 21 ++++++ packages/react-native-web-docs/LICENSE | 21 ++++++ packages/react-native-web-docs/README.md | 2 +- packages/react-native-web-examples/LICENSE | 21 ++++++ packages/react-native-web-examples/README.md | 2 +- LICENSE => packages/react-native-web/LICENSE | 0 packages/react-native-web/README.md | 67 ++++++++++++++++++- 12 files changed, 189 insertions(+), 56 deletions(-) create mode 100644 packages/babel-plugin-react-native-web/LICENSE create mode 100644 packages/benchmarks/LICENSE create mode 100644 packages/dom-event-testing-library/LICENSE create mode 100644 packages/react-native-web-docs/LICENSE create mode 100644 packages/react-native-web-examples/LICENSE rename LICENSE => packages/react-native-web/LICENSE (100%) diff --git a/README.md b/README.md index 540a6e34..66c6440b 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,25 @@ -# React Native for Web +# Development monorepo -[![npm version][package-badge]][package-url] [![Build Status][ci-badge]][ci-url] [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request) +## Structure -"React Native for Web" makes it possible to run [React Native][react-native-url] components and APIs on the web using React DOM. - -## Documentation - -The [documentation site](https://necolas.github.io/react-native-web/) covers installation, guides, and APIs. - -## Example - -And here is a simple example to get you started. The [example app](https://pk4zn6v4o0.sse.codesandbox.io/) (fork the [codesandbox](https://codesandbox.io/s/github/necolas/react-native-web/tree/master/packages/react-native-web-examples)) includes interactive examples and the [source code](https://github.com/necolas/react-native-web/blob/master/packages/react-native-web-examples) is also available. - -```js -import React from 'react'; -import { AppRegistry, StyleSheet, Text, View } from 'react-native'; - -class App extends React.Component { - render() { - return ( - - Hello, world! - - ); - } -} - -const styles = StyleSheet.create({ - box: { padding: 10 }, - text: { fontWeight: 'bold' } -}); - -AppRegistry.registerComponent('App', () => App); -AppRegistry.runApplication('App', { rootTag: document.getElementById('react-root') }); -``` - -This example will render the `App` into a container on the page. - -You'll notice that there is no reference to `react-dom`; the `App` component is defined using the platform-agnostic APIs and Components introduced by React Native. This allows the app to be rendered to web and native platforms. +* `.github` + * Contains workflows used by GitHub Actions. + * Contains issue templates. +* `configs` + * Contains configration files used by the monorepo tooling (compiling, linting, testing, etc.) +* `packages` + * [react-native-web](https://github.com/necolas/react-native-web/blob/master/packages/react-native-web) + * Contains the individual packages managed in the monorepo. +* `scripts` + * Contains Node.js scripts for miscellaneous tasks. ## Contributing -The main purpose of this repository is to help evolve React web and native development towards the platform-agnostic design of React Native, and in the process make it faster and easier to build high-quality experiences for the web with React. Development happens in the open on GitHub, and we are grateful for contributing bugfixes and improvements. Read below to learn how you can take part in improving React Native for Web. +Development happens in the open on GitHub and we are grateful for contributions including bugfixes, improvements, and ideas. ### Code of conduct -Meta has adopted a [Code of Conduct][code-of-conduct] that this project expects all participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated. +This project expects all participants to adhere to Meta's OSS [Code of Conduct][code-of-conduct]. Please read the full text so that you can understand what actions will and will not be tolerated. ### Contributing guide @@ -55,15 +29,6 @@ Read the [contributing guide][contributing-url] to learn about the development p To help you get you familiar with the contribution process, there is a list of [good first issues][good-first-issue-url] that contain bugs which have a relatively limited scope. This is a great place to get started. -## License - -React Native for Web is [MIT licensed](./LICENSE). By contributing to React Native for Web, you agree that your contributions will be licensed under its MIT license. - -[package-badge]: https://img.shields.io/npm/v/react-native-web.svg?style=flat -[package-url]: https://www.npmjs.com/package/react-native-web -[ci-badge]: https://github.com/necolas/react-native-web/workflows/tests/badge.svg -[ci-url]: https://github.com/necolas/react-native-web/actions -[react-native-url]: https://reactnative.dev/ [contributing-url]: https://github.com/necolas/react-native-web/blob/master/.github/CONTRIBUTING.md [good-first-issue-url]: https://github.com/necolas/react-native-web/labels/good%20first%20issue [code-of-conduct]: https://opensource.fb.com/code-of-conduct/ diff --git a/packages/babel-plugin-react-native-web/LICENSE b/packages/babel-plugin-react-native-web/LICENSE new file mode 100644 index 00000000..12405805 --- /dev/null +++ b/packages/babel-plugin-react-native-web/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Nicolas Gallagher. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/babel-plugin-react-native-web/README.md b/packages/babel-plugin-react-native-web/README.md index e24e3a12..1aad44d6 100644 --- a/packages/babel-plugin-react-native-web/README.md +++ b/packages/babel-plugin-react-native-web/README.md @@ -8,7 +8,7 @@ any modules not required by your app (keeping bundle size down). ## Installation ``` -yarn add --dev babel-plugin-react-native-web +npm install --save-dev babel-plugin-react-native-web ``` ## Usage diff --git a/packages/benchmarks/LICENSE b/packages/benchmarks/LICENSE new file mode 100644 index 00000000..12405805 --- /dev/null +++ b/packages/benchmarks/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Nicolas Gallagher. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/benchmarks/README.md b/packages/benchmarks/README.md index 6b647c31..f03b6ae6 100644 --- a/packages/benchmarks/README.md +++ b/packages/benchmarks/README.md @@ -2,14 +2,14 @@ Try the [benchmarks app](https://necolas.github.io/react-native-web/benchmarks) online. -To run the benchmarks locally: +To run the benchmarks locally from monorepo root: ``` yarn benchmarks open ./packages/benchmarks/dist/index.html ``` -Develop against these benchmarks: +Develop against these benchmarks from monorepo root: ``` yarn compile --watch diff --git a/packages/dom-event-testing-library/LICENSE b/packages/dom-event-testing-library/LICENSE new file mode 100644 index 00000000..12405805 --- /dev/null +++ b/packages/dom-event-testing-library/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Nicolas Gallagher. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/react-native-web-docs/LICENSE b/packages/react-native-web-docs/LICENSE new file mode 100644 index 00000000..12405805 --- /dev/null +++ b/packages/react-native-web-docs/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Nicolas Gallagher. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/react-native-web-docs/README.md b/packages/react-native-web-docs/README.md index 8b817ece..1a63a5e9 100644 --- a/packages/react-native-web-docs/README.md +++ b/packages/react-native-web-docs/README.md @@ -1,3 +1,3 @@ -# Documentation website +# React Native for Web documentation Markdown pages and a static site generator. diff --git a/packages/react-native-web-examples/LICENSE b/packages/react-native-web-examples/LICENSE new file mode 100644 index 00000000..12405805 --- /dev/null +++ b/packages/react-native-web-examples/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Nicolas Gallagher. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/react-native-web-examples/README.md b/packages/react-native-web-examples/README.md index 86a5abe4..83421cf3 100644 --- a/packages/react-native-web-examples/README.md +++ b/packages/react-native-web-examples/README.md @@ -1,3 +1,3 @@ -# Example app +# React Native for Web examples Next.js pages and React Native components. Provides interactive examples for the documentation website. diff --git a/LICENSE b/packages/react-native-web/LICENSE similarity index 100% rename from LICENSE rename to packages/react-native-web/LICENSE diff --git a/packages/react-native-web/README.md b/packages/react-native-web/README.md index 0469b08c..9589280a 100644 --- a/packages/react-native-web/README.md +++ b/packages/react-native-web/README.md @@ -1,5 +1,68 @@ # React Native for Web -React Native Components and APIs for the Web. +[![npm version][package-badge]][package-url] [![Build Status][ci-badge]][ci-url] [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request) -[Find out more](https://github.com/necolas/react-native-web) +"React Native for Web" makes it possible to run [React Native][react-native-url] components and APIs on the web using React DOM. + +## Documentation + +The [documentation site](https://necolas.github.io/react-native-web/) ([source](https://github.com/necolas/react-native-web/blob/master/packages/react-native-web-docs)) covers installation, guides, and APIs. + +## Example + +The [examples app](https://pk4zn6v4o0.sse.codesandbox.io/) ([source](https://github.com/necolas/react-native-web/blob/master/packages/react-native-web-examples)) demonstrates many available features. Fork the [codesandbox](https://codesandbox.io/s/github/necolas/react-native-web/tree/master/packages/react-native-web-examples)) to make changes and see the results. + +You'll notice that there is no reference to `react-dom` in components. The `App` component that is shown below is defined using the APIs and Components of React Native, but it can also be rendered on the web using React Native for Web. + +```js +// Example component +import React from 'react'; +import { AppRegistry, StyleSheet, Text, View } from 'react-native'; + +class App extends React.Component { + render() { + return ( + + Hello, world! + + ); + } +} + +const styles = StyleSheet.create({ + box: { padding: 10 }, + text: { fontWeight: 'bold' } +}); + +AppRegistry.registerComponent('App', () => App); +AppRegistry.runApplication('App', { rootTag: document.getElementById('react-root') }); +``` + +## Contributing + +Development happens in the open on GitHub and we are grateful for contributions including bugfixes, improvements, and ideas. Read below to learn how you can take part in improving React Native for Web. + +### Code of conduct + +This project expects all participants to adhere to Meta's OSS [Code of Conduct][code-of-conduct]. Please read the full text so that you can understand what actions will and will not be tolerated. + +### Contributing guide + +Read the [contributing guide][contributing-url] to learn about the development process, how to propose bugfixes and improvements, and how to build and test your changes to React Native for Web. + +### Good first issues + +To help you get you familiar with the contribution process, there is a list of [good first issues][good-first-issue-url] that contain bugs which have a relatively limited scope. This is a great place to get started. + +## License + +React Native for Web is [MIT licensed](./LICENSE). By contributing to React Native for Web, you agree that your contributions will be licensed under its MIT license. + +[package-badge]: https://img.shields.io/npm/v/react-native-web.svg?style=flat +[package-url]: https://www.npmjs.com/package/react-native-web +[ci-badge]: https://github.com/necolas/react-native-web/workflows/tests/badge.svg +[ci-url]: https://github.com/necolas/react-native-web/actions +[react-native-url]: https://reactnative.dev/ +[contributing-url]: https://github.com/necolas/react-native-web/blob/master/.github/CONTRIBUTING.md +[good-first-issue-url]: https://github.com/necolas/react-native-web/labels/good%20first%20issue +[code-of-conduct]: https://opensource.fb.com/code-of-conduct/