mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.52k stars 1.31k forks source link

[license] Move `x-license-pro` cli in a new package #4251

Closed oliviertassinari closed 2 years ago

oliviertassinari commented 2 years ago

It used to be possible to generate a license key with

npx @mui/x-license-pro@4.0.1 --order 121

It's no longer possible, it's broken when you run this same command with the latest version. It outputs

npx @mui/x-license-pro --order 121 Error: Cannot find module '../build/node/cli/license-cli'

It has been broken for a long time, and nobody complained about it. So, I šŸ‘ the point that @m4theushw has, we should get ride of the whole bin and cli folders:

It would also mean we can get rid of

https://github.com/mui/mui-x/blob/0c815ce1e9659c8f01403ef5fc6812251841a995/packages/x-license-pro/package.json#L38-L39

Which are polluting the dependencies:

Screenshot 2022-03-21 at 17 36 42

https://npm.anvaka.com/#/view/2d/%2540mui%252Fx-data-grid-pro


For though that wonder. How do customers get the license key? Will we break it? No, this is done with a WooCommerce webhook in https://github.com/mui/mui-store/blob/d0d86fc9e13d3cf0ca55eba9612ec00d1543356c/lambda/keymailer/index.js#L5

flaviendelangle commented 2 years ago

The CLI is used by the Studio team and has been fixed in #3965 (and #4055) I even added a CLI recently to decode a license for Matt (#4126)

We can publish it on an independent package to avoid polluting the main one, but I would not delete it altogether.

oliviertassinari commented 2 years ago

Ok, so we need the CLI. šŸ‘ to isolate the validation of the license in production, and the license utilities under two different packages. When we do work on the isolation, I think that we should remove the exported methods too, e.g. generateLicence:

https://github.com/mui/mui-store/blob/d0d86fc9e13d3cf0ca55eba9612ec00d1543356c/lambda/keymailer/index.js#L5

oliviertassinari commented 2 years ago

It could be great to expose methods to improve the maintainability of https://master--toolpad.mui.com/_toolpad/app/cl1c2j0l512939zo6a43575en/editor/codeComponents/cl2mcledm00023g6945cr9pkx.

oliviertassinari commented 2 years ago

So far, I didn't explain what problem we would solve with this issue, my bad, I had only said:

Which are polluting the dependencies:

Here are two concretes benefits:

  1. Simplify the license. When enterprises look at new packages, they have to check all the licenses. We have an opportunity to remove ISC licenses, issue #5113
Screenshot 2022-06-04 at 16 16 02

https://npm.anvaka.com/#/view/2d/%2540mui%252Fx-data-grid-pro

  1. Fewer dependencies mean less noise on security concerns. For instance, this customer asked about a depth 7 (WUT) dependency https://groups.google.com/a/mui.com/g/x/c/5nCzjIIQeDE/m/sEcz_YYvBAAJ
Screenshot 2022-06-04 at 16 19 21