Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kanzitelli committed Oct 27, 2021
0 parents commit f3fc876
Show file tree
Hide file tree
Showing 11 changed files with 1,777 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['@react-native-community', 'plugin:@typescript-eslint/recommended'],
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
*.log
lib/
*.env
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
singleQuote: true,
trailingComma: 'all',
printWidth: 100,
bracketSpacing: false,
arrowParens: 'avoid',
};
15 changes: 15 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"non-interactive": true,
"git": {
"requireCleanWorkingDir": false
},
"npm": {
"publish": false
},
"src": {
"tagName": "v${version}"
},
"github": {
"release": true
}
}
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<img src="https://xxx-files.ggc.team/oss/if-component/if-component-readme.png" width="100%" title="Logo">

### Install it

```
yarn add @kanzitelli/if-component
```

### Use it

```tsx
import {If} from '@kanzitelli/if-component';

class OrdersScreen = () => {
return (
<>
<If _={loading}
_then={<LoadingIndicator />}
_else={<SomethingElse />} />
</>
)
}
```

### TS lib starter

```bash
> git clone https://github.com/kanzitelli/if-component rn-lib
> cd rn-lib && rm -rf .git
> yarn
```

Don't forget to change your lib's name in `package.json` and check other scripts.
49 changes: 49 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "rnn-layouts",
"version": "0.1.0",
"description": "🃏 Set of methods which help building initial layouts for RNN (react-native-navigation) without long boring code like {stack:component:{...}}. Also includes methods for screens registration and navigation between them.",
"author": "Batyr ([email protected])",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
"lib"
],
"scripts": {
"prebuild": "rm -rf lib",
"build": "tsc && echo Build completed!",
"postbuild": "prettier --write ./lib",
"clean": "rm -rf ./node_modules ./package-lock.json && yarn",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"format:check": "prettier --check ./src",
"format:write": "prettier --write ./src",
"release:github": "npm run build && dotenv release-it",
"release:npm:public": "npm run build && npm publish --access public",
"release:npm:private": "npm run build && npm publish",
"publish:npm": "npm run build && npm publish",
"publish:npm:next": "npm run build && npm publish --tag next"
},
"keywords": [
"react",
"react-native",
"react-native-navigation",
"rnn-layouts"
],
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-navigation": ">= 7.x.x"
},
"devDependencies": {
"@react-native-community/eslint-config": "^3.0.1",
"@tsconfig/react-native": "^1.0.4",
"@types/react": "^17.0.33",
"dotenv-cli": "^4.0.0",
"eslint": "^8.1.0",
"prettier": "^2.4.1",
"typescript": "^4.4.4"
},
"license": "MIT",
"dependencies": {
"react-native-navigation": "^7.23.1"
}
}
2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import * as React from 'react';
import {Navigation} from 'react-native-navigation';
12 changes: 12 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "@tsconfig/react-native/tsconfig.json",
"compilerOptions": {
"noEmit": false,
"rootDir": "src",
"outDir": "lib",
"declaration": true,
"skipLibCheck": true,
"module": "ES2020"
},
"exclude": ["node_modules", "lib"]
}
Loading

0 comments on commit f3fc876

Please sign in to comment.