You can define "hints" for your questions!
pub global activate stagedive
# activate stagedive again pub global activate stagedive
pub global deactivate stagedive
Usage: stagedive -n <new project folder> -p <template project> -t <template name> -e, --extension Template extension, stripped during copy -s, --settings Prints settings -h, --help Shows this message -l, --list List available templates -n, --newprojectdir New project folder -p, --templateproject Template project (e.g. stagedive) -t, --template Template name (e.g. console) -v, --loglevel Sets the appropriate loglevel [info, debug, warning] Sample: Generate project in example/console: 'stagedive -n example/console -p stagedive -t console'
stagedive -l - List the available templates
It looks for a template in lib_templates. If it finds a _template folder it scans for subfolders with manifest.yaml.
At the moment the only packages that has a _template folder is StageDive but you can define your own _templates-folder in your package.
stagedive -n example/console -p stagedive -t console
This command will prompt you for your name and your email address.
StageDive creates the appropriate sample in example/console.
StageDive takes all variables defined in the manifest.yaml and replaces the according template fields.
There is one extra variable:
basename is the name you specify with the -t option.
<%= varname %>
-e option allows you to specify a template extension that will
be stripped when copying files from the template to their new
locations. This lets you distinguish between Dart files and Dart file
templates, for example, in situations where you have tools that
blindly operate on all
.dart files in your project.
#templatename is not optional! templatename: Simple Console prompts: name: type: input question: "Add your name:" hint: "Used for the pubspec 'name:' field" email: type: input question: "Your email address:"
At the moment the there are two input types:
input: Asks you the 'question' and stores the answer in the defined variable.
lowercase: Same as input but changes the answer to lowercase.
uppercase: Same as input but changes the answer to uppercase.
StageDive scans your installed packages (pub-cache).
This means StageDive recognizes only installed packages by default. If you want to change this behaviour or if you want to test your templates before installing them do the following:
In your project folder, create
or for multiple templates:
templatefolder: - lib/_templates - temp/_templates
With this - StageDive knows how to find your local templates!
Copyright 2015 Michael Mitterer (firstname.lastname@example.org), IT-Consulting and Development Limited, Austrian Branch Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
If this plugin is helpful for you - please (Circle) me or star this repo here on GitHub.
StageDive creates a template-based project for you
This CHANGELOG.md was generated with Changelog for Dart
You can install the package from the command line:
$ pub global activate stagedive
The package has the following executables:
Add this to your package's pubspec.yaml file:
dependencies: stagedive: ^0.5.1
You can install packages from the command line:
$ pub get
Alternatively, your editor might support
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|0.5.1||Nov 16, 2016|
|0.5.0||Oct 20, 2016|
|0.4.2||Dec 10, 2015|
|0.4.1||Dec 10, 2015|
|0.4.0||Dec 10, 2015|
|0.3.3||Dec 8, 2015|
|0.3.2||Jul 16, 2015|
|0.3.1||Jul 10, 2015|
|0.3.0||Jul 10, 2015|
|0.2.3||Jul 10, 2015|
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.
Support Dart 2 in
The SDK constraint in
pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.
dartdoc successfully runs on your package's source files. (-10 points)
Dependencies were not resolved.
|Dart SDK||>=1.8.0 <2.0.0|