Skip to content

Commit

Permalink
Add * - initial commit
Browse files Browse the repository at this point in the history
- based on eventhoven
  • Loading branch information
Raiondesu committed Nov 11, 2019
0 parents commit 9303967
Show file tree
Hide file tree
Showing 20 changed files with 843 additions and 0 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: travis-pro
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
76 changes: 76 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, 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.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers 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, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
17 changes: 17 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Contributing to `{{package-name}}`

Please note - we have a [code of conduct](./CODE_OF_CONDUCT.md),
please follow it in all your interactions with the project.

1. [Start with an issue](https://github.com/{{owner}}/{{package-name}}/issues/new/choose).\
If there's a bug or a feature request, feel free to [create an issue](https://github.com/{{owner}}/{{package-name}}/issues/new/choose) first.

This prevents submitting changes that are not thought through and, as a consequence, allows for a healthier and more productive way of coming with solutions to problems.

2. Fork the repo.
3. Clone the forked repo.
4. Create a new branch (generally named `fix/thing-you-want-to-fix` or `feature/name-of-the-feature`).
5. Commit changes to that branch.
Do not forget to `npm install` and `npm run dev` while making changes.
6. Propose a PR to the **release** branch of this repository (PR's to master will be rebased).
7. Request or wait for a review from maintainers of the repository.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help improve {{package-name}}
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

---

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

---

**Environment (please complete the following information):**
- OS: [e.g. Windows]
- Platform:
- [] Browser [e.g. chrome, safari] (**version**)
- [] Node (**version**)
- `{{package-name}}` version: **v0.10.0**
---
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest your own idea for {{package-name}}
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/question-support-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Question/support request
about: Lack understanding of a certain feature or just have a question? Use this.
title: ''
labels: question
assignees: Raiondesu

---

<!--
Please, describe your question in the most precise way possible.
It's important for us to understand the question to answer it correctly.
-->
65 changes: 65 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!--
Please, go through these steps before you submit a PR.
1. Make sure that your PR is not a duplicate.
2. If not, then make sure that:
a. You have done your changes in a separate branch. Branches MUST have descriptive names that start with either the `fix/` or `feature/` prefixes. Good examples are: `fix/signin-issue` or `feature/issue-templates`.
b. You have a descriptive commit message with a short title (first line).
c. You have only one commit (if not, squash them into one commit).
d. `npm test` doesn't throw any error. If it does, fix them first and amend your commit (`git commit --amend`).
3. **After** these steps, you're ready to open a pull request.
a. Your pull request MUST NOT target the `master` branch on this repository. You probably want to target `staging` instead.
b. Give a descriptive title to your PR.
c. Provide a description of your changes.
d. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).
IMPORTANT: Please review the [CONTRIBUTING.md](./CONTRIBUTING.md) file for detailed contributing guidelines.
-->

## Description
<!--
Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context.
List any dependencies that are required for this change.
-->

Closes # (issue)

## Type of change

<!-- Please delete options that are not relevant. -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

<!--
Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
-->

- [ ] Test A
- [ ] Test B

### Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage
node_modules
.vscode/settings.json
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: node_js

node_js:
- stable

install:
- npm install

script:
- npm t
- npm run build

after_success: npm run coverage

notifications:
email: false
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 {{owner}}

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.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ts-lib-template

A simple zero-setup typescript template for creating maintainable libraries.

## Usage

1. Create your own repository.
- Choose `ts-lib-template` as the repository template.\
OR
- Clone this repository and:
- `rm .git`
- `git init`

2. In the repo's folder run:
- `node init-ts {your-github-username-or-org}/{your-package-name}`
- `npm i`
3. You're ready to go! Adjust the contents as you see fit.
20 changes: 20 additions & 0 deletions README.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# {{package-name}} [![npm](https://img.shields.io/npm/v/{{package-name}}.svg?style=flat-square)](https://www.npmjs.com/package/{{package-name}} "NPM package page")<!-- omit in toc -->

> {{description}}
[![travis](https://img.shields.io/travis/com/{{owner}}/{{package-name}}?style=flat-square)](https://travis-ci.com/{{owner}}/{{package-name}} "Latest Travis CI build")
[![npm](https://img.shields.io/npm/dm/{{package-name}}.svg?style=flat-square)](https://www.npmjs.com/package/{{package-name}} "Downloads per month, but who cares?")
[![size](https://img.shields.io/bundlephobia/minzip/{{package-name}}@latest?style=flat-square)](https://bundlephobia.com/result?p={{package-name}}@latest "minzipped size")
[![coveralls](https://img.shields.io/coveralls/github/{{owner}}/{{package-name}}?style=flat-square)](https://coveralls.io/github/{{owner}}/{{package-name}} "Code coverage")
[![code quality](https://img.shields.io/codeclimate/maintainability/{{owner}}/{{package-name}}?style=flat-square)](https://codeclimate.com/github/{{owner}}/{{package-name}}/maintainability "Code quality")

[![code pen](https://img.shields.io/badge/playground-link-blueviolet?style=flat-square)](https://codepen.io/raiondesu/pen/qBBPPom "Link to in-browser playground")

## Table of Contents<!-- omit in toc -->

## What is this?

---

Something's missing or found a bug?\
Feel free to [create an issue](https://github.com/{{owner}}/{{package-name}}/issues/new)! 😉
15 changes: 15 additions & 0 deletions bili.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { name } from 'package.json';
import { Config } from 'bili';

export default {
input: 'src/index.ts',
output: {
moduleName: name,
fileName: 'umd.js',
format: 'umd-min',
target: 'browser',
},
plugins: {
typescript2: true,
},
} as Config;
32 changes: 32 additions & 0 deletions init/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const replace = require('replace-in-file');

const yargs = require('yargs')
.option('description', {
alias: 'd',
help: 'A short package description',
default: ''
})
.argv;

try {
const [packageOrg, packageName] = yargs._[0].split('/');

replace({
files: process.cwd() + '/**',
from: /{{package-name}}/,
to: packageName
});

replace({
files: process.cwd() + '/**',
from: /{{owner}}/,
to: packageOrg
});

return 0;
} catch (e) {
console.error(`Please, provide package information in the following format:
node init {github-username-or-org}/{package-name}`);

return 1;
}
Loading

0 comments on commit 9303967

Please sign in to comment.