npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@prismicio/prismic-generator-generator

v4.2.1

Published

Used for generating prismic projects for use with the prismic-cli. It creates a customized [yeoman-generator](https://yeoman.io/authoring/) with some additional methods added by [prismic-yeoman-generator](../prismic-yeoman-generator/README.md).

Downloads

20,533

Readme

Prismic Generator Generator.

Used for generating prismic projects for use with the prismic-cli. It creates a customized yeoman-generator with some additional methods added by prismic-yeoman-generator.

Usage

First install the latest version of the prismic cli npm install -g prismic-cli@alpha then run the create-generator command.

Prompts

Name

Name of the generator, generator-prismic- will be prefixed to the input. This is prefixed so prismic-cli can determine which generators are compatible with the cli.

Language

Both JavaScript and Typescript are supported as languages for writing a generator.

Package manager

Use yarn or npm, yarn tends to work better with mono-repositories, but it's really down to personal preference.

Slicemachine

This adds the file and folder structure for the sm commands.

Folder structure

After prompting the cli will generate a yeoman-generator following file and folder structure.

/generators/app

When run this sub-generator should create a working sample project + prismic. there are three options to do this.

  1. The standard yeoman way for writing generators where the files and folders are kept in app/tempmlates. These files can be interpreted as ejs which allows variables like domain to be passed to te templates. (example: prismic-generator-nextjs)
  2. Download a project from a github repository. This is easier to get started with but less Flexible ini regards to modifying files. (example prismic-generator-vue or prismic-cli/src/generatos/theme)
  3. Reverse engineer an existing generator, a lot of frameworks provided their own generators that can be reverse-engineered to run in yeoman. (example prismic-generator-nuxt)
/generators/slicemachine

This sub-generator installs slicemachine-ui and configures the project to use slicemachine and installs dependacies like slice-zone

/generators/create-slice

As the name suggests this sub-generator is run to add a new slice to the project. Only one file here needs to be modified and that's the templates/library/slice/index.js file. This file will be handed data from the user inputs during the prompts (sliceName) and create a generic slice in the language beiing used TODO: show example for svelt

/generators/storybook

This installs and configures storybook. Storybook does have a cli to handle this, but I've not been able to reverse engineer it to be compatible with yeoman. yeoman's this.spawnCommand might be te easiest way to install storybook, but this won't work until after the files have been written out so try and put it in the end part of the yeoman life cycle. Or run it and find what modifications where done and emulate those.

Running the generator locally.

From the root of the generator run npm link this will allow te generator to be discovered by the prismic new and prismic sm commands.