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

@openeuropa/bcl-builder

v1.8.0

Published

Bootstrap Component Library builder

Downloads

2,339

Readme

BCL builder

The @openeuropa/bcl-builder is a package providing scripts to be executed via the command line, styles, scripts, copy, rename and sprite. They can be used respectively to compile SASS files and minify css files, compile and minify js files, to copy files or rename files and to generate svg sprites. It comes with a bin file that is available when the package is installed and can be run as npm run ecl-builder scriptName. It supports a configuration file bcl-builder.config.js where each script can be configured to perform specific operations in the enviroment where they are used.

Api

The builder uses by default a bcl-builder.config.js in the same folder where the builder script is executed. This file will define the different operations you want to perform via the builder. The config file is basically an export of the configuration for the different commands which all supports multiple operations as items in an array.

module.exports = { scripts: [{ entry, dest, options } ...], styles: [{ entry, dest, options } ...], rename: [{ entry, dest, options } ...], copy: [{ from, to, options } ...], sprite: [[{ entry, dest, options } ...], };

Styles

styles: [ { entry (string), dest (string), options (object) [plugins for postcss] https://github.com/postcss/postcss/blob/main/docs/plugins.md { minify (includes css nano for minification) } }, ],

Scripts

scripts: [ { entry (string), dest (string), options: (object) [rollup js configuration https://rollupjs.org/guide/en/#javascript-api] }, }, ],

Copy

copy: [ { from: (string), to: (string), options: (object) [copyfiles api conf https://www.npmjs.com/package/copyfiles], }, ],

Reaname

rename: [ { from: (string), to: (string), options: (object) { search: (glob), operation: [prefix|suffix|rewrite|extension], }, }, ],

Sprite

sprite: [ { entry: (string), dest: (string), options: (object) { file: (string) (defaut: bcl-icons.svg), list: (array of file names) (optional), }, }, ],


Color Scheme

 * Example config object: {
 colorScheme: [
  {
    entry: path.resolve("resources/sass/color-scheme-variables.scss"),
    dest: path.resolve(outputFolder, "assets/css/color_scheme.min.css"),
    options: {
      includePaths,
      sourceMap: "file",
    },
  },
],

This following example is the entry of the colorScheme. The scss file should look like this. It also support multiple color schemes. Example SCSS file of color-scheme.scss:

$colors-schemes: (
  "ocean": (
    "primary": #4eac00,
    "secondary": #fbff00,
    "danger": #ff8800,
    "success": #4dff00,
    "text": #294d26,
    "background": #ffdfb0,
    "link": #7b00ff,
  ),
);

You can find multiple plugins here: Postcss Plugins

The color-scheme enables the possibility to theme the colors used in BCL. It overrides the variables $theme-colors used by Bootstrap (Bootstrap Theme Colors).

We've also added some new variables that overwrite and make use of extra classes:

  • .text-color-default: Text color is changed based on the 'text' variable, overriding all text colors inside a component.
  • .bg-default: Background color is changed based on the 'background' variable. It adds a background for the component but does not override if it already has a bg class (e.g., bg-primary).

Prerequisites

  • BCL-Builder version >= 1.2.1
  • BCL-Bootstrap version >= 1.2.1
  • BCL-Theme-Default >= 1.2.1

Setup Color Schema

Step 1: Depending on your package manager:

Yarn:

  • yarn add @openeuropa/bcl-builder --save
  • yarn add @openeuropa/bcl-bootstrap --save
  • yarn add @openeuropa/bcl-theme-default --save

NPM:

  • npm install @openeuropa/bcl-builder --save
  • npm install @openeuropa/bcl-bootstrap --save
  • npm install @openeuropa/bcl-theme-default --save

Step 2: Add the following bcl-builder.config.js file:

  colorScheme: [
    {
      entry: path.resolve(outputFolder, "path to the color-scheme scss file"),
      dest: path.resolve(outputFolder, "compiled "),
      options: {
        includePaths,
        minify: true,
        sourceMap: "file",
      },
    },
  ],

Step 3: Add in your package.json the following command:

  "build:color-scheme": "bcl-builder color-scheme",

Note: We are using (npm-run-all package) in BCL in order for all scripts for bcl-builder to be run at once: Example:

    "build": "npm-run-all build:*",
    "build:styles": "bcl-builder styles",
    "build:color-scheme": "bcl-builder color-scheme",
    "build:scripts": "bcl-builder scripts",
    "build:copy": "bcl-builder copy",
    "build:sprite": "bcl-builder sprite",