GithubHelp home page GithubHelp logo

jethroo / homeday-blocks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from homeday-de/homeday-blocks

0.0 1.0 0.0 12.62 MB

Front-end Vue.js component library

Home Page: https://blocks.homeday.dev/

License: MIT License

JavaScript 53.74% HTML 0.08% Vue 41.64% CSS 0.06% Shell 0.44% Raku 0.29% Perl 0.20% SCSS 3.55%

homeday-blocks's Introduction

Build Status Coverage Status This project is using Percy.io for visual regression testing.

Homeday Blocks

A library of Vue components used across Homeday projects - here

Local setup

Fork the main repository, clone it to your local machine and add main repo as upstream.

$ git clone [email protected]:YOUR_USERNAME/homeday-blocks.git
$ cd homeday-blocks
$ git remote add upstream [email protected]:homeday-de/homeday-blocks.git

Prerequisites

Homeday Blocks requires Node.js version 10.22.0 (.nvmrc). It's recommended to manage multiple versions of Node on the same machine with nvm or nvm-windows.

Don't forget to setup the deeper shell integration in your console to take full advantage of nvm. You can achieve this by adding the following alias into your ~/.bashrc, or ~/.zshrc file:

alias cd="cdnvm(){ cd $1; if [[ -f .nvmrc && -s .nvmrc && -r .nvmrc ]]; then <.nvmrc nvm install; elif [[ $(nvm current) != $(nvm version default) ]]; then nvm use default; fi; };cdnvm"

Project setup

Download and install dependencies

For a breif explanation of what is being install, please read our setup documentation file.

OSX

To install all our dependencies on OSX, run scripts/setup.osx.sh.

Ubuntu

To install all our dependencies on Ubuntu, run scripts/setup.ubuntu.sh.

It is recommended to run the setup script everytime you pull from the develop branch. This way you can always be sure to have all the project dependencies up to date.

Lints and fixes files

npm run lint

Storybook

Development

npm run serve:storybook

Build

npm run build:storybook

Build as a library

npm run build:lib

Testing

To just run all unit tests:

npm run test:unit

To watch for changes while writing tests:

npm run test:unit:watch

To watch for changes while writing tests for a single component:

npm run test:unit:watch ComponentName

Screenshot tests on Percy

Make sure you've PERCY_TOKEN exported first and the project is built.

The token can be obtained from Percy dashboard if you've access to it.

npm run test:percy

You can also follow build statuses in https://percy.io/Homeday/homeday-blocks

Gotchas

  • tests/ is an alias for <rootDir>/tests/

Generators

We use Hygen as a code generator tool to save time when we need to scaffold some structure.

Just run:

npm run new component
npm run new service

And follow the wizzard in order to generate a base component structure or a service.

Contribution guide

This project follows forking workflow. See project setup to get started locally. That means that all code changes enter the project by PR to develop branch. Once you open the PR with suggested changes, the checks for build and coverage will run. If those fail, your PR needs some more work. :)

Each PR should be reviewed by at least two team members. Once reviewed and approved, it can be merged. Please follow the following convention when merging the PR:

  1. Use "Squash and merge" to merge the PR.
  2. Use a meaningful title when merging your PR.
  3. Give title a semantic meaning through emojis. Please use emoji first, then the text.
  4. ๐Ÿ’ฅ - marks breaking changes (MAJOR version change)
  5. โœจ - marks new feature (MINOR version change)
  6. Everything else is consider a patch change.

It is important to follow this convention, because it makese generating changelog much easier (automatic). We use changelog github action to automatically generate the changelog. Please see the action documentation for more details on supported conventions.

Examples

Major change

๐Ÿ’ฅ Removed HdNotNeeded component (#32)

Minor change

โœจ Added HdAwesomeComponent (#33)

Patch

๐Ÿ”ง Updated travis configuration and run lint on build(#34)

Version release

When a new version is ready to be released, these are the steps we need to take:

  1. Create a release PR from develop to master
  2. Changelog will be generated during the checks. Check it to determed the release type - MAJOR, MINOR or PATCH.For more info, please see contribuiton guide. If in doubt, consult with rest of the team.
  3. Create a version bump PR to develop (use npm version to make sure version is updated everywhere). This should be merged as last PR before releasing.
  4. Once version bump PR is merged to develop and all checks on release PR have passed, merge the release PR.
  5. Draft a github release with corresponding version (target master branch), include the generated changelog, and publish it. Version naming convention is vx.x.x.
  6. After publishing the release on github, new version will be published automatically to the npm registry (using github action) that's hooked to the release event. Double check that the new version has been correctly published on npm registry

The CI will automatically deploy the storybook to our showcase env, once the PR is merged to master branch.

Consuming in other projects

import { HdDynamicForm } from 'homeday-blocks';

Customize configuration

See Configuration Reference.

Services

Together with the components, Homeday Blocks also provides useful services that can be reused across projects. You can read more about them in the services documentation.

homeday-blocks's People

Contributors

aym3nb avatar dependabot-preview[bot] avatar dependabot[bot] avatar drapisarda avatar ilyasmez avatar kuroski avatar leandroinacio avatar majakomel avatar metal-gogo avatar mlande avatar olegivaniv avatar originalexe avatar sinisag avatar viniciuskneves avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.