Closed drewblaisdell closed 8 years ago
I think it should be in peerDependencies
. Updating the PR
So the main idea behind my commit is that this library should tell projects which want to use it to add those dependencies as their own.
peerDependencies
are not installed by default by npm anymore so it will just show a warning:
npm WARN @automattic/dops-components@0.0.1 requires a peer of babel-plugin-add-module-exports@0.2.1 but none was installed.
Which should force devs to add this to their package.json
.
There are other dependencies that could be added to peerDependencies
I believe such as:
If you don't have those your build might fail. But it might just work as well, it depends on the component you're using from this lib.
So I think we should decide on a small subset of dependencies that are important for projects to have if they want to use this lib. Babel presets and webpack should definitively in the list. node-sass
might be used quite a lot for an ui lib so we could have it. json-loader
might be used for a couple of components, so we could ignore it...
For now let's just merge this PR which informs on babel presets and plugins which are needed :)
You can test that it works by adding #update/dependencies
for this dependency in delphin's package.json:
"@automattic/dops-components": "github:automattic/dops-components#update/dependencies",
LGTM. I removed my commit.
Pinging @zinigor so that he is aware of this change. :)
👍 Let's merge
As of #64, this package needs to be installed in every repo that transpiles
dops-components
or it fails when that repo (such as Delphin) tries to build anything fromdops-components
:If we move it to
dependencies
fromdevDependencies
, we ensure that it will be installed. This should probably happen for otherdevDependencies
, but the versions don't line up between this and Calypso and lining those up will require further testing.Testing
master
, updatenode_modules/@automattic/dops-components/package.json
in Delphin with the change from this commit and assert that it runs successfully when runningnpm start
.