Skip to content

Commit

Permalink
chore!: reinitialize client files structure
Browse files Browse the repository at this point in the history
The change was made to simplify client development.
  • Loading branch information
raczu committed Apr 2, 2024
1 parent 982aa08 commit 738a3bd
Show file tree
Hide file tree
Showing 47 changed files with 16,481 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Client/reasn-client/.gitignore
Original file line number Diff line number Diff line change
@@ -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
893 changes: 893 additions & 0 deletions Client/reasn-client/.yarn/releases/yarn-4.1.0.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Client/reasn-client/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.1.0.cjs
32 changes: 32 additions & 0 deletions Client/reasn-client/README.md
Original file line number Diff line number Diff line change
@@ -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/)
- `@reasn/ui`: a stub [react-native](https://reactnative.dev/) component library shared by both `web` and `native` applications
- `@reasn/typescript-config`: `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
4 changes: 4 additions & 0 deletions Client/reasn-client/apps/native/.expo-shared/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
}
14 changes: 14 additions & 0 deletions Client/reasn-client/apps/native/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules/
.expo/
dist/
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# macOS
.DS_Store
33 changes: 33 additions & 0 deletions Client/reasn-client/apps/native/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { StyleSheet, Text, View } from "react-native";
import { StatusBar } from "expo-status-bar";
import { Button } from "@reasn/ui";

export default function Native() {
return (
<View style={styles.container}>
<Text style={styles.header}>Native</Text>
<Button
onClick={() => {
console.log("Pressed!");
alert("Pressed!");
}}
text="Boop"
/>
<StatusBar style="auto" />
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
header: {
fontWeight: "bold",
marginBottom: 20,
fontSize: 36,
},
});
3 changes: 3 additions & 0 deletions Client/reasn-client/apps/native/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Native

A [react-native](https://reactnative.dev/) app built using [expo](https://docs.expo.dev/)
31 changes: 31 additions & 0 deletions Client/reasn-client/apps/native/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"expo": {
"name": "native",
"slug": "native",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Client/reasn-client/apps/native/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Client/reasn-client/apps/native/assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Client/reasn-client/apps/native/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
};
};
8 changes: 8 additions & 0 deletions Client/reasn-client/apps/native/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { registerRootComponent } from "expo";

import App from "./App";

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App);
21 changes: 21 additions & 0 deletions Client/reasn-client/apps/native/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("expo/metro-config");
const path = require("path");

// Find the workspace root, this can be replaced with `find-yarn-workspace-root`
const workspaceRoot = path.resolve(__dirname, "../..");
const projectRoot = __dirname;

const config = getDefaultConfig(projectRoot);

// 1. Watch all files within the monorepo
config.watchFolders = [workspaceRoot];
// 2. Let Metro know where to resolve packages, and in what order
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, "node_modules"),
path.resolve(workspaceRoot, "node_modules"),
];
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
config.resolver.disableHierarchicalLookup = true;

module.exports = config;
29 changes: 29 additions & 0 deletions Client/reasn-client/apps/native/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "native",
"version": "0.0.0",
"private": true,
"main": "index.js",
"scripts": {
"dev": "expo start --go",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@reasn/ui": "*",
"expo": "^49.0.21",
"expo-status-bar": "~1.7.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "0.73.1",
"react-native-web": "^0.19.10"
},
"devDependencies": {
"@babel/core": "^7.23.7",
"@expo/webpack-config": "^19.0.0",
"@types/react": "^18.2.46",
"@types/react-native": "^0.73.0",
"typescript": "^5.3.3"
}
}
6 changes: 6 additions & 0 deletions Client/reasn-client/apps/native/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true
}
}
3 changes: 3 additions & 0 deletions Client/reasn-client/apps/web/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
34 changes: 34 additions & 0 deletions Client/reasn-client/apps/web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel
28 changes: 28 additions & 0 deletions Client/reasn-client/apps/web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Getting Started

First, run the development server:

```bash
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

To create [API routes](https://nextjs.org/docs/app/building-your-application/routing/router-handlers) add an `api/` directory to the `app/` directory with a `route.ts` file. For individual endpoints, create a subfolder in the `api` directory, like `api/hello/route.ts` would map to [http://localhost:3000/api/hello](http://localhost:3000/api/hello).

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
11 changes: 11 additions & 0 deletions Client/reasn-client/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>
);
}
14 changes: 14 additions & 0 deletions Client/reasn-client/apps/web/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use client";

import { Button } from "@reasn/ui";

import styles from "../styles/index.module.css";

export default function Web() {
return (
<div className={styles.container}>
<h1>Web</h1>
<Button onClick={() => console.log("Pressed!")} text="Boop" />
</div>
);
}
5 changes: 5 additions & 0 deletions Client/reasn-client/apps/web/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
18 changes: 18 additions & 0 deletions Client/reasn-client/apps/web/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
reactStrictMode: true,
webpack: (config) => {
config.resolve.alias = {
...(config.resolve.alias || {}),
// Transform all direct `react-native` imports to `react-native-web`
"react-native$": "react-native-web",
};
config.resolve.extensions = [
".web.js",
".web.jsx",
".web.ts",
".web.tsx",
...config.resolve.extensions,
];
return config;
},
};
28 changes: 28 additions & 0 deletions Client/reasn-client/apps/web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "web",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev -H 0.0.0.0",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@reasn/ui": "*",
"next": "^14.0.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native-web": "^0.19.10"
},
"devDependencies": {
"@reasn/typescript-config": "*",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"babel-plugin-react-native-web": "^0.19.10",
"eslint": "^8.56.0",
"eslint-config-next": "14.0.4",
"typescript": "^5.3.3"
}
}
8 changes: 8 additions & 0 deletions Client/reasn-client/apps/web/styles/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
body {
font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica",
"Arial", sans-serif;
display: flex;
height: 100vh;
align-items: center;
justify-content: center;
}
Loading

0 comments on commit 738a3bd

Please sign in to comment.