
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Command Line Interface for MIP 2.0.
Prerequisites: Node.js (>=8.x), npm version 3+ and Git.
$ npm install -g mip
创建项目
$ mip init
新增一个组件
在项目根目录运行 mip add
命令,即可快速添加一个新组件
# 快速添加名为 mip-new 的组件
$ mip add mip-new
# 使用 -f 或 --force 参数强制覆盖同名组件
$ mip add mip-new -f
启动调试服务器,在项目根目录运行
$ mip dev
Example:
# 可使用 ——port 指定端口
$ mip dev --port 8888
组件和页面校验
集成到 cli 工具中的校验分为三种:
$ mip validate
Example:
# 组件校验
$ mip validate components
$ mip validate -c components
# 页面校验
$ mip validate -p page.html
# npm 白名单校验
$ mip validate -w path-to-project
构建组件,在项目根目录运行
$ mip build
生成 Service Worker
mip CLI 提供了 sw
命令,帮助开发者更简单快速地生成 Service Worker,支持离线可用等特性。
# 在项目根目录运行
$ mip sw
默认情况下,将导出 Service Worker 文件到 dist/sw.js
,并对静态资源(如 js,css)及 html 文档进行缓存,实现页面的离线可用。
mip sw
命令提供了选项:
-o, --output // 指定 sw 导出路径,如 mip -o output/service-worker.js
-c, --config // 指定配置文件路径,默认使用项目根目录 mip.config.js
除此之外,我们可以在 mip.config.js
中增加 serviceWorker
配置项,对 Service Worker 进行进一步的配置,如预缓存列表、动态缓存策略、skipWaiting
、clientsClaim
等。
module.exports = {
dev: {/*...*/},
serviceWorker: {
cacheId: 'mipuser',
skipWaiting: true,
clientsClaim: true,
runtimeCaching: [],
globPatterns: [],
globIgnores: []
}
}
更多的配置选项可以参考 Workbox 配置项
本地启动 SF 调试环境
$ mip sf
运行命令后,会在本地启动一个服务器,可以通过 http://localhost:8210/sf
进行访问,对页面嵌入 SF 的情况进行调试和验证。
详情可以查看插件项目仓库 mip-cli-plugin-sf
FAQs
CLI for mip 2.0
The npm package mip receives a total of 2 weekly downloads. As such, mip popularity was classified as not popular.
We found that mip 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.