Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## unreleased

### test

* Fixed jest config to support npm workspaces where ilib may be hoisted to a parent node_modules directory.

## 7.4.0 (November 9, 2026)

* Updated dependencies, including major updates to `chalk` (v6), `dotenv` (v18), `dotenv-expand` (v1000), `validate-npm-package-name` (v8), `@testing-library/jest-dom` (v7), `less-loader` (v13), `sass-loader` (v17), and `postcss-preset-env` (v11).
Expand Down
10 changes: 9 additions & 1 deletion config/jest/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ const rbConst = name =>
const iLibDirs = ['node_modules/@enact/i18n/ilib', 'node_modules/ilib', 'ilib'];
const globals = {
__DEV__: true,
ILIB_BASE_PATH: iLibDirs.find(f => fs.existsSync(path.join(app.context, f))) || iLibDirs[1],
// Support npm workspaces where ilib may be hoisted to a parent node_modules
ILIB_BASE_PATH: iLibDirs.find(f => fs.existsSync(path.join(app.context, f))) ||
(() => {
try {
return path.relative(app.context, path.dirname(require.resolve('ilib/package.json', {paths: [app.context]})));
} catch {
return iLibDirs[1];
}
})(),
Comment on lines +28 to +34

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On Windows, path.relative returns backslashes (for example ....\node_modules\ilib).
ILIB_BASE_PATH is used as a URL base by @enact/i18n's Loader.js.
The theme resource paths a few lines below already normalize with .replace(/\/g, '/'), so let's do the same here.


	(() => {
			try {
				const ilibDir = path.dirname(require.resolve('ilib/package.json', {paths: [app.context]}));
				return path.relative(app.context, ilibDir).replace(/\\/g, '/');
			} catch {
				return iLibDirs[1];
			}
		})(),

ILIB_RESOURCES_PATH: 'resources',
ILIB_CACHE_ID: new Date().getTime() + '',
[rbConst(app.name)]: 'resources'
Expand Down
Loading