kira-kit 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kira-kit",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -10,7 +10,7 @@
10
10
  "kira-kit": "bin/kira-kit.js"
11
11
  },
12
12
  "scripts": {
13
- "build": "esbuild src/index.ts --bundle --outfile=bin/kira-kit.js --platform=node --format=esm --target=node22 --external:node:*",
13
+ "build": "esbuild src/index.ts --bundle --outfile=bin/kira-kit.js",
14
14
  "dev": "bun run build --watch",
15
15
  "start": "tsx src/index.ts",
16
16
  "typecheck": "tsc --noEmit",
@@ -1,5 +1,6 @@
1
1
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
2
- import { join } from "path";
2
+ import inquirer from "inquirer";
3
+ import { join, dirname } from "path";
3
4
  import { welcome, info, success, warning, dim } from "../lib/logger";
4
5
  import { selectBaseColor } from "../prompts/base-color";
5
6
  import { selectPrimaryColor } from "../prompts/primary-color";
@@ -36,7 +37,6 @@ export async function init(options: InitOptions): Promise<void> {
36
37
  const existingConfig = readConfig(cwd);
37
38
  if (existingConfig) {
38
39
  warning("Kira Kit is already initialized in this project.");
39
- const inquirer = await import("inquirer");
40
40
  const { confirm } = await inquirer.prompt([
41
41
  {
42
42
  type: "confirm",
@@ -101,6 +101,10 @@ export async function init(options: InitOptions): Promise<void> {
101
101
  } else {
102
102
  // Create it if it doesn't exist
103
103
  const cssContent = generateCss(colorToUse);
104
+ const cssDir = dirname(cssFilePath);
105
+ if (!existsSync(cssDir)) {
106
+ mkdirSync(cssDir, { recursive: true });
107
+ }
104
108
  writeFileSync(cssFilePath, cssContent, "utf-8");
105
109
  success("Created src/index.css with dynamic palette");
106
110
  }