在component.json和package.json中定义'包'信息 [英] Defining 'package' information in component.json and package.json

查看:247
本文介绍了在component.json和package.json中定义'包'信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个我想通过Bower提供给我的内部公司的JavaScript库。我使用Grunt来构建我的库。



我的问题是grunt的惯例是使用 package.json 定义依赖关系,库版本,依赖关系等。另一方面,Bower假定在组件中可以找到相同的信息。 json 文件。



这两者的用途是什么?他们似乎服务于基本相同的目的。我是否需要创建并剪切和粘贴共享信息?

解决方案

我们收到了很多这类问题并且所有人都假定我们可以在这些格式之间共享大量元数据,但实际情况是只有名称版本字段是可共享的,只有版本字段会定期更改。如果您发现在发布某些内容时需要更新两个字段会很麻烦,那么可以使用这些工具自动执行此操作,例如。 grunt-bumpx


I'm creating a javascript library that I want make available through Bower to my internal company. I'm using Grunt to build my library.

My issue is that grunt's convention is to use package.json to define dependencies, library versions, dependencies, etc.

Bower, on the other hand, assumes that that same information is found in a component.json file.

What's the intended use of these two? They seem to serve essentially the same purpose. Do I need to create both and cut and paste the shared information?

解决方案

We've gotten a lot of these kinds of question and everyone assumes we could share a lot metadata between these formats, but the reality is that only the name and version fields are sharable and only the version field changes regularly. If you find it cumbersome having to update two fields when you release something, there are tools out there that can automate this, eg. grunt-bumpx.

这篇关于在component.json和package.json中定义'包'信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆