Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update with-react-native-web with App Router. #4847

Merged
merged 8 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "yarn@1.22.19"
}
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