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
You can create a .takeoff folder in your project and takeoff will use your custom scaffoldings
25
-
26
-
Each station requires different parameters, the interactive
27
-
28
-
Global Options
29
-
--no-git The takeoff will not contain a git-setup
19
+
Interactive Command-Line-Interface starts
30
20
31
21
Examples
32
-
$ takeoff node-module --without
22
+
$ takeoff
33
23
```
34
24
35
25
### Interactive UI
36
-
_Todo__
26
+
_Todo_
27
+
28
+
### Predefined Stations
29
+
#### `node-module`
30
+
**requiredProps**
31
+
- package-name
32
+
- license
37
33
38
-
### Create a custom station
34
+
**What you get**
35
+
-`package.json`
36
+
- full `.gitignore`
37
+
- preformated `README`
38
+
- selected `LICENSE`
39
+
- empty `yarn.lock`
40
+
41
+
### Create a custom station for your own project
39
42
1. Create a `.takeoff` folder in your project root
40
43
2. Add a new directory named after your wanted `station` e.g. `node-modules`
41
-
3. Create a `__station.js`
42
-
4.Use the format:
44
+
3. Create a `__station.js` in the new directory
45
+
4.Fill:
43
46
```js
44
47
module.exports= {
45
-
requiredProps: ['content'],
46
-
targetRoute:'',
47
-
run:props=> ({
48
-
files: [{
49
-
filename:'my-file.txt',
50
-
template:'This is the content my file has: '+props.content
51
-
}})
48
+
requiredProps: ['content'],// required props, will be required in interactive CLI
49
+
run:props=> ({ // run function will be fired with - before - defined props
50
+
files: [{ // return a files array, takeoff will use this information to create the files
51
+
filename:'my-file.txt', // choose here the filename, if you want to create a file in a deeper folder just add the path `my/folder/my-file.txt`
52
+
template:`My Content: ${props.content}`// template is simply the content of the file
53
+
}]
54
+
})
52
55
};
53
56
```
54
-
You see, there is a array with `requiredProps`, this information uses the interface to get the specific props.
55
-
When the user has given us all prop-informations and everything passed, the `run()` function executes, here we expect a returned object within a `files` array, each item (a object) holds the information about the filename and the content of the file.
57
+
Checkout the example stations in [`example`](https://github.com/entwicklerstube/takeoff/tree/master/example)
58
+
59
+
#### Advanced
60
+
**More specific interactive cli questions**
61
+
Pass valid [`inquirer objects`](https://github.com/SBoudrias/Inquirer.js#objects) in `requiredProps` for more specific questions.
62
+
63
+
**Run script after creating files**
64
+
Add a `postTakeoff` function to your `__station.js` configuration, after successfully creating the files this will be executed
0 commit comments