Repository navigation
Security/modernizing component environment - #568
Draft
Ashley Osuna (ashley-osuna) wants to merge 3 commits into
Draft
Ashley Osuna (ashley-osuna) wants to merge 3 commits into
Ashley Osuna (ashley-osuna) wants to merge 3 commits into
Conversation
…grating from jest to node's native testing environment
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Type-only imports are treated as runtime values in UserIdentityContext.ts and listeners.ts, causing module linking to fail under Node’s native TypeScript loader.
1 open issue
What changed in this PR
Modernizes component-environment tooling and tests while tightening widget JWT subject matching.
Changes:
- Replaces Jest with Node’s test runner and a jsdom setup.
- Updates dependencies, supported Node versions, and TypeScript import handling.
- Anchors JWT subject patterns and restricts identifier characters.
| File | Description |
|---|---|
packages/component-environment/tsconfig.json |
Enables relative import extension rewriting. |
packages/component-environment/src/listeners.ts |
Adds explicit .ts import extensions. |
packages/component-environment/src/index.ts |
Adds .ts extensions to public re-exports. |
packages/component-environment/src/history.ts |
Updates local import extensions. |
packages/component-environment/src/fetchLocale.ts |
Updates local import extensions. |
packages/component-environment/src/environment.ts |
Marks type imports and adds an explicit extension. |
packages/component-environment/src/contexts/UserIdentityContext.ts |
Tightens JWT subject matching and updates imports. |
packages/component-environment/src/contexts/ProgramContext.ts |
Updates local import extensions. |
packages/component-environment/src/contexts/LocaleContext.ts |
Updates local import extensions. |
packages/component-environment/package.json |
Updates tooling, dependencies, Node support, and test command. |
packages/component-environment/jest.config.ts |
Removes obsolete Jest configuration. |
packages/component-environment/__tests__/validateLocale.spec.ts |
Migrates locale tests to Node assertions and runner. |
packages/component-environment/__tests__/setup/dom.ts |
Provides browser globals through jsdom. |
packages/component-environment/__tests__/history.spec.ts |
Migrates history tests and mocks to Node APIs. |
Review effort: Balanced
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Description of the change
Type of change
Links
Checklists
Development
Paperwork
Code review