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

snowpack-mdx-chakra

v0.1.0

Published

> ✨ Bootstrapped with Create Snowpack App (CSA).

Downloads

2

Readme

snowpack-mdx-chakra

✨ Bootstrapped with Create Snowpack App (CSA).

This is a snowpack template project setup with MDX Chakra-ui and React Router v6. Its quite opinionated, but in a good way.

Install

Run the following command, replacing my-new-app with the name of your new app.

npx create-snowpack-app my-new-app --template snowpack-mdx-chakra --use-yarn

Project structure

Your pages live inside the pages directory, they are just mdx files. Your components live inside (you guessed it) a components directory. The routing is handle by React Router v6, which has some nice new additions. An mdx-layout component is created and waiting to be used, if at all, inside the components folder. If used, this will wrap all the pages in the pages folder. So if you have a global layout you can crate that there.

Routing

Inside the components folder is the mdx-routes file. This handles the navigation of your app, if you have more than one page that is. Its usage is very simple. You create a new mdx file under pages then in the mdx-routes file you add your new pages route to the MDXRoutes component. You then add a link to your new page in the Nav component in the same file.

Chakra-ui

Chakra-ui has awesome defaults which put accessibility first. The template comes with a default theme initialized but this can be changed in the theme file which lives at the projects root. You are free to import another theme from chakra or invent your own.

Components

Inside the index.jsx file located in the src folder you will see that Chakra components are mapped to markdown elements, meaning that you dont need to import anything into the mdx files, just use the elements and write markdown as you normally would. If you create any custom components you can place them inside the component object and they will be available in the mdx file. Much like the emoji component the template ships with.


Available Scripts

npm start

Runs the app in the development mode. Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

npm run build

Builds a static copy of your site to the build/ folder. Your app is ready to be deployed!

For the best production performance: Add a build bundler plugin like "@snowpack/plugin-webpack" to your snowpack.config.js config file.

npm test

Launches the application test runner. Run with the --watch flag (npm test -- --watch) to run in interactive watch mode.