forked from saojs/sao-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,015 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{ | ||
"name": "template-template", | ||
"name": "sao-generator", | ||
"version": "0.9.1", | ||
"description": "Scaffold out an SAO template", | ||
"description": "Scaffold out an SAO generator", | ||
"main": "index.js", | ||
"repository": { | ||
"url": "egoist/template-template", | ||
"url": "saojs/sao-generator", | ||
"type": "git" | ||
}, | ||
"scripts": { | ||
"test": "ava test/test*.js" | ||
"test": "ava" | ||
}, | ||
"author": "EGOIST <[email protected]>", | ||
"license": "MIT", | ||
|
@@ -17,6 +17,6 @@ | |
}, | ||
"devDependencies": { | ||
"ava": "^0.21.0", | ||
"sao": "^0.20.8" | ||
"sao": "^1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
const superb = require('superb') | ||
|
||
module.exports = { | ||
prompts() { | ||
return [ | ||
{ | ||
name: 'name', | ||
message: 'What is the name of the new generator (must be sao-*)', | ||
default: this.outFolder, | ||
filter: val => val.toLowerCase() | ||
}, | ||
{ | ||
name: 'description', | ||
message: 'How would you descripe the new template', | ||
default: `my ${superb()} SAO generator` | ||
}, | ||
{ | ||
name: 'username', | ||
message: 'What is your GitHub username', | ||
default: this.gitUser.username || this.gitUser.name, | ||
filter: val => val.toLowerCase(), | ||
store: true | ||
}, | ||
{ | ||
name: 'email', | ||
message: 'What is your email?', | ||
default: this.gitUser.email, | ||
store: true | ||
}, | ||
{ | ||
name: 'website', | ||
message: 'The URL of your website', | ||
default({ username }) { | ||
return `github.com/${username}` | ||
}, | ||
store: true | ||
} | ||
] | ||
}, | ||
actions: [ | ||
{ | ||
type: 'add', | ||
files: '**', | ||
transformExclude: 'template/**' | ||
}, | ||
{ | ||
type: 'move', | ||
patterns: { | ||
gitignore: '.gitignore' | ||
} | ||
} | ||
], | ||
async completed() { | ||
this.gitInit() | ||
await this.npmInstall() | ||
this.showProjectTips() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const superb = require('superb') | ||
|
||
module.exports = { | ||
prompts() { | ||
return [ | ||
{ | ||
name: 'name', | ||
message: 'What is the name of the new generator (must be sao-*)', | ||
default: this.outFolder, | ||
filter: val => val.toLowerCase() | ||
}, | ||
{ | ||
name: 'description', | ||
message: 'How would you descripe the new project', | ||
default: `my ${superb()} project` | ||
}, | ||
{ | ||
name: 'username', | ||
message: 'What is your GitHub username', | ||
default: this.gitUser.username || this.gitUser.name, | ||
filter: val => val.toLowerCase(), | ||
store: true | ||
}, | ||
{ | ||
name: 'email' | ||
message: 'What is your email?', | ||
default: this.gitUser.email, | ||
store: true | ||
}, | ||
{ | ||
message: 'The URL of your website', | ||
default({ username }) { | ||
return `github.com/${username}` | ||
}, | ||
store: true | ||
} | ||
] | ||
}, | ||
actions: [ | ||
{ | ||
type: 'add', | ||
files: '**' | ||
}, | ||
{ | ||
type: 'move', | ||
patterns: { | ||
gitignore: '.gitignore' | ||
} | ||
} | ||
], | ||
async completed() { | ||
this.gitInit() | ||
await this.npmInstall() | ||
this.showProjectTips() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.