Skip to content
Open
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
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema

# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings

DATABASE_URL="file:./dev.db"
42 changes: 36 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
module.exports = {
root: true,
// This tells ESLint to load the config from the package `eslint-config-custom`
extends: ["custom"],
settings: {
next: {
rootDir: ["apps/*/"],
},
env: {
browser: true,
es6: true,
commonjs: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:prettier/recommended'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
route: 'readonly',
__DEV__: 'readonly',
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'react', 'react-hooks', 'unused-imports'],
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'react/no-unescaped-entities': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': [
'error',
{
additionalHooks:
'(useMotiPressableTransition|useMotiPressable|useMotiPressables|useMotiPressableAnimatedProps|useInterpolateMotiPressable)',
},
],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': 'warn',
'no-empty': 'warn',
'react/display-name': 'warn',
'no-async-promise-executor': 'warn',
},
reportUnusedDisableDirectives: true,
};
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ yarn-error.log*

# turbo
.turbo

.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
24 changes: 24 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 95,
"tabWidth": 2,
"jsxSingleQuote": true,
"bracketSpacing": true,
importOrder: [
"expo-dev-client",
"./shim",
"raf/polyfill",
"setimmediate",
'react-native-url-polyfill',
'intl-pluralrules',
'react-native-gesture-handler',
"^(react|react-native)$",
"<THIRD_PARTY_MODULES>",
"^@medico(.*)$",
"^[./]",
],
plugins: [require("./merged-prettier-plugin")],
};

29 changes: 29 additions & 0 deletions .vscode/universal-apps.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"folders": [
{
"name": "✨ @universal/monorepo",
"path": ".."
},
{
"name": "🚀 @universal/expo",
"path": "../apps/expo"
},
{
"name": "🚀 @universal/nextjs",
"path": "../apps/nextjs"
},
{
"name": "📦 @universal/app",
"path": "../packages/app"
},
{
"name": "📦 @universal/ui",
"path": "../packages/ui"
},
{
"name": "📦 @universal/server",
"path": "../packages/server"
}
],
"settings": {}
}
823 changes: 823 additions & 0 deletions .yarn/releases/yarn-3.3.1.cjs

Large diffs are not rendered by default.

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

yarnPath: .yarn/releases/yarn-3.3.1.cjs
22 changes: 8 additions & 14 deletions apps/expo/App.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import { StyleSheet, Text, View } from "react-native";
import { View } from "@universal/ui/view";
import { Button } from "@universal/ui/common/Button";
import { TextInput } from "@universal/ui/text-input";
import { Text } from "@universal/ui/text";

export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.tsx to start working on your app!</Text>
<Button className="bg-green-500 p-2" onPress={() => null}>
<Text className='text-amber-700'>sadasd</Text>
</Button>
<View className="justify-center flex-1 items-center">
<TextInput />
{/* <Button className="bg-green-500 p-2" onPress={() => null}>
<Text className="text-amber-700">sadasd</Text>
</Button> */}
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});
26 changes: 16 additions & 10 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,25 @@
"web": "expo start --web"
},
"dependencies": {
"@react-native-menu/menu": "^0.7.2",
"@universal/ui": "*",
"expo": "~46.0.13",
"expo": "^47.0.8",
"expo-navigation-bar": "^2.0.1",
"expo-status-bar": "~1.4.2",
"nativewind": "^2.0.11",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.6",
"react-native-web": "~0.18.9"
"expo-system-ui": "2.0.1",
"moti": "^0.21.0",
"nativewind": "next",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.70.5",
"react-native-ios-context-menu": "^1.15.1",
"react-native-mmkv": "^2.5.1",
"react-native-reanimated": "~2.12.0",
"react-native-svg": "^13.6.0",
"react-native-web": "0.18.9",
"zeego": "^1.0.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react": "~18.0.14",
"@types/react-native": "~0.70.6",
"typescript": "^4.6.3"
"@babel/core": "^7.12.9"
}
}
20 changes: 0 additions & 20 deletions apps/nextjs/.babelrc

This file was deleted.

4 changes: 0 additions & 4 deletions apps/nextjs/.eslintrc.js

This file was deleted.

56 changes: 28 additions & 28 deletions apps/nextjs/next.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
/* eslint-disable turbo/no-undeclared-env-vars */
const withImages = require("next-images");
const withFonts = require("next-fonts");
const withPlugins = require("next-compose-plugins");
const { DefinePlugin } = require("webpack");
const withImages = require('next-images');
const withFonts = require('next-fonts');
const withPlugins = require('next-compose-plugins');
const { DefinePlugin } = require('webpack');

const withTM = require("next-transpile-modules")([
"@universal/ui",
"react-native-web",
'nativewind'
const withTM = require('next-transpile-modules')([
'@universal/ui',
'@universal/server',
'@universal/app',
'react-native-web',
'react-native-svg',
'nativewind',
]);

/** @type {import('next').NextConfig} **/
const nextConfig = {
reactStrictMode: false,
webpack5: true,
eslint: {
ignoreDuringBuilds: false,
},
Expand All @@ -23,30 +24,29 @@ const nextConfig = {
serverRuntimeConfig: {
PROJECT_ROOT: __dirname,
},
// experimental: {
// forceSwcTransforms: true,
// swcPlugins: [[require.resolve('./plugins/swc_plugin_reanimated.wasm')]],
// },
webpack(config, options) {
experimental: {
forceSwcTransforms: true,
},
webpack(config) {
if (!config.resolve) {
config.resolve = {};
}
config.resolve.alias = {
...(config.resolve.alias || {}),
"react-native$": "react-native-web",
"react-native/Libraries/EventEmitter/RCTDeviceEventEmitter$":
"react-native-web/dist/vendor/react-native/NativeEventEmitter/RCTDeviceEventEmitter",
"react-native/Libraries/vendor/emitter/EventEmitter$":
"react-native-web/dist/vendor/react-native/emitter/EventEmitter",
"react-native/Libraries/EventEmitter/NativeEventEmitter$":
"react-native-web/dist/vendor/react-native/NativeEventEmitter",
'react-native$': 'react-native-web',
'react-native/Libraries/EventEmitter/RCTDeviceEventEmitter$':
'react-native-web/dist/vendor/react-native/NativeEventEmitter/RCTDeviceEventEmitter',
'react-native/Libraries/vendor/emitter/EventEmitter$':
'react-native-web/dist/vendor/react-native/emitter/EventEmitter',
'react-native/Libraries/EventEmitter/NativeEventEmitter$':
'react-native-web/dist/vendor/react-native/NativeEventEmitter',
};

config.resolve.extensions = [
".web.js",
".web.jsx",
".web.ts",
".web.tsx",
'.web.js',
'.web.jsx',
'.web.ts',
'.web.tsx',
...(config.resolve?.extensions ?? []),
];

Expand All @@ -56,8 +56,8 @@ const nextConfig = {
// Expose __DEV__ from Metro.
config.plugins.push(
new DefinePlugin({
__DEV__: JSON.stringify(process.env.NODE_ENV !== "production"),
})
__DEV__: JSON.stringify(process.env.NODE_ENV !== 'production'),
}),
);
return config;
},
Expand Down
22 changes: 13 additions & 9 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,35 @@
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"@next/font": "13.0.7",
"@radix-ui/react-dropdown-menu": "^2.0.1",
"@tanstack/react-query": "^4.20.4",
"@trpc/client": "^10.6.0",
"@trpc/next": "^10.6.0",
"@trpc/react-query": "^10.6.0",
"@trpc/server": "^10.6.0",
"@universal/ui": "*",
"next": "12.2.2",
"raf": "^3.4.1"
"next": "13.0.6",
"raf": "^3.4.1",
"zod": "^3.20.2"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "~7.18.6",
"@babel/plugin-proposal-private-methods": "~7.18.6",
"@babel/plugin-proposal-private-property-in-object": "~7.20.5",
"@types/node": "^17.0.12",
"@types/react": "^18.0.22",
"@types/react-dom": "^18.0.7",
"autoprefixer": "^10.4.13",
"eslint": "7.32.0",
"eslint-config-custom": "*",
"eslint-config-next": "13.0.6",
"next-compose-plugins": "^2.2.1",
"next-fonts": "^1.5.1",
"next-images": "^1.8.4",
"next-transpile-modules": "^9.0.0",
"next-transpile-modules": "^10.0.0",
"postcss": "^8.4.19",
"tailwindcss": "^3.0.24",
"typescript": "^4.5.3"
"tailwindcss": "^3.2.4"
}
}
Loading