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

fix: postCss searches folders recursively #68 #69

Closed
wants to merge 3 commits into from

Conversation

chrisfalaska
Copy link
Contributor

@chrisfalaska chrisfalaska commented Oct 14, 2024

Alaska Airlines Pull Request

Updating postCss to recursively search folders.

Testing

Tested in two repositories:

  • auro-input
  • auro-radio

Process

  • Copied the file locally into /node_modules/@aurodesignsystem/auro-library/scripts/build and renamed it to testPostCss.mjs
  • Updated the path in package.json to temporarily reference the updated testPostCss.mjs file:
"postCss:component": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/testPostCss.mjs",
  • Ran npm run build which ran the build:sass task:
"build:sass": "npm-run-all build:sass:component postCss:component sass:render"

Changes to package.json

build:sass:component

Based on the example present in the auro-radio's package.json:

  • Changed the build:sass:component command in auro-input from:
"build:sass:component": "for file in src/*.scss; do npx sass --no-source-map \"$file:${file%.scss}.css\"; done",

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"
  },

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

Before Submitting this pull request:

  • Link all tickets in this repository related to this PR in the Development section
    note: all pull requests require at least one linked ticket
  • If this PR is Ready For Review, all ticket's linked under Development must have their status changed to Ready For Review as well

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I have performed a self-review of my own update.

@chrisfalaska chrisfalaska self-assigned this Oct 14, 2024
@chrisfalaska chrisfalaska linked an issue Oct 14, 2024 that may be closed by this pull request
@chrisfalaska
Copy link
Contributor Author

chrisfalaska commented Oct 15, 2024

After further testing, the required changes can be managed in package.json as opposed to editing the postCss.mjs file.

Will close this PR and associated issue, and will be making the required edits to wc-generator and any respective, individual Auro repos: AlaskaAirlines/WC-Generator#579

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

Successfully merging this pull request may close these issues.

auro-library: update postCss.mjs to work recursively in folders
1 participant