Repository: kentcdodds/generator-kcd-oss
Branch: main
Commit: c9ad6f77e8a2
Files: 37
Total size: 46.1 KB
Directory structure:
gitextract_x32vci4k/
├── .all-contributorsrc
├── .gitattributes
├── .github/
│ └── workflows/
│ └── validate.yml
├── .gitignore
├── .huskyrc.js
├── .npmrc
├── .prettierignore
├── .prettierrc.js
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── generators/
│ └── app/
│ ├── index.js
│ └── templates/
│ ├── CHANGELOG.md
│ ├── CODE_OF_CONDUCT.md
│ ├── CONTRIBUTING.md
│ ├── LICENSE
│ ├── README.md
│ ├── _package.json
│ ├── all-contributorsrc
│ ├── gitattributes
│ ├── github/
│ │ ├── ISSUE_TEMPLATE.md
│ │ ├── PULL_REQUEST_TEMPLATE.md
│ │ └── workflows/
│ │ └── validate.yml
│ ├── gitignore
│ ├── huskyrc.js
│ ├── npmrc
│ ├── other/
│ │ ├── MAINTAINING.md
│ │ ├── USERS.md
│ │ └── manual-releases.md
│ ├── prettierignore
│ ├── prettierrc.js
│ ├── src/
│ │ ├── __tests__/
│ │ │ └── index.ts
│ │ └── index.ts
│ └── tsconfig.json
└── package.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .all-contributorsrc
================================================
{
"projectName": "generator-kcd-oss",
"projectOwner": "kentcdodds",
"imageSize": 100,
"commit": false,
"contributorsPerLine": 7,
"repoHost": "https://github.com",
"repoType": "github",
"skipCi": false,
"files": [
"README.md"
],
"contributors": [
{
"login": "kentcdodds",
"name": "Kent C. Dodds",
"avatar_url": "https://avatars.githubusercontent.com/u/1500684?v=3",
"profile": "https://kentcdodds.com",
"contributions": [
"code",
"doc",
"infra"
]
},
{
"login": "reznord",
"name": "Anup",
"avatar_url": "https://avatars0.githubusercontent.com/u/3415488?v=4",
"profile": "https://github.com/reznord",
"contributions": [
"doc"
]
},
{
"login": "edm00se",
"name": "Eric McCormick",
"avatar_url": "https://avatars3.githubusercontent.com/u/622118?v=4",
"profile": "https://edm00se.codes/",
"contributions": [
"doc"
]
},
{
"login": "MichaelDeBoey",
"name": "Michaël De Boey",
"avatar_url": "https://avatars3.githubusercontent.com/u/6643991?v=4",
"profile": "https://michaeldeboey.be",
"contributions": [
"code",
"doc"
]
},
{
"login": "MatanBobi",
"name": "Matan Borenkraout",
"avatar_url": "https://avatars2.githubusercontent.com/u/12711091?v=4",
"profile": "https://matan.io",
"contributions": [
"code"
]
},
{
"login": "nickmccurdy",
"name": "Nick McCurdy",
"avatar_url": "https://avatars0.githubusercontent.com/u/927220?v=4",
"profile": "https://nickmccurdy.com/",
"contributions": [
"doc",
"code"
]
}
]
}
================================================
FILE: .gitattributes
================================================
* text=auto eol=lf
================================================
FILE: .github/workflows/validate.yml
================================================
name: validate
on:
push:
branches:
- '+([0-9])?(.{+([0-9]),x}).x'
- 'main'
- 'next'
- 'next-major'
- 'beta'
- 'alpha'
- '!all-contributors/**'
pull_request: {}
jobs:
main:
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
strategy:
matrix:
node: [12, 14, 16]
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
env:
HUSKY_SKIP_INSTALL: true
- name: ▶️ Run validate script
run: npm run validate
- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v2
release:
needs: main
runs-on: ubuntu-latest
if:
${{ github.repository == 'kentcdodds/generator-kcd-oss' &&
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: 14
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
env:
HUSKY_SKIP_INSTALL: true
- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
================================================
FILE: .gitignore
================================================
node_modules
coverage
dist
.DS_Store
# these cause more harm than good
# when working with contributors
package-lock.json
yarn.lock
================================================
FILE: .huskyrc.js
================================================
module.exports = require('kcd-scripts/husky')
================================================
FILE: .npmrc
================================================
package-lock=false
================================================
FILE: .prettierignore
================================================
node_modules
coverage
dist
_package.json
================================================
FILE: .prettierrc.js
================================================
module.exports = require('kcd-scripts/prettier')
================================================
FILE: CHANGELOG.md
================================================
# CHANGELOG
The changelog is automatically updated using
[semantic-release](https://github.com/semantic-release/semantic-release). You
can see it on the [releases page](../../releases).
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
me+coc@kentcdodds.com. All complaints will be reviewed and investigated promptly
and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
Thanks for being willing to contribute!
**Working on your first Pull Request?** You can learn how from this _free_
series [How to Contribute to an Open Source Project on GitHub][egghead]
## Project setup
1. Fork and clone the repo
2. `$ npm install` to install dependencies
3. `$ npm run validate` to validate you've got it working
4. Create a branch for your PR
> Tip: Keep your `main` branch pointing at the original repository and make
> pull requests from branches on your fork. To do this, run:
>
> ```
> git remote add upstream https://github.com/kentcdodds/generator-kcd-oss
> git fetch upstream
> git branch --set-upstream-to=upstream/main main
> ```
>
> This will add the original repository as a "remote" called "upstream," Then
> fetch the git information from that remote, then set your local `main`
> branch to use the upstream main branch whenever you run `git pull`. Then you
> can make all of your pull request branches based on this `main` branch.
> Whenever you want to update your version of `main`, do a regular `git pull`.
## Committing and Pushing changes
Please make sure to run the tests before you commit your changes. You can run
`npm run test:update` which will update any snapshots that need updating. Make
sure to include those changes (if they exist) in your commit.
## Help needed
Please checkout the [the open issues][issues]
Also, please watch the repo and respond to questions/bug reports/feature
requests! Thanks!
[egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
[all-contributors]: https://github.com/all-contributors/all-contributors
[issues]: https://github.com/kentcdodds/generator-kcd-oss/issues
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2017 Kent C. Dodds
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
generator-kcd-oss
An open source project generator for my open source projects :)
---
[![Build Status][build-badge]][build]
[![version][version-badge]][package]
[![downloads][downloads-badge]][npmtrends]
[![MIT License][license-badge]][license]
[![All Contributors][all-contributors-badge]](#contributors-)
[![PRs Welcome][prs-badge]][prs]
[![Code of Conduct][coc-badge]][coc]
## The problem
I have to do a lot of repetitive stuff every time I set up a new open source
project.
## This solution
This is a yeoman generator for my open source projects
## Table of Contents
- [Installation](#installation)
- [Try Without Installing](#try-without-installing)
- [Usage](#usage)
- [Inspiration](#inspiration)
- [Issues](#issues)
- [🐛 Bugs](#-bugs)
- [💡 Feature Requests](#-feature-requests)
- [Contributors ✨](#contributors-)
- [LICENSE](#license)
## Installation
This module is distributed via [npm][npm] which is bundled with [node][node] and
should be installed globally (with `yo`):
```sh
npm install -g generator-kcd-oss yo
```
### Try Without Installing
```sh
npx -p yo -p generator-kcd-oss -c 'yo kcd-oss'
```
## Usage
```sh
yo kcd-oss
```
Follow the prompts...
## Inspiration
I referenced [@sindresorhus][sindresorhus]'s [module][generator-nm] heavily.
## Issues
_Looking to contribute? Look for the [Good First Issue][good-first-issue]
label._
### 🐛 Bugs
Please file an issue for bugs, missing documentation, or unexpected behavior.
[**See Bugs**][bugs]
### 💡 Feature Requests
Please file an issue to suggest new features. Vote on feature requests by adding
a 👍. This helps maintainers prioritize what to work on.
[**See Feature Requests**][requests]
## Contributors ✨
Thanks goes to these people ([emoji key][emojis]):
This project follows the [all-contributors][all-contributors] specification.
Contributions of any kind welcome!
## LICENSE
MIT
[npm]: https://www.npmjs.com
[node]: https://nodejs.org
[build-badge]: https://img.shields.io/github/workflow/status/kentcdodds/generator-kcd-oss/validate?logo=github&style=flat-square
[build]: https://github.com/kentcdodds/generator-kcd-oss/actions?query=workflow%3Avalidate
[version-badge]: https://img.shields.io/npm/v/generator-kcd-oss.svg?style=flat-square
[package]: https://www.npmjs.com/package/generator-kcd-oss
[downloads-badge]: https://img.shields.io/npm/dm/generator-kcd-oss.svg?style=flat-square
[npmtrends]: https://www.npmtrends.com/generator-kcd-oss
[license-badge]: https://img.shields.io/npm/l/generator-kcd-oss.svg?style=flat-square
[license]: https://github.com/kentcdodds/generator-kcd-oss/blob/master/LICENSE
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[prs]: https://makeapullrequest.com
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
[coc]: https://github.com/kentcdodds/generator-kcd-oss/blob/master/CODE_OF_CONDUCT.md
[emojis]: https://github.com/all-contributors/all-contributors#emoji-key
[all-contributors]: https://github.com/all-contributors/all-contributors
[all-contributors-badge]: https://img.shields.io/github/all-contributors/kentcdodds/generator-kcd-oss?color=orange&style=flat-square
[bugs]: https://github.com/kentcdodds/generator-kcd-oss/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Acreated-desc+label%3Abug
[requests]: https://github.com/kentcdodds/generator-kcd-oss/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement
[good-first-issue]: https://github.com/kentcdodds/generator-kcd-oss/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement+label%3A%22good+first+issue%22
[sindresorhus]: https://github.com/sindresorhus
[generator-nm]: https://github.com/sindresorhus/generator-nm
================================================
FILE: generators/app/index.js
================================================
const Generator = require('yeoman-generator')
const kebabCase = require('lodash.kebabcase')
module.exports = class extends Generator {
init() {
return this.prompt([
{
name: 'moduleName',
message: 'What do you want to name your module?',
default: this.appname.replace(/\s/g, '-'),
filter: x => kebabCase(x).toLowerCase(),
},
{
name: 'devDep',
message: 'Should people install this as one of their devDependencies?',
default: true,
type: 'confirm',
},
{
name: 'description',
message: `What's the project description?`,
type: 'input',
},
]).then(props => {
const mv = (from, to) => {
this.fs.move(this.destinationPath(from), this.destinationPath(to))
}
this.fs.copyTpl(
[`${this.templatePath()}/**`],
this.destinationPath(),
props,
)
mv('gitattributes', '.gitattributes')
mv('gitignore', '.gitignore')
mv('npmrc', '.npmrc')
mv('_package.json', 'package.json')
mv('all-contributorsrc', '.all-contributorsrc')
mv('huskyrc.js', '.huskyrc.js')
mv('prettierrc.js', '.prettierrc.js')
mv('prettierignore', '.prettierignore')
mv('github/ISSUE_TEMPLATE.md', '.github/ISSUE_TEMPLATE.md')
mv('github/PULL_REQUEST_TEMPLATE.md', '.github/PULL_REQUEST_TEMPLATE.md')
mv('github/workflows/validate.yml', '.github/workflows/validate.yml')
})
}
install() {
this.spawnCommand('git', ['init', '--initial-branch', 'main'])
this.npmInstall()
}
}
================================================
FILE: generators/app/templates/CHANGELOG.md
================================================
# CHANGELOG
The changelog is automatically updated using
[semantic-release](https://github.com/semantic-release/semantic-release). You
can see it on the [releases page](../../releases).
================================================
FILE: generators/app/templates/CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
me+coc@kentcdodds.com. All complaints will be reviewed and investigated promptly
and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
================================================
FILE: generators/app/templates/CONTRIBUTING.md
================================================
# Contributing
Thanks for being willing to contribute!
**Working on your first Pull Request?** You can learn how from this _free_
series [How to Contribute to an Open Source Project on GitHub][egghead]
## Project setup
1. Fork and clone the repo
2. Run `npm run setup -s` to install dependencies and run validation
3. Create a branch for your PR with `git checkout -b pr/your-branch-name`
> Tip: Keep your `main` branch pointing at the original repository and make pull
> requests from branches on your fork. To do this, run:
>
> ```
> git remote add upstream https://github.com/kentcdodds/<%= moduleName %>
> git fetch upstream
> git branch --set-upstream-to=upstream/main main
> ```
>
> This will add the original repository as a "remote" called "upstream," Then
> fetch the git information from that remote, then set your local `main` branch
> to use the upstream main branch whenever you run `git pull`. Then you can make
> all of your pull request branches based on this `main` branch. Whenever you
> want to update your version of `main`, do a regular `git pull`.
## Committing and Pushing changes
Please make sure to run the tests before you commit your changes. You can run
`npm run test:update` which will update any snapshots that need updating. Make
sure to include those changes (if they exist) in your commit.
## Help needed
Please checkout the [the open issues][issues]
Also, please watch the repo and respond to questions/bug reports/feature
requests! Thanks!
[egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
[issues]: https://github.com/kentcdodds/<%= moduleName %>/issues
================================================
FILE: generators/app/templates/LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2020 Kent C. Dodds
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: generators/app/templates/README.md
================================================
<%= moduleName %>
<%= description %>
---
[![Build Status][build-badge]][build]
[![Code Coverage][coverage-badge]][coverage]
[![version][version-badge]][package]
[![downloads][downloads-badge]][npmtrends]
[![MIT License][license-badge]][license]
[![All Contributors][all-contributors-badge]](#contributors-)
[![PRs Welcome][prs-badge]][prs]
[![Code of Conduct][coc-badge]][coc]
## The problem
// TODO
## This solution
// TODO
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Inspiration](#inspiration)
- [Other Solutions](#other-solutions)
- [Issues](#issues)
- [🐛 Bugs](#-bugs)
- [💡 Feature Requests](#-feature-requests)
- [Contributors ✨](#contributors-)
- [LICENSE](#license)
## Installation
This module is distributed via [npm][npm] which is bundled with [node][node] and
should be installed as one of your project's <% if (devDep) {
%>`devDependencies`<% } %><% if (!devDep) { %>`dependencies`<% } %>:
```
npm install --save<% if (devDep) { %>-dev<% } %> <%= moduleName %>
```
## Usage
// TODO
## Inspiration
// TODO
## Other Solutions
I'm not aware of any, if you are please [make a pull request][prs] and add it
here!
## Issues
_Looking to contribute? Look for the [Good First Issue][good-first-issue]
label._
### 🐛 Bugs
Please file an issue for bugs, missing documentation, or unexpected behavior.
[**See Bugs**][bugs]
### 💡 Feature Requests
Please file an issue to suggest new features. Vote on feature requests by adding
a 👍. This helps maintainers prioritize what to work on.
[**See Feature Requests**][requests]
## Contributors ✨
Thanks goes to these people ([emoji key][emojis]):
This project follows the [all-contributors][all-contributors] specification.
Contributions of any kind welcome!
## LICENSE
MIT
[npm]: https://www.npmjs.com
[node]: https://nodejs.org
[build-badge]: https://img.shields.io/github/workflow/status/kentcdodds/<%= moduleName %>/validate?logo=github&style=flat-square
[build]: https://github.com/kentcdodds/<%= moduleName %>/actions?query=workflow%3Avalidate
[coverage-badge]: https://img.shields.io/codecov/c/github/kentcdodds/<%= moduleName %>.svg?style=flat-square
[coverage]: https://codecov.io/github/kentcdodds/<%= moduleName %>
[version-badge]: https://img.shields.io/npm/v/<%= moduleName %>.svg?style=flat-square
[package]: https://www.npmjs.com/package/<%= moduleName %>
[downloads-badge]: https://img.shields.io/npm/dm/<%= moduleName %>.svg?style=flat-square
[npmtrends]: https://www.npmtrends.com/<%= moduleName %>
[license-badge]: https://img.shields.io/npm/l/<%= moduleName %>.svg?style=flat-square
[license]: https://github.com/kentcdodds/<%= moduleName %>/blob/main/LICENSE
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[prs]: https://makeapullrequest.com
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
[coc]: https://github.com/kentcdodds/<%= moduleName %>/blob/main/CODE_OF_CONDUCT.md
[emojis]: https://github.com/all-contributors/all-contributors#emoji-key
[all-contributors]: https://github.com/all-contributors/all-contributors
[all-contributors-badge]: https://img.shields.io/github/all-contributors/kentcdodds/<%= moduleName %>?color=orange&style=flat-square
[bugs]: https://github.com/kentcdodds/<%= moduleName %>/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Acreated-desc+label%3Abug
[requests]: https://github.com/kentcdodds/<%= moduleName %>/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement
[good-first-issue]: https://github.com/kentcdodds/<%= moduleName %>/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement+label%3A%22good+first+issue%22
================================================
FILE: generators/app/templates/_package.json
================================================
{
"name": "<%= moduleName %>",
"version": "0.0.0-semantically-released",
"description": "<%= description %>",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"keywords": [],
"author": "Kent C. Dodds (https://kentcdodds.com)",
"license": "MIT",
"engines": {
"node": ">=12",
"npm": ">=6"
},
"repository": {
"type": "git",
"url": "https://github.com/kentcdodds/<%= moduleName %>"
},
"bugs": {
"url": "https://github.com/kentcdodds/<%= moduleName %>/issues"
},
"homepage": "https://github.com/kentcdodds/<%= moduleName %>#readme",
"files": [
"dist"
],
"scripts": {
"build": "kcd-scripts build",
"lint": "kcd-scripts lint",
"setup": "npm install && npm run validate -s",
"test": "kcd-scripts test",
"test:update": "npm test -- --updateSnapshot --coverage",
"typecheck": "kcd-scripts typecheck",
"validate": "kcd-scripts validate"
},
"dependencies": {
"@babel/runtime": "^7.14.6"
},
"devDependencies": {
"@types/jest": "^26.0.24",
"kcd-scripts": "^11.1.0",
"typescript": "^4.3.5"
},
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js"
},
"eslintIgnore": [
"node_modules",
"coverage",
"dist"
]
}
================================================
FILE: generators/app/templates/all-contributorsrc
================================================
{
"projectName": "<%= moduleName %>",
"projectOwner": "kentcdodds",
"imageSize": 100,
"commit": false,
"contributorsPerLine": 7,
"repoHost": "https://github.com",
"repoType": "github",
"skipCi": false,
"files": [
"README.md"
],
"contributors": [
{
"login": "kentcdodds",
"name": "Kent C. Dodds",
"avatar_url": "https://avatars.githubusercontent.com/u/1500684?v=3",
"profile": "https://kentcdodds.com",
"contributions": [
"code",
"doc",
"infra",
"test"
]
}
]
}
================================================
FILE: generators/app/templates/gitattributes
================================================
* text=auto eol=lf
================================================
FILE: generators/app/templates/github/ISSUE_TEMPLATE.md
================================================
- `<%= moduleName %>` version:
- `node` version:
- `npm` version:
Relevant code or config
```js
```
What you did:
What happened:
Reproduction repository:
Problem description:
Suggested solution:
================================================
FILE: generators/app/templates/github/PULL_REQUEST_TEMPLATE.md
================================================
**What**:
**Why**:
**How**:
**Checklist**:
- [ ] Documentation
- [ ] Tests
- [ ] Ready to be merged
================================================
FILE: generators/app/templates/github/workflows/validate.yml
================================================
name: validate
on:
push:
branches:
- '+([0-9])?(.{+([0-9]),x}).x'
- 'main'
- 'next'
- 'next-major'
- 'beta'
- 'alpha'
- '!all-contributors/**'
pull_request: {}
jobs:
main:
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
strategy:
matrix:
node: [12, 14, 16]
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
env:
HUSKY_SKIP_INSTALL: true
- name: ▶️ Run validate script
run: npm run validate
- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v2
release:
needs: main
runs-on: ubuntu-latest
if:
${{ github.repository == 'kentcdodds/<%= moduleName %>' &&
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: 14
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
env:
HUSKY_SKIP_INSTALL: true
- name: 🏗 Run build script
run: npm run build
- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
================================================
FILE: generators/app/templates/gitignore
================================================
node_modules
coverage
dist
.DS_Store
# these cause more harm than good
# when working with contributors
package-lock.json
yarn.lock
================================================
FILE: generators/app/templates/huskyrc.js
================================================
module.exports = require('kcd-scripts/husky')
================================================
FILE: generators/app/templates/npmrc
================================================
package-lock=false
================================================
FILE: generators/app/templates/other/MAINTAINING.md
================================================
# Maintaining
**Table of Contents**
- [Code of Conduct](#code-of-conduct)
- [Issues](#issues)
- [Pull Requests](#pull-requests)
- [Release](#release)
- [Thanks!](#thanks)
This is documentation for maintainers of this project.
## Code of Conduct
Please review, understand, and be an example of it. Violations of the code of
conduct are taken seriously, even (especially) for maintainers.
## Issues
We want to support and build the community. We do that best by helping people
learn to solve their own problems. We have an issue template and hopefully most
folks follow it. If it's not clear what the issue is, invite them to create a
minimal reproduction of what they're trying to accomplish or the bug they think
they've found.
Once it's determined that a code change is necessary, point people to
[makeapullrequest.com](https://makeapullrequest.com) and invite them to make a
pull request. If they're the one who needs the feature, they're the one who can
build it. If they need some hand holding and you have time to lend a hand,
please do so. It's an investment into another human being, and an investment
into a potential maintainer.
Remember that this is open source, so the code is not yours, it's ours. If
someone needs a change in the codebase, you don't have to make it happen
yourself. Commit as much time to the project as you want/need to. Nobody can ask
any more of you than that.
## Pull Requests
As a maintainer, you're fine to make your branches on the main repo or on your
own fork. Either way is fine.
When we receive a pull request, a GitHub Action is kicked off automatically (see
the `.github/workflows/validate.yml` for what runs in the Action). We avoid
merging anything that breaks the GitHub Action.
Please review PRs and focus on the code rather than the individual. You never
know when this is someone's first ever PR and we want their experience to be as
positive as possible, so be uplifting and constructive.
When you merge the pull request, 99% of the time you should use the
[Squash and merge](https://help.github.com/articles/merging-a-pull-request/)
feature. This keeps our git history clean, but more importantly, this allows us
to make any necessary changes to the commit message so we release what we want
to release. See the next section on Releases for more about that.
## Release
Our releases are automatic. They happen whenever code lands into `main`. A
GitHub Action gets kicked off and if it's successful, a tool called
[`semantic-release`](https://github.com/semantic-release/semantic-release) is
used to automatically publish a new release to npm as well as a changelog to
GitHub. It is only able to determine the version and whether a release is
necessary by the git commit messages. With this in mind, **please brush up on
[the commit message convention][commit] which drives our releases.**
> One important note about this: Please make sure that commit messages do NOT
> contain the words "BREAKING CHANGE" in them unless we want to push a major
> version. I've been burned by this more than once where someone will include
> "BREAKING CHANGE: None" and it will end up releasing a new major version. Not
> a huge deal honestly, but kind of annoying...
## Thanks!
Thank you so much for helping to maintain this project!
[commit]: https://github.com/conventional-changelog-archived-repos/conventional-changelog-angular/blob/ed32559941719a130bb0327f886d6a32a8cbc2ba/convention.md
================================================
FILE: generators/app/templates/other/USERS.md
================================================
# Users
If you or your company uses this project, add your name to this list! Eventually
we may have a website to showcase these (wanna build it!?)
> No users have been added yet!
================================================
FILE: generators/app/templates/other/manual-releases.md
================================================
# manual-releases
This project has an automated release set up. So things are only released when
there are useful changes in the code that justify a release. But sometimes
things get messed up one way or another and we need to trigger the release
ourselves. When this happens, simply bump the number below and commit that with
the following commit message based on your needs:
**Major**
```
fix(release): manually release a major version
There was an issue with a major release, so this manual-releases.md
change is to release a new major version.
Reference: #
BREAKING CHANGE:
```
**Minor**
```
feat(release): manually release a minor version
There was an issue with a minor release, so this manual-releases.md
change is to release a new minor version.
Reference: #
```
**Patch**
```
fix(release): manually release a patch version
There was an issue with a patch release, so this manual-releases.md
change is to release a new patch version.
Reference: #
```
The number of times we've had to do a manual release is: 0
================================================
FILE: generators/app/templates/prettierignore
================================================
node_modules
coverage
dist
================================================
FILE: generators/app/templates/prettierrc.js
================================================
module.exports = require('kcd-scripts/prettier')
================================================
FILE: generators/app/templates/src/__tests__/index.ts
================================================
// TODO: test the library
================================================
FILE: generators/app/templates/src/index.ts
================================================
// TODO: let's build something amazing...
================================================
FILE: generators/app/templates/tsconfig.json
================================================
{
"extends": "./node_modules/kcd-scripts/shared-tsconfig.json"
}
================================================
FILE: package.json
================================================
{
"name": "generator-kcd-oss",
"version": "0.0.0-semantically-released",
"description": "A generator for my projects. Feel free to contribute if you want to adapt it for more use cases",
"keywords": [
"open source",
"kentcdodds",
"yeoman-generator"
],
"author": "Kent C. Dodds (https://kentcdodds.com)",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/kentcdodds/generator-kcd-oss"
},
"bugs": {
"url": "https://github.com/kentcdodds/generator-kcd-oss/issues"
},
"homepage": "https://github.com/kentcdodds/generator-kcd-oss#readme",
"files": [
"generators"
],
"scripts": {
"lint": "kcd-scripts lint",
"setup": "npm install && npm run validate -s",
"validate": "kcd-scripts validate"
},
"dependencies": {
"lodash.kebabcase": "^4.1.1",
"npm-check": "^5.9.2",
"yeoman-generator": "^4.13.0"
},
"devDependencies": {
"kcd-scripts": "^11.1.0"
},
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js"
},
"eslintIgnore": [
"node_modules",
"coverage",
"dist",
"generators/app/templates/src"
],
"engines": {
"node": ">=12",
"npm": ">=6"
}
}