Skip to content

Cleanup Ngc Api as preparation for watch mode - #18633

Merged
hansl merged 1 commit into
angular:masterfrom
tbosch:ngc_api
Aug 11, 2017
Merged

hansl merged 1 commit into
angular:masterfrom
tbosch:ngc_api

Conversation

@tbosch

@tbosch tbosch commented Aug 10, 2017

Copy link
Copy Markdown
Contributor

Note: The first commit is from #18494

@googlebot

Copy link
Copy Markdown

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@tbosch
tbosch requested a review from chuckjaz August 10, 2017 15:16
@mary-poppins

Copy link
Copy Markdown

You can preview 4d8d0b5 at https://pr18633-4d8d0b5.ngbuilds.io/.

Comment thread tools/ngc-wrapped/index.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since this doesn't merge the angular options and set genDir and basePath like readConfiguration does, this causes:

this.basePath = path.normalize(path.join(options.basePath !, '.')).replace(/\\/g, '/');

to fail in module_filename_resolver.ts. This code should compensate for the missing work done in readConfiguration or modify readConfiguration to allow the work to be shared.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PTAL.

@mary-poppins

Copy link
Copy Markdown

You can preview fdaa7b5 at https://pr18633-fdaa7b5.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 6b012a9 at https://pr18633-6b012a9.ngbuilds.io/.

@tbosch tbosch added target: major This PR is targeted for the next major release area: core Issues related to the framework runtime refactoring Issue that involves refactoring or code-cleanup labels Aug 11, 2017
@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

@mary-poppins

Copy link
Copy Markdown

You can preview e3d126a at https://pr18633-e3d126a.ngbuilds.io/.

Comment thread packages/compiler-cli/src/main.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should use TS to parse the command line, so that it's possible to pass options that override or replace the tsconfig.json file
like tsc-wrapped does: https://github.com/angular/angular/blob/master/packages/tsc-wrapped/src/main.ts#L199

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a TODO

Comment thread packages/compiler-cli/src/main.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

are we able to remove this and move cli args fully into the tsconfig file yet?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, you can specify all i18n options in the config now. However we keep the command line options for backwards compatibility...

Comment thread packages/compiler-cli/src/main.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should not call process.exit, says @evmar - instead set process.exitCode and let the process terminate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's not necessary to copy from TypeScript; I moved this to a public API ts.formatDiagnostics
like here:

if (isTsDiagnostics(diags)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I want to apply it to a single diagnostic, so that the diagnostics array can contain both, ts.Diagnostics and ng.Diagnostics. However, I think I can use that method for a single diagnostic as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

note, and FYI: this is duplicating code here
https://github.com/bazelbuild/rules_typescript/blob/master/internal/tsc_wrapped/tsconfig.ts#L99
but that's probably okay as it's not much, and we don't have a plan for sharing bazel libraries on npm yet

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

passing basePath is a smell, it's not actually a free variable, it is required to be the absolute path to the directory containing tsconfig.json or else paths produced by TS moduleResolver won't match up

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mmh, so how would I get it then if it was no passed in?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: google TS style guide says to use Number(major) to coerce the type

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread packages/compiler-cli/test/main_spec.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

spelling: complier -> compiler

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@mary-poppins

Copy link
Copy Markdown

You can preview 3c04703 at https://pr18633-3c04703.ngbuilds.io/.

@tbosch tbosch added the action: merge The PR is ready for merge by the caretaker label Aug 11, 2017
@tbosch

tbosch commented Aug 11, 2017

Copy link
Copy Markdown
Contributor Author

Travis was red because of a flake, rerunning now.

@hansl
hansl merged commit 27d901a into angular:master Aug 11, 2017
@tbosch
tbosch deleted the ngc_api branch August 14, 2017 16:50
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime cla: yes refactoring Issue that involves refactoring or code-cleanup target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants