diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ca28535..66a5c50 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,16 +1,14 @@ # Simple workflow for deploying static content to GitHub Pages name: Deploy docs content to Pages +run-name: ${{ github.actor }} update docs on: - # Runs on pushes targeting the default branch push: - branches: ["master", "feature-docs"] + branches: + - master pull_request: - branches: ["master"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - + branches: + - master # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f82b66..13a6c5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.9.0](https://github.com/beezen/nucm/compare/v1.8.9...v1.9.0) (2024-01-15) + + +### Features + +* 新增 registry 命令管理本地镜像源 ([2accb87](https://github.com/beezen/nucm/commit/2accb873083e5e815d462dffbd2ada6d5fbf5227)) + ### [1.8.9](https://github.com/beezen/nucm/compare/v1.8.8...v1.8.9) (2024-01-12) diff --git a/README.md b/README.md index 294b94b..67ee6e7 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ NUCM 的全称为 NPM User Change Manager,是一款高效而直观的 NPM 账 4. [简单示例](#简单示例) 5. [注意事项](#注意事项) +## 详细文档 + +文档地址:[https://beezen.github.io/nucm/](https://beezen.github.io/nucm/) + ## 学习资料 - [【教程】优秀前端人必须知道的 NPM 账号管理工具 - nucm](https://juejin.cn/post/7059224326674841636) @@ -47,6 +51,7 @@ Commands: localize 使用本地化语言 update [options] 更新版本 save 保存当前账号 + registry|nrm 注册源配置 help [command] display help for command ``` diff --git a/README_EN.md b/README_EN.md index 2cee231..9e5e53d 100644 --- a/README_EN.md +++ b/README_EN.md @@ -16,6 +16,10 @@ The full name of NUCM is NPM User Change Manager, an efficient and intuitive too 4. [Simple Examples](#simple-examples) 5. [Considerations](#considerations) +## Document + +Document address:[https://beezen.github.io/nucm/](https://beezen.github.io/nucm/) + ## Learning Resources - [【教程】优秀前端人必须知道的 NPM 账号管理工具 - nucm](https://juejin.cn/post/7059224326674841636) @@ -46,6 +50,7 @@ Commands: localize|language use localized languages update [options] updated version save Save the current account + registry|nrm Registration source configuration help [command] display help for command ``` diff --git a/coverage/clover.xml b/coverage/clover.xml index c7e9062..438f584 100644 --- a/coverage/clover.xml +++ b/coverage/clover.xml @@ -1,7 +1,7 @@ - - - + + + @@ -11,10 +11,10 @@ - - + + - + @@ -64,61 +64,66 @@ - + - - + - - - - + + + + - - - - - + + + + + - - - + + + - - - - + + + + + - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -129,40 +134,44 @@ - + - - - - - - - + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json index 8d7789a..b928940 100644 --- a/coverage/coverage-final.json +++ b/coverage/coverage-final.json @@ -1,6 +1,6 @@ -{"/Users/beezen/mine/github/nucm/src/actions/base.js": {"path":"/Users/beezen/mine/github/nucm/src/actions/base.js","statementMap":{"0":{"start":{"line":9,"column":41},"end":{"line":9,"column":55}},"1":{"start":{"line":10,"column":21},"end":{"line":10,"column":82}},"2":{"start":{"line":11,"column":17},"end":{"line":11,"column":19}},"3":{"start":{"line":12,"column":22},"end":{"line":24,"column":3}},"4":{"start":{"line":13,"column":4},"end":{"line":23,"column":18}},"5":{"start":{"line":15,"column":27},"end":{"line":17,"column":58}},"6":{"start":{"line":18,"column":8},"end":{"line":20,"column":9}},"7":{"start":{"line":19,"column":10},"end":{"line":19,"column":75}},"8":{"start":{"line":21,"column":8},"end":{"line":21,"column":59}},"9":{"start":{"line":25,"column":23},"end":{"line":25,"column":38}},"10":{"start":{"line":26,"column":2},"end":{"line":28,"column":5}},"11":{"start":{"line":29,"column":2},"end":{"line":45,"column":3}},"12":{"start":{"line":30,"column":4},"end":{"line":30,"column":35}},"13":{"start":{"line":31,"column":4},"end":{"line":39,"column":20}},"14":{"start":{"line":34,"column":10},"end":{"line":36,"column":33}},"15":{"start":{"line":37,"column":8},"end":{"line":37,"column":80}},"16":{"start":{"line":40,"column":4},"end":{"line":40,"column":23}},"17":{"start":{"line":42,"column":20},"end":{"line":42,"column":74}},"18":{"start":{"line":43,"column":4},"end":{"line":43,"column":82}},"19":{"start":{"line":44,"column":4},"end":{"line":44,"column":46}},"20":{"start":{"line":46,"column":2},"end":{"line":46,"column":18}},"21":{"start":{"line":51,"column":41},"end":{"line":51,"column":55}},"22":{"start":{"line":52,"column":20},"end":{"line":52,"column":34}},"23":{"start":{"line":53,"column":21},"end":{"line":53,"column":36}},"24":{"start":{"line":54,"column":20},"end":{"line":54,"column":67}},"25":{"start":{"line":55,"column":2},"end":{"line":58,"column":3}},"26":{"start":{"line":56,"column":4},"end":{"line":56,"column":52}},"27":{"start":{"line":57,"column":4},"end":{"line":57,"column":11}},"28":{"start":{"line":59,"column":2},"end":{"line":60,"column":39}},"29":{"start":{"line":61,"column":2},"end":{"line":65,"column":5}},"30":{"start":{"line":62,"column":4},"end":{"line":64,"column":5}},"31":{"start":{"line":63,"column":6},"end":{"line":63,"column":44}},"32":{"start":{"line":66,"column":2},"end":{"line":66,"column":41}},"33":{"start":{"line":67,"column":2},"end":{"line":67,"column":34}},"34":{"start":{"line":68,"column":2},"end":{"line":68,"column":32}},"35":{"start":{"line":69,"column":2},"end":{"line":69,"column":64}},"36":{"start":{"line":74,"column":41},"end":{"line":74,"column":55}},"37":{"start":{"line":75,"column":23},"end":{"line":75,"column":38}},"38":{"start":{"line":76,"column":20},"end":{"line":76,"column":67}},"39":{"start":{"line":77,"column":2},"end":{"line":77,"column":49}},"40":{"start":{"line":78,"column":2},"end":{"line":78,"column":45}},"41":{"start":{"line":79,"column":2},"end":{"line":79,"column":58}},"42":{"start":{"line":80,"column":2},"end":{"line":80,"column":34}},"43":{"start":{"line":81,"column":2},"end":{"line":81,"column":51}},"44":{"start":{"line":82,"column":2},"end":{"line":85,"column":3}},"45":{"start":{"line":84,"column":4},"end":{"line":84,"column":21}},"46":{"start":{"line":90,"column":41},"end":{"line":90,"column":55}},"47":{"start":{"line":91,"column":23},"end":{"line":91,"column":38}},"48":{"start":{"line":92,"column":20},"end":{"line":92,"column":67}},"49":{"start":{"line":93,"column":2},"end":{"line":96,"column":3}},"50":{"start":{"line":94,"column":4},"end":{"line":94,"column":54}},"51":{"start":{"line":95,"column":4},"end":{"line":95,"column":11}},"52":{"start":{"line":97,"column":2},"end":{"line":97,"column":27}},"53":{"start":{"line":98,"column":2},"end":{"line":98,"column":34}},"54":{"start":{"line":99,"column":2},"end":{"line":99,"column":54}}},"fnMap":{"0":{"name":"getUserList","decl":{"start":{"line":8,"column":16},"end":{"line":8,"column":27}},"loc":{"start":{"line":8,"column":37},"end":{"line":47,"column":1}},"line":8},"1":{"name":"(anonymous_1)","decl":{"start":{"line":12,"column":22},"end":{"line":12,"column":23}},"loc":{"start":{"line":12,"column":50},"end":{"line":24,"column":3}},"line":12},"2":{"name":"(anonymous_2)","decl":{"start":{"line":14,"column":11},"end":{"line":14,"column":12}},"loc":{"start":{"line":14,"column":20},"end":{"line":22,"column":7}},"line":14},"3":{"name":"(anonymous_3)","decl":{"start":{"line":32,"column":11},"end":{"line":32,"column":12}},"loc":{"start":{"line":32,"column":29},"end":{"line":38,"column":7}},"line":32},"4":{"name":"changeUser","decl":{"start":{"line":50,"column":16},"end":{"line":50,"column":26}},"loc":{"start":{"line":50,"column":33},"end":{"line":70,"column":1}},"line":50},"5":{"name":"(anonymous_5)","decl":{"start":{"line":61,"column":35},"end":{"line":61,"column":36}},"loc":{"start":{"line":61,"column":44},"end":{"line":65,"column":3}},"line":61},"6":{"name":"addUser","decl":{"start":{"line":73,"column":16},"end":{"line":73,"column":23}},"loc":{"start":{"line":73,"column":37},"end":{"line":86,"column":1}},"line":73},"7":{"name":"removeUser","decl":{"start":{"line":89,"column":16},"end":{"line":89,"column":26}},"loc":{"start":{"line":89,"column":33},"end":{"line":100,"column":1}},"line":89}},"branchMap":{"0":{"loc":{"start":{"line":12,"column":32},"end":{"line":12,"column":48}},"type":"default-arg","locations":[{"start":{"line":12,"column":46},"end":{"line":12,"column":48}}],"line":12},"1":{"loc":{"start":{"line":15,"column":27},"end":{"line":17,"column":58}},"type":"cond-expr","locations":[{"start":{"line":16,"column":12},"end":{"line":16,"column":45}},{"start":{"line":17,"column":12},"end":{"line":17,"column":58}}],"line":15},"2":{"loc":{"start":{"line":18,"column":8},"end":{"line":20,"column":9}},"type":"if","locations":[{"start":{"line":18,"column":8},"end":{"line":20,"column":9}},{"start":{},"end":{}}],"line":18},"3":{"loc":{"start":{"line":29,"column":2},"end":{"line":45,"column":3}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":45,"column":3}},{"start":{"line":41,"column":9},"end":{"line":45,"column":3}}],"line":29},"4":{"loc":{"start":{"line":34,"column":10},"end":{"line":36,"column":33}},"type":"cond-expr","locations":[{"start":{"line":35,"column":14},"end":{"line":35,"column":48}},{"start":{"line":36,"column":14},"end":{"line":36,"column":33}}],"line":34},"5":{"loc":{"start":{"line":44,"column":13},"end":{"line":44,"column":44}},"type":"cond-expr","locations":[{"start":{"line":44,"column":23},"end":{"line":44,"column":31}},{"start":{"line":44,"column":34},"end":{"line":44,"column":44}}],"line":44},"6":{"loc":{"start":{"line":54,"column":20},"end":{"line":54,"column":67}},"type":"binary-expr","locations":[{"start":{"line":54,"column":20},"end":{"line":54,"column":61}},{"start":{"line":54,"column":65},"end":{"line":54,"column":67}}],"line":54},"7":{"loc":{"start":{"line":55,"column":2},"end":{"line":58,"column":3}},"type":"if","locations":[{"start":{"line":55,"column":2},"end":{"line":58,"column":3}},{"start":{},"end":{}}],"line":55},"8":{"loc":{"start":{"line":62,"column":4},"end":{"line":64,"column":5}},"type":"if","locations":[{"start":{"line":62,"column":4},"end":{"line":64,"column":5}},{"start":{},"end":{}}],"line":62},"9":{"loc":{"start":{"line":76,"column":20},"end":{"line":76,"column":67}},"type":"binary-expr","locations":[{"start":{"line":76,"column":20},"end":{"line":76,"column":61}},{"start":{"line":76,"column":65},"end":{"line":76,"column":67}}],"line":76},"10":{"loc":{"start":{"line":77,"column":2},"end":{"line":77,"column":48}},"type":"binary-expr","locations":[{"start":{"line":77,"column":2},"end":{"line":77,"column":20}},{"start":{"line":77,"column":25},"end":{"line":77,"column":47}}],"line":77},"11":{"loc":{"start":{"line":82,"column":2},"end":{"line":85,"column":3}},"type":"if","locations":[{"start":{"line":82,"column":2},"end":{"line":85,"column":3}},{"start":{},"end":{}}],"line":82},"12":{"loc":{"start":{"line":92,"column":20},"end":{"line":92,"column":67}},"type":"binary-expr","locations":[{"start":{"line":92,"column":20},"end":{"line":92,"column":61}},{"start":{"line":92,"column":65},"end":{"line":92,"column":67}}],"line":92},"13":{"loc":{"start":{"line":93,"column":2},"end":{"line":96,"column":3}},"type":"if","locations":[{"start":{"line":93,"column":2},"end":{"line":96,"column":3}},{"start":{},"end":{}}],"line":93}},"s":{"0":2,"1":2,"2":2,"3":2,"4":4,"5":10,"6":10,"7":4,"8":6,"9":2,"10":2,"11":2,"12":1,"13":1,"14":3,"15":3,"16":1,"17":1,"18":1,"19":1,"20":2,"21":2,"22":2,"23":2,"24":2,"25":2,"26":0,"27":0,"28":2,"29":2,"30":6,"31":1,"32":2,"33":2,"34":2,"35":2,"36":2,"37":2,"38":2,"39":2,"40":2,"41":2,"42":2,"43":2,"44":2,"45":0,"46":2,"47":2,"48":2,"49":2,"50":0,"51":0,"52":2,"53":2,"54":2},"f":{"0":2,"1":4,"2":10,"3":3,"4":2,"5":6,"6":2,"7":2},"b":{"0":[0],"1":[0,10],"2":[4,6],"3":[1,1],"4":[1,2],"5":[1,0],"6":[2,0],"7":[0,2],"8":[1,5],"9":[2,0],"10":[2,2],"11":[0,2],"12":[2,0],"13":[0,2]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"9df5c2eff606270b8453475dae0802d0193bfafc"} +{"/Users/beezen/mine/github/nucm/src/actions/base.js": {"path":"/Users/beezen/mine/github/nucm/src/actions/base.js","statementMap":{"0":{"start":{"line":9,"column":41},"end":{"line":9,"column":55}},"1":{"start":{"line":10,"column":21},"end":{"line":10,"column":82}},"2":{"start":{"line":11,"column":17},"end":{"line":11,"column":19}},"3":{"start":{"line":12,"column":22},"end":{"line":24,"column":3}},"4":{"start":{"line":13,"column":4},"end":{"line":23,"column":18}},"5":{"start":{"line":15,"column":27},"end":{"line":17,"column":58}},"6":{"start":{"line":18,"column":8},"end":{"line":20,"column":9}},"7":{"start":{"line":19,"column":10},"end":{"line":19,"column":75}},"8":{"start":{"line":21,"column":8},"end":{"line":21,"column":59}},"9":{"start":{"line":25,"column":23},"end":{"line":25,"column":38}},"10":{"start":{"line":26,"column":2},"end":{"line":28,"column":5}},"11":{"start":{"line":29,"column":2},"end":{"line":45,"column":3}},"12":{"start":{"line":30,"column":4},"end":{"line":30,"column":35}},"13":{"start":{"line":31,"column":4},"end":{"line":39,"column":20}},"14":{"start":{"line":34,"column":10},"end":{"line":36,"column":33}},"15":{"start":{"line":37,"column":8},"end":{"line":37,"column":80}},"16":{"start":{"line":40,"column":4},"end":{"line":40,"column":23}},"17":{"start":{"line":42,"column":20},"end":{"line":42,"column":74}},"18":{"start":{"line":43,"column":4},"end":{"line":43,"column":82}},"19":{"start":{"line":44,"column":4},"end":{"line":44,"column":46}},"20":{"start":{"line":46,"column":2},"end":{"line":46,"column":18}},"21":{"start":{"line":51,"column":41},"end":{"line":51,"column":55}},"22":{"start":{"line":52,"column":20},"end":{"line":52,"column":34}},"23":{"start":{"line":53,"column":21},"end":{"line":53,"column":36}},"24":{"start":{"line":54,"column":20},"end":{"line":54,"column":67}},"25":{"start":{"line":55,"column":2},"end":{"line":58,"column":3}},"26":{"start":{"line":56,"column":4},"end":{"line":56,"column":52}},"27":{"start":{"line":57,"column":4},"end":{"line":57,"column":11}},"28":{"start":{"line":59,"column":2},"end":{"line":60,"column":39}},"29":{"start":{"line":61,"column":2},"end":{"line":65,"column":5}},"30":{"start":{"line":62,"column":4},"end":{"line":64,"column":5}},"31":{"start":{"line":63,"column":6},"end":{"line":63,"column":44}},"32":{"start":{"line":66,"column":2},"end":{"line":66,"column":41}},"33":{"start":{"line":67,"column":2},"end":{"line":67,"column":34}},"34":{"start":{"line":68,"column":2},"end":{"line":68,"column":32}},"35":{"start":{"line":69,"column":2},"end":{"line":69,"column":64}},"36":{"start":{"line":74,"column":41},"end":{"line":74,"column":55}},"37":{"start":{"line":75,"column":23},"end":{"line":75,"column":38}},"38":{"start":{"line":76,"column":20},"end":{"line":76,"column":67}},"39":{"start":{"line":77,"column":2},"end":{"line":77,"column":49}},"40":{"start":{"line":78,"column":2},"end":{"line":78,"column":45}},"41":{"start":{"line":79,"column":2},"end":{"line":79,"column":58}},"42":{"start":{"line":80,"column":2},"end":{"line":80,"column":34}},"43":{"start":{"line":81,"column":2},"end":{"line":81,"column":51}},"44":{"start":{"line":82,"column":2},"end":{"line":85,"column":3}},"45":{"start":{"line":84,"column":4},"end":{"line":84,"column":21}},"46":{"start":{"line":90,"column":41},"end":{"line":90,"column":55}},"47":{"start":{"line":91,"column":23},"end":{"line":91,"column":38}},"48":{"start":{"line":92,"column":20},"end":{"line":92,"column":67}},"49":{"start":{"line":93,"column":2},"end":{"line":96,"column":3}},"50":{"start":{"line":94,"column":4},"end":{"line":94,"column":54}},"51":{"start":{"line":95,"column":4},"end":{"line":95,"column":11}},"52":{"start":{"line":97,"column":2},"end":{"line":97,"column":27}},"53":{"start":{"line":98,"column":2},"end":{"line":98,"column":34}},"54":{"start":{"line":99,"column":2},"end":{"line":99,"column":54}}},"fnMap":{"0":{"name":"getUserList","decl":{"start":{"line":8,"column":16},"end":{"line":8,"column":27}},"loc":{"start":{"line":8,"column":37},"end":{"line":47,"column":1}},"line":8},"1":{"name":"(anonymous_1)","decl":{"start":{"line":12,"column":22},"end":{"line":12,"column":23}},"loc":{"start":{"line":12,"column":50},"end":{"line":24,"column":3}},"line":12},"2":{"name":"(anonymous_2)","decl":{"start":{"line":14,"column":11},"end":{"line":14,"column":12}},"loc":{"start":{"line":14,"column":20},"end":{"line":22,"column":7}},"line":14},"3":{"name":"(anonymous_3)","decl":{"start":{"line":32,"column":11},"end":{"line":32,"column":12}},"loc":{"start":{"line":32,"column":29},"end":{"line":38,"column":7}},"line":32},"4":{"name":"changeUser","decl":{"start":{"line":50,"column":16},"end":{"line":50,"column":26}},"loc":{"start":{"line":50,"column":33},"end":{"line":70,"column":1}},"line":50},"5":{"name":"(anonymous_5)","decl":{"start":{"line":61,"column":35},"end":{"line":61,"column":36}},"loc":{"start":{"line":61,"column":44},"end":{"line":65,"column":3}},"line":61},"6":{"name":"addUser","decl":{"start":{"line":73,"column":16},"end":{"line":73,"column":23}},"loc":{"start":{"line":73,"column":37},"end":{"line":86,"column":1}},"line":73},"7":{"name":"removeUser","decl":{"start":{"line":89,"column":16},"end":{"line":89,"column":26}},"loc":{"start":{"line":89,"column":33},"end":{"line":100,"column":1}},"line":89}},"branchMap":{"0":{"loc":{"start":{"line":12,"column":32},"end":{"line":12,"column":48}},"type":"default-arg","locations":[{"start":{"line":12,"column":46},"end":{"line":12,"column":48}}],"line":12},"1":{"loc":{"start":{"line":15,"column":27},"end":{"line":17,"column":58}},"type":"cond-expr","locations":[{"start":{"line":16,"column":12},"end":{"line":16,"column":45}},{"start":{"line":17,"column":12},"end":{"line":17,"column":58}}],"line":15},"2":{"loc":{"start":{"line":18,"column":8},"end":{"line":20,"column":9}},"type":"if","locations":[{"start":{"line":18,"column":8},"end":{"line":20,"column":9}},{"start":{},"end":{}}],"line":18},"3":{"loc":{"start":{"line":29,"column":2},"end":{"line":45,"column":3}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":45,"column":3}},{"start":{"line":41,"column":9},"end":{"line":45,"column":3}}],"line":29},"4":{"loc":{"start":{"line":34,"column":10},"end":{"line":36,"column":33}},"type":"cond-expr","locations":[{"start":{"line":35,"column":14},"end":{"line":35,"column":48}},{"start":{"line":36,"column":14},"end":{"line":36,"column":33}}],"line":34},"5":{"loc":{"start":{"line":44,"column":13},"end":{"line":44,"column":44}},"type":"cond-expr","locations":[{"start":{"line":44,"column":23},"end":{"line":44,"column":31}},{"start":{"line":44,"column":34},"end":{"line":44,"column":44}}],"line":44},"6":{"loc":{"start":{"line":54,"column":20},"end":{"line":54,"column":67}},"type":"binary-expr","locations":[{"start":{"line":54,"column":20},"end":{"line":54,"column":61}},{"start":{"line":54,"column":65},"end":{"line":54,"column":67}}],"line":54},"7":{"loc":{"start":{"line":55,"column":2},"end":{"line":58,"column":3}},"type":"if","locations":[{"start":{"line":55,"column":2},"end":{"line":58,"column":3}},{"start":{},"end":{}}],"line":55},"8":{"loc":{"start":{"line":62,"column":4},"end":{"line":64,"column":5}},"type":"if","locations":[{"start":{"line":62,"column":4},"end":{"line":64,"column":5}},{"start":{},"end":{}}],"line":62},"9":{"loc":{"start":{"line":76,"column":20},"end":{"line":76,"column":67}},"type":"binary-expr","locations":[{"start":{"line":76,"column":20},"end":{"line":76,"column":61}},{"start":{"line":76,"column":65},"end":{"line":76,"column":67}}],"line":76},"10":{"loc":{"start":{"line":77,"column":2},"end":{"line":77,"column":48}},"type":"binary-expr","locations":[{"start":{"line":77,"column":2},"end":{"line":77,"column":20}},{"start":{"line":77,"column":25},"end":{"line":77,"column":47}}],"line":77},"11":{"loc":{"start":{"line":82,"column":2},"end":{"line":85,"column":3}},"type":"if","locations":[{"start":{"line":82,"column":2},"end":{"line":85,"column":3}},{"start":{},"end":{}}],"line":82},"12":{"loc":{"start":{"line":92,"column":20},"end":{"line":92,"column":67}},"type":"binary-expr","locations":[{"start":{"line":92,"column":20},"end":{"line":92,"column":61}},{"start":{"line":92,"column":65},"end":{"line":92,"column":67}}],"line":92},"13":{"loc":{"start":{"line":93,"column":2},"end":{"line":96,"column":3}},"type":"if","locations":[{"start":{"line":93,"column":2},"end":{"line":96,"column":3}},{"start":{},"end":{}}],"line":93}},"s":{"0":2,"1":2,"2":2,"3":2,"4":4,"5":11,"6":11,"7":4,"8":7,"9":2,"10":2,"11":2,"12":1,"13":1,"14":3,"15":3,"16":1,"17":1,"18":1,"19":1,"20":2,"21":2,"22":2,"23":2,"24":2,"25":2,"26":0,"27":0,"28":2,"29":2,"30":6,"31":1,"32":2,"33":2,"34":2,"35":2,"36":2,"37":2,"38":2,"39":2,"40":2,"41":2,"42":2,"43":2,"44":2,"45":0,"46":2,"47":2,"48":2,"49":2,"50":0,"51":0,"52":2,"53":2,"54":2},"f":{"0":2,"1":4,"2":11,"3":3,"4":2,"5":6,"6":2,"7":2},"b":{"0":[0],"1":[0,11],"2":[4,7],"3":[1,1],"4":[1,2],"5":[1,0],"6":[2,0],"7":[0,2],"8":[1,5],"9":[2,0],"10":[2,2],"11":[0,2],"12":[2,0],"13":[0,2]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"9df5c2eff606270b8453475dae0802d0193bfafc"} ,"/Users/beezen/mine/github/nucm/src/common/env.js": {"path":"/Users/beezen/mine/github/nucm/src/common/env.js","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},"1":{"start":{"line":9,"column":30},"end":{"line":9,"column":51}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"c1ac853590fa91dafb523783fe9844394cbf5b49"} -,"/Users/beezen/mine/github/nucm/src/common/index.js": {"path":"/Users/beezen/mine/github/nucm/src/common/index.js","statementMap":{"0":{"start":{"line":13,"column":16},"end":{"line":13,"column":28}},"1":{"start":{"line":14,"column":20},"end":{"line":14,"column":52}},"2":{"start":{"line":15,"column":19},"end":{"line":15,"column":50}},"3":{"start":{"line":16,"column":19},"end":{"line":16,"column":50}},"4":{"start":{"line":24,"column":2},"end":{"line":24,"column":78}},"5":{"start":{"line":24,"column":22},"end":{"line":24,"column":78}},"6":{"start":{"line":25,"column":19},"end":{"line":29,"column":3}},"7":{"start":{"line":30,"column":2},"end":{"line":30,"column":56}},"8":{"start":{"line":35,"column":15},"end":{"line":35,"column":63}},"9":{"start":{"line":36,"column":14},"end":{"line":36,"column":61}},"10":{"start":{"line":37,"column":12},"end":{"line":37,"column":16}},"11":{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},"12":{"start":{"line":39,"column":4},"end":{"line":39,"column":58}},"13":{"start":{"line":41,"column":2},"end":{"line":45,"column":4}},"14":{"start":{"line":53,"column":2},"end":{"line":56,"column":3}},"15":{"start":{"line":54,"column":4},"end":{"line":54,"column":51}},"16":{"start":{"line":55,"column":4},"end":{"line":55,"column":17}},"17":{"start":{"line":57,"column":2},"end":{"line":66,"column":3}},"18":{"start":{"line":58,"column":30},"end":{"line":63,"column":5}},"19":{"start":{"line":64,"column":4},"end":{"line":64,"column":35}},"20":{"start":{"line":65,"column":4},"end":{"line":65,"column":68}},"21":{"start":{"line":67,"column":2},"end":{"line":67,"column":14}},"22":{"start":{"line":76,"column":19},"end":{"line":76,"column":40}},"23":{"start":{"line":77,"column":2},"end":{"line":77,"column":27}},"24":{"start":{"line":77,"column":17},"end":{"line":77,"column":27}},"25":{"start":{"line":78,"column":23},"end":{"line":78,"column":33}},"26":{"start":{"line":79,"column":21},"end":{"line":79,"column":23}},"27":{"start":{"line":80,"column":19},"end":{"line":80,"column":79}},"28":{"start":{"line":83,"column":21},"end":{"line":83,"column":80}},"29":{"start":{"line":84,"column":2},"end":{"line":87,"column":3}},"30":{"start":{"line":86,"column":4},"end":{"line":86,"column":58}},"31":{"start":{"line":89,"column":2},"end":{"line":94,"column":3}},"32":{"start":{"line":90,"column":26},"end":{"line":90,"column":90}},"33":{"start":{"line":91,"column":4},"end":{"line":93,"column":5}},"34":{"start":{"line":92,"column":6},"end":{"line":92,"column":25}},"35":{"start":{"line":95,"column":2},"end":{"line":99,"column":4}},"36":{"start":{"line":107,"column":2},"end":{"line":113,"column":3}},"37":{"start":{"line":108,"column":4},"end":{"line":111,"column":6}},"38":{"start":{"line":112,"column":4},"end":{"line":112,"column":17}},"39":{"start":{"line":114,"column":2},"end":{"line":114,"column":14}},"40":{"start":{"line":122,"column":2},"end":{"line":122,"column":17}},"41":{"start":{"line":123,"column":2},"end":{"line":123,"column":33}},"42":{"start":{"line":123,"column":26},"end":{"line":123,"column":33}},"43":{"start":{"line":124,"column":21},"end":{"line":124,"column":32}},"44":{"start":{"line":125,"column":25},"end":{"line":125,"column":54}},"45":{"start":{"line":126,"column":2},"end":{"line":126,"column":41}},"46":{"start":{"line":126,"column":34},"end":{"line":126,"column":41}},"47":{"start":{"line":128,"column":2},"end":{"line":132,"column":5}},"48":{"start":{"line":133,"column":2},"end":{"line":133,"column":38}},"49":{"start":{"line":134,"column":2},"end":{"line":134,"column":39}},"50":{"start":{"line":142,"column":2},"end":{"line":146,"column":5}}},"fnMap":{"0":{"name":"setConfig","decl":{"start":{"line":23,"column":16},"end":{"line":23,"column":25}},"loc":{"start":{"line":23,"column":38},"end":{"line":31,"column":1}},"line":23},"1":{"name":"getConfig","decl":{"start":{"line":34,"column":16},"end":{"line":34,"column":25}},"loc":{"start":{"line":34,"column":28},"end":{"line":46,"column":1}},"line":34},"2":{"name":"checkConfigInit","decl":{"start":{"line":52,"column":16},"end":{"line":52,"column":31}},"loc":{"start":{"line":52,"column":34},"end":{"line":68,"column":1}},"line":52},"3":{"name":"getRegistryConfig","decl":{"start":{"line":75,"column":16},"end":{"line":75,"column":33}},"loc":{"start":{"line":75,"column":42},"end":{"line":100,"column":1}},"line":75},"4":{"name":"isEnabled","decl":{"start":{"line":106,"column":16},"end":{"line":106,"column":25}},"loc":{"start":{"line":106,"column":42},"end":{"line":115,"column":1}},"line":106},"5":{"name":"prepareEnv","decl":{"start":{"line":121,"column":16},"end":{"line":121,"column":26}},"loc":{"start":{"line":121,"column":37},"end":{"line":135,"column":1}},"line":121},"6":{"name":"initLanguage","decl":{"start":{"line":141,"column":16},"end":{"line":141,"column":28}},"loc":{"start":{"line":141,"column":41},"end":{"line":147,"column":1}},"line":141}},"branchMap":{"0":{"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":78}},"type":"if","locations":[{"start":{"line":24,"column":2},"end":{"line":24,"column":78}},{"start":{},"end":{}}],"line":24},"1":{"loc":{"start":{"line":24,"column":6},"end":{"line":24,"column":20}},"type":"binary-expr","locations":[{"start":{"line":24,"column":6},"end":{"line":24,"column":10}},{"start":{"line":24,"column":14},"end":{"line":24,"column":20}}],"line":24},"2":{"loc":{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},"type":"if","locations":[{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},{"start":{},"end":{}}],"line":38},"3":{"loc":{"start":{"line":53,"column":2},"end":{"line":56,"column":3}},"type":"if","locations":[{"start":{"line":53,"column":2},"end":{"line":56,"column":3}},{"start":{},"end":{}}],"line":53},"4":{"loc":{"start":{"line":57,"column":2},"end":{"line":66,"column":3}},"type":"if","locations":[{"start":{"line":57,"column":2},"end":{"line":66,"column":3}},{"start":{},"end":{}}],"line":57},"5":{"loc":{"start":{"line":77,"column":2},"end":{"line":77,"column":27}},"type":"if","locations":[{"start":{"line":77,"column":2},"end":{"line":77,"column":27}},{"start":{},"end":{}}],"line":77},"6":{"loc":{"start":{"line":84,"column":2},"end":{"line":87,"column":3}},"type":"if","locations":[{"start":{"line":84,"column":2},"end":{"line":87,"column":3}},{"start":{},"end":{}}],"line":84},"7":{"loc":{"start":{"line":84,"column":6},"end":{"line":84,"column":31}},"type":"binary-expr","locations":[{"start":{"line":84,"column":6},"end":{"line":84,"column":16}},{"start":{"line":84,"column":20},"end":{"line":84,"column":31}}],"line":84},"8":{"loc":{"start":{"line":91,"column":4},"end":{"line":93,"column":5}},"type":"if","locations":[{"start":{"line":91,"column":4},"end":{"line":93,"column":5}},{"start":{},"end":{}}],"line":91},"9":{"loc":{"start":{"line":107,"column":2},"end":{"line":113,"column":3}},"type":"if","locations":[{"start":{"line":107,"column":2},"end":{"line":113,"column":3}},{"start":{},"end":{}}],"line":107},"10":{"loc":{"start":{"line":123,"column":2},"end":{"line":123,"column":33}},"type":"if","locations":[{"start":{"line":123,"column":2},"end":{"line":123,"column":33}},{"start":{},"end":{}}],"line":123},"11":{"loc":{"start":{"line":126,"column":2},"end":{"line":126,"column":41}},"type":"if","locations":[{"start":{"line":126,"column":2},"end":{"line":126,"column":41}},{"start":{},"end":{}}],"line":126},"12":{"loc":{"start":{"line":131,"column":10},"end":{"line":131,"column":52}},"type":"binary-expr","locations":[{"start":{"line":131,"column":10},"end":{"line":131,"column":44}},{"start":{"line":131,"column":48},"end":{"line":131,"column":52}}],"line":131},"13":{"loc":{"start":{"line":134,"column":2},"end":{"line":134,"column":38}},"type":"binary-expr","locations":[{"start":{"line":134,"column":2},"end":{"line":134,"column":10}},{"start":{"line":134,"column":14},"end":{"line":134,"column":38}}],"line":134},"14":{"loc":{"start":{"line":141,"column":29},"end":{"line":141,"column":39}},"type":"default-arg","locations":[{"start":{"line":141,"column":35},"end":{"line":141,"column":39}}],"line":141}},"s":{"0":2,"1":2,"2":2,"3":2,"4":8,"5":0,"6":8,"7":8,"8":8,"9":8,"10":8,"11":8,"12":8,"13":8,"14":1,"15":0,"16":0,"17":1,"18":0,"19":0,"20":0,"21":1,"22":5,"23":5,"24":1,"25":4,"26":4,"27":4,"28":4,"29":4,"30":4,"31":4,"32":48,"33":48,"34":4,"35":4,"36":3,"37":1,"38":1,"39":2,"40":1,"41":1,"42":0,"43":1,"44":1,"45":1,"46":0,"47":1,"48":1,"49":1,"50":2},"f":{"0":8,"1":8,"2":1,"3":5,"4":3,"5":1,"6":2},"b":{"0":[0,8],"1":[8,8],"2":[8,0],"3":[0,1],"4":[0,1],"5":[1,4],"6":[4,0],"7":[4,4],"8":[4,44],"9":[1,2],"10":[0,1],"11":[0,1],"12":[1,1],"13":[1,1],"14":[2]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"63ef98432b17d01a3e7ecaff67ad0764e092f30e"} +,"/Users/beezen/mine/github/nucm/src/common/index.js": {"path":"/Users/beezen/mine/github/nucm/src/common/index.js","statementMap":{"0":{"start":{"line":14,"column":16},"end":{"line":14,"column":28}},"1":{"start":{"line":15,"column":20},"end":{"line":15,"column":52}},"2":{"start":{"line":16,"column":19},"end":{"line":16,"column":50}},"3":{"start":{"line":17,"column":19},"end":{"line":17,"column":50}},"4":{"start":{"line":25,"column":2},"end":{"line":25,"column":78}},"5":{"start":{"line":25,"column":22},"end":{"line":25,"column":78}},"6":{"start":{"line":26,"column":19},"end":{"line":30,"column":3}},"7":{"start":{"line":31,"column":2},"end":{"line":31,"column":56}},"8":{"start":{"line":36,"column":15},"end":{"line":36,"column":63}},"9":{"start":{"line":37,"column":14},"end":{"line":37,"column":61}},"10":{"start":{"line":38,"column":12},"end":{"line":38,"column":16}},"11":{"start":{"line":39,"column":2},"end":{"line":41,"column":3}},"12":{"start":{"line":40,"column":4},"end":{"line":40,"column":58}},"13":{"start":{"line":42,"column":2},"end":{"line":46,"column":4}},"14":{"start":{"line":54,"column":2},"end":{"line":57,"column":3}},"15":{"start":{"line":55,"column":4},"end":{"line":55,"column":51}},"16":{"start":{"line":56,"column":4},"end":{"line":56,"column":17}},"17":{"start":{"line":58,"column":2},"end":{"line":67,"column":3}},"18":{"start":{"line":59,"column":30},"end":{"line":64,"column":5}},"19":{"start":{"line":65,"column":4},"end":{"line":65,"column":35}},"20":{"start":{"line":66,"column":4},"end":{"line":66,"column":68}},"21":{"start":{"line":68,"column":2},"end":{"line":68,"column":14}},"22":{"start":{"line":77,"column":19},"end":{"line":77,"column":40}},"23":{"start":{"line":78,"column":2},"end":{"line":78,"column":27}},"24":{"start":{"line":78,"column":17},"end":{"line":78,"column":27}},"25":{"start":{"line":79,"column":23},"end":{"line":79,"column":55}},"26":{"start":{"line":80,"column":21},"end":{"line":80,"column":23}},"27":{"start":{"line":81,"column":19},"end":{"line":81,"column":79}},"28":{"start":{"line":83,"column":2},"end":{"line":88,"column":3}},"29":{"start":{"line":84,"column":26},"end":{"line":84,"column":90}},"30":{"start":{"line":85,"column":4},"end":{"line":87,"column":5}},"31":{"start":{"line":86,"column":6},"end":{"line":86,"column":25}},"32":{"start":{"line":89,"column":2},"end":{"line":93,"column":4}},"33":{"start":{"line":101,"column":2},"end":{"line":104,"column":3}},"34":{"start":{"line":102,"column":4},"end":{"line":102,"column":37}},"35":{"start":{"line":103,"column":4},"end":{"line":103,"column":17}},"36":{"start":{"line":105,"column":2},"end":{"line":105,"column":14}},"37":{"start":{"line":113,"column":27},"end":{"line":113,"column":51}},"38":{"start":{"line":114,"column":2},"end":{"line":134,"column":7}},"39":{"start":{"line":126,"column":6},"end":{"line":133,"column":7}},"40":{"start":{"line":127,"column":23},"end":{"line":127,"column":37}},"41":{"start":{"line":128,"column":8},"end":{"line":131,"column":9}},"42":{"start":{"line":129,"column":10},"end":{"line":129,"column":57}},"43":{"start":{"line":130,"column":10},"end":{"line":130,"column":17}},"44":{"start":{"line":132,"column":8},"end":{"line":132,"column":92}},"45":{"start":{"line":142,"column":2},"end":{"line":142,"column":17}},"46":{"start":{"line":143,"column":2},"end":{"line":143,"column":33}},"47":{"start":{"line":143,"column":26},"end":{"line":143,"column":33}},"48":{"start":{"line":144,"column":21},"end":{"line":144,"column":32}},"49":{"start":{"line":145,"column":25},"end":{"line":145,"column":54}},"50":{"start":{"line":146,"column":2},"end":{"line":146,"column":41}},"51":{"start":{"line":146,"column":34},"end":{"line":146,"column":41}},"52":{"start":{"line":148,"column":2},"end":{"line":152,"column":5}},"53":{"start":{"line":153,"column":2},"end":{"line":153,"column":38}},"54":{"start":{"line":154,"column":2},"end":{"line":154,"column":39}},"55":{"start":{"line":162,"column":2},"end":{"line":166,"column":5}}},"fnMap":{"0":{"name":"setConfig","decl":{"start":{"line":24,"column":16},"end":{"line":24,"column":25}},"loc":{"start":{"line":24,"column":38},"end":{"line":32,"column":1}},"line":24},"1":{"name":"getConfig","decl":{"start":{"line":35,"column":16},"end":{"line":35,"column":25}},"loc":{"start":{"line":35,"column":28},"end":{"line":47,"column":1}},"line":35},"2":{"name":"checkConfigInit","decl":{"start":{"line":53,"column":16},"end":{"line":53,"column":31}},"loc":{"start":{"line":53,"column":34},"end":{"line":69,"column":1}},"line":53},"3":{"name":"getRegistryConfig","decl":{"start":{"line":76,"column":16},"end":{"line":76,"column":33}},"loc":{"start":{"line":76,"column":42},"end":{"line":94,"column":1}},"line":76},"4":{"name":"isEnabled","decl":{"start":{"line":100,"column":16},"end":{"line":100,"column":25}},"loc":{"start":{"line":100,"column":42},"end":{"line":106,"column":1}},"line":100},"5":{"name":"setRegistryAlias","decl":{"start":{"line":112,"column":16},"end":{"line":112,"column":32}},"loc":{"start":{"line":112,"column":49},"end":{"line":135,"column":1}},"line":112},"6":{"name":"(anonymous_6)","decl":{"start":{"line":125,"column":10},"end":{"line":125,"column":11}},"loc":{"start":{"line":125,"column":23},"end":{"line":134,"column":5}},"line":125},"7":{"name":"prepareEnv","decl":{"start":{"line":141,"column":16},"end":{"line":141,"column":26}},"loc":{"start":{"line":141,"column":37},"end":{"line":155,"column":1}},"line":141},"8":{"name":"initLanguage","decl":{"start":{"line":161,"column":16},"end":{"line":161,"column":28}},"loc":{"start":{"line":161,"column":41},"end":{"line":167,"column":1}},"line":161}},"branchMap":{"0":{"loc":{"start":{"line":25,"column":2},"end":{"line":25,"column":78}},"type":"if","locations":[{"start":{"line":25,"column":2},"end":{"line":25,"column":78}},{"start":{},"end":{}}],"line":25},"1":{"loc":{"start":{"line":25,"column":6},"end":{"line":25,"column":20}},"type":"binary-expr","locations":[{"start":{"line":25,"column":6},"end":{"line":25,"column":10}},{"start":{"line":25,"column":14},"end":{"line":25,"column":20}}],"line":25},"2":{"loc":{"start":{"line":39,"column":2},"end":{"line":41,"column":3}},"type":"if","locations":[{"start":{"line":39,"column":2},"end":{"line":41,"column":3}},{"start":{},"end":{}}],"line":39},"3":{"loc":{"start":{"line":54,"column":2},"end":{"line":57,"column":3}},"type":"if","locations":[{"start":{"line":54,"column":2},"end":{"line":57,"column":3}},{"start":{},"end":{}}],"line":54},"4":{"loc":{"start":{"line":58,"column":2},"end":{"line":67,"column":3}},"type":"if","locations":[{"start":{"line":58,"column":2},"end":{"line":67,"column":3}},{"start":{},"end":{}}],"line":58},"5":{"loc":{"start":{"line":78,"column":2},"end":{"line":78,"column":27}},"type":"if","locations":[{"start":{"line":78,"column":2},"end":{"line":78,"column":27}},{"start":{},"end":{}}],"line":78},"6":{"loc":{"start":{"line":85,"column":4},"end":{"line":87,"column":5}},"type":"if","locations":[{"start":{"line":85,"column":4},"end":{"line":87,"column":5}},{"start":{},"end":{}}],"line":85},"7":{"loc":{"start":{"line":101,"column":2},"end":{"line":104,"column":3}},"type":"if","locations":[{"start":{"line":101,"column":2},"end":{"line":104,"column":3}},{"start":{},"end":{}}],"line":101},"8":{"loc":{"start":{"line":126,"column":6},"end":{"line":133,"column":7}},"type":"if","locations":[{"start":{"line":126,"column":6},"end":{"line":133,"column":7}},{"start":{},"end":{}}],"line":126},"9":{"loc":{"start":{"line":128,"column":8},"end":{"line":131,"column":9}},"type":"if","locations":[{"start":{"line":128,"column":8},"end":{"line":131,"column":9}},{"start":{},"end":{}}],"line":128},"10":{"loc":{"start":{"line":143,"column":2},"end":{"line":143,"column":33}},"type":"if","locations":[{"start":{"line":143,"column":2},"end":{"line":143,"column":33}},{"start":{},"end":{}}],"line":143},"11":{"loc":{"start":{"line":146,"column":2},"end":{"line":146,"column":41}},"type":"if","locations":[{"start":{"line":146,"column":2},"end":{"line":146,"column":41}},{"start":{},"end":{}}],"line":146},"12":{"loc":{"start":{"line":151,"column":10},"end":{"line":151,"column":52}},"type":"binary-expr","locations":[{"start":{"line":151,"column":10},"end":{"line":151,"column":44}},{"start":{"line":151,"column":48},"end":{"line":151,"column":52}}],"line":151},"13":{"loc":{"start":{"line":154,"column":2},"end":{"line":154,"column":38}},"type":"binary-expr","locations":[{"start":{"line":154,"column":2},"end":{"line":154,"column":10}},{"start":{"line":154,"column":14},"end":{"line":154,"column":38}}],"line":154},"14":{"loc":{"start":{"line":161,"column":29},"end":{"line":161,"column":39}},"type":"default-arg","locations":[{"start":{"line":161,"column":35},"end":{"line":161,"column":39}}],"line":161}},"s":{"0":2,"1":2,"2":2,"3":2,"4":8,"5":0,"6":8,"7":8,"8":8,"9":8,"10":8,"11":8,"12":8,"13":8,"14":1,"15":0,"16":0,"17":1,"18":0,"19":0,"20":0,"21":1,"22":5,"23":5,"24":1,"25":4,"26":4,"27":4,"28":4,"29":48,"30":48,"31":4,"32":4,"33":3,"34":1,"35":1,"36":2,"37":1,"38":1,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":1,"46":1,"47":0,"48":1,"49":1,"50":1,"51":0,"52":1,"53":1,"54":1,"55":2},"f":{"0":8,"1":8,"2":1,"3":5,"4":3,"5":1,"6":0,"7":1,"8":2},"b":{"0":[0,8],"1":[8,8],"2":[8,0],"3":[0,1],"4":[0,1],"5":[1,4],"6":[4,44],"7":[1,2],"8":[0,0],"9":[0,0],"10":[0,1],"11":[0,1],"12":[1,0],"13":[1,1],"14":[2]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"eade3e74e58ff9128d7dbbeab74db31d694c18cd"} ,"/Users/beezen/mine/github/nucm/src/lang/default/index.js": {"path":"/Users/beezen/mine/github/nucm/src/lang/default/index.js","statementMap":{"0":{"start":{"line":4,"column":28},"end":{"line":7,"column":1}}},"fnMap":{},"branchMap":{},"s":{"0":2},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"120561081555bfaa1259d646aefab0d4a129f872"} -,"/Users/beezen/mine/github/nucm/src/utils/index.js": {"path":"/Users/beezen/mine/github/nucm/src/utils/index.js","statementMap":{"0":{"start":{"line":11,"column":2},"end":{"line":11,"column":60}},"1":{"start":{"line":20,"column":2},"end":{"line":20,"column":34}},"2":{"start":{"line":20,"column":23},"end":{"line":20,"column":34}},"3":{"start":{"line":21,"column":2},"end":{"line":21,"column":56}},"4":{"start":{"line":21,"column":24},"end":{"line":21,"column":56}},"5":{"start":{"line":22,"column":2},"end":{"line":22,"column":52}},"6":{"start":{"line":32,"column":2},"end":{"line":32,"column":21}},"7":{"start":{"line":33,"column":2},"end":{"line":33,"column":21}},"8":{"start":{"line":34,"column":14},"end":{"line":34,"column":44}},"9":{"start":{"line":36,"column":2},"end":{"line":38,"column":3}},"10":{"start":{"line":37,"column":4},"end":{"line":37,"column":17}},"11":{"start":{"line":39,"column":2},"end":{"line":41,"column":3}},"12":{"start":{"line":40,"column":4},"end":{"line":40,"column":17}},"13":{"start":{"line":43,"column":2},"end":{"line":52,"column":3}},"14":{"start":{"line":43,"column":15},"end":{"line":43,"column":16}},"15":{"start":{"line":44,"column":17},"end":{"line":44,"column":32}},"16":{"start":{"line":45,"column":17},"end":{"line":45,"column":32}},"17":{"start":{"line":47,"column":4},"end":{"line":51,"column":5}},"18":{"start":{"line":48,"column":6},"end":{"line":48,"column":15}},"19":{"start":{"line":49,"column":11},"end":{"line":51,"column":5}},"20":{"start":{"line":50,"column":6},"end":{"line":50,"column":16}},"21":{"start":{"line":53,"column":2},"end":{"line":53,"column":11}},"22":{"start":{"line":59,"column":22},"end":{"line":59,"column":82}},"23":{"start":{"line":60,"column":2},"end":{"line":62,"column":3}},"24":{"start":{"line":61,"column":4},"end":{"line":61,"column":18}},"25":{"start":{"line":63,"column":2},"end":{"line":63,"column":15}},"26":{"start":{"line":76,"column":49},"end":{"line":76,"column":56}},"27":{"start":{"line":77,"column":22},"end":{"line":81,"column":3}},"28":{"start":{"line":82,"column":2},"end":{"line":82,"column":35}},"29":{"start":{"line":83,"column":17},"end":{"line":83,"column":33}},"30":{"start":{"line":84,"column":2},"end":{"line":84,"column":64}},"31":{"start":{"line":85,"column":2},"end":{"line":87,"column":3}},"32":{"start":{"line":86,"column":4},"end":{"line":86,"column":20}},"33":{"start":{"line":88,"column":2},"end":{"line":88,"column":24}}},"fnMap":{"0":{"name":"line","decl":{"start":{"line":10,"column":16},"end":{"line":10,"column":20}},"loc":{"start":{"line":10,"column":31},"end":{"line":12,"column":1}},"line":10},"1":{"name":"desensitize","decl":{"start":{"line":19,"column":16},"end":{"line":19,"column":27}},"loc":{"start":{"line":19,"column":33},"end":{"line":23,"column":1}},"line":19},"2":{"name":"compareVersion","decl":{"start":{"line":31,"column":16},"end":{"line":31,"column":30}},"loc":{"start":{"line":31,"column":39},"end":{"line":54,"column":1}},"line":31},"3":{"name":"getPackageManager","decl":{"start":{"line":57,"column":16},"end":{"line":57,"column":33}},"loc":{"start":{"line":57,"column":36},"end":{"line":64,"column":1}},"line":57},"4":{"name":"printLog","decl":{"start":{"line":75,"column":16},"end":{"line":75,"column":24}},"loc":{"start":{"line":75,"column":48},"end":{"line":89,"column":1}},"line":75}},"branchMap":{"0":{"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":34}},"type":"if","locations":[{"start":{"line":20,"column":2},"end":{"line":20,"column":34}},{"start":{},"end":{}}],"line":20},"1":{"loc":{"start":{"line":21,"column":2},"end":{"line":21,"column":56}},"type":"if","locations":[{"start":{"line":21,"column":2},"end":{"line":21,"column":56}},{"start":{},"end":{}}],"line":21},"2":{"loc":{"start":{"line":47,"column":4},"end":{"line":51,"column":5}},"type":"if","locations":[{"start":{"line":47,"column":4},"end":{"line":51,"column":5}},{"start":{"line":49,"column":11},"end":{"line":51,"column":5}}],"line":47},"3":{"loc":{"start":{"line":49,"column":11},"end":{"line":51,"column":5}},"type":"if","locations":[{"start":{"line":49,"column":11},"end":{"line":51,"column":5}},{"start":{},"end":{}}],"line":49},"4":{"loc":{"start":{"line":60,"column":2},"end":{"line":62,"column":3}},"type":"if","locations":[{"start":{"line":60,"column":2},"end":{"line":62,"column":3}},{"start":{},"end":{}}],"line":60},"5":{"loc":{"start":{"line":75,"column":34},"end":{"line":75,"column":46}},"type":"default-arg","locations":[{"start":{"line":75,"column":44},"end":{"line":75,"column":46}}],"line":75},"6":{"loc":{"start":{"line":76,"column":14},"end":{"line":76,"column":23}},"type":"default-arg","locations":[{"start":{"line":76,"column":21},"end":{"line":76,"column":23}}],"line":76},"7":{"loc":{"start":{"line":76,"column":25},"end":{"line":76,"column":39}},"type":"default-arg","locations":[{"start":{"line":76,"column":35},"end":{"line":76,"column":39}}],"line":76},"8":{"loc":{"start":{"line":82,"column":2},"end":{"line":82,"column":34}},"type":"binary-expr","locations":[{"start":{"line":82,"column":2},"end":{"line":82,"column":5}},{"start":{"line":82,"column":10},"end":{"line":82,"column":33}}],"line":82},"9":{"loc":{"start":{"line":84,"column":2},"end":{"line":84,"column":63}},"type":"binary-expr","locations":[{"start":{"line":84,"column":2},"end":{"line":84,"column":19}},{"start":{"line":84,"column":24},"end":{"line":84,"column":62}}],"line":84},"10":{"loc":{"start":{"line":85,"column":2},"end":{"line":87,"column":3}},"type":"if","locations":[{"start":{"line":85,"column":2},"end":{"line":87,"column":3}},{"start":{},"end":{}}],"line":85}},"s":{"0":13,"1":13,"2":1,"3":12,"4":6,"5":6,"6":7,"7":7,"8":7,"9":7,"10":1,"11":7,"12":3,"13":7,"14":7,"15":16,"16":16,"17":16,"18":3,"19":13,"20":2,"21":2,"22":1,"23":1,"24":1,"25":0,"26":14,"27":14,"28":14,"29":14,"30":14,"31":14,"32":5,"33":9},"f":{"0":13,"1":13,"2":7,"3":1,"4":14},"b":{"0":[1,12],"1":[6,6],"2":[3,13],"3":[2,11],"4":[1,0],"5":[2],"6":[12],"7":[9],"8":[14,2],"9":[14,9],"10":[5,9]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"8395100d83b6fadc268f5c02211c2a0996de6bd2"} +,"/Users/beezen/mine/github/nucm/src/utils/index.js": {"path":"/Users/beezen/mine/github/nucm/src/utils/index.js","statementMap":{"0":{"start":{"line":13,"column":2},"end":{"line":13,"column":60}},"1":{"start":{"line":22,"column":2},"end":{"line":22,"column":34}},"2":{"start":{"line":22,"column":23},"end":{"line":22,"column":34}},"3":{"start":{"line":23,"column":2},"end":{"line":23,"column":56}},"4":{"start":{"line":23,"column":24},"end":{"line":23,"column":56}},"5":{"start":{"line":24,"column":2},"end":{"line":24,"column":52}},"6":{"start":{"line":34,"column":2},"end":{"line":34,"column":21}},"7":{"start":{"line":35,"column":2},"end":{"line":35,"column":21}},"8":{"start":{"line":36,"column":14},"end":{"line":36,"column":44}},"9":{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},"10":{"start":{"line":39,"column":4},"end":{"line":39,"column":17}},"11":{"start":{"line":41,"column":2},"end":{"line":43,"column":3}},"12":{"start":{"line":42,"column":4},"end":{"line":42,"column":17}},"13":{"start":{"line":45,"column":2},"end":{"line":54,"column":3}},"14":{"start":{"line":45,"column":15},"end":{"line":45,"column":16}},"15":{"start":{"line":46,"column":17},"end":{"line":46,"column":32}},"16":{"start":{"line":47,"column":17},"end":{"line":47,"column":32}},"17":{"start":{"line":49,"column":4},"end":{"line":53,"column":5}},"18":{"start":{"line":50,"column":6},"end":{"line":50,"column":15}},"19":{"start":{"line":51,"column":11},"end":{"line":53,"column":5}},"20":{"start":{"line":52,"column":6},"end":{"line":52,"column":16}},"21":{"start":{"line":55,"column":2},"end":{"line":55,"column":11}},"22":{"start":{"line":61,"column":22},"end":{"line":61,"column":82}},"23":{"start":{"line":62,"column":2},"end":{"line":64,"column":3}},"24":{"start":{"line":63,"column":4},"end":{"line":63,"column":18}},"25":{"start":{"line":65,"column":2},"end":{"line":65,"column":15}},"26":{"start":{"line":78,"column":49},"end":{"line":78,"column":56}},"27":{"start":{"line":79,"column":22},"end":{"line":83,"column":3}},"28":{"start":{"line":84,"column":2},"end":{"line":84,"column":35}},"29":{"start":{"line":85,"column":17},"end":{"line":85,"column":33}},"30":{"start":{"line":86,"column":2},"end":{"line":86,"column":64}},"31":{"start":{"line":87,"column":2},"end":{"line":89,"column":3}},"32":{"start":{"line":88,"column":4},"end":{"line":88,"column":20}},"33":{"start":{"line":90,"column":2},"end":{"line":90,"column":24}},"34":{"start":{"line":95,"column":21},"end":{"line":95,"column":74}},"35":{"start":{"line":96,"column":17},"end":{"line":96,"column":45}},"36":{"start":{"line":97,"column":2},"end":{"line":97,"column":43}},"37":{"start":{"line":97,"column":29},"end":{"line":97,"column":43}},"38":{"start":{"line":98,"column":2},"end":{"line":98,"column":12}}},"fnMap":{"0":{"name":"line","decl":{"start":{"line":12,"column":16},"end":{"line":12,"column":20}},"loc":{"start":{"line":12,"column":31},"end":{"line":14,"column":1}},"line":12},"1":{"name":"desensitize","decl":{"start":{"line":21,"column":16},"end":{"line":21,"column":27}},"loc":{"start":{"line":21,"column":33},"end":{"line":25,"column":1}},"line":21},"2":{"name":"compareVersion","decl":{"start":{"line":33,"column":16},"end":{"line":33,"column":30}},"loc":{"start":{"line":33,"column":39},"end":{"line":56,"column":1}},"line":33},"3":{"name":"getPackageManager","decl":{"start":{"line":59,"column":16},"end":{"line":59,"column":33}},"loc":{"start":{"line":59,"column":36},"end":{"line":66,"column":1}},"line":59},"4":{"name":"printLog","decl":{"start":{"line":77,"column":16},"end":{"line":77,"column":24}},"loc":{"start":{"line":77,"column":48},"end":{"line":91,"column":1}},"line":77},"5":{"name":"getNrmModule","decl":{"start":{"line":94,"column":16},"end":{"line":94,"column":28}},"loc":{"start":{"line":94,"column":31},"end":{"line":99,"column":1}},"line":94}},"branchMap":{"0":{"loc":{"start":{"line":22,"column":2},"end":{"line":22,"column":34}},"type":"if","locations":[{"start":{"line":22,"column":2},"end":{"line":22,"column":34}},{"start":{},"end":{}}],"line":22},"1":{"loc":{"start":{"line":23,"column":2},"end":{"line":23,"column":56}},"type":"if","locations":[{"start":{"line":23,"column":2},"end":{"line":23,"column":56}},{"start":{},"end":{}}],"line":23},"2":{"loc":{"start":{"line":49,"column":4},"end":{"line":53,"column":5}},"type":"if","locations":[{"start":{"line":49,"column":4},"end":{"line":53,"column":5}},{"start":{"line":51,"column":11},"end":{"line":53,"column":5}}],"line":49},"3":{"loc":{"start":{"line":51,"column":11},"end":{"line":53,"column":5}},"type":"if","locations":[{"start":{"line":51,"column":11},"end":{"line":53,"column":5}},{"start":{},"end":{}}],"line":51},"4":{"loc":{"start":{"line":62,"column":2},"end":{"line":64,"column":3}},"type":"if","locations":[{"start":{"line":62,"column":2},"end":{"line":64,"column":3}},{"start":{},"end":{}}],"line":62},"5":{"loc":{"start":{"line":77,"column":34},"end":{"line":77,"column":46}},"type":"default-arg","locations":[{"start":{"line":77,"column":44},"end":{"line":77,"column":46}}],"line":77},"6":{"loc":{"start":{"line":78,"column":14},"end":{"line":78,"column":23}},"type":"default-arg","locations":[{"start":{"line":78,"column":21},"end":{"line":78,"column":23}}],"line":78},"7":{"loc":{"start":{"line":78,"column":25},"end":{"line":78,"column":39}},"type":"default-arg","locations":[{"start":{"line":78,"column":35},"end":{"line":78,"column":39}}],"line":78},"8":{"loc":{"start":{"line":84,"column":2},"end":{"line":84,"column":34}},"type":"binary-expr","locations":[{"start":{"line":84,"column":2},"end":{"line":84,"column":5}},{"start":{"line":84,"column":10},"end":{"line":84,"column":33}}],"line":84},"9":{"loc":{"start":{"line":86,"column":2},"end":{"line":86,"column":63}},"type":"binary-expr","locations":[{"start":{"line":86,"column":2},"end":{"line":86,"column":19}},{"start":{"line":86,"column":24},"end":{"line":86,"column":62}}],"line":86},"10":{"loc":{"start":{"line":87,"column":2},"end":{"line":89,"column":3}},"type":"if","locations":[{"start":{"line":87,"column":2},"end":{"line":89,"column":3}},{"start":{},"end":{}}],"line":87},"11":{"loc":{"start":{"line":97,"column":2},"end":{"line":97,"column":43}},"type":"if","locations":[{"start":{"line":97,"column":2},"end":{"line":97,"column":43}},{"start":{},"end":{}}],"line":97}},"s":{"0":14,"1":14,"2":1,"3":13,"4":5,"5":8,"6":7,"7":7,"8":7,"9":7,"10":1,"11":7,"12":3,"13":7,"14":7,"15":16,"16":16,"17":16,"18":3,"19":13,"20":2,"21":2,"22":1,"23":1,"24":1,"25":0,"26":13,"27":13,"28":13,"29":13,"30":13,"31":13,"32":5,"33":8,"34":0,"35":0,"36":0,"37":0,"38":0},"f":{"0":14,"1":14,"2":7,"3":1,"4":13,"5":0},"b":{"0":[1,13],"1":[5,8],"2":[3,13],"3":[2,11],"4":[1,0],"5":[2],"6":[11],"7":[8],"8":[13,2],"9":[13,8],"10":[5,8],"11":[0,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"c8a22a105a057f05ba1ed2f18ab0dec0a2475fcf"} } diff --git a/coverage/lcov.info b/coverage/lcov.info index 08e9401..a5d8846 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -12,7 +12,7 @@ FNF:8 FNH:8 FNDA:2,getUserList FNDA:4,(anonymous_1) -FNDA:10,(anonymous_2) +FNDA:11,(anonymous_2) FNDA:3,(anonymous_3) FNDA:2,changeUser FNDA:6,(anonymous_5) @@ -23,10 +23,10 @@ DA:10,2 DA:11,2 DA:12,2 DA:13,4 -DA:15,10 -DA:18,10 +DA:15,11 +DA:18,11 DA:19,4 -DA:21,6 +DA:21,7 DA:25,2 DA:26,2 DA:29,2 @@ -77,9 +77,9 @@ LF:55 LH:50 BRDA:12,0,0,0 BRDA:15,1,0,0 -BRDA:15,1,1,10 +BRDA:15,1,1,11 BRDA:18,2,0,4 -BRDA:18,2,1,6 +BRDA:18,2,1,7 BRDA:29,3,0,1 BRDA:29,3,1,1 BRDA:34,4,0,1 @@ -118,102 +118,111 @@ BRH:0 end_of_record TN: SF:src/common/index.js -FN:23,setConfig -FN:34,getConfig -FN:52,checkConfigInit -FN:75,getRegistryConfig -FN:106,isEnabled -FN:121,prepareEnv -FN:141,initLanguage -FNF:7 -FNH:7 +FN:24,setConfig +FN:35,getConfig +FN:53,checkConfigInit +FN:76,getRegistryConfig +FN:100,isEnabled +FN:112,setRegistryAlias +FN:125,(anonymous_6) +FN:141,prepareEnv +FN:161,initLanguage +FNF:9 +FNH:8 FNDA:8,setConfig FNDA:8,getConfig FNDA:1,checkConfigInit FNDA:5,getRegistryConfig FNDA:3,isEnabled +FNDA:1,setRegistryAlias +FNDA:0,(anonymous_6) FNDA:1,prepareEnv FNDA:2,initLanguage -DA:13,2 DA:14,2 DA:15,2 DA:16,2 -DA:24,8 +DA:17,2 DA:25,8 -DA:30,8 -DA:35,8 +DA:26,8 +DA:31,8 DA:36,8 DA:37,8 DA:38,8 DA:39,8 -DA:41,8 -DA:53,1 -DA:54,0 +DA:40,8 +DA:42,8 +DA:54,1 DA:55,0 -DA:57,1 -DA:58,0 -DA:64,0 +DA:56,0 +DA:58,1 +DA:59,0 DA:65,0 -DA:67,1 -DA:76,5 +DA:66,0 +DA:68,1 DA:77,5 -DA:78,4 +DA:78,5 DA:79,4 DA:80,4 +DA:81,4 DA:83,4 -DA:84,4 +DA:84,48 +DA:85,48 DA:86,4 DA:89,4 -DA:90,48 -DA:91,48 -DA:92,4 -DA:95,4 -DA:107,3 -DA:108,1 -DA:112,1 -DA:114,2 -DA:122,1 -DA:123,1 -DA:124,1 -DA:125,1 -DA:126,1 -DA:128,1 -DA:133,1 -DA:134,1 -DA:142,2 -LF:47 -LH:42 -BRDA:24,0,0,0 -BRDA:24,0,1,8 -BRDA:24,1,0,8 -BRDA:24,1,1,8 -BRDA:38,2,0,8 -BRDA:38,2,1,0 -BRDA:53,3,0,0 -BRDA:53,3,1,1 -BRDA:57,4,0,0 -BRDA:57,4,1,1 -BRDA:77,5,0,1 -BRDA:77,5,1,4 -BRDA:84,6,0,4 -BRDA:84,6,1,0 -BRDA:84,7,0,4 -BRDA:84,7,1,4 -BRDA:91,8,0,4 -BRDA:91,8,1,44 -BRDA:107,9,0,1 -BRDA:107,9,1,2 -BRDA:123,10,0,0 -BRDA:123,10,1,1 -BRDA:126,11,0,0 -BRDA:126,11,1,1 -BRDA:131,12,0,1 -BRDA:131,12,1,1 -BRDA:134,13,0,1 -BRDA:134,13,1,1 -BRDA:141,14,0,2 +DA:101,3 +DA:102,1 +DA:103,1 +DA:105,2 +DA:113,1 +DA:114,1 +DA:126,0 +DA:127,0 +DA:128,0 +DA:129,0 +DA:130,0 +DA:132,0 +DA:142,1 +DA:143,1 +DA:144,1 +DA:145,1 +DA:146,1 +DA:148,1 +DA:153,1 +DA:154,1 +DA:162,2 +LF:52 +LH:41 +BRDA:25,0,0,0 +BRDA:25,0,1,8 +BRDA:25,1,0,8 +BRDA:25,1,1,8 +BRDA:39,2,0,8 +BRDA:39,2,1,0 +BRDA:54,3,0,0 +BRDA:54,3,1,1 +BRDA:58,4,0,0 +BRDA:58,4,1,1 +BRDA:78,5,0,1 +BRDA:78,5,1,4 +BRDA:85,6,0,4 +BRDA:85,6,1,44 +BRDA:101,7,0,1 +BRDA:101,7,1,2 +BRDA:126,8,0,0 +BRDA:126,8,1,0 +BRDA:128,9,0,0 +BRDA:128,9,1,0 +BRDA:143,10,0,0 +BRDA:143,10,1,1 +BRDA:146,11,0,0 +BRDA:146,11,1,1 +BRDA:151,12,0,1 +BRDA:151,12,1,0 +BRDA:154,13,0,1 +BRDA:154,13,1,1 +BRDA:161,14,0,2 BRF:29 -BRH:22 +BRH:18 end_of_record TN: SF:src/lang/default/index.js @@ -227,70 +236,78 @@ BRH:0 end_of_record TN: SF:src/utils/index.js -FN:10,line -FN:19,desensitize -FN:31,compareVersion -FN:57,getPackageManager -FN:75,printLog -FNF:5 +FN:12,line +FN:21,desensitize +FN:33,compareVersion +FN:59,getPackageManager +FN:77,printLog +FN:94,getNrmModule +FNF:6 FNH:5 -FNDA:13,line -FNDA:13,desensitize +FNDA:14,line +FNDA:14,desensitize FNDA:7,compareVersion FNDA:1,getPackageManager -FNDA:14,printLog -DA:11,13 -DA:20,13 -DA:21,12 -DA:22,6 -DA:32,7 -DA:33,7 +FNDA:13,printLog +FNDA:0,getNrmModule +DA:13,14 +DA:22,14 +DA:23,13 +DA:24,8 DA:34,7 +DA:35,7 DA:36,7 -DA:37,1 -DA:39,7 -DA:40,3 -DA:43,7 -DA:44,16 -DA:45,16 +DA:38,7 +DA:39,1 +DA:41,7 +DA:42,3 +DA:45,7 +DA:46,16 DA:47,16 -DA:48,3 -DA:49,13 -DA:50,2 -DA:53,2 -DA:59,1 -DA:60,1 +DA:49,16 +DA:50,3 +DA:51,13 +DA:52,2 +DA:55,2 DA:61,1 -DA:63,0 -DA:76,14 -DA:77,14 -DA:82,14 -DA:83,14 -DA:84,14 -DA:85,14 -DA:86,5 -DA:88,9 -LF:31 +DA:62,1 +DA:63,1 +DA:65,0 +DA:78,13 +DA:79,13 +DA:84,13 +DA:85,13 +DA:86,13 +DA:87,13 +DA:88,5 +DA:90,8 +DA:95,0 +DA:96,0 +DA:97,0 +DA:98,0 +LF:35 LH:30 -BRDA:20,0,0,1 -BRDA:20,0,1,12 -BRDA:21,1,0,6 -BRDA:21,1,1,6 -BRDA:47,2,0,3 -BRDA:47,2,1,13 -BRDA:49,3,0,2 -BRDA:49,3,1,11 -BRDA:60,4,0,1 -BRDA:60,4,1,0 -BRDA:75,5,0,2 -BRDA:76,6,0,12 -BRDA:76,7,0,9 -BRDA:82,8,0,14 -BRDA:82,8,1,2 -BRDA:84,9,0,14 -BRDA:84,9,1,9 -BRDA:85,10,0,5 -BRDA:85,10,1,9 -BRF:19 +BRDA:22,0,0,1 +BRDA:22,0,1,13 +BRDA:23,1,0,5 +BRDA:23,1,1,8 +BRDA:49,2,0,3 +BRDA:49,2,1,13 +BRDA:51,3,0,2 +BRDA:51,3,1,11 +BRDA:62,4,0,1 +BRDA:62,4,1,0 +BRDA:77,5,0,2 +BRDA:78,6,0,11 +BRDA:78,7,0,8 +BRDA:84,8,0,13 +BRDA:84,8,1,2 +BRDA:86,9,0,13 +BRDA:86,9,1,8 +BRDA:87,10,0,5 +BRDA:87,10,1,8 +BRDA:97,11,0,0 +BRDA:97,11,1,0 +BRF:21 BRH:18 end_of_record diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index b11f4ca..be4b660 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -6,7 +6,18 @@ module.exports = { themeConfig: { repo: "https://github.com/beezen/nucm", repoLabel: "查看源码", - sidebar: ["/", "/start", "/add", "/del", "/save", "/list", "/use", "/localize", "/update"], + sidebar: [ + "/", + "/start", + "/add", + "/del", + "/save", + "/list", + "/use", + "/localize", + "/update", + "/registry" + ], nav: [ { text: "更新记录", diff --git a/docs/list.md b/docs/list.md index a84573d..8b398c8 100644 --- a/docs/list.md +++ b/docs/list.md @@ -23,25 +23,25 @@ $ nucm ls [options] ## 详细 -仅查看当前源下的账号列表,且账号都脱敏显示 +1、仅查看当前源下的账号列表,且账号都脱敏显示 ```bash $ nucm ls ``` -仅查看当前源下的账号列表,且账号都完整显示(请注意保护自己的账号) +2、仅查看当前源下的账号列表,且账号都完整显示(请注意保护自己的账号) ```bash $ nucm ls -l #或 --list ``` -查看所有注册源下的账号列表,且账号都脱敏显示 +3、查看所有注册源下的账号列表,且账号都脱敏显示 ```bash $ nucm ls -a #或 --all ``` -查看所有注册源下的账号列表,且账号都完整显示(请注意保护自己的账号) +4、查看所有注册源下的账号列表,且账号都完整显示(请注意保护自己的账号) ```bash $ nucm ls -al #或 --all --list diff --git a/docs/localize.md b/docs/localize.md index 5143a6c..7fc590c 100644 --- a/docs/localize.md +++ b/docs/localize.md @@ -23,13 +23,13 @@ $ nucm localize ## 详细 -切换英文版本 +1、切换英文版本 ```bash $ nucm localize en ``` -切换中文版本 +2、切换中文版本 ```bash $ nucm localize cn diff --git a/docs/registry.md b/docs/registry.md new file mode 100644 index 0000000..b7aa990 --- /dev/null +++ b/docs/registry.md @@ -0,0 +1,102 @@ +--- +title: nucm registry 镜像源操作 +--- + +# 镜像源操作 + +通过 NUCM 可以轻松管理 NPM 的镜像源,实现快速切换能力。 + +## 命令 + +```bash +$ nucm registry +``` + +## `cmd...` 变长参数 + +### `ls` + +查看镜像源列表。 + +### `add ` + +添加镜像源和别名。 + +`name` + +- Default: null +- Required: true + +镜像源的别名 + +`url` + +- Default: null +- Required: true + +镜像源的地址 + +### `use ` + +切换当前镜像源。 + +`name` + +- Default: null +- Required: true + +镜像源的别名 + +### `del ` + +删除指定镜像源。 + +`name` + +- Default: null +- Required: true + +镜像源的别名 + +## 详细 + +1、查看当前镜像源列表 + +```bash +$ nucm registry ls + + npm ----------------------- https://registry.npmjs.org/ + yarn ---------------------- https://registry.yarnpkg.com/ + tencent ------------------- https://mirrors.cloud.tencent.com/npm/ + cnpm ---------------------- https://r.cnpmjs.org/ +* taobao -------------------- https://registry.npmmirror.com/ + npmMirror ----------------- https://skimdb.npmjs.com/registry/ +``` + +2、添加新的镜像源配置 + +```bash +$ nucm registry add testRegistry https://xxx.registry.com/ +``` + +3、切换当前使用镜像源 + +```bash +$ nucm registry use testRegistry + +SUCCESS The registry has been changed to 'testRegistry'. +``` + +4、删除指定镜像源 + +```bash +$ nucm registry del testRegistry + +SUCCESS The registry 'testRegistry' has been deleted successfully. +``` + +## 使用 NRM 管理镜像源 + +NUCM 工具默认内置了 NRM 模块,以便更便捷地管理 NPM 镜像源。开发者执行的 `nucm registry ` 命令会被自动代理到 `nrm ` 命令。有关 ` `的详细指令,请参考 [NRM 使用文档](https://www.npmjs.com/package/nrm)。 + +如果您已经在本地安装了 nrm 工具,可以继续使用它,而不会与 nucm 工具发生冲突。 diff --git a/docs/save.md b/docs/save.md index bb224dc..6f08575 100644 --- a/docs/save.md +++ b/docs/save.md @@ -14,7 +14,7 @@ $ nucm save ## 详细 -保存当前用户账号,提示输入账号别名(默认为随机名称) +1、保存当前用户账号,提示输入账号别名(默认为随机名称) ```bash $ nucm save @@ -22,7 +22,7 @@ $ nucm save ? 当前账号未被存储,建议立即存储。请输入当前账号别名 (nucm_1704675236801) ``` -当前账号已存在时,提示是否需要更新别名 +2、当前账号已存在时,提示是否需要更新别名 ```bash $ nucm save diff --git a/docs/update.md b/docs/update.md index 4910f78..fdf9130 100644 --- a/docs/update.md +++ b/docs/update.md @@ -23,7 +23,7 @@ $ nucm update [options] ## 详细 -询问式更新。检查最新的工具版本,并询问是否需要更新。 +1、询问式更新。检查最新的工具版本,并询问是否需要更新。 ```bash $ nucm update @@ -33,7 +33,7 @@ $ nucm update 🌟 nucm 1.8.0 → 1.8.7 (Y/n) ``` -静默更新。检测到可更新版本时,会自动更新到最新,适用于自动化 CI/CD 流程。 +2、静默更新。检测到可更新版本时,会自动更新到最新,适用于自动化 CI/CD 流程。 ```bash $ nucm update --silent diff --git a/package.json b/package.json index c43f3c1..dbbf89b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nucm", - "version": "1.8.9", + "version": "1.9.0", "description": "NPM User Change Manager(NPM 用户账号切换管理)", "main": "./bin/index.js", "scripts": { @@ -47,6 +47,7 @@ "i18next": "^23.7.16", "ini": "^2.0.0", "inquirer": "^8.2.0", + "nrm": "^1.2.6", "os": "^0.1.2", "shelljs": "^0.8.5" }, diff --git a/src/actions/registry.js b/src/actions/registry.js new file mode 100644 index 0000000..bb80719 --- /dev/null +++ b/src/actions/registry.js @@ -0,0 +1,11 @@ +import shell from "shelljs"; +import { getNrmModule, printLog } from "../utils/index"; +/** 代理 NRM 工具指令 */ +export function proxyNrm(cmd) { + const nrmCmd = cmd.join(" "); + const nrmCli = getNrmModule(); + if (!nrmCli) { + return printLog("registry.noNrm"); + } + shell.exec(`node ${nrmCli} ${nrmCmd}`); +} diff --git a/src/common/index.js b/src/common/index.js index bb38cfd..8a05038 100644 --- a/src/common/index.js +++ b/src/common/index.js @@ -2,10 +2,11 @@ import path from "path"; import ini from "ini"; import fs from "fs-extra"; import os from "os"; +import inquirer from "inquirer"; import shell from "shelljs"; import "colors"; import { init, changeLanguage } from "i18next"; -import { printLog } from "../utils/index"; +import { printLog, getNrmModule } from "../utils/index"; import registries from "../constants/registries.json"; import { resourcesAll } from "../lang/default/index"; import { baseInitConfig } from "./env"; @@ -75,16 +76,9 @@ export function checkConfigInit() { export function getRegistryConfig(config) { const registry = config?.npm?.registry; // 当前启用源地址 if (!registry) return {}; - let registriesList = registries; // 源注册表 + let registriesList = { ...registries, ...config.nrm }; // 源注册表 let registryName = ""; let _authtoken = config.npm[`${registry.replace(/^https?:/, "")}:_authToken`]; // 当前源的用户账号令牌 - - // 校验 nrm 是否存在 - const nrmVersion = shell.exec("nrm --version", { silent: true }).stdout.trim(); - if (nrmVersion && config?.nrm) { - // 判断配置文件是否存在 - registriesList = { ...registriesList, ...config.nrm }; - } // 获取当前源别名 for (let key in registriesList) { let currentRegistry = registriesList[key]?.registry?.replace(/^https?:\/\/|\/*$/g, ""); @@ -105,15 +99,41 @@ export function getRegistryConfig(config) { */ export function isEnabled(registryConfig) { if (!registryConfig.registryName) { - printLog( - `registry: ${registryConfig.registry}.${printLog("registry.manage", { isPrint: false })}`, - { type: "error" } - ); + setRegistryAlias(registryConfig); return false; } return true; } +/** + * 设置注册源别名 + * @param {*} registryConfig 注册源配置 + */ +export function setRegistryAlias(registryConfig) { + let registryRandomName = `registry_${Date.now()}`; + inquirer + .prompt([ + { + type: "input", + message: `【${registryConfig.registry}】${printLog("registry.setAlias", { + isPrint: false + })}`, + name: "registryName", + default: registryRandomName + } + ]) + .then((answers) => { + if (answers.registryName) { + const nrmCli = getNrmModule(); + if (!nrmCli) { + printLog("registry.manage", { type: "error" }); + return; + } + shell.exec(`node ${nrmCli} add ${answers.registryName} ${registryConfig.registry}`); + } + }); +} + /** * 环境准备 * @param callback 回调函数 diff --git a/src/index.js b/src/index.js index 7e3442f..d9eac56 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ import { Command } from "commander"; import { prepareEnv } from "./common/index"; import { getUserList, changeUser, addUser, removeUser } from "./actions/base"; import { updateVersion, changeLang, searchToSave } from "./actions/helper"; +import { proxyNrm } from "./actions/registry"; import { printLog } from "./utils/index"; prepareEnv(() => { const pkg = require("../package.json"); @@ -40,6 +41,11 @@ prepareEnv(() => { .command("save") .description(printLog("command.saveAccount", { isPrint: false })) .action(searchToSave); + program + .command("registry ") + .alias("nrm") + .description(printLog("command.registry", { isPrint: false })) + .action(proxyNrm); program.parse(process.argv); }); diff --git a/src/lang/default/en/base.json b/src/lang/default/en/base.json index 588a7d3..ac61545 100644 --- a/src/lang/default/en/base.json +++ b/src/lang/default/en/base.json @@ -11,7 +11,8 @@ "localizedLang": "use localized languages", "update": "updated version", "updateSilent": "silent", - "saveAccount": "Save the current account" + "saveAccount": "Save the current account", + "registry": "Registration source configuration" }, "account": { "noData": "No account information at present; Please enter 'nucm add ' to add", @@ -32,7 +33,10 @@ "changed": "Switched to language {{language}}" }, "registry": { - "manage": "To manage other source account information, recommend NRM to register other sources.NRM document: https://www.npmjs.com/package/nrm ." + "setAlias": "The current source has not been managed, please set the aliases.", + "fail": "The registered source operation is abnormal.", + "noNrm": "The registered source operation is abnormal, please reinstall the nucm tool", + "manage": "The registered source operation is abnormal. If you want to manage other source account information, it is recommended to register with other sources with NRM.NRM document: https://www.npmjs.com/package/nrm ." }, "save": { "fail": "No account information is not queried.Refer to login or integrated flow: https://docs.npmjs.com/getting-started and https://docs.npmjs.com/integrations", diff --git a/src/lang/default/zh/base.json b/src/lang/default/zh/base.json index 0817896..745bea0 100644 --- a/src/lang/default/zh/base.json +++ b/src/lang/default/zh/base.json @@ -11,7 +11,8 @@ "localizedLang": "使用本地化语言", "update": "更新版本", "updateSilent": "静默的", - "saveAccount": "保存当前账号" + "saveAccount": "保存当前账号", + "registry": "注册源配置" }, "account": { "noData": "暂无账号信息;请输入 nucm add 进行添加", @@ -32,7 +33,10 @@ "changed": "已切换到语言 {{language}}" }, "registry": { - "manage": "若要管理其他源账号信息,建议使用 NRM 对其他源进行注册。NRM 文档:https://www.npmjs.com/package/nrm 。" + "setAlias": "当前源还未被管理,请设置别名", + "fail": "注册源操作异常", + "noNrm": "注册源操作异常,请重新安装 nucm 工具", + "manage": "注册源操作异常,若要管理其他源账号信息,建议使用 NRM 对其他源进行注册。NRM 文档:https://www.npmjs.com/package/nrm 。" }, "save": { "fail": "未查询到相关账号信息。可参考登录或集成流程:https://docs.npmjs.com/getting-started 和 https://docs.npmjs.com/integrations", diff --git a/src/utils/index.js b/src/utils/index.js index e53a183..ef786e1 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,6 +1,8 @@ import shell from "shelljs"; import { t } from "i18next"; import colors from "colors"; +import path from "path"; +import fs from "fs-extra"; /** * 链接符号 * @param str 字符传 @@ -87,3 +89,11 @@ export function printLog(message, options = {}) { } console.log(tMessage); } + +/** 获取 nrm 模块 */ +export function getNrmModule() { + const npmBinPath = shell.exec("npm bin", { silent: true }).stdout.trim(); + const nrmCli = path.join(npmBinPath, "nrm"); + if (fs.existsSync(nrmCli)) return nrmCli; + return ""; +}