Skip to content

Commit

Permalink
BREAKING CHANGE: set minimum node version to 14 (#318)
Browse files Browse the repository at this point in the history
- Set minimum node to version 14 since 12 is EOL
- Bump typescript to version 4
  • Loading branch information
styfle authored Oct 17, 2022
1 parent 3c39adf commit 428cc8f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,15 @@
"swig": "^1.4.2",
"tiny-json-http": "^7.1.2",
"twilio": "^3.33.0",
"typescript": "^3.9.6",
"typescript": "^4.8.4",
"uglify-js": "^3.6.0",
"unified": "^10.1.0",
"vm2": "^3.9.11",
"vue": "^2.6.10",
"vue-server-renderer": "^2.6.10",
"when": "^3.7.8"
},
"engines": {
"node": ">=14"
}
}
4 changes: 2 additions & 2 deletions src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export default async function analyze(id: string, code: string, job: Job): Promi
ast = acorn.parse(code, { ecmaVersion: 'latest', allowReturnOutsideFunction: true });
isESM = false;
}
catch (e) {
catch (e: any) {
const isModule = e && e.message && e.message.includes('sourceType: module');
if (!isModule) {
job.warnings.add(new Error(`Failed to parse ${id} as script:\n${e && e.message}`));
Expand All @@ -281,7 +281,7 @@ export default async function analyze(id: string, code: string, job: Job): Promi
ast = acorn.parse(code, { ecmaVersion: 'latest', sourceType: 'module', allowAwaitOutsideFunction: true });
isESM = true;
}
catch (e) {
catch (e: any) {
job.warnings.add(new Error(`Failed to parse ${id} as module:\n${e && e.message}`));
// Parser errors just skip analysis
return { assets, deps, imports, isESM: false };
Expand Down
10 changes: 5 additions & 5 deletions src/node-file-trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class Job {
this.symlinkCache.set(path, link);
return link;
}
catch (e) {
catch (e: any) {
if (e.code !== 'EINVAL' && e.code !== 'ENOENT' && e.code !== 'UNKNOWN')
throw e;
this.symlinkCache.set(path, null);
Expand Down Expand Up @@ -202,7 +202,7 @@ export class Job {
this.statCache.set(path, stats);
return stats;
}
catch (e) {
catch (e: any) {
if (e.code === 'ENOENT') {
this.statCache.set(path, null);
return null;
Expand All @@ -227,7 +227,7 @@ export class Job {
this.fileCache.set(path, source);
return source;
}
catch (e) {
catch (e: any) {
if (e.code === 'ENOENT' || e.code === 'EISDIR') {
this.fileCache.set(path, null);
return null;
Expand Down Expand Up @@ -358,7 +358,7 @@ export class Job {
try {
var resolved = await this.resolve(dep, path, this, !isESM);
}
catch (e) {
catch (e: any) {
this.warnings.add(new Error(`Failed to resolve dependency ${dep}:\n${e && e.message}`));
return;
}
Expand All @@ -379,7 +379,7 @@ export class Job {
try {
var resolved = await this.resolve(dep, path, this, false);
}
catch (e) {
catch (e: any) {
this.warnings.add(new Error(`Failed to resolve dependency ${dep}:\n${e && e.message}`));
return;
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"noUnusedParameters": true,
"noImplicitThis": true,
"outDir": "out",
"target": "es2017",
"target": "es2020",
"types": ["node"],
"skipLibCheck": true,
"strict": true
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15720,10 +15720,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^3.9.6:
version "3.9.9"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.9.tgz#e69905c54bc0681d0518bd4d587cc6f2d0b1a674"
integrity sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==
typescript@^4.8.4:
version "4.8.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==

uglify-es@^3.3.9:
version "3.3.9"
Expand Down

0 comments on commit 428cc8f

Please sign in to comment.