First off, thanks for considering making a contribution to Liquid Oxygen! π
The following is a set of guidelines for contributing to Liquid Oxygen. These are not rules. So use your best judgment, and feel free to propose changes to this document in a pull request.
This project and everyone who participates in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to liquid@emdgroup.com.
This section guides you through submitting a bug report for Liquid. Following these guidelines helps maintainers and the community understand your report βοΈ, reproduce the behavior π»π», and find related reports π.
Before creating bug reports, please check this list as you might find out that you do not need to create one. Fill out our bug report template and include as many details as possible. The more information we have, the more likely we will be able to resolve the issue in a short time.
Bugs are tracked as GitHub issues. Create an issue and provide the following information by filling in the template.
Explain the problem and include additional details to help maintainers reproduce the problem:
Provide more context by answering these questions:
Include details about your configuration and environment:
npm list @emdgroup-liquid/liquid
inside the working directory of your project.This section guides you through submitting a feature request for Liquid, including completely new components, new features to existing components and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your request βοΈ and find related requests π.
You can upvote a feature request, if it has the needed: votes
label, with a π reaction on the top comment of the issue. The more votes, the higher we prioritize the request.
Feature requests are tracked as GitHub issues. Use our feature request template to create a feature request and include as many details as possible:
npm list @emdgroup-liquid/liquid
inside the working directory of your project.Unsure where to begin contributing to Liquid Oxygen? You can start by looking through beginner
and help wanted
issues:
beginner
issues.Both issue lists are sorted by total number of comments. While not perfect, the number of comments is a reasonable indicator for the impact your contribution can have.
Before you can contribute any code, you will most likely want to setup a local development environment. Follow these steps to get started:
git clone git@github.com:emdgroup-liquid/liquid.git
corepack enable && pnpm i
src/liquid
folder by running the project build task (this step is only required before starting the local dev server for the first time):pnpm run build
pnpm run start
This project consists of different parts and pieces, each with its own purpose. Familiarize yourself with these parts and pieces, so that you find your way quicker to the relevant spot where you would like to contribute.
βββ README.md
βββ CODE_OF_CONDUCT.md
βββ CONTRIBUTING.md
βββ SECURITY.md
βββ LICENSE.md
βββ package.json # Please have a look at the scripts section inside the
β # package.json file.
β # You can also run `npm run` to get a list of all
β # available commands.
βββ .devcontainer
β βββ devcontainer.json # GitHub codespaces dev container configuration.
βββ .github
β βββ workflows/ci-cd.yml # CI/CD pipeline config file.
βββ .vscode
β βββ task.json # Task configurations for Visual Studio Code.
βββ .env # The .env file is not under version control.
β # It contains sensitive data, such as credentials
β # used to authenticate oneself against
β # an API. We currenly do this for fetching design
β # tokens from Figma.
βββ bin # Contains scripts to be included in the bundle
β # for execution with npx.
βββ config # Folder containing all sorts of configuration files.
β βββ .eleventy.cjs # The Liquid Oxygen docs site is powered by 11ty.
β β # See https://www.11ty.dev/
β βββ .eslintrc.cjs # eslint is used for linting ts and tsx files.
β β # Please make sure to enable eslint in your code editor.
β βββ .prettierrc.json # prettier ensures a consistent code style. Please make
β β # sure to enable prettier in your code editor of choice.
β βββ .releaserc.cjs # Config file for semantic-release. See
β β # https://semantic-release.gitbook.io/semantic-release/
β βββ commitlint.config.cjs # We use conventional commits and semantic release.
β βββ postcss.config.docs.cjs # PostCSS config file for the docs site CSS processing.
β βββ postcss.config.cjs # PostCSS config file for Liquid CSS processing.
β βββ stencil.config.docs.ts # Stencil config file for the docs site.
β βββ stylelint.config.cjs # Stylelint config file. See section about linting
β β # further below.
β βββ tsconfig.docs.json # Typescript config file for components used for the
β β # docs site.
β βββ tsconfig.react.json # Typescript config file for react component bindings.
β βββ tsconfig.vue.json # Typescript config file for vue component bindings.
βββ .npmignore # The .npmignore file is used to keep the package size
β # to a minimum.
β # More about this below.
βββ dist # Here is the main juice which gets published to npm.
βββ dist_docs # This folder is served during development. It contains
β # the docs site as well as the necessary liquid files.
βββ screenshot # This directory contains files related to visual
β # regression testing with Stencil. See
β # https://stenciljs.com/docs/screenshot-visual-diff
βββ scripts # Contains bash or node script files executed via
β # npm script commands.
βββ src # The source folder.
β βββ _data # This folder contains data files.
β β β # See https://www.11ty.dev/docs/data-global/
β β βββ env.cjs # Environment variables injected during generation of
β β # the docs site.
β βββ docs # Everything inside this folder is for developing the
β β β # docs site.
β β βββ assets # Static assets for the docs page reside here.
β β βββ components # Docs components live here.
β β βββ global # Docs global styles live here.
β β βββ includes
β β β βββ layout.njk # The docs site is powered by 11ty. This is the default
β β β β # 11ty layout file for the docs site.
β β β β # See https://www.11ty.dev/docs/layouts/
β β β βββ redirect.njk # This layout file handles redirects on pages behind
β β β β # authentication.
β β βββ layouts # There is one layout component which lives inside this
β β β # folder.
β β βββ pages # This folder contains markdown files for general
β β β # documentation pages, legal stuff and the 404 page.
β β βββ utils # Contains docs utililty files.
β βββ liquid # Liquid Oxygen source code lives here.
β βββ components # This folder contains all Liquid components including
β β # tests and docs.
β βββ global # Here we have global styles. Mainly CSS custom
β β # properties, such as variables for colors, theming,
β β # typography, spacings, shadows etc.
β β # Note that most of these files are auto-generated
β β # using design tokens.
β βββ utils # Contains utilities shared between components.
βββ stencil.config.ts # Stencil config file for Liquid components.
βββ tsconfig.json # Typescript config file for Liquid components.
βββ pnpm-lock.yaml # We use pnpm and this is the respective lock file.
As you can see, Liquid Oxygen currenly has a straight forward project structure:
One repo, one package.json, no workspaces, just two main directories inside the src/
folder, src/docs/
for the docs site and src/liquid/
for the component library.
You probably noticed by now that we use eslint, prettier and stylelint in this project to enforce some code style conventions. Please make sure to enable these tools in your code editor of choice.
Some things are not linted but are still important:
ld-
and docs components with docs-
.rem
; absolute length units should be avoided (borders and outlines may count as an exception to the rule).ld-
and use BEM..shadow
suffix in the file name (for instance ld-sidenav.shadow.css
). This will ensure the CSS does not end up in the CSS components bundle.:where
trick to reduce CSS speceficity to zero, make sure the properties affected are not potential candidates for reset and normalize styles.We also use husky for running Git hooks which in turn run lint tasks before you commit or push something. Which brings us to the next point...
Commit messages are linted with commitlint and should adhere to the Conventional Commits specification. This ensures that semantic release, which we use for automated release management, works as it is supposed to. Please squash commits which together solve a specific task before submitting a pull request. This not only ensures a clean Git history, but also a clean changelog which is generated by semantic release automatically upon release.
Branch names are linted using the following regular expression before push:
^((feat|fix|hotfix|build|chore|ci|docs|style|refactor|perf|test)\/([a-z0-9._-]+)|main|rc)$
There are multiple commands available as npm scripts for running different kinds of tests: Unit tests, functional (e2e) tests as well as visual regression tests (using screenshots) are handled by Stencil. We also run accessibility tests within the functional test suits using axe-core.
You execute tests either by running one of the npm scripts which start with test
(see package.json) or by executing the respective test commands directly with the options needed. Please refer to the docs of each test runner in question for available options.
The following examples should help you start testing quickly and efficiently.
pnpm run test:unit
pnpm run test:watch
ld-tabs
component in watch mode with coverage: #stencil test --spec --coverage --no-cache --watch=all -- ld-tabs ld-tablist
pnpm run test:e2e
ld-sidenav
component: #stencil test --screenshot --e2e -- src/liquid/components/ld-sidenav/test/ld-sidenav.e2e.ts && pnpm run test:e2e:cleanup
pnpm run test:compare_screenshots
ld-sidenav
component: #ts-node scripts/screenshots.ts rm -c ld-sidenav
When you have implemented changes in your local clone or fork of our Liquid Oxygen repository, it is time to create a pull request in order to integrate these changes. But before you do that, please follow these steps to make sure your contribution gets considered by the Liquid Oxygen maintainers:
While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
If you want to dive deeper into the technology stack used in the Liquid Oxygen project, check out the below list of selected documentation sites and articles we found valuable:
Let us know if we should add something! π€