Skip to content

Commit 5603d6b

Browse files
authored
Merge pull request #13 from streamich/fix-build
feat: 🎸 export TypeScript types and improve build process
2 parents 368cd7c + e0545b7 commit 5603d6b

File tree

123 files changed

+453
-1297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+453
-1297
lines changed

.npmignore

Lines changed: 0 additions & 24 deletions
This file was deleted.

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ notifications:
1010
node_js:
1111
- '8'
1212
script:
13-
- npm run test
14-
- npm run build
13+
- yarn test
14+
- yarn build
15+
- yarn build:modules
1516
matrix:
1617
allow_failures: []
1718
fast_finish: true
1819
after_success:
1920
- npx ci-scripts github-post
2021
- npx ci-scripts slack
21-
- npm run semantic-release
22+
- yarn semantic-release
2223
branches:
2324
except:
2425
- /^v\d+\.\d+\.\d+$/

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
[![][npm-badge]][npm-url] [![][travis-badge]][travis-url] [![React Universal Interface](https://img.shields.io/badge/React-Universal%20Interface-green.svg)](https://github.com/streamich/react-universal-interface)
66

7-
React standard library — must-have toolbox for any React project.
7+
React standard library—must-have toolbox for any React project.
88

9-
- *Isomorphic* - all components work in browser and on server (and some in `react-native`).
10-
- See [__demos__](https://streamich.github.io/libreact/demos/), [__docs__](https://streamich.github.io/libreact/en/), and [__package__](https://www.npmjs.com/package/libreact/).
9+
- [__LAUNCH STORYBOOK__](https://streamich.github.io/libreact/demos/) 🚀
10+
- [__See documentation__](https://streamich.github.io/libreact/en/)
11+
- Most components implement [![React Universal Interface](https://img.shields.io/badge/React-Universal%20Interface-green.svg)](https://github.com/streamich/react-universal-interface)
12+
- *Isomorphic* - most components work in browser and on server (and some in `react-native`).
1113

1214

1315
## Installation
@@ -19,10 +21,12 @@ npm i <a href="https://www.npmjs.com/package/libreact">libreact</a> --save
1921

2022
## Usage
2123

22-
Import each utility individually to decrease your bundle size
24+
Library is modular&mdash;you can import each component by its name.
2325

2426
```js
2527
import {mock} from 'libreact/lib/mock';
28+
// or
29+
import {mock} from 'libreact/modules/mock';
2630

2731
const MyComponent = mock();
2832
```
@@ -75,7 +79,7 @@ const MyComponent = mock();
7579
- [`<Provider>`](./docs/en/Provider.md#provider), [`<Consumer>`](./docs/en/Provider.md#consumer), [`withContext()`](./docs/en/Provider.md#withcontext-hoc), and [`@withContext`](./docs/en/Provider.md#withcontext-decorator)
7680
- [`<Theme>`](./docs/en/theme.md#theme), [`<Themed>`](./docs/en/theme.md#themed), [`withTheme()`](./docs/en/theme.md#withtheme-hoc), and [`@withTheme`](./docs/en/theme.md#withtheme-decorator)
7781
- [`<CssVarsProvider>`](./docs/en/cssvars.md), [`<CssVars>`](./docs/en/cssvars.md#cssvars), [`withCssVars()`](./docs/en/cssvars.md#withcssvars-hoc), and [`@withCssVars`](./docs/en/cssvars.md#withcssvars-decorator)
78-
- [Router](./docs/en/routing.md)
82+
- [__Routing__](./docs/en/routing.md): [`createRouter()`](./docs/en/routing.md#createrouter), [`<Router>`](./docs/en/routing.md#router), [`<Route>`](./docs/en/routing.md#route), [`<Switch>`](./docs/en/routing.md#switch), [`<Match>`](./docs/en/routing.md#match), [`<Link>`](./docs/en/routing.md#link), and [`go()`](./docs/en/routing.md#go)
7983
- [`<Translations>`](./docs/en/translate.md#translations), [`<Translate>`](./docs/en/translate.md#translate-or-t), [`<T>`](./docs/en/translate.md#translate-or-t), [`withT()`](./docs/en/translate.md#witht-hoc), and [`@withT`](./docs/en/translate.md#witht-decorator)
8084
- [UI](./docs/en/UI.md)
8185
- [`<Portal>`](./docs/en/Portal.md), [`<Overlay>`](./docs/en/Overlay.md), and [`<Modal>`](./docs/en/Modal.md)
@@ -100,7 +104,6 @@ const MyComponent = mock();
100104
- [Side Effects](./docs/en/Side-effects.md)
101105
- [`<LocalStorage>`](./docs/en/LocalStorage.md)
102106
- [`<ClassNames>`](./docs/en/ClassNames.md)
103-
- [`go()`](./docs/en/routing.md#go), [`<Sms>`](./docs/en/Sms.md), [`<Mailto>`](./docs/en/Mailto.md)
104107
- [Boundaries](./docs/en/Boundaries.md)
105108
- [`<BrowserOnly>`](./docs/en/BrowserOnly.md), [`<ServerOnly>`](./docs/en/ServerOnly.md), and [`<ElectronOnly>`](./docs/en/ElectronOnly.md)
106109
- [`<ErrorBoundary>`](./docs/en/ErrorBoundary.md) and [`withErrorBoundary()`](./docs/en/ErrorBoundary.md#witherrorboundary-hoc)
@@ -109,6 +112,7 @@ const MyComponent = mock();
109112
- [`createRef()`](./docs/en/next/createRef.md), [`createState()`](./docs/en/next/createState.md), and [`createLifecycleEvents()`](./docs/en/next/createLifecycleEvents.md)
110113
- Other
111114
- [`<Resolve>`](./docs/en/Resolve.md)
115+
- [`<Sms>`](./docs/en/Sms.md), [`<Mailto>`](./docs/en/Mailto.md)
112116
- [`getDisplayName()`](./docs/en/getDisplayName.md)
113117

114118

build/gulpfile.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

docs/en/ActiveSensor.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# `<ActiveSensor>`
22

3-
Render prop that tracks elements active status. Attaches to the root element, or provides a binding, if `bond` prop specified.
3+
[![React Universal Interface](https://img.shields.io/badge/React-Universal%20Interface-green.svg)](https://github.com/streamich/react-universal-interface)
4+
5+
Render prop that tracks some element's active status.
6+
Attaches to the root element, or provides a binding, if `bond` prop specified.
47

58
## Example
69

docs/en/BatterySensor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# `<BatterySensor>`
22

3+
[![React Universal Interface](https://img.shields.io/badge/React-Universal%20Interface-green.svg)](https://github.com/streamich/react-universal-interface)
4+
35
Uses [`Navigator.getBattery()`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getBattery) API to track battery level, charging status and time it takes to charge/discharge a battery.
46

57
## Props

docs/en/Counter.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# `<Counter>`
22

3+
[![React Universal Interface](https://img.shields.io/badge/React-Universal%20Interface-green.svg)](https://github.com/streamich/react-universal-interface)
4+
35
Allows you to keep a state of a counter value. Is similar to [`<Value>`](./Value.md) but its
46
value is cast to `number` and you have an extra `inc(by = 1)` method that will increment your counter.
57

docs/en/Dummies.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Dummies
22

33
Dummies are empty *"shell"* components that don't contain the actual implementation.
4-
54
However, those dummies can be used as real React components and they will re-render
65
automatically once they get implemented.
76

@@ -12,5 +11,3 @@ but implement them with real components only later when necessary.
1211
- [`loadable()`](./loadable.md) - dummy that can be loaded using `.load()` method.
1312
- [`lazy()`](./lazy.md) - like `loadable()`, but also loads automatically when rendered for the first time.
1413
- [`delayed()`](./delayed.md) - like `lazy()`, but its loading can be delayed.
15-
- [`viewport()`](./viewport.md) - postpones component's rendering until it is visible
16-
in viewport at least once.

docs/en/HoverSensor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# `<HoverSensor>`
22

3+
[![React Universal Interface](https://img.shields.io/badge/React-Universal%20Interface-green.svg)](https://github.com/streamich/react-universal-interface)
4+
35
Render prop that tracks elements hover status. Attaches to the root element, or provides a binding, if `bond` prop specified.
46

57
## Example

docs/en/Introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
`libreact` is a collection of most essential React utilities you will probably need in any project.
44

55
[Render prop](#render-props) and [FaCC](#facc) notation is used interchangeably as most `libreact`
6-
components support both interfaces. Also, most render prop components support
7-
[component prop](#component-prop) interface, with the following precedence:
6+
components support both interfaces and implement [*Universal Component Interface*](https://github.com/streamich/react-universal-interface).
7+
Also, most render prop components support [component prop](#component-prop) interface, with the following precedence:
88

99
1. FaCC
1010
2. Render prop

0 commit comments

Comments
 (0)