Skip to content

Commit

Permalink
feat: upgrading package dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
willmendesneto committed May 13, 2020
1 parent b5ef96e commit ae2806c
Show file tree
Hide file tree
Showing 33 changed files with 6,527 additions and 8,816 deletions.
5 changes: 0 additions & 5 deletions .babelrc

This file was deleted.

6 changes: 0 additions & 6 deletions .banner

This file was deleted.

77 changes: 77 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,77 @@
version: 2

docker_defaults: &docker_defaults
docker:
- image: circleci/node:12.16.2-browsers
working_directory: ~/project/repo

attach_workspace: &attach_workspace
attach_workspace:
at: ~/project

install_steps: &install_steps
steps:
- checkout
- restore_cache:
name: Restore node_modules cache
keys:
- dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
- dependency-cache-{{ .Branch }}-
- dependency-cache-
- run:
name: Installing Dependencies
command: |
yarn install --silent --frozen-lockfile
- save_cache:
name: Save node_modules cache
key: dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules/
- persist_to_workspace:
root: ~/project
paths:
- repo

workflows:
version: 2
build_pipeline:
jobs:
- build
- unit_test:
requires:
- build
- bundle_size:
requires:
- build
# - end_to_end:
# requires:
# - build
jobs:
build:
<<: *docker_defaults
<<: *install_steps
unit_test:
<<: *docker_defaults
steps:
- *attach_workspace
- run:
name: Running unit tests
command: |
sudo yarn test:ci
bundle_size:
<<: *docker_defaults
steps:
- *attach_workspace
- run:
name: Checking bundle size
command: |
sudo yarn build
sudo yarn bundlesize
# end_to_end:
# <<: *docker_defaults
# steps:
# - *attach_workspace
# - run:
# name: Running E2E tests
# command: |
# sudo yarn e2e
7 changes: 7 additions & 0 deletions .eslintignore
@@ -0,0 +1,7 @@
.github
.jest
coverage
lib
node_modules
flow-typed
.yarn
26 changes: 26 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,26 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
'plugin:compat/recommended',
],
settings: {
// List of polyfills for `eslint-plugin-compat` check
// To know how to add in case you have a new one to add, please check
// https://github.com/amilajack/eslint-plugin-compat/wiki/Adding-polyfills-(v2)
polyfills: [],
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
tsconfigRootDir: __dirname,
project: './tsconfig.eslint.json',
},
rules: {
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 1,
},
};
8 changes: 6 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Expand Up @@ -10,6 +10,10 @@ I thought that by going to the page '...' and do the action '...' then '...' wou

Instead of '...', what I saw was that '...' happened instead.

### Browsers affected
### How to simulate the behaviour (if applicable)

Please specify the affected browsers.
This is the example of the current behaviour https://stackblitz.com/edit/feature-toggle-service-playground

### Browsers/OS/Platforms affected

Please specify the affected browsers/OS/platforms.
9 changes: 9 additions & 0 deletions .gitignore
Expand Up @@ -3,5 +3,14 @@ npm-debug.log
.DS_Store
node_modules
coverage
package
.nyc_output
dist
.jest/
out-tsc/
*.js
*.d.ts
!jest.*.js
!.eslintrc.js
!scripts/*
*.tgz
28 changes: 21 additions & 7 deletions .npmignore
@@ -1,9 +1,23 @@
/.*/
/demo/
/test/
/.*
/bower.json
/karma.conf.js
/src
/coverage
/.nyc_output
.*
bower.json
karma.conf.js
src
coverage
.nyc_output
.jest
**/__tests__/
out-tsc
images
scripts
jest*.js
tsconfig.*.json
tsconfig.json
.coveralls.yml
.banner
package
*.tgz

# ignore OS generated files
**/.DS_Store
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
v10.9.0
v12.16.2
11 changes: 11 additions & 0 deletions .prettierrc
@@ -0,0 +1,11 @@
{
"semi": true,
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid"
}
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

4 changes: 1 addition & 3 deletions CHANGELOG.md
Expand Up @@ -32,7 +32,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

<img width="701" alt="Added method description for Editor/IDE integration" src="https://user-images.githubusercontent.com/1252570/59961226-53d91480-9518-11e9-8f3f-acbaf952e955.png">


## [4.0.0][] - 2018-10-07

### Added
Expand All @@ -50,8 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Removing `setConfig()` to use `set()` method instead


[Unreleased]: https://github.com/willmendesneto/feature-toggle-service/compare/v4.1.1...HEAD
[unreleased]: https://github.com/willmendesneto/feature-toggle-service/compare/v4.1.1...HEAD
[4.1.1]: https://github.com/willmendesneto/feature-toggle-service/compare/v4.1.0...v4.1.1
[4.1.0]: https://github.com/willmendesneto/feature-toggle-service/compare/v4.0.1...v4.1.0
[4.0.1]: https://github.com/willmendesneto/feature-toggle-service/compare/v4.0.0...v4.0.1
Expand Down
48 changes: 38 additions & 10 deletions README.md
@@ -1,17 +1,19 @@
# Feature Toggle Service

[![Greenkeeper badge](https://badges.greenkeeper.io/willmendesneto/feature-toggle-service.svg)](https://greenkeeper.io/)
[![npm](https://img.shields.io/badge/stackblitz-online-orange.svg)](https://stackblitz.com/edit/feature-toggle-service-playground)

[![npm version](https://badge.fury.io/js/feature-toggle-service.svg)](http://badge.fury.io/js/feature-toggle-service) [![npm downloads](https://img.shields.io/npm/dm/feature-toggle-service.svg)](https://npmjs.org/feature-toggle-service)
[![MIT License](https://img.shields.io/badge/license-MIT%20License-blue.svg?style=flat-square)](LICENSE)

[![Build Status](https://travis-ci.org/willmendesneto/feature-toggle-service.svg?branch=master)](https://travis-ci.org/willmendesneto/feature-toggle-service)
[![Build Status](https://circleci.com/gh/willmendesneto/feature-toggle-service.svg?style=shield)](https://circleci.com/gh/willmendesneto/feature-toggle-service)
[![Coverage Status](https://coveralls.io/repos/willmendesneto/feature-toggle-service/badge.svg?branch=master)](https://coveralls.io/r/willmendesneto/feature-toggle-service?branch=master)
[![Dependency Status](https://david-dm.org/willmendesneto/feature-toggle-service.svg)](https://david-dm.org/willmendesneto/feature-toggle-service)

[![NPM](https://nodei.co/npm/feature-toggle-service.png?downloads=true&downloadRank=true&stars=true)](https://npmjs.org/feature-toggle-service)
[![NPM](https://nodei.co/npm-dl/feature-toggle-service.png?height=3&months=3)](https://npmjs.org/feature-toggle-service)

![Perf marks](./images/feature-toggle-service.png)
The simplest solution for [feature toggles](http://martinfowler.com/bliki/FeatureToggle.html) in Javascript. Simple how it should be.

## Why Feature toggle?
Expand All @@ -26,6 +28,10 @@ The idea of this directive is make this process transparent and easier. So the m

You can integrate with WebSockets or handling this in a EventSourcing architecture. It's totally transparent for you and you can integrate easier in your application.

## Contributing

Please check our [contributing.md](https://github.com/willmendesneto/feature-toggle-service/blob/master/contributing.md) to know more about setup and how to contribute.

## Setup and installation

Make sure that you are using the NodeJS version is the same as `.nvmrc` file version. If you don't have this version please use a version manager such as `nvm` or `n` to manage your local nodejs versions.
Expand All @@ -37,7 +43,6 @@ Assuming that you are using `nvm`, please run the commands inside this folder:
```bash
$ nvm install $(cat .nvmrc); # install required nodejs version
$ nvm use $(cat .nvmrc); # use nodejs version
$ npm install
```

In Windows, please install NodeJS using one of these options:
Expand All @@ -47,7 +52,6 @@ Via `NVM Windows` package: Dowload via [this link](https://github.com/coreybutle
```bash
$ nvm install $(cat .nvmrc); # install required nodejs version
$ nvm use $(cat .nvmrc); # use nodejs version
$ npm install
```

Via Chocolatey:
Expand All @@ -56,26 +60,44 @@ Via Chocolatey:
$ choco install nodejs.install -version 6.10.2
```

### Install yarn

We use `yarn` as our package manager instead of `npm`

[Install it following these steps](https://yarnpkg.com/lang/en/docs/install/#mac-tab)

After that, just navigate to your local repository and run

```bash
$ yarn install
```

## Demo

Try out the [demo](https://github.com/willmendesneto/feature-toggle-service/blob/master/demo/index.html)!
Try out our [demo on Stackblitz](https://feature-toggle-service-playground.stackblitz.io)!

### Run the tests

```bash
$ yarn test # run the tests
```

## Run the app
### Run the build

```bash
$ npm start
$ yarn build # run the tests
```

## Run the tests
### Run the bundlesize check

```bash
$ npm test # run the tests
$ yarn bundlesize # run the tests
```

## Run the build
### Run the code lint

```bash
$ npm run build # run the tests
$ yarn lint # run the tests
```

## `FeatureToggleService`
Expand All @@ -90,6 +112,12 @@ Adds the feature toggle configuration in your application. This information will

Checks if the feature toggle configuration has the string key value with `true` value. For bundle reasons if you want to check if the feature toggle is turned off, please use `!featureToggleService.isOn(key)`. When `debug` param is passed as `true` and it's not `NODE_ENV` is not set to prod, it prints configuration, version and settings for debug purposes

## Publish

this project is using `np` package to publish, which makes things straightforward. EX: `np <patch|minor|major>`

> For more details, [please check np package on npmjs.com](https://www.npmjs.com/package/np)
## Author

**Wilson Mendes (willmendesneto)**
Expand Down
8 changes: 2 additions & 6 deletions contributing.md
Expand Up @@ -9,20 +9,16 @@ Open an issue to report bugs or to propose new features.

- Reporting bugs: describe the bug as clearly as you can, including steps to reproduce, what happened and what you were expecting to happen. Also include browser version, OS and other related software's (npm, Node.js, etc) versions when applicable.

- Proposing features: explain the proposed feature, what it should do, why it is useful, how users should use it. Give us as much info as possible so it will be easier to discuss, access and implement the proposed feature. When you're unsure about a certain aspect of the feature, feel free to leave it open for others to discuss and find an appropriate solution.
- Proposing features: explain the proposed feature, what it should do, why it is useful, how users should use it. Give us as much info as possible so it will be easier to discuss, access and implement the proposed feature. When you're unsure about a certain aspect of the feature, feel free to leave it open for others to discuss and find an appropriate solution. In case of a specific scenario, please recreate that in our Stackblitz demo (http://stackblitz.com/edit/feature-toggle-service-playground) and share the link. This will help in make the fix as quick as possible

## Proposing pull requests

Pull requests are very welcome. Note that if you are going to propose drastic changes, be sure to open an issue for discussion first, to make sure that your PR will be accepted before you spend effort coding it.

Fork the feature-toggle-service repository, clone it locally and create a branch for your proposed bug fix or new feature. Avoid working directly on the master branch.

Implement your bug fix or feature, write tests to cover it and make sure all tests are passing (run a final `npm test` to make sure everything is correct). Then commit your changes, push your bug fix/feature branch to the origin (your forked repo) and open a pull request to the upstream (the repository you originally forked)'s master branch.
Implement your bug fix or feature, write tests to cover it and make sure all tests are passing (run a final `yarn test` to make sure everything is correct). Then commit your changes, push your bug fix/feature branch to the origin (your forked repo) and open a pull request to the upstream (the repository you originally forked)'s master branch.

## Documentation

Documentation is extremely important and takes a fair deal of time and effort to write and keep updated. Please submit any and all improvements you can make to the repository's docs.

## Known issues
If you're using npm@3 you'll probably face some issues related to peerDependencies.
https://github.com/npm/npm/issues/9204

0 comments on commit ae2806c

Please sign in to comment.