Skip to content

Conversation

Artur-
Copy link
Member

@Artur- Artur- commented Oct 3, 2025

Replace the external glob package dependency with Node.js built-in globSync functionality (available since Node.js 22).

Changes:

  • Remove glob dependency from 3 package.json files
  • Update imports from 'glob' to 'node:fs' in theme plugins
  • All glob usage patterns are compatible with built-in implementation

@Artur- Artur- requested a review from mshabarov October 3, 2025 14:04
@Artur- Artur- marked this pull request as draft October 3, 2025 14:05
@Artur- Artur- marked this pull request as ready for review October 3, 2025 14:10
Copy link

github-actions bot commented Oct 3, 2025

Test Results

1 270 files  ±0  1 270 suites  ±0   1h 15m 18s ⏱️ - 1m 54s
8 793 tests ±0  8 726 ✅ ±0  67 💤 ±0  0 ❌ ±0 
9 242 runs  ±0  9 165 ✅ ±0  77 💤 ±0  0 ❌ ±0 

Results for commit c4a4f92. ± Comparison against base commit 4b1abc8.

♻️ This comment has been updated with latest results.

@mshabarov
Copy link
Contributor

Looks good to me, nice idea!

However, the implementation seems to be incomplete because theme plugin apparently doesn't copy assets files.

Error:  com.vaadin.flow.devbuild.DevBundleThemeIT.serveStylesInExpressBuildMode_assetsAreCopiedToBundle[any_Chrome_] -- Time elapsed: 0.862 s <<< FAILURE!
java.lang.AssertionError: External asset file is not found in the bundle

Error:  com.vaadin.flow.uitest.ui.theme.ParentThemeIT.childTheme_overridesParentTheme[any_Chrome_] -- Time elapsed: 2.838 s <<< FAILURE!
java.lang.AssertionError: Error message in browser log: [2025-10-07T06:07:08.609Z] [SEVERE] http://localhost:8888/themes/reusable-theme/fortawesome/icons/snowflake.svg - Failed to load resource: the server responded with a status of 404 (Not Found)

Artur- and others added 3 commits October 10, 2025 18:21
Replace the external glob package dependency with Node.js built-in
globSync functionality (available since Node.js 22).

Changes:
- Remove glob dependency from 3 package.json files
- Update imports from 'glob' to 'node:fs' in theme plugins
- All glob usage patterns are compatible with built-in implementation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Remove glob from devDependencies in the default frontend dependencies
package.json.
Node.js built-in fs.globSync doesn't support the 'nodir' option from
the glob package. Replace it with the 'exclude' option using statSync
to filter out directories.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Artur- and others added 2 commits October 10, 2025 18:37
…ctories

The exclude callback in fs.globSync receives relative path segments
during pattern matching, not full paths. Calling statSync() on these
segments fails with ENOENT errors because they don't exist relative
to the current working directory.

Using withFileTypes: true returns Dirent objects that already contain
type information via isDirectory(), avoiding the need for additional
statSync() calls. This is both correct and efficient.

Fixes asset copying from theme.json (FontAwesome icons, Line Awesome, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Complete the migration from glob package to Node.js built-in fs.globSync
by replacing the unsupported nodir option with withFileTypes + filtering.

While the *.css pattern wouldn't match directories anyway, this ensures
consistency across all globSync usage and fully completes the migration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@vaadin vaadin deleted a comment from github-actions bot Oct 10, 2025
@vaadin vaadin deleted a comment from github-actions bot Oct 10, 2025
@vaadin-bot vaadin-bot added +0.0.1 and removed +0.1.0 labels Oct 10, 2025
Filter out any Dirent entries that don't have parentPath defined.

If parentPath is undefined, we can't construct a valid file path anyway,
so it makes more sense to filter those entries out early.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@vaadin vaadin deleted a comment from github-actions bot Oct 11, 2025
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants