We'd love to have you as a contributor to this project.
This document contains the guidelines and directions to get started with our development process.
- Major changes (e.g. bug fixes, new features):
You should have a discussion about it first:- Check for existing issues/feature requests or open a new one.
- Make sure someone else isn't already working on it.
- Minor changes (e.g. typos, other small mistakes):
You can go ahead without needing any discussion.
After forking and cloning the repo cd in the repo directory and install the
necessary npm dependencies:
npm installStart the preview server:
npm run devNext, open the URL displayed in the terminal. In most cases, a new browser tab should automatically open for you.
You can modify the existing previews (i.e. stories) or create new ones for the specific features that you're working on.
You can find the stories inside the stories/node/ directory.
Note
If you make changes to src/browser-component.jsx file, previewing those
changes requires a different command. This file provides the browser API that
allows Topspin to be used directly in the browser like a library. So it
requires some different build parameters.
Start the preview server with this command:
npm run dev:browserThe stories for browser API are inside the stories/browser/ directory.
Open a Pull Request to submit your changes.
Some guidelines:
- Commit messages should be in present tense.
- Try to adhere to the coding conventions as listed below.
- Quotes:
// Prefer single quotes let x = 'value'; let y = {'a': 1}; // Use double quotes if a string has a single quote (apostrophe) let x = "What's up?" // Use double quotes for HTML/JSX attributes <Button type="button" />
- Global constants: Upper snake case.
- DO:
MY_GLOBAL_CONSTANT - DON'T:
myGlobalConstant
- DO:
- File names: Lower kebab case.
- DO:
my-file-name.js - DON'T:
myFileName.js
- DO:
- File extension:
.jsxif a JS file has JSX code..jsif a JS file doesn't have any JSX code.
- CSS: Try to follow BEM guidelines for naming CSS classes.