Skip to content

Releases: Cykelero/tasklemon

0.2.0: The npm Update

19 Aug 16:09
Compare
Choose a tag to compare

So. You're busy writing a small, handy script, when you realize you could really use a juicy npm package right now. But you can't indulge and create a package.json file—there are other scripts in this folder! What do you do?

Well, you just type in const randomPun = npm.devpun.random(), of course. What was that about a package file?

Using an npm package in Tasklemon is absurdly easy: every single npm package is available on the npm global you'll find already injected in your Tasklemon script. So all you have to do is something like this:

const friendNames = await cli.ask('What are your friends called?', Array);
const uniqueFriendNames = npm.dedupe(friendNames); // let's use the “dedupe” package

cli.tell('Total count of unique friend names: ' + uniqueFriendNames.length);

And voilà: run your script, and it all just works. No declaring, no importing, and certainly no installing. Tasklemon proactively discovers what packages you need, and installs them in the background when your script runs. Everything is neatly cached, so that subsequent runs can invoke the packages instantly.

In addition to being almost magical, npm support is also very resilient, and knows of a lot of back-up plans for when things go askew—which means it basically always succeeds. And if you do want more control, Tasklemon exposes a few commands to manage the package cache and to remind it of who's the boss (you).

One very important goal of Tasklemon is to make sure everything you need is within reach. With the new addition of about one million npm packages, your reach is looking pretty good.

New

  • Add npm support
    • Use any npm package without needing to declare, install or import it
    • Robust automatic download and installation
    • Smart caching and prefetching avoid any performance hit
    • Manual version pinning and cache management commands allow for finer control
  • Add scriptFile and scriptFolder, as File/Folder equivalents to __filename and __dirname
  • Automatically add shebang to new scripts when running them
    • Also includes the runtime version number, to prepare for backward compatibility

Improvements

  • Don't show call stack if exiting because of an argument error

Fixes

  • Set default argument type in cli.accept() to String, instead of Boolean
  • When parsing an item as a script argument, detect its type using the filesystem, rather than relying on its path
  • Throw if cli.accept() is called more than once
  • Clean up execution stage after running
  • Properly set exit code when using --inspect
  • Windows: Improve reliability when debugging
  • Tests: Clean up test site after running

0.1.1: The Windows Path Panic Placation Patch

24 Jun 11:38
Compare
Choose a tag to compare

Great news! It turns out that Windows support was almost completely broken. And now it's not!
The lesson here is that it's not enough to have test suites: you also have to run them once in a while.

Fixes

  • Properly throw when failing to create an item
  • Windows: fix path handling
    • Virtually all paths were parsed as relative
    • Paths with no existing components weren't properly resolved
  • Tests: Don't assume timezone in Date's TypeDefinition

0.1.0: First Version

07 Oct 21:25
Compare
Choose a tag to compare

This is Tasklemon's first release!

Here's a high level overview of what's included:

  • Super nice filesystem access
    • Directly manipulate File and Folder instances, for safety and ease of use
    • Move, copy and rename things
    • Get and set file contents with effortless casting
    • Even manipulate permissions with a dead-simple API
  • Practical CLI support
    • Declare which arguments you accept, and receive them already validated and cast
    • Ask the user for more data interactively, again with built-in casting
    • Concisely format numbers and dates for friendly display
  • Simplified network requests
    • Query a URL with a single line of code
    • Directly get JSON or even DOM data
    • Use the built-in fetch for complex requests
  • Automatic injection of all the above APIs: no need to import anything!

Tasklemon's goal is to have all the tools you need, all nicely packaged behind crazily simple APIs. I hope you love them!