From 794ae46a256be1cfb8124d86c054bf8f8b12dfff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ari=20Perkki=C3=B6?= Date: Mon, 9 Sep 2024 11:56:01 +0300 Subject: [PATCH] chore: windows local development fix (#320) --- packages/create-tutorial/package.json | 3 ++- packages/create-tutorial/scripts/build.js | 5 +++++ pnpm-lock.yaml | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 packages/create-tutorial/scripts/build.js diff --git a/packages/create-tutorial/package.json b/packages/create-tutorial/package.json index cdb39ab7..2063cb6e 100644 --- a/packages/create-tutorial/package.json +++ b/packages/create-tutorial/package.json @@ -16,7 +16,7 @@ "create-tutorial": "./dist/index.js" }, "scripts": { - "build": "rm -rf dist && tsc -b", + "build": "node ./scripts/build.js", "prepublishOnly": "pnpm run build" }, "files": [ @@ -27,6 +27,7 @@ }, "devDependencies": { "@types/node": "^20.14.6", + "execa": "^9.2.0", "typescript": "^5.4.5" } } diff --git a/packages/create-tutorial/scripts/build.js b/packages/create-tutorial/scripts/build.js new file mode 100644 index 00000000..bf4eba5a --- /dev/null +++ b/packages/create-tutorial/scripts/build.js @@ -0,0 +1,5 @@ +import { rm } from 'node:fs/promises'; +import { execa } from 'execa'; + +await rm('dist', { recursive: true, force: true }); +await execa('tsc', ['-b'], { stdio: 'inherit', preferLocal: true }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f41856e7..42e24c61 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -470,6 +470,9 @@ importers: '@types/node': specifier: ^20.14.6 version: 20.14.11 + execa: + specifier: ^9.2.0 + version: 9.2.0 typescript: specifier: ^5.4.5 version: 5.5.3