Repository navigation
feat: ng icons manager v2 - #281
Conversation
add config support add multiple projects support
add config support add multiple projects support
|
Warning Review limit reached
More reviews will be available in 55 minutes and 55 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (36)
📝 WalkthroughWalkthroughThe PR converts ng-icons-manager to an ESM-only, config-driven job runner with new config validation, icon resolution/output logic, CLI/watch orchestration, and updated docs and tests. Changesng-icons-manager rewrite
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (3)
libs/ng-icons-manager/src/internal/cli/watch-coordinator.ts (1)
37-37: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant
selected()call.Line 37 calls
this.selected(this.config, selectedJobs)only for early validation and discards the result;apply()(Line 51) validates again. You can drop Line 37 and rely onapply()'s validation, or keep a comment clarifying it is an intentional pre-watch validation gate.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@libs/ng-icons-manager/src/internal/cli/watch-coordinator.ts` at line 37, The WatchCoordinator flow has a redundant selected() validation call that discards its result before apply() validates again. Remove the early this.selected(this.config, selectedJobs) call in watch-coordinator’s setup path, or if you keep it, add a clear comment that it is an intentional pre-watch validation gate; use the selected() and apply() methods in WatchCoordinator to locate the fix.libs/ng-icons-manager/src/internal/cli/cli-application.ts (1)
26-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant
jobs()resolution on the non-watch path.Line 26 resolves+validates the job list and discards it, then
once()(Line 39) resolves it again. Consider computing once and passing the resolved jobs down to avoid the double lookup and keep validation in a single place.♻️ Possible simplification
- const config = await this.configs.load(configPath); - this.jobs(config, options.jobs); - - if (options.verbose) this.logger.info(`Loaded config from ${config.configPath}`); - if (options.watch) return this.watch.run(config, options.jobs, options.verbose, signal); - return this.once(config, options); + const config = await this.configs.load(configPath); + const jobs = this.jobs(config, options.jobs); + + if (options.verbose) this.logger.info(`Loaded config from ${config.configPath}`); + if (options.watch) return this.watch.run(config, options.jobs, options.verbose, signal); + return this.once(jobs, options);(adjust
once()signature accordingly)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@libs/ng-icons-manager/src/internal/cli/cli-application.ts` around lines 26 - 30, The CLI flow in `CLIApplication` resolves `jobs()` twice on the non-watch path, once before branching and again inside `once()`. Compute the resolved jobs a single time in `run()` and pass them through to `once()` (and keep `watch.run()` consistent if needed), then update `once()`’s signature to accept the already-resolved jobs so validation happens in one place only.libs/ng-icons-manager/src/internal/infrastructure/native-config-importer.ts (1)
6-9: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueCache-busting query string leaks modules across watch reloads.
Appending a unique
?t=${Date.now()}makes the ESM loader treat each reload as a new module and retain it in the registry for the process lifetime. In a long-lived--watchsession that reloads config on every change, memory grows unbounded. There's no built-in eviction for the ESM cache, so this is inherent to the approach—worth confirming the watch reload frequency is low enough that this is acceptable, or documenting the tradeoff.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@libs/ng-icons-manager/src/internal/infrastructure/native-config-importer.ts` around lines 6 - 9, The dynamic import in native-config-importer.importFile uses a cache-busting query string that causes each watch reload to register a new ESM module and leak memory over time. Update importFile to avoid unbounded module growth in long-lived watch sessions by removing or gating the timestamp-based busting logic, and either reuse stable module URLs or document/confirm the watch reload tradeoff where importFile is called.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@libs/ng-icons-manager/src/internal/cli/cli-options.ts`:
- Around line 27-29: The CLI option parsing in cli-options.ts must keep the
explicit duplicate --config validation because util.parseArgs with strict mode
will otherwise silently accept repeated non-multiple options and use the last
value. Preserve or restore the tokens.filter check in the option-parsing logic
that counts 'config' occurrences, and ensure it throws the existing error when
more than one --config is provided so duplicate config input is rejected instead
of overwritten.
In `@libs/ng-icons-manager/src/internal/cli/watch-coordinator.ts`:
- Around line 34-67: The abort path in watch coordination can leave a
SerialJobWatcher registered after cleanup has already started. In
WatchCoordinator.apply, after awaiting watcher.start(), guard against
this.finished before calling this.jobWatchers.set so a watcher is not added once
finish(0) has already run. Use the existing finish/closeJobs flow and the
this.finished flag in watch-coordinator.ts to skip registration when shutdown is
in progress.
In `@libs/ng-icons-manager/src/internal/core/icon-parser.ts`:
- Around line 13-24: commentHints currently only extracts hints from HTML and
block comments, so it misses `//` line comments used by the spec template.
Update the comment parsing in `commentHints` within `icon-parser.ts` to also
scan single-line comment content for `i(...)` patterns, alongside the existing
`commentHints` regex handling for `<!-- -->` and `/* */`, so names like
`matAlarm` are collected.
In `@libs/ng-icons-manager/src/internal/infrastructure/chokidar-watcher.ts`:
- Around line 18-34: The readyPromise in ChokidarWatcher only resolves on the
watcher’s ready event, so ready() can hang forever if FSWatcher emits error
first; update the ChokidarWatcher constructor and ready() flow so the promise
settles on the first error as well, and make sure the same error path is wired
through onError and any internal handlers to either reject or otherwise unblock
callers waiting on ready().
---
Nitpick comments:
In `@libs/ng-icons-manager/src/internal/cli/cli-application.ts`:
- Around line 26-30: The CLI flow in `CLIApplication` resolves `jobs()` twice on
the non-watch path, once before branching and again inside `once()`. Compute the
resolved jobs a single time in `run()` and pass them through to `once()` (and
keep `watch.run()` consistent if needed), then update `once()`’s signature to
accept the already-resolved jobs so validation happens in one place only.
In `@libs/ng-icons-manager/src/internal/cli/watch-coordinator.ts`:
- Line 37: The WatchCoordinator flow has a redundant selected() validation call
that discards its result before apply() validates again. Remove the early
this.selected(this.config, selectedJobs) call in watch-coordinator’s setup path,
or if you keep it, add a clear comment that it is an intentional pre-watch
validation gate; use the selected() and apply() methods in WatchCoordinator to
locate the fix.
In `@libs/ng-icons-manager/src/internal/infrastructure/native-config-importer.ts`:
- Around line 6-9: The dynamic import in native-config-importer.importFile uses
a cache-busting query string that causes each watch reload to register a new ESM
module and leak memory over time. Update importFile to avoid unbounded module
growth in long-lived watch sessions by removing or gating the timestamp-based
busting logic, and either reuse stable module URLs or document/confirm the watch
reload tradeoff where importFile is called.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c087b362-efd0-439f-ad23-8d7726e05f99
📒 Files selected for processing (52)
libs/ng-icons-manager/README.mdlibs/ng-icons-manager/bin/cli.jslibs/ng-icons-manager/jest.config.tslibs/ng-icons-manager/package.jsonlibs/ng-icons-manager/project.jsonlibs/ng-icons-manager/src/adapters/console-logger.tslibs/ng-icons-manager/src/adapters/fs-adapter.tslibs/ng-icons-manager/src/adapters/index.tslibs/ng-icons-manager/src/adapters/module-resolver.tslibs/ng-icons-manager/src/config/defaults.tslibs/ng-icons-manager/src/config/icon-map.tslibs/ng-icons-manager/src/config/index.tslibs/ng-icons-manager/src/core/cache.service.tslibs/ng-icons-manager/src/core/icon-scanner.tslibs/ng-icons-manager/src/core/index.tslibs/ng-icons-manager/src/core/scanner.facade.tslibs/ng-icons-manager/src/index.tslibs/ng-icons-manager/src/internal/cli/cli-application.tslibs/ng-icons-manager/src/internal/cli/cli-options.tslibs/ng-icons-manager/src/internal/cli/cli-reporter.tslibs/ng-icons-manager/src/internal/cli/serial-job-watcher.tslibs/ng-icons-manager/src/internal/cli/watch-coordinator.tslibs/ng-icons-manager/src/internal/config/config-loader.tslibs/ng-icons-manager/src/internal/config/config-validator.tslibs/ng-icons-manager/src/internal/config/models.tslibs/ng-icons-manager/src/internal/config/output-path-policy.tslibs/ng-icons-manager/src/internal/core/icon-manager.tslibs/ng-icons-manager/src/internal/core/icon-output.tslibs/ng-icons-manager/src/internal/core/icon-parser.tslibs/ng-icons-manager/src/internal/core/icon-registry.tslibs/ng-icons-manager/src/internal/core/icon-resolver.tslibs/ng-icons-manager/src/internal/core/icon-scanner.tslibs/ng-icons-manager/src/internal/core/issues.tslibs/ng-icons-manager/src/internal/core/ports.tslibs/ng-icons-manager/src/internal/infrastructure/chokidar-watcher.tslibs/ng-icons-manager/src/internal/infrastructure/console-logger.tslibs/ng-icons-manager/src/internal/infrastructure/create-cli-application.tslibs/ng-icons-manager/src/internal/infrastructure/native-config-importer.tslibs/ng-icons-manager/src/internal/infrastructure/node-file-system.tslibs/ng-icons-manager/src/internal/infrastructure/node-module-loader.tslibs/ng-icons-manager/src/test/cli.spec.tslibs/ng-icons-manager/src/test/config.spec.tslibs/ng-icons-manager/src/test/fakes.tslibs/ng-icons-manager/src/test/icon-resolver.spec.tslibs/ng-icons-manager/src/test/icon-scanner.spec.tslibs/ng-icons-manager/src/test/integration/cli.integration.spec.tslibs/ng-icons-manager/src/test/integration/test-utils.tslibs/ng-icons-manager/src/test/mock.spec.tslibs/ng-icons-manager/src/test/scanner-and-runner.spec.tslibs/ng-icons-manager/src/test/watch.spec.tslibs/ng-icons-manager/src/types.tslibs/ng-icons-manager/tsconfig.lib.json
💤 Files with no reviewable changes (14)
- libs/ng-icons-manager/src/adapters/console-logger.ts
- libs/ng-icons-manager/src/config/icon-map.ts
- libs/ng-icons-manager/src/adapters/module-resolver.ts
- libs/ng-icons-manager/src/adapters/fs-adapter.ts
- libs/ng-icons-manager/src/core/icon-scanner.ts
- libs/ng-icons-manager/src/types.ts
- libs/ng-icons-manager/src/core/cache.service.ts
- libs/ng-icons-manager/src/config/defaults.ts
- libs/ng-icons-manager/src/adapters/index.ts
- libs/ng-icons-manager/src/test/mock.spec.ts
- libs/ng-icons-manager/src/core/index.ts
- libs/ng-icons-manager/src/test/icon-scanner.spec.ts
- libs/ng-icons-manager/src/core/scanner.facade.ts
- libs/ng-icons-manager/src/config/index.ts
|
add config support
add multiple projects support
Summary by CodeRabbit
New Features
Bug Fixes
Documentation