{"id":24919729,"url":"https://github.com/deepfunc/mp-iconfont-cli","last_synced_at":"2025-04-09T18:08:45.344Z","repository":{"id":57303427,"uuid":"247017048","full_name":"deepfunc/mp-iconfont-cli","owner":"deepfunc","description":"微信小程序开发中自动更新 iconfont 样式文件的小工具。","archived":false,"fork":false,"pushed_at":"2020-10-23T06:26:17.000Z","size":2208,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T20:04:37.098Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepfunc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-13T07:58:05.000Z","updated_at":"2021-04-19T03:42:32.000Z","dependencies_parsed_at":"2022-09-17T21:30:43.486Z","dependency_job_id":null,"html_url":"https://github.com/deepfunc/mp-iconfont-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepfunc%2Fmp-iconfont-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepfunc%2Fmp-iconfont-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepfunc%2Fmp-iconfont-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepfunc%2Fmp-iconfont-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepfunc","download_url":"https://codeload.github.com/deepfunc/mp-iconfont-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248084351,"owners_count":21045125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-02T10:37:09.741Z","updated_at":"2025-04-09T18:08:45.329Z","avatar_url":"https://github.com/deepfunc.png","language":"JavaScript","readme":"在微信小程序开发中，使用 iconfont 需要引用本地的文件。每次 iconfont 项目发生变更时，需要去下载最新的 css 文件，并且还要手动删除掉里面对于小程序无用的 src url(*) 兼容节点，然后保存为 wxss 文件。整个过程比较繁琐，这个小工具可以帮你自动完成这些工作。\n\n\n\n## 运行效果\n\n![](assets/01rus-ssjjl.gif)\n\n\n\n## 使用指南\n\n### 安装\n\n```shell\nnpm i -D mp-iconfont-cli\n```\n\n\u003e 请安装 Node.js 8+ 版本。\n\n\n\n### 使用范例\n\n目前仅支持 GitHub 账号登录 iconfont。安装完毕后，在你的项目根目录下运行：\n\n```shell\nnpx iconfont-update\n```\n\n运行过程中会列出 iconfont 中我的项目列表，选择你需要的项目，按照后面的提示操作即可。\n\n\n\n#### 清除设定值\n\n第一次运行完毕后，工具会记住你的选项，下次再运行时无需重复输入了。如果需要清除输入过的设定值，运行下面的命令：\n\n```shell\nnpx iconfont-update --clear\n```\n\n\n\n#### 显示详细错误内容\n\n有时由于网络不太好或者其他情况会出现异常错误，如需要显示详细的异常信息，请在运行时加上选项 `--trace`：\n\n```shell\nnpx iconfont-update --trace\n```\n\n\n\n## 设计思路\n\n- 使用 [puppeteer](https://github.com/puppeteer/puppeteer) 模拟网页交互\n- 使用 [inquirer](https://github.com/SBoudrias/Inquirer.js) 和 [ora](https://github.com/sindresorhus/ora) 增强 CLI 交互\n- 使用 [css-tree](https://github.com/csstree/csstree) 处理 CSS AST\n- 使用 [configstore](https://github.com/yeoman/configstore) 保存用户设定值\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepfunc%2Fmp-iconfont-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepfunc%2Fmp-iconfont-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepfunc%2Fmp-iconfont-cli/lists"}