Skip to content
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

TypeScript migration #105

Merged
merged 63 commits into from Nov 2, 2023
Merged

TypeScript migration #105

merged 63 commits into from Nov 2, 2023

Conversation

direnakkoc
Copy link
Collaborator

@direnakkoc direnakkoc commented Feb 22, 2023

Typescript migrated in this PR. We wanted to have type-safe properties and faster compilation.

Description

Changing your code from JavaScript to TypeScript requires changing files with the .js extension to .ts , adding signatures, building types and interfaces, and making sure nothing breaks in the process.

Instead of changing it all at once, we decided to switch gradually. The method we chose was that during each process, we would migrate only the core folder from js to ts. This way, we ensured that our work wasn’t disrupted, we didn’t feel threatened by the sudden change and our project didn’t suddenly break. When the project broke we managed these errors with eslint rules and added some rules to tsconfig as well. During the process when managing types workaround rules are removed by one. We still have some workaround rules in the eslint and tsconfig module. The aim is to remove most of them when merging this PR.

Cloudform library used at alarms properties level, cloudFormation template level and also dashboard level. We are able to manage all alarm properties with types which come from cloudform lib. But for dashboard body properties there were no types defined. We created an issue for this on cloudform repo. Happy to implement this type in the future if it comes through.

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@direnakkoc direnakkoc changed the title Ts migrate TypeScript migration Feb 22, 2023
@direnakkoc direnakkoc force-pushed the ts-migrate branch 2 times, most recently from 477e6d7 to 706f983 Compare February 24, 2023 16:50
@coveralls
Copy link

coveralls commented Mar 3, 2023

Coverage Status

coverage: 100.0%. remained the same when pulling 61607c7 on ts-migrate into 94eb90f on main.

.eslintrc.cjs Outdated Show resolved Hide resolved
.github/workflows/build.yml Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
cf-macro/template.yaml Show resolved Hide resolved
serverless-test-project/package.json Outdated Show resolved Hide resolved
tsconfig.json Show resolved Hide resolved
core/alarms/alarms.ts Outdated Show resolved Hide resolved
core/inputs/cascading-config.ts Outdated Show resolved Hide resolved
core/alarms/appsync.ts Outdated Show resolved Hide resolved
Copy link

@adminy adminy left a comment

Choose a reason for hiding this comment

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

I'm a big fan of 16k lines added and 35k almost lines removed

direnakkoc and others added 8 commits August 8, 2023 14:10
Copy link
Contributor

@eoinsha eoinsha left a comment

Choose a reason for hiding this comment

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

Amazing 💯

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.

None yet

5 participants