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

feat: sass build tasks check folders recursively, adds support for monorepos #580

Merged
merged 4 commits into from
Oct 16, 2024

Conversation

chrisfalaska
Copy link
Contributor

@chrisfalaska chrisfalaska commented Oct 15, 2024

Alaska Airlines Pull Request

In preparation for auro-form becoming a monorepo in #1, updates to the SASS build tasks in Auro component's package.json need to be introduced into the wc-generator template files.

  • Monorepos introduce a different folder structure, so files need to be found recurisvely
  • Monorepos will switch from a /src/ folder to a /components/ folder, requiring search support in build tasks

Resolves: #579

Summary:

Changes to package.json

build:sass:component

  • Changed the build:sass:component command to:
"build:sass:component": "sass --no-source-map src:src",

sass:render

Updated sass:render to check recursively, and added the /components/ folder:

"sass:render": "sass-render 'src/**/*.css' 'components/**/*.css' -t ./node_modules/@aurodesignsystem/auro-library/scripts/build/staticStyles-template.js"

sweep

  • Updated the run sweep command to check recursively
  • Added the ./components folder
"sweep": "find ./demo ./dist ./src ./components -type f \\( -name \"*.css\" -o -name \"*-css.js\" \\) -delete",

Testing

Tested in two repositories:

  • auro-input
  • auro-radio

Process

  • Made the changes to package.json in the local copy of the respective repositories.

  • Ran npm run build which ran the build:sass task:

"build:sass": "npm-run-all build:sass:component postCss:component sass:render"

Confirming changes

  • Using npm run sweep, any previous .css & .js files are cleaned from the repo
  • Ran npm run build and observed the expected files being built:

auro-input

Screenshot 2024-10-15 at 11 27 09 AM

  • Created test subdirectories in /src/ to further check recursive functionality:

Screenshot 2024-10-15 at 11 22 46 AM

Exit notes

Some legacy components, such as auro-input, may require their SASS build tasks to be manually updated. See AlaskaAirlines/auro-library#69 for details.

Type of change:

Please delete options that are not relevant.

  • New capability
  • Revision of an existing capability
  • Infrastructure change (automation, etc.)
  • Other (please elaborate)

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

@chrisfalaska chrisfalaska requested a review from a team as a code owner October 15, 2024 20:28
@chrisfalaska chrisfalaska self-assigned this Oct 15, 2024
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. We don't review packaging changes - Let us know if you'd like us to change this.

@chrisfalaska chrisfalaska changed the title Feature: SASS Build Tasks Check Folder Recursively, Support for Monorepos Feature: SASS Build Tasks Check Folders Recursively, Adds Support for Monorepos Oct 15, 2024
Copy link
Member

@jason-capsule42 jason-capsule42 left a comment

Choose a reason for hiding this comment

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

commit messages need to be updated to match our contribution guidelines (e.g. fix: ..., feat:...)

@chrisfalaska chrisfalaska changed the title Feature: SASS Build Tasks Check Folders Recursively, Adds Support for Monorepos feature: sass build tasks check Folders recursively, adds support for monorepos Oct 16, 2024
@chrisfalaska chrisfalaska changed the title feature: sass build tasks check Folders recursively, adds support for monorepos feature: sass build tasks check folders recursively, adds support for monorepos Oct 16, 2024
@chrisfalaska chrisfalaska changed the title feature: sass build tasks check folders recursively, adds support for monorepos fix: sass build tasks check folders recursively, adds support for monorepos Oct 16, 2024
@chrisfalaska chrisfalaska changed the title fix: sass build tasks check folders recursively, adds support for monorepos feat: sass build tasks check folders recursively, adds support for monorepos Oct 16, 2024
@chrisfalaska chrisfalaska merged commit 7335a7f into master Oct 16, 2024
6 checks passed
@chrisfalaska chrisfalaska deleted the cfriedberg/579 branch October 16, 2024 22:04
@blackfalcon
Copy link
Member

🎉 This PR is included in version 4.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Completed work has been released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update package.json tasks to check folders recursively and add compatibility for monorepos
3 participants