Skip to content

build: add validation for prebuilt cdk css #15588

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

Merged
merged 1 commit into from
Apr 2, 2019

Conversation

crisbeto
Copy link
Member

Adds another check to the release validation script that ensures that the prebuilt CDK CSS has been created.

@crisbeto crisbeto added pr: merge safe target: patch This PR is targeted for the next patch release labels Mar 23, 2019
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 23, 2019
*/
export function checkCdkPackage(packagePath: string): string[] {
return ['overlay', 'a11y', 'text-field']
.filter(name => !existsSync(join(packagePath, `${name}-prebuilt.css`)))
Copy link
Member

Choose a reason for hiding this comment

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

Cool! I would have needed something like that for #15497.

Feels a bit weird to hardcode the entry-points. Maybe we can use a glob and look for SCSS files in a given entry-point? Also how about also checking that e.g. _a11y.scss is exposed at the root? (I initially missed this in #15497)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I follow the note about using a Glob. As for hardcoding the entry points, I don't think it's an issue, because we have a limited set of prebuilt styles that we're exposing.

Copy link
Member

@devversion devversion Mar 25, 2019

Choose a reason for hiding this comment

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

My concern is just that whenever we add a new style file to a CDK entry-point/or add a new entry-point w/ styles, we need to remember adding the entry-point name to that array.

For globs: I meant that we just look for any SCSS files in the format of src/cdk/{name}/_{name}.scss. That way we could avoid the hard-coded array of entry-points that generate a prebuilt CSS file.

Copy link
Member Author

Choose a reason for hiding this comment

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

That is a little brittle though. E.g. it won't handle the case where overlay is generated, but a11y or text-field aren't.

Copy link
Member

@devversion devversion Mar 25, 2019

Choose a reason for hiding this comment

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

Maybe I don't follow what you are saying, but my stance is that:

  • If there is a {name}-prebuilt.scss file, then it will be exposed at the root of the CDK
  • If there is a _{name}.scss file, then it will be exposed at the root of the CDK.

This is basically how the package-tools works: see here. I don't feel too strong about it, but it should be definitely possible to make the check follow our current package-tools expectation.

Copy link
Member Author

Choose a reason for hiding this comment

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

My point was that the glob only verifies that some file with that pattern is generated, it won't verify that the exact files we're expecting are in the directory.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry if my comment was ambiguous. My point was that you could use the glob to identify the files in the source folder and then check if the corresponding output files exist in the release output.

Adds another check to the release validation script that ensures that the prebuilt CDK CSS has been created.
@crisbeto crisbeto force-pushed the cdk-prebuilt-styles-check branch from 058ac73 to b073cd8 Compare March 31, 2019 14:41
@crisbeto
Copy link
Member Author

I've reworked it based on the feedback @devversion.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Apr 1, 2019
@mmalerba mmalerba merged commit 11839a5 into angular:master Apr 2, 2019
jelbourn pushed a commit that referenced this pull request Apr 4, 2019
Adds another check to the release validation script that ensures that the prebuilt CDK CSS has been created.
@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
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement 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