2.0.43 • Published 2 days ago

@nerdjs/nerd-ui v2.0.43

Weekly downloads
-
License
ISC
Repository
-
Last release
2 days ago

@nerdjs/nerd-ui

This library contains a collection of generic React components that will be used on different home projects bootstrapping this project with TSDX.

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.

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.

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

To run tests, use npm test or yarn test.

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.

Configuration

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

npm run lint # will run linter evaluation (error and warning)
npm run lint --fix # potentially fixable
npm run prettier

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

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.

Named Exports

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

Conventions

  • All component name should be prefix with Nerd<Component>, Example: NerdAppBar

Including Styles

There are many ways to ship styles, including with CSS-in-JS. This library 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.

2.0.42

2 days ago

2.0.43

2 days ago

2.0.41

13 days ago

2.0.40

20 days ago

3.1.0

20 days ago

2.0.38

26 days ago

2.0.39

25 days ago

2.0.37

1 month ago

2.0.36

1 month ago

2.0.35

2 months ago

2.0.34

2 months ago

2.0.33

2 months ago

2.0.32

2 months ago

2.0.31

2 months ago

2.0.30

2 months ago

2.0.29

3 months ago

2.0.28

3 months ago

3.0.0

3 months ago

2.0.27

3 months ago

2.0.26

3 months ago

2.0.25

4 months ago

2.0.24

4 months ago

2.0.22

4 months ago

2.0.23

4 months ago

2.0.21

4 months ago

2.0.20

4 months ago

2.0.19

4 months ago

2.0.18

4 months ago

2.0.17

4 months ago

2.0.16

5 months ago

2.0.3

9 months ago

2.0.2

9 months ago

2.0.5

8 months ago

2.0.4

8 months ago

2.0.7

7 months ago

2.0.6

8 months ago

2.0.9

7 months ago

2.0.8

7 months ago

1.0.66

10 months ago

1.0.65

10 months ago

1.0.64

10 months ago

1.0.68

9 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.0.67

10 months ago

2.0.15

5 months ago

2.0.13

6 months ago

2.0.14

6 months ago

2.0.11

7 months ago

2.0.12

7 months ago

2.0.10

7 months ago

1.0.62

12 months ago

1.0.61

12 months ago

1.0.60

12 months ago

1.0.63

11 months ago

1.0.55

12 months ago

1.0.54

12 months ago

1.0.53

1 year ago

1.0.58

12 months ago

1.0.57

12 months ago

1.0.56

12 months ago

1.0.52

1 year ago

1.0.51

1 year ago

1.0.50

1 year ago

1.0.49

1 year ago

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.40

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago