Skip to content

Releases: carnesen/cli

carnesen-cli-examples-0.8.0 (2022-09-11)

12 Sep 02:02
Compare
Choose a tag to compare
carnesen-cli-examples-0.8.0

carnesen-cli-docs-0.8.1 (2022-09-11)

12 Sep 02:52
Compare
Choose a tag to compare

carnesen-cli-0.8.1 (2022-09-11)

12 Sep 02:47
Compare
Choose a tag to compare
carnesen-cli-0.8.1

carnesen-cli-0.8.0 (2022-09-11)

12 Sep 01:53
Compare
Choose a tag to compare

This is a significant release with breaking changes. It refactors all the @carnesen/cli abstractions as TypeScript/ECMAScript classes. Earlier implementations of this library favored a pattern of factory functions producing a plain object. We adopt a new namespace/branding convention "CCli" for the new classes. Compared to the old namespace (just "Cli"), the extra "C" (for "carnesen"!) makes the exported symbols more distinctive and easily auto-imported in your IDE. For most use cases however you won't need to use the "CCli" symbols because this release provides a new convenient API for defining CLI's, the c namespace object. For example:

Old API:

import { CliCommand, CliStringArgGroup } from "@carnesen/cli";

const root = CliCommand({
   name: "curl",
   positionalArgGroup: CliStringArgGroup({
      placeholder: "<url>",
   }),
   action({ positionalValue: url }) {
      // Implementation goes here...
   }
});

New API:

import { c } from "@carnesen/cli";

const root = c.command({
   name: "curl",
   positionalArgGroup: c.string({
      placeholder: "<url>",
   }),
   action({ positionalValue: url }) {
      // Implementation goes here...
   }
});

Upgrading from older versions is pretty straightforward. As in the example above, it's mostly a matter of replacing the old factory functions with the new ones e.g. CliCommand --> c.command. Install the new @carnesen/cli package, fix any TypeScript type errors, and you should be good to go.

Besides the new CCli naming scheme, there are a few other breaking changes in this release. Previously we injected a logging object called console into command action function. We've since adopted a lint rule that forbids us from shadowing the global console. In this release we adopt a more sensible name logger for the injected logging object, by default still a thin wrapper around the global console. While we were at it, we also renamed the ansi injection color.

Besides the breaking refactoring, this release also has a few new features. The previously internal-only CCliLogger classes are now supported as official exports, same for the CCliColor classes.

carnesen-cli-website-server-2022.5.0 (2022-05-10)

11 May 03:27
Compare
Choose a tag to compare
carnesen-cli-website-server-2022.5.0

carnesen-cli-website-2022.5.0 (2022-05-10)

11 May 03:23
Compare
Choose a tag to compare
carnesen-cli-website-2022.5.0

carnesen-cli-examples-0.7.1 (2022-05-10)

11 May 03:19
Compare
Choose a tag to compare
  • Breaking: Drop official support for Node.js 12

  • Internal: Upgrade dev dependencies

carnesen-cli-docs-0.7.1 (2022-05-10)

11 May 03:15
Compare
Choose a tag to compare

carnesen-cli-0.7.1 (2022-05-10)

11 May 03:12
Compare
Choose a tag to compare
  • Breaking: Drop official support for Node.js 12

  • Internal: Run the TypeScript compiler explicitly avoiding @types/node to make sure this code is truly isomorphic

  • Fix: A browser-only bug where CliRun made an unqualified reference to process

  • Internal: Upgrade dev dependencies

carnesen-cli-website-server-2022.2.0 (2022-02-26)

26 Feb 07:00
Compare
Choose a tag to compare
  • Internal: Upgrade dependencies