@pegasusheavy/nestjs-prisma-graphql 1.0.0 → 1.0.2
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/dist/generate.js +4 -7
- package/dist/generate.js.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/package.json +23 -20
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import generatorHelper from '@prisma/generator-helper';
|
|
2
2
|
import { ok } from 'assert';
|
|
3
|
+
import { createRequire } from 'module';
|
|
3
4
|
import { memoize, mapKeys, merge, trim, castArray, uniqWith, isEqual, countBy, startCase, camelCase, keyBy, remove, partition, kebabCase, isObject, omit, cloneDeep } from 'lodash-es';
|
|
4
5
|
import { Project, QuoteKind, StructureKind } from 'ts-morph';
|
|
5
6
|
import JSON52 from 'json5';
|
|
@@ -11,12 +12,7 @@ import filenamify from 'filenamify';
|
|
|
11
12
|
import { unflatten } from 'flat';
|
|
12
13
|
import pluralize from 'pluralize';
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
16
|
-
}) : x)(function(x) {
|
|
17
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
18
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
19
|
-
});
|
|
15
|
+
// src/index.ts
|
|
20
16
|
|
|
21
17
|
// src/helpers/is-many-and-return.ts
|
|
22
18
|
function isManyAndReturnOutputType(name) {
|
|
@@ -2426,7 +2422,8 @@ var middleKeywords = [
|
|
|
2426
2422
|
];
|
|
2427
2423
|
|
|
2428
2424
|
// src/generate.ts
|
|
2429
|
-
var
|
|
2425
|
+
var requireCjs = createRequire(import.meta.url);
|
|
2426
|
+
var AwaitEventEmitter = requireCjs("await-event-emitter").default;
|
|
2430
2427
|
async function generate(args) {
|
|
2431
2428
|
const { connectCallback, dmmf, generator, skipAddOutputSourceFiles } = args;
|
|
2432
2429
|
const generatorOutputValue = generator.output?.value;
|
|
@@ -2564,6 +2561,7 @@ async function generate(args) {
|
|
|
2564
2561
|
}
|
|
2565
2562
|
|
|
2566
2563
|
// src/index.ts
|
|
2564
|
+
var { generatorHandler } = generatorHelper;
|
|
2567
2565
|
function isGeneratorDisabled(options, env = process.env) {
|
|
2568
2566
|
const envVarsToCheck = [
|
|
2569
2567
|
"DISABLE_NESTJS_PRISMA_GRAPHQL",
|
|
@@ -2581,7 +2579,7 @@ function isGeneratorDisabled(options, env = process.env) {
|
|
|
2581
2579
|
return true;
|
|
2582
2580
|
}
|
|
2583
2581
|
}
|
|
2584
|
-
const configDisabled = options.generator.config
|
|
2582
|
+
const configDisabled = options.generator.config.disabled;
|
|
2585
2583
|
if (configDisabled === "true" || configDisabled === "1" || configDisabled === "yes") {
|
|
2586
2584
|
return true;
|
|
2587
2585
|
}
|
|
@@ -2590,7 +2588,9 @@ function isGeneratorDisabled(options, env = process.env) {
|
|
|
2590
2588
|
generatorHandler({
|
|
2591
2589
|
async onGenerate(options) {
|
|
2592
2590
|
if (isGeneratorDisabled(options)) {
|
|
2593
|
-
console.log(
|
|
2591
|
+
console.log(
|
|
2592
|
+
"\u23ED\uFE0F nestjs-prisma-graphql: Generation skipped (disabled via environment variable or config)"
|
|
2593
|
+
);
|
|
2594
2594
|
return;
|
|
2595
2595
|
}
|
|
2596
2596
|
await generate(options);
|