From 5219fc531f0cf670696dab01986453ccc5dec72f Mon Sep 17 00:00:00 2001 From: "K.J. Valencik" Date: Sat, 19 Feb 2022 09:14:37 -0500 Subject: [PATCH] TS fixes from merge --- create-neon/package.json | 2 +- create-neon/src/bin/create-neon.ts | 6 +++--- create-neon/src/shell.ts | 3 ++- create-neon/test/create-neon.ts | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/create-neon/package.json b/create-neon/package.json index 552867ef2..825e4f3a4 100644 --- a/create-neon/package.json +++ b/create-neon/package.json @@ -16,7 +16,7 @@ "dist/data/**/*" ], "scripts": { - "build": "tsc && cp -r data/templates dist/data", + "build": "tsc --skipLibCheck && cp -r data/templates dist/data", "prepublishOnly": "npm run build", "pretest": "npm install && npm run build", "test": "mocha", diff --git a/create-neon/src/bin/create-neon.ts b/create-neon/src/bin/create-neon.ts index 170375544..18a123bf5 100644 --- a/create-neon/src/bin/create-neon.ts +++ b/create-neon/src/bin/create-neon.ts @@ -39,7 +39,7 @@ async function main(name: string) { await fs.rmdir(name); tmpFolderName = await fs.mkdtemp(`${name}-`); - } catch (err) { + } catch (err: any) { await die(`Could not create \`${name}\`: ${err.message}`, tmpFolderName); } @@ -48,7 +48,7 @@ async function main(name: string) { try { pkg = await Package.create(name, tmpFolderName); await fs.mkdir(path.join(tmpFolderName, "src")); - } catch (err) { + } catch (err: any) { await die("Could not create `package.json`: " + err.message, tmpFolderName); } if (pkg) { @@ -63,7 +63,7 @@ async function main(name: string) { try { await fs.rename(tmpFolderName, name); - } catch (err) { + } catch (err: any) { await die(`Could not create \`${name}\`: ${err.message}`, tmpFolderName); } console.log(`✨ Created Neon project \`${name}\`. Happy 🦀 hacking! ✨`); diff --git a/create-neon/src/shell.ts b/create-neon/src/shell.ts index 581a34e79..ec061ea44 100644 --- a/create-neon/src/shell.ts +++ b/create-neon/src/shell.ts @@ -1,6 +1,7 @@ import { spawn } from "child_process"; import { promises as fs } from "fs"; import path from "path"; + /** * Transparently shell out to an executable with a list of arguments. * All stdio is inherited directly from the current process. @@ -38,7 +39,7 @@ export default function shell( if ([description, author, license].includes(undefined)) { reject(Error(`error code: ${code}`)); } - } catch (e) { + } catch (e: any) { reject(e); } } diff --git a/create-neon/test/create-neon.ts b/create-neon/test/create-neon.ts index 6d377b649..0acfa68e6 100644 --- a/create-neon/test/create-neon.ts +++ b/create-neon/test/create-neon.ts @@ -56,7 +56,7 @@ describe("Project creation", () => { "license:": "", "Is this OK?": "", }); - } catch (error) { + } catch (error: any) { assert.fail("create-neon unexpectedly failed: " + error.message); }