"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/cdk/schematics/utils/build-component.ts" between
material2-7.3.2.tar.gz and material2-7.3.3.tar.gz

About: material2 offers Material Design components for Angular.

build-component.ts  (material2-7.3.2):build-component.ts  (material2-7.3.3)
skipping to change at line 43 skipping to change at line 43
import {buildRelativePath, findModuleFromOptions} from '@schematics/angular/util ity/find-module'; import {buildRelativePath, findModuleFromOptions} from '@schematics/angular/util ity/find-module';
import {parseName} from '@schematics/angular/utility/parse-name'; import {parseName} from '@schematics/angular/utility/parse-name';
import {buildDefaultPath} from '@schematics/angular/utility/project'; import {buildDefaultPath} from '@schematics/angular/utility/project';
import {validateHtmlSelector, validateName} from '@schematics/angular/utility/va lidation'; import {validateHtmlSelector, validateName} from '@schematics/angular/utility/va lidation';
import {readFileSync, statSync} from 'fs'; import {readFileSync, statSync} from 'fs';
import {dirname, join, resolve} from 'path'; import {dirname, join, resolve} from 'path';
import {getProjectFromWorkspace} from './get-project'; import {getProjectFromWorkspace} from './get-project';
import {getDefaultComponentOptions} from './schematic-options'; import {getDefaultComponentOptions} from './schematic-options';
import {ts} from './version-agnostic-typescript'; import {ts} from './version-agnostic-typescript';
/**
* List of style extensions which are CSS compatible. All supported CLI style ex
tensions can be
* found here: angular/angular-cli/master/packages/schematics/angular/ng-new/sch
ema.json#L118-L122
*/
const supportedCssExtensions = ['css', 'scss', 'less'];
function readIntoSourceFile(host: Tree, modulePath: string) { function readIntoSourceFile(host: Tree, modulePath: string) {
const text = host.read(modulePath); const text = host.read(modulePath);
if (text === null) { if (text === null) {
throw new SchematicsException(`File ${modulePath} does not exist.`); throw new SchematicsException(`File ${modulePath} does not exist.`);
} }
return ts.createSourceFile(modulePath, text.toString('utf-8'), ts.ScriptTarget .Latest, true); return ts.createSourceFile(modulePath, text.toString('utf-8'), ts.ScriptTarget .Latest, true);
} }
function addDeclarationToNgModule(options: ComponentOptions): Rule { function addDeclarationToNgModule(options: ComponentOptions): Rule {
skipping to change at line 196 skipping to change at line 202
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;
options.selector = options.selector || buildSelector(options, project.prefix ); options.selector = options.selector || buildSelector(options, project.prefix );
validateName(options.name); validateName(options.name);
validateHtmlSelector(options.selector!); validateHtmlSelector(options.selector!);
// In case the specified style extension is not part of the supported CSS su
persets,
// we generate the stylesheets with the "css" extension. This ensures that w
e don't
// accidentally generate invalid stylesheets (e.g. drag-drop-comp.styl) whic
h will
// break the Angular CLI project. See: https://github.com/angular/material2/
issues/15164
if (!supportedCssExtensions.includes(options.styleext!)) {
options.styleext = 'css';
}
// Object that will be used as context for the EJS templates. // Object that will be used as context for the EJS templates.
const baseTemplateContext = { const baseTemplateContext = {
...strings, ...strings,
'if-flat': (s: string) => options.flat ? '' : s, 'if-flat': (s: string) => options.flat ? '' : s,
...options, ...options,
}; };
// Key-value object that includes the specified additional files with their loaded content. // Key-value object that includes the specified additional files with their loaded content.
// The resolved contents can be used inside EJS templates. // The resolved contents can be used inside EJS templates.
const resolvedFiles = {}; const resolvedFiles = {};
 End of changes. 2 change blocks. 
0 lines changed or deleted 20 lines changed or added

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