@nestjs/schematics
Advanced tools
Comparing version 7.2.10-next.1 to 7.3.0
@@ -1,2 +0,2 @@ | ||
import { PartialType } from '@nestjs/mapped-types'; | ||
<% if (isSwaggerInstalled) { %>import { PartialType } from '@nestjs/swagger';<% } else { %>import { PartialType } from '@nestjs/mapped-types';<% } %> | ||
import { Create<%= singular(classify(name)) %>Dto } from './create-<%= singular(name) %>.dto'; | ||
@@ -3,0 +3,0 @@ |
@@ -9,3 +9,3 @@ import { Create<%= singular(classify(name)) %>Input } from './create-<%= singular(name) %>.input';<% if (type === 'graphql-code-first') { %> | ||
}<% } else { %> | ||
import { PartialType } from '@nestjs/graphql'; | ||
import { PartialType } from '@nestjs/mapped-types'; | ||
@@ -12,0 +12,0 @@ export class Update<%= singular(classify(name)) %>Input extends PartialType(Create<%= singular(classify(name)) %>Input) { |
@@ -12,2 +12,3 @@ "use strict"; | ||
const dependencies_utils_1 = require("../../utils/dependencies.utils"); | ||
const tasks_1 = require("@angular-devkit/schematics/tasks"); | ||
function main(options) { | ||
@@ -17,4 +18,4 @@ options = transform(options); | ||
return schematics_1.branchAndMerge(schematics_1.chain([ | ||
addMappedTypesDependencyIfApplies(options), | ||
source_root_helpers_1.mergeSourceRoot(options), | ||
addMappedTypesDependencyIfApplies(options), | ||
addDeclarationToModule(options), | ||
@@ -27,2 +28,3 @@ schematics_1.mergeWith(generate(options)), | ||
function transform(options) { | ||
var _a; | ||
const target = Object.assign({}, options); | ||
@@ -43,2 +45,3 @@ if (!target.name) { | ||
: core_1.join(target.path, target.name); | ||
target.isSwaggerInstalled = (_a = options.isSwaggerInstalled) !== null && _a !== void 0 ? _a : false; | ||
return target; | ||
@@ -106,6 +109,5 @@ } | ||
function addMappedTypesDependencyIfApplies(options) { | ||
return (host) => { | ||
return (host, context) => { | ||
try { | ||
if (options.type === 'graphql-code-first' || | ||
options.type === 'graphql-schema-first') { | ||
if (options.type === 'graphql-code-first') { | ||
return; | ||
@@ -116,10 +118,15 @@ } | ||
if (nodeDependencyRef) { | ||
options.isSwaggerInstalled = true; | ||
return; | ||
} | ||
} | ||
dependencies_utils_1.addPackageJsonDependency(host, { | ||
type: dependencies_utils_1.NodeDependencyType.Default, | ||
name: '@nestjs/mapped-types', | ||
version: '*', | ||
}); | ||
const nodeDependencyRef = dependencies_utils_1.getPackageJsonDependency(host, '@nestjs/mapped-types'); | ||
if (!nodeDependencyRef) { | ||
dependencies_utils_1.addPackageJsonDependency(host, { | ||
type: dependencies_utils_1.NodeDependencyType.Default, | ||
name: '@nestjs/mapped-types', | ||
version: '*', | ||
}); | ||
context.addTask(new tasks_1.NodePackageInstallTask()); | ||
} | ||
} | ||
@@ -126,0 +133,0 @@ catch (err) { |
{ | ||
"name": "@nestjs/schematics", | ||
"version": "7.2.10-next.1", | ||
"version": "7.3.0", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@schematics)", | ||
@@ -54,3 +54,3 @@ "main": "dist/index.js", | ||
"@types/jest": "26.0.20", | ||
"@types/node": "14.14.32", | ||
"@types/node": "14.14.33", | ||
"@typescript-eslint/eslint-plugin": "4.17.0", | ||
@@ -57,0 +57,0 @@ "@typescript-eslint/parser": "4.17.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
185415
4311
0