@tsed/prisma 6.114.14 → 6.114.17

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.
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createProjectFixture = void 0;
4
- const ts_morph_1 = require("ts-morph");
5
- const fs_extra_1 = require("fs-extra");
6
4
  const path_1 = require("path");
7
- const fs_1 = require("fs");
5
+ const ts_morph_1 = require("ts-morph");
8
6
  const SNAPSHOT_DIR = `${__dirname}/../../test/snapshots`;
9
7
  function createProjectFixture(dir = "/") {
10
8
  const baseDir = (0, path_1.join)(SNAPSHOT_DIR, dir);
@@ -28,15 +26,10 @@ function createProjectFixture(dir = "/") {
28
26
  }
29
27
  sourceFile.formatText({ indentSize: 2 });
30
28
  const actualValue = sourceFile.getFullText();
31
- if (!(0, fs_extra_1.existsSync)(absolutePath)) {
32
- (0, fs_extra_1.ensureDirSync)((0, path_1.dirname)(absolutePath));
33
- (0, fs_1.writeFileSync)(absolutePath, actualValue, { encoding: "utf8" });
34
- }
35
- const expectedValue = (0, fs_1.readFileSync)(absolutePath, { encoding: "utf8" });
36
29
  return {
37
30
  ...expect(actualValue),
38
- toEqualSnapshot() {
39
- expect(actualValue).toEqual(expectedValue);
31
+ toMatchSnapshot() {
32
+ expect(actualValue).toMatchSnapshot();
40
33
  }
41
34
  };
42
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createProjectFixture.js","sourceRoot":"","sources":["../../../src/__mock__/createProjectFixture.ts"],"names":[],"mappings":";;;AAAA,uCAA2D;AAC3D,uCAAmD;AACnD,+BAAmC;AACnC,2BAA+C;AAE/C,MAAM,YAAY,GAAG,GAAG,SAAS,uBAAuB,CAAC;AAEzD,SAAgB,oBAAoB,CAAC,GAAG,GAAG,GAAG;IAC5C,MAAM,OAAO,GAAG,IAAA,WAAI,EAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IACxC,MAAM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\";\nimport {dirname, join} from \"path\";\nimport {readFileSync, writeFileSync} from \"fs\";\n\nconst SNAPSHOT_DIR = `${__dirname}/../../test/snapshots`;\n\nexport function createProjectFixture(dir = \"/\") {\n const baseDir = join(SNAPSHOT_DIR, dir);\n const project = new Project({\n compilerOptions: {\n target: ScriptTarget.ES2019,\n module: ModuleKind.CommonJS,\n emitDecoratorMetadata: true,\n experimentalDecorators: true,\n esModuleInterop: true\n }\n });\n\n return {\n project,\n baseDir,\n render(file: string) {\n const absolutePath = join(baseDir, file);\n const sourceFile = project.getSourceFile(absolutePath);\n\n if (!sourceFile) {\n throw `File not found: ${file}`;\n }\n\n sourceFile.formatText({indentSize: 2});\n const actualValue = sourceFile.getFullText();\n\n if (!existsSync(absolutePath)) {\n ensureDirSync(dirname(absolutePath));\n writeFileSync(absolutePath, actualValue, {encoding: \"utf8\"});\n }\n\n const expectedValue = readFileSync(absolutePath, {encoding: \"utf8\"});\n\n return {\n ...expect(actualValue),\n toEqualSnapshot() {\n expect(actualValue).toEqual(expectedValue);\n }\n };\n }\n };\n}\n"]}
1
+ {"version":3,"file":"createProjectFixture.js","sourceRoot":"","sources":["../../../src/__mock__/createProjectFixture.ts"],"names":[],"mappings":";;;AAAA,+BAA0B;AAC1B,uCAA2D;AAE3D,MAAM,YAAY,GAAG,GAAG,SAAS,uBAAuB,CAAC;AAEzD,SAAgB,oBAAoB,CAAC,GAAG,GAAG,GAAG;IAC5C,MAAM,OAAO,GAAG,IAAA,WAAI,EAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,IAAI,kBAAO,CAAC;QAC1B,eAAe,EAAE;YACf,MAAM,EAAE,uBAAY,CAAC,MAAM;YAC3B,MAAM,EAAE,qBAAU,CAAC,QAAQ;YAC3B,qBAAqB,EAAE,IAAI;YAC3B,sBAAsB,EAAE,IAAI;YAC5B,eAAe,EAAE,IAAI;SACtB;KACF,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,OAAO;QACP,MAAM,CAAC,IAAY;YACjB,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;YAEvD,IAAI,CAAC,UAAU,EAAE;gBACf,MAAM,mBAAmB,IAAI,EAAE,CAAC;aACjC;YAED,UAAU,CAAC,UAAU,CAAC,EAAC,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;YACvC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;YAE7C,OAAO;gBACL,GAAG,MAAM,CAAC,WAAW,CAAC;gBACtB,eAAe;oBACb,MAAM,CAAC,WAAW,CAAC,CAAC,eAAe,EAAE,CAAC;gBACxC,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAlCD,oDAkCC","sourcesContent":["import {join} from \"path\";\nimport {ModuleKind, Project, ScriptTarget} from \"ts-morph\";\n\nconst SNAPSHOT_DIR = `${__dirname}/../../test/snapshots`;\n\nexport function createProjectFixture(dir = \"/\") {\n const baseDir = join(SNAPSHOT_DIR, dir);\n const project = new Project({\n compilerOptions: {\n target: ScriptTarget.ES2019,\n module: ModuleKind.CommonJS,\n emitDecoratorMetadata: true,\n experimentalDecorators: true,\n esModuleInterop: true\n }\n });\n\n return {\n project,\n baseDir,\n render(file: string) {\n const absolutePath = join(baseDir, file);\n const sourceFile = project.getSourceFile(absolutePath);\n\n if (!sourceFile) {\n throw `File not found: ${file}`;\n }\n\n sourceFile.formatText({indentSize: 2});\n const actualValue = sourceFile.getFullText();\n\n return {\n ...expect(actualValue),\n toMatchSnapshot() {\n expect(actualValue).toMatchSnapshot();\n }\n };\n }\n };\n}\n"]}
@@ -1,7 +1,5 @@
1
+ import { join } from "path";
1
2
  import { ModuleKind, Project, ScriptTarget } from "ts-morph";
2
- import { ensureDirSync, existsSync } from "fs-extra";
3
- import { dirname, join } from "path";
4
- import { readFileSync, writeFileSync } from "fs";
5
3
  const SNAPSHOT_DIR = `${__dirname}/../../test/snapshots`;
6
4
  export function createProjectFixture(dir = "/") {
7
5
  const baseDir = join(SNAPSHOT_DIR, dir);
@@ -25,15 +23,10 @@ export function createProjectFixture(dir = "/") {
25
23
  }
26
24
  sourceFile.formatText({ indentSize: 2 });
27
25
  const actualValue = sourceFile.getFullText();
28
- if (!existsSync(absolutePath)) {
29
- ensureDirSync(dirname(absolutePath));
30
- writeFileSync(absolutePath, actualValue, { encoding: "utf8" });
31
- }
32
- const expectedValue = readFileSync(absolutePath, { encoding: "utf8" });
33
26
  return {
34
27
  ...expect(actualValue),
35
- toEqualSnapshot() {
36
- expect(actualValue).toEqual(expectedValue);
28
+ toMatchSnapshot() {
29
+ expect(actualValue).toMatchSnapshot();
37
30
  }
38
31
  };
39
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createProjectFixture.js","sourceRoot":"","sources":["../../../src/__mock__/createProjectFixture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AACnD,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,MAAM,CAAC;AACnC,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,IAAI,CAAC;AAE/C,MAAM,YAAY,GAAG,GAAG,SAAS,uBAAuB,CAAC;AAEzD,MAAM,UAAU,oBAAoB,CAAC,GAAG,GAAG,GAAG;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;QAC1B,eAAe,EAAE;YACf,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,MAAM,EAAE,UAAU,CAAC,QAAQ;YAC3B,qBAAqB,EAAE,IAAI;YAC3B,sBAAsB,EAAE,IAAI;YAC5B,eAAe,EAAE,IAAI;SACtB;KACF,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,OAAO;QACP,MAAM,CAAC,IAAY;YACjB,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;YAEvD,IAAI,CAAC,UAAU,EAAE;gBACf,MAAM,mBAAmB,IAAI,EAAE,CAAC;aACjC;YAED,UAAU,CAAC,UAAU,CAAC,EAAC,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;YACvC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;YAE7C,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;gBAC7B,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;gBACrC,aAAa,CAAC,YAAY,EAAE,WAAW,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAAC;aAC9D;YAED,MAAM,aAAa,GAAG,YAAY,CAAC,YAAY,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAAC;YAErE,OAAO;gBACL,GAAG,MAAM,CAAC,WAAW,CAAC;gBACtB,eAAe;oBACb,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;gBAC7C,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {ModuleKind, Project, ScriptTarget} from \"ts-morph\";\nimport {ensureDirSync, existsSync} from \"fs-extra\";\nimport {dirname, join} from \"path\";\nimport {readFileSync, writeFileSync} from \"fs\";\n\nconst SNAPSHOT_DIR = `${__dirname}/../../test/snapshots`;\n\nexport function createProjectFixture(dir = \"/\") {\n const baseDir = join(SNAPSHOT_DIR, dir);\n const project = new Project({\n compilerOptions: {\n target: ScriptTarget.ES2019,\n module: ModuleKind.CommonJS,\n emitDecoratorMetadata: true,\n experimentalDecorators: true,\n esModuleInterop: true\n }\n });\n\n return {\n project,\n baseDir,\n render(file: string) {\n const absolutePath = join(baseDir, file);\n const sourceFile = project.getSourceFile(absolutePath);\n\n if (!sourceFile) {\n throw `File not found: ${file}`;\n }\n\n sourceFile.formatText({indentSize: 2});\n const actualValue = sourceFile.getFullText();\n\n if (!existsSync(absolutePath)) {\n ensureDirSync(dirname(absolutePath));\n writeFileSync(absolutePath, actualValue, {encoding: \"utf8\"});\n }\n\n const expectedValue = readFileSync(absolutePath, {encoding: \"utf8\"});\n\n return {\n ...expect(actualValue),\n toEqualSnapshot() {\n expect(actualValue).toEqual(expectedValue);\n }\n };\n }\n };\n}\n"]}
1
+ {"version":3,"file":"createProjectFixture.js","sourceRoot":"","sources":["../../../src/__mock__/createProjectFixture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;AAE3D,MAAM,YAAY,GAAG,GAAG,SAAS,uBAAuB,CAAC;AAEzD,MAAM,UAAU,oBAAoB,CAAC,GAAG,GAAG,GAAG;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;QAC1B,eAAe,EAAE;YACf,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,MAAM,EAAE,UAAU,CAAC,QAAQ;YAC3B,qBAAqB,EAAE,IAAI;YAC3B,sBAAsB,EAAE,IAAI;YAC5B,eAAe,EAAE,IAAI;SACtB;KACF,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,OAAO;QACP,MAAM,CAAC,IAAY;YACjB,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;YAEvD,IAAI,CAAC,UAAU,EAAE;gBACf,MAAM,mBAAmB,IAAI,EAAE,CAAC;aACjC;YAED,UAAU,CAAC,UAAU,CAAC,EAAC,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;YACvC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;YAE7C,OAAO;gBACL,GAAG,MAAM,CAAC,WAAW,CAAC;gBACtB,eAAe;oBACb,MAAM,CAAC,WAAW,CAAC,CAAC,eAAe,EAAE,CAAC;gBACxC,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {join} from \"path\";\nimport {ModuleKind, Project, ScriptTarget} from \"ts-morph\";\n\nconst SNAPSHOT_DIR = `${__dirname}/../../test/snapshots`;\n\nexport function createProjectFixture(dir = \"/\") {\n const baseDir = join(SNAPSHOT_DIR, dir);\n const project = new Project({\n compilerOptions: {\n target: ScriptTarget.ES2019,\n module: ModuleKind.CommonJS,\n emitDecoratorMetadata: true,\n experimentalDecorators: true,\n esModuleInterop: true\n }\n });\n\n return {\n project,\n baseDir,\n render(file: string) {\n const absolutePath = join(baseDir, file);\n const sourceFile = project.getSourceFile(absolutePath);\n\n if (!sourceFile) {\n throw `File not found: ${file}`;\n }\n\n sourceFile.formatText({indentSize: 2});\n const actualValue = sourceFile.getFullText();\n\n return {\n ...expect(actualValue),\n toMatchSnapshot() {\n expect(actualValue).toMatchSnapshot();\n }\n };\n }\n };\n}\n"]}
@@ -4,7 +4,7 @@ export declare function createProjectFixture(dir?: string): {
4
4
  project: Project;
5
5
  baseDir: string;
6
6
  render(file: string): {
7
- toEqualSnapshot(): void;
7
+ toMatchSnapshot(): void;
8
8
  resolves: jest.AndNot<jest.Matchers<Promise<void>, string>>;
9
9
  rejects: jest.AndNot<jest.Matchers<Promise<void>, string>>;
10
10
  lastCalledWith<E extends any[]>(...args: E): void;
@@ -44,9 +44,7 @@ export declare function createProjectFixture(dir?: string): {
44
44
  toHaveReturnedWith<E_16 = any>(expected: E_16): void;
45
45
  toMatch(expected: string | RegExp): void;
46
46
  toMatchObject<E_17 extends {} | any[]>(expected: E_17): void;
47
- toMatchSnapshot<U extends string>(propertyMatchers: Partial<U>, snapshotName?: string | undefined): void;
48
- toMatchSnapshot(snapshotName?: string | undefined): void;
49
- toMatchInlineSnapshot<U_1 extends string>(propertyMatchers: Partial<U_1>, snapshot?: string | undefined): void;
47
+ toMatchInlineSnapshot<U extends string>(propertyMatchers: Partial<U>, snapshot?: string | undefined): void;
50
48
  toMatchInlineSnapshot(snapshot?: string | undefined): void;
51
49
  toReturn(): void;
52
50
  toReturnTimes(count: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/prisma",
3
- "version": "6.114.14",
3
+ "version": "6.114.17",
4
4
  "description": "Generate Ts.ED JsonSchema based on Prisma models",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/cjs/index.js",
@@ -29,24 +29,24 @@
29
29
  "change-case": "^4.1.2",
30
30
  "pluralize": "^8.0.0",
31
31
  "ts-morph": "^12.0.0",
32
- "tslib": "^2.3.1"
32
+ "tslib": "2.4.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@prisma/client": "^3.10.0",
36
- "@tsed/core": "6.114.14",
37
- "@tsed/di": "6.114.14",
38
- "@tsed/json-mapper": "6.114.14",
39
- "@tsed/schema": "6.114.14",
36
+ "@tsed/core": "6.114.17",
37
+ "@tsed/di": "6.114.17",
38
+ "@tsed/json-mapper": "6.114.17",
39
+ "@tsed/schema": "6.114.17",
40
40
  "@types/change-case": "^2.3.1",
41
41
  "@types/pluralize": "0.0.29",
42
42
  "prisma": "^3.10.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@prisma/client": "^2 || ^3",
46
- "@tsed/core": "^6.114.14",
47
- "@tsed/di": "^6.114.14",
48
- "@tsed/json-mapper": "^6.114.14",
49
- "@tsed/schema": "^6.114.14"
46
+ "@tsed/core": "^6.114.17",
47
+ "@tsed/di": "^6.114.17",
48
+ "@tsed/json-mapper": "^6.114.17",
49
+ "@tsed/schema": "^6.114.17"
50
50
  },
51
51
  "keywords": [
52
52
  "TypeScript",