fix(nest): add missing resource generator option (#8310)

Co-authored-by: hoonoh <hoonoh@users.noreply.github.com>
This commit is contained in:
Hoon Oh 2022-01-14 00:15:50 +09:00 committed by GitHub
parent a7a7c55ff5
commit f30b8a318d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import type { Tree } from '@nrwl/devkit';
import { convertNxGenerator } from '@nrwl/devkit'; import { convertNxGenerator } from '@nrwl/devkit';
import type { import type {
NestGeneratorWithLanguageOption, NestGeneratorWithLanguageOption,
NestGeneratorWithResourceOption,
NestGeneratorWithTestOption, NestGeneratorWithTestOption,
NormalizedOptions, NormalizedOptions,
} from '../utils'; } from '../utils';
@ -12,7 +13,8 @@ import {
} from '../utils'; } from '../utils';
export type ResourceGeneratorOptions = NestGeneratorWithLanguageOption & export type ResourceGeneratorOptions = NestGeneratorWithLanguageOption &
NestGeneratorWithTestOption; NestGeneratorWithTestOption &
NestGeneratorWithResourceOption;
export function resourceGenerator( export function resourceGenerator(
tree: Tree, tree: Tree,

View File

@ -16,6 +16,12 @@ export type NestSchematic =
| 'resolver' | 'resolver'
| 'resource' | 'resource'
| 'service'; | 'service';
export type TransportLayer =
| 'rest'
| 'graphql-code-first'
| 'graphql-schema-first'
| 'microservice'
| 'ws';
export type NestGeneratorOptions = { export type NestGeneratorOptions = {
name: string; name: string;
@ -33,6 +39,11 @@ export type NestGeneratorWithTestOption = NestGeneratorOptions & {
unitTestRunner?: UnitTestRunner; unitTestRunner?: UnitTestRunner;
}; };
export type NestGeneratorWithResourceOption = NestGeneratorOptions & {
type?: TransportLayer;
crud?: boolean;
};
export type NormalizedOptions = { export type NormalizedOptions = {
name: string; name: string;
sourceRoot: string; sourceRoot: string;