Skip to content

feat: Convert CLI to TypeScript#140

Merged
justlevine merged 35 commits intortCamp:developfrom
Swanand01:feat/migrate-cli-to-ts
Apr 9, 2025
Merged

feat: Convert CLI to TypeScript#140
justlevine merged 35 commits intortCamp:developfrom
Swanand01:feat/migrate-cli-to-ts

Conversation

@Swanand01
Copy link
Contributor

@Swanand01 Swanand01 commented Apr 1, 2025

What

This PR converts the CLI to TypeScript.

Why

Typechecking. This is part of a larger effort to improve the CLI: https://github.com/rtCamp/headless/issues/408

Related Issue(s):

https://github.com/rtCamp/headless/issues/411

How

.cjs files are rewritten in TypeScript.
build.cjs is left as is, but the code has been updated to compile the rest of the TypeScript files.

Testing Instructions

Screenshots

Additional Info

Checklist

  • I have read the Contribution Guidelines.
  • My code is tested to the best of my abilities.
  • My code passes all lints (ESLint, tsc, prettier etc.).
  • My code has detailed inline documentation.
  • I have added unit tests to verify the code works as intended.
  • I have updated the project documentation as needed.
  • I have added a changeset for this PR using npm run changeset.

@changeset-bot
Copy link

changeset-bot bot commented Apr 1, 2025

🦋 Changeset detected

Latest commit: ac67767

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
snapwp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Swanand01 Swanand01 changed the title feta: Convert CLI to TypeScript feat: Convert CLI to TypeScript Apr 1, 2025
@Swanand01 Swanand01 requested a review from ayushnirwal April 1, 2025 08:02
@justlevine justlevine added the needs: review 🧐 Needs to be reviewed by a codeowner label Apr 2, 2025
Comment on lines +11 to +17
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.js",
"types": "./dist/types/index.d.ts"
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are no exports from this package. Only requirement is to add a "bin"

"resolve-tspaths": "*",
"tsc-watch": "*",
"typescript": "*",
"@snapwp/types": "*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see no imports from @snapwp/types

@Swanand01 Swanand01 requested a review from ayushnirwal April 3, 2025 14:05
@justlevine justlevine removed the needs: review 🧐 Needs to be reviewed by a codeowner label Apr 3, 2025
Copy link
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

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

I resolved the merge conflicts, but and then cleaned up the eslintrc file a bit more since different file types were sliding through. (ref: ef971fe)

@ayushnirwal please give it one last look through / approve before I go ahead and merge 🙇

@coveralls
Copy link

coveralls commented Apr 4, 2025

Pull Request Test Coverage Report for Build 14358746936

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 53.768%

Totals Coverage Status
Change from base Build 14332702779: 0.0%
Covered Lines: 399
Relevant Lines: 658

💛 - Coveralls

* @param config configuration.
* @param {string} source Import string.
* @param {string} file File-path in which alias is used.
* @param {Object} config configuration.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this file not included in the eslint config before?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nope 😬

Copy link
Collaborator

@ayushnirwal ayushnirwal left a comment

Choose a reason for hiding this comment

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

LGTM

@justlevine justlevine merged commit 211a7e5 into rtCamp:develop Apr 9, 2025
11 checks passed
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.

5 participants