• Stars
    star
    172
  • Rank 214,570 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year 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,014
star
2

redux-beacon

Analytics integration for Redux and ngrx/store
TypeScript
669
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
280
star
5

angular-devtools

Moved to the Angular organization.
TypeScript
256
star
6

ngCourse2

An Angular Course from Rangle.io
TypeScript
182
star
7

augury-labs

Experimental Angular developer tools
TypeScript
89
star
8

stripe-eventbridge

Connect Stripe events to AWS EventBridge
JavaScript
71
star
9

angular2-starter

Angular 2 Starter Repo
JavaScript
60
star
10

radius-tracker

Measure adoption of your design system
TypeScript
52
star
11

rangle-starter

JavaScript
48
star
12

mibank-micro-frontends

Demonstration of Micro Frontend Architecture.
JavaScript
42
star
13

schematics-angular

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

hackstack

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

angular-training-slides

Slides for the Angular 2 training
HTML
29
star
16

jwt-role-based-authentication-examples

Implement the same backend using graphql, nestjs and deno.
TypeScript
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

radius-workspace

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

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
34

vue-3d

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

bridge-transit-app-cohort-2

JavaScript
3
star
36

stripe-ts-react-redux-saga

Demo of Stripe Elements & Terminal in React/Redux/Sagas using Typescript
TypeScript
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

headless-workshop

TypeScript
3
star
41

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
42

rangle-academy-unit-testing

Workshop for Unit Testing
JavaScript
3
star
43

react-training-oct-2

JavaScript
2
star
44

angular-training

Integrated Angular training materials
Shell
2
star
45

angular-testing-workshop

TypeScript
2
star
46

react-native-workshop-1

Objective-C
2
star
47

react-training-sep-25

JavaScript
2
star
48

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
49

rangle-type-scale

JavaScript
2
star
50

angular-performance-meetup

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

bridge-photo-map-app

JavaScript
2
star
52

angular-training-app

Sample application for learning Angular 2
JavaScript
2
star
53

ng-apollo-story

TypeScript
2
star
54

test-automation

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

koast-db-utils

JavaScript
1
star
56

koast-admin-app

client app to admin a koast server
JavaScript
1
star
57

a11y-test-automation

TypeScript
1
star
58

angular-schematic-patterns

TypeScript
1
star
59

gitub-action-template-example

Example of setting up Github action workflow templates within Organization
1
star
60

stripe-payment-demo

Vue
1
star
61

ng-blog-live-code

Live Coded Blog For Teaching Angular
TypeScript
1
star
62

styled-system-workshop

Programming Design Systems with Styled-System Workshop
JavaScript
1
star
63

react-native-training

Rangle.io React Native Training
JavaScript
1
star
64

playingHere

JavaScript
1
star
65

graphql-pt1-workshop-slides

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

jekyll-starter

A Gulp based Jekyll Starter
JavaScript
1
star
67

contentful-custom-map-editor

Custom Image Map Editor for Contentful
TypeScript
1
star
68

angular-book-examples

TypeScript
1
star
69

apollo-rest-example

Apollo Rest API Server Adaptor Example
TypeScript
1
star
70

serverless-app-poc

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

bridge-lcbo-app-cohort-2

JavaScript
1
star