You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+105-1Lines changed: 105 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,130 @@
1
+
## 0.7.0-dev.1
2
+
3
+
### BREAKING CHANGES
4
+
5
+
- A special `$script` key has been introduced with a neat 💪 platform recognition feature.
6
+
7
+
Do you work on multiple platforms? Need to use many different commands and always forget which one to use? This is what you've been waiting for!
8
+
9
+
```yaml
10
+
scripts:
11
+
where-am-i:
12
+
$script:
13
+
$windows: echo "You are on Windows!"
14
+
$linux: echo "You are on Linux!"
15
+
$macos: echo "You are on MacOs!"
16
+
$default: echo "You are on... something else?"
17
+
```
18
+
19
+
```
20
+
user@MacBook-Pro Desktop % rps where-am-i
21
+
> where-am-i
22
+
$ echo "You are on MacOs!"
23
+
24
+
You are on MacOs!
25
+
26
+
user@MacBook-Pro Desktop %
27
+
```
28
+
29
+
This can be useful for commands like `rm -rf`, which in Windows.... `rd /s /q`, you know what I mean, it can be helpful, right?
30
+
31
+
- Added support for script references. From now on it is possible to call another rps command directly from a defined script.
32
+
33
+
```yaml
34
+
scripts:
35
+
app:
36
+
clean: flutter clean
37
+
clean: $app clean
38
+
c: $clean
39
+
clear: $c
40
+
delete: $clear
41
+
```
42
+
This is just a simple proxy example, but you can also use it in `$before` and `$after` hooks to chain multiple scripts together.
43
+
44
+
- ⚠️ The `before-` and `after-` hooks has been removed. Instead use the `$before` and `$after` keys. This will help keep hook scripts grouped in a project with multiple scripts defined.
45
+
46
+
```yaml
47
+
scripts:
48
+
hooks:
49
+
$before: echo "before"
50
+
$script: echo "script"
51
+
$after: echo "after"
52
+
```
53
+
54
+
Execute as always.
55
+
56
+
```
57
+
user@MacBook-Pro Desktop % rps hooks
58
+
> hooks $before
59
+
$ echo "before"
60
+
61
+
before
62
+
63
+
> hooks
64
+
$ echo "script"
65
+
66
+
script
67
+
68
+
> hooks $after
69
+
$ echo "after"
70
+
71
+
after
72
+
73
+
user@MacBook-Pro Desktop %
74
+
```
75
+
76
+
It is also possible to link multiple scripts together!
77
+
78
+
```yaml
79
+
scripts:
80
+
get: flutter pub get
81
+
test:
82
+
$before: $get
83
+
$script: flutter test
84
+
build:
85
+
$before: $test
86
+
$script: flutter build apk
87
+
```
88
+
89
+
You don't have to worry about cyclic references, RPS will keep track of them and notify you in case of a problem.
90
+
1
91
## 0.6.5
92
+
2
93
- Update dependencies
3
-
- Longer description in pubspec.yqml
94
+
- Longer description in pubspec.yaml
4
95
- pedantic (deprecated) replaced by flutter_lints
96
+
5
97
## 0.6.4
98
+
6
99
- Fixed readme example
100
+
7
101
## 0.6.3
102
+
8
103
- Minor bug fixes and improvements. 🚧
104
+
9
105
## 0.6.2
106
+
10
107
- Exposed executables.
108
+
11
109
## 0.6.1
110
+
12
111
- Minor bug fixes and improvements. 🚧
13
112
- Added colorful logs. 🎨
14
113
- Shared with the world via Github and pub.dev! 🌎
114
+
15
115
## 0.6.0
116
+
16
117
- Added optional `before-` and `after-` hooks support.
# too long command? no problem! define alias using reference syntax!
37
+
bab: $build android appbundle
38
+
# as simple as typing "rps baa"
39
+
baa: $build android apk
40
+
# some commands may vary from platform to platform
41
+
# but that's not a problem
42
+
clear:
43
+
# use the $script key to define platform specific scripts
44
+
$script:
45
+
# define the default script
46
+
$default: rm -rf ./cache
47
+
# And different script for the windows platform.
48
+
$windows: rd /s /q ./cache
49
+
# now "rps clear" will work on any platform!
50
+
34
51
35
52
# the rest of your pubspec file...
36
53
dependencies:
37
-
path: ^1.7.0
54
+
path: ^1.7.0
38
55
```
39
56
40
57
3. Use your custom command.
@@ -55,31 +72,135 @@ Define and use scripts from your _pubspec.yaml_ file.
55
72
56
73
Less time typing long commands more time watching funny cats. 🐈
57
74
75
+
## Nesting
76
+
77
+
Nest your commands to group them contextually and make them easier to understand 🧪
78
+
79
+
```yaml
80
+
scripts:
81
+
build:
82
+
web: flutter build web --flavor production -t lib/main.dart
83
+
android:
84
+
apk: flutter build apk --flavor production -t lib/main.dart
85
+
appbundle: flutter build appbundle --flavor production -t lib/main.dart
86
+
ios:
87
+
ipa: flutter build ipa --flavor production -t lib/main.dart
88
+
ios: flutter build ios --flavor production -t lib/main.dart
89
+
```
90
+
91
+
Use with ease 😏
92
+
93
+
```
94
+
rps build android apk
95
+
```
96
+
97
+
## References
98
+
99
+
Sometimes you may want to create a command alias (e.g. a shorter version of it) or simply pass the execution of a hook to another command. This is where references come to the rescue! ⛑
100
+
101
+
References are defined as a scripts that must begin with `$` sign.
102
+
103
+
```yaml
104
+
scripts:
105
+
generator:
106
+
build: flutter pub run build_runner build --delete-conflicting-outputs
107
+
watch: flutter pub run build_runner watch --delete-conflicting-outputs
108
+
# short aliases:
109
+
gb: $generator build # same as "rps run generator build"
110
+
gw: $generator watch # same as "rps run generator watch"
111
+
```
112
+
113
+
References can also be used with `$before` and `$after` hooks.
114
+
58
115
## Hooks
59
-
You can use commands that will be executed **before** or **after** some command. Have a look at these scripts in the `pubspec.yaml` file.
116
+
117
+
To enable hooks define the `$before` and/or `$after` keys for your script command.
118
+
60
119
```yaml
61
120
scripts:
121
+
hooks:
122
+
$before: echo "hello before" # executed before the $script
123
+
$script: echo "hello script"
124
+
$after: echo "hello after" # executed after $script
125
+
```
126
+
127
+
Execute as always.
128
+
129
+
```
130
+
user@MacBook-Pro Desktop % rps hooks
131
+
> hooks $before
132
+
$ echo "hello before"
133
+
134
+
hello before
135
+
136
+
> hooks
137
+
$ echo "hello script"
138
+
139
+
hello script
140
+
141
+
> hooks $after
142
+
$ echo "hello after"
143
+
144
+
hello after
145
+
```
146
+
147
+
You can also combine multiple scripts using references!
148
+
149
+
```yaml
150
+
scripts:
151
+
get: flutter pub get
62
152
test:
63
-
before-echo: echo "before-test"
64
-
echo: echo "test"
65
-
after-echo: echo "after-test"
153
+
# equivalent of "rps run get"
154
+
$before: $get
155
+
$script: flutter test
156
+
build:
157
+
# equivalent of "rps run test"
158
+
$before: $test
159
+
$script: flutter build apk
66
160
```
67
-
Running `rps test echo` command produces following output:
161
+
162
+
But wait a minute! The hooks can also be nested!
163
+
164
+
```yaml
165
+
# Order when executing: "rps generator build"
166
+
scripts:
167
+
generator:
168
+
$before: dart pub get # 1.
169
+
$after: dart analyze # 5.
170
+
build:
171
+
$before: echo "Building JSON models..." # 2.
172
+
$script: dart pub run build_runner build # 3.
173
+
$after: echo "JSON models built successfully..." # 4.
68
174
```
69
-
> test before-echo
70
-
$ echo "before-test"
71
175
72
-
before-test
73
-
> test echo
74
-
$ echo "test"
176
+
You don't have to worry about cyclic references 🔄, RPS will keep track of them and notify you in case of a problem 😏.
177
+
178
+
## Platform specific scripts
179
+
180
+
Do you work on multiple platforms? Need to use many different commands and always forget which one to use? This is what you've been waiting for! 🛠
181
+
182
+
Just use one command on all supported platforms 💪.
183
+
184
+
```yaml
185
+
scripts:
186
+
where-am-i:
187
+
$script:
188
+
$windows: echo "You are on Windows!"
189
+
$linux: echo "You are on Linux!"
190
+
$macos: echo "You are on MacOs!"
191
+
$default: echo "You are on... something else?"
192
+
```
75
193
76
-
test
77
-
> test after-echo
78
-
$ echo "after-test"
194
+
```
195
+
user@MacBook-Pro Desktop % rps where-am-i
196
+
> where-am-i
197
+
$ echo "You are on MacOs!"
79
198
80
-
after-test
199
+
You are on MacOs!
81
200
```
82
201
202
+
This can be useful for commands like `rm -rf`, which in Windows.... `rd /s /q`, you know what I mean, it can be helpful, right?
203
+
83
204
---
84
205
85
206
## Motivation
@@ -92,6 +213,6 @@ I got bored of typing the same long commands over and over again... I even got b
92
213
93
214
- Further hooks improvements.
94
215
95
-
___
216
+
---
96
217
97
218
Hey you! This package is still in development (bugs may occur 🐛😏).
0 commit comments