Skip to content

Commit

Permalink
Convert to ES module, document breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreisnz committed Jun 24, 2024
1 parent b17ebe7 commit be28e3f
Show file tree
Hide file tree
Showing 45 changed files with 3,713 additions and 4,115 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

10 changes: 10 additions & 0 deletions .c8rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"exclude": [
"node_modules",
"**/*.spec.js",
"src/helpers/handlers.js"
],
"reporter": ["lcov", "text", "html"],
"sourceMap": false,
"cache": false
}
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

144 changes: 0 additions & 144 deletions .eslintrc.yaml

This file was deleted.

1 change: 0 additions & 1 deletion .mocharc.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .nycrc

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
node_js:
- "16"
- "18"
- "20"
- "22"
branches:
only:
- master
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 8.0.0
The package has been converted to an ES module and now requires Node 18 or higher. If you need support for Node 16 or below, please use version 7.x.x.

### Breaking changes
- Package has been converted to an ES module
- No longer providing a default export. Use the named exports `replaceInFile` or `replaceInFileSync` instead.
- The `replace.sync` syntax is no longer available. Use the named export `replaceInFileSync` instead.
- The callback API has been removed for asynchronous replacements. Please use promises or `async/await` instead.
- Configuration files provided to the CLI using the `--configFile` flag can now only be JSON.
- To use a custom `fs` implementation, you must now specify `fs` config parameter for the async API, and `fsSync` for the sync API. For the asynchronous APIs, the provided `fs` must provide the `readFile` and `writeFile` methods. For the synchronous APIs, the provided `fsSync` must provide the `readFileSync` and `writeFileSync` methods.
- If a `cwd` parameter is provided, it will no longer be prefixed to each path using basic string concatenation, but rather uses `path.join()` to ensure correct path concatenation.

## 7.0.0
Strings provided to the `from` value are now escaped for regex matching when counting of matches is enabled. This is unlikely to result in any breaking changes, but as a precaution the major version has been bumped.

Expand Down
Loading

0 comments on commit be28e3f

Please sign in to comment.