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

gatsby-shopify-starter

v1.0.3

Published

A CLI for creating projects using the Gatsby-Shopify-Starter Boilerplate.

Downloads

5

Readme

gatsby-shopify-starter

A boilerplate for creating custom Shopify storefronts for using GatsbyJs & Apollo

disclaimer: This package is still a work in progress. For suggestions or questions please hit me up on Github

This starter package is built to get your custom Shopify storefront up and running with minimal configuration. This starter is meant to be used with the Shopify Storefront API.

Built with the following technologies:

Installation

First, install the gatsby-shopify-starter cli by running

npm i gatsby-shopify-starter -g

for npm and

yarn add gatsby-shopify-starter -g

if you prefer yarn.

To create your Gatsby Shopify repo navigate to the appropriate directory in your terminal and run the following:

gatsby-shopify-create <repo name>

note: you can also use gscreate <repo name> for a shorter command.

And thats it! Your custom Shopify site is ready to go!

Getting Started

In order to connect your app to your shopify store you need to add three variables to an env.development file.

NODE_PATH=./src //for resolving import paths.

GATSBY_SHOPIFY_STOREFRONT_NAME=<Your Storefront Name>
GATSBY_SHOPIFY_TOKEN=<Your Storefont Access Token>

Next you will need to configure your site settings in the settings.json file inside the ./src folder.

  • These settings will be used to specify the site title, main site url, description etc.
  • If you would like to modify the site titles and descriptions page by page you can do so using the <SEO> component and adding an seo section into your page.md file. For example:

Add an seo section to about.md.

templateKey: about

seo:
title: About Us
description: About our store and the awesome people behind the scenes.

...

Pass the seo data to the <SEO> component in your about page template. (templates > about > index.js).

import React, { Fragment } from 'react'
import AboutPage from './AboutPage'
import SEO from 'components/SEO'

export const AboutPageTemplate = ({ seo, info }) =>  return (
  <Fragment>
    <SEO title={seo.title} description={seo.description} />
    <AboutPage pageInfo={info} />
  </Fragment>
)

Test Your Connection

To test if your store connection is working use the <Products> component to query for all products in your store. The response should return an object containing the product data for all products in your Shopify Store.

import React, { Fragment } from "react";
import Products from "components/Products";

export default () => (
  <Products>
    {({ products }) => <Fragment>{console.log(products)}</Fragment>}
  </Products>
);