typeorm-naming-strategy 2.0.18 → 3.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.
Files changed (2) hide show
  1. package/README.md +11 -8
  2. package/package.json +13 -13
package/README.md CHANGED
@@ -25,7 +25,8 @@ In the DB the `createdAt` field will be `created_at`
25
25
 
26
26
  ## Installation
27
27
 
28
- It's available as an [npm package](https://www.npmjs.com/package/typeorm-naming-strategy)
28
+ It's available as a [npm package](https://www.npmjs.com/package/typeorm-naming-strategy)
29
+ Compatible with TypeORM `0.3.x` and `1.1.x`.
29
30
 
30
31
  ```sh
31
32
  npm install typeorm-naming-strategy --save
@@ -40,14 +41,16 @@ yarn add typeorm-naming-strategy
40
41
  ## Usage
41
42
 
42
43
  ```ts
43
- import { createConnection } from 'typeorm'
44
- // import { SnakeNamingStrategy } from 'typeorm-naming-strategy';
44
+ import { DataSource } from 'typeorm'
45
45
  import SnakeNamingStrategy from 'typeorm-naming-strategy'
46
46
 
47
- createConnection({
48
- // ...
49
- namingStrategy: new SnakeNamingStrategy(), // Here you'r using the strategy!
47
+ const dataSource = new DataSource({
48
+ type: 'postgres',
49
+ // other TypeORM options...
50
+ namingStrategy: new SnakeNamingStrategy(), // Here you're using the strategy!
50
51
  })
52
+
53
+ await dataSource.initialize()
51
54
  ```
52
55
 
53
56
  Alternatively you can use it in combination with a `ormconfig.js`
@@ -77,11 +80,11 @@ module.exports = {
77
80
  Use with NestJs configuration
78
81
 
79
82
  ```ts
80
- import type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions'
83
+ import type { DataSourceOptions } from 'typeorm'
81
84
  import { registerAs } from '@nestjs/config'
82
85
  import { SnakeNamingStrategy } from 'typeorm-naming-strategy'
83
86
 
84
- export default registerAs('database', (): MysqlConnectionOptions => ({
87
+ export default registerAs('database', (): DataSourceOptions => ({
85
88
  // ...
86
89
  namingStrategy: new SnakeNamingStrategy(),
87
90
  // ...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typeorm-naming-strategy",
3
- "version": "2.0.18",
3
+ "version": "3.0.0",
4
4
  "packageManager": "yarn@4.12.0",
5
5
  "description": "Custom naming strategies for typeorm",
6
6
  "author": {
@@ -30,7 +30,7 @@
30
30
  "dist"
31
31
  ],
32
32
  "engines": {
33
- "node": "^12.20.0 || >=14.13.0"
33
+ "node": ">=18.0.0"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "rimraf dist && tsc",
@@ -42,25 +42,25 @@
42
42
  "release": "changelogen --release && git push --follow-tags origin main && npm publish"
43
43
  },
44
44
  "peerDependencies": {
45
- "typeorm": "^0.3"
45
+ "typeorm": "^0.3 || ^1.1"
46
46
  },
47
47
  "devDependencies": {
48
- "@antfu/eslint-config": "^8.3.0",
49
- "@commitlint/cli": "^20.5.3",
50
- "@commitlint/config-conventional": "^20.5.3",
51
- "@types/node": "^25.9.1",
52
- "@vitest/coverage-v8": "^4.1.8",
48
+ "@antfu/eslint-config": "^9.1.0",
49
+ "@commitlint/cli": "^21.2.1",
50
+ "@commitlint/config-conventional": "^21.2.0",
51
+ "@types/node": "^26.1.1",
52
+ "@vitest/coverage-v8": "^4.1.10",
53
53
  "changelogen": "^0.6.2",
54
- "eslint": "^10.4.1",
54
+ "eslint": "^10.7.0",
55
55
  "husky": "^9.1.7",
56
- "lint-staged": "^16.4.0",
57
- "prettier": "^3.8.3",
56
+ "lint-staged": "^17.1.0",
57
+ "prettier": "^3.9.6",
58
58
  "reflect-metadata": "^0.2.2",
59
59
  "rimraf": "^6.1.3",
60
60
  "ts-node": "^10.9.2",
61
- "typeorm": "^0.3.30",
61
+ "typeorm": "^1.1.0",
62
62
  "typescript": "^5.9.3",
63
- "vitest": "^4.1.8"
63
+ "vitest": "^4.1.10"
64
64
  },
65
65
  "lint-staged": {
66
66
  "*.{ts,js}": "eslint"