Skip to content

fix(@schematics/angular): address vulnerability in protractor #17725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions packages/angular/cli/lib/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1645,11 +1645,6 @@
"type": "string",
"description": "Override suite in the protractor config."
},
"elementExplorer": {
"type": "boolean",
"description": "Start Protractor's Element Explorer for debugging.",
"default": false
},
"webdriverUpdate": {
"type": "boolean",
"description": "Try to update webdriver.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ interface JasmineNodeOpts {

function runProtractor(root: string, options: ProtractorBuilderOptions): Promise<BuilderOutput> {
const additionalProtractorConfig: Partial<ProtractorBuilderOptions> & Partial<JasmineNodeOpts> = {
elementExplorer: options.elementExplorer,
baseUrl: options.baseUrl,
specs: options.specs && options.specs.length ? options.specs : undefined,
suite: options.suite,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
"type": "string",
"description": "Override suite in the protractor config."
},
"elementExplorer": {
"type": "boolean",
"description": "Start Protractor's Element Explorer for debugging.",
"default": false
},
"webdriverUpdate": {
"type": "boolean",
"description": "Try to update webdriver.",
Expand Down
20 changes: 10 additions & 10 deletions packages/schematics/angular/migrations/migration-collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@
"factory": "./update-10/rename-browserslist-config",
"description": "Update Browserslist configurations to '.browserslistrc'."
},
"update-workspace-dependencies": {
"version": "10.0.0-beta.1",
"factory": "./update-10/update-dependencies",
"description": "Workspace dependencies updates."
},
"remove-es5-browser-support-option": {
"version": "10.0.0-beta.2",
"factory": "./update-10/remove-es5-browser-support",
Expand All @@ -80,11 +75,6 @@
"factory": "./update-9/schematic-options",
"description": "Replace deprecated 'styleext' and 'spec' Angular schematic options."
},
"update-angular-config": {
"version": "10.0.0-beta.3",
"factory": "./update-10/update-angular-config",
"description": "Remove various deprecated builders options from 'angular.json'."
},
"side-effects-package-json": {
"version": "10.0.0-beta.3",
"factory": "./update-10/side-effects-package-json",
Expand All @@ -94,6 +84,16 @@
"version": "10.0.0-beta.3",
"factory": "./update-10/update-module-and-target-compiler-options",
"description": "Update 'module' and 'target' TypeScript compiler options."
},
"update-workspace-dependencies": {
"version": "10.0.0-beta.6",
"factory": "./update-10/update-dependencies",
"description": "Workspace dependencies updates."
},
"update-angular-config": {
"version": "10.0.0-beta.6",
"factory": "./update-10/update-angular-config",
"description": "Remove various deprecated builders options from 'angular.json'."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ export default function (): Rule {
continue;
}

let extraOptionsToRemove = {};
let optionsToRemove: Record<string, undefined> = {
evalSourceMap: undefined,
skipAppShell: undefined,
profile: undefined,
elementExplorer: undefined,
};

if (target.builder === Builders.Server) {
extraOptionsToRemove = {
optionsToRemove = {
...optionsToRemove,
vendorChunk: undefined,
commonChunk: undefined,
};
Expand All @@ -43,10 +50,7 @@ export default function (): Rule {
if (target.options) {
target.options = {
...updateVendorSourceMap(target.options),
evalSourceMap: undefined,
skipAppShell: undefined,
profile: undefined,
...extraOptionsToRemove,
...optionsToRemove,
};
}

Expand All @@ -58,10 +62,7 @@ export default function (): Rule {
for (const configurationName of Object.keys(target.configurations)) {
target.configurations[configurationName] = {
...updateVendorSourceMap(target.configurations[configurationName]),
evalSourceMap: undefined,
skipAppShell: undefined,
profile: undefined,
...extraOptionsToRemove,
...optionsToRemove,
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function (): Rule {
return (host, context) => {
const dependenciesToUpdate: Record<string, string> = {
'karma': '~5.0.0',
'protractor': '~5.4.4',
'protractor': '~7.0.0',
'ng-packagr': latestVersions.ngPackagr,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.1.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",<% } %>
"protractor": "~7.0.0",<% } %>
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "<%= latestVersions.TypeScript %>"
Expand Down
7 changes: 0 additions & 7 deletions tests/legacy-cli/e2e/tests/basic/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ export default function () {
},
`, `allScriptsTimeout: 11000,`
))
// Should start up Element Explorer
.then(() => execAndWaitForOutputToMatch('ng', ['e2e', 'test-project', '--element-explorer'],
/Element Explorer/))
.then(() => killAllProcesses(), (err: any) => {
killAllProcesses();
throw err;
})
// Should run side-by-side with `ng serve`
.then(() => execAndWaitForOutputToMatch('ng', ['serve'],
/: Compiled successfully./))
Expand Down