Skip to content

Commit 9609262

Browse files
authored
feat: initial implementation of React Native SDK (#1)
1 parent 6ba8f9b commit 9609262

File tree

94 files changed

+16218
-7
lines changed

Some content is hidden

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

94 files changed

+16218
-7
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
charset = utf-8
9+
indent_style = tab
10+
indent_size = 2
11+
end_of_line = lf
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Bug Report
2+
description: Create a report to help us improve
3+
body:
4+
- type: textarea
5+
id: description
6+
attributes:
7+
label: Describe the bug
8+
description: A clear and concise description of what the bug is.
9+
validations:
10+
required: true
11+
- type: textarea
12+
id: repro
13+
attributes:
14+
label: Steps To Reproduce
15+
description: How do you trigger this bug? Please walk us through it step by step.
16+
value: |
17+
Steps to reproduce the behavior:
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error
22+
render: typescript
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: behavior
27+
attributes:
28+
label: Expected behavior
29+
description: A clear and concise description of what you expected to happen.
30+
validations:
31+
required: true
32+
- type: input
33+
id: clickstream-version
34+
attributes:
35+
label: ClickstreamAnalytic React Native SDK Version
36+
placeholder: e.g. 1.0.0
37+
validations:
38+
required: true
39+
- type: input
40+
id: react-native-version
41+
attributes:
42+
label: React Native version
43+
placeholder: e.g. 0.73.5
44+
validations:
45+
required: true
46+
- type: input
47+
id: platform
48+
attributes:
49+
label: The platform of the bug
50+
placeholder: |
51+
- e.g. Android/iOS/All
52+
validations:
53+
required: true
54+
- type: textarea
55+
id: logs
56+
attributes:
57+
label: Relevant log output
58+
description: >-
59+
Include any relevant log output
60+
value: |
61+
<details>
62+
<summary>Log Messages</summary>
63+
64+
```
65+
INSERT LOG MESSAGES HERE
66+
```
67+
</details>
68+
render: shell
69+
- type: dropdown
70+
id: regression
71+
attributes:
72+
label: Is this a regression?
73+
multiple: false
74+
options:
75+
- "Yes"
76+
- "No"
77+
validations:
78+
required: true
79+
- type: textarea
80+
id: regression-info
81+
attributes:
82+
label: Regression additional context
83+
placeholder: If it was a regression provide the versions used before and after the upgrade.
84+
- type: textarea
85+
id: context
86+
attributes:
87+
label: Additional context
88+
description: Add any other context about the problem here.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Feature request
2+
description: Suggest an idea for this project
3+
body:
4+
- type: textarea
5+
id: description
6+
attributes:
7+
label: Is your feature request related to a problem? Please describe.
8+
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
validations:
10+
required: true
11+
12+
- type: textarea
13+
id: proposal
14+
attributes:
15+
label: Describe the solution you'd like
16+
description: A clear and concise description of what you want to happen.
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: alternatives
22+
attributes:
23+
label: Describe alternatives you've considered
24+
description: A clear and concise description of any alternative solutions or features you've considered.
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: context
30+
attributes:
31+
label: Additional context
32+
description: Add any other context about the problem here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Issue \#
2+
<!-- If applicable, please link to issue(s) this change addresses -->
3+
4+
## Description
5+
<!-- Why is this change required? What problem does it solve? -->
6+
7+
## General Checklist
8+
<!-- Check or cross out if not relevant -->
9+
10+
- [ ] Added new tests to cover change, if needed
11+
- [ ] Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
12+
- [ ] Documentation update for the change if required
13+
- [ ] PR title conforms to conventional commit style
14+
- [ ] If breaking change, documentation/changelog update with migration instructions
15+
16+
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

.github/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
changelog:
2+
categories:
3+
- title: Feature
4+
labels:
5+
- enhancement
6+
- title: Fix
7+
labels:
8+
- bug
9+
- title: Other Changes
10+
labels:
11+
- "*"

.github/workflows/build-android.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: React Native SDK Build for Android
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build-android:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-java@v3
15+
with:
16+
distribution: 'corretto'
17+
java-version: '17'
18+
- name: Run build apk
19+
run: |
20+
yarn
21+
cd example/android
22+
./gradlew assembleDebug

.github/workflows/build-ios.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: React Native SDK Build for iOS
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build-ios:
11+
runs-on: macos-13-xl
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Initialize submodules
15+
run: |
16+
git submodule update --init
17+
- name: Run build ios
18+
run: |
19+
yarn
20+
cd example/ios && pod install && cd ..
21+
yarn build:ios

.github/workflows/build-rn.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: React Native SDK Build
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build-rn:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Run build
15+
run: |
16+
yarn
17+
yarn run build

.github/workflows/code-lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: React Native SDK Lint
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
code-lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Run package install
15+
run: yarn
16+
- name: Run code format
17+
run: yarn run format
18+
- name: Run code lint
19+
run: yarn run lint

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release Next Version
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
release_tag:
6+
description: 'Release Tag'
7+
required: true
8+
type: string
9+
env:
10+
NEW_VERSION: ${{ github.event.inputs.release_tag }}
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
ref: main
18+
fetch-depth: 0
19+
token: ${{ secrets.PROJECT_TOKEN }}
20+
- name: Modify for next release
21+
run: |
22+
chmod +x release.sh
23+
./release.sh ${{ env.NEW_VERSION }}
24+
yarn
25+
git diff
26+
git config user.name '${{ vars.USER_NAME }}'
27+
git config user.email '${{ vars.USER_EMAIL }}'
28+
git add .
29+
git commit -m 'release: clickstream React Native ${{ env.NEW_VERSION }}'
30+
git push
31+
git tag v${{ env.NEW_VERSION }}
32+
git push origin v${{ env.NEW_VERSION }}
33+
- name: Prepare release file
34+
run: |
35+
yarn
36+
yarn run pack
37+
- name: Create GitHub release
38+
uses: softprops/action-gh-release@v1
39+
with:
40+
name: "Clickstream React Native ${{ env.NEW_VERSION }}"
41+
files: |
42+
*.tgz
43+
tag_name: "v${{ env.NEW_VERSION }}"
44+
prerelease: true
45+
generate_release_notes: true

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: React Native SDK Test
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
code-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Run test
15+
run: |
16+
yarn
17+
yarn run test
18+
- name: Upload Test Report
19+
uses: codecov/codecov-action@v3
20+
with:
21+
name: report
22+
files: coverage/coverage-final.json

.github/workflows/title-lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Pull Request Title Lint
2+
3+
on:
4+
pull_request:
5+
branches: [ "*" ]
6+
7+
jobs:
8+
title-lint:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
steps:
13+
- uses: amannn/action-semantic-pull-request@v5
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
with:
17+
types: |-
18+
feat
19+
fix
20+
chore
21+
docs
22+
ci
23+
tests
24+
requireScope: false

0 commit comments

Comments
 (0)