@zenstackhq/sdk 2.6.1 → 2.7.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/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +5 -5
- package/path.d.ts +4 -0
- package/path.js +15 -0
- package/path.js.map +1 -0
- package/prisma.js +2 -2
- package/prisma.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './code-gen';
|
|
|
2
2
|
export * from './constants';
|
|
3
3
|
export { generate as generateModelMeta } from './model-meta-generator';
|
|
4
4
|
export * from './names';
|
|
5
|
+
export * from './path';
|
|
5
6
|
export * from './policy';
|
|
6
7
|
export * from './types';
|
|
7
8
|
export * from './typescript-expression-transformer';
|
package/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __exportStar(require("./constants"), exports);
|
|
|
20
20
|
var model_meta_generator_1 = require("./model-meta-generator");
|
|
21
21
|
Object.defineProperty(exports, "generateModelMeta", { enumerable: true, get: function () { return model_meta_generator_1.generate; } });
|
|
22
22
|
__exportStar(require("./names"), exports);
|
|
23
|
+
__exportStar(require("./path"), exports);
|
|
23
24
|
__exportStar(require("./policy"), exports);
|
|
24
25
|
__exportStar(require("./types"), exports);
|
|
25
26
|
__exportStar(require("./typescript-expression-transformer"), exports);
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,+DAAuE;AAA9D,yHAAA,QAAQ,OAAqB;AACtC,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,sEAAoD;AACpD,0CAAwB;AACxB,+CAA6B;AAC7B,0DAAwC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,+DAAuE;AAA9D,yHAAA,QAAQ,OAAqB;AACtC,0CAAwB;AACxB,yCAAuB;AACvB,2CAAyB;AACzB,0CAAwB;AACxB,sEAAoD;AACpD,0CAAwB;AACxB,+CAA6B;AAC7B,0DAAwC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenstackhq/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "ZenStack plugin development SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@prisma/generator-helper": "5.
|
|
15
|
-
"@prisma/internals": "5.
|
|
14
|
+
"@prisma/generator-helper": "5.21.x",
|
|
15
|
+
"@prisma/internals": "5.21.x",
|
|
16
16
|
"langium": "1.3.1",
|
|
17
17
|
"lower-case-first": "^2.0.2",
|
|
18
18
|
"semver": "^7.5.2",
|
|
19
19
|
"ts-morph": "^16.0.0",
|
|
20
20
|
"ts-pattern": "^4.3.0",
|
|
21
21
|
"upper-case-first": "^2.0.2",
|
|
22
|
-
"@zenstackhq/language": "2.
|
|
23
|
-
"@zenstackhq/runtime": "2.
|
|
22
|
+
"@zenstackhq/language": "2.7.0",
|
|
23
|
+
"@zenstackhq/runtime": "2.7.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/semver": "^7.3.13"
|
package/path.d.ts
ADDED
package/path.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.normalizedRelative = normalizedRelative;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
/**
|
|
9
|
+
* Gets the relative path from `from` to `to` and normalizes it to start it with `./`
|
|
10
|
+
*/
|
|
11
|
+
function normalizedRelative(from, to) {
|
|
12
|
+
const result = path_1.default.relative(from, to);
|
|
13
|
+
return result.startsWith('.') ? result : `./${result}`;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=path.js.map
|
package/path.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":";;;;;AAKA,gDAGC;AARD,gDAAwB;AAExB;;GAEG;AACH,SAAgB,kBAAkB,CAAC,IAAY,EAAE,EAAU;IACvD,MAAM,MAAM,GAAG,cAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;AAC3D,CAAC"}
|
package/prisma.js
CHANGED
|
@@ -14,6 +14,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
14
14
|
const semver_1 = __importDefault(require("semver"));
|
|
15
15
|
const constants_1 = require("./constants");
|
|
16
16
|
const utils_1 = require("./utils");
|
|
17
|
+
const path_2 = require("./path");
|
|
17
18
|
/**
|
|
18
19
|
* Given an import context directory and plugin options, compute the import spec for the Prisma Client.
|
|
19
20
|
*/
|
|
@@ -32,10 +33,9 @@ function getPrismaClientImportSpec(importingFromDir, options) {
|
|
|
32
33
|
// resolve absolute path based on the zmodel file location
|
|
33
34
|
const resolvedPrismaClientOutput = path_1.default.resolve(path_1.default.dirname(options.schemaPath), options.prismaClientPath);
|
|
34
35
|
// translate to path relative to the importing context directory
|
|
35
|
-
let result =
|
|
36
|
+
let result = (0, path_2.normalizedRelative)(importingFromDir, resolvedPrismaClientOutput);
|
|
36
37
|
// remove leading `node_modules` (which may be provided by the user)
|
|
37
38
|
result = result.replace(/^([./\\]*)?node_modules\//, '');
|
|
38
|
-
// compute prisma client absolute output dir relative to the importing file
|
|
39
39
|
return normalizePath(result);
|
|
40
40
|
}
|
|
41
41
|
function normalizePath(p) {
|
package/prisma.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.js","sourceRoot":"","sources":["../src/prisma.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;
|
|
1
|
+
{"version":3,"file":"prisma.js","sourceRoot":"","sources":["../src/prisma.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;AAgBvD,8DA2BC;AASD,0BAEC;AAKD,4CAmBC;AAKD,8CAKC;AArFD,iDAA6E;AAC7E,iDAAgE;AAChE,gDAAwB;AACxB,oDAA4B;AAE5B,2CAA8C;AAE9C,mCAAgD;AAChD,iCAA4C;AAE5C;;GAEG;AACH,SAAgB,yBAAyB,CAAC,gBAAwB,EAAE,OAAsB;IACtF,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,KAAK,gBAAgB,EAAE,CAAC;QAC7E,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,IACI,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,2BAAe,CAAC;QACpD,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,mCAAyB,CAAC,EAChE,CAAC;QACC,OAAO,OAAO,CAAC,gBAAgB,CAAC;IACpC,CAAC;IAED,IAAI,cAAI,CAAC,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC5C,gBAAgB;QAChB,OAAO,OAAO,CAAC,gBAAgB,CAAC;IACpC,CAAC;IAED,0DAA0D;IAC1D,MAAM,0BAA0B,GAAG,cAAI,CAAC,OAAO,CAAC,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,gBA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