MathCookie17 / Eternal-Notations

A JavaScript library that abbreviates really large numbers in various notations, built on break_eternity.js.
MIT License
10 stars 3 forks source link

Package manager and dependencies #3

Open xShadowBlade opened 1 month ago

xShadowBlade commented 1 month ago

There seems to be some ambiguity regarding the package manager being used and how dependencies are managed. Specifically:

Also, a .gitignore file seems to be missing.

MathCookie17 commented 1 month ago

I don't really understand NPM/Yarn stuff, so I tried to follow the conventions of packages like AD Notations and break_eternity, whose GitHub pages include the package and package lock files, but not node_modules. On my end, I used yarn and bili, and I did use npm/yarn to add break_eternity as a dependency, but I didn't include the node stuff on the GitHub page. ./break_eternity stuff is there so the demo website has a copy of break_eternity to run on.

xShadowBlade commented 1 month ago

Thank you for answering my questions.

As a developer, I think it would be cool if this project could eventually be made into an npm package for easier use within my projects. If you do this, you would need to modify your package.json to include git info (optional), keywords and exports.

{
  "name": "eternal_notations",
  "exports": {
    "module": "./dist/eternal_notations.esm.js",
    "default": "./dist/eternal_notations.esm.js"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/MathCookie17/Eternal-Notations.git"
  },
  "keywords": [],
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/MathCookie17/Eternal-Notations/issues"
  },
  "dependencies": {
    "break_eternity.js": "^1.4.2",
    "lru_cache": "^1.0.2"
  },
  "devDependencies": {
    "bili": "^5.0.5",
    "rollup-plugin-typescript2": "^0.36.0",
    "typescript": "^5.4.5"
  }
}

This official npm article and this one are pretty good guides. I have experience working with npm and publishing packages, so if you need help with this. let me know. However, I understand if this is currently a low priority item or if you don't want to do this.

MathCookie17 commented 1 month ago

Making this into an npm package is something I want to do eventually, though right now I need a break after working on this for over four months - I'll still fix bugs and all that as they show up, but I'm not mentally ready yet to tackle more crazy library stuff I don't understand.

lonevox commented 1 week ago

I'll add by saying I'm looking to use this but probably won't unless it's published to npm, just because adding eternal_notations.min.js directly to my project is too clunky for my tastes (also the file is several times the size of my project!). But this really is a game changer for the incremental scene so thanks for sharing it :)