Chore/prepare npm publish#2
Conversation
- Set package name to @lokal-dev/react-native-device-metrics - Add publishConfig.access, author object, files (README, LICENSE) - Polish README: structure, API reference accuracy, remove TOC/Prerequisites - Add npm login to manual release steps
📝 WalkthroughSummary by CodeRabbitRelease Notes
WalkthroughThis pull request renames the package from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on preparing the React Native device metrics library for public npm distribution under a new organizational scope. It includes comprehensive updates to documentation, package metadata, and build configurations to ensure seamless installation, usage, and continuous integration for Android, addressing previous dependency resolution issues. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
README.md (1)
30-30: Nitpick: Consider "incompatible" for conciseness.-| **Expo (dev client)**| SDK 50+ (not compatible with Expo Go) | +| **Expo (dev client)**| SDK 50+ (incompatible with Expo Go) |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` at line 30, Update the table entry text to use the shorter adjective "incompatible": replace the cell value "**Expo (dev client)**| SDK 50+ (not compatible with Expo Go)" with "**Expo (dev client)**| SDK 50+ (incompatible with Expo Go)" so the README uses the more concise phrasing; locate the string "not compatible with Expo Go" in README.md and change it to "incompatible with Expo Go".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@README.md`:
- Line 30: Update the table entry text to use the shorter adjective
"incompatible": replace the cell value "**Expo (dev client)**| SDK 50+ (not
compatible with Expo Go)" with "**Expo (dev client)**| SDK 50+ (incompatible
with Expo Go)" so the README uses the more concise phrasing; locate the string
"not compatible with Expo Go" in README.md and change it to "incompatible with
Expo Go".
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to Reviews > Disable Cache setting
Disabled knowledge base sources:
- Jira integration is disabled
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (5)
.github/workflows/ci.ymlREADME.mdexample/src/App.tsxpackage.jsontsconfig.json
There was a problem hiding this comment.
Code Review
This pull request effectively prepares the library for its initial public release on npm under the @lokal-dev scope. The updates to package metadata, documentation, and build configurations are well-executed. The API simplification, by removing the *Parsed methods, is a welcome improvement for clarity. My review includes a few suggestions for the README.md to enhance the installation instructions, ensuring a smoother setup process for developers, especially concerning credential handling for dependencies from GitHub Packages.
| memory: { | ||
| low: { | ||
| approxHeapRemainingInMBThreshold: 32, | ||
| approxHeapLimitInMBThreshold: 64, | ||
| }, | ||
| average: { | ||
| approxHeapRemainingInMBThreshold: 64, | ||
| approxHeapLimitInMBThreshold: 128, | ||
| availableRamGBThreshold: 1.5, | ||
| }, | ||
| high: { | ||
| approxHeapRemainingInMBThreshold: 256, | ||
| availableRamGBThreshold: 3, | ||
| }, | ||
| low: { approxHeapRemainingInMBThreshold: 32, approxHeapLimitInMBThreshold: 64 }, | ||
| average: { approxHeapRemainingInMBThreshold: 64, approxHeapLimitInMBThreshold: 128, availableRamGBThreshold: 1.5 }, | ||
| high: { approxHeapRemainingInMBThreshold: 256, availableRamGBThreshold: 3 }, | ||
| }, | ||
| battery: { | ||
| excellent: { | ||
| batteryPercentageThreshold: 80, | ||
| isChargingBatteryPercentageThreshold: 70, | ||
| temperatureThreshold: 30, | ||
| }, | ||
| high: { | ||
| batteryPercentageThreshold: 55, | ||
| isChargingBatteryPercentageThreshold: 50, | ||
| temperatureThreshold: 34, | ||
| }, | ||
| average: { | ||
| batteryPercentageThreshold: 40, | ||
| isChargingBatteryPercentageThreshold: 35, | ||
| temperatureThreshold: 38, | ||
| }, | ||
| excellent: { batteryPercentageThreshold: 80, isChargingBatteryPercentageThreshold: 70, temperatureThreshold: 30 }, | ||
| high: { batteryPercentageThreshold: 55, isChargingBatteryPercentageThreshold: 50, temperatureThreshold: 34 }, | ||
| average: { batteryPercentageThreshold: 40, isChargingBatteryPercentageThreshold: 35, temperatureThreshold: 38 }, | ||
| }, | ||
| // ... cpu, network, storage thresholds | ||
| // ... cpu, network, storage |
There was a problem hiding this comment.
This code block has been made very compact, which harms readability. For a documentation example, clarity is more important than saving a few lines. Please consider reformatting this to be more readable, similar to its previous state, to improve developer experience.
memory: {
low: {
approxHeapRemainingInMBThreshold: 32,
approxHeapLimitInMBThreshold: 64,
},
average: {
approxHeapRemainingInMBThreshold: 64,
approxHeapLimitInMBThreshold: 128,
availableRamGBThreshold: 1.5,
},
high: {
approxHeapRemainingInMBThreshold: 256,
availableRamGBThreshold: 3,
},
},
battery: {
excellent: {
batteryPercentageThreshold: 80,
isChargingBatteryPercentageThreshold: 70,
temperatureThreshold: 30,
},
high: {
batteryPercentageThreshold: 55,
isChargingBatteryPercentageThreshold: 50,
temperatureThreshold: 34,
},
average: {
batteryPercentageThreshold: 40,
isChargingBatteryPercentageThreshold: 35,
temperatureThreshold: 38,
},
},
// ... cpu, network, storage
What it does
Prepares the library for npm publish under
@lokal-dev/react-native-device-metrics: updates docs and package metadata, fixes example and TS resolution for the new scope, and configures CI so the Android build can resolve the device-telemetry-toolkit dependency from GitHub Packages.Why we did it
@lokal-devscope.Changes
@lokal-dev/react-native-device-metrics; features, requirements, installation, and API reference simplified and corrected (e.g. getWeightedPerformanceLevels returns parsed object; getLatest* and getPerformanceLevel documented accurately); removed TOC, Kotlin requirement, and Publishing prerequisites; addednpm loginto manual release steps.nameset to@lokal-dev/react-native-device-metrics;descriptionupdated;publishConfig.access: "public";filesincludes README.md and LICENSE;authorset to{ name, email }(no url).@lokal-dev/react-native-device-metrics.@lokal-dev/react-native-device-metricsso the example and IDE resolve the scoped package.build-android:permissions(contents: read, packages: read);envwithGITHUB_USERNAME(github.repository_owner) andGITHUB_TOKEN(secrets.DEVICE_TELEMETRY_GITHUB_TOKEN) so Gradle can fetch device-telemetry-toolkit from GitHub Packages.Test Plan
yarn prepareat repo root and confirm build succeeds.yarn typecheckandyarn lint; no errors.@lokal-dev/react-native-device-metricsresolves (no red underline) and app runs.AI Used (~95%)
DEVICE_TELEMETRY_GITHUB_TOKENin GitHub Settings; running commits and pushing.