Skip to content

Fix package.json exports for index modules#646

Merged
ro0gr merged 1 commit intosan650:masterfrom
simonihmig:fix-exports
Sep 5, 2025
Merged

Fix package.json exports for index modules#646
ro0gr merged 1 commit intosan650:masterfrom
simonihmig:fix-exports

Conversation

@simonihmig
Copy link
Contributor

@simonihmig simonihmig commented Sep 3, 2025

An import like import { alias } from 'ember-cli-page-object/macros'; was failing to build when using Vite. It turns out there are indeed exports entries missing for all imports that should resolve to an index.js module. The existing ./* would not cover those correctly (there is no ./dist/macros.js).

I think this change here is correct, I wonder though why this didn't came up earlier, with ember-cli and ember-auto-import or Embroider, both using webpack which should also acknowledge package.json exports. 🤔

@simonihmig simonihmig marked this pull request as ready for review September 3, 2025 15:56
@ro0gr
Copy link
Collaborator

ro0gr commented Sep 3, 2025

Hey 👋 thanks for the PR.

I'm wondering if it makes sense to add vite mode to the test app. Do you know if is there a feasible way to add vite via ember-try? I'm mostly asking out of curiosity, your PR LGTM in its current state.

@simonihmig
Copy link
Contributor Author

simonihmig commented Sep 4, 2025

Do you know if is there a feasible way to add vite via ember-try

That would be nice, but I don't think that is practically feasible. There are too many differences in the boilerplate, it is not just changing dependencies. You could have a separate test-app-vite though, and run the same tests in both.

The latest v2 addon blueprint has a different setup with no separate test-app anymore, but it will only run with Vite, and won't support classic or Emrboider/webpack. And by not having two separate packages (addon and test-app), it wouldn't be able to test the change here with package.json exports, as those wouldn't be used when tests are inside the same package. 😅

@aklkv
Copy link

aklkv commented Sep 5, 2025

would it be possible to land this some time soon, we are also blocked on vite adoption 🙏🏻

@ro0gr
Copy link
Collaborator

ro0gr commented Sep 5, 2025

@simonihmig I see. Thank you for the explanation!

@ro0gr ro0gr merged commit 4d9eb7d into san650:master Sep 5, 2025
14 checks passed
@ro0gr
Copy link
Collaborator

ro0gr commented Sep 5, 2025

Just published it under v2.3.2 https://github.com/san650/ember-cli-page-object/releases/tag/v2.3.2

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