Skip to content

refactor: add ndk package #1294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 35 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6dc2251
refactor: move sdk to core
a7medev Sep 29, 2024
2bffe83
chore: add ndk package
a7medev Sep 30, 2024
c21d156
refactor(android): grab android sdk's ndk version from core sdk
a7medev Oct 2, 2024
b13976e
chore: add global scripts & deps
a7medev Oct 7, 2024
3d0d7f6
chore: share git config
a7medev Oct 7, 2024
1015135
ci: resolve some issues with file locations
a7medev Oct 7, 2024
4571d08
ci: resolve some path issues
a7medev Oct 8, 2024
744652f
chore: use correct end of line on windows
a7medev Oct 8, 2024
afe9148
ci: correct some paths in custom builds
a7medev Oct 8, 2024
6f33bf3
TEMPORARILY enable release jobs on private package
a7medev Oct 8, 2024
f63c341
ci: fix config
a7medev Oct 8, 2024
a157b5b
TEMP: add version suffixes to test releases
a7medev Oct 13, 2024
7d91eee
chore: remove release deps
a7medev Oct 13, 2024
95fbaf3
TEMPORARY: add tsconfig
a7medev Oct 13, 2024
bd6d554
refactor: share tsconfig
a7medev Oct 13, 2024
91a6144
TEMP update temp versions
a7medev Oct 13, 2024
eed270f
chore: fix formatting of tsconfig.json
a7medev Oct 13, 2024
06bec6b
ci: remove temp changes in config
a7medev Oct 13, 2024
9f47759
chore: add release ndk job
a7medev Oct 15, 2024
105cea1
ci: add checkout step to ndk release
a7medev Oct 15, 2024
485e258
build: use the same tsconfig & version for ndk
a7medev Oct 15, 2024
342a5e6
fix(ndk): use builder bob for build
a7medev Oct 15, 2024
5aeb950
ci(ndk): fix temporary package name change
a7medev Oct 15, 2024
e6736fb
build: add convenient bump up script
a7medev Oct 17, 2024
6158d40
ci: add validate package versions job
a7medev Oct 17, 2024
6eb926d
ci: add ndk to snapshot generation
a7medev Oct 17, 2024
7c693d6
ci: fix snapshot version
a7medev Oct 17, 2024
6b00c19
TEMP: disable release deps
a7medev Oct 17, 2024
9a63493
chore: rename ndk to scoped package
a7medev Oct 17, 2024
8d4163b
chore: fix formatting of package.json
a7medev Oct 17, 2024
ddb8333
ci: remove temp config changes
a7medev Oct 17, 2024
271f811
fix: sync podfile
a7medev Oct 17, 2024
9565641
feat: bump core's build.gradle version in bump-up
a7medev Oct 17, 2024
4906bd6
build: fix output directories
a7medev Oct 17, 2024
8f0c73b
chore: fix formatting of package.json
a7medev Oct 17, 2024
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
118 changes: 99 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ references:
- test_module
- test_android
- validate_shell_files
- validate_package_versions
- sync_generated_files
- test_ios
- e2e_ios
Expand Down Expand Up @@ -104,17 +105,17 @@ commands:
command: rm README.md
working_directory: << parameters.working_directory >>
- find_and_replace:
files: package.json android/sourcemaps.gradle ios/sourcemaps.sh
files: core/package.json core/android/sourcemaps.gradle core/ios/sourcemaps.sh
search: instabug-reactnative
replace: << parameters.npm_package >>
working_directory: << parameters.working_directory >>
- find_and_replace:
files: cli/upload/uploadSourcemaps.ts cli/upload/uploadSoFiles.ts
files: core/cli/upload/uploadSourcemaps.ts core/cli/upload/uploadSoFiles.ts
search: api.instabug.com
replace: << parameters.api_endpoint >>
working_directory: << parameters.working_directory >>
- find_and_replace:
files: android/native.gradle
files: core/android/native.gradle
search: 'com.instabug.library:instabug:'
replace: 'com.instabug.library-<< parameters.android_package >>:instabug:'
working_directory: << parameters.working_directory >>
Expand All @@ -125,24 +126,26 @@ commands:
type: string
default: ~/project
steps:
- install_node_modules
- install_node_modules:
# Using an absolute path to avoid issues with the working directory of the parent job.
app-dir: ~/project/core
- prepare_custom_package:
npm_package: '@instabug/instabug-reactnative-dream11'
android_package: dream11
api_endpoint: st001012dream11.instabug.com
working_directory: << parameters.working_directory >>
- run:
name: Give execute permission to Dream11 script
command: chmod +x ./scripts/dream-11-delete-unused-features.sh
command: chmod +x ./scripts/prepare-dream11-sdk.sh
working_directory: << parameters.working_directory >>
- run:
name: Remove unused features
command: ./scripts/dream-11-delete-unused-features.sh
command: ./scripts/prepare-dream11-sdk.sh
working_directory: << parameters.working_directory >>
# Remove the NDK package to avoid dependency conflicts on Android.
- run:
name: Remove the NDK package
command: yarn remove instabug-reactnative-ndk
command: yarn remove @instabug/react-native-ndk
working_directory: << parameters.working_directory >>/examples/default

notify_github:
Expand Down Expand Up @@ -171,6 +174,7 @@ jobs:
lint:
executor:
name: node/default
working_directory: ~/project/core
steps:
- advanced-checkout/shallow-checkout
- install_node_modules
Expand All @@ -191,6 +195,7 @@ jobs:
default: false
executor:
name: node/default
working_directory: ~/project/core
steps:
- advanced-checkout/shallow-checkout
- steps: << parameters.prepare_steps >>
Expand Down Expand Up @@ -231,13 +236,14 @@ jobs:
condition: << parameters.collect_coverage >>
steps:
- persist_to_workspace:
root: ~/project/android/build/reports/jacoco/jacocoTestReport
root: ~/project/core/android/build/reports/jacoco/jacocoTestReport
paths:
- jacocoTestReport.xml

validate_shell_files:
machine:
image: ubuntu-2004:current
working_directory: ~/project/core
steps:
- advanced-checkout/shallow-checkout
- run:
Expand All @@ -256,7 +262,11 @@ jobs:
resource_class: macos.m1.medium.gen1
steps:
- advanced-checkout/shallow-checkout
- install_node_modules
- install_node_modules:
app-dir: core
- node/install-packages:
pkg-manager: yarn
app-dir: ndk
- node/install-packages:
pkg-manager: yarn
app-dir: examples/default
Expand All @@ -266,6 +276,26 @@ jobs:
- run: git --no-pager diff
- run: git diff-index HEAD --exit-code -p -I EXCLUDED_ARCHS # Ignore Arch Changes

# Makes sure that the instabug-reactnative package version, sub-packages versions
# and peer dependency versions are all in sync.
#
# Ideally you shouldn't be modifying them manually but rather through the scripts/bump-up.sh
# script or the convenience `yarn bump <version>` script.
validate_package_versions:
machine:
image: ubuntu-2404:current
working_directory: ~/project
steps:
- advanced-checkout/shallow-checkout
- run:
name: Install jq
command: sudo apt-get update && sudo apt-get install -y jq
- run:
name: Bump up to validate no changes
command: ./scripts/bump-up.sh $(jq -r '.version' core/package.json)
- run: git --no-pager diff
- run: git diff-index HEAD --exit-code -p

test_ios:
parameters:
prepare_steps:
Expand Down Expand Up @@ -401,16 +431,19 @@ jobs:
steps:
- advanced-checkout/shallow-checkout
- steps: << parameters.prepare_steps >>
- install_node_modules
- install_node_modules:
app-dir: core
- run:
name: Build the SDK
command: yarn build
working_directory: core
- run:
name: Authorize with NPM
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- run:
name: Publish new enterprise version
command: npm publish
working_directory: core

publish:
macos:
Expand All @@ -427,13 +460,14 @@ jobs:
working_directory: Escape/.build/release
command: cp -f Escape /usr/local/bin/escape
- install_node_modules:
app-dir: project
app-dir: project/core
- run:
working_directory: project
working_directory: project/core
command: yarn build
- run:
working_directory: project
command: Escape react-native publish

publish_new_namespace:
working_directory: ~/project
executor:
Expand Down Expand Up @@ -465,28 +499,60 @@ jobs:
name: node/default
steps:
- advanced-checkout/shallow-checkout
- install_node_modules
- run: yarn build
- run: yarn remove @instabug/danger-plugin-coverage
- install_node_modules:
app-dir: core
- install_node_modules:
app-dir: ndk
- run:
command: yarn build
working_directory: core
- run:
command: yarn build
working_directory: ndk
- run:
name: Get snapshot version
command: |
source scripts/snapshot-version.sh
echo "export SNAPSHOT_VERSION=$SNAPSHOT_VERSION" >> "$BASH_ENV"
- run:
name: Install jq
command: sudo apt-get update && sudo apt-get install -y jq
- run: yarn bump $SNAPSHOT_VERSION
- run:
name: Authorize with NPM
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- run: npm version $SNAPSHOT_VERSION --no-git-tag-version
- run: npm publish --tag snapshot
- run:
name: Install jq
command: sudo apt-get update && sudo apt-get install -y jq
command: npm publish --tag snapshot
working_directory: core
- run:
command: npm publish --tag snapshot
working_directory: ndk
- find_and_replace:
files: scripts/snapshot-comment.md
search: '{VERSION}'
replace: $SNAPSHOT_VERSION
- notify_github:
data: "$(jq -Rcs '{ body: . }' scripts/snapshot-comment.md)"

release_ndk:
working_directory: ~/project
executor:
name: node/default
steps:
- advanced-checkout/shallow-checkout
- install_node_modules:
app-dir: ndk
- run:
name: Build the SDK
command: yarn build
working_directory: ndk
- run:
name: Authorize with NPM
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- run:
name: Publish new version
command: npm publish
working_directory: ndk

workflows:
publish:
Expand All @@ -504,6 +570,7 @@ workflows:
- test_ios:
collect_coverage: true
- validate_shell_files
- validate_package_versions
- sync_generated_files
- e2e_ios
- e2e_android
Expand Down Expand Up @@ -537,6 +604,18 @@ workflows:
filters:
branches:
only: master
- hold_release_ndk:
requires: *release_dependencies
type: approval
filters:
branches:
only: master
- release_ndk:
requires:
- hold_release_ndk
filters:
branches:
only: master

- hold_release_nn:
requires: *release_dependencies
Expand Down Expand Up @@ -603,6 +682,7 @@ workflows:
- test_ios_dream11
- e2e_android_dream11
- e2e_ios_dream11
- validate_package_versions
type: approval
filters:
branches:
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Distribution
dist/
bin/
upload/*
!upload/package.json
**/dist/
**/lib/
**/bin/
**/upload/*
!**/upload/package.json

# NodeJS
node_modules/
Expand All @@ -11,6 +12,7 @@ yarn-debug.log
yarn-error.log
coverage/
.jest/cache/
.yarn/

# OSX
.DS_Store
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
78 changes: 78 additions & 0 deletions core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"name": "instabug-reactnative",
"description": "React Native plugin for integrating the Instabug SDK",
"version": "13.4.0",
"author": "Instabug (https://instabug.com)",
"repository": "github:Instabug/Instabug-React-Native",
"homepage": "https://www.instabug.com/platforms/react-native",
"bugs": "https://github.com/Instabug/Instabug-React-Native/issues",
"license": "MIT",
"main": "dist/index",
"types": "dist/index.d.ts",
"react-native": "src/index.ts",
"bin": {
"instabug": "bin/index.js"
},
"keywords": [
"react-native",
"instabug",
"debugging",
"errors",
"exceptions",
"logging",
"reporting",
"feedback"
],
"scripts": {
"lint": "eslint . --ignore-path ../.gitignore",
"lint:fix": "yarn lint --fix",
"lint:ci": "yarn lint --max-warnings=0",
"format": "prettier --check . --ignore-path ../.gitignore",
"format:fix": "prettier --write . --ignore-path ../.gitignore",
"test": "jest",
"build": "yarn build:lib && yarn build:cli",
"build:lib": "tsc",
"build:cli": "npx rollup -c rollup.config.js --bundleConfigAsCjs"
},
"peerDependencies": {
"react": ">=16.8.6",
"react-native": ">=0.60.0"
},
"devDependencies": {
"@apollo/client": "^3.7.0",
"@react-native-community/eslint-config": "^3.1.0",
"@react-navigation/native": "^6.1.7",
"@rollup/plugin-commonjs": "^25.0.3",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^11.0.0",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.8",
"@types/react-native": "^0.72.2",
"axios": "^1.2.2",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^29.6.2",
"commander": "^11.0.0",
"eslint": "^8.24.0",
"eslint-plugin-jsdoc": "^48.1.0",
"eslint-plugin-prettier": "^5.0.0",
"esprima": "^4.0.1",
"form-data": "^4.0.0",
"jest": "^29.6.2",
"metro-react-native-babel-preset": "0.77.0",
"nock": "^13.2.9",
"prettier": "^3.0.1",
"react": "^18.2.0",
"react-native": "^0.72.3",
"react-native-navigation": "7.36.0",
"react-navigation": "^4.4.4",
"rollup": "^3.27.2",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-preserve-shebang": "^1.0.1",
"ts-jest": "^29.1.1",
"typescript": "^4.8.4",
"wait-for-expect": "^3.0.2",
"xhr2": "^0.2.1"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"outDir": "dist"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading