Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit e1c779f

Browse files
authored
refactor: conversion to nitro modules (margelo#404)
1 parent 24783a3 commit e1c779f

File tree

265 files changed

+6460
-21206
lines changed

Some content is hidden

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

265 files changed

+6460
-21206
lines changed

.clang-format

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Config for clang-format version 16
2+
3+
# Standard
4+
BasedOnStyle: llvm
5+
Standard: c++14
6+
7+
# Indentation
8+
IndentWidth: 2
9+
ColumnLimit: 140
10+
11+
# Includes
12+
SortIncludes: CaseSensitive
13+
SortUsingDeclarations: true
14+
15+
# Pointer and reference alignment
16+
PointerAlignment: Left
17+
ReferenceAlignment: Left
18+
ReflowComments: true
19+
20+
# Line breaking options
21+
BreakBeforeBraces: Attach
22+
BreakConstructorInitializers: BeforeColon
23+
AlwaysBreakTemplateDeclarations: true
24+
AllowShortFunctionsOnASingleLine: Empty
25+
IndentCaseLabels: true
26+
NamespaceIndentation: Inner

.github/dependabot.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ version: 2
22

33
updates:
44
- package-ecosystem: "npm"
5+
target-branch: "main"
56
directory: "/"
67
schedule:
7-
interval: "daily"
8+
interval: "weekly"
9+
- package-ecosystem: "npm"
10+
target-branch: "0.x"
11+
directory: "/"
12+
schedule:
13+
interval: "weekly"

.github/workflows/build-android.yml

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@ on:
66
- main
77
paths:
88
- '.github/workflows/build-android.yml'
9-
- 'android/**'
9+
- 'packages/react-native-quick-crypto/android/**'
10+
- 'packages/react-native-quick-crypto/nitrogen/generated/android/**'
11+
- 'packages/react-native-quick-crypto/nitrogen/generated/shared/**'
1012
- 'example/android/**'
11-
- 'yarn.lock'
12-
- 'example/yarn.lock'
13+
- 'bun.lockb'
14+
- 'example/bun.lockb'
1315
pull_request:
1416
paths:
1517
- '.github/workflows/build-android.yml'
16-
- 'android/**'
18+
- 'packages/react-native-quick-crypto/android/**'
19+
- 'packages/react-native-quick-crypto/nitrogen/generated/android/**'
20+
- 'packages/react-native-quick-crypto/nitrogen/generated/shared/**'
1721
- 'example/android/**'
18-
- 'yarn.lock'
19-
- 'example/yarn.lock'
22+
- 'bun.lockb'
23+
- 'example/bun.lockb'
2024

2125
jobs:
2226
build_android_example:
@@ -29,8 +33,10 @@ jobs:
2933
run: |
3034
sudo rm -rf /usr/share/dotnet
3135
sudo rm -rf /opt/ghc
32-
sudo rm -rf "/usr/local/share/boost"
33-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
36+
37+
- uses: oven-sh/setup-bun@v2
38+
with:
39+
bun-version: 1.1.22
3440

3541
- name: Setup JDK
3642
uses: actions/setup-java@v4
@@ -41,28 +47,16 @@ jobs:
4147

4248
- name: Setup Android SDK
4349
uses: android-actions/setup-android@v3
44-
45-
- uses: actions/setup-node@v4
4650
with:
47-
node-version: 20
48-
- run: corepack enable
51+
accept-android-sdk-licenses: true
52+
log-accepted-android-sdk-licenses: false
53+
# this cmdline tools version barked the least in GHA runners
54+
# hopefully we can remove it in the future
55+
cmdline-tools-version: 9477386
4956

50-
- name: Get yarn cache directory path
51-
id: yarn-cache-dir-path
52-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
53-
54-
- name: Restore node_modules from cache
55-
uses: actions/cache@v4
56-
id: yarn-cache
57-
with:
58-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
59-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
60-
restore-keys: |
61-
${{ runner.os }}-yarn-
62-
- name: Install node_modules
63-
run: yarn install --frozen-lockfile
64-
- name: Install node_modules for example/
65-
run: yarn install --frozen-lockfile --cwd example
57+
- name: Bootstrap JS
58+
run: |
59+
bun install
6660
6761
- name: Restore Gradle cache
6862
uses: actions/cache@v4
@@ -74,8 +68,5 @@ jobs:
7468
restore-keys: |
7569
${{ runner.os }}-gradle-
7670
77-
- name: Run Gradle Build for android/
78-
run: cd android && ./gradlew assembleDebug && cd ..
79-
80-
- name: Run Gradle Build for example/android/
71+
- name: Run Gradle Build for example app
8172
run: cd example/android && ./gradlew assembleDebug --build-cache && cd ../..

.github/workflows/build-ios.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,34 @@ on:
66
- main
77
paths:
88
- '.github/workflows/build-ios.yml'
9-
- 'ios/**'
9+
- 'packages/react-native-quick-crypto/ios/**'
10+
- 'packages/react-native-quick-crypto/nitrogen/generated/ios/**'
11+
- 'packages/react-native-quick-crypto/nitrogen/generated/shared/**'
1012
- '*.podspec'
1113
- 'example/ios/**'
1214
pull_request:
1315
paths:
1416
- '.github/workflows/build-ios.yml'
15-
- 'ios/**'
17+
- 'packages/react-native-quick-crypto/ios/**'
18+
- 'packages/react-native-quick-crypto/nitrogen/generated/ios/**'
19+
- 'packages/react-native-quick-crypto/nitrogen/generated/shared/**'
1620
- '*.podspec'
1721
- 'example/ios/**'
1822

1923
jobs:
2024
build_ios_example:
2125
name: Build iOS Example App
2226
runs-on: macOS-latest
23-
defaults:
24-
run:
25-
working-directory: example/ios
2627
steps:
2728
- uses: actions/checkout@v4
2829

29-
- name: Get yarn cache directory path
30-
id: yarn-cache-dir-path
31-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
32-
- name: Restore node_modules from cache
33-
uses: actions/cache@v4
34-
id: yarn-cache
30+
- uses: oven-sh/setup-bun@v2
3531
with:
36-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
37-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
38-
restore-keys: |
39-
${{ runner.os }}-yarn-
40-
- name: Install node_modules for example/
41-
run: yarn install --frozen-lockfile --cwd ..
32+
bun-version: 1.1.22
4233

43-
# - name: Restore buildcache
44-
# uses: mikehardy/buildcache-action@v2
45-
# continue-on-error: true
34+
- name: Bootstrap JS
35+
run: |
36+
bun install
4637
4738
- name: Setup Ruby (bundle)
4839
uses: ruby/setup-ruby@v1
@@ -61,14 +52,19 @@ jobs:
6152
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
6253
restore-keys: |
6354
${{ runner.os }}-pods-
55+
6456
- name: Install Gems
6557
working-directory: example
6658
run: bundle config set deployment 'true' && bundle install
59+
6760
- name: Install Pods
68-
run: yarn pods
61+
run: bun pods
62+
6963
- name: Install xcpretty
7064
run: gem install xcpretty
65+
7166
- name: Build App
67+
working-directory: example/ios
7268
run: "set -o pipefail && xcodebuild \
7369
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
7470
-derivedDataPath build -UseModernBuildSystem=YES \

.github/workflows/release-publish.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/validate-android.yml

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,25 @@ on:
66
- main
77
paths:
88
- '.github/workflows/validate-android.yml'
9-
- 'android/**'
9+
- 'packages/react-native-quick-crypto/android/**'
1010
- '.editorconfig'
1111
pull_request:
1212
paths:
1313
- '.github/workflows/validate-android.yml'
14-
- 'android/**'
14+
- 'packages/react-native-quick-crypto/android/**'
1515
- '.editorconfig'
1616

1717
jobs:
1818
validate_android:
1919
name: Gradle Lint
2020
runs-on: ubuntu-latest
21-
defaults:
22-
run:
23-
working-directory: ./android
2421
steps:
2522
- uses: actions/checkout@v4
2623

24+
- uses: oven-sh/setup-bun@v2
25+
with:
26+
bun-version: 1.1.22
27+
2728
- name: Setup JDK
2829
uses: actions/setup-java@v4
2930
with:
@@ -33,28 +34,16 @@ jobs:
3334

3435
- name: Setup Android SDK
3536
uses: android-actions/setup-android@v3
36-
37-
- uses: actions/setup-node@v4
3837
with:
39-
node-version: 20
40-
- run: corepack enable
41-
42-
- name: Get yarn cache directory path
43-
id: yarn-cache-dir-path
44-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
38+
accept-android-sdk-licenses: true
39+
log-accepted-android-sdk-licenses: false
40+
# this cmdline tools version barked the least in GHA runners
41+
# hopefully we can remove it in the future
42+
cmdline-tools-version: 9477386
4543

46-
- name: Restore node_modules from cache
47-
uses: actions/cache@v4
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: |
53-
${{ runner.os }}-yarn-
54-
- name: Install node_modules
55-
run: yarn install --frozen-lockfile --cwd ..
56-
- name: Install node_modules for example/
57-
run: yarn install --frozen-lockfile --cwd ../example
44+
- name: Bootstrap JS
45+
run: |
46+
bun install
5847
5948
- name: Restore Gradle cache
6049
uses: actions/cache@v4
@@ -67,19 +56,10 @@ jobs:
6756
${{ runner.os }}-gradle-
6857
6958
- name: Run Gradle Lint
70-
run: cd ../example/android && ./gradlew lint
59+
run: cd example/android && ./gradlew lint
7160

7261
- name: Parse Gradle Lint Report
7362
uses: yutailang0119/action-android-lint@v4
7463
with:
7564
# ignore-warnings: true
7665
report-path: example/android/app/build/reports/*.xml
77-
# ktlint:
78-
# name: Kotlin Lint
79-
# runs-on: ubuntu-latest
80-
# steps:
81-
# - uses: actions/checkout@v4
82-
# - name: Run KTLint
83-
# uses: mrousavy/[email protected]
84-
# with:
85-
# github_token: ${{ secrets.github_token }}

.github/workflows/validate-cpp.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
name: Validate C++
1+
name: 'Validate C++'
22

33
on:
44
push:
55
branches:
66
- main
77
paths:
88
- '.github/workflows/validate-cpp.yml'
9-
- 'cpp/**'
10-
- 'android/src/main/cpp/**'
9+
- 'packages/react-native-quick-crypto/android/src/main/cpp/**'
10+
- 'packages/react-native-quick-crypto/cpp/**'
11+
- 'packages/react-native-quick-crypto/nitrogen/generated/shared/**'
1112
pull_request:
1213
paths:
1314
- '.github/workflows/validate-cpp.yml'
14-
- 'cpp/**'
15-
- 'android/src/main/cpp/**'
15+
- 'packages/react-native-quick-crypto/android/src/main/cpp/**'
16+
- 'packages/react-native-quick-crypto/cpp/**'
17+
- 'packages/react-native-quick-crypto/nitrogen/generated/shared/**'
1618

1719
jobs:
1820
validate_cpp:
@@ -25,7 +27,7 @@ jobs:
2527
github_token: ${{ secrets.github_token }}
2628
reporter: github-pr-review
2729
flags: --linelength=230
28-
targets: --recursive cpp android/src/main/cpp
30+
targets: --recursive packages/react-native-quick-crypto/cpp packages/react-native-quick-crypto/android/src/main/cpp packages/react-native-quick-crypto/nitrogen/generated/shared/c++
2931
filter: "-legal/copyright\
3032
,-readability/todo\
3133
,-build/namespaces\

0 commit comments

Comments
 (0)