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

generator-z-frontend

v2.0.4

Published

A Yeoman Generator to generate a basic frontend dir structure and boilerplate code.

Downloads

42

Readme

Generator-Z-Frontend

Project Status npm version

Installation and Usage

run npm install generator-z-frontend -g

After that, you can run yo z-frontend from a project to start the generator.

Description

This is a heavily opinionated frontend generator, tailored to my needs.

I mostly use it to complement the way I work with the Symfony Framework, but in theory, it should work with any framework.

As such, it may or may not work for you, but I'd be glad to hear out advices or discuss PRs / feature-requests. :)

The workflow and rules described shortly are havily influenced by my personal experiences working on several projects over the years, and also by OOCSS methodologys and articles.

Basic workflow

For the generator to work properly, a workflow must be adapted.

It assumes the following:

  • The vendors, images and watch tasks are only ever run on the developer's machines.

    The results of the vendors and images tasks can be tracked by a vcs even if there are more developers involved on the frontend.

    So whenever new images, or something were added to the vendors, these tasks then need to be run manually.

  • The styles and scripts tasks are being run on every deployment.

    The output of these tasks depend on the environment (prod or dev) they are in. (ex: sourcemap generation) Also: if more than one frontend developer is involved in the project, it's very easy to introduce conflicts. However, by not tracking it by the vcs, and rebuilding the results on every deployment, it resolves these possible issues.

Rules

These rules are about the sass files which will make your life easier on the long run. :)

Details about a particular file's role can be found in comments in that file.

Classname naming conventions

Presentational classes and javascript "hooks" must be separated.

  • Components must be prefixed with c-,
  • Javascript hooks must be prefixed with js-.
  • Every file, that is @import-ed in the main scss files (and not mentioned above), must be prefixed with an underscore.

The styles/overwrites/ folder

In this folder only 3rd party overwrites can be placed.

Examples may include: Foundation / Bootstrap, jQuery UI etc.

The styles/includes/ folder

In this folder, only mixins and functions can be placed. Every mixin and function must have a separate file, and the filename must be the mixin's / function's name, prefixed with an underscore, having the following syllables separated by a dash. Ex.: _my-mixin.scss, which contains the my-mixin mixin.

The styles/components/ folder

  • Components must only be imported to the main scss files. (Ex.: app.scss)
  • File naming convention: "c-a-component".
  • Classnames are prefered to tags as the rules' selectors. If the component is small enough however (like a btn), and it is certain, that other components won't ever be embedded in it, then it can use tag-selectors too. (Ex.: "h1", "a" etc.) This is something that needs to be discussed by the team working on the project. For a true OOCSS workflow, tag selectors must be prohibited.
  • Colors must be collected to variables and stored in the config/_global.scss file.

The styles/config/global.scss file

Color variables and global configurations must be placed here. Follow the naming conventions presented there strictly.

License

MIT