Skip to content

Commit b9657b7

Browse files
committed
feat: updating all source code to latest versions of rollup, react-native and removed styled-compoents and lodash dependencies from package.
1 parent a535194 commit b9657b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+12958
-14316
lines changed

.eslintrc.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ yarn-error.log
1616
build/
1717

1818
# CocoaPods
19-
/ios/Pods/
19+
/ios/Pods/
20+
21+
.pnp*
22+
23+
.yarn

README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,60 @@ An elegant Toast solution for react-native apps. Built using Typescript, hooks a
2020
Check out the docs [here](https://mcodex.dev/react-native-rooster) for installation and usage instructions
2121

2222
<hr/>
23-
Pull requests are always welcome ❤️
23+
Pull requests are always welcome ❤️
24+
25+
## 🛠️ Development
26+
Follow these steps to set up the project locally and contribute:
27+
28+
1. Clone the repository
29+
```bash
30+
git clone https://github.com/mcodex/react-native-rooster.git
31+
cd react-native-rooster
32+
```
33+
2. Install dependencies
34+
```bash
35+
yarn install # install library dependencies
36+
cd example && yarn install # install example app dependencies
37+
```
38+
3. Run the example app
39+
```bash
40+
cd example
41+
yarn start # start Metro bundler
42+
yarn ios # run on iOS simulator (or yarn android)
43+
```
44+
4. Build the library
45+
```bash
46+
cd react-native-rooster
47+
yarn build # compile TypeScript and bundle with Rollup
48+
```
49+
4.1 Use yalc for local integration testing
50+
Install yalc globally if you haven't already:
51+
```bash
52+
npm install -g yalc # or yarn global add yalc
53+
```
54+
Publish the freshly built package:
55+
```bash
56+
yalc publish # pushes lib to local yalc store
57+
```
58+
Link into the example app:
59+
```bash
60+
cd example
61+
yalc add react-native-rooster # installs the local package
62+
yarn install # ensure dependencies are up to date
63+
```
64+
Now run the example to verify changes:
65+
```bash
66+
yarn start # start Metro bundler
67+
yarn ios || yarn android # launch on simulator/device
68+
```
69+
5. Run tests and lint
70+
```bash
71+
yarn test # run Jest unit tests
72+
yarn lint # run ESLint
73+
```
74+
6. Release process
75+
- Bump version in `package.json`
76+
- Commit changes and create a Git tag
77+
- Push to GitHub; CI will publish to npm on merge
78+
79+
Make sure to follow existing code style and add tests for new features.

babel.config.cjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
presets: ['module:metro-react-native-babel-preset'],
3+
plugins: [
4+
['@babel/plugin-transform-runtime', {
5+
helpers: true,
6+
regenerator: true
7+
}]
8+
]
9+
};

babel.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

eslint.config.js

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
const {
2+
defineConfig,
3+
} = require("eslint/config");
4+
5+
const globals = require("globals");
6+
const tsParser = require("@typescript-eslint/parser");
7+
const react = require("eslint-plugin-react");
8+
const reactHooks = require("eslint-plugin-react-hooks");
9+
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
10+
const prettier = require("eslint-plugin-prettier");
11+
12+
const {
13+
fixupPluginRules,
14+
} = require("@eslint/compat");
15+
16+
const js = require("@eslint/js");
17+
18+
const {
19+
FlatCompat,
20+
} = require("@eslint/eslintrc");
21+
22+
const compat = new FlatCompat({
23+
baseDirectory: __dirname,
24+
recommendedConfig: js.configs.recommended,
25+
allConfig: js.configs.all
26+
});
27+
28+
module.exports = defineConfig([{
29+
languageOptions: {
30+
globals: {
31+
...globals.browser,
32+
},
33+
34+
parser: tsParser,
35+
ecmaVersion: 11,
36+
sourceType: "module",
37+
38+
parserOptions: {
39+
ecmaFeatures: {
40+
jsx: true,
41+
},
42+
},
43+
},
44+
45+
extends: compat.extends(
46+
"plugin:react/recommended",
47+
"airbnb",
48+
"plugin:@typescript-eslint/recommended",
49+
"prettier/@typescript-eslint",
50+
"plugin:prettier/recommended",
51+
),
52+
53+
plugins: {
54+
react,
55+
"react-hooks": fixupPluginRules(reactHooks),
56+
"@typescript-eslint": typescriptEslint,
57+
prettier,
58+
},
59+
60+
rules: {
61+
"prettier/prettier": "error",
62+
"react-hooks/rules-of-hooks": "error",
63+
"react-hooks/exhaustive-deps": "warn",
64+
65+
"react/jsx-filename-extension": [1, {
66+
extensions: [".tsx"],
67+
}],
68+
69+
"import/prefer-default-export": "off",
70+
"react/jsx-one-expression-per-line": "off",
71+
"react/jsx-props-no-spreading": "off",
72+
"no-unused-expressions": "off",
73+
"react/prop-types": "off",
74+
75+
"@typescript-eslint/explicit-function-return-type": ["error", {
76+
allowExpressions: true,
77+
}],
78+
79+
"import/extensions": ["error", "ignorePackages", {
80+
ts: "never",
81+
tsx: "never",
82+
}],
83+
},
84+
85+
settings: {
86+
"import/resolver": {
87+
typescript: {},
88+
},
89+
},
90+
}]);

example/.buckconfig

Lines changed: 0 additions & 6 deletions
This file was deleted.

example/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

example/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
};

example/.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)