Skip to content

Conversation

@ashoktamang
Copy link
Contributor

add logic to filter out spec file associated with the given component unit and all index files while getting all dependent files
add utlity function to get all the files (.html/stylesheets/.spec.ts) associated with the given component unit
change the constructor method of the class ModuleResolver (add 'rootPath' as an additional parameter)

let fileBaseName = path.basename(fileName, '.ts');
return files
.filter((file) => {
if (path.extname(path.basename(file, '.ts')) === '.spec') {
Copy link
Member

Choose a reason for hiding this comment

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

I think that getDependentFiles shouldn't lie to you. Return the spec here as well, and filter it out when you're actually using it.

@ashoktamang ashoktamang force-pushed the dependent-files branch 6 times, most recently from 4b8f613 to cd02683 Compare August 8, 2016 17:13
*
* @return absolute paths of '.html/.css/.sass/.spec.ts' files associated with the given file.
*
*/
Copy link
Member

Choose a reason for hiding this comment

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

Should we validate in here that the file is actually a .component file?

Copy link
Member

Choose a reason for hiding this comment

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

No tests for this function?

@alxhub
Copy link
Member

alxhub commented Aug 8, 2016

LGTM pending 2 comments.

@ashoktamang ashoktamang force-pushed the dependent-files branch 2 times, most recently from 52bd322 to 823e53e Compare August 8, 2016 22:18

/**
* Function to get all the templates, stylesheets, and spec files of a given component unit
* Assumption: When any component/service/pipe unit is generated, Angular CLI has a blueprint for
Copy link
Member

Choose a reason for hiding this comment

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

Don't indent so far over here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will 2 spaces under 'Assumption: ' do?

@ashoktamang ashoktamang force-pushed the dependent-files branch 4 times, most recently from aaf1d5b to a32f7b9 Compare August 10, 2016 16:16
add logic to filter out spec file associated with the given component unit and all index files while getting all dependent files
add utlity function to get all the files (.html/stylesheets/.spec.ts) associated with the given component unit
change the constructor method of the class ModuleResolver (add 'rootPath' as an additional parameter)
@alxhub alxhub merged commit 7565f2d into angular:master Aug 10, 2016
@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