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

@swissquote/crafty

v1.27.0

Published

`crafty` is the core package of Crafty, it gives the foundations to load presets and execute the tasks and commands created by them.

Downloads

381

Readme

Description

crafty is the core package of Crafty, it gives the foundations to load presets and execute the tasks and commands created by them.

Crafty comes with three default commands, reads one configuration file and loads presets. All the rest is handled by presets.

The philosophy

Crafty's philosophy is that there are great build and automation tools out there, we don't want to reinvent them.

Gulp is awesome to create tasks and streams of work, Webpack is great at creating bundles, PostCSS and its plugin ecosystem is big. But what plugins and loaders should we use for our needs ?

Crafty's philosophy is that if you wish to use Gulp and Webpack together, it should be easy. If you want to use TypeScript instead of Babel, it should be a single configuration line change.

The default configuration should allow you to get started in a couple of minutes, but you should be able to fine-tune the configuration to your needs.

Another aspect is that configuring your build process once is one thing, keeping it up-to-date is more complicated. Does a new major version of PostCSS work with my existing plugins ? Does this minor update introduce a breaking change by mistake ? Crafty takes care of that heavy lifting and helps you keep your package.json small.

What's inside

Bundles

In Crafty, a bundle is a piece of configuration that represents one or more source files and one destination file. (In some cases, more than one destination file.)

Each bundle has to be treated by a runner.

Runners

A runner's purpose is to take a bundle and turn it into a task that will then take your files and compile them.

Each runner can be augmented with presets.

Presets

Presets are a way to extend Crafty's capabilities with new tasks, commands, runners and configuration.

Each preset can use any number of extension points (functions) that will be executed by crafty or other presets.

We have an extension point that can override the configuration, an extension point to add Babel plugins (provided by the Babel preset) and more.

Read more about the anatomy of a preset

Existing runners and presets

  • crafty-runner-webpack Use this runner to bundle your code with Webpack.
  • crafty-runner-gulp Use this runner to be able to create Gulp tasks in your projects.
  • crafty-preset-babel EcmaScript 2015+ support with Babel and ESLint with our linting rules.
  • crafty-preset-postcss Compile your CSS using PostCSS, works with Webpack and Gulp.
  • crafty-preset-typescript This preset provides TypeScript support and configures ESLint with our linting rules.
  • crafty-preset-images This preset compresses your SVG/PNG/JPG/GIF files.
  • crafty-preset-images-simple If you are behind a corporate proxy, this preset will copy images without compressing them.
  • crafty-preset-maven This preset overrides the destination to move your compiled assets to the right directory in target of your Maven project.
  • crafty-preset-react A preset that provides default configuration when using React in a project. JSX Compilation is handled by the crafty-preset-babel already (Not Ready)
  • crafty-preset-jest This preset will add Jest to the crafty test command, works with Babel and TypeScript.