Skip to content

Commit c050afd

Browse files
committed
feat: 🎸 export TypeScript types and improve build process
Export TypeScript types, build with tsc, remove Gulp, publish to NPM only lib/ folder, upgrade TypeScript to latest, import React as wildcard.
1 parent 368cd7c commit c050afd

File tree

103 files changed

+274
-1203
lines changed

Some content is hidden

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

103 files changed

+274
-1203
lines changed

‎.npmignore‎

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

‎build/gulpfile.js‎

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

‎package.json‎

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,23 @@
77
"type": "git",
88
"url": "https://github.com/streamich/libreact.git"
99
},
10+
"files": ["lib/"],
1011
"scripts": {
11-
"start": "npm run test:story",
12-
"build": "npm run clean && gulp --gulpfile build/gulpfile.js build",
13-
"clean": "rimraf lib modules && npm run test:story:clean && npm run docs:clean",
14-
"test": "npm run test:server && npm run test:client",
12+
"start": "yarn test:story",
13+
"clean": "rimraf lib modules && yarn test:story:clean && yarn docs:clean",
14+
"build": "tsc",
15+
"test": "yarn test:server && yarn test:client",
1516
"test:server": "mocha -r ts-node/register src/**/*.test-server.ts*",
1617
"test:client": "jest",
1718
"test:client:coverage": "jest --coverage",
1819
"test:watch": "jest --watch",
1920
"test:story:clean": "rimraf storybook-static",
20-
"test:story": "npm run storybook",
21+
"test:story": "yarn storybook",
2122
"test:story:build": "build-storybook",
2223
"docs:clean": "rimraf dist_docs docs/_book",
23-
"docs:serve": "npm run docs:clean && gitbook install ./docs && gitbook serve ./docs",
24-
"docs:build": "npm run docs:clean && gitbook install ./docs && gitbook build ./docs",
25-
"docs:publish": "npm run test:story:build && npm run docs:build && ./build/publish-docs.sh",
24+
"docs:serve": "yarn docs:clean && gitbook install ./docs && gitbook serve ./docs",
25+
"docs:build": "yarn docs:clean && gitbook install ./docs && gitbook build ./docs",
26+
"docs:publish": "yarn test:story:build && yarn docs:build && ./build/publish-docs.sh",
2627
"storybook": "start-storybook -p 6007",
2728
"semantic-release": "semantic-release"
2829
},
@@ -47,14 +48,12 @@
4748
"@types/chai": "4.1.1",
4849
"@types/jest": "22.0.1",
4950
"@types/node": "9.3.0",
50-
"@types/react": "^16.3.17",
51-
"@types/react-dom": "16.0.3",
51+
"@types/react": "^16.4.14",
52+
"@types/react-dom": "^16.0.8",
5253
"chai": "4.1.2",
5354
"enzyme": "^3.3.0",
5455
"enzyme-adapter-react-16": "^1.1.1",
5556
"enzyme-to-json": "^3.3.4",
56-
"gulp": "3.9.1",
57-
"gulp-typescript": "3",
5857
"jest": "^23.6.0",
5958
"jest-environment-jsdom": "^23.4.0",
6059
"jest-environment-jsdom-global": "^1.1.0",
@@ -64,10 +63,10 @@
6463
"react-test-renderer": "16.2.0",
6564
"rimraf": "2.6.2",
6665
"to-string-loader": "1.1.5",
67-
"ts-jest": "22.0.1",
68-
"ts-loader": "3.2.0",
69-
"ts-node": "4.1.0",
70-
"typescript": "2.6.2",
66+
"ts-jest": "^23.10.3",
67+
"ts-loader": "^5.2.1",
68+
"ts-node": "^7.0.1",
69+
"typescript": "^3.1.1",
7170
"webpack": "3.10.0",
7271
"semantic-release": "^15.5.0",
7372
"@semantic-release/changelog": "^2.0.2",

‎src/ActiveSensor/__story__/story.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {createElement as h} from 'react';
22
import {storiesOf} from '@storybook/react';
33
import {ActiveSensor} from '..';
4-
import ShowDocs from '../../../.storybook/ShowDocs'
4+
import ShowDocs from '../../ShowDocs'
55

66
storiesOf('Sensors/ActiveSensor', module)
77
.add('Documentation', () => h(ShowDocs, {md: require('../../../docs/en/ActiveSensor.md')}))

‎src/AfterDraf/__story__/story.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {createElement as h} from 'react';
22
import {storiesOf} from '@storybook/react';
33
import {AfterDraf} from '..';
4-
import ShowDocs from '../../../.storybook/ShowDocs'
4+
import ShowDocs from '../../ShowDocs'
55

66
storiesOf('Animation/AfterDraf', module)
77
.add('Documentation', () => h(ShowDocs, {md: require('../../../docs/en/AfterDraf.md')}))

‎src/AfterDraf/createSingleRunDraf.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component} from 'react';
1+
import * as React from 'react';
22
import {isClient} from '../util';
33

44
export interface IAfterDrafState {
@@ -9,7 +9,7 @@ export const createSingleRunDraf = isClient
99
? () => {
1010
let signelDrafFinished = false;
1111

12-
return class extends Component<{}, IAfterDrafState> {
12+
return class extends React.Component<{}, IAfterDrafState> {
1313
frame;
1414
state: IAfterDrafState;
1515

‎src/AfterDraf/index.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {Component} from 'react';
1+
import * as React from 'react';
22
import {isClient} from '../util';
33

44
export interface IAfterDrafState {
55
ready: boolean;
66
}
77

88
export const AfterDraf = isClient
9-
? class AfterDraf extends Component<{}, IAfterDrafState> {
9+
? class AfterDraf extends React.Component<{}, IAfterDrafState> {
1010
frame;
1111
state: IAfterDrafState;
1212

‎src/AfterTimeout/__story__/story.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {createElement as h} from 'react';
22
import {storiesOf} from '@storybook/react';
33
import {AfterTimeout} from '..';
4-
import ShowDocs from '../../../.storybook/ShowDocs'
4+
import ShowDocs from '../../ShowDocs'
55

66
storiesOf('Animation/AfterTimeout', module)
77
.add('Documentation', () => h(ShowDocs, {md: require('../../../docs/en/AfterTimeout.md')}))

‎src/Alert/__story__/story.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {createElement as h} from 'react';
22
import {storiesOf} from '@storybook/react';
33
import {Alert} from '..';
4-
import ShowDocs from '../../../.storybook/ShowDocs'
4+
import ShowDocs from '../../ShowDocs'
55

66
storiesOf('Generators/Alert', module)
77
.add('Documentation', () => h(ShowDocs, {md: require('../../../docs/en/Alert.md')}))

‎src/BatterySensor/__story__/story.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {Component, createElement as h} from 'react';
22
import {storiesOf} from '@storybook/react';
33
import {BatterySensor, withBattery} from '..';
4-
import ShowDocs from '../../../.storybook/ShowDocs';
4+
import ShowDocs from '../../ShowDocs';
55

66
const Print = (props) => h('pre', {
77
style: {

0 commit comments

Comments
 (0)