-
Notifications
You must be signed in to change notification settings - Fork 35
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
[WIP] Remove build artifacts from the repo #295
Conversation
@dmethvin-gov to answer your questions:
|
On 1, if that's the way we want it to stay we can just copy them into On 2, all of the files are always going to be built and linted on each commit to master or on PRs, since they're needed to run tests. It's just a question of whether |
Looking at this some more I think we should have this PR resolve #66 along with #218. Some thoughts about it:
|
d5eb13c
to
4e2f736
Compare
@annekainicUSDS I think this is ready for another look. I rebased against the current master in order to remove some of the merge conflicts with the built files. |
4e2f736
to
84e3309
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple more questions for you!
package.json
Outdated
"autoprefix": "npx postcss lib/css/styles.css --use autoprefixer -map -d lib/css/", | ||
"build": "npm run compile-js && npm run compile-sass && npm run autoprefix && npm run copy-uswds -s", | ||
"ci": "npm run clean -s && npm run lint && npm run build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we not want to run npm run test
as part of this? Now that we're using this command in our circleci config instead of npm run lint
and npm run test
, we've lost the command to run the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, we do but I messed up fixing the merge conflict. This was exactly one of those situations where the built files updated causing a merge conflict, . I can add it back. Thanks for catching it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah gotcha!
package.json
Outdated
"autoprefix": "npx postcss lib/css/styles.css --use autoprefixer -map -d lib/css/", | ||
"build": "npm run compile-js && npm run compile-sass && npm run autoprefix && npm run copy-uswds -s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've removed the part where we clear out the lib/
directory first before adding the compiling files. Is that not something we still need to do? To make sure that files we may have deleted are being deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For CI it's nice to be completely sure it's clean but I wasn't sure whether it was really needed when you're building over and over locally. Files removed from the project are relatively rare. I can put it in here as well though if you think we should have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can't hurt! Might as well include it to be extra sure it's reflective of reality.
OK, I moved all the steps into |
Once we remove the build artifacts we could also revisit the use of a push hook or commit hook which we couldn't use before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes #218
This is a breaking change since potentially some people might be expecting the
/lib
contents to be there on each build. A couple of things:I have questions about where the images and fonts should go, they were in
/lib
but aren't copied there? I think our build process needs to copy anything we require or we need to figure out a better way to reference them. (This is the subject of Discovery on best way to import USWDS images and fonts #66 I think but I wanted to be sure I understood all the issues here.)As far as leaving things out, should we remove our eslint and babel configs from the published package? It depends on whether we expect people to transpile our code, there are a bunch of pro/cons but I was thinking it might be good to leave it in for now.
Once those are resolved I think it should be possible to land this. I ran a
npm publish --dry-run
and it seemed to put in the right files.Types of changes
Checklist:
npm run lint
.npm run build
.npm test
.