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

refactor: flatten dependency structure #272

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nayeemrmn
Copy link
Collaborator

Towards #247. Implements the proposed API on the rust side while keeping a legacy serialization layer to preserve deno info --json.

Essentially dependencies like this:

{
  dependencies: [
    {
      specifier: "./foo.js",
      code: {
        specifier: "file:///foo.js",
        range: { /*...*/ },
      },
      type: {
        specifier: "file:///foo.d.ts",
        range: { /*...*/ },
      },
    },
  ]
}

are now like this:

{
  dependencies: [
    {
      key: "./foo.js",
      specifier: "file:///foo.js",
      range: { /*...*/ },
      externalTypesIndex: 1, // Points to the second entry below.
    },
    {
      key: "./foo.d.ts",
      specifier: "file:///foo.d.ts",
      range: { /*...*/ },
      isTypeOnly: true,
    },
  ]
}

where you can actually reason about the properties of each dependency since they are limited to one specifier key, one resolved specifier and a flatter structure.

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

1 participant