Skip to content

Commit

Permalink
feat: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardobelchior committed May 15, 2020
0 parents commit 3339dcd
Show file tree
Hide file tree
Showing 28 changed files with 16,069 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# top-most EditorConfig file
root = true

# all files
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
max_line_length = 80

[*.{js,ts}]
quote_type = single
curly_bracket_next_line = false
spaces_around_brackets = inside
indent_brace_style = BSD KNF

# HTML
[*.html]
quote_type = double
131 changes: 131 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Contributing

First of all, thanks for your interest in contributing to the fifo-capital-gains-js! 🎉

PRs are the preferred way to spike ideas and address issues, if you have time. If you plan on contributing frequently, please feel free to ask to become a maintainer; the more the merrier. 🤙

## Technical overview

This library uses following libraries for development:

- [typescript](http://www.typescriptlang.org/) for typed JavaScript and transpilation
- [jest](https://jestjs.io/) for unit testing
- run `npm run test:watch` during development
- [rollup](https://rollupjs.org/guide/en) for creating UMD bundles
- [npm](https://www.npmjs.com/) for package management
- [npm scripts](https://docs.npmjs.com/misc/scripts) for executing tasks

### 🧪 Tests

Test are written and run via Jest 💪

```sh
# Run whole test suite once
npm test
# Run test in watch mode
npm run test:watch
# Generate code coverage
npm run test:coverage
```

### 💅 Style guides

Style guides are enforced by robots _(I meant prettier and tslint of course 🤖 )_, so they'll let you know if you screwed something, but most of the time, they'll autofix things for you. Magic right ?

Lint and format codebase via npm-script:

```sh
#Format and fix lint errors
npm run style:fix
```

#### Commit conventions (via commitizen)

- this is preferred way how to create conventional-changelog valid commits
- if you prefer your custom tool we provide a commit hook linter which will error out, it you provide invalid commit message
- if you are in rush and just wanna skip commit message validation just prefix your message with `WIP: something done` ( if you do this please squash your work when you're done with proper commit message so standard-version can create Changelog and bump version of your library appropriately )

```sh
# invoke [commitizen CLI](https://github.com/commitizen/cz-cli)
npm run commit
```

## Getting started

### Creating a Pull Request

If you've never submitted a Pull request before please visit http://makeapullrequest.com/ to learn everything you need to know.

#### Setup

1. Fork the repo.
1. `git clone` your fork.
1. Make a `git checkout -b branch-name` branch for your change.
1. Run `npm install` (make sure you have node and npm installed first)
Updates

1. Make sure to add unit tests
1. If there is a `*.spec.ts` file, update it to include a test for your change, if needed. If this file doesn't exist, please create it.
1. Run `npm test` or `npm run test:watch` to make sure all tests are working, regardless if a test was added.

---

## 🚀 Publishing

> releases are handled by awesome [standard-version](https://github.com/conventional-changelog/standard-version)
> #### NOTE:
>
> you have to create npm account and register token on your machine
> 👉 `npm adduser`
>
> If you are using scope (you definitely should 👌) don't forget to [`--scope`](https://docs.npmjs.com/cli/adduser#scope)
Execute `npm run release` which will handle following tasks:

- bump package version and git tag
- update/(create if it doesn't exist) CHANGELOG.md
- push to github master branch + push tags
- publish build packages to npm

> releases are handled by awesome [standard-version](https://github.com/conventional-changelog/standard-version)
### Initial Release (no package.json version bump):

```sh
npm run release --first-release
```

### Pre-release

- To get from `1.1.2` to `1.1.2-0`:

`npm run release --prerelease`

- **Alpha**: To get from `1.1.2` to `1.1.2-alpha.0`:

`npm run release --prerelease alpha`

- **Beta**: To get from `1.1.2` to `1.1.2-beta.0`:

`npm rum release --prerelease beta`

### Dry run

#### version bump + changelog

```sh
# See what next release version would be with updated changelog
npm run standard-version --dry-run
```

#### npm publish

```sh
# check what files are gonna be published to npm
npm run release:preflight
```

## License

By contributing your code to the fifo-capital-gains-js GitHub Repository, you agree to license your contribution under the MIT license.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!-- -------------------------------------------------- -->
<!-- Delete this section if this is a feature request. -->
<!-- -------------------------------------------------- -->

## Bug report

- fifo-capital-gains-js version: _x.x.x_ (<!-- (run `npm list fifo-capital-gains-js` from a terminal/cmd prompt): -->)
- Affected browsers (and versions): _IE 10_

### Current behaviour

<!-- Please explain the problem you're having -->

```ts
// put code here
```

<!-- Having a real demo that demonstrates your issue -->

[issue demo](https://codesandbox.io/)

### Expected behaviour

_Please explain how you'd expect it to behave._

<!-- -------------------------------------------- -->
<!-- Delete this section if this is a bug report. -->
<!-- -------------------------------------------- -->

## Feature request

### Use case(s)

_Explain the rationale for this feature._
32 changes: 32 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
_If there is a linked issue, mention it here._

- [ ] Bug
- [ ] Feature

## Requirements

- [ ] Read the [contribution guidelines](./.github/CONTRIBUTING.md).
- [ ] Wrote tests.
- [ ] Updated docs and upgrade instructions, if necessary.

## Rationale

_Why is this PR necessary?_

## Implementation

_Why have you implemented it this way? Did you try any other methods?_

## Open questions

_Are there any open questions about this implementation that need answers?_

## Other

_Is there anything else we should know? Delete this section if you don't need it._

## Tasks

_List any tasks you need to do here, if any. Delete this section if you don't need it._

- [ ] _Example task._
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.log
.idea
.DS_Store
.cache
node_modules

coverage
lib
esm5
lib-esm
esm2015
lib-fesm
fesm
umd
bundles
typings
types
docs
dist

## this is generated by `npm pack`
*.tgz
package
32 changes: 32 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.*
*.log

# tools configs
**/tsconfig.json
tsconfig.*.json
tslint.json
**/webpack.config.js
**/jest.config.js
**/prettier.config.js

# build scripts
config/
scripts/

# Test files
**/*.spec.js
**/*.test.js
**/*.test.d.ts
**/*.spec.d.ts
__tests__
coverage

# Sources
node_modules
src
docs
examples

## this is generated by `npm pack`
*.tgz
package
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
access=public
save-exact=true
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"arrowParens": "always",
"semi": false,
"bracketSpacing": true,
"trailingComma": "es5",
"printWidth": 80
}
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
"esbenp.prettier-vscode",
"codezombiech.gitignore",
"EditorConfig.EditorConfig"
]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Place your settings in this file to overwrite default and user settings.
{
"editor.formatOnSave": true,
"typescript.format.enable": false,
"javascript.format.enable": false,
"typescript.implementationsCodeLens.enabled": true,
"typescript.referencesCodeLens.enabled": true,
"javascript.referencesCodeLens.enabled": true,
"editor.rulers": [
80,100
],
"typescript.tsdk": "node_modules/typescript/lib",
"files.associations": {
"tslint*.json": "jsonc"
}
}
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Bernardo Belchior <bernardo.belchior1@gmail.com>

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.

0 comments on commit 3339dcd

Please sign in to comment.