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(*): [RO-18670] add ability to ignore dependencies #78

Conversation

terry-au
Copy link
Contributor

Changes

  • Adds the ability to mark a dependency as ignored by setting spurIocIgnore to true on the dependency.
  • Update warning output when dependencies are being overridden.

…cy registration

add support for skipping dependency injection by setting
…cy registration

improve logging output when warning against dependency registration collisions
…cy registration

fix passing incorrect parameters
improve logging
Copy link
Collaborator

@acolchado acolchado left a comment

Choose a reason for hiding this comment

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

Overall this looks like it will provide us with the filtering we need. A couple of minor things:

Can you add coverage for all of the public (documented) [registration entry points](ioc.registerDependencies)?

  • ioc.registerDependencies
  • ioc.registerFolders
  • ioc.addResolvableDependency
  • ioc.addDependency

Could we filter out *.d.ts files?

I made it too relaxed with the 'ts' inclusion. But this doesn't have to be in this PR and I can also take care of it.

}
this.dependencies[name] = Dependency.resolvableDependency(name, dependency);
return this;
},

addDependency(name, dependency, suppressWarning = false) {
if (this.shouldIgnoreDependency(dependency)) {
return this;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wondering if we should add a debug message here that says we are ignoring this dependency..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@acolchado updated to print a warning if suppressWarning is false.

src/ContainerManagement.js Outdated Show resolved Hide resolved
…cy registration

add warning for ignored dependencies
…cy registration

add test cases for registerFolders and addResolvableDependency
…cy registration

add test cases for addDependency
…O-18670-Extend-spur-ioc-to-add-the-ability-to-skip-dependency-registration
…cy registration

update FileFilterExpression to ignore .d.ts files
add test
…cy registration

fix file filter causing issues with some imports
update logging to print primitive types
…cy registration

added missing lodash.get dependency
@terry-au terry-au changed the base branch from main to v2.0.0 May 17, 2023 04:29
@acolchado acolchado merged commit d72cf6c into opentable:v2.0.0 May 17, 2023
acolchado pushed a commit that referenced this pull request Jun 13, 2023
* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
add support for skipping dependency injection by setting

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
improve logging output when warning against dependency registration collisions

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
fix passing incorrect parameters
improve logging

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
add warning for ignored dependencies

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
add test cases for registerFolders and addResolvableDependency

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
add test cases for addDependency

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
update FileFilterExpression to ignore .d.ts files
add test

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
fix file filter causing issues with some imports
update logging to print primitive types

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
added missing lodash.get dependency
acolchado added a commit that referenced this pull request Jun 13, 2023
* Adds the ability to read the typescript files (#76)

This addition is not meant to be full support of typescript from the library. It's meant to allow the reading of the files in the case you are looking to use TS files and are responsible for the transpilation/compilation of those files.

We are experimenting adding this to allow us to use ts files with ts-jest and other tooling in our tests and source files. The compilation is happening locally and doesn't depend on the package having full support for a build pipeline.

This will be published a major version so that those who may have .ts files won't have a break in their dev flow but once it's promoted out of release candidate, it will have proper documentation if we opt to keep the support.

* v2.0.0-rc.0 (#77)

* feat(*): [RO-18670] add ability to ignore dependencies (#78)

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
add support for skipping dependency injection by setting

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
improve logging output when warning against dependency registration collisions

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
fix passing incorrect parameters
improve logging

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
add warning for ignored dependencies

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
add test cases for registerFolders and addResolvableDependency

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
add test cases for addDependency

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
update FileFilterExpression to ignore .d.ts files
add test

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
fix file filter causing issues with some imports
update logging to print primitive types

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration
added missing lodash.get dependency

* feat(*): RO-18670 Extend spur-ioc to add the ability to skip dependency registration (#80)

fix logging

* v2.0.0-rc.1 (#79)

* refactor(warnings): Removes the noisy ignored dependency warnings (#81)

* v2.0.0-rc.2 (#82)

---------

Co-authored-by: Terry Lewis <terry1994dev@gmail.com>
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