fix(deps): drop deprecated transitive packages and refresh tooling#183
fix(deps): drop deprecated transitive packages and refresh tooling#183adrianschmidt wants to merge 4 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR modernizes the build tooling by migrating ESLint to native flat-config format, bumps development dependencies, refactors generator symlink creation to use Node's built-in APIs, improves type safety in the search module, and reformats SCSS files for visual consistency without functional changes. ChangesESLint migration and code improvements
SCSS formatting consolidation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/kompendium/search.ts (1)
20-33:⚠️ Potential issue | 🟠 MajorFix Fuse.js key typing:
FuseOptionKeyis not generic in v6.6.2Fuse.js’ shipped TypeScript types define the search “key” typing via
FuseOptionKey/FuseOptionKeyObject(plus string /[string]forms), but not asFuseOptionKey<T>—soArray<Fuse.FuseOptionKey<KompendiumDocument>>is likely to fail TypeScript compilation. Use the non-genericFuse.FuseOptionKey(orFuse.FuseOptionKeyObject) typing instead, and apply KompendiumDocument-specific safety via a local helper type if needed.🤖 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 `@src/kompendium/search.ts` around lines 20 - 33, The keys array in src/kompendium/search.ts uses a non-existent generic Fuse.FuseOptionKey<KompendiumDocument>; change the typing to use the library's non-generic Fuse.FuseOptionKey (or Fuse.FuseOptionKeyObject) and, if you want KompendiumDocument-specific safety, create a local helper type that narrows allowed string literals to properties of KompendiumDocument and use that for the keys variable; update the declaration of keys (and any other uses) from Array<Fuse.FuseOptionKey<KompendiumDocument>> to Array<Fuse.FuseOptionKey> (or Array<Fuse.FuseOptionKeyObject>) and/or the local helper type so TypeScript compiles against Fuse v6.6.2.package.json (1)
53-53:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTypo in
lint:src:fixglob skips.jsfiles.The extension list is
{ts,tsx,j,mjs}—jshould bejs. As written,eslint --fixwon't process.jsfiles (e.g. thiseslint.config.mjsmigration touches JS tooling), diverging from the other lint scripts on Lines 52/54. Pre-existing, but trivial to correct.🐛 Proposed fix
- "lint:src:fix": "eslint \"**/*.{ts,tsx,j,mjs}\" --fix --max-warnings=0 && prettier --write \"{!(package*).json,.prettierrc}\"", + "lint:src:fix": "eslint \"**/*.{ts,tsx,js,mjs}\" --fix --max-warnings=0 && prettier --write \"{!(package*).json,.prettierrc}\"",🤖 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 `@package.json` at line 53, The npm script "lint:src:fix" in package.json has a typo in its glob (uses "{ts,tsx,j,mjs}" so ".js" files are skipped); update the glob in the "lint:src:fix" script to include "js" (e.g., "{ts,tsx,js,mjs}") so ESLint --fix runs on .js files as intended, matching the other lint scripts.
🧹 Nitpick comments (1)
eslint.config.mjs (1)
27-27: ⚡ Quick winMove
prettierRecommendedafter the custom rules block.
eslint-plugin-prettier/recommendedpulls ineslint-config-prettier, which disables formatting-related core rules. Because it sits before the block at Lines 51–173, the subsequentquotes,semi,comma-dangle, andmultiline-ternaryentries re-enable formatting rules that can conflict/double-report with Prettier. Convention is to place the Prettier config last. The order matters: prettierConfig goes after all other configs because it disables rules set by previous entries.🤖 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 `@eslint.config.mjs` at line 27, The eslint config currently lists prettierRecommended before your custom rule overrides, which causes prettier's disablements to be overridden; move the prettierRecommended entry to the end of the extends array so it is applied last. Specifically, ensure the symbol prettierRecommended is relocated after the custom rule block that contains the rules quotes, semi, comma-dangle, and multiline-ternary so eslint-config-prettier can properly disable formatting-related core rules and avoid double-reporting.
🤖 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 `@src/kompendium/generator.ts`:
- Line 98: The symlink call await symlink(source, target) should be wrapped in a
try/catch so failures are surfaced (instead of silently ignored); update the
code around the symlink invocation (referencing the symlink call and the
source/target variables that create kompendium.json at config.publicPath) to
catch errors and log or rethrow them, and optionally pass the 'file' type on
Windows (symlink(source, target, 'file')) if you want explicit file link
behavior.
---
Outside diff comments:
In `@package.json`:
- Line 53: The npm script "lint:src:fix" in package.json has a typo in its glob
(uses "{ts,tsx,j,mjs}" so ".js" files are skipped); update the glob in the
"lint:src:fix" script to include "js" (e.g., "{ts,tsx,js,mjs}") so ESLint --fix
runs on .js files as intended, matching the other lint scripts.
In `@src/kompendium/search.ts`:
- Around line 20-33: The keys array in src/kompendium/search.ts uses a
non-existent generic Fuse.FuseOptionKey<KompendiumDocument>; change the typing
to use the library's non-generic Fuse.FuseOptionKey (or
Fuse.FuseOptionKeyObject) and, if you want KompendiumDocument-specific safety,
create a local helper type that narrows allowed string literals to properties of
KompendiumDocument and use that for the keys variable; update the declaration of
keys (and any other uses) from Array<Fuse.FuseOptionKey<KompendiumDocument>> to
Array<Fuse.FuseOptionKey> (or Array<Fuse.FuseOptionKeyObject>) and/or the local
helper type so TypeScript compiles against Fuse v6.6.2.
---
Nitpick comments:
In `@eslint.config.mjs`:
- Line 27: The eslint config currently lists prettierRecommended before your
custom rule overrides, which causes prettier's disablements to be overridden;
move the prettierRecommended entry to the end of the extends array so it is
applied last. Specifically, ensure the symbol prettierRecommended is relocated
after the custom rule block that contains the rules quotes, semi, comma-dangle,
and multiline-ternary so eslint-config-prettier can properly disable
formatting-related core rules and avoid double-reporting.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3799a544-f249-4eea-94e6-a2a5051e7c9e
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (9)
eslint.config.mjspackage.jsonscripts/utils/vermoji.jssrc/components/navigation/navigation.scsssrc/kompendium/generator.tssrc/kompendium/search.tssrc/style/colors.scsssrc/style/dev-server-modal.scsssrc/style/shadows.scss
💤 Files with no reviewable changes (1)
- scripts/utils/vermoji.js
befe617 to
3cdad73
Compare
Shrink the dependency footprint that surfaced deprecation warnings in consumers (most notably lime-elements): - Drop the unused direct `glob` dependency. - Replace `lnk` with a native `fs.symlink` call in the docs generator. `lnk` was the last thing pulling in `rimraf@2` -> `glob@7`, and it was only used on a guarded, watch-mode-only code path. - Bump `chokidar` to ^3.6.0, replacing the bundled `fsevents@2.1.3` with `fsevents@2.3.3`. - Bump `puppeteer` to ^24. The production dependency tree now contains neither `glob` nor `lnk`, and resolves a maintained `fsevents`. Also refresh dev tooling and types (Stencil, typescript-eslint, prettier, eslint plugins, @types/*, fuse.js, yaml). `fuse.js` 6.6 made `FuseOptionKey` generic, so the search index key type is updated to match. The .scss changes are prettier 3.8 reformatting only. ESLint stays on 8.x: moving to 9 requires a flat-config migration, since eslint-plugin-sonarjs now ships its recommended config in flat-config format that the current FlatCompat setup cannot consume.
Convert eslint.config.mjs from the FlatCompat shim to native flat config, which unblocks ESLint 9. Plugin recommended configs are now consumed directly instead of through FlatCompat: - @typescript-eslint via configs['flat/eslint-recommended'] - eslint-plugin-sonarjs (1.x) via its flat `recommended` - eslint-plugin-jsdoc via configs['flat/recommended'] - eslint-plugin-prettier via eslint-plugin-prettier/recommended eslint-plugin-sonarjs is bumped 0.25 -> 1.x: 0.25 only supports ESLint <=8, and its newer recommended config ships in flat-config format that FlatCompat cannot consume. All custom rules and file-specific overrides are preserved. Also remove the now-unused @eslint/eslintrc dependency and drop a stale no-constant-condition disable directive (ESLint 9 no longer flags `while (true)` by default). This eliminates the @humanwhocodes/* and eslint@8 deprecation warnings; npm ci is now free of deprecation warnings.
In watch mode the generator symlinks the public `kompendium.json` (under `publicPath`, e.g. `www/`) to the real file in the config folder (under `path`, e.g. `.kompendium/`). The link was created with a relative source, which the OS resolves relative to the link's own directory (`publicPath`) rather than the cwd -- producing a broken link (`www/.kompendium/kompendium.json`) and a 404 for the docs data on every dev-server reload. Resolve the source to an absolute path so the link is valid regardless of its location. Keeps the native `fs.symlink` (no reintroduction of the removed `lnk`/`glob` dependency). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7173329 to
9fb8bac
Compare
What
Dependency refresh focused on removing deprecated packages from the
production dependency tree, plus an ESLint 9 flat-config migration
and safe tooling/type bumps.
Deprecation fixes (the motivation)
globdependency.lnkwith nativefs.symlinkin the docs generator.lnkwas the only remaining path torimraf@2 → glob@7; it was usedsolely on a guarded, watch-mode-only code path.
chokidar^3.3.1 → ^3.6.0— replaces bundledfsevents@2.1.3with
fsevents@2.3.3.puppeteer^22 → ^24.8 → 9via a flat-config migration (see below) — removesthe
@humanwhocodes/*andeslint@8deprecation warnings.After this, the production tree contains no
globand nolnkandresolves a maintained
fsevents, andnpm cireports no deprecationwarnings at all. The cleaned-up production tree is what clears the
fsevents/globwarnings seen by consumers such aslime-elements(which only installs kompendium's runtime deps).
ESLint 9 flat-config migration
eslint.config.mjsis converted from theFlatCompatshim to nativeflat config. Plugin recommended configs are consumed directly:
@typescript-eslint(flat/eslint-recommended),eslint-plugin-sonarjs(flat
recommended),eslint-plugin-jsdoc(flat/recommended),eslint-plugin-prettier(eslint-plugin-prettier/recommended).eslint-plugin-sonarjsis bumped0.25 → 1.x(0.25 only supportsESLint ≤8). The unused
@eslint/eslintrcdependency is removed. Allcustom rules and file-specific overrides are preserved.
Tooling / types
Stencil, typescript-eslint, prettier (3.8), eslint plugins,
@types/*,fuse.js(6.6 —FuseOptionKeyis now generic; search key type updatedto match),
yaml. The.scssdiffs are prettier 3.8 reformatting only.Verification
npm run lint(0 warnings),npm run build,npm test(96 passed / 5 skipped) all green.
npm ciis free of deprecationwarnings.
Summary by CodeRabbit