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

Support for local dependencies #4300

Open
2 tasks
jeromevdl opened this issue Oct 18, 2023 · 3 comments
Open
2 tasks

Support for local dependencies #4300

jeromevdl opened this issue Oct 18, 2023 · 3 comments
Labels
feature-request A feature should be added or improved. p2

Comments

@jeromevdl
Copy link

Describe the feature

Would be great to support local dependencies (with file:)

Use Case

My CDK library is used by another one. Both are in the same project and it makes no sense to release the dependency in order to work with the dependant (faster development cycle).

Proposed Solution

Verify if the dependency is a file or folder and do not fail if this is the case.

Other Information

Hi, I have a lerna project with 2 AwsCdkConstructLibrary projen projects (let's say foo & bar).

bar is depending on foo. I tried the following in bar:

deps: [
    'foo@file:../foo',
],

but it fails with jsii and the error:

Declared dependency on version file:../foo of foo, but version 0.0.0 was found
  at DependencyResolver.discoverDependencyTree (...node_modules/jsii/lib/project-info.js:161:23)
  at loadProjectInfo (...node_modules/jsii/lib/project-info.js:50:31)
  ...

I also tried to use the tgz in the dist of foo, but had the error (plus it's not easy to have the foo project built before bar install):

Error: ENOTDIR: not a directory, open '.../dist/js/[email protected]/package.json'
  at _resolveVersion (...node_modules/jsii/lib/project-info.js:312:36)
  at DependencyResolver.resolveDependency (...node_modules/jsii/lib/project-info.js:188:58)

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.94.0

Environment details (OS name and version, etc.)

mac os 13.5.2, node 20.8.0, jsii ~5.2.16

@jeromevdl jeromevdl added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 18, 2023
@gocapa
Copy link

gocapa commented Feb 7, 2024

Any updates?

Thanks.

@cloudkitect
Copy link

This is a much needed feature, else the development cycle becomes tedious.

@gadams999
Copy link

There is a PR that should fix this by changing the @ to a - in the filename. I've tested by having projen create a package file for the dependency, renaming by changing the @ sign, then including in the main project by adding a dependency (dep) of "dep-pkg-name@file:/path/to/dep-pkg-name-0.0.0.jsii.tgz and then running npx projen && npx projen install.

Support for the PR would be appreciated to get this in front of the JSII maintainers.

@mrgrain mrgrain added p2 and removed needs-triage This issue or PR still needs to be triaged. labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

4 participants