Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert NPM package to TS #2

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0c3df59
Change package name for fork
markerikson Feb 21, 2020
32536bc
Add TSDX
markerikson Feb 21, 2020
256d474
Copy and tweak tsconfig from RTK
markerikson Feb 21, 2020
4c8371a
Add Redux dev dep
markerikson Feb 21, 2020
4c17c62
Add Prettier
markerikson Feb 21, 2020
8cd5d55
Add Prettier config
markerikson Feb 21, 2020
b52c6c2
Initial TS conversion
markerikson Feb 21, 2020
7af1956
Add API Extractor
markerikson Feb 21, 2020
3b095a4
Add API Extractor config
markerikson Feb 21, 2020
2c78d93
Move TS files to /src
markerikson Feb 21, 2020
8e1d32b
Add build scripts
markerikson Feb 21, 2020
878c3fc
Add release annotations to exported types
markerikson Feb 21, 2020
4f48dc4
Add API Extractor output file
markerikson Feb 21, 2020
47ee2cd
Add Jest types
markerikson Feb 21, 2020
dfcd597
Add dummy ESLint and test file
markerikson Feb 21, 2020
41052fc
Skip linting Markdown (ie README)
markerikson Feb 21, 2020
565c6c8
Add .gitignore
markerikson Feb 21, 2020
cb30080
Format README
markerikson Feb 21, 2020
3150981
Fix file references in package.json
markerikson Feb 21, 2020
f314682
Convince TS this is legal
markerikson Feb 21, 2020
8617710
Try changing the exported types
markerikson Feb 21, 2020
a2e0741
More types fixing
markerikson Feb 21, 2020
eb3d2b3
Export some interfaces instead
markerikson Feb 21, 2020
15f55b5
Reset version
markerikson Feb 21, 2020
99cdd0a
v0.0.1
markerikson Feb 21, 2020
ebc661b
Try simplifying Travis and test command
markerikson Feb 21, 2020
9a39f86
Paste Travis config from RTK
markerikson Feb 21, 2020
ecdfbc2
Yarn!
markerikson Feb 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 9 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
sudo: required
dist: trusty
language: node_js
node_js:
- "6"
cache:
directories:
- $HOME/.yarn-cache
- node_modules
node_js: node
env:
- CXX=g++-4.8
addons:
apt:
sources:
- google-chrome
- ubuntu-toolchain-r-test
packages:
- google-chrome-stable
- g++-4.8

- TYPESCRIPT_VERSION=rc
- TYPESCRIPT_VERSION=3.7
- TYPESCRIPT_VERSION=3.6
- TYPESCRIPT_VERSION=3.5
install:
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16"
- npm install -g yarn
- yarn install

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start &
- sleep 3

script:
- yarn test
- cd npm-package
- yarn --ignore-scripts
- yarn add typescript@$TYPESCRIPT_VERSION
script: yarn prepare
3 changes: 3 additions & 0 deletions npm-package/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"root": true
}
14 changes: 14 additions & 0 deletions npm-package/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DS_Store
*.log
node_modules
dist
lib
es
yarn.lock


.idea/
.vscode/
temp/

.rts2*
3 changes: 3 additions & 0 deletions npm-package/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/dist/**
**/etc/**
**/temp/**
4 changes: 4 additions & 0 deletions npm-package/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
64 changes: 38 additions & 26 deletions npm-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,46 @@

## Usage

Install:
```
npm install --save redux-devtools-extension
```
and use like that:
```js
import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';

const store = createStore(reducer, composeWithDevTools(
applyMiddleware(...middleware),
Install:

```
npm install --save redux-devtools-extension
```

and use like that:

```js
import { createStore, applyMiddleware } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'

const store = createStore(
reducer,
composeWithDevTools(
applyMiddleware(...middleware)
// other store enhancers if any
));
```
or if needed to apply [extension’s options](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md#windowdevtoolsextensionconfig):
```js
import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';

const composeEnhancers = composeWithDevTools({
// Specify here name, actionsBlacklist, actionsCreators and other options
});
const store = createStore(reducer, composeEnhancers(
applyMiddleware(...middleware),
)
)
```

or if needed to apply [extension’s options](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md#windowdevtoolsextensionconfig):

```js
import { createStore, applyMiddleware } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'

const composeEnhancers = composeWithDevTools({
// Specify here name, actionsBlacklist, actionsCreators and other options
})
const store = createStore(
reducer,
composeEnhancers(
applyMiddleware(...middleware)
// other store enhancers if any
));
```
There’re just [few lines of code](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/npm-package/index.js). If you don’t want to allow the extension in production, just use ‘redux-devtools-extension/developmentOnly’ instead of ‘redux-devtools-extension’.
)
)
```

There’re just [few lines of code](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/npm-package/index.js). If you don’t want to allow the extension in production, just use ‘redux-devtools-extension/developmentOnly’ instead of ‘redux-devtools-extension’.

## License

Expand Down
Loading