-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement in memory repository package (#13)
* feat: implement in memory repository package * chore(syncpack): format and sync package.json files Co-authored-by: github-actions[bot] <github-actions@github.com>
- Loading branch information
Showing
18 changed files
with
142 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 4 additions & 8 deletions
12
apps/backend/src/modules/table/adapters/table-in-memory.repository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
import { type ITableRepository, type Table } from '@egodb/core' | ||
import { TableInMemoryRepository } from '@egodb/in-memory-repository' | ||
import { Injectable } from '@nestjs/common' | ||
|
||
@Injectable() | ||
export class TableInmMemoryRepository implements ITableRepository { | ||
async findOneById(id: string): Promise<Table> { | ||
throw new Error('[TableInmMemoryRepository.findOnyById] Method not implemented.') | ||
} | ||
|
||
async insert(table: Table): Promise<void> { | ||
throw new Error('[TableInmMemoryRepository.insert] Method not implemented.') | ||
export class NestTableInMemoryRepository extends TableInMemoryRepository { | ||
constructor() { | ||
super() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
}, | ||
"workspaces": [ | ||
"apps/*", | ||
"packages/*" | ||
"packages/*", | ||
"repositories/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Alert } from '@mantine/core' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { showNotification, updateNotification } from '@mantine/notifications' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
packages: | ||
- "apps/*" | ||
- "packages/*" | ||
- 'apps/*' | ||
- 'packages/*' | ||
- 'repositories/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './repositories' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "@egodb/in-memory-repository", | ||
"description": "", | ||
"version": "0.0.0", | ||
"dependencies": { | ||
"@egodb/core": "^0.0.0" | ||
}, | ||
"devDependencies": { | ||
"rimraf": "^3.0.2", | ||
"tsconfig": "^0.0.0", | ||
"tsup": "^6.5.0", | ||
"typescript": "^4.9.3" | ||
}, | ||
"main": "./dist/index", | ||
"scripts": { | ||
"build": "tsc", | ||
"dev": "tsup --watch --onSuccess \"tsc --emitDeclarationOnly --declaration\"", | ||
"prebuild": "rimraf dist", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"types": "./dist/index.d" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './table' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './table-in-memory-repository' |
10 changes: 10 additions & 0 deletions
10
repositories/in-memory-repository/repositories/table/table-in-memory-repository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ITableRepository, Table } from '@egodb/core' | ||
|
||
export class TableInMemoryRepository implements ITableRepository { | ||
findOneById(id: string): Promise<Table> { | ||
throw new Error('Method not implemented.') | ||
} | ||
insert(table: Table): Promise<void> { | ||
throw new Error('Method not implemented.') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "tsconfig/lib.json", | ||
"include": ["."], | ||
"exclude": ["dist", "build", "node_modules"], | ||
"compilerOptions": { | ||
"outDir": "./dist" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { defineConfig } from 'tsup' | ||
|
||
export default defineConfig({ | ||
entry: ['index.ts'], | ||
outDir: 'dist', | ||
splitting: true, | ||
sourcemap: true, | ||
clean: true, | ||
dts: true, | ||
}) |