Skip to content

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
@joao10lima joao10lima force-pushed the feat/124-context-deps branch from bbe6513 to f03d122 Compare January 18, 2022 18:29
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

2 participants