mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 18:13:38 +08:00
fix(@schematics/angular): add additionalProperties
to all schemas
This commit is contained in:
parent
a09000cbe6
commit
ba6f546a02
@ -4,6 +4,7 @@
|
||||
"title": "Angular AppShell Options Schema",
|
||||
"type": "object",
|
||||
"description": "Generates an app shell for running a server-side version of an app.",
|
||||
"additionalProperties": false,
|
||||
"long-description": "./app-shell-long.md",
|
||||
"properties": {
|
||||
"clientProject": {
|
||||
|
@ -4,6 +4,7 @@
|
||||
"title": "Angular Application Options Schema",
|
||||
"type": "object",
|
||||
"description": "Generates a new basic app definition in the \"projects\" subfolder of the workspace.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"projectRoot": {
|
||||
"description": "The root directory of the new app.",
|
||||
|
@ -4,6 +4,7 @@
|
||||
"title": "Angular Class Options Schema",
|
||||
"type": "object",
|
||||
"description": "Creates a new generic class definition in the given or default project.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
|
@ -4,6 +4,7 @@
|
||||
"title": "Angular Component Options Schema",
|
||||
"type": "object",
|
||||
"description": "Creates a new generic component definition in the given or default project.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
|
@ -4,6 +4,7 @@
|
||||
"title": "Angular Directive Options Schema",
|
||||
"type": "object",
|
||||
"description": "Creates a new generic directive definition in the given or default project.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularE2eApp",
|
||||
"title": "Angular e2e Application Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Generates a new, generic end-to-end test definition for the given or default project.",
|
||||
"long-description": "e2e-long.md",
|
||||
"properties": {
|
||||
|
@ -4,6 +4,7 @@
|
||||
"title": "Angular Enum Options Schema",
|
||||
"type": "object",
|
||||
"description": "Generates a new, generic enum definition for the given or default project.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
|
@ -4,6 +4,7 @@
|
||||
"title": "Angular Guard Options Schema",
|
||||
"type": "object",
|
||||
"description": "Generates a new, generic route guard definition in the given or default project.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularInterceptor",
|
||||
"title": "Angular Interceptor Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Creates a new, generic interceptor definition in the given or default project.",
|
||||
"properties": {
|
||||
"name": {
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularInterface",
|
||||
"title": "Angular Interface Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Creates a new generic interface definition in the given or default project.",
|
||||
"properties": {
|
||||
"name": {
|
||||
|
@ -5,6 +5,7 @@
|
||||
"type": "object",
|
||||
"description": "Creates a new generic library project in the current workspace.",
|
||||
"long-description": "./library-long.md",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
|
@ -44,7 +44,6 @@ describe('Migration to version 9', () => {
|
||||
{
|
||||
name: 'migration-test',
|
||||
version: '1.2.3',
|
||||
directory: '.',
|
||||
},
|
||||
tree,
|
||||
)
|
||||
|
@ -29,7 +29,6 @@ describe('Migration to version 9', () => {
|
||||
{
|
||||
name: 'migration-test',
|
||||
version: '1.2.3',
|
||||
directory: '.',
|
||||
},
|
||||
tree,
|
||||
)
|
||||
|
@ -20,6 +20,7 @@ import {
|
||||
schematic,
|
||||
url,
|
||||
} from '@angular-devkit/schematics';
|
||||
import { Schema as ComponentOptions } from '../component/schema';
|
||||
import * as ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript';
|
||||
import { addImportToModule, addRouteDeclarationToModule } from '../utility/ast-utils';
|
||||
import { InsertChange } from '../utility/change';
|
||||
@ -167,15 +168,20 @@ export default function (options: ModuleOptions): Rule {
|
||||
const modulePath =
|
||||
`${!options.flat ? moduleDasherized + '/' : ''}${moduleDasherized}.module.ts`;
|
||||
|
||||
const componentOptions: ComponentOptions = {
|
||||
module: modulePath,
|
||||
flat: options.flat,
|
||||
name: options.name,
|
||||
path: options.path,
|
||||
project: options.project,
|
||||
};
|
||||
|
||||
return chain([
|
||||
!isLazyLoadedModuleGen ? addDeclarationToNgModule(options) : noop(),
|
||||
addRouteDeclarationToNgModule(options, routingModulePath),
|
||||
mergeWith(templateSource),
|
||||
isLazyLoadedModuleGen
|
||||
? schematic('component', {
|
||||
...options,
|
||||
module: modulePath,
|
||||
})
|
||||
? schematic('component', componentOptions)
|
||||
: noop(),
|
||||
options.lintFix ? applyLintFix(options.path) : noop(),
|
||||
]);
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularModule",
|
||||
"title": "Angular Module Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Creates a new generic NgModule definition in the given or default project.",
|
||||
"properties": {
|
||||
"name": {
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularNgNew",
|
||||
"title": "Angular Ng New Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"directory": {
|
||||
"type": "string",
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularPipe",
|
||||
"title": "Angular Pipe Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Creates a new generic pipe definition in the given or default project.",
|
||||
"properties": {
|
||||
"name": {
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularResolver",
|
||||
"title": "Angular resolver Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Generates a new, generic resolver definition in the given or default project.",
|
||||
"properties": {
|
||||
"name": {
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularServiceWorker",
|
||||
"title": "Angular Service Worker Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Pass this schematic to the \"run\" command to create a service worker",
|
||||
"properties": {
|
||||
"project": {
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularService",
|
||||
"title": "Angular Service Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Creates a new, generic service definition in the given or default project.",
|
||||
"properties": {
|
||||
"name": {
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularUniversalApp",
|
||||
"title": "Angular Universal App Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Pass this schematic to the \"run\" command to set up server-side rendering for an app.",
|
||||
"properties": {
|
||||
"clientProject": {
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularWebWorker",
|
||||
"title": "Angular Web Worker Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Creates a new generic web worker definition in the given or default project.",
|
||||
"properties": {
|
||||
"path": {
|
||||
|
@ -3,6 +3,7 @@
|
||||
"id": "SchematicsAngularWorkspace",
|
||||
"title": "Angular Workspace Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "The name of the workspace.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user