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

Generated .tgz file for JavaScript package is not yarn-installable #4448

Open
climbertjh opened this issue Mar 9, 2024 · 2 comments
Open
Labels
bug This issue is a bug. p2

Comments

@climbertjh
Copy link

Describe the bug

When using JSII to generate/package JavaScript packages, the generated filename for the .tgz file is of the form <package-name>@<version>.jsii.tgz for the JavaScript code. The generated filename for the Python module is, by contrast, <module-name>-<version>.tar.gz.

The JavaScript package file, with the @ sign in the filename is not installable using yarn. yarn add file:<filename> results in errors during the add/install of the package.

Expected Behavior

Expected behavior is that the .tgz file created by the JavaScript packaging is installable (by filename reference) when using yarn add.

Current Behavior

After building the package file, yarn add fails with messages similar to:

yarn add file:../ncfour/projen-utils/dist/js/[email protected]
yarn add v1.22.21
info No lockfile found.
[1/4] Resolving packages...
error Package "file:../ncfour/projen-utils/dist/js/projen-utils" refers to a non-existing file '"/home/tjh/Projects/repos/testing/ncfour/projen-utils/dist/js/[email protected]"'.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Reproduction Steps

  1. Build a package using the JSII tools.
  2. Create another project/package and initialize with yarn init
  3. Attempt to install the package into the test project/package using yarn add

Possible Solution

Change the @ character in the generated filename to a - character.

Additional Information/Context

No response

SDK version used

5.3.23

Environment details (OS name and version, etc.)

WSL2 - Ubuntu

@climbertjh climbertjh added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 9, 2024
@climbertjh
Copy link
Author

I have submitted a PR as a suggested update: #4449 .

@climbertjh
Copy link
Author

I am canceling/closing PR #4449 .

I re-configured my projen projects to use npm rather than yarn ("Classic", v1.x.x) and have found that the package file name works OK when using npm as packageManager.

@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
bug This issue is a bug. p2
Projects
None yet
Development

No branches or pull requests

2 participants