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

@mdn/bob

v6.0.0

Published

Builder of Bits aka The MDN Web Docs interactive examples, example builder

Downloads

541

Readme

BoB

Builder of Bits aka The MDN Web Docs interactive examples example builder.

Contributing

If you want to contribute to BoB, please follow these steps:

Thank you for your interest in contributing to MDN Web Docs.

NOTE: By contributing to BoB and MDN Web Docs you acknowledge that you have read and agree to our code of conduct.

Source Folder Structure

-editor # All files related to the interactive examples editor
|--> css
|--> js
|--> media # media used only by the editor
|--> tmpl
-live-examples # All example related files and media (only used for testing purposes)
|--> css-examples
|--> fonts # fonts used by the editor and examples
|--> html-examples
|--> js-examples
|--> mathml-examples
|--> media # media used only by the examples

Generated Folder Structure

-docs
|--> css # All editor related CSS
|--> js # All editor related JS
|--> live-examples # All custom CSS and JS for the examples
|--> media # All media and fonts for the examples
|--> pages # All generated interactive example pages
|----> css # All CSS examples
|----> js # All JS examples
|----> tabbed # All examples using the tabbed UI
|----> wat # WebAssembly examples
|----> mathml # MathML examples
|----> webapi-tabbed # Web API examples (not currently used in production)

Testing Bob without the interactive examples repository

As mentioned above, this repository contains a couple of representative examples that you can use to test Bob. For most use cases, this should be enough and allow you to test your changes without installing BoB locally and integrating it with the interactive examples repository.

To test your changes, run:

npm start

You should see output similar to the following:

MDN-BOB: Cleaning or creating ./docs/....
MDN-BOB: Copying static assets....
MDN-BOB: Compiling editor JavaScript....
MDN-BOB:  ../editor/js/editable-css-bundle.js written to disk
MDN-BOB:  ../editor/js/editable-js-bundle.js written to disk
MDN-BOB:  ../editor/js/editable-wat-bundle.js written to disk
MDN-BOB:  ../editor/js/editor-bundle.js written to disk
MDN-BOB: Pages built successfully

This will build the local examples and startup a local server serving the examples. Navigate to localhost:4444 and open one of the examples to test your changes.

Testing Bob as part of interactive examples

When working on changes to BoB, you might need to test against more examples than those that are a part of this repository. In those cases, you will need to run a local version of Bob inside the interactive-examples repo. Use the following command from the root of your local copy of the interactive-examples repo:

npx install-local ~/path/to/bob && node node_modules/.bin/mdn-bob

Stuck? Ask for help.

If you get stuck while working on BoB, there are a couple of ways to get help.

  • Add a comment to the issue you are working on and tag the @mdn/code-dev team.
  • Open a discussion in the platform category.
  • Connect with the team and the rest of the community on Matrix.