Skip to content
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

Update to use CommonJS module format #67

Closed
wants to merge 16 commits into from

Conversation

andyinabox
Copy link

This PR is related to #42 — it doesn't make the clmtrackr usable as a node.js module yet, but it does restructure the code to use CommonJS modules, which is a step in that direction. Here's a basic summary of what you'll find here:

  • As much as possible, I included dependencies using npm (defined as dependencies in package.json) instead of as .js files in the repo.
  • The built files ("clmtrackr.js" and "clmtrackr.min.js") are now wrapped up as UMD modules, so it can be included as a CommonJS module, an AMD module, or a browser global.
  • I restructured the main js files to use CommonJS module format, so that dependencies are more explicit within each file. For the browser, these can be built using browserify or something similar.
  • Since dependencies are all managed using require statements, I moved the build to a simple script definition in the "package.json", which can be run using npm run build.
  • In some cases, I changed or duplicated files to .json format when they were only storing data and didn't contained any js code.

I know this is a lot of changes, so won't be surprised if you have questions/concerns (or maybe just don't even want to bother with it). But I wanted to use this library in some of my own projects using the npm/browserify workflow and so I figured I'd give it a shot! As far as I can tell all of the examples work still so I don't think I broke anything in the process :)

@andyinabox
Copy link
Author

No update to this PR, but if anyone wants to try out my CommonJS fork grab it here: https://github.com/andyinabox/clmtrackr. As of today it's still up-to-date with this repo's dev branch.

@yofreke yofreke mentioned this pull request Sep 19, 2016
4 tasks
@auduno
Copy link
Owner

auduno commented Jul 5, 2017

Sorry for not replying earlier. This project has now been refactored for npm and is built as an UMD module. I based the refactor on PR #85, which again was based on this PR, but ended up using different solutions (rollup, ES6 imports) so it's quite heavily modified, but thanks very much for this PR.

@auduno auduno closed this Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants