• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NebuPookins / toggl-cli / #5
52%
master: 52%

Build:
Build:
LAST BUILD BRANCH:
DEFAULT BRANCH: master
Ran 15 Sep 2021 11:46PM UTC
Jobs 1
Files 13
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
#5

push

NebuPookins
refactor: now using JavaScript Modules (ESM).

This is part of an effort to upgrade the `xo` linter. The current version of
`xo` pulls in an old version of trim-newlines which contains a security
vulnerability. In upgrading `xo`, the linter enforces several new things, one
of which is the use of ESM style modules (as opposed to AMD or CommonJS style
modules, for example).

This commit makes the switch to ESM modules in isolation from all the other
changes, to make it easier to trace any bugs this refactoring may have
introduced.

Notable changes:

* The project previously used a custom module system
  https://github.com/meeDamian/mee that builds upon the CommonJS module
  system. I've written a small module system `meeEsm` which mimics what `mee`
  did, but using the ESM module system as its base.
* The `mee` module system expects you to place the object containing all the
  fields you want to export in some local variable (by convention, named
  `me`), and the `mee` module will mutate that object, and return a new
  object, which it expects you to reassign to the `me` variable. That new
  object is also the object that actually gets exported. This means that
  functions that wish to act on the exported object can reference the `me`
  local variable. In contrast, the `meeEsm` module system does not mutate the
  passed in object, and simply returns an object which you are then
  responsible for exporting (e.g. via the `export default` keywords).
  Functions which wish to act on that object should use the `this` pointer.
  TL;DR, all the code that previously had method invocations like
  `me.someMethod()` now look like `this.someMethod()`.
* CommonJS style modules have a `require` function, and the old code used
  this function to read in the `package.json` file (e.g. to report version
  numbers). For ESM style modules, I created a new module called `pkg` which
  exposes the data from the `package.json` file without relying on the
  `require` function.
... (continued)

125 of 125 branches covered (100.0%)

Branch coverage included in aggregate %.

830 of 1720 relevant lines covered (48.26%)

3.57 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #5.1 15 Sep 2021 11:45PM UTC 0
51.76
Source Files on build #5
Detailed source file information is not available for this build.
  • Back to Repo
  • 37efda31 on github
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc