vsrepo 1.1.7 → 1.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vsrepo",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Uma biblioteca de repository pattern para Prisma",
5
5
  "homepage": "https://github.com/jaobrabo123/VSRepository#readme",
6
6
  "repository": {
@@ -54,7 +54,9 @@ if (prismaArg.startsWith('-')) {
54
54
 
55
55
  const outputDir = path.resolve(workspaceRoot, outputArg);
56
56
 
57
- const prismaTargetPath = stripKnownExtension(
57
+ const CLASSIC_PRISMA_GENERATED_PATH = "@prisma/client";
58
+
59
+ const prismaTargetPath = prismaArg === CLASSIC_PRISMA_GENERATED_PATH ? prismaArg : stripKnownExtension(
58
60
  path.resolve(workspaceRoot, prismaArg, prismaArg.endsWith('client') ? '' : 'client')
59
61
  );
60
62
 
@@ -97,7 +99,7 @@ for (const fileName of typeFiles) {
97
99
 
98
100
  contents = contents.replace(
99
101
  /from\s+(['"])@vsrepo\/prisma\/types\1/g,
100
- `from '${relativeImportPath(path.dirname(targetFile), prismaTargetPath)}'`
102
+ `from '${prismaTargetPath === CLASSIC_PRISMA_GENERATED_PATH ? prismaTargetPath : relativeImportPath(path.dirname(targetFile), prismaTargetPath)}'`
101
103
  );
102
104
 
103
105
  fs.writeFileSync(targetFile, GENERATED_HEADER + contents, 'utf8');