Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@wubafe/picasso
Advanced tools
A tool automatically convert sketch to code.
Picasso是58同城推出的一款sketch设计稿智能解析工具,可将sketch设计稿自动解析成还原精准,可用度高的前端代码。
注:安装picassoImg插件之前,请先安装sketch
下载picassoImg插件 => picassoImg.sketchplugin.zip 解压压缩包,双击安装即可,如下:
安装完成后在sketch软件中看到该插件,如下图所示:
npm install -g @wubafe/picasso
# 查看帮助
picasso --help
# 查看版本
picasso --version
# 解析sketch设计稿
picasso -s test/index.sketch
# 或者
picasso -s test/index.sketch -d test -t 1 -p tt
# 参数介绍
Options:
-v, --version picasso版本
-s, --src [path] sketch设计稿源文件路径
-d, --dest [string] 解析生成的代码存放路径
-s, --imgScale [number] 图片尺寸(1:1倍图 1.5:1.5倍图 2:2倍图 3:3倍图) (default: 1)
-t, --pageType [number] 解析类型: 1-普通版 2-运营版 (default: 1)
-p, --classPrefix [string] 生成样式className前缀 (default: "")
解析过程中,打印日志如下图所示:
解析结果文件(如果不设置dest输出目录,解析结果会放到sketch文件同目录下,结果文件夹名同sketch文件):
页面效果展示:
npm install @wubafe/picasso -S
const picasso = require('@wubafe/picasso');
// 解析sketch
(async () => {
await picasso({
src: 'test/index.sketch', // sketch源文件路径
dest: 'test', // 生成代码存放路径
assetsScale: 1, // 导出图片尺寸(1 1.5 2 3) 默认 1
pageType: 1, // 1 普通版 2 运营版 默认 1
classPrefix: '', // 生成样式className前缀 默认 ''
});
})()
# 安装依赖
npm install
# 运行项目,即可进行解析
npm run dev
欢迎参与picasso项目的开发建设和讨论。
提交 pull request 之前请先提 [Issue 讨论].
FAQs
sketch设计稿智能解析工具
We found that @wubafe/picasso demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.