Skip to content

Commit

Permalink
Merge pull request #2 from cjies/typescript
Browse files Browse the repository at this point in the history
Rewrite with typescript
  • Loading branch information
cjies authored Aug 6, 2020
2 parents 4360291 + 88a1d60 commit e1ae1d7
Show file tree
Hide file tree
Showing 16 changed files with 2,771 additions and 3,112 deletions.
14 changes: 0 additions & 14 deletions .babelrc

This file was deleted.

9 changes: 0 additions & 9 deletions .flowconfig

This file was deleted.

1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ install:
- yarn

script:
- yarn flow
- yarn test
2 changes: 0 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"flow.enabled": true,
"flow.useNPMPackagedFlow": true,
"javascript.validate.enable": false
}
7 changes: 3 additions & 4 deletions examples/message.js → examples/message.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
// Replace '../src/duck' destination to 'redux-duck-immer'
import duck from '../src/duck';
// @ts-ignore
import * as duck from 'redux-duck-immer';

// -------------------------------------
// Action types
Expand All @@ -24,7 +23,7 @@ const reset = duck.createAction(RESET);
// -------------------------------------

type State = {
message?: string,
message?: string;
};

const initState: State = {
Expand Down
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
35 changes: 12 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-duck-immer",
"version": "1.2.1",
"version": "2.0.0-beta",
"description": "Providing redux helpers to implement ducks-modular-redux proposal and Immer for immutability",
"repository": "git@github.com:cjies/redux-duck-immer.git",
"author": "CJies <cijies@gmail.com>",
Expand All @@ -9,35 +9,24 @@
"dist"
],
"main": "./dist/duck.js",
"module": "./dist/duck.module.js",
"types": "./dist/duck.d.ts",
"scripts": {
"prebuild": "rm -rf ./dist",
"build": "rollup -c && cpx \"src/*.{d.ts,js.flow}\" dist --verbose",
"test": "NODE_ENV=test ava"
"build": "tsc",
"test": "jest --config ./jest.config.js"
},
"dependencies": {
"immer": "^2.1.5"
"immer": "^7.0.7"
},
"devDependencies": {
"@babel/core": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"@babel/preset-flow": "^7.0.0",
"@babel/register": "^7.4.0",
"ava": "^1.4.1",
"cpx": "^1.5.0",
"flow-bin": "^0.94.0",
"husky": "^1.3.1",
"prettier": "^1.16.4",
"pretty-quick": "^1.10.0",
"rollup": "^1.9.3",
"rollup-plugin-babel": "^4.3.2"
},
"ava": {
"files": [
"src/**/*.test.js"
],
"require": "@babel/register"
"@types/jest": "^26.0.8",
"husky": "^4.2.5",
"jest": "^26.2.2",
"prettier": "^2.0.5",
"pretty-quick": "^2.0.1",
"ts-jest": "^26.1.4",
"tslint": "^6.1.3",
"typescript": "^3.9.7"
},
"husky": {
"hooks": {
Expand Down
16 changes: 0 additions & 16 deletions rollup.config.js

This file was deleted.

39 changes: 0 additions & 39 deletions src/duck.d.ts

This file was deleted.

50 changes: 0 additions & 50 deletions src/duck.js.flow

This file was deleted.

174 changes: 0 additions & 174 deletions src/duck.test.js

This file was deleted.

Loading

0 comments on commit e1ae1d7

Please sign in to comment.