This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
generated from connor-baer/package-template
-
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
0 parents
commit a35e5dd
Showing
19 changed files
with
13,257 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"presets": ["@babel/preset-env"], | ||
"ignore": ["node_modules/**"] | ||
} |
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 @@ | ||
module.exports = require('@sumup/foundry/eslint').react; |
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,31 @@ | ||
--- | ||
name: Report a bug | ||
about: File a bug report | ||
--- | ||
|
||
## Describe the bug | ||
|
||
A clear and concise description of what the bug is. | ||
|
||
## Steps 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. | ||
|
||
## Specifications | ||
|
||
* Version: | ||
* Browser: | ||
* OS: | ||
|
||
## Additional context | ||
|
||
Add any other context about the problem here. |
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,16 @@ | ||
--- | ||
name: Feature request | ||
about: Request an enhancement or a new feature | ||
--- | ||
|
||
## Purpose | ||
|
||
Describe what you are trying to accomplish. What problem does the feature solve? | ||
|
||
## Approach & Changes | ||
|
||
Suggest how you would solve the problem. | ||
|
||
## Additional Context | ||
|
||
e.g. screenshots |
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,18 @@ | ||
--- | ||
name: Question | ||
about: Something's not clear? Ask a question | ||
--- | ||
|
||
## Summarize the question | ||
|
||
A clear and concise description of your question. | ||
|
||
## Context | ||
|
||
Provide relevant, detailed context to help us answer your question. | ||
|
||
## Specifications | ||
|
||
* Version: | ||
* Browser: | ||
* OS: |
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,7 @@ | ||
## Purpose | ||
|
||
Describe the problem you are trying to solve. | ||
|
||
## Approach and changes | ||
|
||
Describe the changes you made to solve the problem. |
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,65 @@ | ||
# Project | ||
dist | ||
.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next |
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 @@ | ||
module.exports = require('@sumup/foundry/husky').base; |
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 @@ | ||
module.exports = require('@sumup/foundry/semantic-release').modules; |
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,46 @@ | ||
# 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, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behaviour 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 behaviour by participants include: | ||
|
||
- The use of sexualised 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 behaviour and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behaviour. | ||
|
||
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 behaviours 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 behaviour may be reported by contacting the project team at [github@connorbaer.co](mailto:github@connorbaer.co). The project team will review and investigate all complaints, and will respond in a way that it deems 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 [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Connor Bär | ||
|
||
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. |
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,70 @@ | ||
<div align="center"> | ||
|
||
# package-template <!-- omit in TOC --> | ||
|
||
JS package template repository | ||
|
||
[![npm version](https://badge.fury.io/js/%40madebyconnor%2Fpackage-template.svg)](https://badge.fury.io/js/%40madebyconnor%2Fpackage-template) [![Build Status](https://travis-ci.org/connor-baer/package-template.svg?branch=master)](https://travis-ci.org/connor-baer/package-template) [![codecov](https://codecov.io/gh/connor-baer/package-template/branch/master/graph/badge.svg)](https://codecov.io/gh/connor-baer/package-template) [![License MIT](https://img.shields.io/github/license/connor-baer/package-template.svg)](https://github.com/connor-baer/package-template/blob/master/LICENSE.md) | ||
|
||
</div> | ||
|
||
<!-- TOC --> | ||
|
||
- [Installation](#Installation) | ||
- [Getting started](#Getting-started) | ||
- [Getting the smallest possible bundle size](#Getting-the-smallest-possible-bundle-size) | ||
- [Changelog](#Changelog) | ||
|
||
<!-- /TOC --> | ||
|
||
--- | ||
|
||
[`package-template`](https://www.npmjs.com/package/@madebyconnor/package-template) is a template repository for my JavaScript modules. | ||
|
||
Some standout features include... | ||
|
||
All this clocks in at around ⚡ kB gzipped. | ||
|
||
⚠️ Requires Node >= 8.0.0. | ||
|
||
## Installation | ||
|
||
Install `@madebyconnor/package-template` with your favorite package manager. | ||
|
||
```shell | ||
# yarn | ||
yarn add @madebyconnor/package-template | ||
# npm | ||
npm i @madebyconnor/package-template | ||
``` | ||
|
||
## Getting started | ||
|
||
`@madebyconnor/package-template` exports a function | ||
|
||
```js | ||
import sayHello from '@madebyconnor/package-template'; | ||
|
||
sayHello('Tessa') | ||
|
||
/* | ||
returns: | ||
Hello Tessa | ||
*/ | ||
``` | ||
|
||
## Getting the smallest possible bundle size | ||
|
||
Many development conveniences are placed behind `process.env.NODE_ENV !== "production"` conditionals. When bundling your app, it's a good idea to replace these code snippets such that a minifier (like uglify) can sweep them away and leave a smaller overall bundle. | ||
|
||
Here are instructions for some of the popular bundlers: | ||
|
||
- [webpack](https://webpack.js.org/guides/production/#specify-the-environment) | ||
- [browserify plugin](https://github.com/hughsk/envify) | ||
- [parcel](https://parceljs.org/production.html) | ||
- [fuse-box](http://fuse-box.org/plugins/replace-plugin#notes) | ||
|
||
## Changelog | ||
|
||
See [GitHub Releases](https://github.com/connor-baer/package-template/releases). |
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 @@ | ||
module.exports = require('@sumup/foundry/lint-staged').base; |
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,52 @@ | ||
{ | ||
"name": "@madebyconnor/package-template", | ||
"version": "0.0.0-semantically-released", | ||
"description": "JS package template", | ||
"sideEffects": false, | ||
"main": "dist/index.cjs.js", | ||
"jsnext:main": "dist/index.esm.js", | ||
"module": "dist/index.esm.js", | ||
"browser": "dist/index.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"repository": "https://github.com/connor-baer/package-template.git", | ||
"author": "(Connor Bär <github@connorbaer.co>)", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=8.0.0" | ||
}, | ||
"scripts": { | ||
"start": "rollup --config --watch", | ||
"build": "rollup --config", | ||
"lint": "foundry run eslint --quiet \"src/**/*.js\"", | ||
"lint:fix": "yarn lint --fix", | ||
"test": "jest --watch", | ||
"test:coverage": "jest --coverage", | ||
"test:coverage:upload": "codecov", | ||
"size": "size-limit", | ||
"prerelease": "yarn build", | ||
"release": "semantic-release" | ||
}, | ||
"size-limit": [ | ||
{ | ||
"path": "dist/index.cjs.js", | ||
"limit": "4 kB" | ||
} | ||
], | ||
"devDependencies": { | ||
"@babel/core": "^7.4.5", | ||
"@babel/preset-env": "^7.4.5", | ||
"@sumup/foundry": "^1.3.2", | ||
"babel-jest": "^24.8.0", | ||
"codecov": "^3.5.0", | ||
"jest": "^24.8.0", | ||
"rollup": "^1.16.2", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-commonjs": "^10.0.0", | ||
"rollup-plugin-filesize": "^6.1.1", | ||
"rollup-plugin-node-resolve": "^5.0.4", | ||
"rollup-plugin-peer-deps-external": "^2.2.0", | ||
"size-limit": "^1.3.7" | ||
} | ||
} |
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 @@ | ||
module.exports = require('@sumup/foundry/prettier').base; |
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,42 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import filesize from 'rollup-plugin-filesize'; | ||
|
||
import pkg from './package.json'; | ||
|
||
const globals = {}; | ||
|
||
const config = { | ||
input: 'src/index.js', | ||
output: [ | ||
{ | ||
file: pkg.browser, | ||
format: 'umd', | ||
name: 'packageTemplate', | ||
exports: 'named', | ||
globals | ||
}, | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
exports: 'named', | ||
globals | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: 'es' | ||
} | ||
], | ||
external: [], | ||
plugins: [ | ||
peerDepsExternal(), | ||
babel({ exclude: 'node_modules/**' }), | ||
resolve(), | ||
commonjs(), | ||
filesize() | ||
] | ||
}; | ||
|
||
export default config; |
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,3 @@ | ||
export default function sayHello(name) { | ||
return `Hello ${name}`; | ||
} |
Oops, something went wrong.