bigal 13.0.7 → 13.0.9

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.
@@ -0,0 +1 @@
1
+ CHANGELOG.md
@@ -0,0 +1 @@
1
+ CHANGELOG.md
package/CHANGELOG.md CHANGED
@@ -1,160 +1,167 @@
1
- # Change Log
1
+ ## [13.0.9](https://github.com/bigalorm/bigal/compare/v13.0.8...v13.0.9) (2025-04-15)
2
2
 
3
- ## 13.0.7 - 2024-03-10
3
+ ### Bug Fixes
4
+
5
+ - **deps:** update all dependencies ([#95](https://github.com/bigalorm/bigal/issues/95)) ([2b6cab1](https://github.com/bigalorm/bigal/commit/2b6cab1dadaf1e28106de27406eb05898d7632f9))
6
+ - optional scope for semantic release ([#96](https://github.com/bigalorm/bigal/issues/96)) ([e15f680](https://github.com/bigalorm/bigal/commit/e15f6805ad51480a9e5d0147355faed1b8a3a784))
7
+
8
+ ## [13.0.8](https://github.com/bigalorm/bigal/compare/v13.0.7...v13.0.8) (2025-04-07)
9
+
10
+ # 13.0.7 - 2024-03-10
4
11
 
5
12
  - Update npms
6
13
 
7
- ## 13.0.6 - 2024-01-08
14
+ # 13.0.6 - 2024-01-08
8
15
 
9
16
  - Update npms
10
17
 
11
- ## 13.0.5 - 2024-12-17
18
+ # 13.0.5 - 2024-12-17
12
19
 
13
20
  - Update npms
14
21
  - Use node protocol for built-in modules
15
22
 
16
- ## 13.0.4 - 2024-11-29
23
+ # 13.0.4 - 2024-11-29
17
24
 
18
25
  - Update npms
19
26
 
20
- ## 13.0.3 - 2024-09-30
27
+ # 13.0.3 - 2024-09-30
21
28
 
22
29
  - Update npms
23
30
 
24
- ## 13.0.2 - 2024-08-26
31
+ # 13.0.2 - 2024-08-26
25
32
 
26
33
  - Update npms
27
34
 
28
- ## 13.0.1 - 2024-07-02
35
+ # 13.0.1 - 2024-07-02
29
36
 
30
37
  - Update postgres-pool npm
31
38
 
32
- ## 13.0.0 - 2024-07-02
39
+ # 13.0.0 - 2024-07-02
33
40
 
34
41
  - Publish as CJS and ESM
35
42
  - Upgrade eslint to flat config
36
43
  - Update npms and dependencies
37
44
 
38
- ### BREAKING CHANGES
45
+ ## BREAKING CHANGES
39
46
 
40
47
  - Consolidated exports for /decorators, /errors, /metadata, /query, and /types to root
41
48
 
42
- ## 12.1.5 - 2024-05-13
49
+ # 12.1.5 - 2024-05-13
43
50
 
44
51
  - Update npms
45
52
 
46
- ## 12.1.4 - 2024-04-08
53
+ # 12.1.4 - 2024-04-08
47
54
 
48
55
  - Update npms
49
56
 
50
- ## 12.1.3 - 2024-03-11
57
+ # 12.1.3 - 2024-03-11
51
58
 
52
59
  - Update npms
53
60
 
54
- ## 12.1.2 - 2024-02-07
61
+ # 12.1.2 - 2024-02-07
55
62
 
56
63
  - Update npms
57
64
 
58
- ## 12.1.1 - 2024-01-12
65
+ # 12.1.1 - 2024-01-12
59
66
 
60
67
  - Handle `null` and `undefined` for columns with maxLength. #90 Thanks @tyler-neal!
61
68
  - Update npms
62
69
 
63
- ## 12.1.0 - 2024-01-05
70
+ # 12.1.0 - 2024-01-05
64
71
 
65
72
  - Added support for optional maxLength constraint when inserting/updating string fields. #89 Thanks @tyler-neal!
66
73
  - Update npms
67
74
 
68
- ## 12.0.2 - 2023-11-28
75
+ # 12.0.2 - 2023-11-28
69
76
 
70
77
  - Update npms
71
78
 
72
- ## 12.0.1 - 2023-10-27
79
+ # 12.0.1 - 2023-10-27
73
80
 
74
81
  - Update npms
75
82
 
76
- ## 12.0.0 - 2023-10-04
83
+ # 12.0.0 - 2023-10-04
77
84
 
78
- ### BREAKING CHANGES (12.0.0)
85
+ ## BREAKING CHANGES (12.0.0)
79
86
 
80
87
  - Drop support for Node.js 16
81
88
 
82
- ### NON-BREAKING CHANGES (12.0.0)
89
+ ## NON-BREAKING CHANGES (12.0.0)
83
90
 
84
91
  - Throw `QueryError`, with additional metadata
85
92
  - Throw error if query has an empty `or` statement
86
93
 
87
- ### MAINTENANCE (12.0.0)
94
+ ## MAINTENANCE (12.0.0)
88
95
 
89
96
  - Update npms
90
97
 
91
- ## 11.0.2 - 2023-07-18
98
+ # 11.0.2 - 2023-07-18
92
99
 
93
100
  - Update npms
94
101
 
95
- ## 11.0.1 - 2023-04-17
102
+ # 11.0.1 - 2023-04-17
96
103
 
97
104
  - Update npms
98
105
 
99
- ## 11.0.0 - 2023-02-07
106
+ # 11.0.0 - 2023-02-07
100
107
 
101
- ### BREAKING CHANGES (11.0.0)
108
+ ## BREAKING CHANGES (11.0.0)
102
109
 
103
110
  - Drop support for Node.js 14
104
111
 
105
- ### MAINTENANCE (11.0.0)
112
+ ## MAINTENANCE (11.0.0)
106
113
 
107
114
  - Update npms
108
115
 
109
- ## 10.4.2 - 2023-01-03
116
+ # 10.4.2 - 2023-01-03
110
117
 
111
118
  - Update npms
112
119
  - Enable noUncheckedIndexedAccess compiler option
113
120
 
114
- ## 10.4.1 - 2022-12-06
121
+ # 10.4.1 - 2022-12-06
115
122
 
116
123
  - Update npms
117
124
 
118
- ## 10.4.0 - 2022-11-03
125
+ # 10.4.0 - 2022-11-03
119
126
 
120
127
  - Fix string comparison where constraint with union values
121
128
  - Update npms
122
129
 
123
- ## 10.3.4 - 2022-10-11
130
+ # 10.3.4 - 2022-10-11
124
131
 
125
132
  - Update npms
126
133
 
127
- ## 10.3.3 - 2022-08-30
134
+ # 10.3.3 - 2022-08-30
128
135
 
129
136
  - Update npms
130
137
 
131
- ## 10.3.2 - 2022-06-29
138
+ # 10.3.2 - 2022-06-29
132
139
 
133
140
  - Update npms
134
141
 
135
- ## 10.3.1 - 2022-05-23
142
+ # 10.3.1 - 2022-05-23
136
143
 
137
144
  - Update npms
138
145
 
139
- ## 10.3.0 - 2022-04-25
146
+ # 10.3.0 - 2022-04-25
140
147
 
141
148
  - Add where clause for conflict resolution. Thanks @shortstuffsushi!
142
149
  - Update npms
143
150
 
144
- ## 10.2.0 - 2022-04-13
151
+ # 10.2.0 - 2022-04-13
145
152
 
146
153
  - Add `onConflict` options to `create()` to support `ON CONFLICT DO NOTHING` and `ON CONFLICT DO UPDATE`
147
154
  - Update npms
148
155
 
149
- ## 10.1.1 - 2022-03-22
156
+ # 10.1.1 - 2022-03-22
150
157
 
151
158
  - Update npms
152
159
 
153
- ## 10.1.0 - 2022-03-15
160
+ # 10.1.0 - 2022-03-15
154
161
 
155
162
  - Add ability to override db pool for `count()`
156
163
 
157
- ## 10.0.3 - 2022-03-15
164
+ # 10.0.3 - 2022-03-15
158
165
 
159
166
  - Update npms
160
167
  - Fix string comparison operators with arrays. Wildcard characters in array values passed to `startsWith`, `contains`,
@@ -162,98 +169,98 @@
162
169
  using `ilike`
163
170
  - Remove unnecessary `await` operators from `then()` functions
164
171
 
165
- ## 10.0.2 - 2022-03-02
172
+ # 10.0.2 - 2022-03-02
166
173
 
167
174
  - Update npms
168
175
 
169
- ## 10.0.1 - 2022-02-22
176
+ # 10.0.1 - 2022-02-22
170
177
 
171
178
  - Update npms
172
179
  - Update husky to support Apple silicon homebrew package links
173
180
 
174
- ## 10.0.0 - 2022-01-07
181
+ # 10.0.0 - 2022-01-07
175
182
 
176
183
  - Fix populated entities to be QueryResult
177
184
  - Improve return types when doing partial selects
178
185
  - Be less restrictive with dependency versions
179
186
  - Drop node 12 support
180
187
 
181
- ## 9.2.4 - 2021-12-28
188
+ # 9.2.4 - 2021-12-28
182
189
 
183
190
  - Fix PromiseLike signatures. Remove ChainablePromiseLike
184
191
 
185
- ## 9.2.3 - 2021-12-27
192
+ # 9.2.3 - 2021-12-27
186
193
 
187
194
  - Update npms
188
195
 
189
- ## 9.2.2 - 2021-12-27
196
+ # 9.2.2 - 2021-12-27
190
197
 
191
198
  - Fix to always include populate column names in select query
192
199
  - Use readonly arrays where possible when building sql
193
200
  - Update npms
194
201
 
195
- ## 9.2.1 - 2021-11-16
202
+ # 9.2.1 - 2021-11-16
196
203
 
197
204
  - Update npms
198
205
 
199
- ## 9.2.0 - 2021-11-16
206
+ # 9.2.0 - 2021-11-16
200
207
 
201
208
  - Update npms
202
209
  - Add ability to override db pool for `find()` and `findOne()`
203
210
 
204
- ## 9.1.6 - 2021-10-29
211
+ # 9.1.6 - 2021-10-29
205
212
 
206
213
  - Update npms
207
214
  - Format markdown files
208
215
 
209
- ## 9.1.5 - 2021-09-14
216
+ # 9.1.5 - 2021-09-14
210
217
 
211
218
  - Update npms
212
219
  - Lint markdown files
213
220
 
214
- ## 9.1.4
221
+ # 9.1.4
215
222
 
216
223
  - Update npms
217
224
  - Set sourceRoot when transpiling Typescript, to help with sourcemap paths
218
225
 
219
- ## 9.1.3
226
+ # 9.1.3
220
227
 
221
228
  - Fix deprecated faker.js usage
222
229
 
223
- ## 9.1.2
230
+ # 9.1.2
224
231
 
225
232
  - Update npms
226
233
 
227
- ## 9.1.1
234
+ # 9.1.1
228
235
 
229
236
  - Update npms
230
237
 
231
- ## 9.1.0
238
+ # 9.1.0
232
239
 
233
240
  - Add beforeCreate and beforeUpdate static method definitions to Entity.
234
241
  - Enable typescript lint check: [`noImplicitOverride`](https://www.typescriptlang.org/tsconfig#noImplicitOverride)
235
242
  - Update npms
236
243
 
237
- ## 9.0.2
244
+ # 9.0.2
238
245
 
239
246
  - Update npms
240
247
 
241
- ## 9.0.1
248
+ # 9.0.1
242
249
 
243
250
  - Update npms
244
251
  - Add Node.js v16 to CI tests
245
252
 
246
- ## 9.0.0
253
+ # 9.0.0
247
254
 
248
255
  - Drop Node.js 10 support
249
256
  - Enable consistent indexed object style lint rule
250
257
 
251
- ## 8.1.1
258
+ # 8.1.1
252
259
 
253
260
  - Throw error when trying to populate a one-to-many relationship from `find()` with specific select columns and not including the
254
261
  relation column.
255
262
 
256
- ## 8.1.0
263
+ # 8.1.0
257
264
 
258
265
  - Allow chaining `populate()` with `find()` calls :tada:
259
266
  - Add `UNSAFE_withOriginalFieldType()` helper method to `find()` and `findOne()` to retain the original type for a field.
@@ -261,7 +268,7 @@
261
268
  being forced to strictly `string`.
262
269
  - Add `UNSAFE_withFieldValue()` helper method to `findOne()` to manually set a field value.
263
270
 
264
- ## 8.0.0
271
+ # 8.0.0
265
272
 
266
273
  - Constrain types for create(), update(), and selects
267
274
  - Exclude instance functions and entity collections
@@ -273,17 +280,17 @@
273
280
 
274
281
  **Breaking Change:** The change to create and update values expects a property called `id` on subclasses of `Entity`.
275
282
 
276
- ## 7.1.2
283
+ # 7.1.2
277
284
 
278
285
  - Make sort argument optional for chained calls
279
286
 
280
- ## 7.1.1
287
+ # 7.1.1
281
288
 
282
289
  - Allow sort() argument to be undefined
283
290
  - Fix object notation for sort() to have properties be optional
284
291
  - Make `__bigAlEntity` be optional on Entity to avoid undefined errors when using objects as model data
285
292
 
286
- ## 7.1.0
293
+ # 7.1.0
287
294
 
288
295
  - Fix `select` typings for populate() calls
289
296
  - Changed `Entity` to be an abstract class rather than an interface
@@ -291,259 +298,259 @@
291
298
  NOTE: This is a pretty big breaking change, but v7.0.0 was less than 24h old and was broken, so leaving this as a
292
299
  minor version change.
293
300
 
294
- ## 7.0.0
301
+ # 7.0.0
295
302
 
296
303
  - Add generic types to select and where. #72 Thanks @krislefeber!
297
304
  - Add debug environment variable to print sql to console. #73 Thanks @krislefeber!
298
305
  - Add generic types to returnSelect and sort arguments
299
306
  - Update npms
300
307
 
301
- ## 6.0.2
308
+ # 6.0.2
302
309
 
303
310
  - Update npms
304
311
  - Sort union/intersection members
305
312
 
306
- ## 6.0.1
313
+ # 6.0.1
307
314
 
308
315
  - Fix jsdocs for create and update
309
316
 
310
- ## 6.0.0
317
+ # 6.0.0
311
318
 
312
319
  - Update npms
313
320
  - Change `.destroy()` to not return records by default. Use `.destroy({}, { returnRecords: true })` for previous behavior
314
321
  - Return `void` instead of `boolean` when not returning records
315
322
 
316
- ## 5.0.3
323
+ # 5.0.3
317
324
 
318
325
  - Update npms
319
326
 
320
- ## 5.0.2
327
+ # 5.0.2
321
328
 
322
329
  - Update npms
323
330
 
324
- ## 5.0.1
331
+ # 5.0.1
325
332
 
326
333
  - Update npms
327
334
 
328
- ## 5.0.0
335
+ # 5.0.0
329
336
 
330
337
  - Update npms
331
338
  - Use prettier to format files
332
339
  - Create interfaces for Repository and ReadonlyRepository
333
340
  - Remove interfaces for RepositoriesByModelName and RepositoriesByModelNameLowered
334
341
 
335
- ## 4.1.1
342
+ # 4.1.1
336
343
 
337
344
  - Update npms
338
345
  - Use prettier to format files
339
346
 
340
- ## 4.1.0
347
+ # 4.1.0
341
348
 
342
349
  - Fix issues with `like` and array containing null or empty string.
343
350
  Specifically support negated array type value with null and empty string.
344
351
  - Fix `like` constraint with null value
345
352
 
346
- ## 4.0.2
353
+ # 4.0.2
347
354
 
348
355
  - Update npms
349
356
 
350
- ## 4.0.1
357
+ # 4.0.1
351
358
 
352
359
  - Update npms
353
360
 
354
- ## 4.0.0
361
+ # 4.0.0
355
362
 
356
363
  - Tightened up type definitions for "object" to Record<string, unknown> or more strict definition
357
364
  - Do not return a string from .count() if the number is greater than safe int
358
365
  - Update npms & fix lint issues
359
366
 
360
- ## 3.4.1
367
+ # 3.4.1
361
368
 
362
369
  - Update npms
363
370
 
364
- ## 3.4.0
371
+ # 3.4.0
365
372
 
366
373
  - Update npms
367
374
  - Fix jsdoc comments for .populate()
368
375
 
369
- ## 3.3.4
376
+ # 3.3.4
370
377
 
371
378
  - Update npms
372
379
 
373
- ## 3.3.3
380
+ # 3.3.3
374
381
 
375
382
  - Update npms
376
383
 
377
- ## 3.3.2
384
+ # 3.3.2
378
385
 
379
386
  - Update npms
380
387
 
381
- ## 3.3.1
388
+ # 3.3.1
382
389
 
383
390
  - Update npms
384
391
 
385
- ## 3.3.0
392
+ # 3.3.0
386
393
 
387
394
  - Make typescript lint rules more strict
388
395
  - Update npms
389
396
 
390
- ## 3.2.0
397
+ # 3.2.0
391
398
 
392
399
  - Fix CreateUpdateDelete type to be strict about either returnRecords=false or defined returnSelect
393
400
  - Update npms
394
401
 
395
- ## 3.1.1
402
+ # 3.1.1
396
403
 
397
404
  - Throw error when invalid propertyName in query projection
398
405
  - Update npms
399
406
 
400
- ## 3.1.0
407
+ # 3.1.0
401
408
 
402
409
  - Update postgres-pool to v2.0.0
403
410
  - Update npms
404
411
 
405
- ## 3.0.1
412
+ # 3.0.1
406
413
 
407
414
  - Remove returnSelect requirement when returnRecords=false
408
415
 
409
- ## 3.0.0
416
+ # 3.0.0
410
417
 
411
418
  - Use classes and decorators to define database models
412
419
  - Allow repositories to be strongly typed to their database model
413
420
  - Split readonly repository functionality into a separate class from writeable repository functionality
414
421
 
415
- ## 2.2.1
422
+ # 2.2.1
416
423
 
417
424
  - Update npms
418
425
 
419
- ## 2.2.0
426
+ # 2.2.0
420
427
 
421
428
  - Add readonly property to schemas to limit access to create(), update(), destroy() methods
422
429
  - Update npms
423
430
 
424
- ## 2.1.3
431
+ # 2.1.3
425
432
 
426
433
  - Fix querying array columns with `like` operator
427
434
  - Add additional array types: string[], integer[], float[], boolean[]
428
435
 
429
- ## 2.1.2
436
+ # 2.1.2
430
437
 
431
438
  - Fix casing issues with generated Repository and SqlHelper
432
439
  - Revert explicit export of interfaces/classes: Entity, Model, ModelClassesByGlobalId, and Repository
433
440
 
434
- ## 2.1.1
441
+ # 2.1.1
435
442
 
436
443
  - Explicit export of interfaces/classes: Entity, Model, ModelClassesByGlobalId, and Repository
437
444
 
438
- ## 2.1.0
445
+ # 2.1.0
439
446
 
440
447
  - Fix publish path to remove "dist"
441
448
  - Add type definitions to "dependencies"
442
449
 
443
- ## 2.0.8
450
+ # 2.0.8
444
451
 
445
452
  - Add binary data type
446
453
 
447
- ## 2.0.7
454
+ # 2.0.7
448
455
 
449
456
  - Add additional array types as type for defaultsTo
450
457
 
451
- ## 2.0.6
458
+ # 2.0.6
452
459
 
453
460
  - Add array as type for defaultsTo
454
461
  - Fix generic type issues due to Typescript 3.5
455
462
  - Update npms
456
463
 
457
- ## 2.0.5
464
+ # 2.0.5
458
465
 
459
466
  - Allow .findOne(), .find(), .count(), .update(), and .destroy() to be used in an iterable promise (eg. Promise.all())
460
467
 
461
- ## 2.0.4
468
+ # 2.0.4
462
469
 
463
470
  - Fix return type for .findOne(), .find(), .count(), .destroy() to not include `undefined`
464
471
 
465
- ## 2.0.3
472
+ # 2.0.3
466
473
 
467
474
  - Update npm dependencies
468
475
 
469
- ## 2.0.2
476
+ # 2.0.2
470
477
 
471
478
  - Add boolean types as acceptable values for a where clause
472
479
 
473
- ## 2.0.1
480
+ # 2.0.1
474
481
 
475
482
  - Fix case of import module for initialization function
476
483
 
477
- ## 2.0.0
484
+ # 2.0.0
478
485
 
479
486
  - Typescript ftw! The API is the same as BigAl v1.x. BigAl v2 is a rewrite in typescript, to provide strong type support. It should be a drop in update to go to v2.
480
487
 
481
- ## 1.2.1
488
+ # 1.2.1
482
489
 
483
490
  - Use husky to enforce precommit hook for development
484
491
 
485
- ## 1.2.0
492
+ # 1.2.0
486
493
 
487
494
  - Add `connections` property to initialize method
488
495
  - Use `connection` on model schema to optionally set specific connection pools for each model
489
496
  - Update dependencies
490
497
 
491
- ## 1.1.6
498
+ # 1.1.6
492
499
 
493
500
  - Update dependencies
494
501
 
495
- ## 1.1.5
502
+ # 1.1.5
496
503
 
497
504
  - Throw exception when find, update, findOne, and destroy queries receive a string parameter instead of object.
498
505
 
499
- ## 1.1.4
506
+ # 1.1.4
500
507
 
501
508
  - Fix: Results for model queries should share the same inherited base
502
509
 
503
- ## 1.1.3
510
+ # 1.1.3
504
511
 
505
512
  - Fix: Querying array types
506
513
  - Fix: Explicitly cast array values
507
514
 
508
- ## 1.1.2
515
+ # 1.1.2
509
516
 
510
517
  - Fix: Try to convert float and integer column data to numbers when fetching records
511
518
 
512
- ## 1.1.1
519
+ # 1.1.1
513
520
 
514
521
  - Fix: Checking if array column equals an empty array
515
522
 
516
- ## 1.1.0
523
+ # 1.1.0
517
524
 
518
525
  - Allow array values for: like, contains, startsWith, and endsWith
519
526
 
520
- ## 1.0.8
527
+ # 1.0.8
521
528
 
522
529
  - Fix: Prevent trying to save when create() is called with an empty array
523
530
 
524
- ## 1.0.7
531
+ # 1.0.7
525
532
 
526
533
  - Fix: Add additional stack trace data when an exception occurs
527
534
 
528
- ## 1.0.6
535
+ # 1.0.6
529
536
 
530
537
  - Fix: "invalid input syntax for type json" error when setting jsonb column value to an array. See <https://github.com/brianc/node-postgres/issues/442>
531
538
  - Update npms to latest versions
532
539
 
533
- ## 1.0.5
540
+ # 1.0.5
534
541
 
535
542
  - Fix: AND constraint after an OR constraint caused exception
536
543
 
537
- ## 1.0.4
544
+ # 1.0.4
538
545
 
539
546
  - Fix: Querying date values was not working
540
547
  - Fix: Querying a property with columnName that is the same as the property name would result in unnecessary sql syntax
541
548
 
542
- ## 1.0.3
549
+ # 1.0.3
543
550
 
544
551
  - Fix: A query with an empty array should return 0 records. Negated queries with empty arrays will return all records.
545
552
 
546
- ## 1.0.2
553
+ # 1.0.2
547
554
 
548
555
  - Organize schemas by case-insensitive global id
549
556
  - Expose schema attributes collection on model instance
@@ -551,10 +558,10 @@ minor version change.
551
558
  - Ensure .count() returns number instead of a string (default data type for bigint)
552
559
  - Fix queries for empty arrays
553
560
 
554
- ## 1.0.1
561
+ # 1.0.1
555
562
 
556
563
  - Add .count() method
557
564
 
558
- ## 1.0.0
565
+ # 1.0.0
559
566
 
560
567
  - Initial release
package/CONTRIBUTING.md CHANGED
@@ -1,22 +1,25 @@
1
- # Contributors
1
+ # Contributing Guidelines
2
2
 
3
- ## Checkin
3
+ ## Pull Request Format
4
4
 
5
- - Do checkin source (src)
6
- - Do not checkin build output (dist)
7
- - Do not checkin node_modules
5
+ The title of your PR should match the following format:
8
6
 
9
- ## Development
7
+ ```text
8
+ <type>: <short description>
9
+ ```
10
10
 
11
- In order to handle code style and static analysis, we run [Husky](https://github.com/typicode/husky) before each commit.
12
- This step ensures that formatting and checkin rules are followed. To make sure Husky runs correctly, please use the
13
- following workflow:
11
+ ### Types
14
12
 
15
- ```sh
16
- npm install # installs all devDependencies including Husky
17
- git add abc.ext # Add the files you've changed. This should include files in src, lib, and node_modules (see above)
18
- git commit -m "Informative commit message" # Commit. This will run Husky
19
- ```
13
+ - **docs** - Documentation changes only
14
+ - **feat** - Any new functionality additions
15
+ - **fix** - Bugfixes that don't add new functionality
16
+ - **test** - Test changes only
17
+ - **chore** - Anything else
18
+
19
+ Within the body of your PR, make sure you reference the issue that you have worked on, as well as pointing out anything
20
+ of note you wish us to look at during our review.
21
+
22
+ ### Commits
20
23
 
21
- During the commit step, Husky will take care of formatting all files with [Prettier](https://github.com/prettier/prettier).
22
- It will also make sure these changes are appropriately included in your commit (no further work is needed)
24
+ We do not care about the number, or style of commits in your history, because we squash merge every PR into main.
25
+ Feel free to commit in whatever style you feel comfortable with.
package/dist/index.cjs CHANGED
@@ -2135,21 +2135,15 @@ ${stack}`;
2135
2135
 
2136
2136
  function column(dbColumnNameOrOptions, options) {
2137
2137
  return function columnDecorator(object, propertyName) {
2138
- if (!dbColumnNameOrOptions) {
2139
- dbColumnNameOrOptions = ___default.snakeCase(propertyName);
2140
- }
2138
+ dbColumnNameOrOptions ??= ___default.snakeCase(propertyName);
2141
2139
  let dbColumnName;
2142
2140
  if (typeof dbColumnNameOrOptions === "string") {
2143
2141
  dbColumnName = dbColumnNameOrOptions;
2144
2142
  } else {
2145
2143
  options = dbColumnNameOrOptions;
2146
2144
  }
2147
- if (!options) {
2148
- options = {};
2149
- }
2150
- if (!dbColumnName) {
2151
- dbColumnName = options.name ?? ___default.snakeCase(propertyName);
2152
- }
2145
+ options ??= {};
2146
+ dbColumnName ??= options.name ?? ___default.snakeCase(propertyName);
2153
2147
  const metadataStorage = getMetadataStorage();
2154
2148
  const columnCollectionOptions = options;
2155
2149
  if (columnCollectionOptions.collection || columnCollectionOptions.via) {
@@ -2208,12 +2202,8 @@ function createDateColumn(dbColumnNameOrOptions, options) {
2208
2202
  options = dbColumnNameOrOptions;
2209
2203
  }
2210
2204
  if (dbColumnNameOrOptions) {
2211
- if (!options) {
2212
- options = {};
2213
- }
2214
- if (!dbColumnName) {
2215
- dbColumnName = options.name ?? ___default.snakeCase(propertyName);
2216
- }
2205
+ options ??= {};
2206
+ dbColumnName ??= options.name ?? ___default.snakeCase(propertyName);
2217
2207
  metadataStorage.columns.push(
2218
2208
  new ColumnTypeMetadata({
2219
2209
  target: object.constructor.name,
@@ -2246,12 +2236,8 @@ function primaryColumn(dbColumnNameOrOptions, options) {
2246
2236
  options = dbColumnNameOrOptions;
2247
2237
  }
2248
2238
  if (dbColumnNameOrOptions) {
2249
- if (!options) {
2250
- options = {};
2251
- }
2252
- if (!dbColumnName) {
2253
- dbColumnName = options.name ?? ___default.snakeCase(propertyName);
2254
- }
2239
+ options ??= {};
2240
+ dbColumnName ??= options.name ?? ___default.snakeCase(propertyName);
2255
2241
  const { type } = options;
2256
2242
  const { model } = options;
2257
2243
  const metadataStorage = getMetadataStorage();
@@ -2302,12 +2288,8 @@ function table(dbNameOrTableOptions, options) {
2302
2288
  } else {
2303
2289
  options = dbNameOrTableOptions;
2304
2290
  }
2305
- if (!options) {
2306
- options = {};
2307
- }
2308
- if (!options.name) {
2309
- options.name = dbTableName ?? ___default.snakeCase(className);
2310
- }
2291
+ options ??= {};
2292
+ options.name ??= dbTableName ?? ___default.snakeCase(className);
2311
2293
  const metadataStorage = getMetadataStorage();
2312
2294
  const modelMetadata = new ModelMetadata({
2313
2295
  name: className,
@@ -2329,12 +2311,8 @@ function updateDateColumn(dbColumnNameOrOptions, options) {
2329
2311
  options = dbColumnNameOrOptions;
2330
2312
  }
2331
2313
  if (dbColumnNameOrOptions) {
2332
- if (!options) {
2333
- options = {};
2334
- }
2335
- if (!dbColumnName) {
2336
- dbColumnName = options.name ?? ___default.snakeCase(propertyName);
2337
- }
2314
+ options ??= {};
2315
+ dbColumnName ??= options.name ?? ___default.snakeCase(propertyName);
2338
2316
  const metadataStorage = getMetadataStorage();
2339
2317
  metadataStorage.columns.push(
2340
2318
  new ColumnTypeMetadata({
@@ -2369,12 +2347,8 @@ function versionColumn(dbColumnNameOrOptions, options) {
2369
2347
  options = dbColumnNameOrOptions;
2370
2348
  }
2371
2349
  if (dbColumnNameOrOptions) {
2372
- if (!options) {
2373
- options = {};
2374
- }
2375
- if (!dbColumnName) {
2376
- dbColumnName = options.name ?? ___default.snakeCase(propertyName);
2377
- }
2350
+ options ??= {};
2351
+ dbColumnName ??= options.name ?? ___default.snakeCase(propertyName);
2378
2352
  const metadataStorage = getMetadataStorage();
2379
2353
  metadataStorage.columns.push(
2380
2354
  new ColumnTypeMetadata({
package/dist/index.mjs CHANGED
@@ -2129,21 +2129,15 @@ ${stack}`;
2129
2129
 
2130
2130
  function column(dbColumnNameOrOptions, options) {
2131
2131
  return function columnDecorator(object, propertyName) {
2132
- if (!dbColumnNameOrOptions) {
2133
- dbColumnNameOrOptions = _.snakeCase(propertyName);
2134
- }
2132
+ dbColumnNameOrOptions ??= _.snakeCase(propertyName);
2135
2133
  let dbColumnName;
2136
2134
  if (typeof dbColumnNameOrOptions === "string") {
2137
2135
  dbColumnName = dbColumnNameOrOptions;
2138
2136
  } else {
2139
2137
  options = dbColumnNameOrOptions;
2140
2138
  }
2141
- if (!options) {
2142
- options = {};
2143
- }
2144
- if (!dbColumnName) {
2145
- dbColumnName = options.name ?? _.snakeCase(propertyName);
2146
- }
2139
+ options ??= {};
2140
+ dbColumnName ??= options.name ?? _.snakeCase(propertyName);
2147
2141
  const metadataStorage = getMetadataStorage();
2148
2142
  const columnCollectionOptions = options;
2149
2143
  if (columnCollectionOptions.collection || columnCollectionOptions.via) {
@@ -2202,12 +2196,8 @@ function createDateColumn(dbColumnNameOrOptions, options) {
2202
2196
  options = dbColumnNameOrOptions;
2203
2197
  }
2204
2198
  if (dbColumnNameOrOptions) {
2205
- if (!options) {
2206
- options = {};
2207
- }
2208
- if (!dbColumnName) {
2209
- dbColumnName = options.name ?? _.snakeCase(propertyName);
2210
- }
2199
+ options ??= {};
2200
+ dbColumnName ??= options.name ?? _.snakeCase(propertyName);
2211
2201
  metadataStorage.columns.push(
2212
2202
  new ColumnTypeMetadata({
2213
2203
  target: object.constructor.name,
@@ -2240,12 +2230,8 @@ function primaryColumn(dbColumnNameOrOptions, options) {
2240
2230
  options = dbColumnNameOrOptions;
2241
2231
  }
2242
2232
  if (dbColumnNameOrOptions) {
2243
- if (!options) {
2244
- options = {};
2245
- }
2246
- if (!dbColumnName) {
2247
- dbColumnName = options.name ?? _.snakeCase(propertyName);
2248
- }
2233
+ options ??= {};
2234
+ dbColumnName ??= options.name ?? _.snakeCase(propertyName);
2249
2235
  const { type } = options;
2250
2236
  const { model } = options;
2251
2237
  const metadataStorage = getMetadataStorage();
@@ -2296,12 +2282,8 @@ function table(dbNameOrTableOptions, options) {
2296
2282
  } else {
2297
2283
  options = dbNameOrTableOptions;
2298
2284
  }
2299
- if (!options) {
2300
- options = {};
2301
- }
2302
- if (!options.name) {
2303
- options.name = dbTableName ?? _.snakeCase(className);
2304
- }
2285
+ options ??= {};
2286
+ options.name ??= dbTableName ?? _.snakeCase(className);
2305
2287
  const metadataStorage = getMetadataStorage();
2306
2288
  const modelMetadata = new ModelMetadata({
2307
2289
  name: className,
@@ -2323,12 +2305,8 @@ function updateDateColumn(dbColumnNameOrOptions, options) {
2323
2305
  options = dbColumnNameOrOptions;
2324
2306
  }
2325
2307
  if (dbColumnNameOrOptions) {
2326
- if (!options) {
2327
- options = {};
2328
- }
2329
- if (!dbColumnName) {
2330
- dbColumnName = options.name ?? _.snakeCase(propertyName);
2331
- }
2308
+ options ??= {};
2309
+ dbColumnName ??= options.name ?? _.snakeCase(propertyName);
2332
2310
  const metadataStorage = getMetadataStorage();
2333
2311
  metadataStorage.columns.push(
2334
2312
  new ColumnTypeMetadata({
@@ -2363,12 +2341,8 @@ function versionColumn(dbColumnNameOrOptions, options) {
2363
2341
  options = dbColumnNameOrOptions;
2364
2342
  }
2365
2343
  if (dbColumnNameOrOptions) {
2366
- if (!options) {
2367
- options = {};
2368
- }
2369
- if (!dbColumnName) {
2370
- dbColumnName = options.name ?? _.snakeCase(propertyName);
2371
- }
2344
+ options ??= {};
2345
+ dbColumnName ??= options.name ?? _.snakeCase(propertyName);
2372
2346
  const metadataStorage = getMetadataStorage();
2373
2347
  metadataStorage.columns.push(
2374
2348
  new ColumnTypeMetadata({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigal",
3
- "version": "13.0.7",
3
+ "version": "13.0.9",
4
4
  "description": "A fast and lightweight orm for postgres and node.js, written in typescript.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -33,32 +33,39 @@
33
33
  "node": ">=18"
34
34
  },
35
35
  "dependencies": {
36
- "@types/pg": "^8.11.11",
37
- "lodash": "^4.17.21",
38
- "pg": "^8.13.3",
39
- "postgres-pool": "^10.0.0"
36
+ "@types/pg": "8.11.13",
37
+ "lodash": "4.17.21",
38
+ "pg": "8.14.1",
39
+ "postgres-pool": "10.1.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@faker-js/faker": "^9.6.0",
43
- "@types/chai": "^5.2.0",
44
- "@types/lodash": "^4.17.16",
42
+ "@faker-js/faker": "9.7.0",
43
+ "@semantic-release/changelog": "6.0.3",
44
+ "@semantic-release/commit-analyzer": "13.0.1",
45
+ "@semantic-release/git": "10.0.1",
46
+ "@semantic-release/github": "11.0.1",
47
+ "@semantic-release/npm": "12.0.1",
48
+ "@semantic-release/release-notes-generator": "14.0.3",
49
+ "@types/chai": "5.2.1",
50
+ "@types/lodash": "4.17.16",
45
51
  "@types/mocha": "10.0.10",
46
52
  "@types/node": ">=22",
47
- "chai": "^5.2.0",
48
- "eslint": "^9.22.0",
49
- "eslint-config-decent": "^2.6.1",
50
- "husky": "^9.1.7",
51
- "lint-staged": "^15.4.3",
52
- "markdownlint-cli": "^0.44.0",
53
- "mocha": "^11.1.0",
54
- "npm-run-all": "^4.1.5",
55
- "pinst": "^3.0.0",
56
- "prettier": "^3.5.3",
57
- "strict-event-emitter-types": "^2.0.0",
58
- "ts-mockito": "^2.6.1",
59
- "ts-node": "^10.9.2",
60
- "typescript": "^5.8.2",
61
- "unbuild": "^3.5.0"
53
+ "chai": "5.2.0",
54
+ "eslint": "9.24.0",
55
+ "eslint-config-decent": "2.6.6",
56
+ "husky": "9.1.7",
57
+ "lint-staged": "15.5.1",
58
+ "markdownlint-cli": "0.44.0",
59
+ "mocha": "11.1.0",
60
+ "npm-run-all2": "7.0.2",
61
+ "pinst": "3.0.0",
62
+ "prettier": "3.5.3",
63
+ "semantic-release": "24.2.3",
64
+ "strict-event-emitter-types": "2.0.0",
65
+ "ts-mockito": "2.6.1",
66
+ "ts-node": "10.9.2",
67
+ "typescript": "5.8.3",
68
+ "unbuild": "3.5.0"
62
69
  },
63
70
  "scripts": {
64
71
  "build": "unbuild",
@@ -69,7 +76,7 @@
69
76
  "lint": "run-p lint:*",
70
77
  "lint-staged": "lint-staged",
71
78
  "beta": "npm publish --tag beta",
72
- "prepublishOnly": "npm run lint && npm run test && npm run build && pinst --disable",
79
+ "prepublishOnly": "pinst --disable",
73
80
  "postpublish": "pinst --enable",
74
81
  "prepare": "husky"
75
82
  },
@@ -78,17 +85,11 @@
78
85
  "prettier --write --cache",
79
86
  "markdownlint --config=.github/linters/.markdown-lint.yml --fix"
80
87
  ],
81
- "*.js": [
88
+ "*.{js,cjs,mjs,ts}": [
82
89
  "eslint --fix"
83
90
  ],
84
- "*.cjs": [
85
- "eslint --fix"
86
- ],
87
- "*.mjs": [
88
- "eslint --fix"
89
- ],
90
- "*.ts": [
91
- "eslint --fix"
91
+ "*.{json5,yml}": [
92
+ "prettier --write"
92
93
  ]
93
94
  },
94
95
  "repository": {
@@ -0,0 +1,44 @@
1
+ export default {
2
+ branches: ['main', 'beta'],
3
+ plugins: [
4
+ [
5
+ '@semantic-release/commit-analyzer',
6
+ {
7
+ preset: 'angular',
8
+ releaseRules: [
9
+ { type: 'docs', release: 'patch' },
10
+ { type: 'feat', release: 'minor' },
11
+ { type: 'fix', release: 'patch' },
12
+ { type: 'test', release: 'patch' },
13
+ { type: 'chore', release: 'patch' },
14
+ ],
15
+ parserOpts: {
16
+ // eslint-disable-next-line security/detect-unsafe-regex
17
+ headerPattern: /^(\w+)(?:\([^)]+\))?: (.+)$/,
18
+ headerCorrespondence: ['type', 'subject'],
19
+ },
20
+ },
21
+ ],
22
+ '@semantic-release/release-notes-generator',
23
+ [
24
+ '@semantic-release/changelog',
25
+ {
26
+ changelogFile: 'CHANGELOG.md',
27
+ },
28
+ ],
29
+ '@semantic-release/npm',
30
+ [
31
+ '@semantic-release/github',
32
+ {
33
+ assets: [],
34
+ },
35
+ ],
36
+ [
37
+ '@semantic-release/git',
38
+ {
39
+ assets: ['CHANGELOG.md', 'package.json', 'package-lock.json'],
40
+ message: `chore: release \${nextRelease.version} [skip ci]\n\n\${nextRelease.notes}`,
41
+ },
42
+ ],
43
+ ],
44
+ };