typeorm-naming-strategy 1.0.0 → 2.0.0

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 CHANGED
@@ -2,6 +2,36 @@
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.0](https://github.com/chantouchsek/typeorm-naming-strategy/compare/v1.0.0...v2.0.0) (2022-10-16)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * replace the deprecated interface
11
+ * remove tslint as it is deprecated
12
+ * export the function
13
+ * :beers: rename snake-naming to main
14
+
15
+ ### Features
16
+
17
+ * :beers: rename snake-naming to main ([b5fdb52](https://github.com/chantouchsek/typeorm-naming-strategy/commit/b5fdb52d9d48999962cfcbea1d2ffb0ba9f99d92))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **deps:** bump actions/checkout from 2.4.0 to 3.1.0 ([4c38435](https://github.com/chantouchsek/typeorm-naming-strategy/commit/4c384358f53d8d78fe2ac80bfb74d53399c58cab))
23
+ * **deps:** bump actions/setup-node from 2.5.0 to 3.4.1 ([9f045ce](https://github.com/chantouchsek/typeorm-naming-strategy/commit/9f045cec7ee26d688b21eb0e4ade05f0f3845ff1))
24
+ * **deps:** bump actions/setup-node from 3.4.1 to 3.5.1 ([6e9baac](https://github.com/chantouchsek/typeorm-naming-strategy/commit/6e9baac5586f14a4ba9e079615ccca2bc15b2959))
25
+ * **deps:** bump actions/stale from 4 to 5.1.0 ([3248a10](https://github.com/chantouchsek/typeorm-naming-strategy/commit/3248a107f48b9c899e1b38b652b3180df8c32506))
26
+ * **deps:** bump actions/stale from 5.1.0 to 5.1.1 ([48dd8f6](https://github.com/chantouchsek/typeorm-naming-strategy/commit/48dd8f64ae37ceb510f07b55bbea69a9015f4891))
27
+ * **deps:** bump actions/stale from 5.1.1 to 6.0.0 ([5d652a5](https://github.com/chantouchsek/typeorm-naming-strategy/commit/5d652a53d1e8372da5d7d066ce9c9564b0ad2e37))
28
+ * **deps:** bump actions/stale from 6.0.0 to 6.0.1 ([e6c581e](https://github.com/chantouchsek/typeorm-naming-strategy/commit/e6c581e4b61862eeee1d289e1d68da3a1d9554eb))
29
+ * replace the deprecated interface ([a8be33c](https://github.com/chantouchsek/typeorm-naming-strategy/commit/a8be33c6f9fa431ca27260e325498cf27099a3b8))
30
+
31
+
32
+ * export the function ([2308223](https://github.com/chantouchsek/typeorm-naming-strategy/commit/23082231358225a3536ffb981eb874a5b388117c))
33
+ * remove tslint as it is deprecated ([58700ee](https://github.com/chantouchsek/typeorm-naming-strategy/commit/58700ee6f650119bbca88421154a5a14e0114d76))
34
+
5
35
  ## 1.0.0 (2021-12-17)
6
36
 
7
37
 
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;
@@ -35,4 +35,5 @@ class SnakeNamingStrategy extends typeorm_1.DefaultNamingStrategy {
35
35
  }
36
36
  }
37
37
  exports.SnakeNamingStrategy = SnakeNamingStrategy;
38
- //# sourceMappingURL=snake-naming.strategy.js.map
38
+ exports.default = SnakeNamingStrategy;
39
+ //# sourceMappingURL=main.js.map
@@ -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": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "Custom naming strategies for typeorm",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
5
+ "main": "dist/main.js",
6
+ "types": "dist/main.d.ts",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
@@ -40,33 +40,32 @@
40
40
  "prepublish": "yarn build",
41
41
  "prepare": "husky install",
42
42
  "lint": "eslint --ext \".ts,.js,.vue\" --ignore-path .gitignore .",
43
- "standard-version": "standard-version",
44
43
  "release": "standard-version && git push --follow-tags origin main && yarn publish"
45
44
  },
46
45
  "devDependencies": {
47
- "@commitlint/cli": "^15.0.0",
48
- "@commitlint/config-conventional": "^15.0.0",
49
- "@types/jest": "^27.0.3",
50
- "@types/node": "^17.0.0",
51
- "@typescript-eslint/eslint-plugin": "^4.33.0",
52
- "@typescript-eslint/parser": "^4.31.1",
53
- "eslint": "^7.32.0",
54
- "eslint-config-prettier": "^8.3.0",
55
- "eslint-plugin-import": "^2.24.2",
56
- "eslint-plugin-prettier": "^4.0.0",
57
- "eslint-plugin-promise": "^5.1.0",
58
- "husky": "^7.0.4",
59
- "jest": "^27.4.5",
60
- "lint-staged": "^12.1.2",
61
- "prettier": "^2.5.1",
46
+ "@commitlint/cli": "^17.1.2",
47
+ "@commitlint/config-conventional": "^17.0.3",
48
+ "@types/jest": "^29.1.2",
49
+ "@types/node": "^18.11.0",
50
+ "@typescript-eslint/eslint-plugin": "^5.40.0",
51
+ "@typescript-eslint/parser": "^5.40.0",
52
+ "eslint": "^8.25.0",
53
+ "eslint-config-prettier": "^8.5.0",
54
+ "eslint-plugin-import": "^2.26.0",
55
+ "eslint-plugin-prettier": "^4.2.1",
56
+ "eslint-plugin-promise": "^6.1.0",
57
+ "husky": "^8.0.1",
58
+ "jest": "^29.2.0",
59
+ "lint-staged": "^13.0.3",
60
+ "prettier": "^2.7.1",
62
61
  "rimraf": "^3.0.2",
63
- "standard-version": "^9.3.2",
64
- "ts-jest": "^27.1.2",
65
- "tslint": "^6.1.3",
66
- "typeorm": "^0.2.41",
67
- "typescript": "^4.5.4"
62
+ "standard-version": "^9.5.0",
63
+ "ts-jest": "^29.0.3",
64
+ "ts-node": "^10.9.1",
65
+ "typeorm": "^0.3",
66
+ "typescript": "^4.8"
68
67
  },
69
68
  "peerDependencies": {
70
- "typeorm": "^0.2.41"
69
+ "typeorm": "^0.3"
71
70
  }
72
71
  }
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { SnakeNamingStrategy } from './snake-naming.strategy';
2
- export { SnakeNamingStrategy };
3
- export default SnakeNamingStrategy;
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;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"}