Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions test/unit/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ const dependenciesToTransform = [
process.env.TZ = 'UTC';

/*
* Resolved rather than hardcoded to `<rootDir>/node_modules`,
* which is empty under non-hoisting installs.
* Resolved hop by hop through its dependents rather than hardcoded to
* `<rootDir>/node_modules`, which is empty under non-hoisting installs.
*/
const ariakitUtilsDir = path.dirname(
require.resolve( '@ariakit/utils/package.json', {
paths: [ path.join( ROOT_DIR, 'packages/components' ) ],
} )
const ariakitUtilsDir = [
'@ariakit/react',
'@ariakit/react-components',
'@ariakit/utils',
].reduce(
( fromDir, packageName ) =>
path.dirname(
require.resolve( `${ packageName }/package.json`, {
paths: [ fromDir ],
} )
),
path.join( ROOT_DIR, 'packages/components' )
);
Comment on lines +44 to 56

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, would findPackageJSON be something that we'd want to use or would help in this situation?

It's one of the features we were waiting for Node.js v24 to be able to start using in places where we currently resolve package.json files.


const commonProjectConfig = {
Expand Down
Loading