Skip to content

Commit

Permalink
🚧 feat: add @barusu/redux-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon-clown committed Jul 3, 2020
1 parent 7526647 commit 3545616
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/redux-actions/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
root: true,
extends: [
'@barusu/eslint-config'
],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json'
},
rules: {
}
}
15 changes: 15 additions & 0 deletions packages/redux-actions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[![npm version](https://img.shields.io/npm/v/@barusu/redux-actions.svg)](https://www.npmjs.com/package/@barusu/redux-actions)
[![npm download](https://img.shields.io/npm/dm/@barusu/redux-actions.svg)](https://www.npmjs.com/package/@barusu/redux-actions)
[![npm license](https://img.shields.io/npm/l/@barusu/redux-actions.svg)](https://www.npmjs.com/package/@barusu/redux-actions)


`redux-actions` is a util package for creating async actions, async state item and reducer


# Usage

## Install
```shell
yarn add @barusu/redux-actions
```

45 changes: 45 additions & 0 deletions packages/redux-actions/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@barusu/redux-actions",
"version": "0.0.17",
"author": {
"name": "lemon-clown",
"url": "https://github.com/lemon-clown/"
},
"repository": {
"type": "git",
"url": "https://github.com/lemon-clown/barusu.git"
},
"homepage": "https://github.com/lemon-clown/barusu/tree/master/packages/redux-actions#readme",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"types": "lib/types/index.d.ts",
"source": "src/index.ts",
"license": "MIT",
"engines": {
"node": ">= 12.16.0"
},
"files": [
"lib/",
".eslintrc.js",
"CHANGELOG.md",
"LICENSE",
"README.md",
"package.json",
"!lib/**/*.js.map",
"!lib/**/*.d.ts.map"
],
"scripts": {
"start": "rollup -w -c rollup.config.js",
"prebuild": "rimraf lib/",
"build": "rollup -c rollup.config.js",
"lint:fix": "eslint 'src/**/*.{ts,tsx}' --fix",
"prepublishOnly": "cross-env ROLLUP_USE_SOURCE_MAP=false yarn build"
},
"dependencies": {},
"devDependencies": {
"@barusu/eslint-config": "^0.0.17",
"@barusu/rollup-config": "^0.0.17",
"cross-env": "^7.0.2",
"rollup": "2.16.1"
}
}
30 changes: 30 additions & 0 deletions packages/redux-actions/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import path from 'path'
import { createRollupConfig } from '@barusu/rollup-config'
import manifest from './package.json'


const resolvePath = p => path.resolve(__dirname, p)
const paths = {
eslintrc: resolvePath('.eslintrc.js'),
tsconfig: resolvePath('tsconfig.src.json'),
}


const config = createRollupConfig({
manifest,
pluginOptions: {
eslintOptions: {
configFile: paths.eslintrc,
},
typescriptOptions: {
tsconfig: paths.tsconfig,
useTsconfigDeclarationDir: true,
},
commonjsOptions: {
include: ['../../node_modules/**'],
},
}
})


export default config
14 changes: 14 additions & 0 deletions packages/redux-actions/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"module": "commonjs",
"target": "es2015"
},
"include": [
"demo",
"example",
"src",
"script",
"test"
]
}
13 changes: 13 additions & 0 deletions packages/redux-actions/tsconfig.src.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.settings",
"compilerOptions": {
"declarationDir": "lib/types",
"module": "es2015",
"rootDir": "src",
"target": "es2015",
"outDir": "lib"
},
"include": [
"src"
]
}
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"@barusu/event-bus": [
"./packages/event-bus/src"
],
"@barusu/redux-actions": [
"./packages/redux-actions/src"
],
"@barusu/rollup-config": [
"./packages/rollup-config/src"
],
Expand Down

0 comments on commit 3545616

Please sign in to comment.