Skip to content

Releases: thecodrr/fdir

6.0.0

08 Feb 18:24
Compare
Choose a tag to compare

Note: While fdir tries to strictly follow semver, this release doesn't actually break anything. It does deprecate a few things but overall, migrating from v5.3.0 to v6.0.0 should be seamless.

⭐ Features & new stuff

Typescript rewrite

fdir has now been fully rewritten in TypeScript. This brings better clarity into what's happening and how its happening. The code in the project has also be reorganized & broken down so it's much easier to understand now.

Another benefit of using TypeScript is types. Since everything is now autogenerated by tsc, it is always in sync with the actual API. With the help of generics, the output type is now automatically inferred based on the method used. That means no more as string[] etc.

globWithOptions

Globbing support has always been barebones in fdir. This release brings in full support for passing picomatch options when globbing. Use it like this:

new fdir()
  .globWithOptions(["**/*.js"], { dot: true })
  .crawl("path/to/dir")
  .sync();

⚔️ Deprecations

A lot of unintuitive & badly designed API choices have been deprecated. They will continue to work as intended but they will eventually be removed in the upcoming major versions. These include:

crawlWithOptions

This function was added as a convenience for people who don't like the Builder API. This has now been replaced with the fdir constructor.

Instead of this:

new fdir()
  .crawlWithOptions("./", { includeDirs: true })
  .sync();

You should now do this:

new fdir({ includeDirs: true })
  .crawl("./")
  .sync();

P.S. I forgot to deprecate includeDirs and replace it with includeDirectories. Oh well, I'll do that in the next version.

directories instead of dirs

When using the onlyCounts() API, the resulting object will now contain directories instead of dirs. A minor change but I really don't like abbreviations unless absolutely necessary.

directory instead of dir

When using the group() API, the resulting object will now contain directory instead of dir.


And that's it. No other changes to the API. I am pretty sure that the TypeScript rewrite fixed some hidden & hard-to-debug bugs so you should find v6.0.0 much more stable.

5.3.0

18 Oct 17:43
926609a
Compare
Choose a tag to compare

⭐ Features & new stuff

  1. It is now possible to disable path resolution of files inside symlinked directories (#84). This release adds new optional parameter to the withSymlinks. Check the docs on how to use it:

This change is 100% backwards compatible and should not break any of your scripts that rely on symlink resolution.

5.2.1

17 Oct 18:39
0ed9e53
Compare
Choose a tag to compare

🐛 Fixes & improvements

  1. Add picomatch in peerDependencies by @kyleknighted in #76
  2. Make picomatch an optional peerDependency by @IanVS in #80

New Contributors

5.2.0

18 Jan 06:17
Compare
Choose a tag to compare

Note: fdir follows semantic versoning hence this release is backward compatible with only version 5.x.

Features

  1. withRelativePaths has been added to return paths relative to the root directory (closes #51)

Fixes

  1. respect the original symboliclink if resolveSymlinks is false (#63)
  2. only handle fs related errors (#56) — before we were swallowing all thrown errors.
  3. Fixed a critical issue with async crawling that caused the crawler to return early.

5.1.0

21 May 13:16
Compare
Choose a tag to compare

Note: fdir follows semantic versoning hence this release is backward compatible with only version 5.x.

Features

  1. Added symlink resolution support via .withSymlinks method (#53 & #58):
const files = new fdir().withSymlinks().crawl("/path/to/dir").sync();
  1. Performance & memory usage has also been greatly improved due to the many internal refactorings.

Infrastructural improvements:

Aside from the symlinks support, this release has a lot of under-the-hood refactoring. This has improved the maintainability of the project from 83% to 97%.

Major improvements include:

  1. Added ARCHITECTURE.md
  2. Added CONTRIBUTING.md
  3. Consistent internal naming for functions, variables & arguments.

And other changes you can see in PR: #59


Thanks to everyone who has used, supported, tested, & worked on this project. This is also a celebratory release since fdir is now being used by projects such as snowpackjs/snowpack & mdn/yari. So YAY!

5.0.0

12 Jan 17:41
Compare
Choose a tag to compare

Note: fdir follows semantic versoning hence this release is not backward compatible with any previous release.

Breaking Changes

  1. Filters applied using new fdir().filter() are now joined via AND instead of OR. (#35)

Features

  1. There is now a brand new onlyDirs builder function that allows you to grab (and filter) only directories ignoring all files. (#43)
const crawler = new fdir().onlyDirs();
  1. As a result, filters now work with directories as well and include isDirectory as second parameter to .filter() function:
const crawler = new fdir()
  .filter((path, isDirectory) => path.startsWith("."))
  .filter((path, isDirectory) => path.endsWith(".js"));
  1. Full path of the directory is now sent to the excludeFn of .exclude(excludeFn): (#46)
const crawler = new fdir().exclude((dirName, dirPath) =>
  dirName.startsWith(".")
);

Fixes

  1. Use \0 instead of nothing to separate cached glob patterns (#42)
  2. Resolved all concurrency issues that made the configuration of multiple concurrent instances of fdir to collide (#47)
  3. Node was exiting whenever an error (like ENOENT) occured. (#48)

Thank you @papb for your help and PR #45!

4.1.0

04 Aug 15:36
Compare
Choose a tag to compare

What's Improved:

  1. Performance improved by 8%.

4.0.0

27 Jul 18:28
Compare
Choose a tag to compare

Breaking Changes:

  1. Due to issues with export default in the Type Definitions, I had to migrate to using named exports. (#37)

So this is now invalid:

import fdir from "fdir";

Instead do this:

ES6:

import { fdir } from "fdir";

CommonJS:

const { fdir } = require("fdir");

3.4.3

02 Jun 23:08
Compare
Choose a tag to compare

What's Fixed

  1. Fixed issue where excludeFn was affected by Options (#31) Now fdir only will send the root directory name as the param to excludeFn.

3.4.2

18 May 00:41
Compare
Choose a tag to compare

What's Fixed:

  1. Enabled dotfile matching in glob API by default (Fixes: #30)