-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Build generates invalid package.json files, thereby breaking tooling (eg normalize-package-data, CycloneDX) #10694
Comments
Do you have the option of using the ESM module tree (e.g. If you're only able to use the CommonJS entry point (e.g. |
Hi Augustus, This practice of having sub-folders with Before the While we generate those proxy directories with As it currently stands, there is no way around using these files in many libraries. I'm sorry to tell you this, but this seems like either you'll have to play that ball back to |
Hi Ben and Lenz, I really appreciate your feedback. Thank you. The issue is not about importing the files so changing the way we import them does not matter. It's the presence of package.json files which contain name-properties that are invalid from the perspective of an NPM repo which breaks the build. Generating the name-properties from the folder structure works fine for importing in NodeJS and other UI builds but conflicts with the expectations tools like The answers you provided here helped to understand better why Apollo chose to do it this way. Always good to understand the reasons behind doing things a certain way. I think we can conclude that the build in Fortunately, @jkowalleck has already prepared CycloneDX/cyclonedx-webpack-plugin#754 in an attempt to make CycloneDX more robust in this respect. If everything goes well this should allow CycloneDX to produce SBOMs even if To give some context: the goal is then to use this SBOM in mainly two ways:
Getting this working correctly is actually surprisingly difficult given the various ways licences are referred to and other system parts like Docker containers and backend code that also needs to be considered. Thanks again for your input. I'll go ahead an close this ticket as the work on this needs to continue elsewhere. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue Description
Code in
apollo-client/config/prepareDist.js
Line 64 in b214dd1
package.json
files for subfolders that are not real NPM packages. It uses multiple slashes as part of the package names which makes them invalid. If I understand the comment #6656 (review) correctly this is done to allow for partial imports.We stumbled over this when trying to use CycloneDX create an SBOM for a project. The presence of the
package.json
files above broke the run of CycloneDX thereby making it imposisble to use it as soon as@apollo/client
is a dependency of the project,I guess the aim of allowing partial imports of
@apollo/client
could be archived in a safer manner by either:mts
ormjs
files and get rid of thepackage.json
files that supposedly only exist to transport the type=module setting to NodeJS.@apollo/client
in various smaller packages whilst having transitive dependencies in@apollo/client
for those users who want the complete Apollo client.Please correct me if I misunderstood the reasons for having the
package.json
files generated for your subfolders.References:
Link to Reproduction
https://github.com/sresch4b/cyclonedx-issue
Reproduction Steps
Get repo from https://github.com/sresch4b/cyclonedx-issue
yarn install
yarn build
The text was updated successfully, but these errors were encountered: