-
Notifications
You must be signed in to change notification settings - Fork 28
chore(devx): make dev/CI deterministic and move iOS tests into package ownership #85
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: main
Are you sure you want to change the base?
Conversation
- ignore apps/example/targets as generated prebuild output to reduce churn - remove tracked example target artifacts from version control - point VS Code and pre-push lint command to TestHarness SwiftLint binary - document one-time pod install setup in CONTRIBUTING
- ensure clean example prebuild paths generate Apple targets in local scripts and CI - enforce JS runtime/plugin tests in CI and release gates - restore SwiftLint and Swift format coverage for production iOS module files - exclude dev-only harness/test artifacts from published npm package
7a01fac to
b2c8a66
Compare
commit: |
|
@robertherber yo sorry for the monster-sized PR! I started working on it cuz I wanted to improve a couple things, but it ended up taking almost a full day. Honestly tho, was worth it, esp considering I need to add a couple more features to this package, including reporting as I mentioned (almost done). DX now feels sublime compared to before. The codebase is also way more maintainable now. Lmk if you have any feedback/want some things changed. If you had other DX setup changes in mind happy to implement. |
TL;DR:
This PR stabilizes the contributor/dev workflow without changing the public JS API. I moved iOS tests and harness ownership into the package, aligned the example app with Expo's CNG workflow guidance (generate native output instead of tracking it in git), hardened CI/local test and lint paths, and tightened npm publish filtering so package contents stay lean and aligned with current release expectations.
What the situation looked like before
npm,npx,bun) and had stale path references from the oldexample/layoutapps/example/ios,apps/example/android,apps/example/targets), which created high PR churn afterexpo prebuildexpo-module-scripts), which made formatting on save different from formatting through the CLIWhy I made these changes
What changed
1) Tooling and path consistency
.husky/pre-push, example prebuild usingbunx).example/*references toapps/example/*in workflows, ignores, docs, and scripts.node ./node_modules/prettier/bin/prettier.cjs) to avoid PATH/bin shadowing (where transitive tooling can resolve the wrong Prettier binary/version). See expo/expo#42994.2) Example app moved to env-driven CNG flow
apps/example/app.jsonwith env-drivenapps/example/app.config.ts.apps/example/.env.examplefor:RNDA_APPLE_TEAM_IDRNDA_APP_GROUPRNDA_IOS_BUNDLE_IDRNDA_ANDROID_PACKAGEapps/example/ios,apps/example/android) and generated target output (apps/example/targets).apps/example/ios,apps/example/android, andapps/example/targetsare generated outputs and are expected to be regenerated locally, not committed.3) iOS tests now package-owned, with a package-owned harness
packages/react-native-device-activity/ios/Tests.packages/react-native-device-activity/ios/TestHarness.4) Clear source-of-truth for Apple target artifacts
packages/react-native-device-activity/targetsis now the canonical source for Apple target templates.apps/example/targets.5) Test workflow hardening
packages/react-native-device-activity/plugin/__tests__/config-plugin.test.ts.packages/react-native-device-activity/src/index.test.tsto properly mock runtime dependencies and verify native delegation behavior.bun run testruns both runtime and plugin tests withCI=1to keep Jest non-watch and deterministic in hooks/CI.pre-pushto run typecheck, lint, tests, and SwiftLint.6) Packaging safety
packages/react-native-device-activity/ios/ReactNativeDeviceActivity.podspecto excludeTests/**/*andTestHarness/**/*from pod source globs.packages/react-native-device-activity/.npmignoreto exclude dev-only harness/test/plugin test files from npm publish artifacts.build/*.test.*).targets/but excluded generated target metadata that is not part of the current published package (generated.entitlementsandPrivacyInfo.xcprivacyfiles).7) Docs and contributor workflow updates
CONTRIBUTING.mdsetup guidance around env config, CNG regeneration, harness ownership, SwiftLint setup, and formatting behavior.8) Post-review hardening fixes before merge
bun run prebuildfromapps/example(which sets the required env toggles).ios/androidrun scripts now also setCOPY_TO_TARGET_FOLDER=trueso target generation is consistent.bun run testintest.ymland publish test gate).swift formatcoverage beyond tests/harness-only paths.swiftlintscript guard so missing harness SwiftLint binaries fail fast and stop execution (instead of falling through to a second command failure).--strict(matchingbun run pre-pushbehavior).NPM package footprint check
Measured on February 9, 2026 with
npm pack --dry-runafterprepublishOnly, compared against currently publishedreact-native-device-activity@0.5.3.0.5.3)Important note on formatter-only file changes
Some files changed only because we ran the formatter. Those edits are non-functional style/layout normalization, not behavior changes. This includes a few tiny package file touches, but no logic change.
How the situation is now
CI=1, preventing local/CI watch-mode prompts during automated checks.API / runtime impact