From ee3be89ed11df3fe0b23a44a477b0e44b1a16acb Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 26 Nov 2019 09:17:09 +0100 Subject: [PATCH] fix(@angular-devkit/build-angular): add pattern validations for `browserTarget` and `serverTarget` --- .../angular_devkit/build_angular/src/app-shell/schema.json | 6 ++++-- .../angular_devkit/build_angular/src/dev-server/schema.json | 2 +- .../build_angular/src/extract-i18n/schema.json | 3 ++- .../angular_devkit/build_angular/src/protractor/schema.json | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/angular_devkit/build_angular/src/app-shell/schema.json b/packages/angular_devkit/build_angular/src/app-shell/schema.json index e7fb6156d47f..b89b795265ab 100644 --- a/packages/angular_devkit/build_angular/src/app-shell/schema.json +++ b/packages/angular_devkit/build_angular/src/app-shell/schema.json @@ -6,11 +6,13 @@ "properties": { "browserTarget": { "type": "string", - "description": "Target to build." + "description": "Target to build.", + "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$" }, "serverTarget": { "type": "string", - "description": "Server target to use for rendering the app shell." + "description": "Server target to use for rendering the app shell.", + "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$" }, "appModuleBundle": { "type": "string", diff --git a/packages/angular_devkit/build_angular/src/dev-server/schema.json b/packages/angular_devkit/build_angular/src/dev-server/schema.json index ff1623b9d55b..8901b27cc9b8 100644 --- a/packages/angular_devkit/build_angular/src/dev-server/schema.json +++ b/packages/angular_devkit/build_angular/src/dev-server/schema.json @@ -7,7 +7,7 @@ "browserTarget": { "type": "string", "description": "Target to serve.", - "pattern": ".+:.+(:.+)?" + "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$" }, "port": { "type": "number", diff --git a/packages/angular_devkit/build_angular/src/extract-i18n/schema.json b/packages/angular_devkit/build_angular/src/extract-i18n/schema.json index 3212818ff580..2d9d89c170be 100644 --- a/packages/angular_devkit/build_angular/src/extract-i18n/schema.json +++ b/packages/angular_devkit/build_angular/src/extract-i18n/schema.json @@ -6,7 +6,8 @@ "properties": { "browserTarget": { "type": "string", - "description": "Target to extract from." + "description": "Target to extract from.", + "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$" }, "format": { "type": "string", diff --git a/packages/angular_devkit/build_angular/src/protractor/schema.json b/packages/angular_devkit/build_angular/src/protractor/schema.json index 0da1ccc1dff8..9eeb1c22a557 100644 --- a/packages/angular_devkit/build_angular/src/protractor/schema.json +++ b/packages/angular_devkit/build_angular/src/protractor/schema.json @@ -10,7 +10,8 @@ }, "devServerTarget": { "type": "string", - "description": "Dev server target to run tests against." + "description": "Dev server target to run tests against.", + "pattern": "^([^:\\s]+:[^:\\s]+(:[^\\s]+)?)?$" }, "specs": { "type": "array",