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
The sample usage code is shown in the help command
214
214
215
215
### Run context
216
216
@@ -255,7 +255,7 @@ todo
255
255
256
256
### Sub commands
257
257
258
-
Commands can be nested multiple levels. If you want to make a sub-command, just add the parent name in `main` property. Other features of the command remains same for sub commands.
258
+
Commands can be nested multiple levels. If you want to make a sub-command, just add the parent name in `main` property. Other features of the command remain same for sub commands.
259
259
260
260
```typescript
261
261
// parent command
@@ -305,7 +305,7 @@ Please dont use parent name aliases
305
305
306
306
### Default command
307
307
308
-
By default **lesy** looks for command named `default` if no args supplied in the input. If you would like to run different command as a default command, set it in the config.
308
+
By default **lesy** looks for the command named `default` if no args supplied in the input. If you would like to run a different command as a default command, set it in the config.
Copy file name to clipboardExpand all lines: docs/src/markdown/docs/main/get-started/overview.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ path: /docs/get-started/overview
4
4
icon: user-smile-fill
5
5
---
6
6
7
-
Lesy is just a simple lightweight CLI frameworkhelps you to build modern and performant commandline apps. Thats all!
7
+
Lesy is a **lightweight CLI framework** built with Node JS, which helps you to build modern and performant command-line apps.
8
8
9
-
Whether you are building a deadsimple app or more advanced app, Lesy lets you to write less code and get more. Here's the sample code for classic Hello world example.
9
+
Whether you are building a dead-simple or a complex app, Lesy lets you write less code and get more. Here's the sample code for the classic Hello world example.
10
10
11
11
```js
12
12
#!/usr/bin/env node
@@ -20,8 +20,8 @@ lesy({ commands }).parse();
20
20
### Why Lesy?
21
21
22
22
-**Language**: Full support for Typescript with @types
23
-
-**Flexibility**: Able to change complete behaviour with middlewares
24
-
-**Boilerplate**: Write less code. whether its a dead simple project or complex one.
23
+
-**Flexibility**: Able to change complete behavior with middlewares
24
+
-**Boilerplate**: Write less code.
25
25
-**Extensions**: Add cool functionalities with plugins
26
26
-**Platform**: Write once and run in CLI or UI
27
27
-**Performance**: It is just faster than existing libraries. Benchmark inside.
@@ -36,8 +36,8 @@ We have setup a _playground_ for you to play around with it.
36
36
37
37
### What is the meaning of Lesy?
38
38
39
-
Well, there is no specific meaning for Lesy. The whole project is build with the mindset of simple and easy. Whether it is a code or documentation or name or logo, everything should be simple. **Lesy** sounds cool and short.
39
+
Well, there is no specific meaning for Lesy. The whole project is built with the mindset of simplicity and maintainability. Thus each part of the project right from the name to code, everything is crafted carefully. **Lesy** sounds cool and short.
40
40
41
-
Same way, it is not related to penguin logo. Penguin is cute right? Lets make that as a logo and name it Lesy!!
41
+
Same way, it is not related to the penguin. I just felt Penguin is cute and so made it as a logo.
Copy file name to clipboardExpand all lines: docs/src/markdown/docs/plugins/docs/generator.md
+24-23Lines changed: 24 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,12 +30,13 @@ export default {
30
30
```typescript
31
31
exportdefault {
32
32
name: "generate",
33
-
run: async ({ features: { generator } }) => {
34
-
awaitgenerator().create({
35
-
destination: `${process.cwd}/projects/`,
33
+
run: async ({ feature: { generateFiles } }) => {
34
+
awaitgenerateFiles({
36
35
source: `${__dirname}/templates`,
36
+
destination: `${process.cwd}/projects/`,
37
37
data: {
38
-
name: "John",
38
+
filename: "welcome",
39
+
name: "Scooby Doo",
39
40
},
40
41
});
41
42
},
@@ -45,7 +46,7 @@ export default {
45
46
#### Step 2: Create source templates
46
47
47
48
```html
48
-
<!-- path/to/templates/welcome.html -->
49
+
<!-- path/to/templates/{{filename}}.html -->
49
50
<h1>Hello {{name}}</h1>
50
51
```
51
52
@@ -59,41 +60,41 @@ This command will create a files in the destination folder. And the output file
59
60
60
61
```html
61
62
<!-- path/to/estination/welcome.html -->
62
-
<h1>Hello John</h1>
63
+
<h1>Hello Scooby Doo</h1>
63
64
```
64
65
65
66
### Options
66
67
67
-
Once the plugin is installed and added to index file, we can access the `generator` function from the `features`. It has only one method called`create`, which accepts the following options.
68
+
Once the plugin is installed and added to the index file, we can access the `generator` function from the `feature` property. It has only one method named`create`, which accepts the following options.
68
69
69
70
#### source
70
71
71
-
The source path for the templates. Should be a absolute path.
72
+
The source path for the templates. Should be an absolute path.
72
73
73
74
#### destination
74
75
75
-
The destination path for the compiled files.Should be a absolute path.
76
+
The destination path for the compiled files.Should be an absolute path.
76
77
77
78
#### data
78
79
79
-
We can pass the dynamic data to the templates using `data` option. It is a plain object. All the keys will be replaced with the value in the template files.
80
+
We can pass the dynamic data to the templates using the `data` option. It is a plain object. All the keys will be replaced with the values in the template files.
81
+
82
+
#### handlebarsInstance
83
+
84
+
If you wish to register any handlebars helpers or partials, you can get the instance from this function property.
85
+
86
+
#### handebarsOptions
87
+
88
+
You can pass handlebars options using this property.
80
89
81
90
### Templating
82
91
83
-
Templates are parsed using [Handlebars](https://handlebarsjs.com/guide/). This plugin comes with a build-in case change helper. In the template we can use,
92
+
Templates are parsed using [Handlebars](https://handlebarsjs.com/guide/). This plugin comes with a built-in case helper. In the template we can use,
0 commit comments