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

feat: add support for package self-referencing #88

Merged
merged 21 commits into from
Mar 17, 2023

Conversation

RebeccaStevens
Copy link
Contributor

@RebeccaStevens RebeccaStevens commented Mar 15, 2023

fix #87

src/util/require.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@RebeccaStevens RebeccaStevens force-pushed the self-ref branch 2 times, most recently from b46edc9 to e0e96ec Compare March 15, 2023 11:48
Copy link
Collaborator

@webpro webpro left a comment

Choose a reason for hiding this comment

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

TIL about self-referencing a package using its name :) Hats off for picking this up in this oddly organized codebase, including tests & fixtures! Also glad you worked against v2.

src/typescript/ast-walker.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@RebeccaStevens
Copy link
Contributor Author

RebeccaStevens commented Mar 16, 2023

The windows test seems to be failing due to upstream issue.
Where exactly that issue is, I'm not sure. It might be in node itself.

@webpro
Copy link
Collaborator

webpro commented Mar 16, 2023

The windows test seems to be failing due to upstream issue. Where exactly that issue is, I'm sure. It might be in node itself.

Yes, facing this too:

  error: |-
    Cannot find module './build'
    Require stack:
    - C:/Users/larsk/Projects/knip/tests/fixtures/workspaces-self-reference/packages/eslint-config-self-reference
  code: 'MODULE_NOT_FOUND'
  stack: |-
    Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    u.default._resolveFilename (C:\Users\larsk\Projects\knip\node_modules\@esbuild-kit\cjs-loader\dist\index.js:1:1519)
    Function.resolve (node:internal/modules/cjs/helpers:109:19)
    <anonymous> (c:\Users\larsk\Projects\knip\src\index.ts:187:40)

@RebeccaStevens RebeccaStevens force-pushed the self-ref branch 2 times, most recently from e1add0a to 9e2d849 Compare March 17, 2023 04:34
@webpro
Copy link
Collaborator

webpro commented Mar 17, 2023

I opened RebeccaStevens#1 to better describe what I meant and added some comments in the code as well. Did you see that? Perhaps a bit odd to open a PR this way, but alas :)

@RebeccaStevens RebeccaStevens force-pushed the self-ref branch 2 times, most recently from abfe6ce to c076899 Compare March 17, 2023 08:20
@webpro
Copy link
Collaborator

webpro commented Mar 17, 2023

Alright, let's go! I'm very grateful for your efforts @RebeccaStevens

@webpro webpro merged commit 3a9ef07 into webpro-nl:v2 Mar 17, 2023
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.

2 participants