Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Commit dee4adc

Browse files
committed
add react-native-skeleton
1 parent e31ef6d commit dee4adc

29 files changed

+1055
-27
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pbxproj -text
2+
# specific for windows script files
3+
*.bat text eol=crlf
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# XDE
6+
.expo/
7+
8+
# VSCode
9+
.vscode/
10+
jsconfig.json
11+
12+
# Xcode
13+
#
14+
build/
15+
*.pbxuser
16+
!default.pbxuser
17+
*.mode1v3
18+
!default.mode1v3
19+
*.mode2v3
20+
!default.mode2v3
21+
*.perspectivev3
22+
!default.perspectivev3
23+
xcuserdata
24+
*.xccheckout
25+
*.moved-aside
26+
DerivedData
27+
*.hmap
28+
*.ipa
29+
*.xcuserstate
30+
project.xcworkspace
31+
**/.xcode.env.local
32+
33+
# Android/IJ
34+
#
35+
.classpath
36+
.cxx
37+
.gradle
38+
.idea
39+
.project
40+
.settings
41+
local.properties
42+
android.iml
43+
44+
# Cocoapods
45+
#
46+
example/ios/Pods
47+
48+
# Ruby
49+
example/vendor/
50+
51+
# node.js
52+
#
53+
node_modules/
54+
npm-debug.log
55+
yarn-debug.log
56+
yarn-error.log
57+
58+
# BUCK
59+
buck-out/
60+
\.buckd/
61+
android/app/libs
62+
android/keystores/debug.keystore
63+
64+
# Yarn
65+
.yarn/*
66+
!.yarn/patches
67+
!.yarn/plugins
68+
!.yarn/releases
69+
!.yarn/sdks
70+
!.yarn/versions
71+
72+
# Expo
73+
.expo/
74+
75+
# Turborepo
76+
.turbo/
77+
78+
# generated by bob
79+
lib/
80+
81+
# React Native Codegen
82+
ios/generated
83+
android/generated
84+
85+
# React Native Nitro Modules
86+
nitrogen/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.20.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MIT License
2+
3+
Copyright (c) 2025 @onekeyfe
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# react-native-skeleton
2+
3+
react-native-skeleton
4+
5+
## Installation
6+
7+
8+
```sh
9+
npm install react-native-skeleton react-native-nitro-modules
10+
11+
> `react-native-nitro-modules` is required as this library relies on [Nitro Modules](https://nitro.margelo.com/).
12+
```
13+
14+
15+
## Usage
16+
17+
18+
```js
19+
import { SkeletonView } from "react-native-skeleton";
20+
21+
// ...
22+
23+
<SkeletonView color="tomato" />
24+
```
25+
26+
27+
## Contributing
28+
29+
- [Development workflow](CONTRIBUTING.md#development-workflow)
30+
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
31+
- [Code of conduct](CODE_OF_CONDUCT.md)
32+
33+
## License
34+
35+
MIT
36+
37+
---
38+
39+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
require "json"
2+
3+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4+
5+
Pod::Spec.new do |s|
6+
s.name = "Skeleton"
7+
s.version = package["version"]
8+
s.summary = package["description"]
9+
s.homepage = package["homepage"]
10+
s.license = package["license"]
11+
s.authors = package["author"]
12+
13+
s.platforms = { :ios => min_ios_version_supported }
14+
s.source = { :git => "https://github.com/OneKeyHQ/app-views/react-native-skeleton.git", :tag => "#{s.version}" }
15+
16+
s.source_files = [
17+
"ios/**/*.{swift}",
18+
"ios/**/*.{m,mm}",
19+
"cpp/**/*.{hpp,cpp}",
20+
]
21+
22+
s.dependency 'React-jsi'
23+
s.dependency 'React-callinvoker'
24+
25+
load 'nitrogen/generated/ios/Skeleton+autolinking.rb'
26+
add_nitrogen_files(s)
27+
28+
install_modules_dependencies(s)
29+
end
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
project(skeleton)
2+
cmake_minimum_required(VERSION 3.9.0)
3+
4+
set(PACKAGE_NAME skeleton)
5+
set(CMAKE_VERBOSE_MAKEFILE ON)
6+
set(CMAKE_CXX_STANDARD 20)
7+
8+
# Define C++ library and add all sources
9+
add_library(${PACKAGE_NAME} SHARED src/main/cpp/cpp-adapter.cpp)
10+
11+
# Add Nitrogen specs :)
12+
include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/skeleton+autolinking.cmake)
13+
14+
# Set up local includes
15+
include_directories("src/main/cpp" "../cpp")
16+
17+
find_library(LOG_LIB log)
18+
19+
# Link all libraries together
20+
target_link_libraries(
21+
${PACKAGE_NAME}
22+
${LOG_LIB}
23+
android # <-- Android core
24+
)
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
buildscript {
2+
ext.getExtOrDefault = {name ->
3+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Skeleton_' + name]
4+
}
5+
6+
repositories {
7+
google()
8+
mavenCentral()
9+
}
10+
11+
dependencies {
12+
classpath "com.android.tools.build:gradle:8.7.2"
13+
// noinspection DifferentKotlinGradleVersion
14+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
15+
}
16+
}
17+
18+
def reactNativeArchitectures() {
19+
def value = rootProject.getProperties().get("reactNativeArchitectures")
20+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
21+
}
22+
23+
apply plugin: "com.android.library"
24+
apply plugin: "kotlin-android"
25+
apply from: '../nitrogen/generated/android/skeleton+autolinking.gradle'
26+
27+
apply plugin: "com.facebook.react"
28+
29+
def getExtOrIntegerDefault(name) {
30+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Skeleton_" + name]).toInteger()
31+
}
32+
33+
android {
34+
namespace "com.margelo.nitro.skeleton"
35+
36+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
37+
38+
defaultConfig {
39+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
40+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
41+
42+
externalNativeBuild {
43+
cmake {
44+
cppFlags "-frtti -fexceptions -Wall -fstack-protector-all"
45+
arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
46+
abiFilters (*reactNativeArchitectures())
47+
48+
buildTypes {
49+
debug {
50+
cppFlags "-O1 -g"
51+
}
52+
release {
53+
cppFlags "-O2"
54+
}
55+
}
56+
}
57+
}
58+
}
59+
60+
externalNativeBuild {
61+
cmake {
62+
path "CMakeLists.txt"
63+
}
64+
}
65+
66+
packagingOptions {
67+
excludes = [
68+
"META-INF",
69+
"META-INF/**",
70+
"**/libc++_shared.so",
71+
"**/libfbjni.so",
72+
"**/libjsi.so",
73+
"**/libfolly_json.so",
74+
"**/libfolly_runtime.so",
75+
"**/libglog.so",
76+
"**/libhermes.so",
77+
"**/libhermes-executor-debug.so",
78+
"**/libhermes_executor.so",
79+
"**/libreactnative.so",
80+
"**/libreactnativejni.so",
81+
"**/libturbomodulejsijni.so",
82+
"**/libreact_nativemodule_core.so",
83+
"**/libjscexecutor.so"
84+
]
85+
}
86+
87+
buildFeatures {
88+
buildConfig true
89+
prefab true
90+
}
91+
92+
buildTypes {
93+
release {
94+
minifyEnabled false
95+
}
96+
}
97+
98+
lintOptions {
99+
disable "GradleCompatible"
100+
}
101+
102+
compileOptions {
103+
sourceCompatibility JavaVersion.VERSION_1_8
104+
targetCompatibility JavaVersion.VERSION_1_8
105+
}
106+
107+
sourceSets {
108+
main {
109+
java.srcDirs += [
110+
"generated/java",
111+
"generated/jni"
112+
]
113+
}
114+
}
115+
}
116+
117+
repositories {
118+
mavenCentral()
119+
google()
120+
}
121+
122+
def kotlin_version = getExtOrDefault("kotlinVersion")
123+
124+
dependencies {
125+
implementation "com.facebook.react:react-android"
126+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
127+
implementation project(":react-native-nitro-modules")
128+
}

0 commit comments

Comments
 (0)