From d6c59c263e5de4096bed404bcc2c96114fead805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Carmo?= <17721880+joaocarmo@users.noreply.github.com> Date: Mon, 16 Oct 2023 23:11:53 +0100 Subject: [PATCH] refactor(package.json): move `node-postal` to `optionalDependencies` (#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 --- .eslintrc.js | 4 ++++ README.md | 17 +++++++++++++---- package.json | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index a50e180..cdce746 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,6 +29,10 @@ module.exports = { ts: 'never', }, ], + 'import/no-extraneous-dependencies': [ + 'error', + { optionalDependencies: ['./lib/string-parser.ts'] }, + ], }, settings: { 'import/resolver': { diff --git a/README.md b/README.md index 26abe19..f76aecb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index 9af8040..59342ef 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "web" ], "dependencies": {}, - "peerDependencies": { + "optionalDependencies": { "node-postal": "^1.1.2" }, "devDependencies": {