-
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.
This is the first version of this project. It's working but it's more for testing everything.
- Loading branch information
0 parents
commit e2d4b9c
Showing
25 changed files
with
640 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,6 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-flow" | ||
] | ||
} |
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,24 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
|
||
# change these settings to your own preference | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# we recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[{package,bower}.json] | ||
indent_style = space | ||
indent_size = 2 |
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,48 @@ | ||
{ | ||
"source": "./src", | ||
"destination": "./docs", | ||
"includes": [ | ||
"\\.js$" | ||
], | ||
"excludes": [ | ||
"\\.config\\.js$" | ||
], | ||
"plugins": [ | ||
{ | ||
"name": "esdoc-standard-plugin" | ||
}, | ||
{ | ||
"name": "esdoc-flow-type-plugin", | ||
"option": { | ||
"enable": true | ||
} | ||
}, | ||
{ | ||
"name": "esdoc-brand-plugin" | ||
} | ||
], | ||
"option": { | ||
"lint": { | ||
"enable": true | ||
}, | ||
"coverage": { | ||
"enable": true | ||
}, | ||
"test": { | ||
"source": "./test/", | ||
"interfaces": [ | ||
"describe", | ||
"it", | ||
"context", | ||
"suite", | ||
"test" | ||
], | ||
"includes": [ | ||
"(spec|Spec|test|Test)\\.js$" | ||
], | ||
"excludes": [ | ||
"\\.config\\.js$" | ||
] | ||
} | ||
} | ||
} |
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,9 @@ | ||
node_modules | ||
flow-typed | ||
dist | ||
doc | ||
.DS_Store | ||
|
||
\#*# | ||
|
||
.vscode |
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,12 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"extends": [ | ||
"standard", | ||
"plugin:flowtype/recommended" | ||
], | ||
"rules": {}, | ||
"parserOptions": {}, | ||
"plugins": [ | ||
"flowtype" | ||
] | ||
} |
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,14 @@ | ||
[ignore] | ||
.*/node_modules/npm/node_modules/config-chain/.* | ||
.*/dist/.* | ||
|
||
|
||
[include] | ||
|
||
[libs] | ||
|
||
[lints] | ||
|
||
[options] | ||
|
||
[strict] |
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 @@ | ||
*.js text eol=lf |
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,14 @@ | ||
node_modules | ||
doc | ||
dist | ||
.DS_Store | ||
coverage/lcov-report | ||
coverage/coverage-summary.json | ||
coverage/lcov.info | ||
package.json.save | ||
package-lock.json | ||
yarn.lock | ||
|
||
\#*# | ||
|
||
.vscode |
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,8 @@ | ||
node_modules/ | ||
.DS_Store/ | ||
doc/ | ||
flow-typed | ||
package.json.save | ||
package-lock.json | ||
yarn.lock | ||
.vscode |
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,9 @@ | ||
language: node_js | ||
|
||
node_js: 8 | ||
|
||
deploy: | ||
provider: script | ||
skip_cleanup: true | ||
script: | ||
- npm run release |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Contributing | ||
|
||
- Fork the project and clone your fork. | ||
- Create a local feature branch: | ||
|
||
```bash | ||
git checkout -b <branch> | ||
``` | ||
|
||
- Please add tests in '__tests__/' for each new function that you're adding. | ||
- Make one or more atomic commits using either 'yarn commit' or 'npm run commit' ONLY (this project is commitizen friendly). Do not commit changes to the `dist/` folder. | ||
- Run 'yarn test', 'yarn lint' and 'yarn flow' and address any errors. Preferably, fix commits in place using `git rebase` or `git commit --amend` to make the changes easier to review and to keep the history tidy. | ||
- Push to your fork: | ||
|
||
```bash | ||
git push origin <branch> | ||
``` | ||
|
||
- Open a pull request. |
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,23 @@ | ||
library-boilerplate | ||
Copyright (c) 2018 Ziv Barber, contributors. | ||
|
||
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,167 @@ | ||
# library-boilerplate | ||
|
||
Rollup based javascript library boilerplate + babel 7, eslint, flow, jest, esdoc and live editing. | ||
|
||
[](http://commitizen.github.io/cz-cli/) | ||
[](https://github.com/pamepeixinho/jest-coverage-badges) | ||
[](https://github.com/pamepeixinho/jest-coverage-badges) | ||
[](https://github.com/pamepeixinho/jest-coverage-badges) | ||
[](https://github.com/semantic-release/semantic-release) | ||
|
||
 | ||
|
||
- [Getting Started](#getstart) | ||
- [Features](#features) | ||
- [Installation](#inst) | ||
- [Running](#run) | ||
- [API](#ref) | ||
- [The source code](#code) | ||
- [Variations](#other) | ||
- [Credit](#credit) | ||
|
||
<a name="getstart"></a> | ||
## Getting Started: ## | ||
|
||
This boilerplate including a basic code to start creating a js based library. | ||
|
||
Start with cloning the project: | ||
|
||
```bash | ||
$ git clone --depth=1 git://github.com/Ziv-Barber/library-boilerplate.git your-project-name | ||
``` | ||
|
||
Then: | ||
|
||
- Remove the .git directory. | ||
- Edit package.json: | ||
- Change the name of the project to your project name. | ||
- Change the version to 0.1.0 | ||
- If you want to release a npm package then change: | ||
"release": "npx run-s test release:pre release:post" | ||
to: | ||
"release": "npx run-s test release:pre release:publish release:post" | ||
|
||
The boilerplate without any changes supporting creating a library for both CommonJS, es6 modules, amd and browser. If you don't need all of this then just edit the rollup.config.js file and remove the inputs that you don't need. | ||
|
||
Now, create a new github project and do: | ||
|
||
```bash | ||
$ git init | ||
$ git remote add origin https://github.com/your-name/your-project-name.git | ||
$ git add -A | ||
$ npm run commit | ||
$ git push -u origin master | ||
``` | ||
|
||
This project is using semantic-release to automatic handling of the version of your library. | ||
|
||
<a name="features"></a> | ||
## Features: ## | ||
|
||
This project is using the following awesome libraries/utilities/services: | ||
|
||
- [babel 7][https://babeljs.io/] | ||
- [better-npm-run][https://github.com/benoror/better-npm-run] | ||
- [commitizen][http://commitizen.github.io/cz-cli] | ||
- [esdoc][https://esdoc.org/] | ||
- [eslint][https://eslint.org/] | ||
- [flow][https://flow.org/] | ||
- [jest][https://jestjs.io/] | ||
- [npm-run-all][https://github.com/mysticatea/npm-run-all] | ||
- [rollup][https://rollupjs.org/] | ||
- [semantic-release][https://github.com/semantic-release/semantic-release] | ||
|
||
<a name="inst"></a> | ||
## Installation: ## | ||
|
||
via Git: | ||
|
||
```bash | ||
$ git clone git://github.com/Ziv-Barber/library-boilerplate.git | ||
``` | ||
|
||
via yarn: | ||
|
||
```bash | ||
$ yarn add library-boilerplate | ||
``` | ||
|
||
via npm: | ||
|
||
```bash | ||
$ npm install library-boilerplate | ||
``` | ||
|
||
<a name="ref"></a> | ||
## API: ## | ||
|
||
???. | ||
|
||
<a name="code"></a> | ||
## The source code: ## | ||
|
||
- lib - all the sources. | ||
- types - put here all the flow type declarations. | ||
- __tests__ - all the tests. | ||
- .editorconfig - coding style for this project. | ||
|
||
### Scripts: ### | ||
|
||
- start | ||
- build | ||
- clean | ||
- test | ||
- flow | ||
- lint | ||
### Tests: ### | ||
|
||
Tests: | ||
|
||
```bash | ||
yarn test | ||
``` | ||
|
||
or: | ||
|
||
```bash | ||
npm test | ||
``` | ||
|
||
### Flow: ### | ||
|
||
Flow check (if you don't have a flow plugin in your IDE): | ||
|
||
```bash | ||
yarn flow | ||
``` | ||
|
||
or: | ||
|
||
```bash | ||
npm flow | ||
``` | ||
|
||
### Lint: ### | ||
|
||
Lint check (if you don't have a plugin in your IDE): | ||
|
||
```bash | ||
yarn lint | ||
``` | ||
|
||
or: | ||
|
||
```bash | ||
npm lint | ||
``` | ||
|
||
<a name="other"></a> | ||
## Variations: ## | ||
|
||
- library-boilerplate (this project) - Rollup based javascript library boilerplate + babel 7, eslint, flow, jest, esdoc and live editing. | ||
- [react-boilerplate](https://github.com/Ziv-Barber/react-boilerplate) - React 16.5.2 + babel 7 + jest + webpack 4 + flow + eslint + esdoc + live editing boilerplate. | ||
|
||
<a name="credits"></a> | ||
## Credit: ## | ||
|
||
- Created by Ziv Barber. |
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,8 @@ | ||
{ | ||
"extends": [ | ||
"../.eslintrc" | ||
], | ||
"env": { | ||
"jest": true | ||
} | ||
} |
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,15 @@ | ||
import * as someModule from '../lib/someModule' | ||
|
||
/** @test {someModule} */ | ||
describe('someModule test suits', function () { | ||
// Executed before each test: | ||
beforeEach(done => { | ||
done() | ||
}) | ||
|
||
test('#test ()', done => { | ||
expect(someModule).toBeDefined() | ||
// assert(123 === 123) | ||
done() | ||
}) | ||
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.