generate 0.2.1+3

  • Readme
  • Changelog
  • Installing
  • 46

generate #

generate 是一個 命令行工具 用來自動 創建一些 程式語言的 代碼

DART_GENERATE_TEMPLATE #

generate 創建的 代碼 內置 了 一些模板

同時 generate 允許 用戶創建一些 自定義的 代碼模板 generate 或從 環境變量 DART_GENERATE_TEMPLATE 中 查找 代碼模板

代碼模板 可以是 一個 檔案夾/檔案 以這個 檔案夾/檔案 作爲 模板名

模板位置 #

自定義模板 應該放置在 DART_GENERATE_TEMPLATE 中和 當前 命令 相同的 子目錄中

比如 generate dart version 指令 會 查找 $DART_GENERATE_TEMPLATE/dart/version 下的 所有模板

公共模板 #

https://gitlab.com/king011/generate_template.git

0.2.1+3 #

  • support rename template _ fix some bug

0.2.0 #

  • support user template

0.1.0+3 #

  • update bash-completion
  • update go init create build-go.sh
  • update go init create grpc code

0.1.0 #

  • generate golang code for console,version

0.0.2 #

  • Initial version, created by Stagehand

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate generate

2. Use it

The package has the following executables:


$ generate

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  generate: ^0.2.1+3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:generate/generate.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
94
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
46
Learn more about scoring.

We analyzed this package on Nov 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: other

Primary library: package:generate/generate.dart with components: io, isolate, mirrors.

Health suggestions

Fix lib/template/manager.dart. (-2.48 points)

Analysis of lib/template/manager.dart reported 5 hints:

line 16 col 24: Avoid const keyword.

line 17 col 25: Avoid const keyword.

line 18 col 25: Avoid const keyword.

line 26 col 28: Avoid const keyword.

line 230 col 30: Avoid empty catch blocks.

Fix lib/cmd/go.dart. (-1.49 points)

Analysis of lib/cmd/go.dart reported 3 hints:

line 21 col 14: This function has a return type of 'int', but doesn't end with a return statement.

line 76 col 14: This function has a return type of 'int', but doesn't end with a return statement.

line 183 col 14: This function has a return type of 'int', but doesn't end with a return statement.

Fix lib/cmd/dart.dart. (-1 points)

Analysis of lib/cmd/dart.dart reported 2 hints:

line 20 col 14: This function has a return type of 'int', but doesn't end with a return statement.

line 74 col 14: This function has a return type of 'int', but doesn't end with a return statement.

Fix lib/cmd/completion.dart. (-0.50 points)

Analysis of lib/cmd/completion.dart reported 1 hint:

line 25 col 14: This function has a return type of 'int', but doesn't end with a return statement.

Fix lib/cmd/root.dart. (-0.50 points)

Analysis of lib/cmd/root.dart reported 1 hint:

line 22 col 14: This function has a return type of 'int', but doesn't end with a return statement.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and generate.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
mustache ^1.1.1 1.1.1
path ^1.6.2 1.6.4
resource ^2.1.5 2.1.6
wrapper_args ^1.0.0 1.0.1+1
Transitive dependencies
args 1.5.2
typed_data 1.1.6
Dev dependencies
pedantic ^1.0.0
test ^1.0.0