typeorm-naming-strategy 1.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +19 -3
- package/dist/{snake-naming.strategy.d.ts → main.d.ts} +1 -0
- package/dist/{snake-naming.strategy.js → main.js} +2 -1
- package/dist/main.js.map +1 -0
- package/package.json +26 -27
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/snake-naming.strategy.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.0.1](https://github.com/chantouchsek/typeorm-naming-strategy/compare/v2.0.0...v2.0.1) (2023-02-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **deps:** bump actions/checkout from 3.1.0 to 3.2.0 ([09573c2](https://github.com/chantouchsek/typeorm-naming-strategy/commit/09573c21186209954b10e08ad351cf2221847473))
|
|
11
|
+
* **deps:** bump actions/checkout from 3.2.0 to 3.3.0 ([5c008b6](https://github.com/chantouchsek/typeorm-naming-strategy/commit/5c008b656449de8b49568ddcf730fc119aeeb989))
|
|
12
|
+
* **deps:** bump actions/setup-node from 3.5.1 to 3.6.0 ([c5aa6f1](https://github.com/chantouchsek/typeorm-naming-strategy/commit/c5aa6f1dcbdf87a3d48b54ca91e0f56a027db58e))
|
|
13
|
+
* **deps:** bump actions/stale from 6.0.1 to 7.0.0 ([c374f48](https://github.com/chantouchsek/typeorm-naming-strategy/commit/c374f48e7576c5aa3f4e3f9a6927692c4f73caf1))
|
|
14
|
+
|
|
15
|
+
## [2.0.0](https://github.com/chantouchsek/typeorm-naming-strategy/compare/v1.0.0...v2.0.0) (2022-10-16)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### ⚠ BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
* replace the deprecated interface
|
|
21
|
+
* remove tslint as it is deprecated
|
|
22
|
+
* export the function
|
|
23
|
+
* :beers: rename snake-naming to main
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* :beers: rename snake-naming to main ([b5fdb52](https://github.com/chantouchsek/typeorm-naming-strategy/commit/b5fdb52d9d48999962cfcbea1d2ffb0ba9f99d92))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* **deps:** bump actions/checkout from 2.4.0 to 3.1.0 ([4c38435](https://github.com/chantouchsek/typeorm-naming-strategy/commit/4c384358f53d8d78fe2ac80bfb74d53399c58cab))
|
|
33
|
+
* **deps:** bump actions/setup-node from 2.5.0 to 3.4.1 ([9f045ce](https://github.com/chantouchsek/typeorm-naming-strategy/commit/9f045cec7ee26d688b21eb0e4ade05f0f3845ff1))
|
|
34
|
+
* **deps:** bump actions/setup-node from 3.4.1 to 3.5.1 ([6e9baac](https://github.com/chantouchsek/typeorm-naming-strategy/commit/6e9baac5586f14a4ba9e079615ccca2bc15b2959))
|
|
35
|
+
* **deps:** bump actions/stale from 4 to 5.1.0 ([3248a10](https://github.com/chantouchsek/typeorm-naming-strategy/commit/3248a107f48b9c899e1b38b652b3180df8c32506))
|
|
36
|
+
* **deps:** bump actions/stale from 5.1.0 to 5.1.1 ([48dd8f6](https://github.com/chantouchsek/typeorm-naming-strategy/commit/48dd8f64ae37ceb510f07b55bbea69a9015f4891))
|
|
37
|
+
* **deps:** bump actions/stale from 5.1.1 to 6.0.0 ([5d652a5](https://github.com/chantouchsek/typeorm-naming-strategy/commit/5d652a53d1e8372da5d7d066ce9c9564b0ad2e37))
|
|
38
|
+
* **deps:** bump actions/stale from 6.0.0 to 6.0.1 ([e6c581e](https://github.com/chantouchsek/typeorm-naming-strategy/commit/e6c581e4b61862eeee1d289e1d68da3a1d9554eb))
|
|
39
|
+
* replace the deprecated interface ([a8be33c](https://github.com/chantouchsek/typeorm-naming-strategy/commit/a8be33c6f9fa431ca27260e325498cf27099a3b8))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
* export the function ([2308223](https://github.com/chantouchsek/typeorm-naming-strategy/commit/23082231358225a3536ffb981eb874a5b388117c))
|
|
43
|
+
* remove tslint as it is deprecated ([58700ee](https://github.com/chantouchsek/typeorm-naming-strategy/commit/58700ee6f650119bbca88421154a5a14e0114d76))
|
|
44
|
+
|
|
5
45
|
## 1.0.0 (2021-12-17)
|
|
6
46
|
|
|
7
47
|
|
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ import { createConnection } from 'typeorm';
|
|
|
45
45
|
import SnakeNamingStrategy from 'typeorm-naming-strategy';
|
|
46
46
|
|
|
47
47
|
await createConnection({
|
|
48
|
-
|
|
48
|
+
//...
|
|
49
49
|
namingStrategy: new SnakeNamingStrategy(), // Here you'r using the strategy!
|
|
50
50
|
});
|
|
51
51
|
```
|
|
@@ -58,7 +58,7 @@ Alternatively you can use it in combination with a `ormconfig.js`
|
|
|
58
58
|
const SnakeNamingStrategy = require("typeorm-naming-strategy")
|
|
59
59
|
|
|
60
60
|
module.exports = {
|
|
61
|
-
|
|
61
|
+
//...
|
|
62
62
|
namingStrategy: new SnakeNamingStrategy(),
|
|
63
63
|
}
|
|
64
64
|
```
|
|
@@ -69,7 +69,23 @@ Or you can use it in combination with a `ormconfig.ts`
|
|
|
69
69
|
import SnakeNamingStrategy from 'typeorm-naming-strategy';
|
|
70
70
|
|
|
71
71
|
module.exports = {
|
|
72
|
-
|
|
72
|
+
//...
|
|
73
73
|
namingStrategy: new SnakeNamingStrategy(),
|
|
74
74
|
}
|
|
75
75
|
```
|
|
76
|
+
|
|
77
|
+
Use with NestJs configuration
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { registerAs } from '@nestjs/config'
|
|
81
|
+
import type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions'
|
|
82
|
+
import { SnakeNamingStrategy } from 'typeorm-naming-strategy'
|
|
83
|
+
|
|
84
|
+
export default registerAs('database', (): MysqlConnectionOptions => ({
|
|
85
|
+
//...
|
|
86
|
+
namingStrategy: new SnakeNamingStrategy(),
|
|
87
|
+
//...
|
|
88
|
+
})
|
|
89
|
+
)
|
|
90
|
+
```
|
|
91
|
+
|
|
@@ -9,3 +9,4 @@ export declare class SnakeNamingStrategy extends DefaultNamingStrategy implement
|
|
|
9
9
|
classTableInheritanceParentColumnName(parentTableName: string, parentTableIdPropertyName: string): string;
|
|
10
10
|
eagerJoinRelationAlias(alias: string, propertyPath: string): string;
|
|
11
11
|
}
|
|
12
|
+
export default SnakeNamingStrategy;
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;AAAA,qCAAyE;AACzE,0DAAqD;AAErD,MAAa,mBACX,SAAQ,+BAAqB;IAG7B,SAAS,CAAC,SAAiB,EAAE,UAAkB;QAC7C,OAAO,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,uBAAS,EAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED,UAAU,CACR,YAAoB,EACpB,UAAkB,EAClB,gBAA0B;QAE1B,OAAO,CACL,IAAA,uBAAS,EAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAChD,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,uBAAS,EAAC,YAAY,CAAC,CAAC,CACpD,CAAC;IACJ,CAAC;IAED,YAAY,CAAC,YAAoB;QAC/B,OAAO,IAAA,uBAAS,EAAC,YAAY,CAAC,CAAC;IACjC,CAAC;IAED,cAAc,CAAC,YAAoB,EAAE,oBAA4B;QAC/D,OAAO,IAAA,uBAAS,EAAC,YAAY,GAAG,GAAG,GAAG,oBAAoB,CAAC,CAAC;IAC9D,CAAC;IAED,aAAa,CACX,cAAsB,EACtB,eAAuB,EACvB,iBAAyB;QAEzB,OAAO,IAAA,uBAAS,EACd,cAAc;YACZ,GAAG;YACH,iBAAiB,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;YACtC,GAAG;YACH,eAAe,CAClB,CAAC;IACJ,CAAC;IAED,mBAAmB,CACjB,SAAiB,EACjB,YAAoB,EACpB,UAAmB;QAEnB,OAAO,IAAA,uBAAS,EACd,SAAS,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAC3D,CAAC;IACJ,CAAC;IAED,qCAAqC,CACnC,eAAuB,EACvB,yBAAiC;QAEjC,OAAO,IAAA,uBAAS,EAAC,GAAG,eAAe,IAAI,yBAAyB,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,sBAAsB,CAAC,KAAa,EAAE,YAAoB;QACxD,OAAO,KAAK,GAAG,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtD,CAAC;CACF;AA7DD,kDA6DC;AAED,kBAAe,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typeorm-naming-strategy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Custom naming strategies for typeorm",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"types": "dist/
|
|
5
|
+
"main": "dist/main.js",
|
|
6
|
+
"types": "dist/main.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
@@ -36,37 +36,36 @@
|
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "rimraf dist && tsc",
|
|
39
|
-
"test": "
|
|
39
|
+
"test": "vitest --run",
|
|
40
|
+
"test:cov": "vitest run --coverage",
|
|
40
41
|
"prepublish": "yarn build",
|
|
41
42
|
"prepare": "husky install",
|
|
42
43
|
"lint": "eslint --ext \".ts,.js,.vue\" --ignore-path .gitignore .",
|
|
43
|
-
"standard-version": "standard-version",
|
|
44
44
|
"release": "standard-version && git push --follow-tags origin main && yarn publish"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@commitlint/cli": "^
|
|
48
|
-
"@commitlint/config-conventional": "^
|
|
49
|
-
"@types/
|
|
50
|
-
"@
|
|
51
|
-
"@typescript-eslint/
|
|
52
|
-
"@
|
|
53
|
-
"eslint": "^
|
|
54
|
-
"eslint-config-prettier": "^8.
|
|
55
|
-
"eslint-plugin-import": "^2.
|
|
56
|
-
"eslint-plugin-prettier": "^4.
|
|
57
|
-
"eslint-plugin-promise": "^
|
|
58
|
-
"husky": "^
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"typescript": "^4.5.4"
|
|
47
|
+
"@commitlint/cli": "^17.1.2",
|
|
48
|
+
"@commitlint/config-conventional": "^17.0.3",
|
|
49
|
+
"@types/node": "^18.11.19",
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^5.40.0",
|
|
51
|
+
"@typescript-eslint/parser": "^5.40.0",
|
|
52
|
+
"@vitest/coverage-c8": "^0.28.4",
|
|
53
|
+
"eslint": "^8.25.0",
|
|
54
|
+
"eslint-config-prettier": "^8.5.0",
|
|
55
|
+
"eslint-plugin-import": "^2.26.0",
|
|
56
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
57
|
+
"eslint-plugin-promise": "^6.1.0",
|
|
58
|
+
"husky": "^8.0.1",
|
|
59
|
+
"lint-staged": "^13.0.3",
|
|
60
|
+
"prettier": "^2.7.1",
|
|
61
|
+
"rimraf": "^4.0.1",
|
|
62
|
+
"standard-version": "^9.5.0",
|
|
63
|
+
"ts-node": "^10.9.1",
|
|
64
|
+
"typeorm": "^0.3",
|
|
65
|
+
"typescript": "^4.8",
|
|
66
|
+
"vitest": "^0.28.4"
|
|
68
67
|
},
|
|
69
68
|
"peerDependencies": {
|
|
70
|
-
"typeorm": "^0.
|
|
69
|
+
"typeorm": "^0.3"
|
|
71
70
|
}
|
|
72
71
|
}
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SnakeNamingStrategy = void 0;
|
|
4
|
-
const snake_naming_strategy_1 = require("./snake-naming.strategy");
|
|
5
|
-
Object.defineProperty(exports, "SnakeNamingStrategy", { enumerable: true, get: function () { return snake_naming_strategy_1.SnakeNamingStrategy; } });
|
|
6
|
-
exports.default = snake_naming_strategy_1.SnakeNamingStrategy;
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mEAA8D;AAErD,oGAFA,2CAAmB,OAEA;AAE5B,kBAAe,2CAAmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snake-naming.strategy.js","sourceRoot":"","sources":["../src/snake-naming.strategy.ts"],"names":[],"mappings":";;;AAAA,qCAAyE;AACzE,0DAAqD;AAErD,MAAa,mBACX,SAAQ,+BAAqB;IAG7B,SAAS,CAAC,SAAiB,EAAE,UAAkB;QAC7C,OAAO,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,uBAAS,EAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED,UAAU,CACR,YAAoB,EACpB,UAAkB,EAClB,gBAA0B;QAE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