Skip to content

Commit

Permalink
transfer to other computer
Browse files Browse the repository at this point in the history
  • Loading branch information
perennialAutodidact committed Nov 10, 2024
1 parent 5196e06 commit 639a2e5
Show file tree
Hide file tree
Showing 16 changed files with 362 additions and 958 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Flip tiles to find matching images. The player who finds the most pairs wins!

## Project Setup
This project uses Nx to manage a monorepo containing a backend server created with Express and a frontend application created with `create-react-app` (CRA).
This project uses Turborepo to manage a monorepo containing a backend server created with Express and a frontend application created with `create-react-app` (CRA).

- Install and/or switch to Node 18.17.1.
- Run `git clone https://github.com/perennialAutodidact/memory-snap.git`
Expand All @@ -22,6 +22,12 @@ This project uses Nx to manage a monorepo containing a backend server created wi

- Run `yarn start` to start the local dev server

## Installing Dependencies
According to the [Turborepo docs](https://turbo.build/repo/docs/crafting-your-repository/managing-dependencies#install-dependencies-where-theyre-used), dependencies should be installed in the workspace in which they're used and *not* in the root directory whenever possible.

To install a dependency in the `apps/frontend` app use:
> `yarn workspace frontend add my-dependency --dev`
## Styling
Styles are written in SCSS and are located in the `src/styles` directory.
[Bootstrap](https://getbootstrap.com/docs/5.0/getting-started/introduction/) is used as a foundation and custom values are applied in
Expand Down Expand Up @@ -208,4 +214,4 @@ All new branches should be created using the `dev` branch as a base. Click
![image](design/readmeImages/contributing_create_branch_3.png)
![image](design/readmeImages/contributing_create_branch_4.png)
</details>
</details>
17 changes: 8 additions & 9 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"dependencies": {
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"pexels": "^1.4.0",
"socket.io": "^4.7.2",
Expand All @@ -25,18 +24,18 @@
"test": "cross-env NODE_ENV=test yarn jest"
},
"devDependencies": {
"jest": "^29.7.0",
"nodemon": "^3.0.1",
"socket.io-client": "^4.7.2",
"supertest": "^6.3.3",
"msw": "^2.6.2",
"prettier": "^3.0.3",
"prettier-eslint-cli": "^7.1.0",
"@babel/core": "^7.22.11",
"@babel/preset-env": "^7.22.14",
"babel-jest": "^29.6.4",
"babel-plugin-transform-import-meta": "^2.2.1",
"cross-env": "^7.0.3",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"jest": "^29.6.4",
"nodemon": "^3.0.1",
"prettier": "^3.0.3",
"prettier-eslint-cli": "^7.1.0",
"socket.io-client": "^4.7.2",
"supertest": "^6.3.3"
"dotenv": "^16.3.1"
}
}
3 changes: 0 additions & 3 deletions apps/frontend/babel.config.cjs

This file was deleted.

4 changes: 4 additions & 0 deletions apps/frontend/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
// "plugins": ["@babel/plugin-transform-runtime"]
}
18 changes: 0 additions & 18 deletions apps/frontend/jest.config.cjs

This file was deleted.

31 changes: 31 additions & 0 deletions apps/frontend/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { defaults } from 'jest-config'
import path from 'path';

export default {
...defaults,
rootDir: '.',
testEnvironment: 'node',
setupFiles: ['<rootDir>/src/setupTests.js'],
// setupFilesAfterEnv: ['<rootDir>/src/setupTests.js'],
verbose: true,
transform: {
'^.+\\.js(x)?$': 'babel-jest',
// '^.+\\.scss$': path.resolve(path.dirname('.'), '../../node_modules/jest-scss-transform'),
},
moduleDirectories: [
'<rootDir>/node_modules',
'<rootDir>/src',
'<rootDir>../../node_modules',
],
moduleNameMapper: {
'^.+\\.(css|scss)$': 'identity-obj-proxy',
'^components/(.*)$': '<rootDir>/src/components/$1',
'^contexts/(.*)$': '<rootDir>/src/contexts/$1',
'^contexts$': '<rootDir>/src/contexts',
'^Proptypes$': '<rootDir>/src/Proptypes',
'^hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^utils$': '<rootDir>/src/utils',
'^utils/(.*)$': '<rootDir>/src/utils/$1'
},
moduleFileExtensions: ['js', 'jsx', 'scss'],
};
16 changes: 11 additions & 5 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"express": "^4.18.2",
"gsap": "^3.12.2",
"immer": "^10.0.2",
"node-sass": "^9.0.0",
"pexels": "^1.4.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down Expand Up @@ -47,20 +46,27 @@
]
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/core": "^7.22.11",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-env": "^7.26.0",
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "^7.22.14",
"@babel/preset-react": "^7.25.9",
"babel-jest": "^29.7.0",
"babel-plugin-module-resolver": "^5.0.2",
"@memory-snap/eslint-config": "*",
"@testing-library/react": "^16.0.1",
"babel-jest": "^29.6.4",
"babel-plugin-transform-import-meta": "^2.2.1",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"eslint-plugin-react": "^7.37.2",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-scss-transform": "^1.0.4",
"msw": "^2.6.2",
"prettier": "^3.0.3",
"prettier-eslint-cli": "^7.1.0",
"react-router-dom": "^6.15.0",
"sass": "^1.80.6",
"testing-library-selector": "^0.3.1"
}
}
1 change: 0 additions & 1 deletion apps/frontend/src/__mocks__/jest/styleMock.js

This file was deleted.

6 changes: 2 additions & 4 deletions apps/frontend/src/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
import { mswServer } from '__mocks__/api';

console.log('setupTests loaded')

let nativeWindowLocation;
beforeAll(() => {
nativeWindowLocation = window.location;
Expand Down
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"name": "memory-snap",
"private": true,
"workspaces": {
"packages": [
"apps/**",
"packages/**"
]
},
"workspaces": ["apps/*", "packages/*"],
"packageManager": "[email protected]",
"type": "module",
"scripts": {
"build": "npx turbo build",
Expand All @@ -20,7 +16,6 @@
"devDependencies": {
"husky": "^8.0.0",
"lint-staged": "^15.0.2",
"msw": "^2.6.2",
"stylelint": "^15.11.0",
"stylelint-config-standard-scss": "^11.0.0",
"turbo": "^1.11.2"
Expand Down
9 changes: 9 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@memory-snap/common",
"version": "1.0.0",
"description": "Shared dependencies for other workspaces",
"main": "index.js",
"author": "Keegan Good",
"license": "MIT",
"private": true
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 639a2e5

Please sign in to comment.