• Stars
    star
    173
  • Rank 220,124 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A design system accelerator

Radius Design System Kit

This is 1 of 3 repos that is part of an ecosystem of open-source tools and libraries that allow you to accelerate your design system! This repository contains several branches that enable the boilerplate creation of design system instances for React.

rangle.io/radius

Figma File

Storybook Docs

Chromatic

See also: Radius Angular Radius Workspace

Contribution

We are currently working to make Radius for React more flexible with regards to accelerating the creation of design systems for integrating with vanilla css, css modules, emotion and styled-components.

Respective versions of such design systems can be found in the following branches:

basic-css     - CSS modules
basic-emotion - the emotion library, has theme
basic-styled  - the styled-components library, has theme

Please create pull requests against the branches above to contribute.

What's Inside

.
β”œβ”€β”€ README.md
β”œβ”€β”€ demo/
β”œβ”€β”€ dist/
β”œβ”€β”€ docs/
β”œβ”€β”€ example/
β”œβ”€β”€ jest.config.js
β”œβ”€β”€ package.json
β”œβ”€β”€ src/
└── tsconfig.json

Are you using Radius?

We would love to hear about how you are using Radius or any feedback or feature requests. Open an issue.

πŸš€ Quick start

To get started you can just clone the repository.


TSDX React w/ Storybook User Guide

Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.

This TSDX setup is meant for developing React component libraries (not apps!) that can be published to NPM. If you’re looking to build a React-based app, you should use create-react-app, razzle, nextjs, gatsby, or react-static.

If you’re new to TypeScript and React, checkout this handy cheatsheet

Commands

TSDX scaffolds your new library inside /src, and also sets up a Parcel-based playground for it inside /example.

The recommended workflow is to run TSDX in one terminal:

npm start # or yarn start

This builds to /dist and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.

Then run either Storybook or the example playground:

Storybook

Run inside another terminal:

yarn storybook

This loads the stories from ./stories.

NOTE: Stories should reference the components as if using the library, similar to the example playground. This means importing from the root project directory. This has been aliased in the tsconfig and the storybook webpack config as a helper.

Example

Then run the example inside another:

cd example
npm i # or yarn to install dependencies
npm start # or yarn start

The default example imports and live reloads whatever is in /dist, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. No symlinking required, we use Parcel's aliasing.

To do a one-off build, use npm run build or yarn build.

To run tests, use npm test or yarn test.

Configuration

Code quality is set up for you with prettier, husky, and lint-staged. Adjust the respective fields in package.json accordingly.

Jest

Jest tests are set up to run with npm test or yarn test.

Bundle analysis

Calculates the real cost of your library using size-limit with npm run size and visulize it with npm run analyze.

React Testing Library

We do not set up react-testing-library for you yet, we welcome contributions and documentation on this.

Rollup

TSDX uses Rollup as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.

TypeScript

tsconfig.json is set up to interpret dom and esnext types, as well as react for jsx. Adjust according to your needs.

Continuous Integration

GitHub Actions

Two actions are added by default:

  • main which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
  • size which comments cost comparison of your library on every pull request using size-limit

Optimizations

Please see the main tsdx optimizations docs. In particular, know that you can take advantage of development-only optimizations:

// ./types/index.d.ts
declare var __DEV__: boolean;

// inside your code...
if (__DEV__) {
  console.log('foo');
}

You can also choose to install and use invariant and warning functions.

Module Formats

CJS, ESModules, and UMD module formats are supported.

The appropriate paths are configured in package.json and dist/index.js accordingly. Please report if any issues are found.

Deploying the Example Playground

The Playground is just a simple Parcel app, you can deploy it anywhere you would normally deploy that. Here are some guidelines for manually deploying with the Netlify CLI (npm i -g netlify-cli):

cd example # if not already in the example folder
npm run build # builds to dist
netlify deploy # deploy the dist folder

Alternatively, if you already have a git repo connected, you can set up continuous deployment with Netlify:

netlify init
# build command: yarn build && cd example && yarn && yarn build
# directory to deploy: example/dist
# pick yes for netlify.toml

Named Exports

Per Palmer Group guidelines, always use named exports. Code split inside your React app instead of your React library.

Including Styles

There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.

For vanilla CSS, you can include it at the root directory and add it to the files section in your package.json, so that it can be imported separately by your users and run through their bundler's loader.

Publishing to NPM

We recommend using np.

Usage with Lerna

When creating a new package with TSDX within a project set up with Lerna, you might encounter a Cannot resolve dependency error when trying to run the example project. To fix that you will need to make changes to the package.json file inside the example directory.

The problem is that due to the nature of how dependencies are installed in Lerna projects, the aliases in the example project's package.json might not point to the right place, as those dependencies might have been installed in the root of your Lerna project.

Change the alias to point to where those packages are actually installed. This depends on the directory structure of your Lerna project, so the actual path might be different from the diff below.

   "alias": {
-    "react": "../node_modules/react",
-    "react-dom": "../node_modules/react-dom"
+    "react": "../../../node_modules/react",
+    "react-dom": "../../../node_modules/react-dom"
   },

An alternative to fixing this problem would be to remove aliases altogether and define the dependencies referenced as aliases as dev dependencies instead. However, that might cause other problems.

More Repositories

1

augury

Angular Debugging and Visualization Tools
TypeScript
2,008
star
2

redux-beacon

Analytics integration for Redux and ngrx/store
TypeScript
668
star
3

angular-2-aot-sandbox

Sandbox for testing Angular 2's AoT specifically what expressions break it
TypeScript
297
star
4

angular-ssr

Angular 4+ server-side rendering solution compatible with @angular/material, jQuery, and other libraries that touch the DOM (as well as providing a rich feature set!)
TypeScript
279
star
5

angular-devtools

Moved to the Angular organization.
TypeScript
255
star
6

ngCourse2

An Angular Course from Rangle.io
TypeScript
184
star
7

augury-labs

Experimental Angular developer tools
TypeScript
89
star
8

stripe-eventbridge

Connect Stripe events to AWS EventBridge
JavaScript
72
star
9

angular2-starter

Angular 2 Starter Repo
JavaScript
60
star
10

radius-tracker

Measure adoption of your design system
TypeScript
56
star
11

rangle-starter

JavaScript
48
star
12

mibank-micro-frontends

Demonstration of Micro Frontend Architecture.
JavaScript
43
star
13

jwt-role-based-authentication-examples

Implement the same backend using graphql, nestjs and deno.
TypeScript
34
star
14

schematics-angular

Angular Schematics for adding features to an existing angular project to improve productivity and organization-wide consistency
TypeScript
34
star
15

hackstack

A library for building AngularJS apps with broken APIs that are delivered late.
JavaScript
32
star
16

angular-training-slides

Slides for the Angular 2 training
HTML
29
star
17

angular-ngrx-example

Angular @ngrx example illustrating best practices
TypeScript
28
star
18

federated-modules-typescript

Use Webpack5 Module Federation with TS/React - Type-safe MonoRepo setup
JavaScript
18
star
19

pgdays-codepush-demo

JavaScript
14
star
20

angular-training-examples

Blog application for Angular 2 training
TypeScript
13
star
21

code-push-demo

An example of how to use CodePush with an Ionic/Cordova app.
JavaScript
11
star
22

react-native-workshop

JavaScript
10
star
23

radius-monorepo-react

Radius Monorepo Configuration for React
TypeScript
9
star
24

Stripe-shop-backend

A starter kit for Stripe Payments running on AWS lambda's with DynamoDB. Implements a basic Catalog and payment. Support Terminal and Stripe Elements.
TypeScript
8
star
25

augury-examples

A repo containing the augury example apps.
TypeScript
7
star
26

react-native-example

React-native and redux example package
JavaScript
7
star
27

serve-webpack-client

Helper module for serving webpack-related client code from a nodejs server.
JavaScript
6
star
28

rangle-investing

RangleBank Investing App
TypeScript
5
star
29

radius-angular

TypeScript
4
star
30

express-jwt-jwks

Simple JWT auth using JWKS key sets for Express. Wraps express-jwt and jwks-rsa. AWS Cognito compatible.
JavaScript
4
star
31

custom-angular-schematic-demo

Custom schematics for libraries
TypeScript
4
star
32

headless-workshop

TypeScript
4
star
33

radius-workspace

Main workspace for the new version of Radius
TypeScript
4
star
34

figma-plugin-missing-library-usage-finder

Figma Plugin to find instances or styles by name, e.g. to find missing library usage
TypeScript
4
star
35

vue-3d

3D visualization demo for Hack Western 5.
Vue
3
star
36

bridge-transit-app-cohort-2

JavaScript
3
star
37

react-native-netflix-clone

Basic Netflix clone app built with React Native
TypeScript
3
star
38

augury-site

Augury's Documentation Site
JavaScript
3
star
39

invision-dsm-utlities

Utility scripts to help integrate InVision Design System Manager (DSM) into your front-end codebase.
TypeScript
3
star
40

catch-webhooks

A webhook catcher with a web UI. See a transcript log of webhook events that reach your endpoint in a nice annotatable web interface.
JavaScript
3
star
41

rangle-academy-unit-testing

Workshop for Unit Testing
JavaScript
3
star
42

angular-18-demos

TypeScript
3
star
43

stripe-ts-react-redux-saga

Demo of Stripe Elements & Terminal in React/Redux/Sagas using Typescript
TypeScript
3
star
44

react-training-oct-2

JavaScript
2
star
45

angular-training

Integrated Angular training materials
Shell
2
star
46

angular-testing-workshop

TypeScript
2
star
47

react-native-workshop-1

Objective-C
2
star
48

react-training-sep-25

JavaScript
2
star
49

gitub-action-template-example

Example of setting up Github action workflow templates within Organization
2
star
50

a11y-violations-crawler

A performant webpage-crawler that will run each page through axe-core to display and/or store violations related to it for reporting.
CSS
2
star
51

rangle-type-scale

JavaScript
2
star
52

angular-performance-meetup

Sample application to show how to improve performance in an Angular app
CSS
2
star
53

bridge-photo-map-app

JavaScript
2
star
54

angular-training-app

Sample application for learning Angular 2
JavaScript
2
star
55

ng-apollo-story

TypeScript
2
star
56

angular-headless-cms

TypeScript
2
star
57

test-automation

Any code related to testing such as automation frameworks or utilities for manual testing.
HTML
1
star
58

koast-db-utils

JavaScript
1
star
59

koast-admin-app

client app to admin a koast server
JavaScript
1
star
60

radius-token-tango

Suite of tools to connect Design Tokens to Repositories, facilitating Figma workflows
TypeScript
1
star
61

a11y-test-automation

TypeScript
1
star
62

angular-schematic-patterns

TypeScript
1
star
63

stripe-payment-demo

Vue
1
star
64

ng-blog-live-code

Live Coded Blog For Teaching Angular
TypeScript
1
star
65

react-native-training

Rangle.io React Native Training
JavaScript
1
star
66

playingHere

JavaScript
1
star
67

graphql-pt1-workshop-slides

Slides and speaker notes for GraphQL Part 1 workshop
CSS
1
star
68

jekyll-starter

A Gulp based Jekyll Starter
JavaScript
1
star
69

contentful-custom-map-editor

Custom Image Map Editor for Contentful
TypeScript
1
star
70

angular-book-examples

TypeScript
1
star
71

apollo-rest-example

Apollo Rest API Server Adaptor Example
TypeScript
1
star
72

serverless-app-poc

A serverless application that provides subscription-based online learning content managed by headless CMS.
JavaScript
1
star
73

bridge-lcbo-app-cohort-2

JavaScript
1
star
74

ai-alt-text-generator

TypeScript
1
star
75

styled-system-workshop

Programming Design Systems with Styled-System Workshop
JavaScript
1
star