"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/schematics/angular/web-worker/index.ts" between
angular-cli-12.0.3.tar.gz and angular-cli-12.0.4.tar.gz

About: Angular CLI is a command line interface for Angular.

index.ts  (angular-cli-12.0.3):index.ts  (angular-cli-12.0.4)
skipping to change at line 128 skipping to change at line 128
} }
const projectType = project.extensions['projectType']; const projectType = project.extensions['projectType'];
if (projectType !== 'application') { if (projectType !== 'application') {
throw new SchematicsException(`Web Worker requires a project type of "appl ication".`); throw new SchematicsException(`Web Worker requires a project type of "appl ication".`);
} }
const projectTarget = project.targets.get(options.target); const projectTarget = project.targets.get(options.target);
if (!projectTarget) { if (!projectTarget) {
throw new Error(`Target is not defined for this project.`); throw new Error(`Target is not defined for this project.`);
} }
const projectTargetOptions = ((projectTarget.options || const projectTargetOptions = (projectTarget.options || {}) as unknown as Bro
{}) as unknown) as BrowserBuilderOptions; wserBuilderOptions;
if (options.path === undefined) { if (options.path === undefined) {
options.path = buildDefaultPath(project); options.path = buildDefaultPath(project);
} }
const parsedPath = parseName(options.path, options.name); const parsedPath = parseName(options.path, options.name);
options.name = parsedPath.name; options.name = parsedPath.name;
options.path = parsedPath.path; options.path = parsedPath.path;
const root = project.root || ''; const root = project.root || '';
const needWebWorkerConfig = !projectTargetOptions.webWorkerTsConfig; const needWebWorkerConfig = !projectTargetOptions.webWorkerTsConfig;
if (needWebWorkerConfig) { if (needWebWorkerConfig) {
const workerConfigPath = join(normalize(root), 'tsconfig.worker.json'); const workerConfigPath = join(normalize(root), 'tsconfig.worker.json');
projectTargetOptions.webWorkerTsConfig = workerConfigPath; projectTargetOptions.webWorkerTsConfig = workerConfigPath;
} }
const projectTestTarget = project.targets.get('test');
if (projectTestTarget) {
const projectTestTargetOptions = (projectTestTarget.options ||
{}) as unknown as BrowserBuilderOptions;
const needWebWorkerConfig = !projectTestTargetOptions.webWorkerTsConfig;
if (needWebWorkerConfig) {
const workerConfigPath = join(normalize(root), 'tsconfig.worker.json');
projectTestTargetOptions.webWorkerTsConfig = workerConfigPath;
}
}
const templateSource = apply(url('./files/worker'), [ const templateSource = apply(url('./files/worker'), [
applyTemplates({ ...options, ...strings }), applyTemplates({ ...options, ...strings }),
move(parsedPath.path), move(parsedPath.path),
]); ]);
return chain([ return chain([
// Add project configuration. // Add project configuration.
needWebWorkerConfig ? addConfig(options, root, projectTargetOptions.tsConf ig) : noop(), needWebWorkerConfig ? addConfig(options, root, projectTargetOptions.tsConf ig) : noop(),
needWebWorkerConfig ? updateWorkspace(workspace) : noop(), needWebWorkerConfig ? updateWorkspace(workspace) : noop(),
// Create the worker in a sibling module. // Create the worker in a sibling module.
 End of changes. 2 change blocks. 
2 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)