Skip to content

Commit

Permalink
refactor(package.json): move node-postal to optionalDependencies (#…
Browse files Browse the repository at this point in the history
…63)

* refactor(package.json): Move node-postal from peerDependencies to optionalDependencies

* docs(README): Update libpostal section to clarify it's optional

* style(.eslintrc.js): Add rule to ignore extraneous dependencies
  • Loading branch information
joaocarmo authored Oct 16, 2023
1 parent 52a8360 commit d6c59c2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ module.exports = {
ts: 'never',
},
],
'import/no-extraneous-dependencies': [
'error',
{ optionalDependencies: ['./lib/string-parser.ts'] },
],
},
settings: {
'import/resolver': {
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,27 @@ title

If you're interested in parsing a string into an object, you can use the new
experimental support for parsing addresses using some existing libraries.
However, note that these are optional and not required for the primary
functionality of this library.

### libpostal

This is the most complete and comprehensive library for parsing addresses. You
need to be using the **node** version as it's not supported on the web.

#### Requirements
#### Optional Requirements for libpostal Support

If you wish to utilize the `libpostal` experimental features, follow these
steps:

1. Install [libpostal][libpostal] following their installation instructions, or
execute [this script][install-libpostal] if you're on a \*nix machine
2. Install [node-postal][node-postal] as a dependency in your project, _after
installing libpostal_
execute [this script][install-libpostal] if you're on a \*nix machine.
2. Install [node-postal][node-postal] as an **optional** dependency in your
project, _after installing libpostal_. This is not required for the core
functionality but only if you want to use the `libpostal` features.

Remember, these steps are optional and are only for users interested in the
experimental string parsing feature.

#### Experimental usage

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"web"
],
"dependencies": {},
"peerDependencies": {
"optionalDependencies": {
"node-postal": "^1.1.2"
},
"devDependencies": {
Expand Down

0 comments on commit d6c59c2

Please sign in to comment.