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

Export resolve paths as function #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Bielik20
Copy link

This is my proposal to add option to use this package in code through standard import without damaging existing functionality.

Why?

I wanted to use this in rollup as a plugin so I needed a way to import function and execute it. Plugin looks like that:

import { resolvePaths } from 'tscpaths'

function tscpaths() {
  return {
    onwrite() {
      resolvePaths({
        project: 'tsconfig.json',
        src: './src',
        out: './dist/types'
      })
    }
  }
}

Misc

I have updated globby becuase it has now its own types so @types/globby is no longer necessary.

@joonhocho
Copy link
Owner

@Bielik20 Hey thanks for PR, but since you split the original file into two different files. It's really hard to review what has changed.

@Bielik20
Copy link
Author

Bielik20 commented May 9, 2019

@joonhocho You are right I should have written summary. I did not touch the logic at all I simply put it in the functions (resolvePaths and command). I have changed paths to "main", "module" and "types" to point to newly created function resolvePaths. Also "bin" now points to to the cjs/run.js where the command function is executed.

Should you require more in depth explanation let me know.

@Bielik20
Copy link
Author

@joonhocho Is there something you require of me?

Copy link

@dmnsobczak dmnsobczak left a comment

Choose a reason for hiding this comment

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

@joonhocho Bielik20 made a nice change and it'll be useful in our projects. Can you please merge it? :)

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