Skip to content

Migrate to TypeScript (core)#4155

Open
SteRiccio wants to merge 8 commits intomasterfrom
refactor/typescript
Open

Migrate to TypeScript (core)#4155
SteRiccio wants to merge 8 commits intomasterfrom
refactor/typescript

Conversation

@SteRiccio
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces TypeScript support across the core package and updates the build/lint/test tooling so the repository can compile and typecheck .ts/.tsx alongside existing JavaScript.

Changes:

  • Add TypeScript toolchain: tsconfig.json, TypeScript Babel preset, TypeScript-aware webpack resolution/rules, and a typecheck script.
  • Migrate a set of core/* utilities/modules from .js to .ts, adding typings and tightening some APIs.
  • Extend ESLint + lint-staged + test webpack config to include .ts/.tsx sources.

Reviewed changes

Copilot reviewed 67 out of 77 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
yarn.lock Adds TypeScript, Babel TS preset, TS ESLint tooling, and type packages to the lockfile.
webpack.config.server.babel.js Adds .ts/.tsx resolution and transpilation for server bundle.
webpack.config.babel.js Adds .ts/.tsx resolution and transpilation for client bundle.
tsconfig.json Introduces TS compiler settings (typecheck-only).
test/webpack.config.js Extends test bundling to include .ts/.tsx tests and resolve extensions.
package.json Adds typecheck script and TS-related dev dependencies; extends lint-staged globs.
global.d.ts Declares module types for styles/images and a global constant.
eslint.config.js Adds TypeScript parsing + rules, and extends existing configs to include .ts/.tsx.
core/uuid.ts Adds TS version of uuid helpers.
core/uuid.js Switches uuid helper to CommonJS export style.
core/user2FADevice/user2FADevice.ts Migrates User2FADevice helpers to TypeScript.
core/user2FADevice/user2FADevice.js Removes JS implementation (migrated to TS).
core/user2FADevice/index.ts Adds TS barrel export for user2FADevice.
core/uniqueNameGenerator.ts Adds TS annotations and refactors variable initialization.
core/systemError.ts Adds TS typing for SystemError and makes StatusCodes as const.
core/stringUtils.ts Migrates string utilities to TypeScript and adds typings.
core/stringUtils.js Removes JS implementation (migrated to TS).
core/queue.ts Migrates Queue to a typed generic implementation.
core/promiseUtils.ts Migrates promise utilities to TypeScript.
core/promiseUtils.js Removes JS implementation (migrated to TS).
core/processUtils.ts Adds TS version of process/env utilities alongside existing JS version.
core/objectUtils.ts Migrates object utilities to TypeScript.
core/objectUtils.js Removes JS implementation (migrated to TS).
core/numberUtils.ts Adds TS typing to numeric helpers.
core/numberConversionUtils.ts Migrates number conversion helpers to TypeScript.
core/numberConversionUtils.js Removes JS implementation (migrated to TS).
core/message/messageValidator.ts Adds TS typing to message validation entrypoint.
core/markdownValidator.ts Adds TS typing and explicit stack typing for marked token traversal.
core/markdownUtils.ts Migrates markdown parsing/sanitization helper to TypeScript.
core/markdownUtils.js Removes JS implementation (migrated to TS).
core/map/mapUtils.ts Migrates map tile URL utilities to TypeScript.
core/map/mapUtils.js Removes JS implementation (migrated to TS).
core/i18n/i18nFactory.ts Adds TypeScript annotations and interop casts for i18next factory.
core/functionsDefer.ts Migrates debounce/throttle utilities to TypeScript with typed timeout maps.
core/fileFormats.ts Adds as const and typed accessor for extensions by file format.
core/dateUtils.ts Migrates date utilities to TypeScript with typed i18n parameter for relative dates.
core/dateUtils.js Removes JS implementation (migrated to TS).
core/dataImport/index.ts Adds TS barrel export for data import types.
core/dataImport/dataImportTemplateTypes.ts Adds as const typing to template type constants.
core/counter.ts Migrates Counter to TypeScript.
core/counter.js Removes JS implementation (migrated to TS).
core/auth/jwtConstants.ts Adds TS constant for bearer prefix.
core/auth/authorizer.ts Migrates authorizer logic to TypeScript with arena-core types.
core/auth/authorizer.js Removes JS implementation (migrated to TS).
core/auth/authGroup.ts Improves typing around auth groups and permissions mapping.
core/arrayUtils.ts Migrates array utility module to TypeScript.
core/arrayUtils.js Removes JS implementation (migrated to TS).
core/arena/stringify.ts Adds typings and preserves stringify behavior with explicit null handling.
core/arena/set.ts Adds typings to mutating set helper.
core/arena/propOr.ts Adds typings and null-safe object handling.
core/arena/prop.ts Adds typings for property access helper.
core/arena/pipe.ts Migrates pipe helper to TypeScript.
core/arena/pipe.js Removes JS implementation (migrated to TS).
core/arena/parse.ts Adds typings and safer casts for Map/Set reviver behavior.
core/arena/omit.ts Adds typings for omit helper and accumulator typing.
core/arena/isNull.ts Adds typings for null/undefined check helper.
core/arena/isEmpty.ts Adds typings and safe casts for collection emptiness checks.
core/arena/internal/_isPlaceholder.ts Migrates placeholder detection to TypeScript.
core/arena/internal/_isPlaceholder.js Removes JS implementation (migrated to TS).
core/arena/internal/_curry3.ts Migrates internal curry helper to TypeScript.
core/arena/internal/_curry3.js Removes JS implementation (migrated to TS).
core/arena/internal/_curry2.ts Migrates internal curry helper to TypeScript.
core/arena/internal/_curry1.ts Migrates internal curry helper to TypeScript.
core/arena/internal/_camelizePartial.ts Migrates internal camelize logic to TypeScript with typed options.
core/arena/index.ts Adds TS barrel exports for arena helper functions.
core/arena/identity.ts Adds a generic-typed identity function.
core/arena/dissoc.ts Adds typings for dissoc helper.
core/arena/camelizePartial.ts Adds TS wrapper export for camelizePartial.
core/arena/camelize.ts Adds typings for camelize helper.
core/arena/assoc.ts Adds typings for assoc helper.
core/app/languages.ts Adds typings for language label lookup and language lists.
core/app/appInfo.ts Adds typings for app info helpers.
core/Countries/index.ts Adds TS barrel export for Countries module.
core/Countries/Countries.ts Migrates Countries module to TypeScript with typed JSON shape.
core/Countries/Countries.js Removes JS implementation (migrated to TS).
babel.config.js Adds @babel/preset-typescript and uses @babel/preset-react explicitly.
Comments suppressed due to low confidence (1)

core/uniqueNameGenerator.ts:25

  • parseName(startingName) is invoked twice (once to get count, once to get nameWithoutCount). This is minor but unnecessary work and makes the flow harder to follow; consider destructuring both from a single call.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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