summaryrefslogtreecommitdiff
path: root/src/_slides/perl6-using-app-assixt-to-improve-module-development.md
blob: b16c9790422bc627d954b2504d1746e1f131333e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
---
title:  "Perl6: Using `App::Assixt` to improve module development"
event:  14th Dutch Perl Workshop
date:   2018-07-07
---

# `App::Assixt`
## Improving module development

---

# About me

- Patrick Spek (`TYIL`)
- https://www.tyil.nl
- @tyil@mastodon.social

note:
  I have about 10 Perl 6 modules available on CPAN right now. `Config` and
  parser modules, `IRC::Client` plugins, `Hash::Merge`, `Dist::Helper` and
  `App::Assixt`.

---

# Why?

- Manually updating JSON is annoying
- Wanted to ease development
- Wanted easier way to distribute

note:
  It's my 2nd project in Perl 6, following `Config`.

---

# How?

- Uses `Dist::Helper`
- Updates `META6.json`
- Creates skeleton files

note:
  `Dist::Helper` is the base that deals with the actual interaction with the
  modules. `App::Assixt` is a CLI frontend with some nice extras to make it
  usable.

---

# How do I get it?

```
$ zef install App::Assixt
```

note:
  `App::Assixt` is easily available through `CPAN`, and `zef` is able to
  install it cleanly nowadays.

---

# Using it

```
$ assixt help
```

```
$ p6man assixt
```

note:
  - p6man is shipped with `Pod::To::Pager`, still in development!

---

# Creating a new project

## Manual
```
$ mkdir my-new-perl6-project
$ cp my-old-project/META6.json my-new-perl6-project/.
$ $EDITOR my-new-perl6-project/META6.json
```

## `assixt`
```
$ assixt new --name=my-new-perl6-project
```

note:
  - `assixt new` can also be done without arguments, it will ask for a name
    then
  - additional questions will also be asked to fill out the META6.json
  - `assixt` will add gitlab-ci, travis configuration
  - default changelog
  - gitignore

---

# Adding files

## Manual
```
$ mkdir -p lib/App/Local
$ touch lib/App/Local/NewClass.pm6
$ $EDITOR META6.json
```

## `assixt`
```
$ assixt touch class App::Local::NewClass
```

- Classes
- Tests
- Unit modules

---

# Adding a dependency

## Manual
```
$ $EDITOR META6.json
$ zef install Config
```

## `assixt`
```
$ assixt depend Config
```

note:
  `--no-install` skips the step where `zef` tries to install the module.

---

# Bumping the version

## Manual
```
$ $EDITOR META6.json
```

## `assixt`
```
$ assixt bump
```

note:
  - `bump` asks for additional user input to decide whether to bump the patch,
    minor or major level.
  - In a next release, will also update `=VERSION` in pod, and CHANGELOG
    releases.

---

# Create a new dist

## Manual
```
$ tar czf My-Dist-0.1.2.tar.gz --exclude-vcs-ignores [--exclude...] .
$ mv !:2 ~/.local/dists/.
```

## `assixt`
```
$ assixt dist
```

---

# Uploading to CPAN

## Manual
Through your favourite webbrowser

## `assixt`
```
$ assixt upload ~/.local/var/assixt/dists/Dist-Helper-0.19.0.tar.gz
```

note:
  After starting development and testing of `assixt`, I eventually found `mi6`,
  but I stick to `assixt` as it can do much more.

---

# `push` shorthand

```
$ assixt push
```

- Bump
- Dist
- Upload

note:
  Does a `bump`, `dist` and `upload`, one after another.

---

# Workflow

```
$ assixt new Local::App
$ cd perl6-local-app
$ assixt depend Config
$ assixt touch class Local::App::Foo
$ $EDITOR
$ assixt push
```

note:
  Creates a new module directory, make the module depend on `Config`, create a
  class named `Local::App::Foo` and push the module to CPAN.

---

# Future plans

---

## QA check
- Will perform QA checks to improve module quality
- Based on `Release::Checklist` by [Tux]
- Work In Progress on Github

---

## Other ideas
- `meta`: To update misc dist info, such as the authors
- `sync-meta`: To synchronize a `META6.json` from an existing module
- Improve `new`: Also generate a default `README.pod6`

note:
  `sync-meta` is intended to also create a new `META6.json` if none exists
  yet.

---

# Questions