Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into RSN-9
Browse files Browse the repository at this point in the history
  • Loading branch information
raczu committed Jun 8, 2024
2 parents 489af11 + 280aae9 commit 520be86
Show file tree
Hide file tree
Showing 144 changed files with 8,126 additions and 3,313 deletions.
8 changes: 8 additions & 0 deletions Client/reasn-client/.husky/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
command_exists () {
command -v "$1" >/dev/null 2>&1
}

# Workaround for Windows 10, Git Bash, and Yarn
if command_exists winpty && test -t 1; then
exec < /dev/tty
fi
9 changes: 9 additions & 0 deletions Client/reasn-client/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# .husky/pre-commit
. "$(dirname -- "$0")/common.sh"

(cd ./Client/reasn-client && yarn lint-staged)
(cd ./Server/ReasnAPI && dotnet format)
if ! git diff --quiet; then
echo "🚫 dotnet format made changes, commit aborted."
exit 1
fi
3 changes: 3 additions & 0 deletions Client/reasn-client/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["prettier-plugin-tailwindcss"]
}
10 changes: 10 additions & 0 deletions Client/reasn-client/apps/native/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
extends: ["expo", "prettier"],
plugins: ["prettier"],
rules: {
"prettier/prettier": "error",
},
globals: {
__dirname: true,
},
};
12 changes: 9 additions & 3 deletions Client/reasn-client/apps/native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
"eject": "expo eject",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@reasn/ui": "*",
"expo": "^49.0.21",
"expo": "50.0.18",
"expo-status-bar": "~1.7.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -21,9 +22,14 @@
},
"devDependencies": {
"@babel/core": "^7.23.7",
"@expo/webpack-config": "^19.0.0",
"@expo/webpack-config": "^19.0.1",
"@types/react": "^18.2.46",
"@types/react-native": "^0.73.0",
"eslint": "^8.57.0",
"eslint-config-expo": "^7.1.2",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
"typescript": "^5.3.3"
}
}
2 changes: 1 addition & 1 deletion Client/reasn-client/apps/web/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
"extends": ["next/core-web-vitals", "prettier"]
}
2 changes: 1 addition & 1 deletion Client/reasn-client/apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../styles/global.css';
import "../styles/global.css";
import "@reasn/ui/src/styles.css";

export default function RootLayout({
Expand Down
18 changes: 12 additions & 6 deletions Client/reasn-client/apps/web/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
"use client";

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

import styles from "../styles/index.module.css";
import {
CTASection,
HeroSection,
QuickFilters,
} from "@reasn/ui/src/components/web";
import { Navbar, Footer } from "@reasn/ui/src/components/shared";

export default function Web() {
return (
<div className={styles.container}>
<h1>Web</h1>
<Button onClick={() => console.log("Pressed!")} text="Boop" />
<div className="min-h-screen bg-[#161618] text-white">
<Navbar />
<HeroSection />
<QuickFilters />
<CTASection />
<Footer />
</div>
);
}
3 changes: 2 additions & 1 deletion Client/reasn-client/apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"babel-plugin-react-native-web": "^0.19.10",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-config-next": "14.0.4",
"eslint-config-prettier": "^9.1.0",
"typescript": "^5.3.3"
}
}
10 changes: 5 additions & 5 deletions Client/reasn-client/apps/web/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
3 changes: 0 additions & 3 deletions Client/reasn-client/apps/web/styles/index.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
.container {
text-align: center;
}
10 changes: 6 additions & 4 deletions Client/reasn-client/apps/web/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./app/**/*.{js,jsx,ts,tsx}',
'../../packages/ui/src/**/*.{js,jsx,ts,tsx}'
"./app/**/*.{js,jsx,ts,tsx}",
"../../packages/ui/src/**/*.{js,jsx,ts,tsx}",
"./app/**/*.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}",
"../../packages/ui/src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}

};
35 changes: 12 additions & 23 deletions Client/reasn-client/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://jestjs.io/docs/configuration
*/

import type { JestConfigWithTsJest } from 'ts-jest'
import type { JestConfigWithTsJest } from "ts-jest";

const config: JestConfigWithTsJest = {
// All imported modules in your tests should be mocked automatically
Expand Down Expand Up @@ -73,9 +73,7 @@ const config: JestConfigWithTsJest = {
// maxWorkers: "50%",

// An array of directory names to be searched recursively up from the requiring module's location
moduleDirectories: [
"node_modules"
],
moduleDirectories: ["node_modules"],

// An array of file extensions your modules use
moduleFileExtensions: [
Expand All @@ -86,14 +84,15 @@ const config: JestConfigWithTsJest = {
"ts",
"tsx",
"json",
"node"
"node",
],

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
"^@reasn/common/services/(.*)$": "<rootDir>/packages/common/services/$1",
"^@reasn/common/enums/(.*)$": "<rootDir>/packages/common/enums/$1",
"^@reasn/common/interfaces/(.*)$": "<rootDir>/packages/common/interfaces/$1",
"^@reasn/common/interfaces/(.*)$":
"<rootDir>/packages/common/interfaces/$1",
"^@reasn/common/errors/(.*)$": "<rootDir>/packages/common/errors/$1",
},

Expand Down Expand Up @@ -131,9 +130,7 @@ const config: JestConfigWithTsJest = {
// rootDir: undefined,

// A list of paths to directories that Jest should use to search for files in
roots: [
"<rootDir>"
],
roots: ["<rootDir>"],

// Allows you to use a custom runner instead of Jest's default test runner
// runner: "jest-runner",
Expand All @@ -142,7 +139,7 @@ const config: JestConfigWithTsJest = {
// setupFiles: [],

// A list of paths to modules that run some code to configure or set up the testing framework before each test
setupFilesAfterEnv: ['jest-fetch-mock'],
setupFilesAfterEnv: ["jest-fetch-mock"],

// The number of seconds after which a test is considered as slow and reported as such in the results.
// slowTestThreshold: 5,
Expand All @@ -160,15 +157,10 @@ const config: JestConfigWithTsJest = {
// testLocationInResults: false,

// The glob patterns Jest uses to detect test files
testMatch: [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[tj]s?(x)"
],
testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[tj]s?(x)"],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: [
"\\\\node_modules\\\\"
],
testPathIgnorePatterns: ["\\\\node_modules\\\\"],

// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],
Expand All @@ -181,14 +173,11 @@ const config: JestConfigWithTsJest = {

// A map from regular expressions to paths to transformers
transform: {
"^.+\\.(ts|tsx)?$": "ts-jest"
"^.+\\.(ts|tsx)?$": "ts-jest",
},

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
transformIgnorePatterns: [
"\\\\node_modules\\\\",
"\\.pnp\\.[^\\\\]+$"
],
transformIgnorePatterns: ["\\\\node_modules\\\\", "\\.pnp\\.[^\\\\]+$"],

// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
// unmockedModulePathPatterns: undefined,
Expand All @@ -203,4 +192,4 @@ const config: JestConfigWithTsJest = {
// watchman: true,
};

export default config;
export default config;
19 changes: 17 additions & 2 deletions Client/reasn-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@
"scripts": {
"dev": "turbo run dev",
"dev:web": "turbo run dev --filter=web --filter=@reasn/ui --filter=@reasn/typescript-config",
"dev:mobile": "turbo run dev --filter=native --filter=@reasn/ui --filter=@reasn/typescript-config",
"dev:mobile": "turbo run dev --filter=native --filter=@reasn/ui",
"build": "turbo run build",
"clean": "turbo run clean && rm -rf node_modules",
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\" --ignore-path .gitignore",
"test": "jest"
"test": "jest",
"postinstall": "cd ../../ && husky Client/reasn-client/.husky"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^20.12.11",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"lint-staged": "^15.2.2",
"prettier": "^3.1.1",
"prettier-plugin-tailwindcss": "^0.6.1",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"turbo": "latest"
Expand All @@ -32,8 +38,17 @@
},
"dependencies": {
"autoprefixer": "^10.4.19",
"clsx": "^2.1.1",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"zod": "^3.23.7"
},
"lint-staged": {
"apps/**/*.{js,ts,jsx,tsx}": [
"eslint --fix"
],
"**/*.{ts,tsx,js,jsx,json,md}": [
"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\" --ignore-path .gitignore"
]
}
}
Loading

0 comments on commit 520be86

Please sign in to comment.