JS native output from json (to npm_dist) #34
Merged
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.
Adds
scripts/js/build_js.mjs
that does the following -index.{js, cjs}
versions from thess58-registry.json
inputpackage.json
file to allow for export mapsindex.d.ts
file for TypeScript consumersThis is executed via
npm run build
that creates the output in thenpm_dist
folder. At this point is is completely ready for publishing to the npm registry, socd npm_dist && npm publish --access public
will publish (assuming all the right credentials are found locally)The reason for the JS outputs is that
import
orrequire
from json is still well, up-in-the-air from a standards perspective. For instance under Node extra flags are now required to enable this.In general having a full build setup via something else would probably be overkill, hence the small script that copies stuff and generates the JS output. Cannot beat no additional dependencies.
Additionally the PR also adds -
types.d.ts
file in the root for TypeScript definitions for the registry structure.gitignore
to skip thenpm_dist
folder (alongside the changes in Version package.json from Cargo.toml (via script) #33)package.json
version from the current master statusWith this available alongside #33 it can really be published to npm from CI.