1.1.0 • Published 6 months ago

@dkshs/pkg-test v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

dkcutter

A command-line utility that creates projects from templates.

license mit NPM version

Overview

DKCutter takes a template provided as a directory structure with template-files. Templates can be located on the file system, such as on a VCS (Git) server like GitHub.

It reads a settings file and interactively prompts the user whether or not to change the settings.

It then takes both and generates an output directory structure from them.

Additionally, the model can provide code (Javascript) to be executed before and after generation (pre-generation and post-generation hooks).

Input

This is a directory structure for a simple dkcutter:

dkcutter-something/
├── template/
│   ├── {{projectSlug}}/    <------ Project template
├── hooks/                  <------ JavaScript to be executed before and after generation
│   ├── preGenProject.js
│   └── postGenProject.js
├── blah.txt                <------ Non-templated files/dirs
│                                   go outside
│
└── dkcutter.json           <------ Prompts & default values

You must have:

  • A dkcutter.json file
  • A template/{{projectSlug}}/ directory, where projectSlug is defined in your dkcutter.json.

Beyond that, you can have whatever files/directories you want.

Output

This is what will be generated locally, in your current directory:

mysomething/    <-------- Value corresponding to what you enter at the
│                          projectSlug prompt
│
└── ...         <-------- Files corresponding to those in your
                          dkcutter's `{{ projectSlug }}/` dir

Getting Started

For Users

The recommended way to use DKCutter as a command line utility is to execute it with pnpm dlx, npx, yarn dlx or bunx.

Use a GitHub template

pnpm dlx dkcutter https://github.com/dkshs/dkcutter-nextjs.git

Use a local template

pnpm dlx dkcutter ./dkcutter-nextjs

Detailed Usage

  • Generate projects from local or remote templates.
  • Customize projects with dkcutter.json prompts.
  • Utilize pre- and post-generate hooks.

Learn More

For Template Creators

  • Utilize unlimited directory nesting.
  • Employ nunjucks for all templating needs.
  • Define template variables easily with dkcutter.json.

Learn More

1.1.0

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago