Skip to content

Commit

Permalink
update cli command
Browse files Browse the repository at this point in the history
To build a package, run "./kirki build package-name".
For instance:
./kirki build control-base
  • Loading branch information
contactjavas committed Feb 2, 2023
1 parent 1721604 commit a5d370d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions kirki.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
node ./kirki.mjs %1 %2 %3 %4 %5 %6 %7 %8 %9
7 changes: 4 additions & 3 deletions kirki.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <packageName>")
.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) => {
Expand All @@ -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`;

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"global": "ReactDOM"
}
},
"bin": {
"kirki": "./kirki.mjs"
},
"scripts": {
"kirki": "node ./kirki.mjs",
"build": "node ./kirki.mjs build"
Expand Down

0 comments on commit a5d370d

Please sign in to comment.