diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 3198d4e..6386cc9 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -81,7 +81,7 @@ rules: - error - 300 max-lines-per-function: - - error + - warn - max: 20 no-console: error no-duplicate-imports: error @@ -100,7 +100,7 @@ rules: - .js - .jsx react/prop-types: error - sort-imports: error + sort-imports: warn sort-keys: - error - asc diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/.github/ISSUE_TEMPLATE/BUG_REPORT.md new file mode 100644 index 0000000..ee5a2c5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.md @@ -0,0 +1,174 @@ +--- +name: "πŸ› Bug Report" +about: Report a bug in the library. +title: 'Bug: ' +labels: [ 'bug report' ] +--- + + + +## βœ… Checklist + +- [ ] I have searched + through [this library's GitHub issues](https://github.com/hossein-zare/react-native-dropdown-picker/issues) + and am satisfied that this bug report is not a duplicate +- [ ] I have checked that my bug is present + in [the latest version of this library](https://www.npmjs.com/package/react-native-dropdown-picker) +- [ ] I have + searched [this library's GitHub issues](https://github.com/hossein-zare/react-native-dropdown-picker/issues) + and [this library's docs](https://hossein-zare.github.io/react-native-dropdown-picker-website/docs) + and am satisfied that this is indeed a bug rather than simply something I + don't know how to do (if so, make a question/help issue instead) +- [ ] My bug comes from this library and not others, e.g. React Native or + another dependency in my project +- [ ] I understand that each bug should be submitted in its own issue. + Therefore, this issue will contain only one bug, and I will submit any + different bugs in their own, separate issues + +## πŸ€” Summary + + + +## ⚠️ The problem + +### Desired (expected, correct) behaviour + + + +### Actual (unexpected, incorrect) behaviour + + + +### Screenshots/screen recording + + + +### Conditions + + + +### Code + + + +### Log/error output + + + +## πŸ’» Environment + +### react-native-dropdown-picker version + + + +### Node and npm versions + + + +### React, React Native, and Expo versions + + + +### Package.json contents + + + +### Platform/s + + + +### JavaScript or TypeScript + + + +### Class component or function component + + + +## πŸ” Reproducing the bug + +### Steps To Reproduce + +1. Do this +2. Then this +3. .... +4. Bug appears + + + +### Minimal reproducible example + + + +Link to minimal reproducible example: + +## 🏁 Final details + +### Steps to fix + + + +### Additional context/info + + diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md new file mode 100644 index 0000000..f20c527 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md @@ -0,0 +1,110 @@ +--- +name: "πŸš€ Feature request" +about: Request a new feature to be added to this library. +title: 'Feature request: ' +labels: [ 'feature request' ] +--- + + + +## βœ… Checklist + +- [ ] I have searched + through [this library's GitHub issues](https://github.com/hossein-zare/react-native-dropdown-picker/issues) + and am satisfied that this feature request is not a duplicate +- [ ] I have searched + through [this library's GitHub issues](https://github.com/hossein-zare/react-native-dropdown-picker/issues) + and + read [this library's docs](https://hossein-zare.github.io/react-native-dropdown-picker-website) + and am satisfied that this feature request is not implemented in the most + recent version of the library +- [ ] I understand that each feature request should be submitted in its own + issue. Therefore, this issue will contain only one feature request, and I will + submit any different feature requests in their own, separate issues + +## πŸ€” Overview + +### Summary + + + +### User story + + + +## πŸ’‘ Details + +### What + + + +### Who + + + +### When + + + +### Why + + + +### How + + + +## 🏁 Final details + +### Similar/same functionality elsewhere + + + +### Possible alternatives + + + +### Additional context/info + + diff --git a/.github/ISSUE_TEMPLATE/QUESTION_OR_HELP.md b/.github/ISSUE_TEMPLATE/QUESTION_OR_HELP.md new file mode 100644 index 0000000..454d67b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/QUESTION_OR_HELP.md @@ -0,0 +1,149 @@ +--- +name: "❓ Question or help" +about: Ask a question or for help using the library. +title: 'Question/help: ' +labels: [ 'help needed' ] +--- + + + +## βœ… Checklist + +- [ ] I have searched through + the [other issues for this library](https://github.com/hossein-zare/react-native-dropdown-picker/issues) + and am satisfied that my problem is not a duplicate. +- [ ] I have checked and + read [this library's docs](https://hossein-zare.github.io/react-native-dropdown-picker-website) + to try and resolve my problem by myself +- [ ] I have checked and + read [this library's GitHub issues](https://github.com/hossein-zare/react-native-dropdown-picker/issues) + to try and resolve my problem by myself +- [ ] I have checked and + read [Stack Overflow](https://stackoverflow.com/questions/tagged/react-native-dropdown-picker) + to try and resolve my problem by myself +- [ ] My problem relates to this library and not others, e.g. React Native or + another dependency in my project +- [ ] I understand that each question/problem should be submitted in its own + issue. Therefore, this issue will contain only one such problem, and I will + submit any different problems in their own, separate issues + +### Relevant docs pages + + + +### Relevant issues + + + +### Relevant Stack Overflow questions + + + +## πŸ€” Summary + +### Overview + + + +### User story + + + +## ⚠️ The problem + +### What I need help with + + + +### Code + + + +### Log/error output + + + +### Screenshots + + + +## πŸ’» Environment + +### react-native-dropdown-picker version + + + +### Node and npm versions + + + +### React, React Native, and Expo versions + + + +### Package.json contents + + + +### Platform/s + + + +### JavaScript or TypeScript + + + +### Class component or function component + + + +## 🏁 Additional context/info + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..b56dffb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: πŸ“ƒ Documentation Issue + url: https://github.com/hossein-zare/react-native-dropdown-picker-website + about: If something is missing or incorrect in our docs, please file an issue here. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..4d435c0 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,118 @@ + + +## βœ… Checklist + + + +- [ ] I have + followed [the contributing guidance](https://github.com/hossein-zare/react-native-dropdown-picker/blob/dev-5.x/CONTRIBUTING.md). +- [ ] I have + read [this library's docs](https://hossein-zare.github.io/react-native-dropdown-picker-website/docs), + and it is still sensible to make these changes +- [ ] I have + read [this library's GitHub issues](https://github.com/hossein-zare/react-native-dropdown-picker/issues), + and it is still sensible to make these changes +- [ ] + I [made an issue](https://github.com/hossein-zare/react-native-dropdown-picker/issues) + for the new feature/bug fix/etc this PR implements +- [ ] + This [PR is linked to its relevant issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) +- [ ] I + have [tested my changes and this library as a whole with npm pack](https://dev.to/scooperdev/use-npm-pack-to-test-your-packages-locally-486e), + and everything works +- [ ] My changes pass all the + repo's [CI/status checks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks), + including the Prettier and ESLint checks +- [ ] I + have [squashed all my changes into one commit](https://www.geeksforgeeks.org/git-squash/) +- [ ] My single commit message conforms + to [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/#summary) +- [ ] I added/changed automated tests to ensure my feature works correctly and + continues to do so +- [ ] I + have [kept my changes up-to-date with those in the `dev-5.x` (default) branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch) +- [ ] My changes do not require changing this library's docs: they are + up-to-date and comprehensive even with my changes +- [ ] My changes require this library's docs to be updated and/or completed to + include all relevant and up-to-date information +- [ ] I have made a separate PR + in [the docs repo](https://github.com/hossein-zare/react-native-dropdown-picker-website) + to update them in light of this PR +- [ ] I understand that each atomic change (e.g. fixing one bug or adding one + feature) should be submitted in its own PR. Therefore, this PR will contain + only one such atomic change, and I will submit any different changes in their + own, separate PRs + +## πŸ‘€ Relevant issue(s) + + + +- Fixes bug # +- Implements feature request # +- Fixes bug # + +## πŸ“ˆ Changes made + +### What + + + +### Why + + + +### How + + + +### Tests + + + +## 🏁 Final details + +### Relevant docs pages + + + +### Help required + + + +### Additional context/info + + diff --git a/.github/assets/images/screenshots/badges.png b/.github/assets/images/screenshots/badges.png new file mode 100644 index 0000000..5827811 Binary files /dev/null and b/.github/assets/images/screenshots/badges.png differ diff --git a/.github/assets/images/screenshots/basic.png b/.github/assets/images/screenshots/basic.png new file mode 100644 index 0000000..d13464a Binary files /dev/null and b/.github/assets/images/screenshots/basic.png differ diff --git a/.github/assets/images/screenshots/dark_theme_parent_items.png b/.github/assets/images/screenshots/dark_theme_parent_items.png new file mode 100644 index 0000000..b75536b Binary files /dev/null and b/.github/assets/images/screenshots/dark_theme_parent_items.png differ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f70e20c..f612b98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,12 +9,12 @@ jobs: # TODO: add tests including coverage - lint_files: + lint_src_files: name: Lint source files runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: 18 @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: 18 @@ -65,7 +65,7 @@ jobs: name: Search for TODOs etc runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Search for TODO, FIXME, and BUG statements in source files run: > if grep @@ -86,31 +86,37 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Check spelling with typos uses: crate-ci/typos@master with: config: .typos.toml - lint_markdown_files: - name: Lint Markdown files + run-misc-lints: + name: Lint misc. filetypes runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: articulate/actions-markdownlint@v1 + - uses: actions/checkout@v4 + - name: Lint YAML files with yamllint + uses: ibiqlik/action-yamllint@v3 + - name: Lint Markdown files with MarkdownLint + uses: articulate/actions-markdownlint@v1 with: files: '*.md' ignore: '**/node_modules' + - name: Lint shell script files with ShellCheck + uses: azohra/shell-linter@latest commitlint: name: Enforce Conventional Commits runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check the commits conform to the Conventional Commits specification with commitlint uses: wagoid/commitlint-github-action@v5 # TODO: check commits squashed into one (i.e. all changes in a PR are in one commit after last one in primary branch) -# TODO: use release-please to increment version number, update changelog, and publish releases automatically if CI passes \ No newline at end of file +# TODO: use semver to increase version numbers and update changelog automatically +# TODO: publish new release automatically if version increased and CI passes (use release-please?) \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..ba250f0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,146 @@ +# πŸ’– Contributing to [React Native Dropdown Picker](https://github.com/hossein-zare/react-native-dropdown-picker) + +Thank you for considering contributing to this library! This guide will walk you +through how to do so successfully πŸ˜ƒ + +## πŸ€” Overview + +### 🌍 General guidance + +You should +read [GitHub's general guidance on contributing to projects](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) +and [guidance on collaborating with pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests). + +### πŸ“„ Documentation + +Good and thorough documentation is important to enabling people to use a +library. Therefore, it would be greatly appreciated if +you [contributed to this library's documentation](https://github.com/hossein-zare/react-native-dropdown-picker-website). + +### πŸ§ͺ Experimenting + +To easily and quickly test changes before needing to add them to version +control or submit them for acceptance into this library, you can +use [patch-package](https://www.npmjs.com/package/patch-package). It will let +you edit this library in your own project's npm dependencies to see which +changes work. + +## πŸ› οΈ How to contribute changes + +### βœ… Sensibility + +Read [this library's docs](https://hossein-zare.github.io/react-native-dropdown-picker-website/docs) +and +search [its GitHub issues](https://github.com/hossein-zare/react-native-dropdown-picker/issues) +to ensure your intended changes make sense. + +### 🚩 Make an issue + +Before submitting any changes, document them +in [an issue](https://github.com/hossein-zare/react-native-dropdown-picker/issues/new/choose). +For example, this might be a feature request issue for the feature you will +create or a bug report for the bug you will fix. If the issue already exists, +e.g. a bug report for the same bug you'll fix or a feature request for the same +feature you're building, skip this step. Don't make a duplicate issue. + +### 🍴 Forking + +To start work on your changes to be +submitted, [fork and clone](https://docs.github.com/en/get-started/quickstart/fork-a-repo) +this library. You should +then [create a new branch](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging) +on your fork dedicated to the changes you're making. You should +read [GitHub's docs about branches](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches). +Make sure you use a separate branch (β‡’ PR) for each atomic change (e.g. adding +one feature or fixing one bug) you are making. If you want to make multiple, do +so in separate branches, and submit them in separate PRs. Otherwise, your PRs +will bloat, and it will be hard to review, manage, and keep track of them. + +### πŸ‘©πŸΎβ€πŸ’» Make changes + +Make the changes you require to this library in your fork. Test them +with `npm pack`. It will let you build this library as if for release on npm +locally, so you can include it as a dependency in another npm package to test +it. +Read [this article](https://dev.to/scooperdev/use-npm-pack-to-test-your-packages-locally-486e) +for more information on how to use `npm pack` to test your changed version of +this library locally. + +Once you have ensured your changes work as +required, [commit your changes](https://git-scm.com/docs/git-commit) +and [push them to your fork](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository). +Then ensure that your changes pass +our [continuous integration (CI) workflow](https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration). +They will show up to you +as [status checks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks). +To do this, you may need +to [fix ESLint issues](https://eslint.org/docs/latest/use/command-line-interface#--fix) +and [reformat your code with Prettier](https://prettier.io/docs/en/cli#--write). + +Use the script `update_reformat.sh` to automatically update this library's +dependencies and reformat its code. This will help you pass our CI checks. + +Whenever applicable, add or update automated tests to check your changes work +and that they will continue to do so in the future. You +should [squash the commits you made](https://www.geeksforgeeks.org/git-squash/) +containing your changes into one single commit that conforms +to [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/#summary). + +Ensure your changes are up-to-date with those in the `dev-5.x` (default) branch. +This will mean your commit will come immediately after the last one in +the `dev-5.x` (default) branch if you +run [git log](https://git-scm.com/docs/git-log). +Read [GitHub's guidance on keeping your pull request in sync with the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch). +Doing this will prevent merge conflicts that will stop your changes being able +to be merged. + +Once you've done all this, you're ready to submit a Pull Request (PR). + +### πŸš€ Make a Pull Request + +To submit your changes for review and to have them added to this library, you +must make +a [pull request (PR)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests). +You will be ready to do so after following the instructions in the "Make +changes" section. + +You can make a PR into this +library [here](https://github.com/hossein-zare/react-native-dropdown-picker/compare). +Ensure +you [link the issue you made earlier (and any others that are relevant) to your PR](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-to-an-issue-using-the-pull-request-sidebar). + +PRs should be made against and merged into +the [`dev-5.x`](https://github.com/hossein-zare/react-native-dropdown-picker) +branch, which is set as the `default` branch on GitHub. + +You can also make +a [draft PR](https://github.blog/2019-02-14-introducing-draft-pull-requests/) +before the changes are completely finished as per the "Make changes" section. +This might be useful if you need feedback on your changes early on and before +finalizing for merging. + +Once you have made a PR, you will then get feedback from the maintainers of the +repo. This will help ensure your changes are ready to be merged. + +If required, make a separate +PR [in the docs](https://github.com/hossein-zare/react-native-dropdown-picker-website) +if your changes make its contents incorrect or if information regarding your +changes is missing from them altogether. + +## 🏁 Release process + +Releases are currently made from +the [`5.x`](https://github.com/hossein-zare/react-native-dropdown-picker/tree/5.x) +branch. To make a new release, follow these steps: + +1. Verify the development branch has all the changes desired in the release and + works well +2. Make and merge a final PR into the development branch that increments the + version number in `package.json` +3. Make and merge a PR from the development branch to the release branch +4. Using the GitHub web UI, draft a new release using the tag name `vx.x.x` + (replace the `x` values as appropriate). Use the release branch as the + target, with the release name being `vx.x.x` (again, with appropriate + numbers in place of `x`) +5. Verify in the GitHub Actions panel for the repository that `npm publish` + succeeded diff --git a/README.md b/README.md index 56539f6..5f4014d 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,29 @@ # React Native Dropdown Picker -[![react-native-dropdown-picker is released under the MIT license.](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/hossein-zare/react-native-dropdown-picker/blob/dev-5.x/LICENSE) +[![GitHub repo](https://img.shields.io/badge/GitHub_repo-grey?logo=github)](https://github.com/hossein-zare/react-native-dropdown-picker) +[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fhossein-zare%2Freact-native-dropdown-picker%2Fbadge%3Fref%3Ddev-5.x&style=flat)](https://actions-badge.atrox.dev/hossein-zare/react-native-dropdown-picker/goto?ref=dev-5.x) +[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](https://github.com/hossein-zare/react-native-dropdown-picker/blob/dev-5.x/CONTRIBUTING.md) +[![react-native-dropdown-picker is released under the MIT license.](https://img.shields.io/github/license/hossein-zare/react-native-dropdown-picker)](https://github.com/hossein-zare/react-native-dropdown-picker/blob/dev-5.x/LICENSE) [![Current npm package version.](https://img.shields.io/npm/v/react-native-dropdown-picker?color=brightgreen&label=npm%20package)](https://www.npmjs.org/package/react-native-dropdown-picker) - -[//]: # (TODO: add badge linking to GitHub repo) +![Weekly npm downloads](https://img.shields.io/npm/dw/react-native-dropdown-picker) +[![Documentation](https://img.shields.io/badge/Documentation-grey)](https://hossein-zare.github.io/react-native-dropdown-picker-website/docs) --- -## Screenshots +## πŸ“± Screenshots -

- Screenshot showing basic dropdown - Screenshot showing badges - Screenshot showing dark theme and parent items -

+[![Screenshot showing basic dropdown](.github/assets/images/screenshots/basic.png)](https://user-images.githubusercontent.com/56504893/116790110-e0b36880-aac7-11eb-9ebd-196acee64f7a.png) +[![Screenshot showing badges](.github/assets/images/screenshots/badges.png)](https://user-images.githubusercontent.com/56504893/116789802-faec4700-aac5-11eb-837b-86f18cbfcf3d.png) +[![Screenshot showing dark theme and parent items](.github/assets/images/screenshots/dark_theme_parent_items.png)](https://user-images.githubusercontent.com/56504893/116789839-2c651280-aac6-11eb-99e0-b43b608ed8c7.png) The above screenshots were taken from [this example](https://snack.expo.dev/8mHmLfcZf). -## Usage +## πŸ‘‹ Usage ### Basic usage -The following code shows basic usage of the library: +The following code shows basic usage of this library: ```javascript import React, {useState} from 'react'; @@ -77,15 +75,15 @@ export default function App() { You can find more examples in the `examples` subdirectory. This subdirectory is a working [Expo](https://github.com/expo/expo) project demonstrating this -library. It shows how to use the library with class components as well as with +library. It shows how to use this library with class components as well as with function components, and in TypeScript as well as in JavaScript. Navigate into the `examples` subdirectory, run `npm install`, and then run `npx expo start` to see the examples working. For further information on how to use this library, -read [the relevant documentation](https://hossein-zare.github.io/react-native-dropdown-picker-website/docs/usage). +read [the documentation on usage](https://hossein-zare.github.io/react-native-dropdown-picker-website/docs/usage). -## Further documentation +## πŸ“„ Further documentation The docs can be read at: [https://hossein-zare.github.io/react-native-dropdown-picker-website](https://hossein-zare.github.io/react-native-dropdown-picker-website) @@ -93,43 +91,13 @@ at: [https://hossein-zare.github.io/react-native-dropdown-picker-website](https: The docs can be edited at: [https://github.com/hossein-zare/react-native-dropdown-picker-website](https://github.com/hossein-zare/react-native-dropdown-picker-website) -## Merge and Release Process - -### Branches in use - -#### Development - -PRs should be made against and merged into -the [`dev-5.x`](https://github.com/hossein-zare/react-native-dropdown-picker) -branch, which is set as the `default` branch on GitHub. - -#### Release - -Releases are currently made from -the [`5.x`](https://github.com/hossein-zare/react-native-dropdown-picker/tree/5.x) -branch. - -### Release Process +## πŸ˜• Support and issues -To make a new release, follow these steps: +If you have questions or need help, you +can [ask a question on Stack Overflow](https://stackoverflow.com/questions/tagged/react-native-dropdown-picker) +or [make a GitHub issue](https://github.com/hossein-zare/react-native-dropdown-picker/issues/new/choose). +You can also make a GitHub issue to report a bug or make a feature request. -* Verify the development branch has all the changes desired in the release and - works well -* You can test changes to the library and experiment easily - with [patch-package](https://www.npmjs.com/package/patch-package) -* Once you have made changes, and after finalizing them, use `npm pack` - to [test your new, changed version of the library locally and check it works correctly](https://dev.to/scooperdev/use-npm-pack-to-test-your-packages-locally-486e) -* Make and merge a final PR into the development branch that increments the - version number in `package.json` -* Make and merge a PR from the development branch to the release branch -* Using the GitHub web UI, draft a new release using the tag name `vx.x.x` - (replace the `x` values as appropriate). Use the release branch as the - target, with the release name being `vx.x.x` (again, with appropriate - numbers in place of `x`) -* Verify in the GitHub Actions panel for the repository that `npm publish` - succeeded +## πŸš€οΈ Contributing -[//]: # (TODO: make templates for pull requests and issues, and CONTRIBUTING.md - include check people read docs and past issues before submitting new issues - ensure PRs tested with npm pack: https://dev.to/scooperdev/use-npm-pack-to-test-your-packages-locally-486e -) +See [CONTRIBUTING.md](https://github.com/hossein-zare/react-native-dropdown-picker/blob/dev-5.x/CONTRIBUTING.md). diff --git a/examples/App.tsx b/examples/App.tsx index 17b45b1..3773bc9 100644 --- a/examples/App.tsx +++ b/examples/App.tsx @@ -66,6 +66,7 @@ const EXAMPLE_COMPONENT_ITEMS: Array> = [ ]; type Props = Record; + interface State { currentExample: ExampleComponent; examplePickerOpen: boolean; diff --git a/examples/example-src-files/typescript-class-example.tsx b/examples/example-src-files/typescript-class-example.tsx index 51f448b..e9c8c2e 100644 --- a/examples/example-src-files/typescript-class-example.tsx +++ b/examples/example-src-files/typescript-class-example.tsx @@ -5,6 +5,7 @@ import DropDownPicker, { ItemType } from 'react-native-dropdown-picker'; interface Props { multiple: boolean; } + interface State { open: boolean; singleValue: string | null; diff --git a/examples/package-lock.json b/examples/package-lock.json index 4182973..5a6b8d1 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "expo": "^49.0.13", - "expo-status-bar": "~1.7.1", + "expo-status-bar": "~1.6.0", "react": "18.2.0", "react-native": "0.72.5", "react-native-dropdown-picker": "^5.4.6" @@ -5865,9 +5865,9 @@ } }, "node_modules/@types/node": { - "version": "20.8.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.0.tgz", - "integrity": "sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==" + "version": "20.8.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz", + "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==" }, "node_modules/@types/prop-types": { "version": "15.7.8", @@ -6676,9 +6676,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001541", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz", - "integrity": "sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw==", + "version": "1.0.30001543", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001543.tgz", + "integrity": "sha512-qxdO8KPWPQ+Zk6bvNpPeQIOH47qZSYdFZd6dXQzb2KzhnSXju4Kd7H1PkSJx6NICSMgo/IhRZRhhfPTHYpJUCA==", "funding": [ { "type": "opencollective", @@ -6964,11 +6964,11 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/core-js-compat": { - "version": "3.32.2", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.2.tgz", - "integrity": "sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ==", + "version": "3.33.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.33.0.tgz", + "integrity": "sha512-0w4LcLXsVEuNkIqwjjf9rjCoPhK8uqA4tMRh4Ge26vfLtUutshn+aRJU21I9LCJlh2QQHfisNToLjw1XEJLTWw==", "dependencies": { - "browserslist": "^4.21.10" + "browserslist": "^4.22.1" }, "funding": { "type": "opencollective", @@ -7255,9 +7255,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.537", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.537.tgz", - "integrity": "sha512-W1+g9qs9hviII0HAwOdehGYkr+zt7KKdmCcJcjH0mYg6oL8+ioT3Skjmt7BLoAQqXhjf40AXd+HlR4oAWMlXjA==" + "version": "1.4.540", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.540.tgz", + "integrity": "sha512-aoCqgU6r9+o9/S7wkcSbmPRFi7OWZWiXS9rtjEd+Ouyu/Xyw5RSq2XN8s5Qp8IaFOLiRrhQCphCIjAxgG3eCAg==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -7628,9 +7628,9 @@ } }, "node_modules/expo-status-bar": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/expo-status-bar/-/expo-status-bar-1.7.1.tgz", - "integrity": "sha512-Wkm9uCmuQQBSU+l/AekWAQ1d0FYw560yL116+OAKJDyKBOUpPURoWkFbabM1EDxv+5scTuSThr/CvsA0nsSCow==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/expo-status-bar/-/expo-status-bar-1.6.0.tgz", + "integrity": "sha512-e//Oi2WPdomMlMDD3skE4+1ZarKCJ/suvcB4Jo/nO427niKug5oppcPNYO+csR6y3ZglGuypS+3pp/hJ+Xp6fQ==" }, "node_modules/fast-glob": { "version": "3.3.1", @@ -7648,17 +7648,17 @@ } }, "node_modules/fast-xml-parser": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.1.tgz", - "integrity": "sha512-viVv3xb8D+SiS1W4cv4tva3bni08kAkx0gQnWrykMM8nXPc1FxqZPU00dCEVjkiCg4HoXd2jC4x29Nzg/l2DAA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.2.tgz", + "integrity": "sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==", "funding": [ - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" - }, { "type": "github", "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" } ], "dependencies": { @@ -8052,12 +8052,9 @@ } }, "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "engines": { "node": ">= 0.4.0" } @@ -11706,9 +11703,9 @@ } }, "node_modules/react-devtools-core": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.28.0.tgz", - "integrity": "sha512-E3C3X1skWBdBzwpOUbmXG8SgH6BtsluSMe+s6rRcujNKG1DGi8uIfhdhszkgDpAsMoE55hwqRUzeXCmETDBpTg==", + "version": "4.28.4", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.28.4.tgz", + "integrity": "sha512-IUZKLv3CimeM07G3vX4H4loxVpByrzq3HvfTX7v9migalwvLs9ZY5D3S3pKR33U+GguYfBBdMMZyToFhsSE/iQ==", "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" @@ -12768,9 +12765,9 @@ } }, "node_modules/terser": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.20.0.tgz", - "integrity": "sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.21.0.tgz", + "integrity": "sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", diff --git a/examples/package.json b/examples/package.json index f4a177d..204f7d2 100644 --- a/examples/package.json +++ b/examples/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "expo": "^49.0.13", - "expo-status-bar": "~1.7.1", + "expo-status-bar": "~1.6.0", "react": "18.2.0", "react-native": "0.72.5", "react-native-dropdown-picker": "^5.4.6" diff --git a/package-lock.json b/package-lock.json index 3caf14a..90841e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,8 @@ "devDependencies": { "@types/react": "^18.2.24", "@types/react-native": "^0.72.3", - "@typescript-eslint/eslint-plugin": "^6.7.3", - "@typescript-eslint/parser": "^6.7.3", + "@typescript-eslint/eslint-plugin": "^6.7.4", + "@typescript-eslint/parser": "^6.7.4", "eslint": "^8.50.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb-typescript": "^17.1.0", @@ -2324,9 +2324,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.0.tgz", - "integrity": "sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.1.tgz", + "integrity": "sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -3004,9 +3004,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.0.tgz", - "integrity": "sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==", + "version": "20.8.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz", + "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==", "peer": true }, "node_modules/@types/prop-types": { @@ -3070,16 +3070,16 @@ "peer": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.3.tgz", - "integrity": "sha512-vntq452UHNltxsaaN+L9WyuMch8bMd9CqJ3zhzTPXXidwbf5mqqKCVXEuvRZUqLJSTLeWE65lQwyXsRGnXkCTA==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.4.tgz", + "integrity": "sha512-DAbgDXwtX+pDkAHwiGhqP3zWUGpW49B7eqmgpPtg+BKJXwdct79ut9+ifqOFPJGClGKSHXn2PTBatCnldJRUoA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.7.3", - "@typescript-eslint/type-utils": "6.7.3", - "@typescript-eslint/utils": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/type-utils": "6.7.4", + "@typescript-eslint/utils": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -3105,15 +3105,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.3.tgz", - "integrity": "sha512-TlutE+iep2o7R8Lf+yoer3zU6/0EAUc8QIBB3GYBc1KGz4c4TRm83xwXUZVPlZ6YCLss4r77jbu6j3sendJoiQ==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.4.tgz", + "integrity": "sha512-I5zVZFY+cw4IMZUeNCU7Sh2PO5O57F7Lr0uyhgCJmhN/BuTlnc55KxPonR4+EM3GBdfiCyGZye6DgMjtubQkmA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.7.3", - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/typescript-estree": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/typescript-estree": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4" }, "engines": { @@ -3133,13 +3133,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.3.tgz", - "integrity": "sha512-wOlo0QnEou9cHO2TdkJmzF7DFGvAKEnB82PuPNHpT8ZKKaZu6Bm63ugOTn9fXNJtvuDPanBc78lGUGGytJoVzQ==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz", + "integrity": "sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3" + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -3150,13 +3150,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.3.tgz", - "integrity": "sha512-Fc68K0aTDrKIBvLnKTZ5Pf3MXK495YErrbHb1R6aTpfK5OdSFj0rVN7ib6Tx6ePrZ2gsjLqr0s98NG7l96KSQw==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.4.tgz", + "integrity": "sha512-n+g3zi1QzpcAdHFP9KQF+rEFxMb2KxtnJGID3teA/nxKHOVi3ylKovaqEzGBbVY2pBttU6z85gp0D00ufLzViQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.7.3", - "@typescript-eslint/utils": "6.7.3", + "@typescript-eslint/typescript-estree": "6.7.4", + "@typescript-eslint/utils": "6.7.4", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -3177,9 +3177,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.3.tgz", - "integrity": "sha512-4g+de6roB2NFcfkZb439tigpAMnvEIg3rIjWQ+EM7IBaYt/CdJt6em9BJ4h4UpdgaBWdmx2iWsafHTrqmgIPNw==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.4.tgz", + "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -3190,13 +3190,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.3.tgz", - "integrity": "sha512-YLQ3tJoS4VxLFYHTw21oe1/vIZPRqAO91z6Uv0Ss2BKm/Ag7/RVQBcXTGcXhgJMdA4U+HrKuY5gWlJlvoaKZ5g==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz", + "integrity": "sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3217,17 +3217,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.3.tgz", - "integrity": "sha512-vzLkVder21GpWRrmSR9JxGZ5+ibIUSudXlW52qeKpzUEQhRSmyZiVDDj3crAth7+5tmN1ulvgKaCU2f/bPRCzg==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.4.tgz", + "integrity": "sha512-PRQAs+HUn85Qdk+khAxsVV+oULy3VkbH3hQ8hxLRJXWBEd7iI+GbQxH5SEUSH7kbEoTp6oT1bOwyga24ELALTA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.7.3", - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/typescript-estree": "6.7.3", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/typescript-estree": "6.7.4", "semver": "^7.5.4" }, "engines": { @@ -3242,12 +3242,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.3.tgz", - "integrity": "sha512-HEVXkU9IB+nk9o63CeICMHxFWbHWr3E1mpilIQBe9+7L/lH97rleFLVtYsfnWB+JVMaiFnEaxvknvmIzX+CqVg==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", + "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.3", + "@typescript-eslint/types": "6.7.4", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -3962,9 +3962,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001541", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz", - "integrity": "sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw==", + "version": "1.0.30001543", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001543.tgz", + "integrity": "sha512-qxdO8KPWPQ+Zk6bvNpPeQIOH47qZSYdFZd6dXQzb2KzhnSXju4Kd7H1PkSJx6NICSMgo/IhRZRhhfPTHYpJUCA==", "funding": [ { "type": "opencollective", @@ -4217,12 +4217,12 @@ "peer": true }, "node_modules/core-js-compat": { - "version": "3.32.2", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.2.tgz", - "integrity": "sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ==", + "version": "3.33.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.33.0.tgz", + "integrity": "sha512-0w4LcLXsVEuNkIqwjjf9rjCoPhK8uqA4tMRh4Ge26vfLtUutshn+aRJU21I9LCJlh2QQHfisNToLjw1XEJLTWw==", "peer": true, "dependencies": { - "browserslist": "^4.21.10" + "browserslist": "^4.22.1" }, "funding": { "type": "opencollective", @@ -4484,9 +4484,9 @@ "peer": true }, "node_modules/electron-to-chromium": { - "version": "1.4.537", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.537.tgz", - "integrity": "sha512-W1+g9qs9hviII0HAwOdehGYkr+zt7KKdmCcJcjH0mYg6oL8+ioT3Skjmt7BLoAQqXhjf40AXd+HlR4oAWMlXjA==", + "version": "1.4.540", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.540.tgz", + "integrity": "sha512-aoCqgU6r9+o9/S7wkcSbmPRFi7OWZWiXS9rtjEd+Ouyu/Xyw5RSq2XN8s5Qp8IaFOLiRrhQCphCIjAxgG3eCAg==", "peer": true }, "node_modules/emoji-regex": { @@ -5314,17 +5314,17 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.1.tgz", - "integrity": "sha512-viVv3xb8D+SiS1W4cv4tva3bni08kAkx0gQnWrykMM8nXPc1FxqZPU00dCEVjkiCg4HoXd2jC4x29Nzg/l2DAA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.2.tgz", + "integrity": "sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==", "funding": [ - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" - }, { "type": "github", "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" } ], "peer": true, @@ -5527,7 +5527,8 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "node_modules/function.prototype.name": { "version": "1.1.6", @@ -5723,12 +5724,9 @@ "dev": true }, "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "engines": { "node": ">= 0.4.0" } @@ -8454,9 +8452,9 @@ } }, "node_modules/react-devtools-core": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.28.0.tgz", - "integrity": "sha512-E3C3X1skWBdBzwpOUbmXG8SgH6BtsluSMe+s6rRcujNKG1DGi8uIfhdhszkgDpAsMoE55hwqRUzeXCmETDBpTg==", + "version": "4.28.4", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.28.4.tgz", + "integrity": "sha512-IUZKLv3CimeM07G3vX4H4loxVpByrzq3HvfTX7v9migalwvLs9ZY5D3S3pKR33U+GguYfBBdMMZyToFhsSE/iQ==", "peer": true, "dependencies": { "shell-quote": "^1.6.1", @@ -9493,9 +9491,9 @@ } }, "node_modules/terser": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.20.0.tgz", - "integrity": "sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.21.0.tgz", + "integrity": "sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==", "peer": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", diff --git a/package.json b/package.json index 0da2c51..a34d11e 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ "devDependencies": { "@types/react": "^18.2.24", "@types/react-native": "^0.72.3", - "@typescript-eslint/eslint-plugin": "^6.7.3", - "@typescript-eslint/parser": "^6.7.3", + "@typescript-eslint/eslint-plugin": "^6.7.4", + "@typescript-eslint/parser": "^6.7.4", "eslint": "^8.50.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb-typescript": "^17.1.0", diff --git a/update_reformat.sh b/update_reformat.sh new file mode 100644 index 0000000..2ccb56c --- /dev/null +++ b/update_reformat.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +if [ $# -ne 1 ] || [ "$1" != "-y" ] +# if num arguments supplied !== 1 or single argument supplied !== "-y" +# give feedback to user and check they want to run the script + then + echo "This script will automatically update this library's dependencies and reformat its codeπŸ˜ƒ" + echo "In the future, pass a single argument of \"-y\" to assume \"yes\" as the answer to the prompt and run non-interactively." + + while [ "$yn" != "Y" ] && [ "$yn" != "y" ] && [ "$yn" != "N" ] && [ "$yn" != "n" ] + do + + read -r -p "Do you wish run this script? (y/n): " yn + case $yn in + [Yy]* ) echo "Running script";; + [Nn]* ) echo "Exiting script"; exit 0;; + * ) echo "Please answer y for yes or n for no.";; + esac + + done +fi + +echo "β˜• Script starting. This library's dependencies will be updated and its code will be reformatted. Go get a coffee or sit back and relax!" + +echo "πŸ”„ Step 1 of 2: updating dependencies." + +echo "πŸ”„ Updating dependencies, part 1 of 3: pulling from git." + +git fetch +git pull + +echo "πŸ”„ Updating dependencies, part 2 of 3: updating dependencies of examples subdirectory." + +cd examples || exit 1 +npx --yes npm-check-updates -u --timeout 400000 +npm update +npm audit fix +npm install expo@latest +npx --yes expo install --fix +npx --yes sort-package-json +npm install +npx --yes expo install --check + +echo "πŸ”„ Updating dependencies, part 3 of 3: updating dependencies of react-native-dropdown-picker." + +cd .. || exit 1 +npx --yes npm-check-updates -u --timeout 400000 +npm update +npm audit fix +npx --yes sort-package-json +npm install + +echo "✍️ Step 2 of 2: Reformatting code." + +echo "✍️ Reformatting code, part 1 of 2: starting first pass." + +npx eslint --fix . --config .eslintrc.yaml --ignore-path .eslintignore +npx prettier --write . --config .prettierrc.yaml --ignore-path .prettierignore + +echo "✍️ Reformatting code, part 2 of 2: starting second pass." + +npx eslint --fix . --config .eslintrc.yaml --ignore-path .eslintignore +npx prettier --write . --config .prettierrc.yaml --ignore-path .prettierignore + +echo "βœ… Done!" \ No newline at end of file