stagedive 0.5.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 23

StageDive - Template-Base project generator

Define your own variables for your templates

New

You can define "hints" for your questions!

Install

Install

    pub global activate stagedive

Update

    # activate stagedive again
    pub global activate stagedive

Uninstall

    pub global deactivate stagedive   

Usage

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.

Try 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 basename is the name you specify with the -t option.

File-Content-Format: <%= varname %>
File-Name-Format: {varname}

The -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.

Sample manifest.yaml

#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 and lowercase.

  • 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.

Important

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 .stagedive/config.yaml

templatefolder: lib/_templates

or for multiple templates:

templatefolder: 
    - lib/_templates
    - temp/_templates

With this - StageDive knows how to find your local templates!

License

  Copyright 2015 Michael Mitterer (office@mikemitterer.at),
  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.

Change Log for stagedive

StageDive creates a template-based project for you

v0.5.1 - 2016-11-16

Docs

v0.5.0 - 2016-10-20

Feature

  • -e option for stripping extensions added b641fea

v0.4.2 - 2015-12-10

Fixes

  • Authors email was without <...> f2b3d34

v0.4.1 - 2015-12-10

Fixes

  • lib-template had 'executable' in pubspec b6ec590

v0.4.0 - 2015-12-10

Feature

v0.3.3 - 2015-12-08

Docs

v0.3.1 - 2015-07-10

Feature

  • Promper shows input-field-markers, UPPERCASE-Type support fd70c95

Docs

v0.3.0 - 2015-07-10

Feature

v0.2.1 - 2015-07-10

Feature

  • Multiple templates in config.yaml 78a3e24

v0.2.0 - 2015-07-09

Feature

  • Config to scan local templates 21c8ef4

v0.1.0 - 2015-07-09

Feature

v0.0.3 - 2015-07-09

Feature

v0.0.2 - 2015-07-08

Docs

v0.0.1 - 2015-07-08

Docs

This CHANGELOG.md was generated with Changelog for Dart

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate stagedive

2. Use it

The package has the following executables:


$ stagedive

Use this package as a library

1. Depend on it

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


dependencies:
  stagedive: "^0.5.1"

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:stagedive/stagedive.dart';
  
Version Uploaded Documentation Archive
0.5.1 Nov 16, 2016 Go to the documentation of stagedive 0.5.1 Download stagedive 0.5.1 archive
0.5.0 Oct 20, 2016 Go to the documentation of stagedive 0.5.0 Download stagedive 0.5.0 archive
0.4.2 Dec 10, 2015 Go to the documentation of stagedive 0.4.2 Download stagedive 0.4.2 archive
0.4.1 Dec 10, 2015 Go to the documentation of stagedive 0.4.1 Download stagedive 0.4.1 archive
0.4.0 Dec 10, 2015 Go to the documentation of stagedive 0.4.0 Download stagedive 0.4.0 archive
0.3.3 Dec 8, 2015 Go to the documentation of stagedive 0.3.3 Download stagedive 0.3.3 archive
0.3.2 Jul 16, 2015 Go to the documentation of stagedive 0.3.2 Download stagedive 0.3.2 archive
0.3.1 Jul 10, 2015 Go to the documentation of stagedive 0.3.1 Download stagedive 0.3.1 archive
0.3.0 Jul 10, 2015 Go to the documentation of stagedive 0.3.0 Download stagedive 0.3.0 archive
0.2.3 Jul 10, 2015 Go to the documentation of stagedive 0.2.3 Download stagedive 0.2.3 archive

All 16 versions...

Analysis

We analyzed this package on Jun 15, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
72 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
6 / 100
Overall score:
Weighted score of the above. [more]
23
Learn more about scoring.

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Make sure dartfmt runs.

Suggestions

  • Make sure dartfmt runs.

    Running dartfmt -n . failed with the following output:

    dartfmt on lib/ failed with exit code 65
    Could not format because the source could not be parsed:
    
    line 4, column 10 of /tmp/pana-POYIHU/lib/_templates/console/test/unit/{basename}_test.dart: Expected a type name.
    library <%= basename %>.test;
             ^^
    line 4, column 10 of /tmp/pana-POYIHU/lib/_templates/console/test/unit/{basename}_test.dart: Expected to find '>'.
    library <%= basename %>.test;
             ^^
    line 4, column 10 of /tmp/pana-POYIHU/lib/_templates/console/test/unit/{basename}_test.dart: Expected a method, getter, setter or operator declaration.
    
  • Fix platform conflicts.

    Error(s) prevent platform classification:

    Make sure dartfmt runs.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 129 errors 17 hints.

    Make sure that the imported libraries are not in conflict. Error(s) in lib/_templates/console/lib/cmdline/Config.dart: Part-of directives must include a library name.

    Make sure that the imported libraries are not in conflict. Error(s) in lib/_templates/console/bin/{basename}.dart: Invalid URI syntax: 'package:<%= basename %>/<%= basename %>.dart'.

    Similar analysis of the following files failed:

    • lib/_templates/console/lib/cmdline/Application.dart (error)
    • lib/_templates/console/lib/cmdline/Options.dart (error)
    • lib/_templates/console/lib/{basename}.dart (error)
    • lib/_templates/console/test/unit/{basename}_test.dart (error)
    • lib/_templates/console/tool/grind.dart (error)
    • lib/_templates/lib/lib/{basename}.dart (error)
    • lib/_templates/lib/test/unit/{basename}_test.dart (error)
    • lib/_templates/lib/tool/grind.dart (error)
    • lib/generate/Questions.dart (error)
    • lib/cmdline/Application.dart (hint)
    • lib/cmdline/Config.dart (hint)
    • lib/cmdline/Options.dart (hint)
    • lib/generate/Prompter.dart (hint)
    • lib/generate/Settings.dart (hint)
    • lib/stagedive.dart (hint)
  • Package is getting outdated.

    The package was released 82 weeks ago.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use stagedive.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
args ^0.13.0 0.13.7 1.4.3
browser ^0.10.0 0.10.0+3
console_log_handler ^0.1.0 0.1.4 1.0.3
logging ^0.11.0 0.11.3+1
logging_handlers ^0.8.0 0.8.0
pub_cache ^0.1.0 0.1.1 0.2.0
validate ^1.0.0 1.6.0
yaml ^2.1.0 2.1.14
Transitive dependencies
charcode 1.1.1
collection 1.14.10
intl 0.15.6
path 1.6.0 1.6.1
pub_semver 1.4.1
source_span 1.4.0
string_scanner 1.0.2
Dev dependencies
grinder any
test any