Skip to content

Commit 1278aa7

Browse files
committed
feat: migration from js to ts
1 parent 558ba9b commit 1278aa7

Some content is hidden

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

41 files changed

+501
-228
lines changed

.babelrc

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

.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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Javascript Node CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
4+
#
5+
version: 2
6+
jobs:
7+
build:
8+
docker:
9+
# specify the version you desire here
10+
- image: circleci/node:10.11
11+
12+
# Specify service dependencies here if necessary
13+
# CircleCI maintains a library of pre-built images
14+
# documented at https://circleci.com/docs/2.0/circleci-images/
15+
# - image: circleci/mongo:3.4.4
16+
17+
working_directory: ~/repo
18+
19+
steps:
20+
- checkout
21+
22+
# Download and cache dependencies
23+
- restore_cache:
24+
keys:
25+
- v1-dependencies-{{ checksum "package.json" }}
26+
# fallback to using the latest cache if no exact match is found
27+
- v1-dependencies-
28+
29+
- run: yarn install
30+
31+
- save_cache:
32+
paths:
33+
- node_modules
34+
key: v1-dependencies-{{ checksum "package.json" }}
35+
36+
# run tests!
37+
- run: yarn test
38+

.eslintrc.json

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

.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

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.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: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
sudo: false
12
language: node_js
23
cache:
34
directories:
@@ -6,13 +7,31 @@ cache:
67
notifications:
78
email: false
89
node_js:
10+
- '10'
11+
- '9'
912
- '8'
1013
before_script:
11-
- npm prune
14+
- PATH=${PATH//:\.\/node_modules\/\.bin/}
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"
1620
branches:
1721
only:
1822
- master
23+
- dev
24+
- /^greenkeeper/.*$/
25+
before_deploy:
26+
- cd examples
27+
- npm install
28+
- npm run build
29+
deploy:
30+
provider: pages
31+
skip-cleanup: true
32+
github-token: $GH_TOKEN
33+
keep-history: false
34+
local-dir: examples/site
35+
on:
36+
branch: master
37+
node: '10'

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

0 commit comments

Comments
 (0)