Skip to content

Commit

Permalink
new build setup
Browse files Browse the repository at this point in the history
  • Loading branch information
esamattis committed Nov 4, 2018
1 parent e2daf7c commit 0640060
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 53 deletions.
7 changes: 3 additions & 4 deletions .gitignore
@@ -1,4 +1,3 @@
node_modules
build
typings
package-lock.json
/node_modules
/package-lock.json
/lib
14 changes: 14 additions & 0 deletions __dtslint__/simple-actions.dtslint.ts
@@ -0,0 +1,14 @@
import {createSimpleActions, createReducer} from "../src";

const initialState = {foo: "bar"};

const SimpleActions = createSimpleActions(initialState, {
setFoo(state, action: {foo: string}) {
return {...state, foo: action.foo};
},
});

const reducer = createReducer(SimpleActions);

// $ExpectError
reducer(initialState, SimpleActions.setFoo({foo: /bad/}));
3 changes: 1 addition & 2 deletions jest.config.js
Expand Up @@ -8,6 +8,5 @@ module.exports = {
tsConfigFile: "tsconfig.json",
},
},
testPathIgnorePatterns: ["node_modules", "<rootDir>/build"],
testMatch: ["**/__tests__/*.test.(ts|tsx|js)"],
testMatch: ["**/?(*.)+(spec|test).ts?(x)"],
};
79 changes: 41 additions & 38 deletions package.json
@@ -1,40 +1,43 @@
{
"name": "@epeli/redux-stack",
"version": "0.7.1",
"description": "",
"main": "build/src/index.js",
"repository": {
"url": "https://github.com/epeli/redux-stack"
},
"scripts": {
"prepublish": "tsc",
"test": "tsc --noEmit && jest"
},
"author": "",
"license": "ISC",
"types": "./typings/src/index.d.ts",
"files": [
"build/src",
"typings/src"
],
"devDependencies": {
"@types/jest": "^23.3.9",
"@types/react": "^16.4.18",
"@types/react-dom": "^16.0.9",
"@types/react-redux": "^6.0.9",
"jest": "^23.6.0",
"prettier": "^1.14.3",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-redux": "^5.1.0",
"react-testing-library": "^5.2.3",
"ts-jest": "^23.10.4",
"typescript": "~3.1.6"
},
"peerDependencies": {
"redux": "^4.0.0"
},
"dependencies": {
"immer": "^1.7.4"
}
"name": "@epeli/redux-stack",
"version": "0.7.1",
"description": "",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"repository": {
"url": "https://github.com/epeli/redux-stack"
},
"scripts": {
"test": "npm run dtslint && jest",
"build": "npm run test && tsc --project tsconfig.build.json && rm -rf lib && mv build/src lib && rm -rf build",
"clean": "rm -rf lib build",
"dtslint": "tslint --project tsconfig.dtslint.json",
"prepublish": "npm run build"
},
"author": "",
"license": "ISC",
"files": [
"lib"
],
"devDependencies": {
"@types/jest": "^23.3.9",
"@types/react": "^16.4.18",
"@types/react-dom": "^16.0.9",
"@types/react-redux": "^6.0.9",
"dtslint": "^0.3.0",
"jest": "^23.6.0",
"prettier": "^1.14.3",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-redux": "^5.1.0",
"react-testing-library": "^5.2.3",
"ts-jest": "^23.10.4",
"typescript": "~3.1.6"
},
"peerDependencies": {
"redux": "^4.0.0"
},
"dependencies": {
"immer": "^1.7.4"
}
}
11 changes: 11 additions & 0 deletions tsconfig.build.json
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"exclude": ["__dtslint__"],
"compilerOptions": {
"sourceMap": true,
"noEmit": false,
"outDir": "./build",
"declaration": true,
"declarationDir": "./build"
}
}
4 changes: 4 additions & 0 deletions tsconfig.dtslint.json
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": []
}
12 changes: 3 additions & 9 deletions tsconfig.json
Expand Up @@ -2,18 +2,12 @@
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": ["es6", "dom"],
"sourceMap": true,
"outDir": "./build",
"declaration": true,
"declarationDir": "./typings",
"noEmit": true,
"jsx": "react",
"lib": ["esnext", "dom"],
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"strict": true,
"esModuleInterop": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true
"esModuleInterop": true
}
}
6 changes: 6 additions & 0 deletions tslint.json
@@ -0,0 +1,6 @@
{
"rulesDirectory": "./node_modules/dtslint/bin/rules",
"rules": {
"expect": true
}
}

0 comments on commit 0640060

Please sign in to comment.