@jazim/test 2.0.5 → 2.0.7

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 +9 -74
  2. package/package.json +7 -4
package/README.md CHANGED
@@ -41,6 +41,15 @@ This package requires the following peer dependencies:
41
41
  npm install better-auth typeorm
42
42
  ```
43
43
 
44
+ ## Better Auth CLI Generate Schema
45
+ You can use the Better Auth CLI to generate the database schema using the TypeORM adapter.
46
+
47
+ ```bash
48
+ npx @better-auth/cli@latest generate
49
+ ```
50
+
51
+ For more information, refer to the [Better Auth CLI documentation](https://www.better-auth.com/docs/concepts/cli).
52
+
44
53
  ## Quick Start
45
54
 
46
55
  ### 1. Setup TypeORM DataSource
@@ -352,68 +361,6 @@ export class BetterAuthMigration1234567890 implements MigrationInterface {
352
361
  }
353
362
  ```
354
363
 
355
- ## Advanced Features
356
-
357
- ### Query Operators
358
-
359
- The adapter supports various query operators:
360
-
361
- - `eq` - Equal
362
- - `ne` - Not equal
363
- - `lt` - Less than
364
- - `lte` - Less than or equal
365
- - `gt` - Greater than
366
- - `gte` - Greater than or equal
367
- - `in` - In array
368
- - `not_in` - Not in array
369
- - `contains` - String contains
370
- - `starts_with` - String starts with
371
- - `ends_with` - String ends with
372
-
373
- ### Error Handling
374
-
375
- The adapter provides detailed error messages wrapped in `BetterAuthError` for easier debugging:
376
-
377
- ```typescript
378
- try {
379
- await auth.api.signInEmail({
380
- email: "user@example.com",
381
- password: "password",
382
- });
383
- } catch (error) {
384
- console.error(error.message); // Detailed error from the adapter
385
- }
386
- ```
387
-
388
- ## TypeORM Integration
389
-
390
- ### Running Migrations
391
-
392
- You can use TypeORM CLI to run migrations:
393
-
394
- ```bash
395
- # Run migrations
396
- npx typeorm migration:run -d ./data-source.ts
397
-
398
- # Revert migrations
399
- npx typeorm migration:revert -d ./data-source.ts
400
-
401
- # Show migrations
402
- npx typeorm migration:show -d ./data-source.ts
403
- ```
404
-
405
- ### Accessing Entities
406
-
407
- You can access the generated entities in your application:
408
-
409
- ```typescript
410
- import { User } from "./entities/auth";
411
- import { dataSource } from "./data-source";
412
-
413
- const userRepository = dataSource.getRepository(User);
414
- const users = await userRepository.find();
415
- ```
416
-
417
364
  ## Database Schema
418
365
 
419
366
  The adapter creates the following tables (default names):
@@ -434,18 +381,6 @@ Each table is fully compatible with Better Auth's requirements and supports all
434
381
  5. **Custom Entities**: If using custom entity names, ensure consistency across your application
435
382
  6. **Transaction Support**: Enable transactions for critical operations
436
383
 
437
- ## Troubleshooting
438
-
439
- ### Entities Not Found
440
-
441
- Make sure your TypeORM configuration includes the correct entity paths:
442
-
443
- ```typescript
444
- entities: ["./entities/**/*.ts"], // Development
445
- // or
446
- entities: ["./dist/entities/**/*.js"], // Production
447
- ```
448
-
449
384
  ### Migration Errors
450
385
 
451
386
  If migrations fail:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jazim/test",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "TypeORM adapter for Better-Auth",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -30,7 +30,11 @@
30
30
  "authentication",
31
31
  "auth"
32
32
  ],
33
- "author": "",
33
+ "homepage": "https://github.com/jazimabbas/typeorm-better-auth#readme",
34
+ "repository": {
35
+ "url": "https://github.com/jazimabbas/typeorm-better-auth"
36
+ },
37
+ "author": "Jazim Abbas",
34
38
  "license": "MIT",
35
39
  "peerDependencies": {
36
40
  "better-auth": ">=1.4.0",
@@ -49,7 +53,6 @@
49
53
  "vitest": "^4.0.16"
50
54
  },
51
55
  "dependencies": {
52
- "ejs": "^3.1.9",
53
- "handlebars": "^4.7.8"
56
+ "ejs": "^3.1.9"
54
57
  }
55
58
  }