Skip to content

Commit 5a73c77

Browse files
Merge pull request #477 from reown-com/develop
prep for multichain release
2 parents 97b4925 + 08113ea commit 5a73c77

File tree

537 files changed

+27602
-33178
lines changed

Some content is hidden

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

537 files changed

+27602
-33178
lines changed

.changeset/thirty-wings-stick.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@reown/appkit-coinbase-react-native': patch
3+
'@reown/appkit-bitcoin-react-native': patch
4+
'@reown/appkit-react-native': patch
5+
'@reown/appkit-common-react-native': patch
6+
'@reown/appkit-ethers-react-native': patch
7+
'@reown/appkit-solana-react-native': patch
8+
'@reown/appkit-wagmi-react-native': patch
9+
'@reown/appkit-core-react-native': patch
10+
'@reown/appkit-ui-react-native': patch
11+
---
12+
13+
Release v2.0.1 stable version

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"rules": {
66
"react/react-in-jsx-scope": 0,
77
"no-duplicate-imports": "error",
8+
"react/jsx-no-leaked-render": "error",
89
"react-hooks/exhaustive-deps": "warn",
910
"no-console": ["error", { "allow": ["warn"] }],
1011
"newline-before-return": "error",

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
- name: Setup Node.js
88
uses: actions/setup-node@v4
99
with:
10-
node-version: 18
10+
node-version: 22
1111

1212
- name: Install dependencies
1313
run: |
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
const { execSync, spawnSync } = require('child_process');
2+
const fs = require('fs');
3+
const path = require('path');
4+
5+
// Helper function to run commands and handle errors
6+
function runCommand(command, args, options) {
7+
console.log(
8+
`Executing: ${command} ${args.join(' ')} ${options && options.cwd ? `in ${options.cwd}` : ''}`
9+
);
10+
const result = spawnSync(command, args, { stdio: 'inherit', ...options });
11+
if (result.error) {
12+
console.error(`Error executing ${command}:`, result.error);
13+
throw result.error;
14+
}
15+
if (result.status !== 0) {
16+
const message = `Command failed: ${command} ${args.join(' ')} exited with status ${
17+
result.status
18+
}`;
19+
console.error(message);
20+
throw new Error(message);
21+
}
22+
return result;
23+
}
24+
25+
console.log('Starting initial package publishing process...');
26+
27+
let packagesToPublish = [];
28+
const rootDir = process.cwd();
29+
30+
const packagesToExclude = ['@apps/native', '@apps/gallery', 'appkit-react-native'];
31+
32+
try {
33+
// Get workspace info using yarn workspaces list --json
34+
// Yarn v1 outputs newline-delimited JSON objects
35+
const rawOutput = execSync('yarn workspaces list --json', { encoding: 'utf8' });
36+
const lines = rawOutput
37+
.trim()
38+
.split('\n')
39+
.filter(line => line.trim() !== '');
40+
const workspacePackages = lines.map(line => JSON.parse(line));
41+
42+
for (const pkgData of workspacePackages) {
43+
console.log(`[DEBUG] Processing workspace entry: ${JSON.stringify(pkgData)}`);
44+
45+
// Skip the root package (identified by location '.') or any package without a defined location
46+
if (pkgData.location === '.' || !pkgData.location) {
47+
console.log(
48+
`[DEBUG] Skipping root or undefined location package: ${pkgData.name} at ${pkgData.location}`
49+
);
50+
continue;
51+
}
52+
53+
// Skip excluded packages
54+
if (packagesToExclude.includes(pkgData.name)) {
55+
console.log(`Skipping excluded package: ${pkgData.name}`);
56+
continue;
57+
}
58+
59+
const pkgName = pkgData.name;
60+
const pkgDir = path.resolve(rootDir, pkgData.location);
61+
62+
// Check if package exists on npm
63+
console.log(`Checking NPM status for ${pkgName}...`);
64+
const npmViewResult = spawnSync('npm', ['view', pkgName, 'version'], { encoding: 'utf8' });
65+
66+
// If npm view exits with 0 and has output, package exists.
67+
// Otherwise (non-zero exit or empty output), it likely doesn't.
68+
if (npmViewResult.status === 0 && npmViewResult.stdout && npmViewResult.stdout.trim() !== '') {
69+
console.log(
70+
`Package ${pkgName} (version: ${npmViewResult.stdout.trim()}) already exists on NPM. Skipping initial publish.`
71+
);
72+
} else {
73+
console.log(
74+
`Package ${pkgName} does not appear to exist on NPM or has no published versions.`
75+
);
76+
if (fs.existsSync(path.join(pkgDir, 'package.json'))) {
77+
const packageJsonContent = fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf8');
78+
const parsedPackageJson = JSON.parse(packageJsonContent);
79+
console.log(
80+
`[DEBUG] package.json for ${pkgName}: private=${parsedPackageJson.private}, version=${parsedPackageJson.version}`
81+
); // Added for debugging
82+
packagesToPublish.push({ name: pkgName, dir: pkgDir });
83+
} else {
84+
console.warn(`Skipping ${pkgName}: package.json not found in ${pkgDir}`);
85+
}
86+
}
87+
}
88+
} catch (error) {
89+
console.error('Error processing workspace info or checking NPM status:', error.message);
90+
process.exit(1); // Critical error, exit
91+
}
92+
93+
if (packagesToPublish.length === 0) {
94+
console.log('No new packages to publish initially.');
95+
} else {
96+
console.log(
97+
`Found ${packagesToPublish.length} new package(s) to publish initially: ${packagesToPublish
98+
.map(p => p.name)
99+
.join(', ')}`
100+
);
101+
102+
// Conditionally run changeset:prepublish if there are packages to publish
103+
if (packagesToPublish.length > 0) {
104+
console.log('New packages found. Running changeset:prepublish to build packages...');
105+
try {
106+
runCommand('yarn', ['run', 'changeset:prepublish']); // Assumes it runs from rootDir
107+
console.log('changeset:prepublish completed successfully.');
108+
} catch (prepublishError) {
109+
console.error('Failed to run changeset:prepublish:', prepublishError.message);
110+
process.exit(1); // Exit if build fails, as publishing would also fail
111+
}
112+
}
113+
}
114+
115+
let hasPublishErrors = false;
116+
for (const pkg of packagesToPublish) {
117+
console.log(`[DEBUG] Attempting to publish from list: ${JSON.stringify(pkg)}`); // Added for debugging
118+
console.log(`Attempting to publish ${pkg.name} from ${pkg.dir} with alpha tag...`);
119+
const packageJsonPath = path.join(pkg.dir, 'package.json');
120+
let originalPackageJson = '';
121+
try {
122+
originalPackageJson = fs.readFileSync(packageJsonPath, 'utf8');
123+
const parsedPackageJson = JSON.parse(originalPackageJson);
124+
125+
if (parsedPackageJson.private === true) {
126+
console.log(`Package ${pkg.name} is private, skipping initial publish.`);
127+
continue; // Skip to the next package
128+
}
129+
130+
console.log(`Temporarily setting version of ${pkg.name} to 0.0.1 for initial publish.`);
131+
parsedPackageJson.version = '0.0.1';
132+
fs.writeFileSync(packageJsonPath, JSON.stringify(parsedPackageJson, null, 2));
133+
134+
runCommand('yarn', ['npm', 'publish', '--access', 'public', '--tag', 'alpha'], {
135+
cwd: pkg.dir
136+
});
137+
// console.log(
138+
// `DRY RUN: Would publish ${pkg.name} from ${pkg.dir} with version 0.0.1 and alpha tag.`
139+
// );
140+
// console.log(
141+
// `DRY RUN: Command would be: yarn npm publish --access public --tag alpha (in ${pkg.dir})`
142+
// );
143+
} catch (publishError) {
144+
// runCommand already logs error details if it's from there
145+
console.error(`Failed to publish ${pkg.name}: ${publishError.message}`);
146+
hasPublishErrors = true; // Mark that an error occurred but continue trying other packages
147+
} finally {
148+
// Restore original package.json
149+
if (originalPackageJson) {
150+
console.log(`Restoring original package.json for ${pkg.name}.`);
151+
try {
152+
fs.writeFileSync(packageJsonPath, originalPackageJson);
153+
} catch (restoreError) {
154+
console.error(
155+
`CRITICAL: Failed to restore original package.json for ${pkg.name}: ${restoreError.message}`
156+
);
157+
// This is a more critical error, as it leaves the repo in a modified state.
158+
// Depending on desired behavior, you might want to ensure this error is highly visible
159+
// or even causes the entire workflow to fail more loudly.
160+
hasPublishErrors = true; // Ensure the overall process is marked as failed.
161+
}
162+
}
163+
}
164+
}
165+
166+
console.log('Initial package publishing process finished.');
167+
if (hasPublishErrors) {
168+
console.error('One or more packages failed during initial publishing.');
169+
process.exit(1); // Exit with error if any package failed to publish
170+
}

.github/workflows/alpha-release.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: write
14+
id-token: write
1415
steps:
1516
- name: Checkout Repo
1617
uses: actions/checkout@v4
@@ -37,23 +38,33 @@ jobs:
3738
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3839

3940
- name: Update Lockfile
40-
run: yarn install --immutable false
41+
run: yarn install
4142
shell: bash
4243

4344
- name: Build Packages
44-
run: yarn changeset:prepublish
45+
run: yarn changeset:prepublish:ci
4546
shell: bash
4647

4748
- name: Configure NPM for Publishing
4849
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
4950
shell: bash
5051

5152
- name: Publish Alpha to NPM
52-
run: yarn changeset publish --tag alpha
53+
run: yarn changeset publish
5354
shell: bash
5455
env:
5556
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5657

58+
- name: Exit Pre-mode
59+
run: yarn changeset pre exit
60+
shell: bash
61+
62+
- name: Commit Version Changes
63+
run: |
64+
git add .
65+
git commit -m "chore: update package versions after alpha release"
66+
shell: bash
67+
5768
- name: Push Changes and Tags
5869
run: |
5970
git push --follow-tags

.github/workflows/changesets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
7171
git reset --hard origin/main
7272
yarn run changeset version --no-git-tag --snapshot canary
73-
yarn run changeset:prepublish
73+
yarn run changeset:prepublish:ci
7474
yarn run changeset publish --no-git-tag --snapshot canary --tag canary
7575
7676
- name: Get NPM Version
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Claude Auto Review
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
issue_comment:
7+
types: [created]
8+
9+
jobs:
10+
auto-review:
11+
runs-on: ubuntu-latest
12+
if: |
13+
github.event_name == 'pull_request'
14+
|| (
15+
github.event_name == 'issue_comment'
16+
&& github.event.issue.pull_request
17+
&& contains(github.event.comment.body, '@claude review')
18+
)
19+
permissions:
20+
contents: read
21+
pull-requests: write
22+
issues: write
23+
id-token: write
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Claude Auto Review
31+
uses: WalletConnect/actions/claude/auto-review@1483e05460107d74c575e31af948ce20f9df6387
32+
with:
33+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
34+
model: claude-sonnet-4-5-20250929
35+
timeout_minutes: "60"
36+
project_context: |
37+
This is the AppKit React Native SDK, a comprehensive wallet connection and blockchain interaction library for React Native applications.
38+
39+
Key considerations for this project:
40+
- **React Native SDK Architecture**: Function-based components with hooks exclusively (useState, useEffect)
41+
- **TypeScript-first Approach**: Strict TypeScript with @types/react-native, noUncheckedIndexedAccess, strict mode
42+
- **Valtio State Management**: Proxy-based reactivity for controllers (e.g., RouterController, ConnectionsController)
43+
- **Modular Package Structure**: Separate packages for core, ui, common, wagmi, solana, bitcoin, ethers, coinbase
44+
- **UI Component System**: Use @reown/appkit-ui-react-native components (Text, Button, Pressable) over react-native defaults
45+
- **Internal Navigation**: Custom RouterController.ts for navigation, no react-navigation dependency
46+
- **Performance Optimization**: React.memo, useCallback, useMemo for efficient rendering; FlatList for large datasets
47+
- **Animation Strategy**: React Native's Animated API exclusively, no react-native-reanimated
48+
- **Error Handling**: Centralized ErrorUtil with try-catch blocks, descriptive error messages
49+
- **Security**: Storage only for non-sensitive data, no auth tokens or private keys in storage
50+
- **Testing**: Jest + React Native Testing Library for 80%+ coverage on controllers and components
51+
- **Code Quality**: ESLint + Prettier rules, JSDoc for public APIs, no inline styles
52+
- **Import Organization**: React/RN → External libs → @reown packages → Relative imports
53+
- **Blockchain Support**: Multi-chain with EVM, Solana, and Bitcoin adapters
54+
- **Developer Experience**: Clean package exports, strongly typed APIs, comprehensive error handling

.github/workflows/snapshot.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ jobs:
2323
- name: Setup
2424
uses: ./.github/actions/setup
2525

26+
- name: Publish Initial Versions for New Packages
27+
continue-on-error: false
28+
env:
29+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
run: |
32+
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
33+
node .github/scripts/publish-initial-versions.js
34+
2635
- name: Publish Snapshots
2736
continue-on-error: false
2837
env:
@@ -32,5 +41,5 @@ jobs:
3241
snapshot=$(git branch --show-current | tr -cs '[:alnum:]-' '-' | tr '[:upper:]' '[:lower:]' | sed 's/-$//')
3342
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
3443
yarn run changeset version --no-git-tag --snapshot $snapshot
35-
yarn run changeset:prepublish
44+
yarn run changeset:prepublish:ci
3645
yarn run changeset publish --no-git-tag --snapshot $snapshot --tag $snapshot

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,6 @@ android.iml
6060
# vscode
6161
.vscode/launch.json
6262

63-
# cursor
64-
.cursor/mcp.json
63+
# Cursor
64+
.cursor
65+
.cursor/mcp.json

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.17.0

0 commit comments

Comments
 (0)