Skip to content
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

feat(module): select module to add generations to for declaration #1966

Merged
merged 1 commit into from
Sep 4, 2016

Conversation

Brocco
Copy link
Contributor

@Brocco Brocco commented Sep 3, 2016

Note: this also displays a warning stating that services are not provided by default

@Brocco Brocco force-pushed the add-to-module branch 2 times, most recently from 24a31ed to f6a6351 Compare September 4, 2016 04:23
@@ -2,6 +2,7 @@ var path = require('path');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
const stringUtils = require('ember-cli-string-utils');
const astUtils = require('../../utilities/ast-utils');
var findParentModule = require('../../utilities/find-parent-module');
Copy link
Contributor

Choose a reason for hiding this comment

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

const please.



for (let i = 0; i <= partsLength; i++) {
let files: string[] = fs.readdirSync(pathToCheck);
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need the type information, and you could just do

const files = fs.readdirSync(pathToCheck)
  .filter(fileName => fileName.endsWith('.module.ts')
  .filter(fileName => fs.statsSync(fileName).isFile());

Right now there's a bug (unlikely but still) that if it contains .module.ts (but doesn't end with) it will match. Also, a bug that it doesn't check if it's a directory or a regular file.

import * as path from 'path';
const SilentError = require('silent-error');

export function findParentModule(
Copy link
Contributor

Choose a reason for hiding this comment

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

Everything fits on one line now. \o/

@Brocco Brocco force-pushed the add-to-module branch 2 times, most recently from 1f7a7e6 to 3582e72 Compare September 4, 2016 05:26
@hansl
Copy link
Contributor

hansl commented Sep 4, 2016

2 nits: code in comments and foo/ directory. LGTM I can merge when those are done.

Note: this also displays a warning stating that services are not provided by default
@Brocco Brocco merged commit a647e51 into angular:master Sep 4, 2016
@Brocco Brocco deleted the add-to-module branch September 4, 2016 13:38
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants