Skip to content

Commit

Permalink
Update with-react-native-web with App Router. (#4847)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshew authored May 16, 2023
1 parent 9cb5abc commit 915523c
Show file tree
Hide file tree
Showing 10 changed files with 1,048 additions and 1,074 deletions.
4 changes: 2 additions & 2 deletions examples/with-react-native-web/apps/native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"dependencies": {
"expo": "^45.0.6",
"expo-status-bar": "~1.3.0",
"react": "18.2",
"react-dom": "18.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "0.68.2",
"react-native-web": "^0.18.9",
"ui": "*"
Expand Down
11 changes: 11 additions & 0 deletions examples/with-react-native-web/apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { Button } from "ui";

import styles from "../styles/index.module.css";
Expand Down
10 changes: 5 additions & 5 deletions examples/with-react-native-web/apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
"lint": "next lint"
},
"dependencies": {
"next": "latest",
"react": "18.2",
"react-dom": "18.2",
"next": "^13.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native-web": "^0.18.4",
"ui": "*"
},
"devDependencies": {
"@types/node": "^18.11.5",
"@types/react": "^18.0.22",
"@types/react-dom": "^18.0.7",
"@types/react": "^18.2.5",
"@types/react-dom": "^18.2.4",
"babel-plugin-react-native-web": "^0.18.4",
"eslint": "^8.19.0",
"tsconfig": "*",
Expand Down
6 changes: 0 additions & 6 deletions examples/with-react-native-web/apps/web/pages/_app.tsx

This file was deleted.

5 changes: 4 additions & 1 deletion examples/with-react-native-web/apps/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "tsconfig/nextjs.json",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"plugins": [{ "name": "next" }]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
8 changes: 4 additions & 4 deletions examples/with-react-native-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"packages/*"
],
"scripts": {
"dev": "turbo run dev",
"build": "turbo run build",
"clean": "turbo run clean && rm -rf node_modules",
"dev": "turbo dev",
"build": "turbo build",
"clean": "turbo clean && rm -rf node_modules",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\" --ignore-path .gitignore"
},
"devDependencies": {
"prettier": "^2.7.1",
"turbo": "latest"
"turbo": "^1.9.3"
},
"packageManager": "[email protected]"
}
6 changes: 3 additions & 3 deletions examples/with-react-native-web/packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup src/index.tsx --format esm,cjs --dts --external react",
"dev": "tsup src/index.tsx --format esm,cjs --watch --dts --external react",
"build": "tsup ",
"dev": "tsup --watch",
"clean": "rm -rf dist"
},
"devDependencies": {
Expand All @@ -16,7 +16,7 @@
"typescript": "^4.7.4"
},
"dependencies": {
"react": "^18.1.0",
"react": "^18.2.0",
"react-native": "^0.70.3"
}
}
15 changes: 15 additions & 0 deletions examples/with-react-native-web/packages/ui/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig, Options } from "tsup";

export default defineConfig((options: Options) => ({
entry: {
index: "src/index.tsx",
},
banner: {
js: "'use client'",
},
clean: true,
format: ["cjs", "esm"],
external: ["react"],
dts: true,
...options,
}));
Loading

1 comment on commit 915523c

@vercel
Copy link

@vercel vercel bot commented on 915523c May 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

examples-native-web – ./examples/with-react-native-web/apps/web

examples-native-web.vercel.sh
examples-native-web-git-main.vercel.sh

Please sign in to comment.