-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Import primer-module-build to the monorepo #475
Conversation
@@ -20,6 +20,10 @@ | |||
"test": "npm run test-all-modules && lerna run test", | |||
"test-all-modules": "ava --verbose tests/test-*.js" | |||
}, | |||
"dependencies": { | |||
"primer-module-build": "file:tools/primer-module-build", | |||
"stylelint-config-primer": "file:tools/stylelint-config-primer" |
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.
FYI, this was the only way that I could figure out how to "hoist" any of our packages to the top-level node_modules
directory without specifying a version. It works great for CI, where things won't change, but it could very well cause issues in testing changes to the tools (primer-module-build
, stylelint-config-primer
) on other packages locally.
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.
Also, I broke them out into dependencies
so that it was easier to see them amongst all of the other dev dependencies. 🙈
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 thought the file:
syntax only worked for local development? Does this line get replaced when we publish to npm?
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 you're right. We don't publish the top-level package.json
, though; we just use it with Lerna to hoist all of the common dev dependencies and run tests across the whole project. (The primer
"mega-package" is in modules/primer
.)
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.
ahhh! makes sense! 👍
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.
💎 ⚡️Going to make maintenance easier
@@ -0,0 +1 @@ | |||
@import "./primer-package.scss" |
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.
🎈
package.json
Outdated
"npm-run-all": "^4.0.2", | ||
"npx": "^10.2.0", |
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.
If we're using npx, do we still need npm-run-all in devDeps
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.
Yeah, because npx
doesn't support multiple run scripts in serial
Derp, gotta figure out why tests are failing now... @jonrohan, could you remove your review until then? |
As of d5aeca7, this PR also includes some tweaks to the scorecard test:
|
For reference, here is the
*** /tmp/primer-10.4.0.css 2018-05-09 13:25:18.000000000 -0700
--- /tmp/primer-alpha.css 2018-05-09 13:25:37.000000000 -0700
***************
*** 3178,3184 ****
}
.tooltipped-multiline::after {
- width: -webkit-max-content;
width: -moz-max-content;
width: max-content;
max-width: 250px;
--- 3178,3183 ----
***************
*** 8852,8862 ****
}
.Popover-message--right-bottom::before,.Popover-message--left-bottom::before {
! bottom: 24px
}
.Popover-message--right-bottom::after,.Popover-message--left-bottom::after {
! bottom: 21px
}
@media (min-width: 544px) {
--- 8851,8861 ----
}
.Popover-message--right-bottom::before,.Popover-message--left-bottom::before {
! bottom: 16px
}
.Popover-message--right-bottom::after,.Popover-message--left-bottom::after {
! bottom: 17px
}
@media (min-width: 544px) {
***************
*** 9242,9248 ****
height: 30px;
content: " ";
background-color: transparent;
! background-image: linear-gradient(transparent, rgba(0,0,0,0.05));
background-repeat: repeat-x;
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05)
}
--- 9241,9247 ----
height: 30px;
content: " ";
background-color: transparent;
! background-image: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.05));
background-repeat: repeat-x;
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05)
} The Anyway, I think this is read to go, so I'm merging it! |
Yesterday I ran into a bizarre issue with node-sass that appears to be fixed in a later version. Testing a new version of node-sass with Primer turns out to be really difficult without
primer-module-build
in the monorepo, so I went down that road. Along the way, I also:primer-module-build
to:@import
filenames and (I think!) eliminates the issue of having tonpm dedupe
to flatten thenode_modules
dependency hierarchy in just the right way.fs.mkdir()
call to create the build directory was finished.)build/data.json
in addition tobuild/index.js
, which basically fixes Generate stats.json for other tools to consume primer-module-build#18.Removedstylelint-config-primer
from the monorepopackage.json
, which is not published but could cause issues if we were to bump that package's version without also updating it there.I'd like to test whether we can remove
primer-module-build
from the dotcompackage.json
(or specify it as"primer-module-build": "*"
?) to alleviate issues that @emplums and @jonrohan ran into when testing an alpha version of primer with an updatedprimer-utilities
version. (I think the problem there was that becauseprimer-module-build
depends onprimer-utilities
and the versions weren't in sync, the utilities weren't being hoisted properly.) Otherwise, this is ready to review!Note When we're ready to release this, we'll need to bump
primer-module-build
to2.0.0
, as the JS API has changed./cc @primer/ds-core