0.1.75 • Published 2 years ago

forge-components v0.1.75

Weekly downloads
112
License
0BSD
Repository
github
Last release
2 years ago

WARNING: This dependency has been deprecated.

Please use this private repository https://gheprod.corp.costco.com/costco-developers/forge.costco.web

The output from this repository is available on NPM at:

Details pertaining to change can be found in this document: React Development at Costco


The Forge Storybook design system

Learn more at The Forge.

Prereq's

  • Install Nodejs. Use a v14.15.1 or higher LTS version.
  • Install latest version of Yarn.
  • On Windows device or image make sure to use a bash shell.

Required skills:

Getting Started (assuming you've checked out the source and you're at the project root)

Install dependencies

yarn install

Start storybook

yarn storybook

Unit testing (using Jest)

See ./src/components/AlertHeader/index.test.js for an example of how to write a Jest unit test. Notice how we wrap the component being tested with a provider so the Costco style is injected.

To run your tests for Storybook:

yarn test:generate-output

Once this command finishes you may start storybook to view the results of your test in Storybook

Contributing

Tips

  • Images for testing your components reside in the public directory
  • Locales also reside in the public directory
  • Please follow the existing directory / filename structure: ./src/stories//>ComponentName>/
  • HTML namespaces (xml) is not supported in JSX
  • Follow the templates in src/story-template as a guide
  • When exporting your component for others to use be sure to update index.js.
  • Feature branch off of the develop branch.

How to work locally with your Forge feature branch?

  • Install yalc globally
yarn -g add yalc
  • Make sure your .gitignore has been updated to exclude the .yalc repo from a git commit.
.yalc
yalc.lock
  • On your local Forge feature branch:
yarn build
yalc publish
  • On your local project branch:
yalc add forge-components
  • To restore the NPM instance of forge components in local your project:
yarn add forge-components

Note it is safe to delete the .yalc directory.

Reference

Deployment targets

Merges to master will trigger a github action that deploys to Azure:

Style guides

NOTE: I have a bit of hesitations with the Airbnb styleguide. With forge we want to make use of function components and hooks (no class components please) and component files don't have to be named with the extension .jsx. Also the use fat arrows => in component signatures are file too. Other than that the style guide is a great starting point.

0.1.74

2 years ago

0.1.75

2 years ago

0.1.71

2 years ago

0.1.72

2 years ago

0.1.73

2 years ago

0.1.70

3 years ago

0.1.69

3 years ago

0.1.66

3 years ago

0.1.67

3 years ago

0.1.68

3 years ago

0.1.64

3 years ago

0.1.65

3 years ago

0.1.63

3 years ago

0.1.60

3 years ago

0.1.61

3 years ago

0.1.62

3 years ago

0.1.59

3 years ago

0.1.58

3 years ago

0.1.57

3 years ago

0.1.56

3 years ago

0.1.55

3 years ago

0.1.53

3 years ago

0.1.54

3 years ago

0.1.52

3 years ago

0.1.50

3 years ago

0.1.51

3 years ago

0.1.49

3 years ago

0.1.48

3 years ago

0.1.47

3 years ago

0.1.46

3 years ago

0.1.42

3 years ago

0.1.43

3 years ago

0.1.44

3 years ago

0.1.45

3 years ago

0.1.41

3 years ago

0.1.40

3 years ago

0.1.39

3 years ago

0.1.38

3 years ago

0.1.37

3 years ago

0.1.36

3 years ago

0.1.34

3 years ago

0.1.35

3 years ago

0.1.33

3 years ago

0.1.32

3 years ago

0.1.31

3 years ago

0.1.30

3 years ago

0.1.29

3 years ago

0.1.28

3 years ago

0.1.27

3 years ago

0.1.26

3 years ago

0.1.25

3 years ago

0.1.24

3 years ago

0.1.23

3 years ago

0.1.22

3 years ago

0.1.21

3 years ago

0.1.20

3 years ago

0.1.19

3 years ago

0.1.18

3 years ago

0.1.17

3 years ago

0.1.15

3 years ago

0.1.16

3 years ago

0.1.14

3 years ago

0.1.13

3 years ago

0.1.11

3 years ago

0.1.12

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago