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

@sitegeist/conventional

v2.0.0

Published

Frontend toolchain for sitegeist TYPO3 projects

Downloads

193

Readme

@sitegeist/conventional

Bundles sitegeist's frontend toolchain for TYPO3 projects (with and without fluid-components)

Features

  • Enables centralized design tokens in a json/json5 file which can be used in sass files, javascript as well as TYPO3 and fluid components
  • Easy imports of multiple sass/js files via glob
  • Automatic polyfills for new JavaScript features with babel (respects browserslist of project)
  • Minifies frontend assets and generates source map files
  • Browser Update Note
  • Stylelint for (CSS, SASS, SCSS) and Standard Linting (JS)
  • Autoprefixing of modern CSS properties for older browsers (respects browserslist of project)
  • SVG-Spritemap generation from single SVG files, optionally with name-prefixes
  • Integration of purgeCSS functionality

Planned features

  • Autoprefixing of CSS classes (similar to CSS modules) for selected sass files

Usage

npx @sitegeist/conventional init
  • Outputs instructions to install conventional via npm or yarn
  • Creates default conventional.config.json

After the setup procedure, your package.json should look something like this:

{
   "scripts": {
       "build": "conventional build",
       "watch": "conventional watch",
       "lint": "conventional lint"
   },
   "devDependencies": {
       "@sitegeist/conventional": "^1.4"
   }
}

Installation with ddev and M1 CPU

For the usage in an apple environment with M1 CPU or other installation issues add these packages to your .ddev/config.yaml

webimage_extra_packages: [python-dev, build-essential]

In case you manually added the conventional package to your package.json and you might want to do a 'yarn install' or 'npm install' use this flags when you get issues with node-sass

CXXFLAGS="--std=c++17" yarn install --network-concurrency 1
CXXFLAGS="--std=c++17" npm install --network-concurrency 1

Configuration

All configuration is done in conventional.config.json in your package root folder:

{
    "minify": true,
    "sourceMaps": true,
    "autoprefixer": true,
    "browserUpdateNote": false,
    "sass": {
        "inputFiles": {
            "Main": "./Resources/Private/Sass/Main.scss",
            "Additional": "./Resources/Private/Sass/Additional.scss",
            "Glob": "./Resources/Private/Sass/*.scss"
        },
        "outputPath": "./Resources/Public/Css/",
        "outputFilePattern": "[name].min.css",
        "purgeFiles": [
            "./Resources/Private/Components/**/*.html",
            "./Resources/Private/Templates/**/*.html",
            "./Resources/Private/JavaScript/**/*.js"
        ],
        "purgeSafelist": ["html", "body"]
    },
    "less": {
        "inputFiles": {
            "Main": "./Resources/Private/Less/Main.less"
        },
        "outputPath": "./Resources/Public/Css/",
        "outputFilePattern": "[name].min.css"
    },
    "js": {
        "inputFiles": {
            "Main": "./Resources/Private/JavaScript/Main.js",
            "Additional": "./Resources/Private/JavaScript/Additional.js",
            "Glob": "./Resources/Private/JavaScript/*.js"
        },
        "outputPath": "./Resources/Public/JavaScript/",
        "outputFilePattern": "[name].min.js"
    },
    "ts": {
        "inputFiles": {
            "MainFromTs": "./Resources/Private/JavaScript/*.ts"
        },
        "outputPath": "./Resources/Public/JavaScript/",
        "outputFilePattern": "[name].min.js"
    }
}

see also conventional.config.json

Stylelint configuration

By default, conventional uses the stylelint-config-sass-guidelines. To add your own configuration, place a .stylelintrc.json file into your project root. You can add a complete custom set of rules or extend the standard-rules like this:

{
  "extends": "stylelint-config-sass-guidelines",
  "rules": {
    "indentation": "tab",
    "number-leading-zero": null
  }
}

TypeScript configuration

To configure the TypeScript settings, a tsconfig.json can be placed in your project root. A sample setting could look like this:

{
    "compilerOptions": {
        "noImplicitAny": true,
        "module": "es6",
        "target": "es5",
        "jsx": "react",
        "allowJs": true,
        "moduleResolution": "node"
    }
}

purgeCSS

To run purgeCSS on your sass files, add purgeFiles (path or array of paths incl. glob) to the sass section of your conventional.config.json. Only classes/IDs used in those files will be kept in your output CSS. Note: Enabling this option may reduce the building speed significantly, depending on the size of your project. purgeSafelist can take the different safelist patterns as described here: https://purgecss.com/configuration.html. It just needs to be converted to .json formatting.

Available Commands

conventional init

conventional build
conventional build:sass
conventional build:less
conventional build:js
conventional build:ts
conventional build:spritemap

conventional watch
conventional watch:sass
conventional watch:less
conventional watch:js
conventional watch:ts
conventional watch:spritemap

conventional lint
conventional lint:sass
conventional lint:js

Planned commands

conventional test
conventional test:css
conventional test:js