npm package: @ou-imdt/create
Description: Command line tool to create team boilerplate.
Author: The Open University
Latest version: 3.0.5

# Create

[![npm version](https://badge.fury.io/js/@ou-imdt%2Fcreate.svg)](https://badge.fury.io/js/@ou-imdt%2Fcreate)

## Introduction

Create is a command line interface tool that assists in the creation of new widgets intended for distribution to the VLE.

The intention of the tool is to automate the creation of boilerplate code required by the VLE and provide a streamlined, modern, consistent and efficient development experience.

For the detailed boilerplate features, check the [boilerplate README file](./boilerplate/README.md).

## Features

- Creates a new widget with the boilerplate code, with two optional templates (Vanilla JS or VUE).
- Populates the README file, index.html and package.json with dynamic templating.
- Checks Node.js version and notifies if Long Term Support (LTS) version is not used.
- History to maintain the last input data like author `email`.


> Compatibility Note: Requires [Node.js LTS version](https://nodejs.org/en/download/). 

## Installation

```sh
npm install -g @ou-imdt/create 
```

### Update to the latest version

```sh
npm update -g @ou-imdt/create
```

## Usage

Run the `create` using:

```sh
create
```

By default, you'll be prompted for inputs to generate a boilerplate:

```sh
Template? (Vanilla Javascript/VUE.js)
Widget name?
Widget description?
Widget developer name? **
Widget developer email? **
Install deps? (yes/no)
```

You can also provide non-interactive flags to skip prompts:

- --type, -t: Template type. Accepted values: vue, vanilla (case-insensitive).
- --name, -n: Widget/App name.
- --desc, -d: Description.
- --install, -i: Whether to install dependencies. Accepted: yes/no, y/n, true/false, 1/0.

Examples:

Non-interactive (all flags):

```sh
create --type vue --name app_name --desc "App description" --install yes
create -t vanilla -n widget-hello -d "Simple widget" -i no
```

Partial (prompts for what’s missing):

```sh
create --type vue --name app_name            # prompts for description and install
create --name app_name -i yes                # prompts for type and description
create --desc "My app" --install no         # prompts for type and name
```

Interactive (no flags):

```sh
create
```

** These will be fetched from git config, if they do not exist you will be prompted to enter them.


### Commands

```sh
help  Prints help info
```

### Options

```sh
-t, --type      Template type (vue | vanilla)
-n, --name      Widget/App name
-d, --desc      Description
-i, --install   Whether to install dependencies (yes/no)
-c, --clear     Clear the console Default: true
-v, --version   Print CLI version Default: false
```

## Changelog

❯ [Read the changelog here](./changelog.md)

## Issue reporting

- Use the issue tracker.
- Provide a clear and descriptive title.
- Describe the steps to reproduce the issue (for bugs).
- Explain the expected and actual behavior (for bugs).
- Describe why the feature is needed (for feature requests).

## Licence

This project is licensed under the MIT License - see the [LICENSE](./LICENCE) for details.

## Contributing

See [contributing](./contributing.md) for more details.

## Contact

Addison, Mustafa