Skip to content

Commit

Permalink
refactor: move files to src folder for libs
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgevrgs committed May 16, 2024
1 parent 0904428 commit 37d6581
Show file tree
Hide file tree
Showing 93 changed files with 237 additions and 83 deletions.
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# save exact version of the package
save-exact = true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
4 changes: 3 additions & 1 deletion apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
"@libs/frontend": "workspace:*",
"@libs/shared": "workspace:*",
"@tanstack/react-query": "4.3.4",
"mongodb": "6.6.2",
"next": "14.2.3",
"react-spinners": "0.13.8"
"react-spinners": "0.13.8",
"sharp": "0.33.4"
},
"devDependencies": {
"@playwright/test": "1.44.0",
Expand Down
1 change: 1 addition & 0 deletions apps/nextjs/src/types/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ declare global {
interface ProcessEnv {
readonly NEXT_FRONTEND_URL: string;
readonly NEXT_MONGO_URL: string;
readonly LOG_LEVEL?: string;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './env';
export type * from './env';
18 changes: 14 additions & 4 deletions apps/nextjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"moduleResolution": "node"
}
"incremental": true
},
"include": [
"./next-env.d.ts",
"./src/**/*.ts",
"./src/**/*.tsx",
"./src/**/*.d.ts"
],
"exclude": ["./node_modules", "./src/**/*.test.ts", "./src/**/*.test.tsx"]
}
4 changes: 1 addition & 3 deletions libs/backend/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export * from './application';
export * from './domain';
export * from './infrastructure';
export * from './src';
20 changes: 17 additions & 3 deletions libs/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
"version": "1.0.0",
"description": "",
"sideEffects": false,
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts",
"./*": [
"./src/*.ts",
"./src/*/index.ts"
]
},
"files": [
"src"
],
"scripts": {
"lint": "eslint .",
"clean": "rm -rf ./dist && rm -rf .turbo",
Expand All @@ -12,11 +24,13 @@
"author": "",
"license": "ISC",
"dependencies": {
"@libs/shared": "workspace:*",
"@libs/shared": "workspace:*"
},
"peerDependencies": {
"lodash.omit": "4.5.0",
"mongodb": "4.9.1",
"mongodb": "6.6.2",
"next": "14.2.3",
"sharp": "0.33.3"
"sharp": "0.33.4"
},
"devDependencies": {
"@eslint/js": "9.2.0",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export async function updateCelebrityByIdCollection(
{ returnDocument: 'after' }
);

if (!data.value) {
if (!data) {
throw new Error('NotFound');
}

return new CelebrityDto(data.value);
return new CelebrityDto(data);
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions libs/backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './application';
export * from './domain';
export * from './infrastructure';
File renamed without changes.
4 changes: 2 additions & 2 deletions libs/backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"module": "ESNext",
"moduleResolution": "Node"
},
"include": ["./**/*.ts"],
"exclude": ["node_modules"]
"include": ["./src/**/*.ts"],
"exclude": ["./src/**/*.test.ts"]
}
4 changes: 1 addition & 3 deletions libs/frontend/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export * from './application';
export * from './domain';
export * from './infrastructure';
export * from './src';
23 changes: 18 additions & 5 deletions libs/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@
"name": "@libs/frontend",
"version": "1.0.0",
"description": "",
"private": true,
"sideEffects": false,
"type": "module",
"exports": {
".": "./src/index.ts",
"./*": [
"./src/*.ts",
"./src/*.tsx",
"./src/*/index.ts"
]
},
"files": [
"src"
],
"scripts": {
"lint": "eslint .",
"clean": "rm -rf ./dist && rm -rf .turbo",
Expand All @@ -12,15 +25,14 @@
"author": "",
"license": "ISC",
"dependencies": {
"@libs/shared": "workspace:*",
"@tanstack/react-query": "4.3.4",
"@types/react": "18.0.19",
"next": "14.2.3",
"react": "18.2.0"
"@libs/shared": "workspace:*"
},
"peerDependencies": {
"classnames": "2.3.1",
"dayjs": "1.11.5",
"next": "14.2.3",
"@tanstack/react-query": "4.3.4",
"react": "18.2.0",
"react-device-detect": "2.2.2",
"react-select": "5.4.0",
"react-spinners": "0.13.4",
Expand All @@ -29,6 +41,7 @@
"devDependencies": {
"@eslint/js": "9.2.0",
"@testing-library/react": "15.0.7",
"@types/react": "18.0.19",
"@vitejs/plugin-react": "4.2.1",
"eslint": "8.57.0",
"eslint-plugin-react": "7.34.1",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions libs/frontend/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './application';
export * from './domain';
export * from './infrastructure';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions libs/frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"strict": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"jsx": "preserve",
"module": "ESNext",
"moduleResolution": "Node"
},
"include": ["./src/**/*.ts", "./src/**/*.tsx"],
"exclude": ["./src/**/*.test.ts", "./src/**/*.test.tsx"]
}
13 changes: 12 additions & 1 deletion libs/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@
"name": "@libs/shared",
"version": "1.0.0",
"description": "",
"private": true,
"sideEffects": false,
"main": "index.js",
"type": "module",
"exports": {
".": "./src/index.ts",
"./*": [
"./src/*.ts",
"./src/*/index.ts"
]
},
"files": [
"src"
],
"scripts": {
"lint": "eslint .",
"clean": "rm -rf ./dist && rm -rf .turbo"
Expand Down
12 changes: 12 additions & 0 deletions libs/shared/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"strict": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"jsx": "preserve",
"module": "ESNext",
"moduleResolution": "Node"
},
"include": ["./src/**/*.ts"],
"exclude": ["./src/**/*.test.ts"]
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@
"workspaces": [
"apps/*",
"libs/*"
]
],
"peerDependenciesMeta": {
"sharp": {
"optional": true
}
}
}
Loading

0 comments on commit 37d6581

Please sign in to comment.