Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Commit

Permalink
Release version 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kalkin committed Mar 11, 2017
2 parents 7949c86 + fafd447 commit 1a99da1
Show file tree
Hide file tree
Showing 16 changed files with 834 additions and 412 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
/blib/
/src/*.o
/src/Makefile
/resources/*.so
/resources/*.dylib
.precomp/
# Prove saved state
.prove
# Vim swap files
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# Vim session
Session.vim
# temporary
.netrwhist
*~
# Vim auto-generated tag files
tags
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ language: perl6
perl6:
- latest
install:
- rakudobrew build-panda
- panda --notests installdeps .
- rakudobrew build zef
- zef --/test --depsonly install .
script:
- perl6 -MPanda::Builder -e 'Panda::Builder.build(~$*CWD)'
- PERL6LIB=$PWD/lib prove -e perl6 -vr t/ xt/
- prove --exec 'perl6 -Ilib' -r --timer -vv t xt
sudo: false
30 changes: 25 additions & 5 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,47 @@
"auth" : "kalkin",
"provides" : {
"Ddt::Template" : "lib/Ddt/Template.pm6",
"Ddt::CLI" : "lib/Ddt/CLI.pm6",
"Ddt::Plugins::Deps" : "lib/Ddt/Plugins/Deps.pm6",
"Ddt::Plugins::Watch" : "lib/Ddt/Plugins/Watch.pm6",
"Ddt::Distribution" : "lib/Ddt/Distribution.pm6",
"Ddt::Plugins::Unit-Generator" : "lib/Ddt/Plugins/Unit-Generator.pm6",
"Ddt" : "lib/Ddt.pm6"
},
"depends" : [
"File::Find",
"File::Ignore",
"File::Temp",
"JSON::Pretty",
"License::Software",
"META6",
"Pod::To::Markdown",
"Shell::Command",
"Test::META"
"Test::META",
"Zef",
"Zef::Client",
"Zef::Config",
"Zef::Distribution",
"Zef::Identity"
],
"tags" : [
"authoring",
"command line",
"devel",
"development",
"generator",
"module",
"testing",
"utility"
],
"test-depends" : [
"File::Temp",
"Test::META"
],
"description" : "Distribution Development Tool similar to mi6",
"version" : "0.3.2",
"description" : "Distribution Development Tool",
"version" : "0.4.0",
"meta6" : "0",
"authors" : [
"Shoichi Kaji",
"Bahtiar `kalkin-` Gadimov"
]
}
}
76 changes: 46 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,98 @@
NAME
====

Ddt - Distribution Development Tool similar to mi6
Ddt - Distribution Development Tool

SYNOPSIS
========

> ddt new Foo::Bar # create Foo-Bar distribution
> cd Foo-Bar
> ddt build # build the distribution and re-generate README.md & META6.json
> ddt test # Run tests

INSTALLATION
============

# with zef
> zef install Ddt
> ddt --license-name=LGPL new Foo::Bar # create Foo-Bar distribution
> cd Foo-Bar
> ddt build # build the distribution and re-generate README.md & META6.json
> ddt -C test # Run tests when files change

DESCRIPTION
===========

Ddt is an authoring and distribution development tool for Perl6.

Features
--------

* Create a distribution skeleton for Perl6
**Ddt** is an authoring and distribution development tool for Perl6. It provides scaffolding for generating new distributions, packages, modules, grammers, classes and roles.

* Generate README.md from lib/Main/Module.pm6's pod
WARNING
=======

* Generate a META6.json
This project is a technology preview. It may change at any point. The only API which can be considered stable up to the `v1.0` is the command line interface.

* Generate a META test by default
USAGE
=====

* Support for different licenses


ddt [--license-name=«NAME»] new <module> -- Create new module
ddt build -- Build the distribution & README.md
ddt [-C|--continues] test [<tests> …] -- Run distribution tests
ddt release -- Make release
ddt hack <identity> [<dir>] -- Checkout a Distribution and start hacking on it
ddt generate class <name> -- Generate a class
ddt generate role <name> -- Generate a role
ddt generate package <name> -- Generate a package
ddt generate grammar <name> -- Generate a grammar
ddt generate module <name> -- Generate a module
ddt generate test <name> [<description>] -- Generate stub test file
ddt [-v] deps distri -- Show all the modules used
ddt [-u|--update] deps -- Update META6.json dependencies
ddt watch [<cmd>…] -- Watch lib/, bin/ & t/ for changes respecting .gitignore and execute given cmd

INSTALLATION
============

# with zef
> zef install Ddt

Differences to Mi6
------------------
==================

* Support for different licenses via `License::Software`

* META6 is generated using `META6`

* Meta test

* Use zef for tests
* Use prove for tests

* Run tests on changes

* Extended .gitignore

* Support for different licenses

* Support for Distributions with a hyphen in the namel
* Support for Distributions with a hyphen in the name

FAQ
===

* How can I manage depends, build-depends, test-depends?

Write them to META6.json directly :)

* Where is Changes file?

TODO
Use `ddt -u deps`

* Where is the spec of META6.json?

Maybe https://github.com/perl6/ecosystem/blob/master/spec.pod or http://design.perl6.org/S22.html
Maybe https://github.com/perl6/ecosystem/blob/master/spec.pod or http://design.perl6.org/S22.html

* How do I remove travis badge?
* How do I remove the travis badge?

Remove .travis.yml
Remove .travis.yml

SEE ALSO
========

[https://github.com/tokuhirom/Minilla](https://github.com/tokuhirom/Minilla)
* [https://github.com/skaji/mi6](https://github.com/skaji/mi6)

* [https://github.com/tokuhirom/Minilla](https://github.com/tokuhirom/Minilla)

[https://github.com/rjbs/Dist-Zilla](https://github.com/rjbs/Dist-Zilla)
* [https://github.com/rjbs/Dist-Zilla](https://github.com/rjbs/Dist-Zilla)

AUTHOR
======
Expand Down
139 changes: 139 additions & 0 deletions THOUGHTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Thoughts

Just some random thoughts which should be taken with a grant of salt.

## Ddt should:
1. play well with other tools and try to integrate in existing workflows as long
as it makes sense i.e. through using vcs hooks to auto commit autogenrated
changes.
2. keep all the autogenerated changes to be commited to the minimum for
the currently commited code.
3. if possible allow the human to edit and test autogenerated code to be
commited.
4. make it hard to do stupid things:
- Example: use .gitignore to hide generated files to prevent them beeing
accidentally commited
5. Try to enforce best practices, but allow people to customize their workflows
as long as it's not completly overkill and a burden.
6. Should run as match as possible in parallel.
7. Mark files generated during build / install with a distribution installer as
autogenerated so a human reading such a file knows where it's coming
from.


## Workflows

### Project creation

- make directories
- generate META6
- generate README
- generate a class/module/package
- generate licensing stuff
- initialize VCS Repository

### Patching installed Distributions
- You install `App-Bar`
- `App-Bar` depends on `Net::Foo::Client`, `Net::Foo::TLS`.
- You start using `App-Bar` you notice that you are missing some feature
- Here you have two scenarios
#### Perfect World
* Your distribution manager (i.e: zef or panda)
- already has the source of `App-Bar` (because it's part of the dist pkg)
* You edit the source code of the `App-Foo` distribution like it would be a
locally checked out project in $EDITOR. Your editor should interact with with
the distribution by running tests ect.
* Once you are happy with your changes a new branch is created and your
distribution manager starts using this branch for your environment
* Once you think it's stable you can easily do a PR

#### Current Situation
* Stupid Approach
- Find `zef locate App-Bar`
- open in editor
- hack
- run manual some tests
- OUTCOME: Lost at next upgrade or forgotten and never merged with upstream

* Invalid Approaches
- Using `zef look App-Foo` it will drop you in a directory without any version
control

* Sensible Approach
- get Source-url from `zef info App-Foo`
- Hope it's some kind of version control url
- do vcs clone source-url
- HACK
- run `zef test`, `prove`, `prove6` or whatever is suitable for current case
- do vcs commit when ready
- use `zef --force install .` to deploy when ready
- fork the github repo (i.e: via `hub` `git fork`)
- make a pr (i.e. via `hub` `git pr`)
* Pr is accepted for the current distribution version
* Pr needs to be rebased on the current master
* Not accepted: create an own `App::Foo:auth(user):ver(X.Y.Z)` which
emulates `App::Foo:ver(X.Y.Z)`. Release new Distribution and may the fork be
with you!

The **Sensible Approach** has three phases:
- get version controlled source code for a unit name so you can comfortably
edit it with your `$EDITOR`
- hacking / testing
- deploying and maintaining own set of patches on top of the distribution
- distributing changes

### Adding an App to the current distribution

## How to handle Meta distributions?

Currently it's a custom(?) in the Perl world to generate different distributions
from one source and upload them separately to CPAN. This solves a number of
issues:

1. A huge source code repository which is split in different distributions
modules. This allows applications to only pull a minimal set of dependencies.
2. From same source repository multiple distribution versions could be
generated. This helps to maintain multiple API versions.

My current issue with that is it makes it harder for the user to contribute back
to the project in a way described in **Sensible Aproach** because:

- You need all the source code from which the distribution is
generated, which may be not deployed on your system. This might be an issue if
you have no network connection at the moment. It enforces the human to fall
back to the **Stupid Aproach**
- Let's hope the distribution authors thought about adding all the relevant
tests to the distribution from the main source repository. This might be not
an issue if the distribution is generated with a smart tool.

- How do you integrate with the currently cripled non cpan infrastructure? You
need some kind

- then how to build the distribution locally and install it with zef?

## How to handle different unit versions in the source repository

### Issues
- Should they be packaged as separate minimal distributions? If so how to
contribute back to the user?
- Currently perl6 doesn't provide a way to separate between source code for
distribution and project vcs repository.

### Current Sollution
Use vcs branch / tag feature


## ROAD MAP

* [ ] Refactor generation functions out of Ddt::Distribution
* [ ] Use git-hooks
* [ ] Implement Rule 2 from above

## Random Examples

- A function is add to the code and is commited. The post-commit ddt hook is
run, in this example it generates some pod data which needs to be commited.
There're two cases to handle:
1. If a human is present—i.e if running from a tty device—present him witht
the posibillity to edit the autogenerated code to be commited.
2. There is no human supervision so just do what needs to be done
Loading

0 comments on commit 1a99da1

Please sign in to comment.