Skip to content

Commit

Permalink
Merge pull request #15 from tptshepo/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tptshepo authored Jul 28, 2020
2 parents e134146 + da5869e commit 0ce064f
Show file tree
Hide file tree
Showing 114 changed files with 4,206 additions and 6,360 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ templates
.vscode
dist
design
cwd

5 changes: 3 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/bin/snapdev.js",
"program": "${workspaceRoot}/adhoc-test.js",
// "program": "${workspaceRoot}/bin/snapdev.js",
// "args": ["generate", "--template", "node", "--model", "hello/hello.json", "--clear"],
"args": ["g", "-m", "test.json"]
// "args": ["g", "-m", "test.json"]
},
{
"type": "node",
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Commands:
snapdev logout Log out from snapdev online repository
snapdev list List all your templates on snapdev online
repository [aliases: ls]
snapdev tag Change template configuration
snapdev tag Update current active template configuration
snapdev create <template> Create a new template
snapdev checkout <template> Switch context to the specified template
snapdev clone <template> Clone a template from the snapdev online
Expand All @@ -46,6 +46,7 @@ Commands:
on the online repository
snapdev update Change template behaviour
snapdev delete <template> Delete a template from your local repository
snapdev deregister Delete snapdev online account
snapdev version Snapdev version number [aliases: v]
Options:
Expand Down Expand Up @@ -85,10 +86,10 @@ Template name: nodejs-cli
Generate for all models.
Model filename: default.json
========== Source Code ==========
MyModel.java
MyAppModel.java
```

`MyModel.java` is the output of the code generation. Any code that needs to be generated must be placed in the `src` folder.
`MyAppModel.java` is the output of the code generation. Any code that needs to be generated must be placed in the `src` folder.

A `dist` folder will be created under the `my-project` folder with the results of the code generation.

Expand All @@ -102,7 +103,7 @@ $ snapdev deploy
Template name: nodejs-cli
Model filename: default.json
========== Source Code ==========
MyModel.java
MyAppModel.java
Deployed!
```
Expand Down Expand Up @@ -364,9 +365,9 @@ Output:
* Michael Jackson * RIP
```

### Specieal fields
### Special fields

The `name` and `plural` are special properties that provides addition convenient string fieatures.
The `name` and `plural` are special properties that provides addition convenient string features.

Here is an example of how they can be used

Expand Down
13 changes: 13 additions & 0 deletions adhoc-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { yargs } = require('./bin/command');

const command = 'clean';

(async () => {

const output = await new Promise((resolve) => {
yargs.parse(command.split(' '), (error, argv, output) => {
resolve(output);
});
});
})();

Loading

0 comments on commit 0ce064f

Please sign in to comment.