excelize-wasm icon indicating copy to clipboard operation
excelize-wasm copied to clipboard

Improvements to javascript and build process

Open paustint opened this issue 2 years ago • 3 comments

PR Details

  • Made minor updates to index.js
  • Added a test (just for nodejs)
  • Added package.json scripts to automate build process

Description

  • Added prettier for consistent code formatting and applied formatting. (This accounts for most of the code changes)
  • Updated javascript to simplify some of the environment detection
  • Moved import of pako to top of file
  • Ensure that performance object in node is not fully replaced and instead just now is replaced
  • Added scripts to package.json for building and testing.
  • Added source maps - this is nice for library consumers that need to debug
  • Updated compatibility chart. globalThis bumped node from 8 to 12.
  • Updated build process to automatically include type definition

Related Issue

There is no open issue for this, since it is not really a feature or a bug. Happy to discuss changes here or open an issue if we would like to track an issue along with this PR.

Please let me know. 🙏

Motivation and Context

The init function was using a mix of legacy JS and modern JS. This PR cleans up these minor issues. The build process was not documented or automated, this PR includes documentation in the README and automates this using package.json scripts.

In addition, a test has been added to ensure that the built code works.

How Has This Been Tested

I added a file to test in NodeJS (just basic usage for now) and I have tested manually in a Typescript web project to ensure that the changes work correctly.

Types of changes

  • [x] Docs change / refactoring / dependency upgrade
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • [x] My code follows the code style of this project.
    • I don't see standards documented, but I added prettier that should handle the formatting part of the style
  • [ ] My change requires a change to the documentation.
    • Readme was updated, but core docs do not need to be updated
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [x] I have added tests to cover my changes.
  • [x] All new and existing tests passed. We still have a lot of tests that would benefit from being written

paustint avatar Jan 08 '23 22:01 paustint

@xuri - Hopefully I did not overstep any boundaries by raising this PR and I hope you find the changes valuable. I am happy to discuss any of the changes proposed in the PR. Thank you 😸

paustint avatar Jan 08 '23 22:01 paustint

Thanks for your pull request. This PR contains a lot of code and I need some time to review.

xuri avatar Jan 13 '23 01:01 xuri

@xuri - No problem, take your time. Let me know if you have any questions or if there is anything that I came up with that you disagree with.

Thanks!

paustint avatar Jan 13 '23 01:01 paustint