Skip to content

Conversation

devversion
Copy link
Member

@devversion devversion commented Jan 2, 2020

  • Enforces that golden files exist for each entry-point.
  • Ensures that entry-points are properly configured in Bazel. We "detect" entry-points by looking for public-api.ts files.

Resolves COMP-263

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 2, 2020
@devversion devversion force-pushed the build/enforce-goldens-for-configured-ep branch 2 times, most recently from 521cc85 to 4d83d97 Compare January 2, 2020 15:37
@devversion devversion force-pushed the build/enforce-goldens-for-configured-ep branch from 4d83d97 to 477343b Compare January 2, 2020 15:43
@devversion devversion added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent pr: merge safe target: patch This PR is targeted for the next patch release labels Jan 2, 2020
@devversion
Copy link
Member Author

@mmalerba I'm adding the 9.0.0 milestone since this unveiled that the grid-list harness is not published. Let me know if I should just extract this into a separate PR.

@devversion devversion added this to the 9.0.0 milestone Jan 2, 2020
@devversion devversion marked this pull request as ready for review January 2, 2020 15:48
@devversion devversion requested review from jelbourn and a team as code owners January 2, 2020 15:48
@@ -28,14 +28,15 @@
"gulp": "gulp",
"stage-release": "ts-node --project tools/release/ tools/release/stage-release.ts",
"publish-release": "ts-node --project tools/release/ tools/release/publish-release.ts",
"check-entry-point-setup": "node ./scripts/check-entry-point-setup.js",
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't we run this with ts-node and have it be in TypeScript like we have for the rest of the scripts?

Copy link
Member Author

@devversion devversion Jan 6, 2020

Choose a reason for hiding this comment

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

I decided to not use TypeScript for the script so that it could be simply run without ts-node. I did the same for build-packages-dist.js and deploy-dev-app.js. I'm not sure what the ideal language is for these scripts. I found everything needed for the scripts in standard JS and it doesn't require the slower ts-node.

Copy link
Member

Choose a reason for hiding this comment

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

It's not much slower though and most of the other tooling is in TS already. E.g. check the rest of the scripts around it in the package.json.

Copy link
Member Author

@devversion devversion Jan 6, 2020

Choose a reason for hiding this comment

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

The majority of Node scripts in scripts/ is JavaScript already. Other tools linked in package.json like the release scripts are Typescript-based since they are split up in multiple files and they are not really scripts, but rather tools/. Also most of these TS scripts do not leverage TS specific features, so they are technically JS already (maybe a few types)

For me personally, the scripts in ./scripts/ should primarily be about usability and not need a preprocessor (unless there is a reason it's required for a particular script). Re slowness: I tried running a simple script and for the simple script I hit quite a difference already.

ts-node node
real 0m1.380s
user 0m0.030s
sys 0m0.075s
real 0m0.073s
user 0m0.000s
sys 0m0.015s

I don't mind too much. My point is just that the majority of Node scripts in ./scripts is already JavaScript based, so we should rather decide on one language for these scripts. This seems out of scope for this PR though?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not arguing that it's slower, but it's not something we run manually ourselves and one or two extra seconds is nothing for the build which is taking minutes. I don't mind it either way. We can see what others think about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

The scripts are not necessarily about the build. We could say that the time difference is not impacting much since scripts like check-rollup-globals run on CI and the actual JS code is fast.

What's the benefit of using TypeScript for scripts which do not use any TS features? I could imagine consistency (which is good). As said above, I don't mind too much either, so if we decide to do it for consistency, then I'm happy to switch all other scripts to TS (it might be good to think about the Bash scripts too)

@devversion devversion force-pushed the build/enforce-goldens-for-configured-ep branch from 477343b to 00913cc Compare January 6, 2020 09:28
@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jan 6, 2020
@mmalerba
Copy link
Contributor

mmalerba commented Jan 6, 2020

awesome, thank you!

@mmalerba mmalerba merged commit 6c5c08e into angular:master Jan 6, 2020
yifange pushed a commit to yifange/components that referenced this pull request Jan 30, 2020
…ar#18092)

* build: enforce golden files for configured entry points

* build: add linting to ensure entry-points are configured
@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 Feb 6, 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 cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants