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

bdd-docs

v2.0.1

Published

We use [`gatsby-source-filesystem`](https://www.gatsbyjs.org/packages/gatsby-source-filesystem/) in `gatsby-config.js` to create `File` nodes from our feature files. They can then be used with [`gatsby-transformer-gherkin`](https://www.gatsbyjs.org/packag

Downloads

8

Readme

How do we generate pages out of feature files

We use gatsby-source-filesystem in gatsby-config.js to create File nodes from our feature files. They can then be used with gatsby-transformer-gherkin to query contents of files with gherkin syntax.

The code for creating feature pages with createPage function lives in gatsby-node.js, and it is using FeaturePage as the template.

To highlight the code we use Prism.js and pass the formatted code directly to the template.

Symlinks

Most of the .feature files in src/sites/marvel3/src/features are symlinked, which means they point to the original files that live in corresponding apps and packages. If you update any of the files in the symlinked folders, they should also update in the original location (and vice versa).

When updating feature files, avoid renaming the symlinked folders (easy to spot, as they have an arrow next to folder name in VS Code) or moving any of the feature files out of them, because it can affect our tests. Having said that, you can create folders within the symlinked folders, update their contents and put feature files in them.

How to create a symlink

Run the following command from the features folder in src/sites/marvel3/src/features:

ln -s ../../../../packages/prototype-viewer/src/features prototype-viewer-features

where the first argument is a path to the folder you want to symlink and the second argument is the name of your symlink.

File metadata

In order for a feature file to be converted into a page, it needs to have # Parent: and # Sidebar Link: comments, which act as the file's metadata. # Parent: is used as the category for the file, and # Sidebar Link: is the name you will see in the sidebar. In the below example, Archiving project and Unarchiving project are pages with an Archive parent.

--- Archive
------ Archiving project
------ Unarchiving project

Note: # Sidebar Link: and # Parent are also used for generating page urls.

Another two pieces of metadata you can use (although they are optional), are # Title: and # Description. They are a great way to provide more context to your feature pages.

BDD metadata VS Code snippet

https://share.getcloudapp.com/qGudWGJ5

You can use VS Code snippet feature to create a snippet for quickly adding metadata to your files (see attached video). To add it, follow the below steps:

  1. Press shift + cmd + p to open the commands menu
  2. Search for 'snippets', you should see something like: Preferences: Configure User Snippets
  3. Once you've selected that option, search for 'feature'. This will allow you to add a snippet for any files with .feature extension
  4. Add the following snippet to the json file
	"Add BDD Meta data": {
		"prefix": "bdd-meta",
		"body": [
			"# Title: ",
			"# Description: ",
			"# Parent: ",
			"# Sidebar Link: "
		],
		"description": "Add BDD meta data"
	}
  1. You should now be able to type bdd-metadata in your feature files to expand the snippet.