Skip to content

Commit 4ad48fd

Browse files
committed
chore: init react-native-jsi-base-coder
0 parents  commit 4ad48fd

File tree

100 files changed

+18108
-0
lines changed

Some content is hidden

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

100 files changed

+18108
-0
lines changed

Diff for: .eslintrc.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
extends: ['plugin:@typescript-eslint/recommended', 'prettier'],
3+
parser: '@typescript-eslint/parser',
4+
plugins: ['@typescript-eslint', 'prettier', 'simple-import-sort'],
5+
ignorePatterns: ['.eslintrc.js'],
6+
rules: {
7+
'simple-import-sort/imports': [
8+
'error',
9+
{
10+
groups: [
11+
['^\\u0000'],
12+
['^react', '^@?\\w'],
13+
['^(utils)(/.*|$)'],
14+
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
15+
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
16+
],
17+
},
18+
],
19+
},
20+
};

Diff for: .gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

Diff for: .github/workflows/build-android.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build Android
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/workflows/build-android.yml'
9+
- 'android/**'
10+
- 'example/android/**'
11+
- 'yarn.lock'
12+
- 'example/yarn.lock'
13+
14+
pull_request:
15+
paths:
16+
- '.github/workflows/build-android.yml'
17+
- 'android/**'
18+
- 'example/android/**'
19+
- 'yarn.lock'
20+
- 'example/yarn.lock'
21+
22+
jobs:
23+
build_example:
24+
name: Build Android Example App
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
29+
- name: Setup JDK 1.8
30+
uses: actions/setup-java@v1
31+
with:
32+
java-version: 1.8
33+
34+
- name: Get yarn cache directory path
35+
id: yarn-cache-dir-path
36+
run: echo "::set-output name=dir::$(yarn cache dir)"
37+
38+
- name: Restore node_modules from cache
39+
uses: actions/cache@v2
40+
id: yarn-cache
41+
with:
42+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
43+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
44+
restore-keys: ${{ runner.os }}-yarn-
45+
46+
- name: Install node_modules
47+
run: yarn install --frozen-lockfile
48+
49+
- name: Install node_modules for example/
50+
run: yarn install --frozen-lockfile --cwd example
51+
52+
- name: Restore Gradle cache
53+
uses: actions/cache@v2
54+
with:
55+
path: |
56+
~/.gradle/caches
57+
~/.gradle/wrapper
58+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
59+
restore-keys: ${{ runner.os }}-gradle-
60+
61+
- name: Run Gradle Build for android/
62+
run: cd android && ./gradlew assembleDebug --build-cache && cd ..
63+
64+
- name: Run Gradle Build for example/android/
65+
run: cd example/android && ./gradlew assembleDebug --build-cache && cd ../..

Diff for: .github/workflows/build-ios.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build iOS
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/workflows/build-ios.yml'
9+
- 'ios/**'
10+
- '*.podspec'
11+
- 'example/ios/**'
12+
13+
pull_request:
14+
paths:
15+
- '.github/workflows/build-ios.yml'
16+
- 'ios/**'
17+
- '*.podspec'
18+
- 'example/ios/**'
19+
20+
jobs:
21+
build:
22+
name: Build iOS Example App
23+
runs-on: macOS-latest
24+
defaults:
25+
run:
26+
working-directory: example/ios
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
31+
- name: Get yarn cache directory path
32+
id: yarn-cache-dir-path
33+
run: echo "::set-output name=dir::$(yarn cache dir)"
34+
35+
- name: Restore node_modules from cache
36+
uses: actions/cache@v2
37+
id: yarn-cache
38+
with:
39+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
40+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
41+
restore-keys: ${{ runner.os }}-yarn-
42+
43+
- name: Install node_modules for example/
44+
run: yarn install --frozen-lockfile --cwd ..
45+
46+
- name: Restore buildcache
47+
uses: mikehardy/buildcache-action@v1
48+
continue-on-error: true
49+
50+
- name: Setup Ruby (bundle)
51+
uses: ruby/setup-ruby@v1
52+
with:
53+
ruby-version: 2.6
54+
bundler-cache: true
55+
working-directory: example/ios
56+
57+
- name: Restore Pods cache
58+
uses: actions/cache@v2
59+
with:
60+
path: |
61+
example/ios/Pods
62+
~/Library/Caches/CocoaPods
63+
~/.cocoapods
64+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
65+
restore-keys: ${{ runner.os }}-pods-
66+
67+
- name: Install Pods
68+
run: bundle exec pod check || bundle exec pod install
69+
70+
- name: Install xcpretty
71+
run: gem install xcpretty
72+
73+
- name: Build App
74+
run: "set -o pipefail && xcodebuild \
75+
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
76+
-derivedDataPath build -UseModernBuildSystem=YES \
77+
-workspace BaseCoderExample.xcworkspace \
78+
-scheme BaseCoderExample \
79+
-sdk iphonesimulator \
80+
-configuration Debug \
81+
-destination 'platform=iOS Simulator,name=iPhone 11 Pro' \
82+
build \
83+
CODE_SIGNING_ALLOWED=NO | xcpretty"

Diff for: .github/workflows/notice-yarn-changes.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Notice yarn.lock changes
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
check:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
pull-requests: write
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
14+
- name: Notice yarn.lock changes
15+
uses: Simek/yarn-lock-changes@main
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
collapsibleThreshold: '25'
19+
failOnDowngrade: 'false'
20+
path: 'yarn.lock'
21+
updateComment: 'true'

Diff for: .github/workflows/validate-android.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Validate Android
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/workflows/validate-android.yml'
9+
- 'android/**'
10+
- '.editorconfig'
11+
pull_request:
12+
paths:
13+
- '.github/workflows/validate-android.yml'
14+
- 'android/**'
15+
- '.editorconfig'
16+
17+
jobs:
18+
lint:
19+
name: Gradle Lint
20+
runs-on: ubuntu-latest
21+
defaults:
22+
run:
23+
working-directory: ./android
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Setup JDK 1.8
27+
uses: actions/setup-java@v1
28+
with:
29+
java-version: 1.8
30+
31+
- name: Get yarn cache directory path
32+
id: yarn-cache-dir-path
33+
run: echo "::set-output name=dir::$(yarn cache dir)"
34+
35+
- name: Restore node_modules from cache
36+
uses: actions/cache@v2
37+
id: yarn-cache
38+
with:
39+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
40+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
41+
restore-keys: ${{ runner.os }}-yarn-
42+
43+
- name: Install node_modules
44+
run: yarn install --frozen-lockfile --cwd ..
45+
46+
- name: Install node_modules for example/
47+
run: yarn install --frozen-lockfile --cwd ../example
48+
49+
- name: Restore Gradle cache
50+
uses: actions/cache@v2
51+
with:
52+
path: |
53+
~/.gradle/caches
54+
~/.gradle/wrapper
55+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
56+
restore-keys: ${{ runner.os }}-gradle-
57+
58+
- name: Run Gradle Lint
59+
run: ./gradlew lint --build-cache
60+
61+
- name: Parse Gradle Lint Report
62+
uses: yutailang0119/[email protected]
63+
with:
64+
xml_path: android/build/reports/lint-results.xml

Diff for: .github/workflows/validate-cpp.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Validate C++
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/workflows/validate-cpp.yml'
9+
- 'cpp/**'
10+
- 'android/src/main/cpp/**'
11+
12+
pull_request:
13+
paths:
14+
- '.github/workflows/validate-cpp.yml'
15+
- 'cpp/**'
16+
- 'android/src/main/cpp/**'
17+
18+
jobs:
19+
lint:
20+
name: cpplint
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- uses: reviewdog/action-cpplint@master
26+
with:
27+
github_token: ${{ secrets.github_token }}
28+
reporter: github-pr-review
29+
flags: --linelength=230
30+
targets: --recursive cpp android/src/main/cpp
31+
filter: "-legal/copyright\
32+
,-readability/todo\
33+
,-build/namespaces\
34+
,-whitespace/comments\
35+
,-build/include_order\
36+
"

Diff for: .github/workflows/validate-js.yml

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Validate JS
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/workflows/validate-js.yml'
9+
- 'src/**'
10+
- '*.json'
11+
- '*.js'
12+
- '*.lock'
13+
- 'example/src/**'
14+
- 'example/*.json'
15+
- 'example/*.js'
16+
- 'example/*.lock'
17+
- 'example/*.tsx'
18+
19+
pull_request:
20+
paths:
21+
- '.github/workflows/validate-js.yml'
22+
- 'src/**'
23+
- '*.json'
24+
- '*.js'
25+
- '*.lock'
26+
- 'example/src/**'
27+
- 'example/*.json'
28+
- 'example/*.js'
29+
- 'example/*.lock'
30+
- 'example/*.tsx'
31+
32+
jobs:
33+
compile:
34+
name: Compile JS (tsc)
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
39+
- name: Install reviewdog
40+
uses: reviewdog/action-setup@v1
41+
42+
- name: Get yarn cache directory path
43+
id: yarn-cache-dir-path
44+
run: echo "::set-output name=dir::$(yarn cache dir)"
45+
46+
- name: Restore node_modules from cache
47+
uses: actions/cache@v2
48+
id: yarn-cache
49+
with:
50+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
51+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
52+
restore-keys: ${{ runner.os }}-yarn-
53+
54+
- name: Install node_modules
55+
run: yarn install --frozen-lockfile
56+
57+
- name: Install node_modules (example/)
58+
run: yarn install --frozen-lockfile --cwd example
59+
60+
- name: Run TypeScript # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m
61+
run: |
62+
yarn typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee
63+
env:
64+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Run TypeScript in example/ # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m
67+
run: |
68+
cd example && yarn typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee && cd ..
69+
env:
70+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
72+
lint:
73+
name: Lint JS (eslint, prettier)
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@v2
77+
78+
- name: Get yarn cache directory path
79+
id: yarn-cache-dir-path
80+
run: echo "::set-output name=dir::$(yarn cache dir)"
81+
82+
- name: Restore node_modules from cache
83+
uses: actions/cache@v2
84+
id: yarn-cache
85+
with:
86+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
87+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
88+
restore-keys: ${{ runner.os }}-yarn-
89+
90+
- name: Install node_modules
91+
run: yarn install --frozen-lockfile
92+
93+
- name: Install node_modules (example/)
94+
run: yarn install --frozen-lockfile --cwd example
95+
96+
- name: Run ESLint
97+
run: yarn lint:ci
98+
99+
- name: Verify no files have changed after auto-fix
100+
run: git diff --exit-code HEAD

0 commit comments

Comments
 (0)