@appxdigital/appx-core 0.1.126 → 0.1.127

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
@@ -14,6 +14,20 @@ This project follows the `MAJOR.MINOR.PATCH` scheme in `package.json`.
14
14
 
15
15
  ---
16
16
 
17
+ ## [0.1.127] — 2026-08-03
18
+
19
+ ### Changed
20
+
21
+ - **The AdminJS backoffice reads model definitions from the generated Prisma client instead of re-parsing the schema at boot.** It previously called `getDMMF()` from **`@prisma/sdk`** — a package Prisma **deprecated and renamed** (its `latest` is frozen at the Prisma-4 era) — to parse `prisma/schema.prisma` on every admin boot. It now reads `Prisma.dmmf` from your generated `@prisma/client`, the same source of truth the code generators already use and exactly what `@adminjs/prisma` consumes. Result: no runtime schema parse, no heavy Prisma query engine spun up at admin boot, identical resources, and one fewer dependency.
22
+
23
+ ### Migration
24
+
25
+ > **The deprecated `@prisma/sdk` peer dependency is gone.** Nothing replaces it — the backoffice uses your existing `@prisma/client`.
26
+
27
+ Drop-in for almost everyone (`@prisma/sdk` was an auto-installed peer, not a direct dependency). If you added `@prisma/sdk` to your project's `package.json` explicitly, you can now remove it: `npm remove @prisma/sdk`.
28
+
29
+ ---
30
+
17
31
  ## [0.1.126] — 2026-07-31
18
32
 
19
33
  ### Fixed
@@ -1 +1 @@
1
- {"version":3,"file":"appx-core-admin.module.d.ts","sourceRoot":"","sources":["../../src/backoffice/appx-core-admin.module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,aAAa,EAAiB,MAAM,gBAAgB,CAAC;AAQ7D,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAIjE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AAE9E,qBAEa,mBAAmB;IAC5B,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;CAG3G"}
1
+ {"version":3,"file":"appx-core-admin.module.d.ts","sourceRoot":"","sources":["../../src/backoffice/appx-core-admin.module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,aAAa,EAAiB,MAAM,gBAAgB,CAAC;AAO7D,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAIjE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AAE9E,qBAEa,mBAAmB;IAC5B,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;CAG3G"}
@@ -35,8 +35,7 @@ exports.AppxCoreAdminModule = void 0;
35
35
  (_a = process.env).ADMIN_JS_TMP_DIR ?? (_a.ADMIN_JS_TMP_DIR = 'tmp/adminjs');
36
36
  const common_1 = require("@nestjs/common");
37
37
  const utils_1 = require("./utils");
38
- const fs_1 = require("fs");
39
- const sdk_1 = require("@prisma/sdk");
38
+ const utils_2 = require("../config/utils");
40
39
  const nestjs_request_context_1 = require("nestjs-request-context");
41
40
  const adminjs_1 = require("adminjs");
42
41
  const argon2 = __importStar(require("argon2"));
@@ -60,13 +59,14 @@ async function createAdminJsModule(adminConfig, permissionConfig) {
60
59
  const { AdminModule } = await (0, utils_1.dynamicImport)('@adminjs/nestjs');
61
60
  const { default: importExportFeature } = await (0, utils_1.dynamicImport)('@adminjs/import-export');
62
61
  const { default: passwordFeature } = await (0, utils_1.dynamicImport)('@adminjs/passwords');
63
- // This gets the models from the Prisma schema, and then creates the AdminJS resources
64
- const schemaPath = './prisma/schema.prisma';
65
- const schema = (0, fs_1.readFileSync)(schemaPath, 'utf-8');
66
- const dmmf = await (0, sdk_1.getDMMF)({ datamodel: schema });
62
+ // Model definitions come from the consumer's generated Prisma client
63
+ // (Prisma.dmmf) — the same source of truth the generators use — so the
64
+ // backoffice neither re-parses the schema at runtime nor depends on
65
+ // @prisma/internals. @adminjs/prisma consumes these DMMF models natively.
66
+ const allModels = (0, utils_2.loadAllModels)();
67
67
  const models = [];
68
68
  for (const resource of adminConfig.resources) {
69
- const model = dmmf.datamodel.models.find((model) => model.name === resource.name);
69
+ const model = allModels.find((model) => model.name === resource.name);
70
70
  if (!model)
71
71
  continue;
72
72
  models.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appxdigital/appx-core",
3
- "version": "0.1.126",
3
+ "version": "0.1.127",
4
4
  "description": "Appx Core is a library that provides a set of tools to help you build your application faster.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -76,7 +76,6 @@
76
76
  "@paljs/plugins": "~8.1.0",
77
77
  "@paralleldrive/cuid2": "~2.2.2",
78
78
  "@prisma/client": "~6.5.0",
79
- "@prisma/sdk": "~3.15.2",
80
79
  "@types/bcrypt": "~5.0.2",
81
80
  "@types/express": "~5.0.0",
82
81
  "argon2": "~0.41.1",