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

Emit .d.ts to dist/ on build via "declaration" in tsconfig.json #323

Merged
merged 2 commits into from
Jul 6, 2022
Merged

Emit .d.ts to dist/ on build via "declaration" in tsconfig.json #323

merged 2 commits into from
Jul 6, 2022

Conversation

danbeam
Copy link
Contributor

@danbeam danbeam commented Jul 5, 2022

This is so folks can consume this code in a more type safe way.

cc @catc @lencioni

@codecov
Copy link

codecov bot commented Jul 5, 2022

Codecov Report

Merging #323 (9d09bf8) into main (83ccb01) will not change coverage.
The diff coverage is n/a.

❗ Current head 9d09bf8 differs from pull request most recent head 79e95a3. Consider uploading reports for the commit 79e95a3 to get more accurate results

@@           Coverage Diff           @@
##             main     #323   +/-   ##
=======================================
  Coverage   92.09%   92.09%           
=======================================
  Files          26       26           
  Lines        1872     1872           
  Branches      392      392           
=======================================
  Hits         1724     1724           
  Misses        102      102           
  Partials       46       46           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83ccb01...79e95a3. Read the comment docs.

@skovhus
Copy link
Owner

skovhus commented Jul 6, 2022

I'm curious to understand the use case here. So I assume you have a project where you want to load the transformers from a TypeScript node-based setup and execute jscodeshift from your side?

@danbeam
Copy link
Contributor Author

danbeam commented Jul 6, 2022

I'm curious to understand the use case here. So I assume you have a project where you want to load the transformers from a TypeScript node-based setup and execute jscodeshift from your side?

We've built some codemods (in Typescript) that transform some internal testing infrastructure using some of the utils in jest-codemods. We initially added them directly to a fork of this project but it'd be much cleaner to use parts of jest-codemods as a library instead.

We upstreamed the Sinon codemod cuz that'd be helpful to others. But the rest wouldn't be (cuz the code they transform isn't publicly available).

@lencioni
Copy link
Contributor

lencioni commented Jul 6, 2022

Correct me if I'm wrong @danbeam but I believe we are mostly (only?) using stuff from the utils directory in this way. I see things like this:

import finale from 'jest-codemods/dist/utils/finale';
import { findParentOfType } from 'jest-codemods/dist/utils/recast-helpers';
import { modifyVariableDeclaration } from 'jest-codemods/dist/utils/sinon-helpers';

and this:

import { api } from 'jest-codemods/dist/utils/test-helpers';

@skovhus skovhus enabled auto-merge (squash) July 6, 2022 17:42
@skovhus skovhus merged commit 191cbe2 into skovhus:main Jul 6, 2022
@skovhus
Copy link
Owner

skovhus commented Jul 6, 2022

Thanks for the additional context. I always wondered if some of the utilities here should be shipped as a separate package.

Especially the code mod CLI part that is now powering a lot of codemods (by copy pasting this and improving it). :)

lencioni added a commit to lencioni/jest-codemods that referenced this pull request Jul 6, 2022
This is a small followup to
skovhus#323

Using ^ will allow projects that consume this package as a dependency to
be more flexible with the versions of these dependencies.
skovhus added a commit that referenced this pull request Jul 8, 2022
* Use ^ semver ranges for dependencies

This is a small followup to
#323

Using ^ will allow projects that consume this package as a dependency to
be more flexible with the versions of these dependencies.

* Bump version to 0.29

Co-authored-by: Kenneth Skovhus <[email protected]>
@danbeam danbeam deleted the emit-declarations branch August 19, 2022 19:26
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.

3 participants