Skip to content

Common configurations for building web apps at Shopify

License

Notifications You must be signed in to change notification settings

Shopify/web-configs

Repository files navigation

Web Configs

License: MIT

This repository contains common configurations for building web apps at Shopify.

Usage

This repo is managed as a monorepo that is composed of many npm packages, where each package has its own README and documentation describing usage.

Package Index

Name NPM Size
babel-preset npm version npm bundle size (minified + gzip)
browserslist-config npm version npm bundle size (minified + gzip)
eslint-plugin npm version npm bundle size (minified + gzip)
images npm version npm bundle size (minified + gzip)
postcss-plugin npm version npm bundle size (minified + gzip)
prettier-config npm version npm bundle size (minified + gzip)
stylelint-plugin npm version npm bundle size (minified + gzip)
typescript-configs npm version npm bundle size (minified + gzip)

Contribution

This repository has a CLA-Bot running which will ask contributors to sign a Contributor License Agreement (CLA).

Shopify has also adopted a Code of Conduct that we expect contributors to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Ways to contribute

There are many ways to contribute, some of which are:

  • Filing bug reports
  • Requesting new features or packages via an issue
  • Improving the existing codebase by picking up an issue, improving tests, or furthering documentation

Development

Getting Started

# Shopify Employee
dev clone web-configs
dev up

# External Contributor - To start working on the codebase, first fork the repo, then clone it
git clone [email protected]:{your-username}/web-configs.git # replace {your-username} with your GitHub handle
yarn # install project dependencies
What is dev?

dev is a tool to standardize a small set of common tasks across all projects at Shopify. If you're wondering how to execute the dev commands as an external contributor, you can see where they are defined in this project's dev.yml file.

Testing your changes in a local project

To try out your changes in another locally cloned project, you can use yarn tophat <package-name-without-@shopify-prefix> <relative-path-to-project>. Using this command rather than yarn link will set up a watcher let you make changes without needing to rerun any commands.

Example: To test my changes to @shopify/react-form-state in my local project named my-project, I would run yarn tophat react-form-state ../path/to/my-project.

More usage instructions on the tophat command can be found here.

Documentation

If your change affects the public API of any packages within this repository (i.e. adding or changing arguments to a function, adding a new function, changing the return value, etc), please ensure the documentation is updated, and a changelog is added to reflect this. Documentation is in the README.md files of each package. If further documentation is needed please communicate via a GitHub issue.

Testing

The packages in this repository are used in mission-critical production scenarios. As such, we do not merge any untested code.

To run the full test suite, simply run dev test or yarn test.

Releasing

The release process currently involves some manual steps to complete. Once your PR has been merged, our team will orchestrate when to cut a new release.

Note Version numbers in package.json files should never be altered manually. This will be done via scripts as part of the release process.

License

MIT © Shopify, see LICENSE.md for details.