-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add TypeScript build setup and update publish workflow #14
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,8 @@ jobs: | |||||||||||||||||
| registry-url: 'https://registry.npmjs.org' | ||||||||||||||||||
| - name: Install Package | ||||||||||||||||||
| run: yarn | ||||||||||||||||||
| - name: Build Package | ||||||||||||||||||
| run: yarn build | ||||||||||||||||||
|
Comment on lines
+16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Double build detected: prepublishOnly will rebuild. The workflow runs Solution: Remove the explicit build step here and rely on 🔎 Suggested fix - name: Install Package
run: yarn
- - name: Build Package
- run: yarn build
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm whoami && npm publish --access public📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| - name: Publish | ||||||||||||||||||
| env: | ||||||||||||||||||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,4 +53,6 @@ jsconfig.json | |
| .project | ||
| .settings/ | ||
| .vscode | ||
| .history | ||
| .history | ||
|
|
||
| dist/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,18 @@ | ||
| { | ||
| "name": "@onekeyfe/react-native-animated-charts", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "The library provides a set of components and helpers for building complex and beautiful animated linear (only - for now) charts. It's a part of the [Rainbow.me project](https://rainbow.me/).", | ||
| "main": "src/index.ts", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Test script is still a placeholder. The test script exits with an error. Add actual tests or remove the script. 🤖 Prompt for AI Agents |
||
| "build": "tsc", | ||
| "clean": "rm -rf dist", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clean script breaks on Windows.
🔎 Suggested fixFirst, add rimraf to devDependencies: "devDependencies": {
"rimraf": "^5.0.0",
...
}Then update the clean script: - "clean": "rm -rf dist",
+ "clean": "rimraf dist",
🤖 Prompt for AI Agents |
||
| "prepublishOnly": "npm run clean && npm run build" | ||
| }, | ||
| "author": "Michał Osadnik, @onekeyfe", | ||
| "files": [ | ||
| "src/" | ||
| "dist/" | ||
| ], | ||
| "license": "MIT", | ||
| "dependencies": { | ||
|
|
@@ -20,7 +24,15 @@ | |
| "@babel/core": "^7.11.4", | ||
| "@babel/runtime": "^7.11.2", | ||
| "@types/d3-scale": "^4.0.2", | ||
| "@types/d3-shape": "^3.0.2" | ||
| "@types/d3-shape": "^3.0.2", | ||
| "typescript": "^5.0.0", | ||
| "@types/react": "19.0.0", | ||
| "react": "19.0.0", | ||
| "react-native": "0.81.0", | ||
| "react-native-reanimated": "3.19.4", | ||
| "react-native-gesture-handler": "2.24.0", | ||
| "react-native-svg": "15.11.1", | ||
| "expo-haptics": "12.0.0" | ||
|
Comment on lines
+28
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Short answer: React Native 0.81 is intended to work with React 19 (the 19.x line), but some packages expect specific 19.y patch releases so you may hit peer-dependency conflicts if you use exactly 19.0.0. React Native releases around 0.80–0.82 were updated to the React 19 line (0.80/0.82 notes mention React 19 releases). Check and align your app and 3rd‑party libs' peerDependencies (or upgrade React to a later 19.x such as 19.1.x) to avoid conflicts. [1][2][3] References
Would you like me to check a specific package in your project for compatibility? 🌐 Web query:
💡 Result: Short answer: Reanimated 3.19.4 supports React Native 0.81 (both Paper/old architecture and Fabric/new architecture) — see Reanimated compatibility tables. Requirements to note:
Sources:
Consider upgrading React to 19.1.x or later. React 19.0.0 and React Native 0.81.0 work together, but React 19.0.0 can cause peer-dependency conflicts with third-party packages. Upgrading to a later 19.x version (like 19.1.x) avoids these issues. react-native-reanimated 3.19.4 supports React Native 0.81 and works with both architectures. 🤖 Prompt for AI Agents |
||
| }, | ||
| "peerDependencies": { | ||
| "react": "*", | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||||||
| { | ||||||||||
| "compilerOptions": { | ||||||||||
| "target": "es2018", | ||||||||||
| "module": "commonjs", | ||||||||||
|
Comment on lines
+3
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check React Native version and current tsconfig settings
echo "=== React Native version ==="
cat package.json | jq -r '.devDependencies["react-native"], .peerDependencies["react-native"]' 2>/dev/null || echo "Not found via jq"
echo -e "\n=== Current tsconfig.json ==="
cat tsconfig.jsonRepository: OneKeyHQ/react-native-animated-charts Length of output: 764 Consider modernizing the TypeScript target and module format. With React Native 0.81.0, you can safely use 🤖 Prompt for AI Agents |
||||||||||
| "lib": ["es2018"], | ||||||||||
| "allowJs": true, | ||||||||||
| "jsx": "react-native", | ||||||||||
| "declaration": true, | ||||||||||
| "outDir": "./dist", | ||||||||||
| "strict": true, | ||||||||||
| "moduleResolution": "node", | ||||||||||
| "allowSyntheticDefaultImports": true, | ||||||||||
| "esModuleInterop": true, | ||||||||||
| "skipLibCheck": true, | ||||||||||
| "resolveJsonModule": true, | ||||||||||
| "noUnusedLocals": false, | ||||||||||
| "noUnusedParameters": false, | ||||||||||
|
Comment on lines
+16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Re-enable unused variable checks for better code quality. Disabling 🔎 Suggested fix- "noUnusedLocals": false,
- "noUnusedParameters": false,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| "experimentalDecorators": true, | ||||||||||
| "emitDecoratorMetadata": true | ||||||||||
|
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for decorator usage patterns
rg -n '@\w+\(' src/ --type ts --type tsx -C2 || echo "No decorators found"Repository: OneKeyHQ/react-native-animated-charts Length of output: 145 🏁 Script executed: #!/bin/bash
# Verify tsconfig.json exists and show lines around 18-19
if [ -f tsconfig.json ]; then
echo "=== tsconfig.json lines 15-22 ==="
sed -n '15,22p' tsconfig.json
fi
# Broader decorator search (including other patterns)
echo -e "\n=== Searching for decorator patterns ==="
rg '@[A-Za-z]' src/ -C2 || echo "No @ patterns found in src/"
</script>Repository: OneKeyHQ/react-native-animated-charts Length of output: 9617 Remove unused decorator flags.
🤖 Prompt for AI Agents |
||||||||||
| }, | ||||||||||
| "include": [ | ||||||||||
| "src/**/*" | ||||||||||
| ], | ||||||||||
| "exclude": [ | ||||||||||
| "node_modules", | ||||||||||
| "dist", | ||||||||||
| "Example" | ||||||||||
| ] | ||||||||||
| } | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Add dependency caching to speed up workflow.
Caching
node_modulesreduces install time on subsequent runs.🔎 Suggested fix
- uses: actions/setup-node@v4 with: node-version: '20.x' registry-url: 'https://registry.npmjs.org' + cache: 'yarn' - name: Install Package run: yarn🤖 Prompt for AI Agents