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

chore(plugin): add dependencies list to context #137

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

Conversation

joao10lima
Copy link
Contributor

As explained on the issue #124
This commit adds the projects dependencies list on the plugin context

Before:

import { hasRubyDependency } from "./dependencies.ts";

const isDependency = await hasRubyDependency(context, "rubocop");

At every import and function call, the application would go on the
dependency files(package.json, Pipfile, etc ...) and search for
the requested dependencies. This made the application very slow
in addition to harming the organization of the code with many unnecessary imports.

After:

const isDependency = await context.dependencies.includes("rubocop");

Now the dependency list is loaded before the introspection and
only need to read the necessary dependencies files once.

Resolves: #124

To test:

  • Run Pipelinit on a project that uses Ruby, Python or JavaScript.
  • Run the unit tests

@joao10lima joao10lima force-pushed the feat/124-context-deps branch 4 times, most recently from 544a402 to bbe6513 Compare January 10, 2022 12:51
As explained on the issue #124
This commit adds the projects dependencies list on the plugin context

Before:
```typescript
import { hasRubyDependency } from "./dependencies.ts";

const isDependency = await hasRubyDependency(context, "rubocop");
```
At every import and function call the application would go on the
dependencies files(package.json, Pipfile, etc ...) and search for
the requested dependencies. This made the application very slow
in addition to harming the organization of the code with many unnecessary imports.

After:
```typescript
const isDependency = await context.dependencies.includes("rubocop");
```
Now the dependency list is loaded before the introspection and
only need to read the necessary dependencies files once.

Resolves: #124
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.

Add project dependencies to context
1 participant