diff --git a/.husky/pre-commit b/.husky/pre-commit index 2b3a5f48..9091e9f9 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,8 +1,8 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -yarn doctoc -yarn prettier --write README.md -yarn todos -yarn prettier --write TODO.md -yarn lint-staged +yarn todos && git add TODO.md +yarn prettier --write TODO.md && git add TODO.md +yarn doctoc && git add README.md +yarn prettier --write README.md && git add README.md +yarn lint-staged \ No newline at end of file diff --git a/README.md b/README.md index 856a2a97..4f3b6d8f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # moker [![npm](https://img.shields.io/npm/v/moker)](https://www.npmjs.com/package/moker) -**No more struggles setting up monorepo tooling. Kick-start monorepos and -workspaces fast:** +**No more struggles setting up monorepos. Kick-start monorepos, workspaces and +tooling:** ```bash # initialize a monorepo @@ -9,7 +9,7 @@ yarn dlx moker create my-monorepo cd my-monorepo # install common tools -yarn moker use prettier husky lint-staged github-actions devcontainer +yarn moker use prettier husky lint-staged doctoc semantic-release # create workspaces yarn moker add --template express server @@ -52,8 +52,8 @@ yarn moker add --template cra client - [`todos` _workspace_](#todos-_workspace_) - [`typescript` _workspace_](#typescript-_workspace_) - [Available templates](#available-templates) - - [`common` _monorepo_](#common-_monorepo_) - [`bandersnatch` _workspace_](#bandersnatch-_workspace_) + - [`common` _monorepo_](#common-_monorepo_) - [`cra` _workspace_](#cra-_workspace_) - [`express` _workspace_](#express-_workspace_) - [`lib` _workspace_](#lib-_workspace_) @@ -275,17 +275,17 @@ This plugin sets up [TypeScript](https://www.typescriptlang.org) and adds a # Available templates -## `common` _monorepo_ - -This is the only monorepo template at this point. It simply installs all -available monorepo plugins. - ## `bandersnatch` _workspace_ Scaffolds a simple [bandersnatch](https://github.com/hongaar/bandersnatch) CLI app tool with the [typescript](#typescript-workspace) and [jest](#jest-workspace) plugins. +## `common` _monorepo_ + +This is the only monorepo template at this point. It simply installs all +available monorepo plugins. + ## `cra` _workspace_ Uses [create-react-app](https://create-react-app.dev/) to scaffold a React.js diff --git a/packages/plugins/src/doctoc/doctoc.ts b/packages/plugins/src/doctoc/doctoc.ts index fef2a33d..ef7e1ed4 100644 --- a/packages/plugins/src/doctoc/doctoc.ts +++ b/packages/plugins/src/doctoc/doctoc.ts @@ -12,8 +12,9 @@ import { removePreCommitHookCommand, } from "../husky/husky.js"; -const PRE_COMMIT_HOOK_COMMAND = "yarn doctoc"; -const PRE_COMMIT_HOOK_COMMAND_FORMAT = "yarn prettier --write README.md"; +const PRE_COMMIT_HOOK_COMMAND = "yarn doctoc && git add README.md"; +const PRE_COMMIT_HOOK_COMMAND_FORMAT = + "yarn prettier --write README.md && git add README.md"; async function install({ directory }: PluginArgs) { enqueueInstallDependency({ directory, identifier: "doctoc", dev: true }); diff --git a/packages/plugins/src/todos/todos.ts b/packages/plugins/src/todos/todos.ts index 69075647..5740d0ff 100644 --- a/packages/plugins/src/todos/todos.ts +++ b/packages/plugins/src/todos/todos.ts @@ -12,8 +12,9 @@ import { removePreCommitHookCommand, } from "../husky/husky.js"; -const PRE_COMMIT_HOOK_COMMAND = "yarn todos"; -const PRE_COMMIT_HOOK_COMMAND_FORMAT = "yarn prettier --write TODO.md"; +const PRE_COMMIT_HOOK_COMMAND = "yarn todos && git add TODO.md"; +const PRE_COMMIT_HOOK_COMMAND_FORMAT = + "yarn prettier --write TODO.md && git add TODO.md"; async function install({ directory }: PluginArgs) { enqueueInstallDependency({ directory, identifier: "leasot", dev: true });