This package is a monorepo for the @netresearch/postdirekt-autocomplete-library and @netresearch/postdirekt-autocomplete-sdk npm package.
Before you can start working on the Autocomplete monorepo, you need to have Node.js
installed on your machine. The currently supported versions are 10.0.0 or greater.
To download Node.js visit https://nodejs.org/en/download/.
NOTE: You can use a tool like NVM
or N to install and manage multiple node versions
In addition to Node.js we use yarn to facilitate multi package development.
To install yarn follow the instructions listed on their website:
https://yarnpkg.com/en/docs/install
You can verify your setup by running the following commands in your terminal:
$ node -v
$ yarn -vYour Node.js version should be 10.0.0 or greater, your yarn version should
be 1.0.0 or greater,
Once you have Node.js and yarn installed on your machine and have validated
that you are running the proper version, you can set up the development environment
by running the following at the root of the repo:
$ yarnOnce you have installed all the dependencies, you can build both packages by running the following command the root of the repo:
$ yarn buildThis folder contains the @netresearch/postdirekt-autocomplete-sdk, responsible for abstracting away the Deutsche Post Direkt Autocomplete 2.0 API.
See Readme.
This folder contains the _@netresearch/postdirekt-autocomplete-library, responsible for registering input listeners on given input fields (street address, city and postcode) and fetching address suggestions from the Autocomplete API via the autocomplete-sdk package.
See Readme.
You can run the tests with the command
$ yarn testTo run the linter, do
$ yarn lintYou can build ES2017 compatible artifacts (this is what's published on npm) with
$ yarn buildYou can also build ES5 compatible artifacts (output in <rootDir>/dist) with
$ yarn build:es5