Skip to content

Add TypeScript support #1170

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Add TypeScript support #1170

wants to merge 4 commits into from

Conversation

matux
Copy link
Contributor

@matux matux commented Apr 14, 2025

$ npm run test_ci

> rollbar@3.0.0-alpha.0 test_ci
> ./node_modules/.bin/grunt test

Running "test-server" task

Running "vows:all" (vows) task
/Users/matux/code/rollbar/rollbar-js/src/utility/replace.ts:10
export default function replace(
^^^^^^

SyntaxError: Unexpected token 'export'
    at wrapSafe (node:internal/modules/cjs/loader:1378:20)
    at Module._compile (node:internal/modules/cjs/loader:1428:41)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/Users/matux/code/rollbar/rollbar-js/src/server/telemetry.js:4:15)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)

Node.js v20.18.0
Warning: Task "vows:all" failed. Use --force to continue.

Aborted due to warnings.

Description of the change

This PR implements TypeScript support with minimal codebase changes to enable a mixed JS/TS environment.

  • Add @babel/preset-typescript and related dependencies
  • Configure webpack to process .ts files alongside .js files
  • Create tsconfig.json with appropriate settings for mixed JS/TS environment
  • Add TypeScript examples to demonstrate usage patterns
  • Update documentation in CLAUDE.md with TypeScript guidelines

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)
  • Maintenance
  • New release

Related

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

@matux matux added the claude label Apr 14, 2025
@matux matux requested review from brianr, waltjones and Copilot April 14, 2025 21:26
@matux matux self-assigned this Apr 14, 2025
Copy link
Contributor

@Copilot 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.

Copilot reviewed 8 out of 12 changed files in this pull request and generated no comments.

Files not reviewed (4)
  • babel.config.json: Language not supported
  • examples/typescript/package.json: Language not supported
  • examples/typescript/tsconfig.json: Language not supported
  • package.json: Language not supported

@matux matux marked this pull request as draft April 14, 2025 22:23
@matux matux force-pushed the matux/add-ts-support branch from 0fcf6b2 to 2ef153e Compare April 14, 2025 22:27
@matux matux removed the claude label Apr 14, 2025
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.

1 participant