Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Conversation

@Brocco
Copy link
Contributor

@Brocco Brocco commented Jul 5, 2017

Utilize module schematic for app module
Utilize component schematic for app root component

@Brocco Brocco requested a review from hansl July 5, 2017 20:10
@Brocco Brocco force-pushed the ng-schematics-app branch from 837a97e to c7e0c48 Compare July 5, 2017 20:17
Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good start.

import * as stringUtils from '../strings';
import {Rule, apply, mergeWith, move, template, url} from '@angular-devkit/schematics';
import {
Rule,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sort in ASCII order (capitals first, a-z)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

apply(url('./files'), [
template({ utils: stringUtils, ...options })
])),
schematic('module', { name: 'app' }),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that schematics exist in this PR... Is this in another PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already merged into master


import * as ts from 'typescript';
import 'rxjs/add/operator/merge';
import findModule, { buildRelativePath } from '../utility/find-module';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid the mix of default and non-default exports/imports.


const recorder = host.beginUpdate(modulePath);
for (const change of changes) {
if (change instanceof InsertChange) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have anything else than InsertChange anymore?

Copy link
Contributor Author

@Brocco Brocco Jul 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No but if we remove this check then the typings are off. For now I suggest we leave it. And if the change is necessary a separate refactor PR is the right place for it.

const toParts = to.split('/');

// Remove file names (preserving destination)
fromParts.splice(-1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

splice(-1) => pop()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be used, except this provides consistency/readability with the following line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the following line could be pop() as well.

@Brocco Brocco force-pushed the ng-schematics-app branch 2 times, most recently from dae129a to 0078839 Compare July 6, 2017 17:21
template,
url
} from '@angular-devkit/schematics';
import {addImportToModule, addBootstrapToModule} from '../utility/ast-utils';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for inline ones. I'll see if I can make a linting rule.

Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 more nit then good to merge.

Utilize module schematic for app module Utilize component schematic for app root component
@Brocco Brocco force-pushed the ng-schematics-app branch from 0078839 to 5ec232d Compare July 6, 2017 18:26
@hansl hansl merged commit 7fa0bec into angular:master Jul 6, 2017
@Brocco Brocco deleted the ng-schematics-app branch July 6, 2017 18:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3 participants