Skip to content

v13.0.0

Choose a tag to compare

@sindresorhus sindresorhus released this 02 Feb 07:02
· 9 commits to main since this release

Breaking

  • Dotfiles are no longer included by default. Globs now respect the dot option (default false), so files like .hidden are skipped unless explicitly included.
    • If you relied on dotfiles being copied implicitly, either:
      1. Pass dot: true, or
      2. Add explicit dotfile patterns (for example .hidden or **/.hidden).
  • Add rename source/destination objects 3207310
    • The old single parameter rename function still works, but it will be removed in the next major version, so I recommend migrating.
    • The new two-argument form lets you safely mutate the destination while keeping it within the destination directory.
      • Old:
      await cpy("foo.js", "destination", {
      	rename(basename) {
      		return basename.replace("foo", "bar");
      	}
      });
      • New:
      await cpy("foo.js", "destination", {
      	rename(source, destination) {
      		if (source.nameWithoutExtension === "foo") {
      			destination.nameWithoutExtension = "bar";
      		}
      		// destination.name, destination.extension, or destination.path can be updated here
      	}
      });

Improvements

  • Add dryRun option 247cb9e
  • Add base option for path resolution 28175cb

v12.1.0...v13.0.0