@lykmapipo/phone 0.7.12 → 0.7.16
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/es/index.js +0 -7
- package/lib/index.js +0 -7
- package/package.json +39 -36
- package/src/index.js +0 -1
- package/src/utils.js +0 -6
- package/.babelrc +0 -12
- package/.editorconfig +0 -14
- package/.eslintignore +0 -0
- package/.eslintrc +0 -11
- package/.prettierignore +0 -0
- package/.prettierrc +0 -6
- package/CODE_OF_CONDUCT.md +0 -76
- package/CONTRIBUTING.md +0 -150
- package/rollup.config.js +0 -33
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
#### 0.7.16 (2021-09-06)
|
2
|
+
|
3
|
+
##### Documentation Changes
|
4
|
+
|
5
|
+
* **readme:** update build status to travis.com ([ccc43a97](https://github.com/lykmapipo/phone/commit/ccc43a977bbbbf446a81d24c27c37c213e810e39))
|
6
|
+
|
7
|
+
#### 0.7.15 (2021-08-09)
|
8
|
+
|
9
|
+
##### Chores
|
10
|
+
|
11
|
+
* **deps:** force latest version & audit fix ([9561be64](https://github.com/lykmapipo/phone/commit/9561be64919d1526f8ee3bca9a8b648e01ed590b))
|
12
|
+
|
13
|
+
#### 0.7.14 (2021-06-01)
|
14
|
+
|
15
|
+
##### Chores
|
16
|
+
|
17
|
+
* **deps:** force latest version & audit fix ([98f973ba](https://github.com/lykmapipo/phone/commit/98f973ba11d605af92f39e62bf61e779daee5b3d))
|
18
|
+
|
19
|
+
#### 0.7.13 (2021-03-21)
|
20
|
+
|
1
21
|
#### 0.7.12 (2021-02-09)
|
2
22
|
|
3
23
|
#### 0.7.11 (2021-01-04)
|
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# phone
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.
|
3
|
+
[![Build Status](https://travis-ci.com/lykmapipo/phone.svg?branch=master)](https://travis-ci.com/lykmapipo/phone)
|
4
4
|
[![Dependencies Status](https://david-dm.org/lykmapipo/phone.svg)](https://david-dm.org/lykmapipo/phone)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/github/lykmapipo/phone/badge.svg?branch=master)](https://coveralls.io/github/lykmapipo/phone?branch=master)
|
6
6
|
[![GitHub License](https://img.shields.io/github/license/lykmapipo/phone)](https://github.com/lykmapipo/phone/blob/master/LICENSE)
|
package/es/index.js
CHANGED
@@ -84,7 +84,6 @@ const FORMAT_RFC3966 = 'RFC3966';
|
|
84
84
|
* @example
|
85
85
|
*
|
86
86
|
* phoneNumberUtil.parseAndKeepRawInput('0715333777', 'TZ');
|
87
|
-
*
|
88
87
|
*/
|
89
88
|
const phoneNumberUtil = PhoneNumberUtil.getInstance();
|
90
89
|
|
@@ -105,7 +104,6 @@ const phoneNumberUtil = PhoneNumberUtil.getInstance();
|
|
105
104
|
*
|
106
105
|
* parseRawPhoneNumber('+255715333777');
|
107
106
|
* parseRawPhoneNumber('0715333777', 'TZ');
|
108
|
-
*
|
109
107
|
*/
|
110
108
|
const parseRawPhoneNumber = (
|
111
109
|
phoneNumber,
|
@@ -147,7 +145,6 @@ const parseRawPhoneNumber = (
|
|
147
145
|
* {
|
148
146
|
* e164: '+255715333777'
|
149
147
|
* }
|
150
|
-
*
|
151
148
|
*/
|
152
149
|
const formatPhoneNumber = (phoneNumber, format) => {
|
153
150
|
try {
|
@@ -187,7 +184,6 @@ const formatPhoneNumber = (phoneNumber, format) => {
|
|
187
184
|
* national: '0715 333 777',
|
188
185
|
* rfc3966: 'tel:+255-715-333-777'
|
189
186
|
* }
|
190
|
-
*
|
191
187
|
*/
|
192
188
|
const applyFormats = (phoneNumber) => {
|
193
189
|
// initialize formats
|
@@ -238,7 +234,6 @@ const applyFormats = (phoneNumber) => {
|
|
238
234
|
* isUnknown: false,
|
239
235
|
* type: 'MOBILE'
|
240
236
|
* }
|
241
|
-
*
|
242
237
|
*/
|
243
238
|
const checkTypes = (phoneNumber) => {
|
244
239
|
// initialize types validity
|
@@ -319,7 +314,6 @@ const checkTypes = (phoneNumber) => {
|
|
319
314
|
* national: '0715 333 777',
|
320
315
|
* rfc3966: 'tel:+255-715-333-777'
|
321
316
|
* }
|
322
|
-
*
|
323
317
|
*/
|
324
318
|
const parsePhoneNumberByCountryCode = (phoneNumber, countryCode) => {
|
325
319
|
// parse phone number
|
@@ -420,7 +414,6 @@ const parsePhoneNumberByCountryCode = (phoneNumber, countryCode) => {
|
|
420
414
|
* national: '0715 333 777',
|
421
415
|
* rfc3966: 'tel:+255-715-333-777'
|
422
416
|
* }
|
423
|
-
*
|
424
417
|
*/
|
425
418
|
const parsePhoneNumber = (phoneNumber, ...countryCode) => {
|
426
419
|
try {
|
package/lib/index.js
CHANGED
@@ -86,7 +86,6 @@ const FORMAT_RFC3966 = 'RFC3966';
|
|
86
86
|
* @example
|
87
87
|
*
|
88
88
|
* phoneNumberUtil.parseAndKeepRawInput('0715333777', 'TZ');
|
89
|
-
*
|
90
89
|
*/
|
91
90
|
const phoneNumberUtil = googleLibphonenumber.PhoneNumberUtil.getInstance();
|
92
91
|
|
@@ -107,7 +106,6 @@ const phoneNumberUtil = googleLibphonenumber.PhoneNumberUtil.getInstance();
|
|
107
106
|
*
|
108
107
|
* parseRawPhoneNumber('+255715333777');
|
109
108
|
* parseRawPhoneNumber('0715333777', 'TZ');
|
110
|
-
*
|
111
109
|
*/
|
112
110
|
const parseRawPhoneNumber = (
|
113
111
|
phoneNumber,
|
@@ -149,7 +147,6 @@ const parseRawPhoneNumber = (
|
|
149
147
|
* {
|
150
148
|
* e164: '+255715333777'
|
151
149
|
* }
|
152
|
-
*
|
153
150
|
*/
|
154
151
|
const formatPhoneNumber = (phoneNumber, format) => {
|
155
152
|
try {
|
@@ -189,7 +186,6 @@ const formatPhoneNumber = (phoneNumber, format) => {
|
|
189
186
|
* national: '0715 333 777',
|
190
187
|
* rfc3966: 'tel:+255-715-333-777'
|
191
188
|
* }
|
192
|
-
*
|
193
189
|
*/
|
194
190
|
const applyFormats = (phoneNumber) => {
|
195
191
|
// initialize formats
|
@@ -240,7 +236,6 @@ const applyFormats = (phoneNumber) => {
|
|
240
236
|
* isUnknown: false,
|
241
237
|
* type: 'MOBILE'
|
242
238
|
* }
|
243
|
-
*
|
244
239
|
*/
|
245
240
|
const checkTypes = (phoneNumber) => {
|
246
241
|
// initialize types validity
|
@@ -321,7 +316,6 @@ const checkTypes = (phoneNumber) => {
|
|
321
316
|
* national: '0715 333 777',
|
322
317
|
* rfc3966: 'tel:+255-715-333-777'
|
323
318
|
* }
|
324
|
-
*
|
325
319
|
*/
|
326
320
|
const parsePhoneNumberByCountryCode = (phoneNumber, countryCode) => {
|
327
321
|
// parse phone number
|
@@ -422,7 +416,6 @@ const parsePhoneNumberByCountryCode = (phoneNumber, countryCode) => {
|
|
422
416
|
* national: '0715 333 777',
|
423
417
|
* rfc3966: 'tel:+255-715-333-777'
|
424
418
|
* }
|
425
|
-
*
|
426
419
|
*/
|
427
420
|
const parsePhoneNumber = (phoneNumber, ...countryCode) => {
|
428
421
|
try {
|
package/package.json
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lykmapipo/phone",
|
3
|
-
"version": "0.7.
|
3
|
+
"version": "0.7.16",
|
4
4
|
"description": "Helper utilities for parsing and validate phone numbers",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "es/index.js",
|
7
7
|
"scripts": {
|
8
8
|
"clean": "rimraf lib dist es umd logs",
|
9
|
+
"prepare": "husky install",
|
9
10
|
"prebuild": "npm test && npm run clean",
|
10
11
|
"build": "rollup -c",
|
11
12
|
"lint": "eslint --fix --ext .js src/ test/ rollup.config.js",
|
@@ -56,54 +57,54 @@
|
|
56
57
|
},
|
57
58
|
"homepage": "https://github.com/lykmapipo/phone#readme",
|
58
59
|
"devDependencies": {
|
59
|
-
"@babel/cli": "^7.
|
60
|
-
"@babel/core": "^7.
|
61
|
-
"@babel/node": "^7.
|
62
|
-
"@babel/preset-env": "^7.
|
63
|
-
"@babel/register": "^7.
|
64
|
-
"@commitlint/cli": "^
|
65
|
-
"@commitlint/config-conventional": "^
|
66
|
-
"@commitlint/travis-cli": "^
|
67
|
-
"@lykmapipo/test-helpers": "^0.6.
|
68
|
-
"chai": "^4.3.
|
69
|
-
"commitizen": "^4.2.
|
70
|
-
"coveralls": "^3.1.
|
60
|
+
"@babel/cli": "^7.14.8",
|
61
|
+
"@babel/core": "^7.15.0",
|
62
|
+
"@babel/node": "^7.14.9",
|
63
|
+
"@babel/preset-env": "^7.15.0",
|
64
|
+
"@babel/register": "^7.14.5",
|
65
|
+
"@commitlint/cli": "^13.1.0",
|
66
|
+
"@commitlint/config-conventional": "^13.1.0",
|
67
|
+
"@commitlint/travis-cli": "^13.1.0",
|
68
|
+
"@lykmapipo/test-helpers": "^0.6.20",
|
69
|
+
"chai": "^4.3.4",
|
70
|
+
"commitizen": "^4.2.4",
|
71
|
+
"coveralls": "^3.1.1",
|
71
72
|
"cz-conventional-changelog": "^3.3.0",
|
72
73
|
"dot-prop": "^6.0.1",
|
73
74
|
"doxdox": "^3.0.0",
|
74
|
-
"eslint": "^7.
|
75
|
+
"eslint": "^7.32.0",
|
75
76
|
"eslint-config-airbnb-base": "^14.2.1",
|
76
|
-
"eslint-config-prettier": "^
|
77
|
-
"eslint-plugin-import": "^2.
|
78
|
-
"eslint-plugin-jsdoc": "^
|
79
|
-
"eslint-plugin-mocha": "^
|
80
|
-
"eslint-plugin-prettier": "^3.
|
77
|
+
"eslint-config-prettier": "^8.3.0",
|
78
|
+
"eslint-plugin-import": "^2.24.0",
|
79
|
+
"eslint-plugin-jsdoc": "^36.0.6",
|
80
|
+
"eslint-plugin-mocha": "^9.0.0",
|
81
|
+
"eslint-plugin-prettier": "^3.4.0",
|
81
82
|
"generate-changelog": "^1.8.0",
|
82
|
-
"handlebars": "^4.7.
|
83
|
-
"husky": "^
|
84
|
-
"lint-staged": "^
|
83
|
+
"handlebars": "^4.7.7",
|
84
|
+
"husky": "^7.0.1",
|
85
|
+
"lint-staged": "^11.1.2",
|
85
86
|
"lodash.template": "^4.5.0",
|
86
87
|
"minimist": "^1.2.5",
|
87
|
-
"mocha": "^
|
88
|
-
"nock": "^13.
|
89
|
-
"npm-check-updates": "^11.
|
88
|
+
"mocha": "^9.0.3",
|
89
|
+
"nock": "^13.1.1",
|
90
|
+
"npm-check-updates": "^11.8.3",
|
90
91
|
"nyc": "^15.1.0",
|
91
|
-
"prettier": "^2.2
|
92
|
+
"prettier": "^2.3.2",
|
92
93
|
"rimraf": "^3.0.2",
|
93
|
-
"rollup": "^2.
|
94
|
+
"rollup": "^2.56.1",
|
94
95
|
"shelljs": "^0.8.4",
|
95
96
|
"websocket-extensions": "^0.1.4"
|
96
97
|
},
|
97
98
|
"peerDependencies": {},
|
98
99
|
"dependencies": {
|
99
|
-
"@lykmapipo/common": ">=0.
|
100
|
-
"@lykmapipo/env": ">=0.17.
|
101
|
-
"google-libphonenumber": ">=3.2.
|
102
|
-
"lodash": ">=4.17.
|
100
|
+
"@lykmapipo/common": ">=0.44.1",
|
101
|
+
"@lykmapipo/env": ">=0.17.36",
|
102
|
+
"google-libphonenumber": ">=3.2.22",
|
103
|
+
"lodash": ">=4.17.21"
|
103
104
|
},
|
104
105
|
"engines": {
|
105
|
-
"node": ">=
|
106
|
-
"npm": ">=6.
|
106
|
+
"node": ">=14.5.0",
|
107
|
+
"npm": ">=6.14.5"
|
107
108
|
},
|
108
109
|
"config": {
|
109
110
|
"commitizen": {
|
@@ -116,9 +117,11 @@
|
|
116
117
|
]
|
117
118
|
},
|
118
119
|
"lint-staged": {
|
119
|
-
"
|
120
|
-
"
|
121
|
-
|
120
|
+
"*.js": [
|
121
|
+
"eslint --fix"
|
122
|
+
],
|
123
|
+
"*.{md,json,yml,html}": [
|
124
|
+
"prettier --write"
|
122
125
|
]
|
123
126
|
},
|
124
127
|
"husky": {
|
package/src/index.js
CHANGED
package/src/utils.js
CHANGED
@@ -26,7 +26,6 @@ import { FORMATS } from './constants';
|
|
26
26
|
* @example
|
27
27
|
*
|
28
28
|
* phoneNumberUtil.parseAndKeepRawInput('0715333777', 'TZ');
|
29
|
-
*
|
30
29
|
*/
|
31
30
|
export const phoneNumberUtil = PhoneNumberUtil.getInstance();
|
32
31
|
|
@@ -47,7 +46,6 @@ export const phoneNumberUtil = PhoneNumberUtil.getInstance();
|
|
47
46
|
*
|
48
47
|
* parseRawPhoneNumber('+255715333777');
|
49
48
|
* parseRawPhoneNumber('0715333777', 'TZ');
|
50
|
-
*
|
51
49
|
*/
|
52
50
|
export const parseRawPhoneNumber = (
|
53
51
|
phoneNumber,
|
@@ -89,7 +87,6 @@ export const parseRawPhoneNumber = (
|
|
89
87
|
* {
|
90
88
|
* e164: '+255715333777'
|
91
89
|
* }
|
92
|
-
*
|
93
90
|
*/
|
94
91
|
export const formatPhoneNumber = (phoneNumber, format) => {
|
95
92
|
try {
|
@@ -129,7 +126,6 @@ export const formatPhoneNumber = (phoneNumber, format) => {
|
|
129
126
|
* national: '0715 333 777',
|
130
127
|
* rfc3966: 'tel:+255-715-333-777'
|
131
128
|
* }
|
132
|
-
*
|
133
129
|
*/
|
134
130
|
export const applyFormats = (phoneNumber) => {
|
135
131
|
// initialize formats
|
@@ -180,7 +176,6 @@ export const applyFormats = (phoneNumber) => {
|
|
180
176
|
* isUnknown: false,
|
181
177
|
* type: 'MOBILE'
|
182
178
|
* }
|
183
|
-
*
|
184
179
|
*/
|
185
180
|
export const checkTypes = (phoneNumber) => {
|
186
181
|
// initialize types validity
|
@@ -261,7 +256,6 @@ export const checkTypes = (phoneNumber) => {
|
|
261
256
|
* national: '0715 333 777',
|
262
257
|
* rfc3966: 'tel:+255-715-333-777'
|
263
258
|
* }
|
264
|
-
*
|
265
259
|
*/
|
266
260
|
export const parsePhoneNumberByCountryCode = (phoneNumber, countryCode) => {
|
267
261
|
// parse phone number
|
package/.babelrc
DELETED
package/.editorconfig
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# top-most EditorConfig file
|
2
|
-
root = true
|
3
|
-
|
4
|
-
# Unix-style newlines with a newline ending every file
|
5
|
-
[*]
|
6
|
-
end_of_line = lf
|
7
|
-
insert_final_newline = true
|
8
|
-
indent_style = space
|
9
|
-
indent_size = 2
|
10
|
-
|
11
|
-
# Matches multiple files with brace expansion notation
|
12
|
-
# Set default charset
|
13
|
-
[*.{js}]
|
14
|
-
charset = utf-8
|
package/.eslintignore
DELETED
File without changes
|
package/.eslintrc
DELETED
package/.prettierignore
DELETED
File without changes
|
package/.prettierrc
DELETED
package/CODE_OF_CONDUCT.md
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
-
level of experience, education, socio-economic status, nationality, personal
|
10
|
-
appearance, race, religion, or sexual identity and orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at lallyelias87@gmail.com. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
-
|
73
|
-
[homepage]: https://www.contributor-covenant.org
|
74
|
-
|
75
|
-
For answers to common questions about this code of conduct, see
|
76
|
-
https://www.contributor-covenant.org/faq
|
package/CONTRIBUTING.md
DELETED
@@ -1,150 +0,0 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
I'm really glad you're reading this, because we need volunteer developers to help this project come to fruition.
|
4
|
-
|
5
|
-
We love to receive contributions from our community — you! There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code which can be incorporated into project itself.
|
6
|
-
|
7
|
-
Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests.
|
8
|
-
|
9
|
-
These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
|
10
|
-
|
11
|
-
|
12
|
-
## Code of Conduct
|
13
|
-
|
14
|
-
This project has adopted a Code of Conduct that we expect project participants to adhere to. Please read [the full text](https://github.com/lykmapipo/phone/blob/master/CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated.
|
15
|
-
|
16
|
-
|
17
|
-
## Open Development
|
18
|
-
|
19
|
-
All work happens directly on [GitHub](https://github.com/lykmapipo/phone). Both core team members and external contributors send pull requests which go through the same review process.
|
20
|
-
|
21
|
-
|
22
|
-
## Branch Organization
|
23
|
-
|
24
|
-
We will do our best to keep the [`master` branch](https://github.com/lykmapipo/phone/tree/master) in good shape, with tests passing at all times.
|
25
|
-
|
26
|
-
If you send a pull request, please do it against the [`master` branch](https://github.com/lykmapipo/phone/tree/master).
|
27
|
-
|
28
|
-
|
29
|
-
## Semantic Versioning
|
30
|
-
|
31
|
-
This project follows [semantic versioning](http://semver.org/). We release patch versions for bugfixes, minor versions for new features, and major versions for any breaking changes.
|
32
|
-
|
33
|
-
|
34
|
-
## Where to Find Known Issues
|
35
|
-
|
36
|
-
We are using [GitHub Issues](https://github.com/lykmapipo/phone/issues) for all issues. Before filing a new task, try to make sure your problem doesn't already exist.
|
37
|
-
|
38
|
-
|
39
|
-
## Proposing a Change
|
40
|
-
|
41
|
-
If you intend to change the public API, or make any non-trivial changes to the implementation, we recommend [filing an issue](https://github.com/lykmapipo/phone/issues/new). This lets us reach an agreement on your proposal before you put significant effort into it.
|
42
|
-
|
43
|
-
If you're only fixing a bug, it's fine to submit a pull request right away but we still recommend to file an issue detailing what you're fixing. This is helpful in case we don't accept that specific fix but want to keep track of the issue.
|
44
|
-
|
45
|
-
|
46
|
-
## Your First Pull Request
|
47
|
-
|
48
|
-
Working on your first Pull Request? You can learn how from this free video series:
|
49
|
-
|
50
|
-
**[How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)**
|
51
|
-
|
52
|
-
If you decide to fix an issue, please be sure to check the comment thread in case somebody is already working on a fix. If nobody is working on it at the moment, please leave a comment stating that you intend to work on it so other people don't accidentally duplicate your effort.
|
53
|
-
|
54
|
-
If somebody claims an issue but doesn't follow up for more than two weeks, it's fine to take it over but you should still leave a comment.
|
55
|
-
|
56
|
-
|
57
|
-
## Sending a Pull Request
|
58
|
-
|
59
|
-
The core team is monitoring for pull requests. We will review your pull request and either merge it, request changes to it, or close it with an explanation. We'll do our best to provide updates and feedback throughout the process.
|
60
|
-
|
61
|
-
|
62
|
-
## Style Guide
|
63
|
-
|
64
|
-
Look at [Airbnb's Style Guide](https://github.com/airbnb/javascript) will guide you in the right direction.
|
65
|
-
|
66
|
-
## Git Commit Guidelines
|
67
|
-
|
68
|
-
We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. But also, we use the git commit messages to **generate change log**.
|
69
|
-
|
70
|
-
The commit message formatting can be added using a typical git workflow or through the use of a CLI wizard ([Commitizen](https://github.com/commitizen/cz-cli)). To use the wizard, run `npm run cmt` in your terminal after staging your changes in git.
|
71
|
-
|
72
|
-
### Commit Message Format
|
73
|
-
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**:
|
74
|
-
|
75
|
-
```
|
76
|
-
<type>(<scope>): <subject>
|
77
|
-
<BLANK LINE>
|
78
|
-
<body>
|
79
|
-
<BLANK LINE>
|
80
|
-
<footer>
|
81
|
-
```
|
82
|
-
|
83
|
-
The **header** is mandatory and the **scope** of the header is optional.
|
84
|
-
|
85
|
-
Any line of the commit message cannot be longer 100 characters!. This allows the message to be easier to read on GitHub as well as in various git tools.
|
86
|
-
|
87
|
-
### Revert
|
88
|
-
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted. A commit with this format is automatically created by the [`git revert`](https://git-scm.com/docs/git-revert) command.
|
89
|
-
|
90
|
-
### Type
|
91
|
-
Must be one of the following:
|
92
|
-
|
93
|
-
* **feat**: A new feature
|
94
|
-
* **fix**: A bug fix
|
95
|
-
* **docs**: Documentation only changes
|
96
|
-
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
97
|
-
* **refactor**: A code change that neither fixes a bug nor adds a feature
|
98
|
-
* **perf**: A code change that improves performance
|
99
|
-
* **test**: Adding missing or correcting existing tests
|
100
|
-
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
|
101
|
-
|
102
|
-
### Scope
|
103
|
-
The scope could be anything specifying place of the commit change. You can use `*` when the change affects more than a single scope.
|
104
|
-
|
105
|
-
### Subject
|
106
|
-
The subject contains succinct description of the change:
|
107
|
-
|
108
|
-
* use the imperative, present tense: "change" not "changed" nor "changes"
|
109
|
-
* don't capitalize first letter
|
110
|
-
* no dot (.) at the end
|
111
|
-
|
112
|
-
### Body
|
113
|
-
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
|
114
|
-
|
115
|
-
### Footer
|
116
|
-
The footer should contain any information about **Breaking Changes** and is also the place to [reference GitHub issues that this commit closes](https://help.github.com/articles/closing-issues-using-keywords/).
|
117
|
-
|
118
|
-
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
|
119
|
-
|
120
|
-
|
121
|
-
## License
|
122
|
-
|
123
|
-
By contributing, you agree that your contributions will be licensed under its MIT license.
|
124
|
-
|
125
|
-
|
126
|
-
## Developer's Certificate of Origin 1.1
|
127
|
-
|
128
|
-
By making a contribution to this project, I certify that:
|
129
|
-
|
130
|
-
* (a) The contribution was created in whole or in part by me and I
|
131
|
-
have the right to submit it under the open source license
|
132
|
-
indicated in the file; or
|
133
|
-
|
134
|
-
* (b) The contribution is based upon previous work that, to the best
|
135
|
-
of my knowledge, is covered under an appropriate open source
|
136
|
-
license and I have the right under that license to submit that
|
137
|
-
work with modifications, whether created in whole or in part
|
138
|
-
by me, under the same open source license (unless I am
|
139
|
-
permitted to submit under a different license), as indicated
|
140
|
-
in the file; or
|
141
|
-
|
142
|
-
* (c) The contribution was provided directly to me by some other
|
143
|
-
person who certified (a), (b) or (c) and I have not modified
|
144
|
-
it.
|
145
|
-
|
146
|
-
* (d) I understand and agree that this project and the contribution
|
147
|
-
are public and that a record of the contribution (including all
|
148
|
-
personal information I submit with it, including my sign-off) is
|
149
|
-
maintained indefinitely and may be redistributed consistent with
|
150
|
-
this project or the open source license(s) involved.
|
package/rollup.config.js
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
import { keys } from 'lodash';
|
2
|
-
import pkg from './package.json';
|
3
|
-
|
4
|
-
export default [
|
5
|
-
{
|
6
|
-
input: 'src/index.js',
|
7
|
-
external: [
|
8
|
-
'lodash/clone',
|
9
|
-
'lodash/camelCase',
|
10
|
-
'lodash/find',
|
11
|
-
'lodash/forEach',
|
12
|
-
'lodash/isEmpty',
|
13
|
-
'lodash/keys',
|
14
|
-
'lodash/map',
|
15
|
-
'lodash/merge',
|
16
|
-
'lodash/toLower',
|
17
|
-
'lodash/toUpper',
|
18
|
-
...keys(pkg.dependencies),
|
19
|
-
...keys(pkg.peerDependencies),
|
20
|
-
],
|
21
|
-
output: [
|
22
|
-
{
|
23
|
-
file: pkg.main,
|
24
|
-
format: 'cjs',
|
25
|
-
interop: false,
|
26
|
-
esModule: false,
|
27
|
-
preferConst: true,
|
28
|
-
strict: true,
|
29
|
-
},
|
30
|
-
{ file: pkg.module, format: 'es' },
|
31
|
-
],
|
32
|
-
},
|
33
|
-
];
|