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

build: minor fixes for google3 sync #18354

Merged
merged 1 commit into from Jul 24, 2020
Merged

Conversation

kyliau
Copy link
Contributor

@kyliau kyliau commented Jul 24, 2020

This commit makes a few minor changes to enable syncing the CLI repository
into google3.

  1. mark pkg_tar and pkg_npm as external
  2. remove dependencies (marked as comment) which are stale in google3
  3. add code fence for TS files generated from JSON schema in BUILD files
    since these files are compiled and added to the g3 codebase at sync time
  4. Some minor typing changes
  5. Remove duplicate licenses
  6. mark dependencies which are not available in g3 as external
  7. Immediately type the result of JSON.parse() as required by g3 linter.
    Otherwise, the type defaults to any.

@kyliau kyliau force-pushed the master branch 2 times, most recently from 5b65552 to 78e6cc5 Compare July 24, 2020 18:08
@kyliau kyliau changed the title build: mark pkg_tar and pkg_npm as external build: add external code fence for google3 sync Jul 24, 2020
@kyliau kyliau changed the title build: add external code fence for google3 sync build: minor fixes for google3 sync Jul 24, 2020
@kyliau kyliau marked this pull request as ready for review July 24, 2020 18:10
@kyliau kyliau requested a review from dgp1130 July 24, 2020 18:13
@@ -102,7 +102,7 @@ export default function (options: Schema): Rule {
try {
const packageJsonContent = tree.read('/package.json');
if (packageJsonContent) {
const packageJson = JSON.parse(packageJsonContent.toString('utf-8'));
const packageJson = JSON.parse(packageJsonContent.toString('utf-8')) as {};
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is for the linter? I'm surprised it runs at all on third party code.

We should add a comment here to explain that we need to cast the result for the linter. Also consider using unknown as a safer alternative to {} if not too much trouble.

Copy link
Contributor Author

@kyliau kyliau Jul 24, 2020

Choose a reason for hiding this comment

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

Sorry, to be exact, it is the compiler, not the linter. go/tsetse is built into the compiler, so the violations show up as hard errors at compile time.
I added the comments and typed it as never instead of {}. I'm surprised that bracket notation is allowed on never type.

@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label Jul 24, 2020
@kyliau kyliau added the action: merge The PR is ready for merge by the caretaker label Jul 24, 2020
This commit makes a few minor changes to enable syncing the CLI repository
into google3.

1. mark pkg_tar and pkg_npm as external
2. remove dependencies (marked as comment) which are stale in google3
3. remove TS files generated from JSON schema in BUILD files since these
   files are compiled and added to the g3 codebase at sync time
4. Some minor typing changes
5. Remove duplicate licenses
6. mark dependencies which are not available in g3 as external
7. Immediately type the result of JSON.parse() as required by g3 linter.
   Otherwise, the type defaults to `any`.
@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 Aug 24, 2020
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 target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants