# generator-keystone-ts

> A KeystoneJS TypeScript Project Generator for Yeoman

Latest version **1.0.0** (published 2019-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install generator-keystone-ts
pnpm add generator-keystone-ts
yarn add generator-keystone-ts
bun add generator-keystone-ts
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-01-19 |
| First published | 2017-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Gautam Singh |
| Maintainers | gautamsi |
| Keywords | yeoman-generator, keystonejs, keystone, express, cms, mongoose, mongodb, mongo, website, site, blog |

## Links

- npm: https://www.npmjs.com/package/generator-keystone-ts
- Repository: https://github.com/gautamsi/generator-keystone-ts
- Issues: https://github.com/gautamsi/generator-keystone-ts/issues
- npm.io page: https://npm.io/package/generator-keystone-ts

## Dependencies (4)

- [colors](https://npm.io/package/colors.md) ^1.3.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [keystone-utils](https://npm.io/package/keystone-utils.md) ^0.4.0
- [yeoman-generator](https://npm.io/package/yeoman-generator.md) ^3.2.0

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-01-19
- 0.1.1 — 2018-05-05
- 0.1.0 — 2017-12-18

## README

# Keystone Generator

A [Yeoman](http://yeoman.io) generator for [KeystoneJS](https://keystonejs.com), the model-driven CMS for Node.js built on [Express](https://expressjs.com/), [Mongoose](https://mongoosejs.com/), and [MongoDB](https://mongodb.com/download).

`yo keystone-ts` will scaffold a new KeystoneJS project for you, and offer to set up blog, gallery, and enquiry (contact form) models + views.


# TypeScript
added by @gautamsi. 
TypeScript support folder structure and npm scripts are inspired by https://github.com/Microsoft/TypeScript-Node-Starter
 
 to build run `npm run build`    
`npm start` will run this in watch mode, not a perfect one, you can build your TypeScript workflow accordingly.


get reference from https://github.com/gautamsi/sydjs-ts which is based on KeyStone 4 nd now with a branch with BootStrap 4.
   

## Getting Started

First up, you'll need Node.js >= 6.0 and MongoDB >= 3.2 installed. If you don't have them, follow the **Dependencies** instructions below.

Create an empty directory for your new KeystoneJS Project, then run the generator:

````
$ mkdir myproject
$ cd myproject
$ npx -p yo -p generator-keystone-ts yo keystone-ts
````

_NOTE: If you see errors, check the [problems](#err-please-try-running-this-command-again-as-rootadministrator) section below._

The generator will ask you a few questions about which features to include, then prompt you for Cloudinary and Mailgun account details.

**These accounts are optional**, but Cloudinary is used to host the images for the blog and gallery templates. You can get a free account for each at:

* [Cloudinary](https://cloudinary.com/users/register/free) - Image serving and management in the cloud
* [Mailgun](https://app.mailgun.com/signup) - Easy email integration

### I want the default Keystone start project

To generate a starter project with all default options selected, run:

```
yo keystone-ts auto
```

This is good for experimenting with Keystone, but will require adjustment to use as an ongoing project.

Most importantly:

* Replace default Cloudinary credentials with your own Cloudinary credentials
* Set up email

### starting keystone

```
npm start
```

### Keystone v4

The generator will install the latest Keystone v4 release.

### What next?

When you've got your new project, check out the [Keystone 4 Documentation](https://keystonejs.com/getting-started/) to learn more about how to get started with KeystoneJS.

## Problems?

### ERR! Please try running this command again as root/Administrator.

When running `npm install -g generator-keystone`, you may get an **EACCES** error asking you to run the command again as root/Administrator. This indicates that there is a permissions issue.

On your development system you can change directory ownership to the current $USER so you do not have to run `sudo` while installing untrusted code:

````
sudo chown -R $USER /usr/local

# Other directories may be required depending on your O/S
sudo chown -R $USER /usr/lib/node_modules/
````

For a production/shared environment you may wish to re-run the `npm` command with the `sudo` prefix:

````
sudo npm install -g generator-keystone
````

For more information, see the ["What, no sudo?"](http://foohack.com/2010/08/intro-to-npm/#what_no_sudo) of the Intro to npm by Isaac Schlueter.

### What do you mean it couldn't find my Database?

By default, KeystoneJS will look for a MongoDB server running on `localhost` on the default port, and connect to it. If you're getting errors related to the MongoDB connection, make sure your MongoDB server is running.

If you haven't installed MongoDB yet, follow the instructions below.

To connect to a server **other** than `localhost`, add a `MONGO_URI` setting to the `.env` file in your Keystone project directory:

````
MONGO_URI=mongodb://your-server/database-name
````
### What do you mean 'yo: command not found'?

When running 'yo keystone', you'll run into this problem if you don't have [Yeoman](http://yeoman.io/) installed. Yeoman is a generator ecosystem.

```
One Line Install
npm install -g yo
```

For more information, see the [Yeoman Getting Started Page](http://yeoman.io/learning/index.html).

## Dependencies

### Install Node.js

Download and install the node.js binaries for your platform from the [Node.js download page](http://nodejs.org/download/).

### Install MongoDB

If you're on a Mac, the easiest way to install MongoDB is to use the [homebrew package manager for OS X](https://brew.sh). To install `brew`, run this in your terminal:

````
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
````

With Homebrew installed, run this in your terminal to download and install MongoDB:

````
brew install mongodb
````

This may generate a warning message

'Warning: You have not agreed to the Xcode license.  Builds will fail! Agree to the license by opening Xcode.app or running: xcodebuild -license.'  If you see this message, run:

````
sudo xcodebuild -license
````

Hit 'enter' if prompted to view and agree to the licenses, navigate to the bottom using the 'space' key, then type 'agree' before attempting the install command again.

For other platforms, see the [MongoDB installation guides](https://docs.mongodb.com/manual/installation/).


## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License). Copyright (c) 2019 Gautam Singh.

---
_Source: https://npm.io/package/generator-keystone-ts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
