
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
generator-keystone-ts
Advanced tools
A Yeoman generator for KeystoneJS, the model-driven CMS for Node.js built on Express, Mongoose, and MongoDB.
yo keystone-ts
will scaffold a new KeystoneJS project for you, and offer to set up blog, gallery, and enquiry (contact form) models + views.
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.
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 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:
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:
npm start
The generator will install the latest Keystone v4 release.
When you've got your new project, check out the Keystone 4 Documentation to learn more about how to get started with KeystoneJS.
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?" of the Intro to npm by Isaac Schlueter.
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
When running 'yo keystone', you'll run into this problem if you don't have Yeoman installed. Yeoman is a generator ecosystem.
One Line Install
npm install -g yo
For more information, see the Yeoman Getting Started Page.
Download and install the node.js binaries for your platform from the Node.js download page.
If you're on a Mac, the easiest way to install MongoDB is to use the homebrew package manager for OS X. 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.
MIT License. Copyright (c) 2019 Gautam Singh.
FAQs
A KeystoneJS TypeScript Project Generator for Yeoman
We found that generator-keystone-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.