Skip to content

Commit

Permalink
Merge pull request #92 from smarty/max/esmodules
Browse files Browse the repository at this point in the history
Max/esmodules
  • Loading branch information
maxwellpothier authored Oct 24, 2024
2 parents 79833f7 + 3a8c81f commit 7799a36
Show file tree
Hide file tree
Showing 10 changed files with 3,842 additions and 1,486 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ __MACOSX
/.idea/
/node_modules/
/dist/
.env
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ test: node_modules
node_modules:
npm install

publish: test version upload unversion
build:
npm run build

publish: test version build upload unversion
tagit -p
git push origin --tags

Expand Down
41 changes: 0 additions & 41 deletions index.js

This file was deleted.

93 changes: 93 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* this files is the entry point for rollup to bundle the library
* it exports all the classes and functions as named exports
*/
import Batch from "./src/Batch.js";
import ClientBuilder from "./src/ClientBuilder.js";
import buildClient from "./src/util/buildClients.js";
import SharedCredentials from "./src/SharedCredentials.js";
import StaticCredentials from "./src/StaticCredentials.js";
import Errors from "./src/Errors.js";

import LookupUSStreet from "./src/us_street/Lookup.js";
import CandidateUSStreet from "./src/us_street/Candidate.js";

import LookupUSZipcode from "./src/us_zipcode/Lookup.js";
import ResultUSZipcode from "./src/us_zipcode/Result.js";

import LookupUSAutocompletePro from "./src/us_autocomplete_pro/Lookup.js";
import SuggestionUSAutocompletePro from "./src/us_autocomplete_pro/Suggestion.js";

import LookupUSExtract from "./src/us_extract/Lookup.js";
import ResultUSExtract from "./src/us_extract/Result.js";

import LookupInternationalStreet from "./src/international_street/Lookup.js";
import CandidateInternationalStreet from "./src/international_street/Candidate.js";

import LookupUSReverseGeo from "./src/us_reverse_geo/Lookup.js";

import LookupInternationalAddressAutocomplete from "./src/international_address_autocomplete/Lookup.js";
import SuggestionInternationalAddressAutocomplete from "./src/international_address_autocomplete/Suggestion.js";

import LookupUSEnrichment from "./src/us_enrichment/Lookup.js";
import ResponseUSEnrichment from "./src/us_enrichment/Response.js";

export const core = {
Batch,
ClientBuilder,
buildClient,
SharedCredentials,
StaticCredentials,
Errors,
};

export const usStreet = {
Lookup: LookupUSStreet,
Candidate: CandidateUSStreet,
};

export const usZipcode = {
Lookup: LookupUSZipcode,
Result: ResultUSZipcode,
};

export const usAutocompletePro = {
Lookup: LookupUSAutocompletePro,
Suggestion: SuggestionUSAutocompletePro,
};

export const usExtract = {
Lookup: LookupUSExtract,
Result: ResultUSExtract,
};

export const internationalStreet = {
Lookup: LookupInternationalStreet,
Candidate: CandidateInternationalStreet,
};

export const usReverseGeo = {
Lookup: LookupUSReverseGeo,
};

export const internationalAddressAutocomplete = {
Lookup: LookupInternationalAddressAutocomplete,
Suggestion: SuggestionInternationalAddressAutocomplete,
};

export const usEnrichment = {
Lookup: LookupUSEnrichment,
Response: ResponseUSEnrichment,
};

export default {
core,
usStreet,
usZipcode,
usAutocompletePro,
usExtract,
internationalStreet,
usReverseGeo,
internationalAddressAutocomplete,
usEnrichment,
};
Loading

0 comments on commit 7799a36

Please sign in to comment.