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

Commit 1b36f78

Browse files
committed
test
1 parent 6f382e3 commit 1b36f78

File tree

274 files changed

+18150
-11648
lines changed

Some content is hidden

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

274 files changed

+18150
-11648
lines changed

.github/workflows/package-publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ jobs:
99
- uses: actions/checkout@v2
1010
- uses: actions/setup-node@v2
1111
with:
12-
node-version: '18.x'
12+
node-version: '20.x'
1313
registry-url: 'https://registry.npmjs.org'
1414
- name: Install Package
15-
run: yarn
16-
- name: Build
17-
run: yarn prepare
18-
- name: Publish
15+
run: corepack enable && yarn install
16+
- name:
1917
env:
2018
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21-
run: npm whoami && npm publish --access public
19+
run: yarn version:publish

.gitignore

Lines changed: 62 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,79 @@
1-
# OSX
2-
#
3-
.DS_Store
4-
5-
# XDE
6-
.expo/
1+
node_modules
2+
__generated__
73

8-
# VSCode
4+
.expo-shared
5+
.expo
6+
.DS_Store
7+
.idea/
98
.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
9+
.chat/
10+
.claude/PRPs
11+
.claude/settings.local.json
12+
.clauderc
13+
.tmp/
3114

32-
# Android/IJ
33-
#
34-
.classpath
35-
.cxx
36-
.gradle
37-
.idea
38-
.project
39-
.settings
40-
local.properties
41-
android.iml
42-
43-
# Cocoapods
44-
#
45-
example/ios/Pods
46-
47-
# Ruby
48-
example/vendor/
49-
50-
# node.js
51-
#
52-
node_modules/
53-
npm-debug.log
54-
yarn-debug.log
15+
dist
16+
build-electron
17+
.next
18+
build
19+
*.tsbuildinfo
5520
yarn-error.log
5621

57-
# BUCK
58-
buck-out/
59-
\.buckd/
60-
android/app/libs
61-
android/keystores/debug.keystore
62-
63-
# Yarn
22+
.pnp.*
6423
.yarn/*
6524
!.yarn/patches
6625
!.yarn/plugins
6726
!.yarn/releases
6827
!.yarn/sdks
6928
!.yarn/versions
7029

71-
# Expo
72-
.expo/
30+
.env
31+
webpack.config.preview.json
32+
webpack.config.preview.devServer.json
7333

74-
# Turborepo
75-
.turbo/
34+
*.jks
35+
*.p8
36+
*.p12
37+
*.key
38+
*.mobileprovision
39+
*.orig.*
40+
web-build/
41+
# !/apps/web-embed/web-build/
42+
/inpage-provider-bak
7643

77-
# generated by bob
78-
lib/
44+
### VisualStudioCode ###
45+
.vscode/*
46+
!.vscode/settings.json
47+
!.vscode/tasks.json
48+
!.vscode/launch.json
49+
!.vscode/extensions.json
50+
!.vscode/*.code-snippets
7951

52+
### VisualStudioCode Patch ###
53+
# Ignore all local history of files
54+
.history
55+
.ionide
8056

81-
# key
82-
*.secret
57+
# Support for Project snippet scope
58+
.vscode/*.code-snippets
8359

84-
.history
60+
# Ignore code-workspaces
61+
*.code-workspace
62+
63+
# Ignore yalc
64+
.yalc/
65+
yalc.lock
66+
67+
stats.json
68+
stats.html
69+
.java-version
70+
.eslintcache
71+
tsconfig.tsbuildinfo
72+
73+
test-report.html
74+
75+
# Temporary files created by Metro to check the health of the file watcher
76+
.metro-health-check*
77+
78+
# Ignore tamagui config file
79+
.tamagui

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

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

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

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

.yarn/releases/yarn-3.6.1.cjs

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

.yarnrc.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
nodeLinker: node-modules
2-
nmHoistingLimits: workspaces
1+
compressionLevel: mixed
2+
3+
enableGlobalCache: false
34

4-
plugins:
5-
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
6-
spec: "@yarnpkg/plugin-interactive-tools"
7-
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
8-
spec: "@yarnpkg/plugin-workspace-tools"
5+
nodeLinker: node-modules
96

10-
yarnPath: .yarn/releases/yarn-3.6.1.cjs

LICENSE.md

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

README.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# app-modules
2+
3+
## Create new package
4+
5+
### Create Nitro Module
6+
7+
> **Important**: Avoid generating a new `node_modules` folder. All dependencies should be managed from the monorepo root to avoid conflicts and ensure proper workspace linking.
8+
9+
10+
1. Create project with `npx create-react-native-library@latest` then select turbo module or turbo view
11+
12+
2. Remove `packageManager` field from `package.json` in the new library, then run `yarn` to install dependencies
13+
14+
3. Generate Nitro module code. Run the following command in the module directory to generate `./nitrogen/generated` files, which are required by both iOS and Android.
15+
16+
4. Modify the `react-native.config.js` file in the example directory of the current project to configure the module dependency.
17+
18+
```Javascript
19+
const path = require('path');
20+
const pkg = require('../package.json');
21+
const baseConfig = require('../../../react-native.base.config');
22+
23+
module.exports = {
24+
...baseConfig,
25+
dependencies: {
26+
[pkg.name]: {
27+
root: path.join(__dirname, '..'),
28+
platforms: {
29+
// Codegen script incorrectly fails without this
30+
// So we explicitly specify the platforms with empty object
31+
ios: {},
32+
android: {},
33+
},
34+
},
35+
},
36+
};
37+
```
38+
5. Run `pod install` in the `example/ios` directory of the current module to install dependencies.
39+
40+
6. Now you can start the example app in iOS Simulator to test the module.
41+
42+
7. Modify the `metro.config.js` file in the example directory to configure the monorepo setup:
43+
44+
```
45+
const path = require('path');
46+
const { getDefaultConfig } = require('@react-native/metro-config');
47+
const { withMetroConfig } = require('react-native-monorepo-config');
48+
49+
const root = path.resolve(__dirname, '..');
50+
51+
/**
52+
* Metro configuration
53+
* https://facebook.github.io/metro/docs/configuration
54+
*
55+
* @type {import('metro-config').MetroConfig}
56+
*/
57+
const workspaceRoot = path.resolve(__dirname, '../../../');
58+
const metroConfig = withMetroConfig(getDefaultConfig(__dirname), {
59+
root,
60+
dirname: __dirname,
61+
});
62+
63+
metroConfig.watchFolders = [workspaceRoot];
64+
65+
metroConfig.resolver.nodeModulesPaths = [
66+
path.resolve(root, 'node_modules'),
67+
path.resolve(workspaceRoot, 'node_modules'),
68+
];
69+
70+
module.exports = metroConfig;
71+
72+
```
73+
74+
8. start metro server in `example` folder with `yarn start`
75+
76+
9. Let's talk about Android now. Change `new-library/example/android/settings.gradle`:
77+
78+
```
79+
pluginManagement {
80+
def reactNativeGradlePlugin = new File(
81+
providers.exec {
82+
workingDir(rootDir)
83+
commandLine("node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })")
84+
}.standardOutput.asText.get().trim()
85+
).getParentFile().absolutePath
86+
includeBuild(reactNativeGradlePlugin)
87+
}
88+
plugins { id("com.facebook.react.settings") }
89+
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
90+
rootProject.name = 'onekeyfe.reactnativecheckbiometricauthchanged.example'
91+
include ':app'
92+
93+
def reactNativeGradlePlugin = new File(
94+
providers.exec {
95+
workingDir(rootDir)
96+
commandLine("node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })")
97+
}.standardOutput.asText.get().trim()
98+
).getParentFile().absolutePath
99+
includeBuild(reactNativeGradlePlugin)
100+
```
101+
102+
10. Add the following variables at the top of the react block in `new-library/example/android/app/build.gradle`:
103+
104+
```
105+
react {
106+
reactNativeDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
107+
hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc"
108+
codegenDir = new File(["node", "--print", "require.resolve('@react-native/codegen/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
109+
enableBundleCompression = (findProperty('android.enableBundleCompression') ?: false).toBoolean()
110+
/* Folders */
111+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
112+
// root = file("../../")
113+
// ...
114+
}
115+
```
116+
117+
11. Now you can build and run the Android version.
118+
119+
12. add release script in `package.json`
120+
121+
```json
122+
"release": "yarn nitrogen && yarn prepare && release-it --only-version"
123+
```
124+
125+
126+
## Publish all package
127+
128+
To update the versions of all workspace packages, run the following command in the project root directory:
129+
130+
```shell
131+
yarn version:bump
132+
yarn version:apply
133+
```
134+
Commit version changes and push to GitHub.
135+
136+
Run publish package actions on GitHub.

0 commit comments

Comments
 (0)