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

statamic-camel

v1.0.0-beta.17

Published

A Gulp setup for Statamic development.

Downloads

40

Readme

Camel

Camel aids Statamic v2 development with a one-line Gulpfile.

Installation

  1. npm i -D statamic-camel
  2. Create your Gulpfile by either:
  • Using the helper script automatically run after installing or
  • Create gulpfile.js in your project root with this line: require('statamic-camel');.
    More info.

You shouldn't have to configure much (if anything) for Camel, because it reads as many existing settings as possible, like your Statamic settings and environment variables.

For example, Camel looks up locales:en:url in site/settings/system.yaml to configure Browsersync's proxy setting.

Most-used tasks

Compile Sass and JavaScript (including .vue files)

gulp

Watch for changes, reload, and all that good stuff Browsersync does

gulp watch

Basically runs gulp when files change.

Compile Sass

gulp sass

Compile JavaScript

gulp js

:sparkles: Moar tasks :sparkles:

Configuration

Take a look at Camel's configuration with gulp get:config. Here's an overview of the structure and how it cascades. Unnumbered items don't affect other unnumbered items, but higher-numbered items override their lower-numbered siblings.

  • Camel
    1. Default
    2. Project
    3. User
  • Some environment settings used in deployments
  • Statamic
  • Tasks
    1. Default
    2. Project
  • Shortcuts

Task configs can access settings from Camel, environments, and Statamic using Statamic-like variables, e.g., {{ statamic:theming:theme }} or {env:SOME_ENV_VAR}.

So, if you have a default locale other than en, you can easily override the default proxy Camel sets for Browsersync with something like this in camel/tasks/browserSync.yaml:

proxy: '{{ statamic.system.locales.kr.url }}'

:information_source: You need to wrap the value in quotes for Camel to properly parse the variable.

Preferences

This may not be 100% true anymore. If you need this feature, :mag:/:pencil: the FR.

Use camel/preferences.yaml to override Camel and project-level settings. This is great for stubborn people whose setup is nothing like that of the rest of their team.

:warning: camel/preferences.yaml should be gitignored so you and your teammates don't wage war :boom: over annoying merge conflicts and whatnot.

API

Docs coming eventually, probably, maybe. ¯\_(ツ)_/¯

Other tasks

Display the config

gulp get:config

This shows the entire Camel config in a table in the terminal for debugging purposes.

Style guide

gulp sg

Basically the same as gulp, but opens up the URL /style-guide and compiles style-guide.js from your theme folder. (This works great with :evergreen_tree: :grinning: :evergreen_tree: :grinning: :evergreen_tree: Happy Little Trees.)

gulp sg:watch

Guess.

Pull remote data to local environment

This plays really well with Fawn, our opinionated, base Statamic installation. By default, Fawn doesn't track filesystems other than themes in git. Camel simplifies keeping all that data in sync.

gulp data:pull

You can also specify an environment to pull from like this (replace stage with the environment name):

gulp data:pull --env stage

Oh you fancy, huh?

This is for all you ES6 Babylonians out there.

require('statamic-camel');

Gross, amirite?

How's about instead we do this?

.babelrc

{
  "presets": ["es2015"],
  "plugins": ["transform-runtime"]
}

gulpfile.babel.js

import gulp, {config} from 'statamic-camel';

gulp.task('hey', () => {
  console.log('Herro?');
});