-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: decompose large script files (>1000 lines) into focused modules #695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 17 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
65e326f
Initial plan
Copilot 1470cbd
refactor: decompose content-generators.ts and constants.ts into focus…
Copilot fcb8245
refactor: decompose scripts/news-types/weekly-review.ts (1121 lines) …
Copilot 59c2973
refactor: decompose scripts/committees-dashboard.ts and scripts/coali…
Copilot 54a2f3c
Merge branch 'main' into copilot/decompose-large-script-files
pethers dd5d7ef
Merge branch 'main' into copilot/decompose-large-script-files
pethers 33f261d
Merge branch 'main' into copilot/decompose-large-script-files
pethers cee5244
fix: address code review comments on dashboard types and week-ahead H…
Copilot 16024b3
Merge branch 'main' into copilot/decompose-large-script-files
pethers de76577
Merge branch 'main' into copilot/decompose-large-script-files
pethers 064ea9c
fix: correct path traversal, committee codes, HTML escaping and dashb…
Copilot 2bb72f9
Merge branch 'main' into copilot/decompose-large-script-files
pethers 498b232
fix: add missing declarations in reference modules, align committee c…
Copilot 086fed8
Merge branch 'main' into copilot/decompose-large-script-files
pethers 761f83d
Merge branch 'main' into copilot/decompose-large-script-files
pethers 16f0f59
fix: resolve CI failures - syntax errors, ESLint violations, and exte…
Copilot cfb7ba4
Merge branch 'main' into copilot/decompose-large-script-files
pethers eb70e75
fix: escape dayName before HTML interpolation to prevent XSS
Copilot f545e4d
Merge branch 'main' into copilot/decompose-large-script-files
pethers f5605c8
Merge branch 'main' into copilot/decompose-large-script-files
pethers 8602911
fix: switch coalition-dashboard scatter x-scale from 'time' to 'linea…
Copilot 9e4ce6d
Merge branch 'main' into copilot/decompose-large-script-files
pethers d8ae736
fix: replace hand-rolled CSV parser with PapaParse; move globalThis b…
Copilot 9a72d66
Merge branch 'main' into copilot/decompose-large-script-files
pethers 8a01bbb
fix: remove trailing orphaned JSDoc block from data-loader.ts
Copilot b5e2e69
Merge branch 'main' into copilot/decompose-large-script-files
pethers 4897263
fix: committees-dashboard reads globals inside initializeDashboard();…
Copilot 1a91e63
fix: remove overly-permissive Selection/Simulation stubs from d3 name…
Copilot 1182ce8
fix: reuse REQUIRED_TOOLS in generator.ts to avoid duplication with t…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header comment says this script relies on browser globals (d3/Chart.js), but the file no longer declares them (e.g.
declare const d3: any;) and also removed theimport * as d3 from 'd3'. Since the code still references thed3.*namespace (including in type positions), this leaves the file type-erroring/invalid for any tooling that typechecks it. Add explicitdeclare const d3: any;/declare const Chart: any;(or restore a type-only import) to keep the script self-contained.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit
4897263(refined in1a91e63). Addeddeclare const Chart: anyand adeclare namespace d3stub containing only the three types actually used in the file's top-level interface declarations:SimulationNodeDatum,SimulationLinkDatum, andDSVRowString. TheSelection/Simulationstub entries used by the IIFE body were removed to avoid overly-permissiveanyindex signatures.