Skip to content

Commit 0e260c2

Browse files
committed
feat: reinit
1 parent e927a1f commit 0e260c2

28 files changed

+310
-132
lines changed

.babelrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const presets = [
2+
[
3+
'@babel/preset-env',
4+
{
5+
modules: process.env.NODE_ENV === 'es' ? false : 'commonjs'
6+
}
7+
],
8+
'@babel/preset-react',
9+
'@babel/preset-typescript'
10+
]
11+
12+
const plugins = [
13+
'@babel/plugin-proposal-class-properties',
14+
'@babel/plugin-proposal-object-rest-spread'
15+
]
16+
17+
if (process.env.NODE_ENV === 'test') {
18+
plugins.push('@babel/plugin-transform-modules-commonjs')
19+
}
20+
21+
module.exports = { presets, plugins }

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
steps:
1212
- checkout
1313
- restore_cache:
14-
key: dependency-cache-{{ checksum "package-lock.json" }}
14+
key: dependency-cache-{{ checksum "yarn.lock" }}
1515
- run:
1616
name: install dependences
1717
command: npm install
1818
- save_cache:
19-
key: dependency-cache-{{ checksum "package-lock.json" }}
19+
key: dependency-cache-{{ checksum "yarn.lock" }}
2020
paths:
2121
- ./node_modules
2222
- run:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ typings/
5757
# dotenv environment variables file
5858
.env
5959

60-
# dist dir
60+
# bundle dir
6161
lib
62+
es
6263

6364
package-lock.json

.npmignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
node_modules/
55
npm-debug.log
66

7+
src/
78
tests/
89
examples/
910
coverage/
11+
.circleci
12+
.vscode
1013

14+
.babelrc.js
1115
.travis.yml
1216
*.config.js
13-
.eslintrc.json
17+
tslint.json
18+
tsconfig.json
19+
.prettierrc
20+
commitlint.config.js

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"semi": false
4+
}

.travis.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1+
sudo: false
12
language: node_js
23
cache:
4+
yarn: true
35
directories:
4-
- ~/.npm
56
- node_modules
67
notifications:
78
email: false
89
node_js:
10+
- '10'
11+
- '9'
912
- '8'
1013
before_script:
1114
- npm prune
1215
after_success:
1316
- npm run build
14-
- npm run coveralls
15-
- npm run semantic-release
17+
- npm run coverage
18+
- npm install -g travis-deploy-once
19+
- travis-deploy-once "npm run semantic-release"
20+
- cd examples
21+
- yarn
22+
- npm run deploy -- --ci --host-token-env-variable=GITHUB_TOKEN
1623
branches:
1724
only:
1825
- master
26+
- /^greenkeeper/.*$/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Yuki Zhang
3+
Copyright (c) 2017-present Yuki Zhang
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

examples/.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/.storybook/.babelrc

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

examples/.storybook/config.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import { configure } from '@storybook/react'
22
import { setOptions } from '@storybook/addon-options'
33

4-
function loadStories() {
5-
require('../stories')
6-
// You can require as many stories as you need.
7-
}
8-
94
setOptions({
105
name: 'One React',
11-
url: '#'
6+
url: '#',
7+
goFullScreen: false,
8+
showAddonPanel: true,
9+
addonPanelInRight: true,
1210
})
1311

12+
// automatically import all files ending with *.story.tsx
13+
const req = require.context('../stories', true, /.story.tsx$/)
14+
function loadStories() {
15+
req.keys().forEach(filename => req(filename))
16+
}
17+
1418
configure(loadStories, module)

0 commit comments

Comments
 (0)