Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
dependencies: bump (minor)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesec committed Nov 5, 2021
1 parent 6c8224b commit f5998de
Show file tree
Hide file tree
Showing 6 changed files with 953 additions and 1,048 deletions.
2 changes: 1 addition & 1 deletion lib/detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ export function detect(body: string, visitor: VisitorFunction) {
try {
json = parse(body);
} catch (error) {
log.warn(`Babel parse has failed: ${error.message}`);
log.warn(`Babel parse has failed: ${(error as Error).message}`);
}

if (!json) {
Expand Down
13 changes: 9 additions & 4 deletions lib/follow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ export function follow(x: string, opts: FollowOptions) {
try {
stat = fs.statSync(file);
} catch (e) {
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR'))
const ex = e as NodeJS.ErrnoException;

if (ex && (ex.code === 'ENOENT' || ex.code === 'ENOTDIR'))
return false;
throw e;

throw ex;
}

return stat.isFile() || stat.isFIFO();
Expand All @@ -81,11 +84,13 @@ export function follow(x: string, opts: FollowOptions) {
try {
stat = fs.statSync(directory);
} catch (e) {
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {
const ex = e as NodeJS.ErrnoException;

if (ex && (ex.code === 'ENOENT' || ex.code === 'ENOTDIR')) {
return false;
}

throw e;
throw ex;
}

return stat.isDirectory();
Expand Down
7 changes: 5 additions & 2 deletions lib/producer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export default function producer({
target,
symLinks,
doCompress,
nativeBuild
nativeBuild,
}: ProducerOptions) {
return new Promise<void>((resolve, reject) => {
if (!Buffer.alloc) {
Expand Down Expand Up @@ -461,7 +461,10 @@ export default function producer({
);
}
} catch (err) {
log.debug(`prebuild-install failed[${stripe.file}]:`, err);
log.debug(
`prebuild-install failed[${stripe.file}]:`,
(err as Error).message
);
}
}
return cb(
Expand Down
23 changes: 13 additions & 10 deletions lib/walker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ async function stepRead(record: FileRecord) {
try {
body = await fs.readFile(record.file);
} catch (error) {
log.error(`Cannot read file, ${error.code}`, record.file);
throw wasReported(error);
const exception = error as NodeJS.ErrnoException;
log.error(`Cannot read file, ${exception.code}`, record.file);
throw wasReported(exception.message);
}

record.body = body;
Expand Down Expand Up @@ -295,8 +296,8 @@ function stepDetect(
return true; // can i go inside?
});
} catch (error) {
log.error(error.message, record.file);
throw wasReported(error);
log.error((error as Error).message, record.file);
throw wasReported((error as Error).message);
}
}

Expand Down Expand Up @@ -712,9 +713,10 @@ class Walker {
stat = await fs.stat(file);
} catch (error) {
const { toplevel } = marker;
const debug = !toplevel && error.code === 'ENOENT';
const exception = error as NodeJS.ErrnoException;
const debug = !toplevel && exception.code === 'ENOENT';
const level = debug ? 'debug' : 'warn';
log[level](`Cannot stat, ${error.code}`, [
log[level](`Cannot stat, ${exception.code}`, [
file,
`The file was required from '${record.file}'`,
]);
Expand Down Expand Up @@ -749,7 +751,7 @@ class Walker {
};

let newFile = '';
let failure;
let failure: Error | undefined;

const basedir = path.dirname(record.file);
try {
Expand All @@ -764,7 +766,7 @@ class Walker {
packageFilter: catchPackageFilter,
});
} catch (error) {
failure = error;
failure = error as Error;
}

if (failure) {
Expand Down Expand Up @@ -970,8 +972,9 @@ class Walker {
};
record[STORE_STAT] = value;
} catch (error) {
log.error(`Cannot stat, ${error.code}`, record.file);
throw wasReported(error);
const exception = error as NodeJS.ErrnoException;
log.error(`Cannot stat, ${exception.code}`, record.file);
throw wasReported(exception.message);
}

if (path.dirname(record.file) !== record.file) {
Expand Down
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,45 @@
"singleQuote": true
},
"dependencies": {
"@babel/parser": "7.13.13",
"@babel/types": "7.13.12",
"chalk": "^4.1.0",
"@babel/parser": "7.16.2",
"@babel/types": "7.16.0",
"chalk": "^4.1.2",
"escodegen": "^2.0.0",
"fs-extra": "^9.1.0",
"globby": "^11.0.3",
"globby": "^11.0.4",
"into-stream": "^6.0.0",
"minimist": "^1.2.5",
"multistream": "^4.1.0",
"pkg-fetch": "3.2.4",
"prebuild-install": "6.0.1",
"prebuild-install": "6.1.4",
"progress": "^2.0.3",
"resolve": "^1.20.0",
"stream-meter": "^1.0.4",
"tslib": "2.1.0"
"tslib": "2.3.1"
},
"devDependencies": {
"@babel/core": "7.13.10",
"@types/escodegen": "0.0.6",
"@types/fs-extra": "9.0.8",
"@types/minimist": "1.2.1",
"@babel/core": "7.16.0",
"@types/escodegen": "0.0.7",
"@types/fs-extra": "9.0.13",
"@types/minimist": "1.2.2",
"@types/multistream": "2.1.1",
"@types/node": "14.14.35",
"@types/resolve": "1.20.0",
"@types/node": "14.17.32",
"@types/resolve": "1.20.1",
"@types/stream-meter": "0.0.22",
"@typescript-eslint/eslint-plugin": "4.26.0",
"@typescript-eslint/parser": "4.26.0",
"eslint": "7.27.0",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"eslint": "7.32.0",
"eslint-config-airbnb-base": "14.2.1",
"eslint-config-airbnb-typescript": "12.3.1",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-import": "2.25.2",
"json-stable-stringify": "^1.0.1",
"lint-staged": ">=10",
"lint-staged": "^10.5.4",
"mkdirp": "^1.0.4",
"prettier": "2.3.0",
"prettier": "2.4.1",
"rimraf": "^3.0.2",
"simple-git-hooks": ">=2.2.0",
"typescript": "4.3.2"
"simple-git-hooks": ">=2.7.0",
"typescript": "4.4.4"
},
"peerDependencies": {
"node-notifier": ">=9.0.1"
Expand Down
Loading

0 comments on commit f5998de

Please sign in to comment.