-
Notifications
You must be signed in to change notification settings - Fork 33
Max/esmodules #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Max/esmodules #92
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
c8fea41
feat: create a rollup configuration to export commond and es modules
akadoshin 0370c97
fix: fix rollup configuration in the export for the cjs modules
akadoshin bfe8484
fix: create an index to export all the modules as es modules
akadoshin f5b89a5
fix: delete duplicate index and fix unit test for mjs
akadoshin 9a9195a
chore: test script command
akadoshin b145a92
adding a little extra configuration to the rollup config
d2d086c
updating paths in package.json
d843a4f
run tests
de47aa4
run tests
7b49eea
update axios
498948d
include axios in the process
d97c7fb
adds axios back in
f356a44
clean the cache before testing
496f25c
removing extra step
b1cf9d2
rebuilt package.json
b36b5a0
editing configuration
74c97fa
reverting
2133ad7
remove node 14 from github actions tests
c44dcff
updating the publish process, updating dependencies
3a8c81f
downgrading chai (for now)
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ __MACOSX | |
| /.idea/ | ||
| /node_modules/ | ||
| /dist/ | ||
| .env | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the build command should be added as part of the publish command. I think
publish: test version build upload unversionshould work?In addition, we should define a
.npmignorefile with the following lines in order to not publish unecessary files npm (not for privacy reasons, but just for keeping things tidy)You can test out what will be published to npm with
npm publish --dry-runThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@camiblanch @maxwellpothier I agree with reducing the package size. When I first looked at the project, I wasn't sure why all the code was being exported in the package, so I left it as it was. However, in this case, it would be better to specify which files to include rather than excluding them. In the package.json, you can do something like this:
This way, you’re only including the necessary build folder (dist), which is meant for publishing the package to npm, and other relevant files like the README and license.