-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(node): drop Node 10 support (#136)
This also converts the project to pure ESM as it is fully supported in Node 12.20 and beyond. BREAKING CHANGE: This removes support for Node v10 and makes the new minimum runtime Node v12.20, as v10 is EOL. Please upgrade your Node.js environment to at least version 12.20, or continue using the latest v9 release of `pwned` if you are unable to upgrade your environment.
- Loading branch information
Showing
25 changed files
with
140 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const isTest = process.env.NODE_ENV === 'test'; | ||
|
||
module.exports = { | ||
plugins: [ | ||
isTest && 'babel-plugin-transform-import-meta', | ||
!isTest && 'babel-plugin-add-import-extension', | ||
].filter(Boolean), | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
// needed for jest.mock() until they have a way to mock ES modules | ||
modules: isTest ? 'commonjs' : false, | ||
targets: { | ||
node: '12.20', | ||
}, | ||
}, | ||
], | ||
'@babel/preset-typescript', | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
#!/usr/bin/env node | ||
require('source-map-support/register'); | ||
const path = require('path'); | ||
const yargs = require('yargs'); | ||
import sourceMapSupport from 'source-map-support'; | ||
import yargs from 'yargs'; | ||
import { hideBin } from 'yargs/helpers'; | ||
|
||
/* eslint-disable import/extensions */ | ||
import * as apiKey from '../lib/commands/apiKey.js'; | ||
import * as ba from '../lib/commands/ba.js'; | ||
import * as breach from '../lib/commands/breach.js'; | ||
import * as breaches from '../lib/commands/breaches.js'; | ||
import * as dc from '../lib/commands/dc.js'; | ||
import * as pa from '../lib/commands/pa.js'; | ||
import * as pw from '../lib/commands/pw.js'; | ||
import * as search from '../lib/commands/search.js'; | ||
|
||
sourceMapSupport.install(); | ||
|
||
// eslint-disable-next-line no-unused-expressions | ||
yargs | ||
.commandDir(path.join(__dirname, '..', 'lib', 'commands')) | ||
yargs(hideBin(process.argv)) | ||
.command(apiKey) | ||
.command(ba) | ||
.command(breach) | ||
.command(breaches) | ||
.command(dc) | ||
.command(pa) | ||
.command(pw) | ||
.command(search) | ||
.demandCommand() | ||
.recommendCommands() | ||
.strict() | ||
.wrap(Math.min(100, yargs.terminalWidth())) | ||
.wrap(Math.min(100, yargs().terminalWidth())) | ||
.alias('h', 'help') | ||
.alias('v', 'version').argv; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { jest } from '@jest/globals'; | ||
import * as hibp from 'hibp'; | ||
import { | ||
spinnerFns, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { jest } from '@jest/globals'; | ||
import * as hibp from 'hibp'; | ||
import { | ||
spinnerFns, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { jest } from '@jest/globals'; | ||
import * as hibp from 'hibp'; | ||
import { | ||
spinnerFns, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { jest } from '@jest/globals'; | ||
import * as hibp from 'hibp'; | ||
import { | ||
spinnerFns, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { jest } from '@jest/globals'; | ||
import * as hibp from 'hibp'; | ||
import { | ||
spinnerFns, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { jest } from '@jest/globals'; | ||
import * as hibp from 'hibp'; | ||
import { | ||
spinnerFns, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { jest } from '@jest/globals'; | ||
import * as hibp from 'hibp'; | ||
import { | ||
spinnerFns, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './logger'; | ||
export * from './pkg'; | ||
export * from './spinner'; | ||
export * from './translate-api-error'; | ||
export * from './user-agent'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import url from 'url'; | ||
|
||
const dirname = path.dirname(url.fileURLToPath(import.meta.url)); | ||
|
||
export const pkg = JSON.parse( | ||
fs.readFileSync(path.join(dirname, '..', '..', 'package.json'), 'utf8'), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import * as pkg from '../../package.json'; | ||
import { pkg } from './pkg'; | ||
|
||
export const userAgent = `${pkg.name} ${pkg.version}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.