Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a2ef501
chore: update package-lock.json
Jul 31, 2023
66d176b
feat: add TypeScript support
Jul 31, 2023
cdadace
chore(prettier): update configuration
Jul 31, 2023
118eb2e
chore(eslint): update configuration
Jul 31, 2023
ad9d586
fix(eslint): separate configs for ts files
Jul 31, 2023
4d43ca9
fix(eslint): specify directories to ignore
Jul 31, 2023
6464bd9
chore: install dependencies and edit scripts
Jul 31, 2023
5af0581
fix(babel): update configuration
Jul 31, 2023
3fc5f82
style: run lint
Jul 31, 2023
3d6f4e3
chore: add test file
Jul 31, 2023
0b3d79a
chore(ts): install ts definitions for react
Jul 31, 2023
92c44c1
chore(ts): tell TS how to handle react code
Jul 31, 2023
28861b6
chore(eslint): add new shared config
Jul 31, 2023
baa2dd8
chore: remove unnecessary engine specification
Jul 31, 2023
b1ff6f9
chore: include type declarations in build
Jul 31, 2023
b26c3b2
chore(babel): use jsx-runtime
Jul 31, 2023
5d31b54
chore(ts): specify src and out dirs
Jul 31, 2023
d2748ee
fix: set entry points for each platform
Jul 31, 2023
071afc2
chore: update and uninstall dependencies
Jul 31, 2023
e99d8fd
chore: simplify GH action for linting
Jul 31, 2023
11a061d
style: rename yaml file and workflow
Jul 31, 2023
fcd182b
fix: correct command to run for eslint
Jul 31, 2023
fd0a0f0
style: change workflow job name
Jul 31, 2023
ed5f090
chore: install missing peer dep for airbnb
Aug 1, 2023
49c8e76
chore: install ts parser
Aug 1, 2023
d3a7211
chore(eslint): add rules from expensify eslint
Aug 1, 2023
8d8c33c
chore: comment out .prettierignore
Aug 1, 2023
61147a1
chore(ts): set configuration
Aug 1, 2023
13d2a16
chore: add example code
Aug 1, 2023
027bcde
chore(prettier): add back printWidth
Aug 2, 2023
ef3377f
chore: remove platform specific entry point
Aug 2, 2023
3195d41
chore(prettier): check prettier on ci
Aug 2, 2023
fad3ad0
style: run prettier
Aug 2, 2023
247d9e5
chore: remove example web code
Aug 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 54 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,58 @@
module.exports = {
extends: 'expensify',
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.native.js', '.web.js'],
root: true,
ignorePatterns: ['node_modules', 'dist'],
plugins: ['react', 'jsx-a11y', '@typescript-eslint'],
extends: ['eslint:recommended', 'airbnb', 'plugin:react/recommended', 'plugin:react/jsx-runtime', 'plugin:jsx-a11y/recommended', 'prettier'],
rules: {
'arrow-parens': [
'error',
'as-needed',
{
requireForBlockBody: true,
},
},
],
'no-invalid-this': 'error',
'react/function-component-definition': [
'error',
{
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
},
],
'no-restricted-syntax': [
'error',
// The following four selectors prevent the usage of async/await
{
selector: 'AwaitExpression',
message: 'async/await is not allowed',
},
{
selector: 'FunctionDeclaration[async=true]',
message: 'async functions are not allowed',
},
{
selector: 'FunctionExpression[async=true]',
message: 'async functions are not allowed',
},
{
selector: 'ArrowFunctionExpression[async=true]',
message: 'async functions are not allowed',
},
{
selector: 'MethodDefinition[async=true]',
message: 'async methods are not allowed',
},
],
},
overrides: [
{
files: ['*.ts', '*.tsx'],
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended-type-checked', 'airbnb-typescript', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
},
],
};
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<!-- If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit. -->

### Details

<!-- Explanation of the change or anything fishy that is going on -->

### Related Issues

<!-- Please replace GH_LINK with the link to the GitHub issue this Pull Request is related to -->

GH_LINK

### Manual Tests

<!---
Most changes should have accompanying tests. Describe the tests you added or if no tests were added an explanation about why one was not needed.
--->

### Linked PRs

<!---
Please include links to any update PRs in repos that must change their package.json version.
--->
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: cla-assistant/github-action@948230deb0d44dd38957592f08c6bd934d96d0cf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN : ${{ secrets.CLA_BOTIFY_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_BOTIFY_TOKEN }}
with:
path-to-signatures: '${{ github.repository }}/cla.json'
path-to-document: 'https://github.com/${{ github.repository }}/blob/main/CLA.md'
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/lint.yml

This file was deleted.

38 changes: 19 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: main
ref: main

- name: Decrypt & Import OSBotify GPG key
run: |
cd .github
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output OSBotify-private-key.asc OSBotify-private-key.asc.gpg
gpg --import OSBotify-private-key.asc
cd .github
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output OSBotify-private-key.asc OSBotify-private-key.asc.gpg
gpg --import OSBotify-private-key.asc
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- name: Set up git for OSBotify
run: |
git config --global user.signingkey 367811D53E34168C
git config --global commit.gpgsign true
git config --global user.name OSBotify
git config --global user.email infra+osbotify@expensify.com
git config --global user.signingkey 367811D53E34168C
git config --global commit.gpgsign true
git config --global user.name OSBotify
git config --global user.email infra+osbotify@expensify.com

- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Generate branch name
run: echo "BRANCH_NAME=OSBotify-bump-version-$(uuidgen)" >> $GITHUB_ENV
Expand All @@ -61,27 +61,27 @@ jobs:

- name: Create pull request
run: |
gh pr create \
--title "Update version to ${{ env.NEW_VERSION }}" \
--body "Update version to ${{ env.NEW_VERSION }}"
sleep 5
gh pr create \
--title "Update version to ${{ env.NEW_VERSION }}" \
--body "Update version to ${{ env.NEW_VERSION }}"
sleep 5
env:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Auto-approve pull request
run: gh pr review --approve ${{ env.BRANCH_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Auto-merge pull request
run: gh pr merge --merge --delete-branch ${{ env.BRANCH_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build package
run: npm run build

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/style_and_syntax_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Style and Syntax Checks

on:
pull_request:
types: [opened, synchronize]

jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npx eslint src

- name: Run Prettier
run: npx prettier . --check

- name: Run TypeScript checks
run: npm run ts
32 changes: 16 additions & 16 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# The GH actions don't seem to compile and verify themselves well when Prettier is applied to them
.github/actions/javascript/**/index.js
.well-known
desktop/dist/**/*.js
dist/**/*.js
assets/animations
android
ios
vendor
package.json
package-lock.json
*.html
*.yml
*.yaml
*.css
*.scss
*.md
# .github/actions/javascript/**/index.js
# .well-known
# desktop/dist/**/*.js
# dist/**/*.js
# assets/animations
# android
# ios
# vendor
# package.json
# package-lock.json
# *.html
# *.yml
# *.yaml
# *.css
# *.scss
# *.md
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# `react-native-x-maps`

# Deploying

This repo automatically publishes to NPM when PRs are merged to main.

# Contributing

Right now, contributions to this library are done under https://github.com/Expensify/App. Please refer to that repo and all it's guidelines for contributing.
15 changes: 0 additions & 15 deletions babel.config.js

This file was deleted.

4 changes: 4 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env", ["@babel/preset-react", {"runtime": "automatic"}], "@babel/preset-typescript"],
"sourceMaps": true
}
2 changes: 0 additions & 2 deletions index.js

This file was deleted.

Loading