create-disposabl-app 0.10.4 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/disposabl.js +218 -133
- package/dist/index.js +212 -47
- package/dist/templates/default/.github/scripts/apple.sh +60 -0
- package/dist/templates/default/.github/scripts/mobile.sh +10 -2
- package/dist/templates/default/.github/scripts/platforms.sh +32 -13
- package/dist/templates/default/.github/scripts/release.sh +2 -1
- package/dist/templates/default/.github/workflows/pipeline.yml +105 -44
- package/dist/templates/default/apps/desktop/README.md +5 -45
- package/dist/templates/default/apps/desktop/package.json +6 -6
- package/dist/templates/default/apps/docs/README.md +2 -4
- package/dist/templates/default/apps/docs/build.ts +10 -0
- package/dist/templates/default/apps/docs/content/backend.mdx +39 -0
- package/dist/templates/default/apps/docs/content/desktop.mdx +10 -0
- package/dist/templates/default/apps/docs/content/getting-started.mdx +26 -0
- package/dist/templates/default/apps/docs/content/index.mdx +27 -5
- package/dist/templates/default/apps/docs/content/mobile.mdx +18 -0
- package/dist/templates/default/apps/docs/content/web.mdx +14 -0
- package/dist/templates/default/apps/docs/dev.ts +40 -0
- package/dist/templates/default/apps/docs/package.json +15 -14
- package/dist/templates/default/apps/docs/press.config.ts +13 -1
- package/dist/templates/default/apps/docs/vite.config.ts +1 -0
- package/dist/templates/default/apps/mobile/.agents/skills/agent-device/SKILL.md +3 -1
- package/dist/templates/default/apps/mobile/.agents/skills/android-emulator/SKILL.md +2 -0
- package/dist/templates/default/apps/mobile/.agents/skills/dogfood/SKILL.md +1 -1
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/eas-hosting/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/SKILL.md +7 -4
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/library-integrations.md +116 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/queries.md +27 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/setup.md +3 -2
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update-insights/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/eas-workflows/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-animation/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-data-fetching/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-design-system/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-dev-client/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-dom/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-examples/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/SKILL.md +25 -21
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/references/compatibility.md +136 -60
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/references/example.md +17 -16
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/references/migration-map.md +132 -50
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-overview/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-project-structure/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/SKILL.md +0 -1
- package/dist/templates/default/apps/mobile/.agents/skills/ios-simulator/SKILL.md +2 -0
- package/dist/templates/default/apps/mobile/.claude/skills/agent-device/SKILL.md +24 -0
- package/dist/templates/default/apps/mobile/.claude/skills/android-emulator/SKILL.md +34 -0
- package/dist/templates/default/apps/mobile/.claude/skills/dogfood/SKILL.md +27 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-app-stores/SKILL.md +175 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-app-stores/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-app-stores/references/app-store-metadata.md +497 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-app-stores/references/ios-app-store.md +376 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-app-stores/references/native-ios.md +167 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-app-stores/references/play-store.md +244 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-app-stores/references/testflight.md +62 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-app-stores/references/workflows.md +120 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-hosting/SKILL.md +430 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-hosting/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-observe/SKILL.md +49 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-observe/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-observe/references/library-integrations.md +116 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-observe/references/metrics.md +98 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-observe/references/queries.md +471 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-observe/references/setup.md +530 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-observe/references/third-party.md +136 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-simulator/SKILL.md +236 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-simulator/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-simulator/references/controllers.md +139 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-simulator/references/logs-and-crashes.md +101 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-simulator/references/run-your-app.md +256 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-simulator/references/troubleshooting.md +56 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-update/SKILL.md +145 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-update/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-update-insights/SKILL.md +237 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-update-insights/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-update-insights/references/channel-insights-schema.md +47 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-update-insights/references/update-insights-schema.md +69 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-workflows/SKILL.md +98 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-workflows/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-workflows/scripts/fetch.js +109 -0
- package/dist/templates/default/apps/mobile/.claude/skills/eas-workflows/scripts/package.json +6 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-animation/LICENSE +21 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-animation/RECIPES.md +385 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-animation/SKILL.md +273 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-animation/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-app-clip/SKILL.md +290 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-app-clip/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-app-clip/references/native-module.md +96 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-brownfield/SKILL.md +69 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-brownfield/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-brownfield/references/brownfield-integrated.md +551 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-brownfield/references/brownfield-isolated.md +449 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-brownfield/references/comparison.md +63 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-brownfield/references/feature-integration.md +163 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-brownfield/references/troubleshooting.md +88 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-brownfield/references/version-compatibility.md +40 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-data-fetching/SKILL.md +477 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-data-fetching/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-data-fetching/references/expo-router-loaders.md +341 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-data-fetching/references/offline-and-cancellation.md +68 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-design-system/SKILL.md +375 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-design-system/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-design-system/references/audit.md +190 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-design-system/references/native-slop.md +74 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-dev-client/SKILL.md +183 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-dev-client/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-dom/SKILL.md +424 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-dom/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-examples/SKILL.md +105 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-examples/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-examples/references/catalog.md +105 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-migrate-module/SKILL.md +128 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-migrate-module/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-migrate-module/references/compatibility.md +206 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-migrate-module/references/example.md +213 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-migrate-module/references/migration-map.md +539 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-module/SKILL.md +150 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-module/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-module/references/config-plugin.md +90 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-module/references/create-expo-module.md +206 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-module/references/lifecycle.md +127 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-module/references/module-config.md +48 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-module/references/native-module.md +286 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-module/references/native-view.md +171 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-native-ui/SKILL.md +200 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-native-ui/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-native-ui/references/controls.md +231 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-native-ui/references/gradients.md +106 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-native-ui/references/icons.md +232 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-native-ui/references/media.md +193 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-native-ui/references/storage.md +121 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-native-ui/references/visual-effects.md +198 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-native-ui/references/webgpu-three.md +605 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-overview/SKILL.md +119 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-overview/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-overview/references/launch-without-dev-menu.md +24 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-project-structure/SKILL.md +113 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-project-structure/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-router/SKILL.md +239 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-router/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-router/references/form-sheet.md +253 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-router/references/route-structure.md +229 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-router/references/search.md +248 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-router/references/tabs.md +433 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-router/references/toolbar-and-headers.md +284 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-router/references/zoom-transitions.md +158 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/SKILL.md +313 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/agents/visual-grader.md +52 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/references/design-rubric.md +45 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/references/runtime-matrix.md +34 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/scripts/check-static.sh +64 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/scripts/clean-fixture.sh +56 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/scripts/generate_viewer.py +450 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/scripts/latest-sdk.sh +46 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/scripts/make-fixture.sh +95 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/scripts/make-workspace.sh +31 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/scripts/snapshot-android.sh +284 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/scripts/snapshot-ios.sh +132 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-skill-eval/scripts/snapshot-web.sh +61 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-ui/SKILL.md +100 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-ui/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-ui/references/drop-in-replacements.md +27 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-ui/references/jetpack-compose.md +73 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-ui/references/swift-ui.md +73 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-ui/references/universal.md +104 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-ui/scripts/list-components.js +193 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-upgrade/SKILL.md +149 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-upgrade/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-upgrade/references/expo-av-to-audio.md +132 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-upgrade/references/expo-av-to-video.md +160 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-upgrade/references/native-tabs.md +124 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-upgrade/references/new-architecture.md +79 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-upgrade/references/react-19.md +79 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-upgrade/references/react-compiler.md +59 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-upgrade/references/react-navigation-to-expo-router.md +61 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-web-to-native/SKILL.md +90 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-web-to-native/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-web-to-native/references/false-friends.md +119 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-web-to-native/references/native-patterns.md +39 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-web-to-native/references/run-as-goal.md +48 -0
- package/dist/templates/default/apps/mobile/.claude/skills/expo-web-to-native/references/verify-on-device.md +45 -0
- package/dist/templates/default/apps/mobile/.claude/skills/ios-simulator/SKILL.md +34 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/POWER.md +172 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/SKILL.md +238 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/bundle-analyze-app.md +208 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/bundle-analyze-js.md +264 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/bundle-barrel-exports.md +250 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/bundle-code-splitting.md +255 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/bundle-hermes-mmap.md +167 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/bundle-library-size.md +164 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/bundle-native-assets.md +208 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/bundle-r8-android.md +231 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/bundle-tree-shaking.md +215 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/bundle-treemap-source-map-explorer.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/controlled-textinput-pingpong.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/devtools-flamegraph.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/emerge-xray-ios.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/expo-atlas-treemap.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/flashlight-flatlist-vs-flashlist.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/fps-drop-graph.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/memory-heap-snapshot.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/tti-warm-start-diagram.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/view-hierarchy-flattening.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/xcode-instruments-templates.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/images/xcode-thread-view.png +0 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/js-animations-reanimated.md +273 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/js-atomic-state.md +190 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/js-bottomsheet.md +339 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/js-concurrent-react.md +238 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/js-lists-flatlist-flashlist.md +223 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/js-measure-fps.md +178 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/js-memory-leaks.md +168 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/js-profile-react.md +138 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/js-react-compiler.md +261 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/js-uncontrolled-components.md +219 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/native-android-16kb-alignment.md +114 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/native-measure-tti.md +221 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/native-memory-leaks.md +206 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/native-memory-patterns.md +240 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/native-platform-setup.md +112 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/native-profiling.md +140 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/native-sdks-over-polyfills.md +192 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/native-threading-model.md +230 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/native-turbo-modules.md +210 -0
- package/dist/templates/default/apps/mobile/.claude/skills/react-native-best-practices/references/native-view-flattening.md +180 -0
- package/dist/templates/default/apps/mobile/AGENTS.md +35 -8
- package/dist/templates/default/apps/mobile/README.md +31 -7
- package/dist/templates/default/apps/mobile/app.config.js +35 -6
- package/dist/templates/default/apps/mobile/metro.config.js +6 -0
- package/dist/templates/default/apps/mobile/nativewind-env.d.ts +2 -0
- package/dist/templates/default/apps/mobile/package.json +28 -16
- package/dist/templates/default/apps/mobile/postcss.config.mjs +1 -0
- package/dist/templates/default/apps/mobile/skills-lock.json +27 -27
- package/dist/templates/default/apps/mobile/src/app/(auth)/forgot-password.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/(authenticated)/change-password.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/_layout.tsx +1 -0
- package/dist/templates/default/apps/mobile/tsconfig.json +2 -1
- package/dist/templates/default/apps/web/.claude/skills/frontend-design/SKILL.md +71 -0
- package/dist/templates/default/apps/web/.claude/skills/web-design-guidelines/SKILL.md +39 -0
- package/dist/templates/default/apps/web/package.json +16 -16
- package/dist/templates/default/apps/web/site.json +10 -0
- package/dist/templates/default/apps/web/src/routeTree.gen.ts +282 -0
- package/dist/templates/default/apps/web/src/router/__root.tsx +44 -7
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.tsx +2 -4
- package/dist/templates/default/apps/web/src/router/index.tsx +101 -20
- package/dist/templates/default/apps/web/src/router/mobile-login.tsx +84 -0
- package/dist/templates/default/apps/web/vite.config.ts +53 -8
- package/dist/templates/default/bun.lock +5286 -27943
- package/dist/templates/default/bunfig.toml +4 -0
- package/dist/templates/default/disposabl.json +1 -1
- package/dist/templates/default/package.json +10 -6
- package/dist/templates/default/packages/backend/.claude/skills/convex/SKILL.md +69 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-add/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-advisor/SKILL.md +32 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-agent/SKILL.md +25 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-auth/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-authz/SKILL.md +36 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-backup/SKILL.md +33 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-billing/SKILL.md +69 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-cost/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-create-component/SKILL.md +325 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-create-component/agents/openai.yaml +14 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-create-component/assets/icon.svg +3 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-create-component/references/advanced-patterns.md +146 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-create-component/references/hybrid-components.md +38 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-create-component/references/local-components.md +39 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-create-component/references/packaged-components.md +54 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-crons/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-deploy-guard/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-design/SKILL.md +30 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-docs/SKILL.md +31 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-domains/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-env/SKILL.md +24 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-expert/SKILL.md +38 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-explain-app/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-improve-convex-plugin/SKILL.md +24 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-insights/SKILL.md +32 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-launch-readiness/SKILL.md +35 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-migrate/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-migrate-rehearse/SKILL.md +31 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-monitor/SKILL.md +22 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-optimize/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-quickstart/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-quickstart/agents/openai.yaml +14 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-quickstart/assets/icon.svg +4 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-reviewer/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-seed/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-self-heal/SKILL.md +38 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-sentinel/SKILL.md +25 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-suggest/SKILL.md +27 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-test/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.claude/skills/convex-verify/SKILL.md +34 -0
- package/dist/templates/default/packages/backend/README.md +23 -2
- package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +15 -6
- package/dist/templates/default/packages/backend/convex/_generated/server.d.ts +17 -0
- package/dist/templates/default/packages/backend/convex/auth.ts +90 -3
- package/dist/templates/default/packages/backend/convex/authEmail.ts +45 -0
- package/dist/templates/default/packages/backend/convex/authSetup.ts +12 -0
- package/dist/templates/default/packages/backend/convex/billing.ts +5 -0
- package/dist/templates/default/packages/backend/convex/convex.config.ts +38 -1
- package/dist/templates/default/packages/backend/convex/emails.ts +10 -0
- package/dist/templates/default/packages/backend/convex/files/index.ts +6 -0
- package/dist/templates/default/packages/backend/convex/files/internal.ts +5 -0
- package/dist/templates/default/packages/backend/convex/http.ts +9 -1
- package/dist/templates/default/packages/backend/convex/schema.ts +20 -19
- package/dist/templates/default/packages/backend/convex/telemetry.ts +84 -0
- package/dist/templates/default/packages/backend/convex/users/internal.ts +66 -10
- package/dist/templates/default/packages/backend/convex/users/validator.ts +14 -0
- package/dist/templates/default/packages/backend/generated/pages.json +36 -0
- package/dist/templates/default/packages/backend/package.json +8 -7
- package/dist/templates/default/packages/cli/README.md +3 -1
- package/dist/templates/default/packages/cli/auth.ts +6 -1
- package/dist/templates/default/packages/cli/client.ts +213 -0
- package/dist/templates/default/packages/cli/commands.ts +1 -293
- package/dist/templates/default/packages/cli/package.json +1 -1
- package/dist/templates/default/packages/disposabl-kit/GOOGLE_AUTH.md +37 -0
- package/dist/templates/default/packages/disposabl-kit/PAYMENTS.md +31 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/google-sign-in.tsx +78 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/legal-page.tsx +116 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/password-auth-form.tsx +221 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/password-page.tsx +37 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/log-out.tsx +28 -9
- package/dist/templates/default/packages/disposabl-kit/client/lib/prerender.ts +3 -1
- package/dist/templates/default/packages/disposabl-kit/client/lib/telemetry.ts +32 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/forgot-password.tsx +92 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/login.tsx +4 -149
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/reset-password.tsx +118 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/signUp.tsx +4 -159
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/verify-email.tsx +49 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/_authenticated/change-password.tsx +123 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/legal/delete-account.tsx +7 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/legal/index.tsx +7 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/legal/privacy-request.tsx +7 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/legal/privacy.tsx +7 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/legal/terms.tsx +7 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/pricing.tsx +223 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/route.tsx +66 -14
- package/dist/templates/default/packages/disposabl-kit/client/vite.config.ts +27 -1
- package/dist/templates/default/packages/disposabl-kit/feature-options.ts +44 -0
- package/dist/templates/default/packages/disposabl-kit/features.ts +3 -0
- package/dist/templates/default/packages/disposabl-kit/legal/README.md +7 -0
- package/dist/templates/default/packages/disposabl-kit/legal/config.ts +55 -0
- package/dist/templates/default/packages/disposabl-kit/legal/documents/privacy.ts +69 -0
- package/dist/templates/default/packages/disposabl-kit/legal/documents/terms.ts +66 -0
- package/dist/templates/default/packages/disposabl-kit/legal/index.ts +40 -0
- package/dist/templates/default/packages/disposabl-kit/legal/types.ts +6 -0
- package/dist/templates/default/packages/disposabl-kit/lib/auth-errors.ts +47 -0
- package/dist/templates/default/packages/disposabl-kit/lib/auth-session.ts +15 -0
- package/dist/templates/default/packages/disposabl-kit/lib/google-logo.png +0 -0
- package/dist/templates/default/packages/disposabl-kit/lib/indexing.ts +27 -0
- package/dist/templates/default/packages/disposabl-kit/lib/mobile-auth.ts +44 -0
- package/dist/templates/default/packages/disposabl-kit/lib/starter.ts +57 -0
- package/dist/templates/default/packages/disposabl-kit/lib/telemetry.ts +30 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/billing/account-billing.tsx +216 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/billing/session.ts +73 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/account-profile.tsx +128 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/appearance-settings.tsx +128 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/auth-form.tsx +168 -68
- package/dist/templates/default/packages/disposabl-kit/mobile/components/auth-ui.tsx +52 -8
- package/dist/templates/default/packages/disposabl-kit/mobile/components/email-verification.tsx +77 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/google-button.tsx +66 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/google-sign-in.tsx +121 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/settings-links.tsx +53 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/settings-page.tsx +58 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/design/accent.ts +31 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/design/avatar.tsx +38 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/design/brand-mark.tsx +18 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/design/native-button.tsx +20 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/design/preferences.tsx +234 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/design/primitives.tsx +229 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/design/theme-provider.tsx +198 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/design/theme.ts +13 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/design/themed-text.tsx +61 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/design/use-theme.ts +27 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/expo-plugin.cjs +28 -5
- package/dist/templates/default/packages/disposabl-kit/mobile/global.css +165 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/index.ts +3 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/layout.tsx +156 -23
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/auth-return.ts +10 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/logo-dark.png +0 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/logo-light.png +0 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/account.tsx +171 -39
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/change-password.tsx +147 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/forgot-password.tsx +158 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/home.tsx +162 -54
- package/dist/templates/default/packages/disposabl-kit/mobile/updates/current-update.ts +19 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/updates/foreground-check.ts +19 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/updates/update-prompt.tsx +201 -0
- package/dist/templates/default/packages/disposabl-kit/package.json +62 -22
- package/dist/templates/default/packages/disposabl-kit/payments/autumn.config.example +13 -0
- package/dist/templates/default/packages/disposabl-kit/server/billing-functions.ts +93 -0
- package/dist/templates/default/packages/disposabl-kit/server/billing.ts +119 -0
- package/dist/templates/default/packages/disposabl-kit/server/files-functions.ts +196 -0
- package/dist/templates/default/packages/disposabl-kit/server/files.ts +133 -0
- package/dist/templates/default/packages/disposabl-kit/server/google.ts +95 -0
- package/dist/templates/default/packages/disposabl-kit/server/http.ts +68 -18
- package/dist/templates/default/packages/disposabl-kit/server/lib/platform-spec.ts +99 -16
- package/dist/templates/default/packages/disposabl-kit/server/lib/static.ts +43 -5
- package/dist/templates/default/packages/disposabl-kit/server/lib/telemetry.ts +139 -0
- package/dist/templates/default/packages/sdk/package.json +1 -1
- package/dist/templates/default/packages/sdk/src/config.ts +1 -0
- package/dist/templates/default/packages/skill/SKILL.md +10 -2
- package/dist/templates/default/packages/skill/references/agent.md +28 -0
- package/dist/templates/default/packages/skill/references/delivery.md +2 -0
- package/dist/templates/default/packages/skill/references/design.md +2 -0
- package/dist/templates/default/packages/skill/references/iphone-preview.md +114 -0
- package/dist/templates/default/packages/skill/scripts/sign-iphone.py +126 -0
- package/dist/templates/default/packages/tests/README.md +10 -0
- package/dist/templates/default/packages/tests/billing.test.ts +77 -0
- package/dist/templates/default/packages/tests/components/mobile-google.test.mjs +142 -0
- package/dist/templates/default/packages/tests/components/mobile-settings.test.mjs +118 -0
- package/dist/templates/default/packages/tests/components/mobile-theme.test.mjs +122 -0
- package/dist/templates/default/packages/tests/components/mobile-updates.test.mjs +139 -0
- package/dist/templates/default/packages/tests/e2e.config.ts +1 -0
- package/dist/templates/default/packages/tests/files.test.ts +234 -0
- package/dist/templates/default/packages/tests/flows/email-delivery.e2e.ts +93 -0
- package/dist/templates/default/packages/tests/flows/files.e2e.ts +97 -0
- package/dist/templates/default/packages/tests/flows/legal.e2e.ts +38 -0
- package/dist/templates/default/packages/tests/flows/mcp.e2e.ts +120 -0
- package/dist/templates/default/packages/tests/flows/mobile-auth-disabled.e2e.ts +33 -0
- package/dist/templates/default/packages/tests/flows/mobile.e2e.ts +6 -4
- package/dist/templates/default/packages/tests/flows/password-backend.e2e.ts +58 -0
- package/dist/templates/default/packages/tests/flows/passwords.e2e.ts +206 -0
- package/dist/templates/default/packages/tests/flows/seo.e2e.ts +34 -0
- package/dist/templates/default/packages/tests/flows/web.e2e.ts +42 -2
- package/dist/templates/default/packages/tests/helpers/mobile.ts +31 -0
- package/dist/templates/default/packages/tests/ios-ota.test.ts +267 -0
- package/dist/templates/default/packages/tests/mobile-google.test.ts +100 -0
- package/dist/templates/default/packages/tests/mobile-settings.test.ts +21 -0
- package/dist/templates/default/packages/tests/mobile-theme.test.ts +13 -0
- package/dist/templates/default/packages/tests/mobile-updates-component.test.ts +14 -0
- package/dist/templates/default/packages/tests/mobile-updates.test.ts +122 -0
- package/dist/templates/default/packages/tests/native-billing.test.ts +138 -0
- package/dist/templates/default/packages/tests/package.json +11 -6
- package/dist/templates/default/packages/tests/seo-config.test.ts +17 -0
- package/dist/templates/default/packages/tests/telemetry.test.ts +188 -0
- package/dist/templates/default/patches/react-native-css@3.1.0-rc.1.patch +42 -0
- package/dist/templates/default/vendor/README.md +30 -23
- package/dist/templates/default/vendor/convex-auth-437831bd-disposabl.3.tgz +0 -0
- package/package.json +8 -8
- package/dist/templates/default/packages/backend/convex/mcpEnterprise/README.md +0 -42
- package/dist/templates/default/packages/backend/convex/mcpEnterprise/internal.ts +0 -153
- package/dist/templates/default/packages/backend/convex/mcpEnterprise/provision.ts +0 -102
- package/dist/templates/default/packages/backend/convex/mcpEnterprise/validator.ts +0 -35
- package/dist/templates/default/packages/cli/delete.ts +0 -48
- package/dist/templates/default/packages/cli/preview.ts +0 -234
- package/dist/templates/default/packages/disposabl-kit/server/mcp/enterprise.ts +0 -267
- package/dist/templates/default/packages/disposabl-kit/server/mcp/identity.ts +0 -33
- package/dist/templates/default/vendor/convex-auth-6c0ebf3f.tgz +0 -0
- /package/dist/templates/default/apps/mobile/src/app/{(authenticated)/account.tsx → settings.tsx} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Expo Modules API 2.0 Compatibility Checks
|
|
2
2
|
|
|
3
|
-
The Expo Modules API 2.0 design and implementation evolve across the macros plugin and `expo-modules-
|
|
3
|
+
The Expo Modules API 2.0 design and implementation evolve across three packages: the `expo-modules-macros` compiler plugin, `expo-modules-core`, and `expo-modules-jsi`. Verify the installed dependencies instead of relying on an SDK-number claim.
|
|
4
|
+
|
|
5
|
+
A fourth package, `expo-modules-cli`, provides the `expo-modules` command for module authors. `expo` depends on it and exposes the command as its own bin, so every project that depends on `expo` has it. Its `swift:check` and `swift:expand` commands run the macros of the installed `expo-modules-macros` version on Swift sources, without a build. See "Inspect the generated code".
|
|
4
6
|
|
|
5
7
|
## Find the actual declarations
|
|
6
8
|
|
|
@@ -10,121 +12,195 @@ Locate `ExpoModulesMacros.swift` in the target repository or installed dependenc
|
|
|
10
12
|
find . -name 'ExpoModulesMacros.swift' -not -path '*/node_modules/.cache/*'
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
Inspect the
|
|
15
|
+
Inspect the macros that the user's source can import, and the options that `@JS` accepts:
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
18
|
grep -nE 'public macro (ExpoModule|JS|Event|SharedObject|Record|Union|ViewProps|ExpoView)' <path-to-ExpoModulesMacros.swift>
|
|
19
|
+
grep -nE '^ case ' <path-to-ExpoModulesMacros.swift>
|
|
17
20
|
```
|
|
18
21
|
|
|
22
|
+
In SDK 58, core declares `@ExpoModule`, `@JS`, `@Event`, `@SharedObject`, `@Record`, and `@Union`, and the `@JS` options `.concurrent` and `.withAsync`. It does not declare `@ViewProps` or `@ExpoView`. The plugin implements both, but source cannot use them until core declares them.
|
|
23
|
+
|
|
19
24
|
A declaration proves only that Swift recognizes the attribute, not that the code the macro generates will compile and run against the installed core.
|
|
20
25
|
|
|
21
26
|
## Check paired core support
|
|
22
27
|
|
|
23
|
-
The
|
|
28
|
+
The three packages can drift independently, so a successful macro expansion does not prove the generated code links or is called at runtime. The binding hooks live in `expo-modules-core`. The value conversions, including free-form `Any`, `Task`, and closure callbacks, live in `expo-modules-jsi`. Search both.
|
|
24
29
|
|
|
25
30
|
> The symbol names in this section are macro internals, for your own verification only. Never print them in the conversation, name them in your report, or write them into the migrated module's source. Report a capability by its macro (`@JS static`, `@Event(sync:)`) and by observable JS behavior. See the reporting rule in `SKILL.md`.
|
|
26
31
|
|
|
27
|
-
**Fast pre-check.** Search core for the hooks the generated code calls, to rule out an unsupported capability before you write any Swift:
|
|
32
|
+
**Fast pre-check.** Search core and JSI for the hooks the generated code calls, to rule out an unsupported capability before you write any Swift:
|
|
28
33
|
|
|
29
34
|
```bash
|
|
30
|
-
grep -rnE '_decorateModule|_decorateSharedObject|_constructSharedObject|_jsName|EventEmitter|emitSync|
|
|
35
|
+
grep -rnE '_decorateModule|_decorateSharedObject|_constructSharedObject|_jsName|EventEmitter|emitSync|didCreate|decodeAnyDictionary|encodeAny|extension Task: JavaScriptEncodable|JavaScriptCallback|JSOptions|withAsync|UnionCaseMismatch' <expo-modules-core> <expo-modules-jsi>
|
|
31
36
|
```
|
|
32
37
|
|
|
33
38
|
An absent hook is strong evidence the capability is unavailable. A present one is weaker: it proves the symbol exists, not that its signature matches what the plugin generates or that core ever calls it.
|
|
34
39
|
|
|
35
|
-
**Confirm by compiling.** Write the smallest `@JS` member that uses the capability
|
|
40
|
+
**Confirm by compiling.** Write the smallest `@JS` member that uses the capability. Run `swift:check` (see "Inspect the generated code") to see the macro's own errors without a build. Then build the module target against the installed core and read the diagnostics:
|
|
36
41
|
|
|
37
42
|
- The build succeeds: the capability is supported end to end.
|
|
38
43
|
- The macro reports an error or warning: the plugin itself rejects the construct. The diagnostic names the supported alternative.
|
|
39
|
-
- Expansion succeeds but
|
|
44
|
+
- Expansion succeeds but the build fails on a missing symbol or an override with nothing to override: the plugin is ahead of core. Keep the member in the 1.0 DSL.
|
|
40
45
|
|
|
41
46
|
Then exercise the member from the example app or a test, because a binding can link and still never be invoked.
|
|
42
47
|
|
|
43
48
|
## Capability gates
|
|
44
49
|
|
|
45
|
-
Treat these as independent capabilities. Confirm each by compiling a minimal member that uses it, then calling it from JS
|
|
46
|
-
|
|
47
|
-
| Capability | Macro surface |
|
|
48
|
-
| --- | --- | --- | --- |
|
|
49
|
-
| Module functions/properties | `@ExpoModule`, `@JS` | `_decorateModule` and its call site | calling the function and reading the property from JS |
|
|
50
|
-
| Module name | `@ExpoModule("Name")` | `_jsName` and the name lookup that reads it | resolving the module under its expected JS name |
|
|
51
|
-
| Records | `@Record` | coding conformances and field decode/encode | round-tripping a record argument and a record return value |
|
|
52
|
-
| Async events | `@Event` | `EventEmitter` on modules and shared objects | receiving an emitted event through the module's JS listener |
|
|
53
|
-
| Shared-object instances | `@SharedObject`, `@JS` | `_decorateSharedObject(prototype:)`, construction hook | constructing one from JS and calling an instance member |
|
|
54
|
-
| Shared-object static members | `@JS static` | `_decorateSharedObject(constructor:)`, distinct from the `prototype:` overload | calling the member on the JS class itself, not an instance |
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
50
|
+
Treat these as independent capabilities. Confirm each by compiling a minimal member that uses it, then calling it from JS. The SDK 58 column records what SDK 58 provides at the floor in `SKILL.md`. Use it to decide where to look first, not in place of the checks.
|
|
51
|
+
|
|
52
|
+
| Capability | Macro surface | Hook to grep (internal) | SDK 58 | Confirm by |
|
|
53
|
+
| --- | --- | --- | --- | --- |
|
|
54
|
+
| Module functions/properties | `@ExpoModule`, `@JS` | `_decorateModule` and its call site | yes | calling the function and reading the property from JS |
|
|
55
|
+
| Module name | `@ExpoModule("Name")` | `_jsName` and the name lookup that reads it | yes, but a `Name(...)` entry wins over it | resolving the module under its expected JS name |
|
|
56
|
+
| Records | `@Record` | coding conformances and field decode/encode | yes, on a struct or a `final class` with no inheritance clause | round-tripping a record argument and a record return value |
|
|
57
|
+
| Async events | `@Event` | `EventEmitter` on modules and shared objects | yes | receiving an emitted event through the module's JS listener |
|
|
58
|
+
| Shared-object instances | `@SharedObject`, `@JS` | `_decorateSharedObject(prototype:)`, construction hook | yes | constructing one from JS and calling an instance member |
|
|
59
|
+
| Shared-object static members | `@JS static` | `_decorateSharedObject(constructor:)`, distinct from the `prototype:` overload | yes | calling the member on the JS class itself, not an instance |
|
|
60
|
+
| Shared-object subclasses | `@SharedObject` on a `SharedRef<T>` subclass or another indirect subclass | none, the compiler checks the superclass | yes | constructing one from JS and calling a member |
|
|
61
|
+
| Lazy properties | `@JS lazy var` | none, the macro binds a getter that stores the value | yes | reading the property twice from JS and seeing one native evaluation |
|
|
62
|
+
| Tuples | tuples in `@JS`, `@Record`, `@Union`, `@Event`, and closure arguments | `decodeTuple` and `encodeTuple` in JSI | yes | round-tripping an unlabeled tuple as an array and a labeled one as an object |
|
|
63
|
+
| Synchronous events | `@Event(sync:)` | `emitSync` overloads | **no**, core and JSI have no `emitSync` | observing the listener run before the emit call returns |
|
|
64
|
+
| Task-returning functions | `@JS` returning `Task` | `JavaScriptEncodable` for `Task` in JSI (encode-only) | yes | awaiting the returned promise in JS |
|
|
65
|
+
| Views | `@ViewProps`, `@ExpoView` | the macro declarations in `ExpoModulesMacros.swift` | **no**, core does not declare them | rendering the view and updating every prop from JS |
|
|
66
|
+
| Module lifecycle methods | lifecycle members on the module class | `AnyModule` requirements and holder call sites | yes | observing each hook fire |
|
|
67
|
+
| Free-form `Any` | `@JS` and `@Record` with `Any`, `[Any]`, `[String: Any]` | `decodeAny…` and `encodeAny…` in JSI | yes | passing a JS object through and back |
|
|
68
|
+
| Closure arguments | `@JS` with a function-typed parameter | `JavaScriptCallback` in JSI | yes | calling the closure from native code and reading the JS result |
|
|
69
|
+
| Off-JS-thread async start | `@JS(.concurrent)` | `JSOptions` and the options-taking `@JS` overload | yes | the `@JS` declaration accepting the option |
|
|
70
|
+
| Promise variant of a sync function | `@JS("nameSync", .withAsync("name"))` | `withAsync` in `JSOptions` | yes | calling both JS names |
|
|
71
|
+
| Typed N-case unions | `@Union` | `Union` macro declaration and `UnionCaseMismatch` | yes | round-tripping each case through the JS boundary |
|
|
72
|
+
| Autolinked `@ExpoModule` discovery | none, it is a build-time step | `scanModules` in `expo-modules-autolinking` | yes | the module loading without an `apple.modules` list |
|
|
63
73
|
|
|
64
74
|
If a capability cannot be confirmed, keep that item in the 1.0 DSL.
|
|
65
75
|
|
|
66
76
|
## Known migration hazards
|
|
67
77
|
|
|
68
|
-
Use this only as a warning list;
|
|
78
|
+
Use this only as a warning list; installed source wins.
|
|
69
79
|
|
|
70
|
-
- Async threading changed architecturally, not just syntactically: a 2.0 `async` member starts on the JS thread and leaves it at the first suspension point, where a 1.0 `AsyncFunction` never ran there. A verbatim migration can move blocking work onto the JS thread with no signature change. `@JS(.concurrent)`
|
|
71
|
-
- Same-JS-name `@JS` overload grouping
|
|
72
|
-
- `@Union`
|
|
80
|
+
- Async threading changed architecturally, not just syntactically: a 2.0 `async` member starts on the JS thread and leaves it at the first suspension point, where a 1.0 `AsyncFunction` never ran there. A verbatim migration can move blocking work onto the JS thread with no signature change. `@JS(.concurrent)` restores the 1.0 behavior. In Swift 6 language mode, `.concurrent`, `.withAsync`, and a detached `Task` need the module or shared object to be `@unchecked Sendable`, which newer macros add themselves. See the threading section in `references/migration-map.md`.
|
|
81
|
+
- Same-JS-name `@JS` overload grouping and dispatch were designed but never built. The plugin reports two `@JS` members with one JS name on one object as a build error. A shared object's static and instance members bind onto different JS objects, so they can share a name.
|
|
82
|
+
- `@Union` decoding is first-match in case-declaration order, so preserving a 1.0 `Either`'s type order is part of the contract. See the unions section in `references/migration-map.md`.
|
|
73
83
|
- Decode errors lacked the 1.0 argument-index wrapper. This affects diagnostics rather than call semantics, but tests asserting exact messages may fail.
|
|
74
|
-
- `@ViewProps`
|
|
75
|
-
- `@Event(sync: true)` macro generation
|
|
76
|
-
-
|
|
77
|
-
- `@JS` functions/properties, range-based arity, default/optional-aware calls, `@Record` field synthesis, async `@JavaScriptActor`, and shared-object decoration had landed in the macros work.
|
|
78
|
-
- Shared-object `@JS static`/`class` members bind onto the constructor object through a `constructor:`-labeled decoration hook, separate from the `prototype:` one used for instance members. The plugin has emitted this binding since `v0.7.0`, but core shipped the `prototype:` overload well ahead of it, so a static member can expand and then fail to link. Instance support does not imply static support. Keep `StaticFunction`/`StaticAsyncFunction` entries in the 1.0 `Class(...)` block until the `constructor:` overload is present.
|
|
84
|
+
- The plugin in SDK 58 implements `@ViewProps` and `@ExpoView`, but core does not declare either macro and has no typed view-props runtime. Views stay on the 1.0 DSL.
|
|
85
|
+
- `@Event(sync: true)` macro generation exists, but SDK 58 core and JSI have no `emitSync`.
|
|
86
|
+
- Shared-object `@JS static`/`class` members bind onto the JS class object through a `constructor:`-labeled decoration hook, separate from the `prototype:` one used for instance members. Instance support does not imply static support, so confirm a static member by calling it on the JS class.
|
|
79
87
|
- Async `@JS` bindings are two-phase: arguments decode synchronously before the asynchronous boundary, and return values encode on the JS thread. A 1.0 async function whose argument decoding had side effects ordered after the hop can therefore observe a different order.
|
|
88
|
+
- On SDK 58, `JavaScriptValue` is a non-copyable struct, and DSL `Function`, `AsyncFunction`, `Property`, and `Field` no longer accept it in their signatures. A DSL member that takes or returns a `JavaScriptValue` no longer compiles. Migrate it to `@JS` and take the value as `borrowing JavaScriptValue`. To keep the value after the call returns, store `value.ref()` and read it back with `take()` or `withUnwrappedValue(_:)`. Write `.undefined()` and `.null()`, which are functions now.
|
|
89
|
+
- Core reads the `@ExpoModule` name only when the module has no `Name(...)` entry. In mixed mode a leftover `Name(...)` wins, so a mismatch between the two names is silent.
|
|
90
|
+
- A no-payload `@Event` (`() -> Void`) sends `undefined`. A 1.0 `sendEvent("name")` without a body sent `{}`.
|
|
91
|
+
- `OnAppContextDestroys`, `OnAppEntersForeground`, `OnAppEntersBackground`, and `OnAppBecomesActive` have no 2.0 hook. They stay in `definition()`.
|
|
92
|
+
|
|
93
|
+
## Macro changes in SDK 58 that affect a migration
|
|
94
|
+
|
|
95
|
+
All of them are present under the `expo` `58.0.21` floor in `SKILL.md`.
|
|
96
|
+
|
|
97
|
+
### Free-form `Any`
|
|
98
|
+
|
|
99
|
+
`Any`, `[Any]`, and `[String: Any]` are accepted as `@JS` arguments, return values, and properties, and as `@Record` fields. One optional layer (`[String: Any]?`) also works, and so do nested types built from `Any`, arrays, `String`-keyed dictionaries, and optionals (`[String: [Any]]`). They convert through dedicated free-form methods in JSI, not through `JavaScriptDecodable`/`JavaScriptEncodable`.
|
|
100
|
+
|
|
101
|
+
A 1.0 DSL member with a loosely typed dictionary can therefore keep its Swift signature. Prefer a typed `@Record` only when the user asks for an API-shape change.
|
|
102
|
+
|
|
103
|
+
### Closure arguments
|
|
104
|
+
|
|
105
|
+
A `@JS` function or initializer can take a closure parameter, such as `(Point) throws -> Size` or `(String) async throws -> Data`. JS passes a function for it. Native code can store the closure and call it from any thread.
|
|
106
|
+
|
|
107
|
+
- A closure that returns a value must be `throws`, so that an error from JS can reach the caller.
|
|
108
|
+
- A throwing or value-returning closure blocks the caller until JS returns. An `async` closure suspends instead and awaits the promise that the JS function returns.
|
|
109
|
+
- A non-throwing `Void` closure returns before JS reads its arguments, so do not change a class instance after passing it to one.
|
|
110
|
+
- An optional closure (`((Int) -> Void)?`) turns JS `null` and `undefined` into `nil`.
|
|
111
|
+
- A closure nested in another type, such as an array, is not a closure parameter.
|
|
112
|
+
- The closure type accepts only the `@escaping` and `@Sendable` attributes. Its parameters cannot be variadic, `inout`, closures, or free-form `Any`, and it cannot use typed throws.
|
|
113
|
+
- A `@JS` function cannot return a closure, and a `@JS` property cannot have a closure type.
|
|
114
|
+
|
|
115
|
+
### Parameters and names
|
|
116
|
+
|
|
117
|
+
- `inout` and `isolated` parameters are build errors, because a `@JS` argument is a fresh value decoded from JS. `borrowing`, `consuming`, and `sending` parameters are accepted.
|
|
118
|
+
- A backticked Swift name binds under its bare name: ``@JS func `default`()`` is `default` in JS.
|
|
119
|
+
|
|
120
|
+
### `.withAsync`
|
|
80
121
|
|
|
81
|
-
|
|
122
|
+
`@JS("readSync", .withAsync("read"))` binds a synchronous function under its own JS name, and binds it again under the given name as a function that returns a promise and runs the body on the concurrent thread pool. See the threading section in `references/migration-map.md`. The macro rejects it on an `async` function, a property, or an initializer, and on a function isolated to a global actor.
|
|
82
123
|
|
|
83
|
-
|
|
124
|
+
### Records
|
|
84
125
|
|
|
85
|
-
|
|
126
|
+
`@Record` types convert without an app context. A `@Record` class must be `final` and have no inheritance clause, or the build fails; declare its protocol conformances in an extension. A 1.0 `class Options: Record` therefore becomes `@Record final class Options`, or a struct.
|
|
86
127
|
|
|
87
|
-
###
|
|
128
|
+
### Static members on shared objects
|
|
88
129
|
|
|
89
|
-
`
|
|
130
|
+
`static` and `class` `@JS` members of a `@SharedObject` class bind onto the JS class itself, so JS calls them as `Cache.open(name)`. A 1.0 `StaticFunction` or `StaticAsyncFunction` migrates to one. See the static members section in `references/migration-map.md`.
|
|
90
131
|
|
|
91
|
-
|
|
132
|
+
### `lazy` properties and shared-object subclasses
|
|
92
133
|
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
- **property**: compile error, because its getter always encodes
|
|
134
|
+
- A `@JS lazy var` is read-only from JS. Its first read stores the value as a data property on the JS object, so later reads do not call native code. On a frozen JS object the value is not stored, and each read calls the getter. This is the closest mapping for a 1.0 `Constant`.
|
|
135
|
+
- `@SharedObject` accepts a `SharedRef<T>` subclass and any other indirect `SharedObject` subclass. The compiler, not the macro, reports a class that is not a `SharedObject` subclass. Each `@SharedObject` class exposes only the `@JS` members that it declares. That matches 1.0, where a `Class(...)` block could not inherit from another.
|
|
96
136
|
|
|
97
|
-
|
|
137
|
+
### Tuples
|
|
98
138
|
|
|
99
|
-
|
|
139
|
+
A tuple can cross the boundary as a `@JS` argument, result, or property, a `@Record` property, a `@Union` or `@Event` payload, or a parameter or result of a closure argument that is not `async`.
|
|
100
140
|
|
|
101
|
-
|
|
141
|
+
- An unlabeled tuple such as `(Int, String)` converts to an array with one value per element. A labeled tuple such as `(x: Double, y: Double)` converts to an object with one property per label.
|
|
142
|
+
- A tuple must have two or more elements, all labeled or none, and each element must be convertible. Tuples nest in other tuples, optionals, arrays, and `String`-keyed dictionaries.
|
|
143
|
+
- A type alias of a tuple, such as `typealias Span = (start: Int, end: Int)`, resolves only when the `@ExpoModule` or `@SharedObject` class body declares it.
|
|
102
144
|
|
|
103
|
-
###
|
|
145
|
+
### Package and binary names
|
|
104
146
|
|
|
105
|
-
The
|
|
147
|
+
The package is `expo-modules-macros`, formerly `@expo/expo-modules-macros-plugin`, and the executable is `ExpoModulesMacros`, formerly `ExpoModulesMacros-tool`. `pod install` adds `-load-plugin-executable <plugin>/apple/ExpoModulesMacros#ExpoModulesMacros` to `OTHER_SWIFT_FLAGS`. Look for that flag when the compiler cannot find the macro implementation.
|
|
148
|
+
|
|
149
|
+
## Autolinked module discovery
|
|
150
|
+
|
|
151
|
+
On SDK 58, autolinking scans the package sources for `@ExpoModule` classes when it generates the modules provider. The rules that matter for a migration:
|
|
152
|
+
|
|
153
|
+
- When `expo-module.config.json` has an `apple.modules` list, even an empty one, autolinking uses only that list and ignores the scan.
|
|
154
|
+
- Without the list, it links every scanned class that is `public` or `open` and compiles for the target platform. An `internal` class gets a warning, and a lower access level opts the class out silently.
|
|
155
|
+
- A class inside an `#if` condition that the scanner cannot evaluate statically, such as `#if DEBUG` or `canImport(...)`, is skipped with a warning. List such a class in `apple.modules`.
|
|
156
|
+
- The scan skips `Tests`, `UITests`, `__tests__`, `__mocks__`, `example`, `examples`, `e2e`, `Pods`, `node_modules`, `.build`, and `.git` directories. A module class kept under one of those names needs the list.
|
|
157
|
+
- The scan finds only classes with the `@ExpoModule` attribute. A package that still has a module on the 1.0 DSL alone needs the list.
|
|
158
|
+
|
|
159
|
+
Run the scanners yourself as migration checks. Run this from the module package root, and pass the scanner's name, `scanModules` or `scanExports`, as the argument:
|
|
106
160
|
|
|
107
161
|
```bash
|
|
108
|
-
|
|
162
|
+
node -e "
|
|
163
|
+
const path = require('path');
|
|
164
|
+
let dir = process.cwd();
|
|
165
|
+
for (const name of ['expo', 'expo-modules-core', 'expo-modules-macros']) {
|
|
166
|
+
dir = path.dirname(require.resolve(name + '/package.json', { paths: [dir] }));
|
|
167
|
+
}
|
|
168
|
+
require(dir)[process.argv[1]](['ios']).then((r) => console.log(JSON.stringify(r, null, 2)));
|
|
169
|
+
" scanModules
|
|
109
170
|
```
|
|
110
171
|
|
|
111
|
-
|
|
172
|
+
The script resolves `expo`, then `expo-modules-core` from it, then `expo-modules-macros` from that, which is how `expo-modules-cli` finds the macros. Only `expo` has to be a dependency of the module, so the script also works with pnpm and bun isolated installs, where `expo-modules-core` cannot be resolved from the module root.
|
|
173
|
+
|
|
174
|
+
`scanModules` reports each detected class with its Swift `name`, `jsName`, `accessLevel`, and `platforms`, plus `warnings`. It catches an `@ExpoModule` that landed in a conditional block or on a non-public class.
|
|
175
|
+
|
|
176
|
+
`scanExports` reports the macro-declared surface: `modules`, `sharedObjects`, `records`, `unions`, and `enums`. Each module lists its `functions` (with `jsName`, `parameters`, `async`, `throws`, and `static`), `properties` (with `readonly`), `events` (with `jsName`, `payload`, and `sync`), and `classes`. Compare it against the inventory from step 1. It does not report members that stay in the DSL.
|
|
177
|
+
|
|
178
|
+
## Inspect the generated code
|
|
179
|
+
|
|
180
|
+
`expo-modules-cli` has two commands that run the macros on Swift sources without a build. Both find the `expo-modules-macros` version through the package's `expo` and `expo-modules-core`, which is the version the iOS build compiles with. Run them from the module package root:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# Only the macro errors and warnings, and a summary. The exit code is 1 when there is an error.
|
|
184
|
+
npx --no-install expo-modules swift:check ios
|
|
185
|
+
|
|
186
|
+
# The code that the macros generate, for a file or for one type or member.
|
|
187
|
+
npx --no-install expo-modules swift:expand ios/MyModule.swift
|
|
188
|
+
npx --no-install expo-modules swift:expand --symbol MyModule.load ios/MyModule.swift
|
|
189
|
+
```
|
|
112
190
|
|
|
113
|
-
|
|
191
|
+
`expo` declares the `expo-modules` bin itself and forwards it to `expo-modules-cli`, so every package manager links it into `node_modules/.bin`, also with pnpm and bun isolated installs. `pnpm exec expo-modules` and `bunx expo-modules` run the same command. It needs `expo` installed in the module package; when the command is missing, install the module's dependencies. `--no-install` keeps `npx` from downloading a package from npm in that case. A path is a `.swift` file or a directory. In a directory, only the files that use a macro are expanded, and test and example directories are skipped. The diagnostics use the compiler's `<file>:<line>:<column>: error: <message>` format. `--json` prints a report instead of text, and then the exit code is 0 even when there is an error.
|
|
114
192
|
|
|
115
|
-
|
|
116
|
-
- A migrated `@ExpoModule` class must be `public` or `open` to be linkable from the app target. The scanner reports each class's access level so inaccessible ones can be skipped with a diagnostic.
|
|
117
|
-
- Product sources kept under a pruned directory name are invisible to the scanner. A package in that layout stays on `expo-module.config.json`, which opts it out of scanning.
|
|
118
|
-
- You can run `scan-modules` yourself as a migration check: it lists which classes the macro attribute is actually detected on, which catches an `@ExpoModule` that landed in a conditional block or a non-public class.
|
|
193
|
+
Use `swift:check` to find a macro error fast, and `swift:expand` to see why a binding does not behave as expected. Do not copy the expansion into the module source, and do not quote it to the user: it consists of the internal symbols that the handoff rule in `SKILL.md` keeps out of reports. The macros see only syntax, so code with no diagnostics can still fail to type-check, build, or link against the installed core.
|
|
119
194
|
|
|
120
195
|
## Integration verification
|
|
121
196
|
|
|
122
197
|
Use the target project's own commands. A robust sequence is:
|
|
123
198
|
|
|
124
199
|
1. Run macro/unit tests if working inside the macros package.
|
|
125
|
-
2.
|
|
126
|
-
3.
|
|
127
|
-
4.
|
|
128
|
-
5.
|
|
200
|
+
2. Run `npx --no-install expo-modules swift:check ios` on the module's iOS sources.
|
|
201
|
+
3. Compile the migrated native module against the installed core.
|
|
202
|
+
4. Re-run CocoaPods installation when plugin dependencies or injection changed.
|
|
203
|
+
5. Restart Xcode after swapping a macro plugin binary; cleaning DerivedData alone may not reload it.
|
|
204
|
+
6. Build the example app and execute existing JS/TS behavior tests.
|
|
129
205
|
|
|
130
|
-
Do not report a migration complete based only on textual expansion tests.
|
|
206
|
+
Do not report a migration complete based only on `swift:check`, `swift:expand`, or textual expansion tests.
|
package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/references/example.md
CHANGED
|
@@ -72,7 +72,7 @@ The observable contract to preserve:
|
|
|
72
72
|
|
|
73
73
|
## Intermediate: mixed mode
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
SDK 58 core supports everything used above: `@ExpoModule`, `@JS` functions/properties/constants, async `@JavaScriptActor`, `@JS(.concurrent)`, `@Record`, default async `@Event`, and the module lifecycle hooks. One member still needs a decision, by semantics rather than support: `clearCache` has a body that blocks and never suspends, and a 1.0 `AsyncFunction` runs it on a background queue automatically, while a 2.0 async member starts on the JS actor. Migrating it as-is would move blocking I/O onto the JS thread, so it stays in the DSL until its group is migrated deliberately.
|
|
76
76
|
|
|
77
77
|
The record migrates first because it is a pure data type and the function that consumes it depends on it. Its shape is already correct, so migration is just verifying each field decodes: `url`, `retries`, `label` all map cleanly, so `@Record` stays as-is (it was already using the macro here).
|
|
78
78
|
|
|
@@ -101,9 +101,9 @@ public final class DownloaderModule: Module {
|
|
|
101
101
|
@JS
|
|
102
102
|
var volume: Double = 1
|
|
103
103
|
|
|
104
|
-
//
|
|
104
|
+
// Read-only from JS, evaluated at the first read and cached, like the 1.0 Constant.
|
|
105
105
|
@JS
|
|
106
|
-
|
|
106
|
+
lazy var buildInfo = computeBuildInfo()
|
|
107
107
|
|
|
108
108
|
@JS
|
|
109
109
|
func download(options: DownloadOptions) async throws -> String {
|
|
@@ -111,11 +111,11 @@ public final class DownloaderModule: Module {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// override: the hooks are inherited from the Module base class.
|
|
114
|
-
override func didStartListening(event: String) {
|
|
114
|
+
public override func didStartListening(event: String) {
|
|
115
115
|
beginProgressUpdates()
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
override func didStopListening(event: String) {
|
|
118
|
+
public override func didStopListening(event: String) {
|
|
119
119
|
stopProgressUpdates()
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -143,13 +143,14 @@ Notes on the choices, each traceable to `migration-map.md`:
|
|
|
143
143
|
- `Name("Downloader")` moved into `@ExpoModule("Downloader")`; the custom name is carried explicitly, never dropped.
|
|
144
144
|
- `@Event("onProgress")` uses the explicit wire name to avoid the `on`-stripping default; the untyped dictionary became a typed `ProgressEvent`.
|
|
145
145
|
- The duplicate `private var volume` field was removed once `@JS var volume` became the single source of truth. Watch for this: a 1.0 backing field plus a migrated `@JS var` of the same name is a double-declaration.
|
|
146
|
-
- `Constant("buildInfo")` became `@JS
|
|
147
|
-
- `OnStartObserving`/`OnStopObserving` became the `didStartListening(event:)`/`didStopListening(event:)` hooks, with `override` because the class inherits `Module`. The 1.0 hooks were module-wide, so the event argument is ignored.
|
|
146
|
+
- `Constant("buildInfo")` became `@JS lazy var buildInfo`. Both evaluate at the first read from JS and cache the value, so the evaluation time does not change. A `@JS let` would evaluate when the module is created.
|
|
147
|
+
- `OnStartObserving`/`OnStopObserving` became the `didStartListening(event:)`/`didStopListening(event:)` hooks, with `public override` because the class inherits `Module` and is `public`. The 1.0 hooks were module-wide, so the event argument is ignored.
|
|
148
148
|
- `definition()` remains but now holds only the queue-sensitive `clearCache`. It is not deleted because it is non-empty.
|
|
149
|
+
- The class name did not change, so the package's `expo-module.config.json` entry (`"apple": { "modules": ["DownloaderModule"] }`) stays valid and is left as it is.
|
|
149
150
|
|
|
150
151
|
## Fully migrated (after explicitly moving the blocking work off the JS actor)
|
|
151
152
|
|
|
152
|
-
The DSL entry for `clearCache` was the semantics-preserving default. To finish the migration,
|
|
153
|
+
The DSL entry for `clearCache` was the semantics-preserving default. To finish the migration, migrate it with `@JS(.concurrent)`, so the blocking body still never runs on the JS thread, then delete the empty `definition()`.
|
|
153
154
|
|
|
154
155
|
```swift
|
|
155
156
|
import ExpoModulesCore
|
|
@@ -180,26 +181,24 @@ public final class DownloaderModule: Module {
|
|
|
180
181
|
var volume: Double = 1
|
|
181
182
|
|
|
182
183
|
@JS
|
|
183
|
-
|
|
184
|
+
lazy var buildInfo = computeBuildInfo()
|
|
184
185
|
|
|
185
186
|
@JS
|
|
186
187
|
func download(options: DownloadOptions) async throws -> String {
|
|
187
188
|
return try await performDownload(options)
|
|
188
189
|
}
|
|
189
190
|
|
|
190
|
-
|
|
191
|
+
// The body blocks without suspending, so it runs off the JS thread.
|
|
192
|
+
@JS(.concurrent)
|
|
191
193
|
func clearCache() async throws {
|
|
192
|
-
|
|
193
|
-
try await Task.detached {
|
|
194
|
-
try FileManager.default.removeItem(at: self.cacheDirectory)
|
|
195
|
-
}.value
|
|
194
|
+
try FileManager.default.removeItem(at: cacheDirectory)
|
|
196
195
|
}
|
|
197
196
|
|
|
198
|
-
override func didStartListening(event: String) {
|
|
197
|
+
public override func didStartListening(event: String) {
|
|
199
198
|
beginProgressUpdates()
|
|
200
199
|
}
|
|
201
200
|
|
|
202
|
-
override func didStopListening(event: String) {
|
|
201
|
+
public override func didStopListening(event: String) {
|
|
203
202
|
stopProgressUpdates()
|
|
204
203
|
}
|
|
205
204
|
|
|
@@ -210,3 +209,5 @@ public final class DownloaderModule: Module {
|
|
|
210
209
|
```
|
|
211
210
|
|
|
212
211
|
`definition()` is gone only because it was empty and `@ExpoModule("Downloader")` preserves the resolved name. If any member had stayed blocked or unverified, the mixed-mode form above is the correct place to stop, not a broken end state.
|
|
212
|
+
|
|
213
|
+
`.concurrent` sends the module off the JS thread, so in Swift 6 language mode the class needs `@unchecked Sendable`, as the `.concurrent` constraints in `migration-map.md` describe. The off-thread body reads only `cacheDirectory`, so the conformance is safe as long as `cacheDirectory` does not change. `volume` stays on the JS thread.
|