-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Makefile and update dependencies
- Loading branch information
1 parent
6b336cb
commit 2ec9d90
Showing
13 changed files
with
1,896 additions
and
1,501 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,24 @@ | ||
## 📖 Description | ||
|
||
<!-- What does this pull request bring to this project? Why do we need it? --> | ||
|
||
## ⚠️ Problem | ||
|
||
<!-- Description of what is the problem that we're trying to solve --> | ||
|
||
## 🤓 Solution | ||
|
||
<!-- The most exhaustive description of what is the solution and WHY it's the best solution --> | ||
|
||
## 📝 Notes | ||
|
||
<!-- Any additional notes that might be helpful for reviewers? --> | ||
|
||
## 📓 References | ||
|
||
<!-- Does this pull request fix any reported issue (eg. `Fixes #34`) in this repository? --> | ||
|
||
## 🦀 Dispatch | ||
|
||
- `#dispatch/react` | ||
- `#dispatch/react-native` |
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
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,3 +1,4 @@ | ||
lib | ||
coverage | ||
node_modules | ||
example/.expo |
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,62 @@ | ||
# Contributing | ||
|
||
When it comes to open source, there are different ways you can contribute, all of which are valuable. Here’s few guidelines that should help you as you prepare your contribution. | ||
|
||
## Initial steps | ||
|
||
Before you start working on a contribution, create an issue describing what you want to build. It’s possible someone else is already working on something similar, or perhaps there is a reason that feature isn’t implemented. The maintainers will point you in the right direction. | ||
|
||
<!-- ## Submitting a Pull Request | ||
- Fork the repo | ||
- Clone your forked repository: `git clone [email protected]:{your_username}/react-native-killswitch.git` | ||
- Enter the directory: `cd react-native-killswitch` | ||
- Create a new branch off the `main` branch: `git checkout -b your-feature-name` | ||
- Implement your contributions (see the Development section for more information) | ||
- Push your branch to the repo: `git push origin your-feature-name` | ||
- Go to https://github.com/mirego/react-native-killswitch/compare and select the branch you just pushed in the "compare:" dropdown | ||
- Submit the PR. The maintainers will follow up. --> | ||
|
||
## Development | ||
|
||
The following steps will get you setup to contribute changes to this repo: | ||
|
||
1. Fork this repo. | ||
|
||
2. Clone your forked repo: `git clone [email protected]:{your_username}/react-native-killswitch.git` | ||
|
||
3. Run `make dependencies` to install dependencies for the library and the sample app. | ||
|
||
4. Start playing with the code! You can do some experimentation with the sample app provided in the `example` folder or start implementing a feature right away. | ||
|
||
### Commands | ||
|
||
**`make test`** | ||
|
||
- Runs all Jest tests | ||
|
||
**`make check-all`** | ||
|
||
- Runs linting, format-checking, type-checking | ||
|
||
**`make format`** | ||
|
||
- Runs formatting on the codebase | ||
|
||
**`make start-example`** | ||
|
||
- Runs the sample app with Expo | ||
|
||
### Tests | ||
|
||
react-native-killswitch uses Jest for testing. After implementing your contribution, write tests for it. Just create a new file under `src/__tests__` or add additional tests to the appropriate existing file. | ||
|
||
Before submitting your PR, run `make test` to make sure there are no (unintended) breaking changes. | ||
|
||
### Documentation | ||
|
||
The react-native-killswitch documentation lives in the README.md. Be sure to document any API changes you implement. | ||
|
||
## License | ||
|
||
By contributing your code to the react-native-killswitch GitHub repository, you agree to license your contribution under the BSD 3-Clause license. |
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,98 @@ | ||
# Build configuration | ||
# ------------------- | ||
|
||
APP_NAME = `grep -m1 name package.json | awk -F: '{ print $$2 }' | sed 's/[ ",]//g'` | ||
APP_VERSION = `grep -m1 version package.json | awk -F: '{ print $$2 }' | sed 's/[ ",]//g'` | ||
GIT_REVISION = `git rev-parse HEAD` | ||
|
||
# Linter and formatter configuration | ||
# ---------------------------------- | ||
|
||
PRETTIER_FILES_PATTERN = '{src,example}/**/*.{js,ts,tsx,svg,json}' '**/*.md' | ||
SCRIPTS_PATTERN = '{src,example}/**/*.{js,ts,tsx}' | ||
|
||
# Introspection targets | ||
# --------------------- | ||
|
||
.PHONY: help | ||
help: header targets | ||
|
||
.PHONY: header | ||
header: | ||
@echo "\033[34mEnvironment\033[0m" | ||
@echo "\033[34m---------------------------------------------------------------\033[0m" | ||
@printf "\033[33m%-23s\033[0m" "APP_NAME" | ||
@printf "\033[35m%s\033[0m" $(APP_NAME) | ||
@echo "" | ||
@printf "\033[33m%-23s\033[0m" "APP_VERSION" | ||
@printf "\033[35m%s\033[0m" $(APP_VERSION) | ||
@echo "" | ||
@printf "\033[33m%-23s\033[0m" "GIT_REVISION" | ||
@printf "\033[35m%s\033[0m" $(GIT_REVISION) | ||
@echo "\n" | ||
|
||
.PHONY: targets | ||
targets: | ||
@echo "\033[34mTargets\033[0m" | ||
@echo "\033[34m---------------------------------------------------------------\033[0m" | ||
@perl -nle'print $& if m{^[a-zA-Z_-\d]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-22s\033[0m %s\n", $$1, $$2}' | ||
|
||
# Development targets | ||
# ------------------- | ||
|
||
.PHONY: dependencies | ||
dependencies: ## Install dependencies required by the application | ||
- yarn install | ||
- yarn --cwd example install | ||
|
||
.PHONY: ci-dependencies | ||
ci-dependencies: ## Install dependencies required by the application in CI | ||
yarn install --frozen-lockfile | ||
|
||
.PHONY: ci-test | ||
ci-test: ## Run the test suite in CI | ||
CI=true yarn test --forceExit --detectOpenHandles | ||
|
||
.PHONY: test | ||
test: ## Run the test suite | ||
yarn test --forceExit --detectOpenHandles | ||
|
||
.PHONY: start-example | ||
start-example: ## Run the test suite | ||
yarn --cwd example start | ||
|
||
# Check, lint and format targets | ||
# ------------------------------ | ||
|
||
.PHONY: check | ||
check: check-format lint | ||
|
||
.PHONY: check-all | ||
check-all: check-format lint check-types | ||
|
||
.PHONY: check-format | ||
check-format: | ||
yarn prettier --check $(PRETTIER_FILES_PATTERN) | ||
|
||
.PHONY: check-types | ||
check-types: | ||
yarn tsc --noEmit | ||
|
||
.PHONY: format | ||
format: ## Format project files | ||
- yarn prettier --write $(PRETTIER_FILES_PATTERN) | ||
- yarn eslint --fix $(SCRIPTS_PATTERN) | ||
|
||
.PHONY: lint | ||
lint: ## Lint project files | ||
yarn eslint --max-warnings 0 $(SCRIPTS_PATTERN) | ||
|
||
# Release | ||
# ------------------------------ | ||
.PHONY: version | ||
version: | ||
- yarn version | ||
|
||
.PHONY: release | ||
release: | ||
- yarn run release-it |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.