Skip to content

Commit

Permalink
Remove support for Node 12
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 15, 2022
1 parent 87e212f commit e551e71
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
22 changes: 0 additions & 22 deletions lib/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,25 +199,19 @@ export class Configuration {

result.filePath = filePath

// C8 bug on Node@12
/* c8 ignore next 2 */
return result
}
}

/** @type {Loader} */
async function loadScriptOrModule(_, filePath) {
// C8 bug on Node@12
/* c8 ignore next 4 */
// @ts-expect-error: Assume it matches config.
// type-coverage:ignore-next-line
return loadFromAbsolutePath(filePath, this.cwd)
}

/** @type {Loader} */
async function loadYaml(buf) {
// C8 bug on Node@12
/* c8 ignore next 4 */
return yaml.parse(String(buf))
}

Expand All @@ -226,8 +220,6 @@ async function loadJson(buf, filePath) {
/** @type {Record<string, unknown>} */
const result = parseJson(String(buf), filePath)

// C8 bug on Node@12
/* c8 ignore next 8 */
// @ts-expect-error: Assume it matches config.
return path.basename(filePath) === 'package.json'
? // @ts-expect-error: `this` is the configuration context, TS doesn’t like
Expand All @@ -250,8 +242,6 @@ async function merge(target, raw, options) {
throw new Error('Expected preset, not `' + raw + '`')
}

// C8 bug on Node@12
/* c8 ignore next 6 */
return target

/**
Expand All @@ -271,8 +261,6 @@ async function merge(target, raw, options) {
}

target.settings = Object.assign({}, target.settings, result.settings)
// C8 bug on Node@12
/* c8 ignore next 6 */
}

/**
Expand All @@ -291,8 +279,6 @@ async function merge(target, raw, options) {
await (Array.isArray(value) ? use(...value) : use(value, undefined))
/* eslint-enable no-await-in-loop */
}
// C8 bug on Node@12
/* c8 ignore next 6 */
}

/**
Expand All @@ -309,8 +295,6 @@ async function merge(target, raw, options) {
await use(key, result[key])
}
}
// C8 bug on Node@12
/* c8 ignore next 7 */
}

/**
Expand All @@ -325,8 +309,6 @@ async function merge(target, raw, options) {
} else {
await merge(target, usable, options)
}
// C8 bug on Node@12
/* c8 ignore next 7 */
}

/**
Expand Down Expand Up @@ -369,8 +351,6 @@ async function merge(target, raw, options) {
path.relative(options.root, fp)
)
}
// C8 bug on Node@12
/* c8 ignore next 8 */
}

/**
Expand Down Expand Up @@ -440,8 +420,6 @@ async function loadFromAbsolutePath(fp, base) {

// @ts-expect-error: assume plugin/preset.
return result.default
// C8 bug on Node@12
/* c8 ignore next 9 */
} catch (error) {
const exception = /** @type {Error} */ (error)
throw fault(
Expand Down
4 changes: 0 additions & 4 deletions lib/finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ function search(input, options, next) {
if (ignored) {
try {
file.fail('Cannot process specified file: it’s ignored')
// C8 bug on Node@12
/* c8 ignore next 1 */
} catch {}
}

Expand All @@ -240,8 +238,6 @@ function search(input, options, next) {
file.fail(
error.syscall === 'stat' ? 'No such file or directory' : error
)
// C8 bug on Node@12
/* c8 ignore next 1 */
} catch {}
}

Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ You can use this to make such things.
## Install

This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, 16.0+, or 18.0+), install with [npm][]:
In Node.js (version 14.14+, 16.0+, or 18.0+), install with [npm][]:

```sh
npm install unified-engine
Expand Down Expand Up @@ -233,7 +233,7 @@ It additionally exports the following types:

Projects maintained by the unified collective are compatible with all maintained
versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
As of now, that is Node.js 14.14+, 16.0+, and 18.0+.
Our projects sometimes work with older versions, but this is not guaranteed.

## Security
Expand Down

0 comments on commit e551e71

Please sign in to comment.