Releases: wessberg/cjstoesm
v3.0.0
BREAKING CHANGES
cjstoesm
is now an ESM-only package.- Dropped support for Node versions older than v18.20.0.
New Features
- Added support for TypeScript v5.6.
- Added support for Import Attributes, instead of the now obsolete Import Assertions.
v2.1.2
fix: use ansi-colors instead of Chalk for better CJS fallback support
v2.1.1
v2.1.0
v2.0.0
New Features
The cjstoesm
package is now based on ESM and requires Node v14.19.0 (BREAKING CHANGE)
Despite being a tool for converting CommonJS to ESM, and a bit ironically, cjstoesm
has been published as an NPM package with a CommonJS entrypoint (dist/cjs/index.js
), and an ESM entrypoint (dist/esm/index.js
), while the CLI itself was CommonJS based.
Now, the cjstoesm
package is fully based on ESM. There are still API entrypoints for CommonJS using the package exports feature, as well as pointed to from the main
field in the package.json.
From this new major version of cjstoesm
, you must be using Node.js v14.19.0 or newer.
Improve emit behavior
No more replication of source folder structure (BREAKING CHANGE)
In the past, cjstoesm
would replicate the source folder structure inside the destination folder.
For example, if you called to CLI with something like:
cjstoesm foo/bar/baz/** target
You would get files following a pattern like this: target/foo/bar/baz/<filename>
.
This was a bit counterintuitive.
In the new version, this behavior changes and aligns with general user expectations. In the example above, from the new version files will follow a pattern like this: target/<filename>
.
Allow overwriting in-place and make outDir
an optional argument (BREAKING CHANGE)
In the old version of cjstoesm
, passing in an output directory was strictly required. From the new version, the default behavior is to simply overwrite the files in-place. You can still pass in a separate output directory as the second argument if you want, but from the new version this is completely optional.
This means that the following is now possible:
cjstoesm **/*.*
Easier globbing
In the old version of cjstoesm
, the following wouldn't work:
cjstoesm src
Since src
doesn't match anything as a glob. However, to align with user expectations, in the new version, any direct descendent of the src
folder will now be matched by the above command.
- feat: migrate to publishing ES-modules with a CommonJS fallback. Improve emit-behavior. Fix bugs related to inclusion of module specifiers 78592d0