ibox 1.0.1

  • Readme
  • Changelog
  • Installing
  • 52

iBox #

一个 Dart 实现的终端指令盒子,简化一些常用指令,方便日常开发。A Dart Command Box for Developer.

Feature #

-------------- iBox($version) --------------
$ ibox npm -s, --server    set npm server.
$ ibox pub -l, --lint      pub publish --dry-run.
$ ibox pub -p, --publish   pub publish.

运行环境 #

当前指令需要运行在 Dart VM 环境下,所以需要正确安装 Dart SDKPub.这与 nodejsnpm 是一样的。可以参考 链接 配置你的运行环境。

Install #

$ pub global activate ibox

从 github 安装 #

$ pub global activate --source git https://github.com/Pluckypan/iBox.git

npm #

通过 ibox npm -s 即可切换 npm 镜像,再也不需要记住哪冗长的网址

➜  sample ibox npm -s
[1] https://registry.npmjs.org
[2] https://registry.npm.taobao.org
[✓] select a server : 2
registry => https://registry.npm.taobao.org/

pub #

由于中国大陆访问 pub.dev 比较慢,所以一般情况下,都会将 pub 镜像设置为 PUB_HOSTED_URL=https://pub.flutter-io.cn 。但是发布时,我们必须要设置回来,或者需要手动指定发布服务器比如 pub publish --server https://pub.dev/ 但是这些都太繁琐了,ibox 让一切变得更简单

  1. 发布预演 ibox pub -l
  2. 正式发布 ibox pub -p

本地调试 #

如果想下载代码学习,可按以下步骤:

$ mkdir dart && cd dart
$ git clone git@github.com:Pluckypan/iBox.git
$ cd iBox

# 启用 ibox
$ pub global activate --source path $PWD

# 测试 ibox
$ ibox

# 或者
$ pub global run ibox:main

# 停用 ibox
$ pub global deactivate ibox

# 查看所有 dart cli
$ pub global list

目录结构 #

➜  iBox git:(master) ✗ tree
.
├── CHANGELOG.md
├── LICENSE
├── README.md
├── bin
│   ├── main.dart
│   ├── npm.dart
│   └── pub.dart
├── doc.md
├── lib
│   └── helper.dart
├── pubspec.lock
└── pubspec.yaml

2 directories, 10 files

TODO #

  • [x] 修复 ibox pub -p 指令
  • [x] 读取 pubspec.yaml 参数,比如版本
  • [x] 修复 pubspec.yaml BUG:路径不对
  • [x] 修复 pub.dev 修改建议
  • [ ] 添加 ibox 配置文件 ibox.config
  • [ ] 优化 ibox npm --server 指令,显示当前选中
  • [ ] 添加 ibox npm --server --add 指令,可自己配置 npm 镜像
  • [ ] 添加 ibox npm --server --list 指令,列出已有 npm 镜像
  • [ ] 添加 ibox ssr -p 1991 指令
  • [ ] 添加 ibox git --commit 指令 统计贡献图、生成图形报表 、关联企业微信机器人
  • [ ] 修复只能通过 path 引用 helper.dart 的问题:源码模式下可以,但是发布后不可以

参考链接 #

说明 #

  1. iBox 目前只在 Mac 环境下进行过验证,不保证其他平台能正常运行
  2. 项目初衷只是为了熟悉 Dart 语言,理论上一些功能完全可以通过 alias实现

1.0.1 #

  1. 修复 pub.dev 修改建议

1.0.0 #

  1. 修复 pubspec.yaml BUG:路径不对导致的版本号无法获取的问题
  2. 修复 pub.dev 修改建议
  3. 发布 1.0.0 版本

0.0.3 #

  1. 修复 ibox pub -p 指令
  2. 读取 pubspec.yaml 参数,比如版本

0.0.2 #

  1. 修复 pub global activate ibox 激活包失败的问题

0.0.1 #

  1. 支持 npm 切换镜像
  2. 支持 pub 预演与发布

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate ibox

2. Use it

The package has the following executables:


$ ibox
Popularity:
Describes how popular the package is relative to other packages. [more]
9
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
52
Learn more about scoring.

We analyzed this package on Feb 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix bin/main.dart. (-1 points)

Analysis of bin/main.dart reported 2 hints:

line 9 col 8: Avoid relative imports for files in lib/.

line 19 col 16: Unnecessary new keyword.

Fix bin/npm.dart. (-0.50 points)

Analysis of bin/npm.dart reported 1 hint:

line 30 col 3: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: parsing /dart-sdk/lib/async/async.dart... parsing /dart-sdk/lib/collection/collection.dart... parsing /dart-sdk/lib/internal/internal.dart... parsing /dart-sdk/lib/convert/convert.dart... parsing /dart-sdk/lib/typed_data/typed_data.dart... parsing /dart-sdk/lib/core/core.dart... parsing /dart-sdk/lib/math/math.dart... parsing /dart-sdk/lib/developer/developer.dart... parsing /dart-sdk/lib/isolate/isolate.dart... parsing /dart-sdk/lib/ffi/ffi.dart... parsing /dart-sdk/lib/html/dart2js/html_dart2js.dart... parsing /dart-sdk/lib/html/html_common/html_common_dart2js.dart... parsing /dart-sdk/lib/web_gl/dart2js/web_gl_dart2js.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/native_typed_data.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/interceptors.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_helper.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/foreign_helper.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_names.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/rti.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart... parsing /dart-sdk/lib/js_util/dart2js/js_util_dart2js.dart... parsing /dart-sdk/lib/html/html_common/metadata.dart... parsing /dart-sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart... parsing /dart-sdk/lib/svg/dart2js/svg_dart2js.dart... parsing /dart-sdk/lib/web_audio/dart2js/web_audio_dart2js.dart... parsing /dart-sdk/lib/web_sql/dart2js/web_sql_dart2js.dart... parsing /dart-sdk/lib/_http/http.dart... parsing /dart-sdk/lib/io/io.dart... parsing /dart-sdk/lib/js/dart2js/js_dart2js.dart... parsing /dart-sdk/lib/js/_js.dart... parsing /dart-sdk/lib/mirrors/mirrors.dart... parsing /dart-sdk/lib/html/dartium/nativewrappers.dart... parsing /dart-sdk/lib/cli/cli.dart... parsing /dart-sdk/lib/wasm/wasm.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_primitives.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart... Initialized dartdoc with 37 libraries in 30.8 seconds documenting ibox Validating docs... no issues found Documented 0 public libraries in 2.1 seconds stderr: Documenting ibox... Unhandled exception: dartdoc could not find any libraries to document #0 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:196:7)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
args ^1.5.2 1.5.2
dart_inquirer ^1.0.0 1.0.0
io ^0.3.2+1 0.3.3
path ^1.6.4 1.6.4
yaml ^2.2.0 2.2.0
Transitive dependencies
charcode 1.1.3
collection 1.14.12
console 3.1.0
meta 1.1.8
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
vector_math 2.0.8