diff --git a/CHANGELOG.md b/CHANGELOG.md index 90cb742..ba30aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.4] - 2026-03-10 + +### Added + +- `unoff create` now automatically runs `git init` in the newly created plugin directory if git is available +- README: new **Prerequisites** section documenting required software (Node.js ≄ 18, npm ≄ 9, git) + ## [0.1.3] - 2026-03-06 ### Added @@ -80,6 +87,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 🚧 Sketch plugin template (coming soon) - 🚧 Framer plugin template (coming soon) +[0.1.4]: https://github.com/yelbolt/unoff-cli/compare/v0.1.3...v0.1.4 [0.1.3]: https://github.com/yelbolt/unoff-cli/compare/v0.1.2...v0.1.3 [0.1.2]: https://github.com/yelbolt/unoff-cli/compare/v0.1.1...v0.1.2 [0.1.1]: https://github.com/yelbolt/unoff-cli/compare/v0.1.0...v0.1.1 diff --git a/README.md b/README.md index 217028f..fac8c71 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ A CLI tool to quickly scaffold plugins for Figma, Penpot, Sketch, and Framer with built-in development tools and best practices. +## Prerequisites + +- **Node.js** ≄ 18 +- **npm** ≄ 9 +- **git** — required for `unoff create` (initializes a git repository) and for all `unoff add` commands (workers, skills, specs use git submodules) + ## Installation Install globally: diff --git a/package-lock.json b/package-lock.json index 121352d..d89a8d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@unoff/cli", - "version": "0.1.3", + "version": "0.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@unoff/cli", - "version": "0.1.3", + "version": "0.1.4", "license": "MPL-2.0", "dependencies": { "chalk": "^5.3.0", diff --git a/package.json b/package.json index 979272b..a19c527 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@unoff/cli", - "version": "0.1.3", + "version": "0.1.4", "description": "A CLI tool to create plugins for Figma, Penpot, Sketch, and Framer", "main": "dist/index.js", "type": "module", diff --git a/src/commands/create.ts b/src/commands/create.ts index fde8122..7b33926 100644 --- a/src/commands/create.ts +++ b/src/commands/create.ts @@ -5,6 +5,7 @@ import ora from 'ora' import inquirer from 'inquirer' import Mustache from 'mustache' import { fileURLToPath } from 'url' +import { spawnSync } from 'child_process' const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) @@ -262,7 +263,23 @@ export async function createPlugin(platform: string) { await fs.writeFile(globalConfigPath, configContent, 'utf-8') } - spinner.succeed(chalk.green('Plugin created successfully!')) + // Initialize git repository + const gitCheck = spawnSync('git', ['--version'], { encoding: 'utf-8' }) + if (gitCheck.status === 0) { + const gitInit = spawnSync('git', ['init'], { + cwd: outputDir, + encoding: 'utf-8', + }) + if (gitInit.status === 0) { + spinner.succeed(chalk.green('Plugin created successfully! Git repository initialized.')) + } else { + spinner.succeed(chalk.green('Plugin created successfully!')) + console.warn(chalk.yellow('āš ļø Could not initialize git repository. Run `git init` manually.')) + } + } else { + spinner.succeed(chalk.green('Plugin created successfully!')) + console.warn(chalk.yellow('āš ļø git is not available. Run `git init` manually before using `unoff add`.')) + } console.log(chalk.cyan('\nšŸ“¦ Next steps:\n')) console.log(chalk.white(` cd ${pluginSlug}`))