-
Notifications
You must be signed in to change notification settings - Fork 7
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
79 changed files
with
14,597 additions
and
419 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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
'use strict' | ||
|
||
const assert = require('yeoman-assert') | ||
const helpers = require('yeoman-test') | ||
|
||
describe('community:readme', () => { | ||
afterAll(() => { | ||
process.setMaxListeners(0) | ||
}) | ||
|
||
beforeEach(() => { | ||
return helpers.run(require.resolve('../generators/readme')) | ||
.withOptions({ | ||
name: 'my-project', | ||
description: 'a cool project', | ||
githubAccount: 'yeoman', | ||
authorName: 'Yeoman', | ||
authorUrl: 'http://yeoman.io' | ||
}) | ||
.on('ready', (gen) => { | ||
gen.fs.writeJSON(gen.destinationPath('package.json'), { | ||
license: 'MIT', | ||
repository: 'org/repo' | ||
}) | ||
}) | ||
}) | ||
|
||
it('writes the license (if one has been declared)', () => { | ||
assert.file('README.md') | ||
assert.fileContent('README.md', '> a cool project') | ||
assert.fileContent('README.md', '[MIT][license-url] © [Yeoman][author-url]') | ||
}) | ||
|
||
it('writes a link reference for new "feature request" issues', () => { | ||
assert.fileContent('README.md', '[issues-new-feat-url]: /org/repo/issues/new?title=feat') | ||
}) | ||
|
||
it('writes a link reference for new "defect (bug)" issues', () => { | ||
assert.fileContent('README.md', '[issues-new-defect-url]: /org/repo/issues/new?title=fix') | ||
}) | ||
}) | ||
|
||
describe('community:readme --generate-into', () => { | ||
beforeEach(() => { | ||
return helpers.run(require.resolve('../generators/readme')) | ||
.withOptions({ | ||
name: 'my-project', | ||
description: 'a cool project', | ||
githubAccount: 'yeoman', | ||
authorName: 'Yeoman', | ||
authorUrl: 'http://yeoman.io', | ||
generateInto: 'other/' | ||
}) | ||
.on('ready', (gen) => { | ||
gen.fs.writeJSON(gen.destinationPath('other/package.json'), { | ||
license: 'MIT' | ||
}) | ||
}) | ||
}) | ||
|
||
it('creates and fill contents in README.md', () => { | ||
assert.file('other/README.md') | ||
assert.fileContent('other/README.md', '> a cool project') | ||
assert.fileContent('other/README.md', '[MIT][license-url] © [Yeoman][author-url]') | ||
assert.fileContent('other/README.md', '[issues-new-feat-url]: ./issues/new?title=feat') | ||
}) | ||
}) |
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ install: | |
- npm install --silent --quiet | ||
|
||
platform: | ||
- x86 | ||
- x64 | ||
|
||
build: off | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,28 @@ | ||
### Usage | ||
|
||
```shell | ||
yo community:readme -h | ||
Usage: | ||
yo community:readme [options] | ||
|
||
Options: | ||
-h, --help # Print the generator's options and usage | ||
--skip-cache # Do not remember prompt answers Default: false | ||
--skip-install # Do not automatically install dependencies Default: false | ||
--authorName # Author name | ||
--authorUrl # Author URL | ||
--generateInto # Destination directory for generated files | ||
--githubAccount # GitHub account/organization name | ||
--description # Product description | ||
--lang # Product's primary programming language Default: Unspecified | ||
--licenseName # Open source software license | ||
--licenseUrl # URL to your LICENSE file Default: ./LICENSE | ||
--name # Product name | ||
-a, --includeApi # README.md: Public API overview (optional) Default: true | ||
-b, --includeBackground # README.md: Background section content (optional) Default: false | ||
-c, --includeConfig # README.md: Configuration instructions (optional) Default: false | ||
-o, --includeOverview # README.md: Overview section content (optional) Default: false | ||
-s, --includeSecurity # README.md: Security section content (optional) Default: false | ||
``` | ||
|
||
### API |
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,99 @@ | ||
const defaultOptions = { | ||
authorName: { | ||
desc: 'Author name', | ||
required: true, | ||
type: String | ||
}, | ||
authorUrl: { | ||
desc: 'Author URL', | ||
required: true, | ||
type: String | ||
}, | ||
dependencyManager: { | ||
defaults: 'Unspecified', | ||
desc: 'Tool used to install third-party libraries', | ||
required: false, | ||
type: String | ||
}, | ||
generateInto: { | ||
defaults: '', | ||
desc: 'Destination directory for generated files', | ||
required: false, | ||
type: String | ||
}, | ||
gitRemoteOriginUrl: { | ||
defaults: '/', | ||
desc: 'The URI (SSH or HTTPS) of your Git repository', | ||
required: false, | ||
type: String | ||
}, | ||
githubAccount: { | ||
desc: 'GitHub account/organization name', | ||
required: true, | ||
type: String | ||
}, | ||
description: { | ||
desc: 'Product description', | ||
required: true, | ||
type: String | ||
}, | ||
lang: { | ||
defaults: 'Unspecified', | ||
desc: 'Product\'s primary programming language', | ||
required: true, | ||
type: String | ||
}, | ||
license: { | ||
desc: 'Open source software license', | ||
required: false, | ||
type: String | ||
}, | ||
licenseUrl: { | ||
default: './LICENSE', | ||
desc: 'URL to your LICENSE file', | ||
required: true, | ||
type: String | ||
}, | ||
name: { | ||
desc: 'Product name', | ||
required: true, | ||
type: String | ||
}, | ||
includeApi: { | ||
alias: 'a', | ||
defaults: true, | ||
desc: 'README.md: Public API overview (optional)', | ||
required: false, | ||
type: Boolean | ||
}, | ||
includeBackground: { | ||
alias: 'b', | ||
defaults: false, | ||
desc: 'README.md: Background section content (optional)', | ||
required: false, | ||
type: Boolean | ||
}, | ||
includeConfig: { | ||
alias: 'c', | ||
defaults: false, | ||
desc: 'README.md: Configuration instructions (optional)', | ||
required: false, | ||
type: Boolean | ||
}, | ||
includeOverview: { | ||
alias: 'o', | ||
defaults: false, | ||
desc: 'README.md: Overview section content (optional)', | ||
required: false, | ||
type: Boolean | ||
}, | ||
includeSecurity: { | ||
alias: 's', | ||
defaults: false, | ||
desc: 'README.md: Security section content (optional)', | ||
required: false, | ||
type: Boolean | ||
} | ||
} | ||
|
||
module.exports = defaultOptions |
Oops, something went wrong.