Skip to content

Conversation

@nikeokoronkwo
Copy link
Collaborator

@nikeokoronkwo nikeokoronkwo commented Jul 22, 2025

Fixes #425

This PR adds support to passing files as globs for both the IDL generator and the TS Declarations generator via Node's fs.globSync function.

@nikeokoronkwo
Copy link
Collaborator Author

The tests work on my machine successfully.
I'm assuming it is because of the node version used (because the error assumes globSync does not exist on fs).
Node version I tested with is v22 (LTS).

@kevmoo kevmoo requested a review from srujzs July 22, 2025 02:20
Copy link
Contributor

@srujzs srujzs left a comment

Choose a reason for hiding this comment

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

Feel free to update the node version we use if you think that may be the issue (I believe that shouldn't result in any issues for package:web)

@nikeokoronkwo
Copy link
Collaborator Author

Feel free to update the node version we use if you think that may be the issue

Does mono_repo support set up actions? That way I can update it globally

@nikeokoronkwo nikeokoronkwo requested a review from srujzs July 23, 2025 15:29
@srujzs
Copy link
Contributor

srujzs commented Jul 23, 2025

Hmm, this might be tougher than just updating package.json as it seems like the default GitHub actions still uses v20 for Node.

We could specify an action to setup-node with a newer version: https://github.com/actions/setup-node. It looks like mono_repo provides an on_completion option to add GitHub actions, but it's after all jobs are completed: https://pub.dev/packages/mono_repo#installation. That makes this a bit difficult because we want to setup the node version during each job (right after setting up actions). We could manually write each job in the on_completion but that defeats the point of mono_repo.yaml generating all the jobs we want.

@devoncarew Is there a better way to specify a newer Node version that I'm missing?

@devoncarew
Copy link
Contributor

@devoncarew Is there a better way to specify a newer Node version that I'm missing?

I've largely moved away from using mono_repo; it adds a layer between the user and the actual CI definition that adds additional complexity, makes simple things harder, and doesn't really have additional value over just raw github actions.

I think it would be worth just adding a new workflow definitions per package in this repo (2?) and removing the mono_repo config info. Then things like specifying node versions and such should be straightforward. I can point you to some same workflows if helpful.

@srujzs
Copy link
Contributor

srujzs commented Jul 23, 2025

I've largely moved away from using mono_repo; it adds a layer between the user and the actual CI definition that adds additional complexity, makes simple things harder, and doesn't really have additional value over just raw github actions.

I think it would be worth just adding a new workflow definitions per package in this repo (2?) and removing the mono_repo config info. Then things like specifying node versions and such should be straightforward. I can point you to some same workflows if helpful.

That makes sense. Do you have an example where you migrated away from mono_repo.yml? I'm tempted to keep dart.yml as the source of truth but it's quite messy and I wonder if there's cruft that can be removed.

For now, I believe @nikeokoronkwo will just glob things early so we don't need a new node version, but I'd like to move away from mono_repo.yml at some point as well.

@devoncarew
Copy link
Contributor

That makes sense. Do you have an example where you migrated away from mono_repo.yml? I'm tempted to keep dart.yml as the source of truth but it's quite messy and I wonder if there's cruft that can be removed.

If you want to try switching, I authored #428. I believe it covers the same things that the two mono_repo config files were doing.

@nikeokoronkwo
Copy link
Collaborator Author

@srujzs Since #428 has landed, maybe I could bump the node version and proceed?

nikeokoronkwo and others added 9 commits July 30, 2025 01:24
commit da1dd5d
Author: Devon Carew <devoncarew@google.com>
Date:   Thu Jul 24 10:24:40 2025 -0700

    switch CI to using workflow files (dart-lang#428)

    * switch CI to using workflow files

    * update the sdk matrix

    * review feedback

    * remove format sdk version check

commit 8ffaf5e
Author: Nikechukwu <150845642+nikeokoronkwo@users.noreply.github.com>
Date:   Wed Jul 23 12:17:55 2025 -0400

    [interop] Implement Diagnostics and Handling Errors (dart-lang#426)

    * implemented diagnostics

    * added extra invalid semantic
@srujzs
Copy link
Contributor

srujzs commented Jul 30, 2025

Since #428 has landed, maybe I could bump the node version and proceed?

Yep, go for it! It looks like there's some failures around file names before we can land though.

@nikeokoronkwo
Copy link
Collaborator Author

Yeah, I can't quite get to why the builds are failing: the tests work on my system and they've been working up until now.

@nikeokoronkwo nikeokoronkwo requested a review from srujzs August 6, 2025 05:16
@nikeokoronkwo nikeokoronkwo merged commit f3c960f into dart-lang:main Aug 6, 2025
8 checks passed
@nikeokoronkwo nikeokoronkwo deleted the web_gen/glob branch August 6, 2025 16:40
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Aug 7, 2025
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/414953e..82b48b5):
  82b48b53  2025-08-05  István Soós  Update highlight.js download instructions and resources. (dart-lang/dartdoc#4081)

ecosystem (https://github.com/dart-lang/ecosystem/compare/2fe3618..4543c38):
  4543c38  2025-08-06  Devon Carew  address a `Bad state: No element` element exception (dart-lang/ecosystem#321)
  e14472f  2025-08-06  Devon Carew  add a roadmap to our various mono-repos (dart-lang/ecosystem#318)
  e83479a  2025-08-06  Moritz  Fixes to health (dart-lang/ecosystem#363)
  552f534  2025-08-06  Moritz  Update API tool hash (dart-lang/ecosystem#362)

i18n (https://github.com/dart-lang/i18n/compare/c45e050..25cdb1b):
  25cdb1b4  2025-08-07  Moritz  Reenable mac size checks (dart-lang/i18n#1001)

shelf (https://github.com/dart-lang/shelf/compare/082d3ac..2a46b4f):
  2a46b4f  2025-08-05  Kevin Moore  Update dependencies across 3 packages (dart-lang/shelf#479)

test (https://github.com/dart-lang/test/compare/5aef971..9354f23):
  9354f239  2025-08-07  Liam Appelbe  Add `--coverage-path` and `--branch-coverage` options (dart-lang/test#2517)

tools (https://github.com/dart-lang/tools/compare/5e977d6..1b52e89):
  1b52e89e  2025-08-06  Moritz  Configure Gemini code review (dart-lang/tools#2141)

web (https://github.com/dart-lang/web/compare/1d5771b..f3c960f):
  f3c960f  2025-08-06  Nikechukwu  [web_generator] Add support for passing files as globs (dart-lang/web#427)
  f51cc85  2025-08-06  Nikechukwu  [interop] Add Support for Namespaces (dart-lang/web#436)

webdev (https://github.com/dart-lang/webdev/compare/7ff2d07..94c172c):
  94c172cc  2025-08-05  Nicholas Shahan  Wait for any remaining output in e2e_test.dart (dart-lang/webdev#2663)

Change-Id: Ie18635903f7379bc27e7ae23b916e10e4bdcef94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444360
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Aug 7, 2025
… webdev"

This reverts commit 00240e8.

Reason for revert: failures on HHH

Original change's description:
> [deps] rev dartdoc, ecosystem, i18n, shelf, test, tools, web, webdev
>
> Revisions updated by `dart tools/rev_sdk_deps.dart`.
>
> dartdoc (https://github.com/dart-lang/dartdoc/compare/414953e..82b48b5):
>   82b48b53  2025-08-05  István Soós  Update highlight.js download instructions and resources. (dart-lang/dartdoc#4081)
>
> ecosystem (https://github.com/dart-lang/ecosystem/compare/2fe3618..4543c38):
>   4543c38  2025-08-06  Devon Carew  address a `Bad state: No element` element exception (dart-lang/ecosystem#321)
>   e14472f  2025-08-06  Devon Carew  add a roadmap to our various mono-repos (dart-lang/ecosystem#318)
>   e83479a  2025-08-06  Moritz  Fixes to health (dart-lang/ecosystem#363)
>   552f534  2025-08-06  Moritz  Update API tool hash (dart-lang/ecosystem#362)
>
> i18n (https://github.com/dart-lang/i18n/compare/c45e050..25cdb1b):
>   25cdb1b4  2025-08-07  Moritz  Reenable mac size checks (dart-lang/i18n#1001)
>
> shelf (https://github.com/dart-lang/shelf/compare/082d3ac..2a46b4f):
>   2a46b4f  2025-08-05  Kevin Moore  Update dependencies across 3 packages (dart-lang/shelf#479)
>
> test (https://github.com/dart-lang/test/compare/5aef971..9354f23):
>   9354f239  2025-08-07  Liam Appelbe  Add `--coverage-path` and `--branch-coverage` options (dart-lang/test#2517)
>
> tools (https://github.com/dart-lang/tools/compare/5e977d6..1b52e89):
>   1b52e89e  2025-08-06  Moritz  Configure Gemini code review (dart-lang/tools#2141)
>
> web (https://github.com/dart-lang/web/compare/1d5771b..f3c960f):
>   f3c960f  2025-08-06  Nikechukwu  [web_generator] Add support for passing files as globs (dart-lang/web#427)
>   f51cc85  2025-08-06  Nikechukwu  [interop] Add Support for Namespaces (dart-lang/web#436)
>
> webdev (https://github.com/dart-lang/webdev/compare/7ff2d07..94c172c):
>   94c172cc  2025-08-05  Nicholas Shahan  Wait for any remaining output in e2e_test.dart (dart-lang/webdev#2663)
>
> Change-Id: Ie18635903f7379bc27e7ae23b916e10e4bdcef94
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444360
> Auto-Submit: Devon Carew <devoncarew@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I239eff7add9e5432c67b05c8f7731e1a79d4e4db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444387
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Aug 8, 2025
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/414953e..82b48b5):
  82b48b53  2025-08-05  István Soós  Update highlight.js download instructions and resources. (dart-lang/dartdoc#4081)

ecosystem (https://github.com/dart-lang/ecosystem/compare/2fe3618..4543c38):
  4543c38  2025-08-06  Devon Carew  address a `Bad state: No element` element exception (dart-lang/ecosystem#321)
  e14472f  2025-08-06  Devon Carew  add a roadmap to our various mono-repos (dart-lang/ecosystem#318)
  e83479a  2025-08-06  Moritz  Fixes to health (dart-lang/ecosystem#363)
  552f534  2025-08-06  Moritz  Update API tool hash (dart-lang/ecosystem#362)

i18n (https://github.com/dart-lang/i18n/compare/c45e050..25cdb1b):
  25cdb1b4  2025-08-07  Moritz  Reenable mac size checks (dart-lang/i18n#1001)

shelf (https://github.com/dart-lang/shelf/compare/082d3ac..2a46b4f):
  2a46b4f  2025-08-05  Kevin Moore  Update dependencies across 3 packages (dart-lang/shelf#479)

tools (https://github.com/dart-lang/tools/compare/5e977d6..1b52e89):
  1b52e89e  2025-08-06  Moritz  Configure Gemini code review (dart-lang/tools#2141)

web (https://github.com/dart-lang/web/compare/1d5771b..f3c960f):
  f3c960f  2025-08-06  Nikechukwu  [web_generator] Add support for passing files as globs (dart-lang/web#427)
  f51cc85  2025-08-06  Nikechukwu  [interop] Add Support for Namespaces (dart-lang/web#436)

webdev (https://github.com/dart-lang/webdev/compare/7ff2d07..94c172c):
  94c172cc  2025-08-05  Nicholas Shahan  Wait for any remaining output in e2e_test.dart (dart-lang/webdev#2663)

Change-Id: Id553d989bdb5aea483e6ad7d955a965cfaa3cf16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444362
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
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.

[web_generator] Add Support for Globs and Dir inputs (for IDL and TS Declarations Generator)

3 participants