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

@foeewni/web-core

v2.6.0

Published

Friend of the Earth EWNI Core for frontend projects

Downloads

122

Readme

Codacy Badge Node requirement npm version

FOE EWNI Frontend Core 🌍

This repo contains the build for all the frontend core elements, the repo is split in different "bundles" and compiled through Webpack4. Refer to the Bundles section below

How to build

yarn install then yarn run build

Launching Dev

yarn start launches a Webpack dev server instance with HMR (hot module replacement), the dev server runs on http://localhost:9000, livereload listens to port 9001.

Bundles

The following bundles are available to ease embedding the styles and javascripts on other projects, those bundles are not to be taken as "absolute truth" as in components will vary between sites (for example one could say that forms on Campaignion are part of the critical CSS while won't be on D8 sites.)

Bundles below are for generic use, these are mostly tuned for Drupal 8 sites (main and satellites), for more granularity please import the single components on your builder.

Critical (critical.js)

This is the most important CSS and JS bundle to deliver to the browser as soon as possible.

Embed normally as such:

<link rel="stylesheet" href="/path/to/foe.critical.min.css" />
<script type="text/javascript" src="/path/to/foe.critical.min.js" />

Contains reset and typography, async fonts, bootstrap grid and utilities as well as hero and menu components. This bundle priorotises over-the-fold components and most layout sizing to prevent FOUC (flash of unstyled content) as much as possible. The critical bundle is tuned specifically for our main Drupal sites.

Main (main.js)

This is the generic bundle, this contains all other components such as forms, inputs, paragraphs, sidebars, campaign menus, etc.

Embed with deferred/preload strategy as such:

<link rel="preload" as="style" href="/path/to/foe.main.min.css" media="screen" onload="this.rel = 'stylesheet'" />
<script type="text/javascript" src="/path/to/foe.main.min.js" defer />

Fonts (fonts.js)

The Fonts bundle contains a preloader for the google fonts as well as Font Awesome fonts.

Extras (extras.js)

Ultimately the Extras bundle contains all other remaining components which are not in any way required from anonymous visitors, this bundle will append any style needed only from logged-in admins Load as last, use server-side logic to detect logged in users.

How to include in a project

Javascript

Import the desired bundle from the NPM build itself, eg: import '@foeewni/web-core/src/XXX' where XXX is one of the bundles above, or import as es6, eg: import critical from '@foeewni/web-core'

SCSS

For SCSS you can either import the compiled CSS from the dist folder (nb: you wont access the SCSS vars in this way) Or import the actual entry files for the source SCSS, take note the global variables are all stored inside the core bundle. Components, Drupal and Bootstrap bundles are all dependant from the core.

Releasing

Run npm version [major|minor|patch] to bump the semantic versioning details within our package.json and push a commit via the usual PR/code review route (i.e. PR to develop branch, then PR to master.). Check release here https://www.npmjs.com/package/@foeewni/web-core