Skip to content

Fix/metro exports and hook import #326

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

zibs
Copy link
Contributor

@zibs zibs commented Jul 31, 2025

Description

Using this library at latest on a project causes some warnings in the terminal about some module imports/exports and I found a few issues digging into it.

From the commit message:

  • Remove broken exports array syntax that used invalid "imports" field
  • Replace with proper conditional exports object using "types" and "default" fields
  • Point all consumers to compiled JavaScript (dist/) instead of TypeScript source
  • Keep "react-native" field pointing to source for Metro bundler compatibility
  • Fix direct subpath import in usePressable.ts to use main package export instead of internal path -- this was causing issues once we set up the correct import/exports

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist: (Feel free to delete this section upon completion)

  • I have included a changeset if this change will require a version change to one of the packages.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have run all builds, tests, and linting and all checks pass
  • I have added tests that prove my fix is effective or that my feature works
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

ceceppa and others added 6 commits July 17, 2025 15:12
* expo module

* expo module

* Initial iOS & Android error check implementation

* Prettier fix

* move example to playground

* make clear error

* improve playground app
* fixes to get AMA playground running. still WIP

* fix build
- Fix exports field in all packages: replace invalid "imports" condition with proper "import" condition
- Add comprehensive export conditions (react-native, import, require, types, default) for better compatibility
- Add "./package.json" export to all packages for module resolution
- Fix direct subpath import in usePressable.ts to use main package export instead of internal path
@zibs zibs requested a review from ceceppa July 31, 2025 21:22
Copy link

vercel bot commented Jul 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-ama ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2025 8:24pm

@zibs zibs marked this pull request as draft August 1, 2025 15:01
zibs added 3 commits August 1, 2025 10:20
Update install-state.gz
…Script warnings

  - Remove broken exports array syntax that used invalid "imports" field
  - Replace with proper conditional exports object using "types" and "default" fields
  - Point all consumers to compiled JavaScript (dist/) instead of TypeScript source
  - Keep "react-native" field pointing to source for Metro bundler compatibility
  - Fix inconsistent dist paths (core package used dist/src/, others used dist/)

This resolves Babel warnings about TypeScript type exports (FormActions,
  FormFieldProps, etc.) not being declared in scope tracker. The previous
  exports configuration was malformed and caused consuming apps' Babel to
  process TypeScript type-only exports incorrectly.

  By directing all consumers to compiled JavaScript output, we ensure:
  - Types are properly stripped during compilation
  - Consistent behavior across all JavaScript environments
  - No Babel confusion with TypeScript type-only exports
  - Maintains React Native source access via "react-native" field
it seems like this was just typed wrong, it's an object with an `{issues: [], timestamp: 'string'}` shape
@zibs zibs marked this pull request as ready for review August 1, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants