From a5d370df8fe3aeb4e743126f9d731f6036a987b0 Mon Sep 17 00:00:00 2001 From: Bagus <25834188+contactjavas@users.noreply.github.com> Date: Thu, 2 Feb 2023 11:51:49 +0700 Subject: [PATCH] update cli command To build a package, run "./kirki build package-name". For instance: ./kirki build control-base --- kirki.bat | 2 ++ kirki.mjs | 7 ++++--- package.json | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 kirki.bat diff --git a/kirki.bat b/kirki.bat new file mode 100644 index 000000000..e97c8f442 --- /dev/null +++ b/kirki.bat @@ -0,0 +1,2 @@ +@echo off +node ./kirki.mjs %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/kirki.mjs b/kirki.mjs index d4412f658..aa854126d 100644 --- a/kirki.mjs +++ b/kirki.mjs @@ -95,13 +95,14 @@ const packagePaths = { }; const program = sade("kirki"); +const parcelBinPath = "node_modules/.bin/parcel"; -program.version("1.0.0"); +program.version("4.0.24"); program .command("build ") .describe("Build a package by package name") - .option("-d, --debug", "Output as unminified code for debugging purposes") + .option("-d, --debug", "Build as unminified code for debugging purpose") .example("build control-base") .example("build control-base --debug") .action(async (packageName, opts) => { @@ -123,7 +124,7 @@ program sourcePaths = sourcePaths.trim(); // Build the command along with the opts. - command += `parcel build ${sourcePaths} ${ + command += `"${parcelBinPath}" build ${sourcePaths} ${ opts.d ? "--no-optimize" : "" } --dist-dir ${packagePaths[packageName].path}/dist`; diff --git a/package.json b/package.json index e3eceff89..0ca810e1a 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,9 @@ "global": "ReactDOM" } }, + "bin": { + "kirki": "./kirki.mjs" + }, "scripts": { "kirki": "node ./kirki.mjs", "build": "node ./kirki.mjs build"