
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
lights 是FIS包管理工具。提供便捷、易用的资源安装、发布、搜索,管理工具。用于团队间快速共享资源,提升开发效率。 访问 lights.baidu.com ,找到更多资源。
$ npm install -g lights
lights被发布为一套npm包,对它对环境的要求是:
执行 lights --help 让我们来看一下lights命令的相关帮助:
Usage: lights <command>
Commands:
install install resource from lights
search search resource of lights
adduser add user of lights
publish publish resource to lights
unpublish remove resource to lights
owner change ownership of resource
config set or get config if lights
Options:
-h, --help output usage information
-v, --version output the version number
$ lights install
安装组件依赖。
读取当前文件夹下的package.json的dependecies节点,下载所有依赖。
$ lights install <name>@<version>
Options:
--repos <url> : repository,仓库地址
lights install 下载资源以及资源的所有依赖到当前目录。
不输入version时,默认下载最新版本
当前目录已经存在该资源的,提示已经存在,不会覆盖,需要手动删除才能继续下载。
**--repos ** : lights默认仅与一个仓库交互,仓库之间没有同步时,可以设置--repos 参数,指定仓库下载。 例如,lights install gmu --repos fedev.baidu.com:8889
repos的 url的格式为 : 机器名或者ip地址 + 端口号。
默认的lights.baidu.com的仓库地址为 fedev.baidu.com:8889.
$ lights search <key>
$ lights adduser
$ lights publish <folder>
folder: 一个包含package.json的文件夹
如果包名(name)或者版本(version)已经存在,会发布失败. 可以添加 --force 参数来强行覆盖已存在的版本。
资源必须包括package.json文件
{
"name": "myproject",
"version": "0.0.1",
"description": "An example lights components",
"dependencies": {
"jquery" : "1.7.1"
},
"repository": {
"type": "git",
"url": "https://github.com/myproject"
},
"keywords": [
"scaffold",
"assets"
],
"author": "me",
"license": "MIT"
}
资源有依赖的时候,package.json添加dependencies节点。例如
{
"dependencies": {
"Chart" : "0.2.0",
"jquery" : "2.0.3"
}
}
依赖的文件需要都publish到lights的仓库中,否则下载依赖会失败。依赖的组件还有依赖时,会递归下载。
组件以及依赖全部下载到相同目录,没有目录嵌套。
注意:组件开发中,如果使用依赖的方式,注意相对路径的写法,保证组件下载后可用。
**目前 package.json中的版本号,仅支持具体版本号写法,不支持 >=等。否则会报错 **
前端资源聚合的资源没有强行分类,网站首页显示的资源类型,是由关键字keywords筛选出的。包含资源数目最多的才会显示出来噢~
默认提供以下关键字,推荐选择默认keywords,让其他同学更容易找到你的资源~ 默认keywords类型:
framework (基础库资源 —— backbone,jquery等)
css (css资源,组件等)
test (测试相关资源)
widget (组件化资源(html组件化,js组件化)
smartyPlugin (smarty插件)
assets 素材(icon,图片等)
kernal (FIS 核心资源)
monitor (监控资源 —— webspped, 统计脚本,hunter等)
scaffold (脚手架资源 —— 各种使用demo,代码框架等)
html5 (html5资源)
utils (基础util资源 —— date,array等各种操作)
所谓commonJS开发体验,是基于FIS的前端框架 modJS。lights无缝结合FIS的组件化开发写法,开发的widget等组件可以在FIS中自动运行。
[具体规范细节](http://fe.baidu.com/doc/fis/2.0/user/js.text#widget)
lights unpublish <name>[@<version>]
lights owner ls <package name>
lights owner add <user> <package name>
lights owner rm <user> <package name>
注意:所有资源的操作权限只有两种。可修改与不可修改。
$ lights config set <key> <value>
$ lights config get <key>
$ lights config ls
$ lights update <pkg>
$ lights remove <pkg>
lights支持分布式的仓库存储。自行搭建的lights私有仓库,需要在lights中设置repos的url来指定。
$lights config set repos fedev.baidu.com:8889
相关文档 [https://github.com/lily-zhangying/lights/wiki/newRepos]
node包管理使用详细请查看此文档
FAQs
lights package manager
We found that lights demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.