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

test: link to externals outside node_modules #126

Merged
merged 4 commits into from Oct 29, 2020

Conversation

aleclarson
Copy link
Contributor

In this test, the node_modules/d3-drag path is linked to ../../d3-drag (which is a local package, not from node_modules).

This setup mimics a monorepo, where dependencies often point to local packages.

The local d3-drag package contains an index.d.ts module.

This test fails with Unexpected token error, since no Program is found for the d3-drag/index.d.ts module.

@aleclarson
Copy link
Contributor Author

I'm working on a fix, so lmk if you are too. ;)

aleclarson added a commit to aleclarson/rollup-plugin-dts that referenced this pull request Oct 29, 2020
@aleclarson
Copy link
Contributor Author

Okay, I've got a fix working! LGTM 👍

In this test, the `node_modules/d3-drag` path is linked to `../../d3-drag` (which is a local package, not from node_modules).
This setup mimics a monorepo, where dependencies often point to local packages.
The local `d3-drag` package contains an `index.d.ts` module.
This test fails with `Unexpected token` error, since no `Program` is found for the `d3-drag/index.d.ts` module.
aleclarson added a commit to aleclarson/rollup-plugin-dts that referenced this pull request Oct 29, 2020
Copy link
Owner

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

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

Nice!

src/index.ts Outdated Show resolved Hide resolved
tests/testcases/externals-link/meta.ts Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
../../../d3-drag
Copy link
Owner

Choose a reason for hiding this comment

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

any specific reason for this link? I would rather like to keep the testcase self contained.

Copy link
Owner

Choose a reason for hiding this comment

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

lol nevermind, I should have read the PR description, lol.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unfortunately, it has to exist outside the root directory of the test case for the error to occur :(

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

2 participants