-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7a4c14
commit 5c252fb
Showing
20 changed files
with
3,233 additions
and
3,064 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['backpacker-react-ts'], | ||
rules: { | ||
'import/no-extraneous-dependencies': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: '/' | ||
schedule: | ||
interval: monthly | ||
time: '03:00' | ||
open-pull-requests-limit: 10 | ||
reviewers: | ||
- calintamas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Restore yarn cache | ||
uses: actions/cache@v2 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
run: yarn --prefer-offline | ||
|
||
- name: Setup React Native environment | ||
run: | | ||
yarn add react@17.0.1 | ||
yarn add react-native@0.64.2 | ||
- name: Run tests | ||
run: yarn test --coverage | ||
|
||
- name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
lib | ||
coverage | ||
.DS_Store | ||
.git | ||
.idea | ||
node_modules | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { Cache } from './src/Cache'; | ||
export * from './src/types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
preset: 'react-native', | ||
testEnvironment: 'node', | ||
collectCoverage: true, | ||
collectCoverageFrom: ['src/**/*.{ts,tsx}'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,56 @@ | ||
{ | ||
"name": "react-native-cachemere", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "An async cache manager for React Native", | ||
"main": "index.js", | ||
"main": "./lib/index.js", | ||
"types": "./lib/types/index.d.ts", | ||
"files": [ | ||
"/lib" | ||
], | ||
"scripts": { | ||
"test": "jest" | ||
"prepare": "husky install", | ||
"build": "rm -rf ./lib && tsc", | ||
"prettier": "./node_modules/.bin/prettier --write", | ||
"lint": "./node_modules/.bin/eslint --fix", | ||
"lint-staged": "./node_modules/.bin/lint-staged", | ||
"test": "./node_modules/.bin/jest" | ||
}, | ||
"keywords": [ | ||
"cache", | ||
"react-native" | ||
], | ||
"author": "Calin Tamas <calinntamas@gmail.com>", | ||
"author": "Calin Tamas <calintamas2@gmail.com>", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/calintamas/react-native-cachemere.git" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.6.4", | ||
"@babel/preset-env": "^7.6.3", | ||
"@babel/runtime": "^7.6.3", | ||
"babel-jest": "^26.0.0", | ||
"jest": "^26.0.1" | ||
"@babel/core": "^7.15.8", | ||
"@types/jest": "^27.0.1", | ||
"eslint-config-backpacker-react-ts": "^0.1.0", | ||
"husky": "^7.0.2", | ||
"import-sort-style-module": "^6.0.0", | ||
"jest": "^27.1.1", | ||
"lint-staged": "^11.1.2", | ||
"prettier": "^2.4.1", | ||
"prettier-plugin-import-sort": "^0.0.7", | ||
"typescript": "^4.4.3", | ||
"metro-react-native-babel-preset": "^0.64.0" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.9.0", | ||
"react-native": ">=0.61.5", | ||
"@react-native-async-storage/async-storage": ">=1.8.0" | ||
}, | ||
"importSort": { | ||
".js, .jsx, .ts, .tsx": { | ||
"style": "module", | ||
"parser": "typescript" | ||
} | ||
}, | ||
"jest": { | ||
"testPathIgnorePatterns": [ | ||
"<rootDir>/node_modules" | ||
] | ||
"lint-staged": { | ||
"*.{js,jsx,ts,tsx,md}": "yarn prettier", | ||
"*.{js,jsx,ts,tsx}": "yarn lint" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { CacheOptions } from './types'; | ||
|
||
export class Cache { | ||
ttl: CacheOptions['ttl']; | ||
|
||
constructor({ ttl }: CacheOptions) { | ||
this.ttl = ttl; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* eslint-env jest */ | ||
|
||
describe('test mock', () => { | ||
it('adds 2 numbers', () => { | ||
expect(1 + 1).toBe(2); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.