From 8b2c4a38a461ff5ecc95972291bc711e2c5dec9a Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Fri, 28 Apr 2023 01:47:57 +0800 Subject: --- examples/with-react-native-web/.gitignore | 37 + examples/with-react-native-web/README.md | 32 + .../apps/native/.expo-shared/assets.json | 4 + .../with-react-native-web/apps/native/.gitignore | 14 + examples/with-react-native-web/apps/native/App.tsx | 33 + .../with-react-native-web/apps/native/README.md | 3 + .../with-react-native-web/apps/native/app.json | 31 + .../apps/native/assets/adaptive-icon.png | Bin 0 -> 17547 bytes .../apps/native/assets/favicon.png | Bin 0 -> 1466 bytes .../apps/native/assets/icon.png | Bin 0 -> 22380 bytes .../apps/native/assets/splash.png | Bin 0 -> 47346 bytes .../apps/native/babel.config.js | 6 + .../with-react-native-web/apps/native/index.js | 8 + .../apps/native/metro.config.js | 21 + .../with-react-native-web/apps/native/package.json | 29 + .../apps/native/tsconfig.json | 6 + .../apps/web/.babel.config.js | 4 + examples/with-react-native-web/apps/web/.gitignore | 34 + examples/with-react-native-web/apps/web/README.md | 30 + .../with-react-native-web/apps/web/next-env.d.ts | 5 + .../with-react-native-web/apps/web/next.config.js | 18 + .../with-react-native-web/apps/web/package.json | 27 + .../with-react-native-web/apps/web/pages/_app.tsx | 6 + .../with-react-native-web/apps/web/pages/index.tsx | 12 + .../apps/web/styles/global.css | 8 + .../apps/web/styles/index.module.css | 3 + .../with-react-native-web/apps/web/tsconfig.json | 5 + examples/with-react-native-web/meta.json | 6 + examples/with-react-native-web/package.json | 18 + .../packages/tsconfig/base.json | 20 + .../packages/tsconfig/nextjs.json | 20 + .../packages/tsconfig/package.json | 9 + .../packages/tsconfig/react-native-library.json | 13 + .../with-react-native-web/packages/ui/.gitignore | 28 + .../with-react-native-web/packages/ui/package.json | 22 + .../packages/ui/src/button.tsx | 37 + .../packages/ui/src/index.tsx | 1 + .../packages/ui/tsconfig.json | 8 + examples/with-react-native-web/turbo.json | 18 + examples/with-react-native-web/yarn.lock | 8148 ++++++++++++++++++++ 40 files changed, 8724 insertions(+) create mode 100644 examples/with-react-native-web/.gitignore create mode 100644 examples/with-react-native-web/README.md create mode 100644 examples/with-react-native-web/apps/native/.expo-shared/assets.json create mode 100644 examples/with-react-native-web/apps/native/.gitignore create mode 100644 examples/with-react-native-web/apps/native/App.tsx create mode 100644 examples/with-react-native-web/apps/native/README.md create mode 100644 examples/with-react-native-web/apps/native/app.json create mode 100644 examples/with-react-native-web/apps/native/assets/adaptive-icon.png create mode 100644 examples/with-react-native-web/apps/native/assets/favicon.png create mode 100644 examples/with-react-native-web/apps/native/assets/icon.png create mode 100644 examples/with-react-native-web/apps/native/assets/splash.png create mode 100644 examples/with-react-native-web/apps/native/babel.config.js create mode 100644 examples/with-react-native-web/apps/native/index.js create mode 100644 examples/with-react-native-web/apps/native/metro.config.js create mode 100644 examples/with-react-native-web/apps/native/package.json create mode 100644 examples/with-react-native-web/apps/native/tsconfig.json create mode 100644 examples/with-react-native-web/apps/web/.babel.config.js create mode 100644 examples/with-react-native-web/apps/web/.gitignore create mode 100644 examples/with-react-native-web/apps/web/README.md create mode 100644 examples/with-react-native-web/apps/web/next-env.d.ts create mode 100644 examples/with-react-native-web/apps/web/next.config.js create mode 100644 examples/with-react-native-web/apps/web/package.json create mode 100644 examples/with-react-native-web/apps/web/pages/_app.tsx create mode 100644 examples/with-react-native-web/apps/web/pages/index.tsx create mode 100644 examples/with-react-native-web/apps/web/styles/global.css create mode 100644 examples/with-react-native-web/apps/web/styles/index.module.css create mode 100644 examples/with-react-native-web/apps/web/tsconfig.json create mode 100644 examples/with-react-native-web/meta.json create mode 100644 examples/with-react-native-web/package.json create mode 100644 examples/with-react-native-web/packages/tsconfig/base.json create mode 100644 examples/with-react-native-web/packages/tsconfig/nextjs.json create mode 100644 examples/with-react-native-web/packages/tsconfig/package.json create mode 100644 examples/with-react-native-web/packages/tsconfig/react-native-library.json create mode 100644 examples/with-react-native-web/packages/ui/.gitignore create mode 100644 examples/with-react-native-web/packages/ui/package.json create mode 100644 examples/with-react-native-web/packages/ui/src/button.tsx create mode 100644 examples/with-react-native-web/packages/ui/src/index.tsx create mode 100644 examples/with-react-native-web/packages/ui/tsconfig.json create mode 100644 examples/with-react-native-web/turbo.json create mode 100644 examples/with-react-native-web/yarn.lock (limited to 'examples/with-react-native-web') diff --git a/examples/with-react-native-web/.gitignore b/examples/with-react-native-web/.gitignore new file mode 100644 index 0000000..419ad3c --- /dev/null +++ b/examples/with-react-native-web/.gitignore @@ -0,0 +1,37 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +node_modules +.pnp +.pnp.js + +# testing +coverage + +# next.js +.next/ +.swc/ +out/ +build + +# expo +.expo + +# misc +.DS_Store +*.pem +dist + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# turbo +.turbo \ No newline at end of file diff --git a/examples/with-react-native-web/README.md b/examples/with-react-native-web/README.md new file mode 100644 index 0000000..327ca66 --- /dev/null +++ b/examples/with-react-native-web/README.md @@ -0,0 +1,32 @@ +# Turborepo react-native starter + +This is an official starter Turborepo. + +## Using this example + +Run the following command: + +```sh +npx create-turbo@latest -e with-react-native-web +``` + +## What's inside? + +This Turborepo includes the following packages/apps: + +### Apps and Packages + +- `native`: a [react-native](https://reactnative.dev/) app built with [expo](https://docs.expo.dev/) +- `web`: a [Next.js](https://nextjs.org/) app built with [react-native-web](https://necolas.github.io/react-native-web/) +- `ui`: a stub [react-native](https://reactnative.dev/) component library shared by both `web` and `native` applications +- `tsconfig`: `tsconfig.json`s used throughout the monorepo + +Each package/app is 100% [TypeScript](https://www.typescriptlang.org/). + +### Utilities + +This Turborepo has some additional tools already setup for you: + +- [Expo](https://docs.expo.dev/) for native development +- [TypeScript](https://www.typescriptlang.org/) for static type checking +- [Prettier](https://prettier.io) for code formatting diff --git a/examples/with-react-native-web/apps/native/.expo-shared/assets.json b/examples/with-react-native-web/apps/native/.expo-shared/assets.json new file mode 100644 index 0000000..1e6decf --- /dev/null +++ b/examples/with-react-native-web/apps/native/.expo-shared/assets.json @@ -0,0 +1,4 @@ +{ + "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, + "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true +} diff --git a/examples/with-react-native-web/apps/native/.gitignore b/examples/with-react-native-web/apps/native/.gitignore new file mode 100644 index 0000000..ec8a36a --- /dev/null +++ b/examples/with-react-native-web/apps/native/.gitignore @@ -0,0 +1,14 @@ +node_modules/ +.expo/ +dist/ +npm-debug.* +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision +*.orig.* +web-build/ + +# macOS +.DS_Store diff --git a/examples/with-react-native-web/apps/native/App.tsx b/examples/with-react-native-web/apps/native/App.tsx new file mode 100644 index 0000000..e6fbd5b --- /dev/null +++ b/examples/with-react-native-web/apps/native/App.tsx @@ -0,0 +1,33 @@ +import { StyleSheet, Text, View } from "react-native"; +import { StatusBar } from "expo-status-bar"; +import { Button } from "ui"; + +export default function Native() { + return ( + + Native +