Skip to content

Refactor code for readability, consistency, and modularity - #106

Merged
atldays merged 43 commits into
mainfrom
develop
Sep 13, 2026
Merged

atldays merged 43 commits into
mainfrom
develop

Conversation

@atldays

@atldays atldays commented Sep 13, 2026

Copy link
Copy Markdown
Member

No description provided.

addon-owner and others added 30 commits August 18, 2025 17:21
- Add `holds` method to `entrypoint.ts` interface for file existence checks.
- Update `.toSorted` usage in `AbstractFinder` for array sorting.
- Apply consistent formatting with `prettier-ignore` in various files.
- Minor refactor of `AbstractEntrypointFinder` regex patterns for clarity.
…ions

- Refactored permission handling logic for `RelayPermission` to improve clarity and maintainability.
- Updated type definitions for `declarative` field to support `ContentScriptDeclarative` enum.
- Improved code formatting and consistent conditional handling across relay components.
- Added return types to private methods for better type inference.
# Conflicts:
#	CONTRIBUTING.md
#	src/cli/entrypoint/finder/AbstractFinder.ts
Add per-entry asset metadata and a background-only full asset map.
Respect output filename templates and isolate content chunk graphs by world.
Normalize MV2 content scripts to ISOLATED with a build warning.

Add Chrome and Firefox integration coverage and reorganize fixtures.
Document project naming conventions, including class test filenames.
Separate manifest utilities by responsibility and normalize merged WAR and
host permission rules. Add compilation-scoped preparation and validation
hooks with a generic resource access validator, and rebuild manifest state
for each watch compilation.
Embed serialized metadata with RuntimeDataPlugin and keep property contracts
and augmentable Page/Relay registries in the shared type layer. Preserve
public exports and generated declarations, refresh Relay data in watch,
and substitute runtime template values once without reinterpreting data.
Normalize watched entry paths, retain runtime-only JavaScript chunks in
asset validation, and share chunk filename resolution below plugin owners.
Resolve the virtual entrypoint source alias to its emitted ESM path during
bundling instead of encoding output extensions in TypeScript imports.
Support isolation modes and frame page/src navigation for content scripts
and Relay. Route opt-in isolation CSS separately from document styles,
retain lazy loading, and expose resources without background dependencies.

Render into ShadowRoot or iframe targets, recover blank iframe documents
after host moves, and release stale CSS waits before teardown. Register
fonts through CSS and remove the branch's experimental shadow/fonts API.

Separate shared validation, feature policy, bundler integration and runtime
nodes. Cover parser contracts, access rules, watch transitions, asset names,
CSS errors/retries and browser behavior with unit and integration fixtures.
Remove guards for discarded owner runtime implementations and replace
Plan A fixture filenames and suite labels with neutral entrypoint names.
Keep assertions for current placeholders and background independence.
Document isolation modes, CSS routing, font delivery, iframe recovery and
browser validation fixtures. Record responsibility boundaries, shared
contract ownership and source import conventions in AGENTS.md.

Leave CHANGELOG.md generation to the publication workflow.
Normalize shorthand and object isolation options for content scripts and Relay.
Keep Shadow mode, iframe navigation, and dimensions under the isolation contract.

Move static value resolution and default-export analysis into file readers.
Validate normalized options with explicit Zod schemas while preserving enum
injection and runtime boundaries.

Update lifecycle, browser, watch, and parser tests alongside isolation documentation
and repository conventions.
Generate native locale JSON and virtual/locale from cached, validated
messages. Add a reusable module generation plugin with watch updates and
share the catalogue when used twice or when it reaches 100 KB, while
keeping background self-contained.

Cover catalogue equivalence, module isolation, watch updates, chunk
boundaries and browser delivery with integration fixtures.

Known limitation: Chrome deduplicates a shared content script path across
MAIN and ISOLATED worlds. The mixed-world browser test still fails; this
commit records the agreed first stage without changing script delivery.
Share dynamic state through ObservableLocale and expose native and dynamic
React adapters with typed JSX substitutions and explicit DOM attributes.

BREAKING CHANGE: Remove React LocaleProvider, LocaleProviderProps and
LocaleContract. Use useLocale or useNativeLocale, and apply DOM attributes
explicitly with useLocaleAttributes.

Rename provider languages()/languageNames() to langs()/langNames().
React langs now contains language codes; display names are in langNames.
useLocale().change() now returns Promise<Language>.

React adapters require React 18 or 19. React peers are now optional.
Remove implicit locale resolution from view and command entrypoint
wrappers and from changePopup/changeSidebar. Keep resolve available
through the public locale entrypoint for explicit use.

BREAKING CHANGE: Runtime view titles, command descriptions, and titles
applied by changePopup/changeSidebar are now passed through unchanged.
Call resolve explicitly when translating locale markers is required.
Build-time localization of manifest fields is unchanged.
Deliver popup, sidebar, offscreen, sandbox and icon data through
generated virtual modules with package fallbacks.

Move augmentable registries and related contracts into src/types.
Preserve public augmentation and generate popup/sidebar/icon registries.
Order shared declarations and document empty contracts.

Add build coverage for data delivery and tree shaking, plus source
and package contract checks in tests/integration/types.
@atldays
atldays merged commit 15aa21a into main Sep 13, 2026
10 checks passed
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.

2 participants