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

@on-sight/dev-tools

v1.1.9

Published

on/Sight dev folder theme tools, utilities and helpful functions

Downloads

10

Readme

@on-sight/dev-tools

Table of Contents

What is this?

This package is a source of truth for many of the repeatedly used utilities, plugins, and features that o/S uses across it's projects. dev-tools intends to organize a large amount of the scaffolding included within each new theme.

Who is this for?

This package is built for Shopify theme developers that want to use a smart JS setup for building and compiling code. This package is very opinionated and will not do anything outside of the Shopify ecosystem. You will still need a JS folder system that uses webpack to make anything run. This package is not meant to be stand-alone.

Getting Started

Setting up the dev-tools is as easy as 1, 2, 3, 4, 5, 6, 7...

  1. Install the @on-sight/dev-tools package in your project:
npm install @on-sight/dev-tools
  1. Import engine into your main JS entry point:
import engine from '@on-sight/dev-tools'
  1. Call the engine function and pass in your preferred configurations:
engine({...config})

Package Features

Dev Engine

↑ Jump back to Package Features list

Get yer engine started 🚗. Hassle free set-up. The on/Sight Dev Engine is built to take in a configuration object and sets up a variety of runner tools for you. The engine function is built for flexibilty, scale, and smart configurations.

Smart, Dynamic File Routing

↑ Jump back to Package Features list

Use data attributes on your HTML to automatically watch, import, and run your JS files. You can immediately hook up an HTML element by using one of the two specified categories:

  • [data-utility]
  • [data-component]

The JS file will run with the specified element being passed in as the wrapper You need to attach a specific file path as the attribute value [data]

Read about how to use the file router

Userback Widget Initializer

↑ Jump back to Package Features list

There's no more need for a snippets/userback.liquid file in your project, with the power of JavaScript you can simply pass in your Userback token and watch your troubles melt away 🫠

Basic Usage

engine({
  userback: {
    // Pass in your real (project-specific) access token here
    accessToken: 'totallyRealAccessTokenExample'
  }
})

Additional Settings

The userback key currently has no additional settings. If you have an idea for one to add, please read through the Contribution Guidelines and start a conversation in Discord!

Barba Transitions

↑ Jump back to Package Features list

Default Configurations

↑ Jump back to Package Features list

JS class object, class prefixing, tailwind breakpoints, and more!

jQuery Plugins

↑ Jump back to Package Features list

watchFor, isInViewport, onClassChange, onDraglessClick, and more!

Read more about the available plugins here

Utility Functions

↑ Jump back to Package Features list

Use our amazing utility functions throughout your JS

Read more about the available utility functions here

Examples and Usage

Getting Started: Importing

Back to top

  • import engine from '@on-sight/dev-tools'
  • import defaultEngineConfig from '@on-sight/dev-tools/settings'
  • import { formatMoney } from '@on-sight/dev-tools/utils'

File Router Usage

Lorem ipsum dolar sit amet

  <button
    data-utility="link-to"
    data-link="/blog/your-url"
  >
    Click me
  </button>

You can also pass multiple file paths by comma separating them:

<button
  data-utility="link-to,inline-toggle"
  data-link="/blog/your-url"
  data-toggle="#some-query"
>
  Click me
</button>

File paths can also include a subfolder:

<button data-utility="button/atc">
  Click me
</button>

Default Settings

Overview of what settings is and how it gets used by the engine.

Dev Engine Settings

File Router Settings

The fileRouter key currently has one customizable setting. You can customize watchForSelectors by supplying an array of objects with keys path, selector, and fileName.

Please be careful when customizing this as it holds a lot of power in the engine setup. Below is the default config object for watchForSelectors.

watchForSelectors: [
  { path: 'utilities', selector: '[data-utility]' },
  { path: 'components', selector: '[data-component]' },
  { path: 'utilities', selector: '[class*="reveal"]', fileName: 'reveal' },
]

Userback Settings

Barba Settings

Plugins Settings

Class Settings

Tailwind Settings

Debug Settings

Additional Settings

If you have an idea for one to add, please read through the Contribution Guidelines and start a conversation in Discord!

Contribution Guidelines