Skip to content

Commit d81d7fe

Browse files
authored
fix(sequelize): remove default export of sequelize repository (#136)
and add directory import syntax when using sequelize GH-135
1 parent d32dc71 commit d81d7fe

File tree

11 files changed

+44
-42
lines changed

11 files changed

+44
-42
lines changed

.sonarcloud.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sonar.sources=src
33

44
# Ignoring transaction and sequelize soft crud repository as the duplication of the code is a compulsion in it.
55
# These will be removed in a next major release in favor of universal mixin usage.
6-
sonar.exclusions=src/__tests__/**,src/repositories/default-transaction-soft-crud.repository.base.ts,src/repositories/sequelize.soft-crud.repository.base.ts
6+
sonar.exclusions=src/__tests__/**,src/repositories/default-transaction-soft-crud.repository.base.ts,src/repositories/sequelize/sequelize.soft-crud.repository.base.ts
77
#sonar.inclusions=
88

99
# Path to tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ If not, then please add these columns to the DB table.
4646
### SequelizeSoftCrudRepository
4747

4848
An abstract base class providing soft delete capabilities for projects using [loopback4-sequelize](https://www.npmjs.com/package/loopback4-sequelize) package.
49-
All the other workings are similar to [SoftCrudRepository](#softcrudrepository).
49+
All the other workings are similar to [SoftCrudRepository](#softcrudrepository). except it's imported using directory import syntax from `loopback4-soft-delete/sequelize`.
5050

5151
### SoftCrudRepository
5252

index.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

package-lock.json

Lines changed: 18 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,24 @@
77
"loopback-extension",
88
"loopback"
99
],
10-
"main": "index.js",
10+
"main": "dist/index.js",
11+
"types": "dist/index.d.ts",
12+
"exports": {
13+
".": "./dist/index.js",
14+
"./sequelize": {
15+
"types": "./dist/repositories/sequelize/index.d.ts",
16+
"default": "./dist/repositories/sequelize/index.js"
17+
}
18+
},
19+
"typesVersions": {
20+
"*": {
21+
"sequelize": [
22+
"./dist/repositories/sequelize/index.d.ts"
23+
]
24+
}
25+
},
1126
"engines": {
12-
"node": ">=8.9"
27+
"node": ">=14"
1328
},
1429
"scripts": {
1530
"build": "npm run clean && lb-tsc",
@@ -86,6 +101,7 @@
86101
"husky": "^7.0.4",
87102
"jsdom": "^21.0.0",
88103
"loopback-datasource-juggler": "^4.28.1",
104+
"loopback4-sequelize": "^2.1.0",
89105
"minimist": ">=1.2.6",
90106
"semantic-release": "^19.0.3",
91107
"simple-git": "^3.15.1",

src/__tests__/unit/sequelize/sequelize-soft-crud.unit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {fail} from 'assert';
1212
import {SoftDeleteEntity} from '../../../models';
1313
import {IUser} from '../../../types';
1414
import {SequelizeDataSource} from 'loopback4-sequelize';
15-
import {SequelizeSoftCrudRepository} from '../../../repositories/sequelize.soft-crud.repository.base';
15+
import {SequelizeSoftCrudRepository} from '../../../repositories/sequelize/sequelize.soft-crud.repository.base';
1616

1717
/**
1818
* A mock up model class

src/repositories/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from './soft-crud.repository.base';
2-
export * from './sequelize.soft-crud.repository.base';
32
export * from './default-transaction-soft-crud.repository.base';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './sequelize.soft-crud.repository.base';

0 commit comments

Comments
 (0)