Skip to content

Commit be28e3f

Browse files
committed
Convert to ES module, document breaking changes
1 parent b17ebe7 commit be28e3f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3713
-4115
lines changed

.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.c8rc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"exclude": [
3+
"node_modules",
4+
"**/*.spec.js",
5+
"src/helpers/handlers.js"
6+
],
7+
"reporter": ["lcov", "text", "html"],
8+
"sourceMap": false,
9+
"cache": false
10+
}

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.yaml

Lines changed: 0 additions & 144 deletions
This file was deleted.

.mocharc.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.nycrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: node_js
22
node_js:
3-
- "16"
43
- "18"
54
- "20"
5+
- "22"
66
branches:
77
only:
88
- master

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 8.0.0
2+
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.
3+
4+
### Breaking changes
5+
- Package has been converted to an ES module
6+
- No longer providing a default export. Use the named exports `replaceInFile` or `replaceInFileSync` instead.
7+
- The `replace.sync` syntax is no longer available. Use the named export `replaceInFileSync` instead.
8+
- The callback API has been removed for asynchronous replacements. Please use promises or `async/await` instead.
9+
- Configuration files provided to the CLI using the `--configFile` flag can now only be JSON.
10+
- 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.
11+
- 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.
12+
113
## 7.0.0
214
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.
315

0 commit comments

Comments
 (0)