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

Include missing licenses in /build folder or omit the folder from distributed package #4194

Closed
jschirrmacher opened this issue Nov 29, 2021 Discussed in #4179 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@jschirrmacher
Copy link

Discussed in #4179

Originally posted by riesel November 24, 2021
We are including the socket.io-client package from https://www.npmjs.com/package/socket.io-client in our vue.js frontend.
There we are using webpack-license-plugin to scan for licenses in dependencies in our project.
This worked fine for socket.io-client versions < v4.4.0. From 4.4.0 on we see that the content of package.json in e.g. build\csj\ directory changed and now contains name and version information. Since it does not contain license information, webpack-license-plugin reports a missing license.

My question is whether the build directory has to be packaged at all or can be omitted to avoid this issue?

@darrachequesne darrachequesne added the bug Something isn't working label Nov 30, 2021
@jschirrmacher
Copy link
Author

I've digged a bit deeper into the packaging process, and in my understanding the /build folder seems to be packaged accidentally. Actually, I've checked out the source, found no "build" target in package.json, but only a "compile" which is called during npm packaging. Doing that, a .tgz is created, but doesn't contain /build and in fact, our program using this cleanly setup package still works as expected. Is there anything I've missed, something that actually creates the /build folder?

So I hope that a simple re-packaging in a clean directory and a re-publish as e.g. 4.4.1 would work.
Do you have any plan to do so in the near future and can you already think of a date for such? I would very much appreciate that and would gladly help if needed in doing so.

darrachequesne added a commit to socketio/socket.io-client that referenced this issue Jan 4, 2022
The additional package.json file, which was copied to
build/cjs/package.json, did hide the parent one, leading to several
issues and providing no real feature. The other one, copied to
build/esm/package.json, is needed though, to enforce the module type.

Related:

- socketio/socket.io#4194
- #1513
sunrise30 added a commit to sunrise30/socket.io-client that referenced this issue Jan 8, 2022
The additional package.json file, which was copied to
build/cjs/package.json, did hide the parent one, leading to several
issues and providing no real feature. The other one, copied to
build/esm/package.json, is needed though, to enforce the module type.

Related:

- socketio/socket.io#4194
- socketio/socket.io-client#1513
@jschirrmacher
Copy link
Author

Thanks for the update and the new version!
However, webpack-license-plugin still reports a missing license for 4.4.0, although we updated to 4.4.1.
Can you imagine where it finds such a version? I've checked package-lock.json, removed node_modules and re-installed anything, but to no avail. npm ls socket.io-client reports only version 4.4.1 now, no sign of 4.4.0 anywhere.

darrachequesne added a commit to socketio/socket.io-fiddle that referenced this issue Jan 13, 2022
@darrachequesne
Copy link
Member

@jschirrmacher that's weird, I'm not able to reproduce: https://github.com/socketio/socket.io-fiddle/tree/issues/socket.io/4194

[
  {
    "name": "socket.io-client",
    "version": "4.4.1",
    "repository": "https://github.com/socketio/socket.io-client",
    "source": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.4.1.tgz",
    "license": "MIT",
    "licenseText": "The MIT License (MIT) [...]"
  },
  [...]
]

And I haven't found any reference to a cache at https://github.com/codepunkt/webpack-license-plugin.

@jschirrmacher
Copy link
Author

Thanks for trying to reproduce!
I solved that problem now by using licenseOverrides in webpack-license-plugin for 4.4.0
This should help to prevent the error message and since we use 4.4.1, it should not really be a problem.

@darrachequesne
Copy link
Member

@jschirrmacher great, thanks for the workaround! I get this can be closed now.

@darrachequesne darrachequesne added this to the 4.4.1 milestone Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants