New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@posten/hedwig

Package Overview
Dependencies
Maintainers
5
Versions
283
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@posten/hedwig

Bring Design System

  • 11.6.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26
increased by44.44%
Maintainers
5
Weekly downloads
 
Created
Source

Hedwig

GitHub release GitHub issues

Hedwig is Bring and Postens Design System.

📚 Hedwig documentation is available here

🚨 This repo is public, so please consider this when contributing

⏩ tl;dr

npm install
npm run dev

:neckbeard: Running Hedwig locally

clone this repo
npm install                 # to install dependencies

npm run dev                 # start local development server

Open http://localhost:3000 🚀

📚 Documentation

We use Catalog from documentation. Read the documentation for Catalog.

Docs are auto generated from the components markdown file. The filename will generate the menu name and URL. It is recommended to save the documentation files together with your components.

In development, the docs will live reload. It is recommended to always develop the components within the documentation.

The documentation is auto-deployed to Heroku https://hedwig-docs.herokuapp.com when pushed to master.

Guidelines

  • All components should do one thing, and do that thing well.
  • All CSS should be written to adhere to the BEM methology.
  • All JS should be classless and use data-attributes to attach functionality.
  • New functionality should be reviewed by at least one other person before going into Hedwig.

Contributing

All right, you need to change or add something. What do you do?

1: If the thing you're changing or adding is specific to your project, and not all sites using Hedwig, use a separate css file to add or override functionality using your own classes and components.

2: If you're adding new functionality to Hedwig, follow the below development guide below.

3: If you've found a bug, follow the below "Found a bug?" guide below.

Development

To develop on the project, please first read our guidelines and the contributing section above.

To add a new feature:

  • Create a new feature branch (git checkout -b branchname)
  • Develop the new feature (Template css and js files can be found in the /templates folder)
  • Document and test the new feature
  • Create a pull request and ask for a review

To modify an existing feature follow the same process, but also remember the versioning system. If there is a breaking change, or if this might impact existing sites using hedwig, update the version number. See below for details.

Tip: In order to test changes on a locally running application which uses hedwig, replace the dependencies with the following dev server URLs (after running hedwig locally):

http://localhost:3001/posten.css

http://localhost:3001/main.js   

Staging

The staging environment is setup in Heroku as a separate app. All the assets are copied to docs folder and referred from there in this branch.

Pushing a new change will automatically deploy the app in Heroku.

setup_staging task need to be run whenever the staging branch is reset. It copies the scripts/Procfile to the root folder. Commit and push the file in staging branch only.

master branch shouldn't have a Procfile.

Versioning

Hedwig uses semantic versioning to make sure once a site starts using it, the CSS file won't suddenly change and break the site. The version number is located in package.json, and will be appended to the .css and .js files. Example - bring-1.0.3.css.

When a breaking change is added, a new major version is required.

🔨 Hosting

Production CSS, JavaScript and assets are served through a CDN using jsDelivr.

⭐ Icons

Old functional icons are being deprecated soon. From Hedwig version 7.4 you should switch to using functional icons from Font Awesome.

We use inline SVG's for icons.

..in two different ways:

  • SVG sprite - for special icons and logos
  • Font Awesome - for functional icons
SVG Sprite Icons works like this:
  • Place icons in the assets/icons/ folder
  • Run npm run svg to generate SVG sprite. npm run build or npm run dev will both also produce the SVG sprite
  • Use icons like described in the docs
Font Awesome Icons works like this
  • You need to add an environment variable with your authToken from Font Awesome. For Posten and Bring developers, contact Hedwig contributors. Otherwise, you can get a licence.
  • Use functional icons like described in the docs

To add the authToken to your environment, in ~/.bashrc add the following line:

export NPM_TOKEN=[authToken]

The token needs to be replaced by a real token.

🔧 Linting

Linting our project is import to keep a holistic code base. It is recommended to use a linting plugin for your editor while developing.

JavaScript uses ESLint with the Airbnb config.

CSS uses Stylelint with the standard config.

🌐 Browser support

We support every browser 2 last version, pluss IE10. For IE9 we have partial support. We want it to work, but it won't look perfect.

Note:
Most components are tested in IE10, but IE9 is still yet to be tested.

📂 Application structure

├── /assets
│   ├── /fonts
│   ├── /icons
│   └── /img
├── /build                      - Build folder. Contains minified assets. - auto generated    
├── /dist
│   ├── /icons                  - Service icons and Number icons
│   ├── bring.css               - Minified bring bundle
│   ├── examples.js             - Example javascript intended to run for the documentation
│   ├── hedwig-react.js         - React components
│   ├── icons.min.js            - Javascript snippet that loads the sprite on your page, minified
│   ├── main.js                 – Minified javascript bundle for both posten and bring
│   ├── posten.css              - Minified bring bundle
│   └── svg-sprite.svg          - Svg sprite with all icons
├── /docs                       - Contains the style guide system (Catalog) - auto generated
├── /scripts                    - Contains all scripts for building and compiling
│
├── /src/[posten/bring/shared]  - All modules, split up by area
│   ├── /_config                - CSS Variables
│   ├── /base                   - Global CSS - Body and typography
│   │
│   └── /module
│       ├── / *.css             - Module styles
│       ├── / *.js              - Module scripts (if any)
│       └── / *.md              - Module documentation (for Catalog)
│
├── /tmp                        - Temporary folder - auto generated
├── /templates                  - Contains example `.css` and `.js` files
│
├── / .env                      - Environment variables, required for publishing updates to s3
├── / server.js                 - Node server, starts local web servers for docs and assets
├── / package.json              - Contains all npm scripts
└── / *.*                       - Various dotfiles and config files

Build scripts

The /scripts folder contains a set of custom scripts that helps compile the docs.

List of npm scripts:

  • dev: Starts the watcher and starts the node server (in development mode)

Found a bug?

  • If you've found a bug, you can create a new issue via github.
  • If you want to fix this issue yourself, do so and then follow the development guide above.

FAQ

Q: I have a question! Who do i ask? A: Use the Hedwig slack channel!

Maintainers

WIP

📦 Dependencies

development helpers:

included in bundle:

⚖️ Licenses

FAQs

Package last updated on 29 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc