Skip to content

Commit

Permalink
build: v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-kozel committed Apr 28, 2023
1 parent cab1a5f commit a8b2f08
Show file tree
Hide file tree
Showing 24 changed files with 10,568 additions and 8,944 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: '13.x'
node-version: '14.x'

- name: Install
run: yarn
Expand All @@ -27,4 +27,4 @@ jobs:
run: npm run lint:tslint

- name: Test
run: npm run ci:test
run: npm t -- --ci --coverage && cat ./dist/jest/coverage/lcov.info
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

```bash
npm i react-native-eva-icons
# Using Yarn?
# yarn add react-native-eva-icons
```

This framework assumes you have already installed **react-native-svg**, but if not - you should [install it][link:react-native-svg:install] too.
Expand All @@ -20,7 +22,7 @@ Icons can be used by it's name using only `Icon` component.
import { Icon } from 'react-native-eva-icons';

export const GithubIcon = () => (
<Icon name='github' width={48} height={48}/>
<Icon name='github' width={48} height={48} fill='green' />
);
```

Expand All @@ -30,7 +32,7 @@ You can also use a direct imports.
import GithubIcon from 'react-native-eva-icons/icons/Github';

export const GithubIcon = () => (
<GithubIcon width={48} height={48}/>
<GithubIcon width={48} height={48} fill='green' />
);
```

Expand All @@ -44,7 +46,7 @@ For example, you can change icon fill color with the following code
import { Icon } from 'react-native-eva-icons';

export const GithubIcon = () => (
<Icon name='github' fill='red'/>
<Icon name='github' fill='green' />
);
```

Expand All @@ -59,15 +61,15 @@ import { Icon } from 'react-native-eva-icons';

export const GithubIcon = () => {

const iconRef = React.useRef();
const iconRef = React.useRef(null);

const onIconPress = () => {
iconRef.current?.startAnimation();
};

return (
<TouchableWithoutFeedback onPress={onIconPress}>
<Icon ref={iconRef} animation='pulse' name='activity' />
<Icon ref={iconRef} animation='pulse' name='activity' fill='green' />
</TouchableWithoutFeedback>
);
};
Expand Down
22 changes: 0 additions & 22 deletions jest.config.js

This file was deleted.

7 changes: 7 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
transform: {
'^.+\\.jsx$': 'babel-jest',
'^.+\\.tsx?$': 'ts-jest',
},
coverageDirectory: './dist/jest/coverage',
};
4 changes: 2 additions & 2 deletions lib/animation/animationRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ViewStyle } from 'react-native';
import { ViewProps } from 'react-native';
import {
Animation,
AnimationConfig,
Expand All @@ -7,7 +7,7 @@ import { ZoomAnimation } from './zoomAnimation';
import { PulseAnimation } from './pulseAnimation';
import { ShakeAnimation } from './shakeAnimation';

export type IconAnimation = Animation<any, ViewStyle>;
export type IconAnimation = Animation<any, ViewProps>;

export interface IconAnimationRegistry {
zoom: IconAnimation;
Expand Down
16 changes: 8 additions & 8 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "react-native-eva-icons",
"version": "1.3.0",
"version": "1.4.0",
"description": "Eva Icons for React Native",
"repository": {
"type": "git",
"url": "git+https://github.com/artyorsh/react-native-eva-icons.git"
"url": "git+https://github.com/akveo/react-native-eva-icons.git"
},
"keywords": [
"react-native",
Expand All @@ -14,12 +14,12 @@
"author": "artyorsh",
"license": "MIT",
"bugs": {
"url": "https://github.com/artyorsh/react-native-eva-icons/issues"
"url": "https://github.com/akveo/react-native-eva-icons/issues"
},
"homepage": "https://github.com/artyorsh/react-native-eva-icons#readme",
"homepage": "https://github.com/akveo/react-native-eva-icons#readme",
"peerDependencies": {
"react": "16.5.0",
"react-native-svg": "^9.4.0"
},
"devDependencies": {}
"react": ">=16.8.6",
"react-native": ">=0.60.0",
"react-native-svg": ">=9.0.0"
}
}
70 changes: 28 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
{
"name": "react-native-eva-icons",
"version": "1.3.1",
"version": "1.4.0",
"private": true,
"description": "Eva Icons for React Native",
"workspaces": {
"packages": [
"lib",
"playground"
"lib"
]
},
"scripts": {
"playground": "yarn --cwd ./playground",
"build": "tsc",
"generate": "ts-node ./scripts/ts-node/start.ts ./lib/icons && npm run lint:all:fix",
"clean:build": "rimraf ./dist",
"clean:lib": "rimraf ./lib/icons",
"lint:tslint": "tslint -c ./tslint.json ./lib/icons/**/*.{ts,tsx}",
"lint:prettier": "prettier ./lib/icons/**/*.{ts,tsx} --single-quote --jsx-single-quote",
"lint:all": "npm run lint:prettier && npm run lint:tslint",
"lint:all:fix": "npm run lint:prettier -- --write && npm run lint:tslint -- --fix",
"release:prepare": "npm run clean:build && npm run build",
"release": "npm run clean:build && npm run build",
"publish": "npm run release:prepare && npm publish --access=public ./dist/tsc-out",
"test": "jest",
"ci:test": "npm t -- --ci --coverage && cat ./dist/jest/coverage/lcov.info | coveralls"
"build": "npm run build:lib && tsc && npm run lint",
"build:lib": "ts-node ./scripts/ts-node/start.ts ./lib/icons",
"rebuild": "npm run clean && npm run build",
"clean": "rimraf ./lib/icons ./dist",
"lint": "npm run lint:prettier && npm run lint:tslint",
"lint:tslint": "tslint -c ./tslint.json ./lib/icons/**/*.{ts,tsx} --fix",
"lint:prettier": "prettier ./lib/icons/**/*.{ts,tsx} --single-quote --jsx-single-quote --write",
"publish": "npm publish --access=public ./dist/tsc-out",
"test": "jest"
},
"repository": {
"type": "git",
Expand All @@ -41,31 +36,22 @@
},
"homepage": "https://github.com/artyorsh/react-native-eva-icons#readme",
"devDependencies": {
"@types/jest": "ts3.8",
"@types/node": "ts3.8",
"@types/react-native": "ts3.8",
"@types/rimraf": "ts3.8",
"@types/stringify-object": "ts3.8",
"babel-jest": "24.9.0",
"babel-plugin-module-resolver": "^3.2.0",
"change-case": "^3.1.0",
"coveralls": "^3.0.4",
"eva-icons": "^1.1.3",
"jest": "24.9.0",
"prettier": "^1.17.1",
"react": "16.9.0",
"react-native": "^0.61.5",
"react-native-svg": "9.13.3",
"rimraf": "^2.6.3",
"stringify-object": "^3.3.0",
"ts-jest": "^24.0.2",
"ts-node": "^8.2.0",
"tslint": "^5.16.0",
"typescript": "^3.8.3"
},
"resolutions": {
"react": ">=16.9.0",
"react-native": ">=0.61.5",
"react-native-svg": ">=9.13.3"
"@types/jest": "ts4.9",
"@types/node": "ts4.9",
"@types/react-native": "ts4.9",
"babel-jest": "29.0.3",
"change-case": "4.1.2",
"coveralls": "3.1.1",
"eva-icons": "1.1.3",
"jest": "29.0.3",
"prettier": "2.8.8",
"rimraf": "3.0.2",
"ts-jest": "29.0.5",
"ts-node": "10.9.1",
"tslint": "5.20.1",
"typescript": "4.9.5",
"react": "18.2.0",
"react-native": "0.71.7",
"react-native-svg": "13.9.0"
}
}
1 change: 0 additions & 1 deletion playground/.watchmanconfig

This file was deleted.

32 changes: 14 additions & 18 deletions playground/App.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import React from 'react';
import {
Button,
StyleSheet,
Text,
TouchableWithoutFeedback,
View,
} from 'react-native';
import { Icon } from 'react-native-eva-icons';
import { StatusBar } from 'expo-status-bar';
import { Button, StyleSheet, Text, TouchableWithoutFeedback, View } from 'react-native';
import GithubIcon from 'react-native-eva-icons/icons/Github';
import { Icon } from 'react-native-eva-icons';

export default (): React.ReactElement => {
const IconColor = 'black';

export default function App() {
const zoomIconRef: React.RefObject<Icon> = React.useRef();
const pulseIconRef: React.RefObject<Icon> = React.useRef();
const shakeIconRef: React.RefObject<Icon> = React.useRef();
Expand Down Expand Up @@ -46,37 +42,37 @@ export default (): React.ReactElement => {

return (
<View style={styles.container}>

<StatusBar style='auto' />
<View style={styles.showcaseContainer}>
<Text>{'Default Icon\nIcons that are statically imported\nare not animateable'}</Text>
<GithubIcon {...styles.icon}/>
<GithubIcon {...styles.icon} fill={IconColor} />
</View>

<View style={styles.showcaseContainer}>
<Text>{'Zoom Animation\nPress to animate. Second press to stop'}</Text>
<TouchableWithoutFeedback onPress={onZoomIconPress}>
<Icon ref={zoomIconRef} width={64} height={64} name='maximize-outline' animation='zoom' />
<Icon ref={zoomIconRef} width={64} height={64} name='maximize-outline' animation='zoom' fill={IconColor} />
</TouchableWithoutFeedback>
</View>

<View style={styles.showcaseContainer}>
<Text>{'Pulse Animation\nPress to animate'}</Text>
<TouchableWithoutFeedback onPress={onPulseIconPress}>
<Icon ref={pulseIconRef} width={64} height={64} name='activity' animation='pulse' />
<Icon ref={pulseIconRef} width={64} height={64} name='activity' animation='pulse' fill={IconColor} />
</TouchableWithoutFeedback>
</View>

<View style={styles.showcaseContainer}>
<Text>{'Shake Animation\nPress to animate'}</Text>
<TouchableWithoutFeedback onPress={onShakeIconPress}>
<Icon ref={shakeIconRef} width={64} height={64} name='shake' animation='shake' />
<Icon ref={shakeIconRef} width={64} height={64} name='shake' animation='shake' fill={IconColor} />
</TouchableWithoutFeedback>
</View>

<View style={styles.showcaseContainer}>
<Text>{'Infinite Animation\nPress to start / end animation'}</Text>
<TouchableWithoutFeedback onPress={onInfiniteAnimationIconPress}>
<Icon ref={infiniteAnimationIconRef} width={64} height={64} name='star' animationConfig={{ cycles: Infinity }} />
<Icon ref={infiniteAnimationIconRef} width={64} height={64} name='star' animationConfig={{ cycles: Infinity, useNativeDriver: true }} fill={IconColor} />
</TouchableWithoutFeedback>
</View>

Expand All @@ -87,7 +83,7 @@ export default (): React.ReactElement => {

</View>
);
};
}

const styles = StyleSheet.create({
container: {
Expand All @@ -102,7 +98,7 @@ const styles = StyleSheet.create({
marginVertical: 8,
},
icon: {
// width: 64,
// height: 64,
width: 64,
height: 64,
},
});
19 changes: 10 additions & 9 deletions playground/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@
"expo": {
"name": "react-native-eva-icons-playground",
"slug": "playground",
"privacy": "public",
"sdkVersion": "36.0.0",
"platforms": [
"ios",
"android"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
Binary file added playground/assets/adaptive-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added playground/assets/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified playground/assets/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified playground/assets/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 4 additions & 20 deletions playground/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
const path = require('path');

const moduleResolverConfig = {
root: path.resolve('./'),
alias: {
'react-native-eva-icons': path.resolve(__dirname, '../lib'),
},
};

module.exports = function (api) {
module.exports = function(api) {
api.cache(true);

const presets = [
'babel-preset-expo',
];

const plugins = [
['module-resolver', moduleResolverConfig],
];

return { presets, plugins };
return {
presets: ['babel-preset-expo'],
};
};

0 comments on commit a8b2f08

Please sign in to comment.