Skip to content

Security/modernizing component environment - #568

Draft
Ashley Osuna (ashley-osuna) wants to merge 3 commits into
masterfrom
security/modernizing-component-environment
Draft

Ashley Osuna (ashley-osuna) wants to merge 3 commits into
masterfrom
security/modernizing-component-environment

Conversation

@ashley-osuna

Copy link
Copy Markdown
Contributor

Description of the change

Description here

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation or Development tools (readme, specs, tests, code formatting)

Links

  • Jira issue number: (PUT IT HERE)
  • Process.st launch checklist: (PUT IT HERE)

Checklists

Development

  • Prettier was run (if applicable)
  • The behaviour changes in the pull request are covered by specs
  • All tests related to the changed code pass in development

Paperwork

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has a Jira number
  • This pull request has a Process.st launch checklist

Code review

  • Changes have been reviewed by at least one other engineer
  • Security impacts of this change have been considered

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the tooling modernization, test migration, and JWT subject-parsing changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants