README
github-scaffolder
VCS scaffolder for projects to be hosted on GitHub
Table of Contents
- Features
- Usage
- Contributing
Features
Creation of GitHub repository
When authentication is provided, a repository will be created on GitHub, assuming one does not already exist.
Configuration of GitHub Repository
This tool configures repository settings by generating the settings file for use by probot/settings. The settings in the file will be applied, along with those in the account-level file, once the generated file is pushed to GitHub in the default branch.
Filing of issues
Issues will be created in the repository for tasks that should be completed after acaffolding is complete
Usage
Installation
$ npm install @travi/github-scaffolder --prod
Enabling actions against the GitHub API
This plugin leverages the .netrc strategy for octokit. Be sure to add your personal access token to leverage the GitHub API integration benefits of this plugin.
probot/settings
Enabling repository configuration with - Be sure to install for the user or organization account that you are scaffolding the new project for.
- Enable the settings app for all repositories in the account
Account-level settings
The settings file generated by this tool assumes that it is extending an account level config
- Ensure that you have created a
.github
repository in your account - Create an account-level settings file
in the
.github
repository at the location.github/settings.yml
within the repository- for an organization account, this is a good example
- for a user account, this is a good example
Example
Import
import {scaffold} from '@travi/github-scaffolder';
Scaffold
(async () => {
await scaffold({
projectRoot: process.cwd(),
name: 'foo',
owner: 'travi',
description: 'This is my awesome project',
homepage: 'https://github.com/travi/foo#README',
visibility: 'Public',
tags: ['foo', 'bar'],
nextSteps: [
{summary: 'Do not forget to do this!'},
{
summary: 'Remember to do that',
description: `Take these steps:
- [ ] step 1
- [ ] step 2`
}
]
});
})();
API
string (required) projectRoot
path to the root of the project
string (required) name
Name for the repository
string (required) owner
Name of the account for the repository
string (optional) description
Short description of the project
string (optional) homepage
URL of the project homepage
string (optional) visibility
Whether the repository should be public or private. If provided, must be 'Public' or 'Private'.
list of strings (optional) tags
List of tags to be used as repository topics
list of objects (optional) nextSteps
TODO list to be filed as issues
string (required) summary
String to be used as the title of the created issue
string (optional) description
Markdown content for the in-depth description of the issue
Contributing
Dependencies
$ nvm install
$ npm install
Verification
$ npm test