coderaiser / cloudcmd

✨☁️📁✨ Cloud Commander file manager for the web with console and editor.
https://cloudcmd.io
MIT License
1.83k stars 255 forks source link

Deploy size #365

Closed haixuxu closed 2 years ago

haixuxu commented 2 years ago

I use it as a basic package, but the dependencies in it are so chaotic that the resources deployed are too large.

[root@app01 node_modules]# ll|grep babel
drwxr-xr-x 109 root root  4096 1月   6 15:20 @babel
drwxr-xr-x   2 root root  4096 1月   6 15:20 babel-core
drwxr-xr-x   3 root root  4096 1月   6 15:20 babel-plugin-dynamic-import-node
drwxr-xr-x   4 root root  4096 1月   6 15:20 babel-plugin-polyfill-corejs2
drwxr-xr-x   5 root root  4096 1月   6 15:20 babel-plugin-polyfill-corejs3
drwxr-xr-x   4 root root  4096 1月   6 15:20 babel-plugin-polyfill-regenerator
drwxr-xr-x   3 root root  4096 1月   6 15:20 estree-to-babel

@babel/core is used

[root@app01 node_modules]# npm list @babel/core
webfile@1.0.0 /root/oschina/webfile
└─┬ cloudcmd@14.9.3
  └─┬ putout@9.14.2
    └─┬ @putout/engine-loader@2.2.1
      ├── @babel/core@7.16.7
      └─┬ jscodeshift@0.11.0
        └── @babel/core@7.16.7  de

babel-core is used.

[root@app01 node_modules]# npm list babel-core
webfile@1.0.0 /root/oschina/webfile
└─┬ cloudcmd@14.9.3
  └─┬ putout@9.14.2
    └─┬ @putout/engine-loader@2.2.1
      └─┬ jscodeshift@0.11.0
        └── babel-core@7.0.0-bridge.0
coderaiser commented 2 years ago

Hi, thank you!

Alright, let's start from the beginning:

What kind of resources are you deployed and where? Is it docker image or something? Is there anything else I can help you?

haixuxu commented 2 years ago

I got it. Can you separate this feature? I just want to use the file management function of this package.

coderaiser commented 2 years ago

What do you mean by file manager function? How do you imagine this separation?

And why separate, you talking about chaotic dependencies but I see no numbers from you. What is the problem with current size of Cloud Commander? What size do you prefer? What are you ready to do for it?

haixuxu commented 2 years ago

I don't really need user-defined menu function, but I need to install the whole putout to support it, which sounds too unfriendly.

haixuxu commented 2 years ago

I only installed one package, which has reached 278m in size.

 /tmp/test123/ cat package.json
{
  "name": "test123",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "cloudcmd": "^15.9.13"
  }
}
 /tmp/test123/ du -d 1 -h |sort -n
278M    ./node_modules
279M    .
coderaiser commented 2 years ago

I don't really need user-defined menu function, but I need to install the whole putout to support it, which sounds too unfriendly.

How do you suggest split Cloud Commander? User Menu is a feature one of users asked for (https://github.com/coderaiser/cloudcmd/issues/221). Other two panels file manager also have it. You definitely should learn how to use this very useful instrument which I spend a lot of time!

279M

So what? Are you using dial-up or something? What size do you think is better?

What do you suggest? And what is your usecase?

haixuxu commented 2 years ago

oh ha! Thank you for your work. Thank you for your patience. I achieved my goal by copying the source code into the project and removing some code. Of course, it's ugly.

In addition, I tried user menu on package version 15.9.13 and the latest docker image, and found that this feature is invalid.. Maybe I used it improperly.

I intend to close the problem to avoid delaying you more time. Do you agree with it

coderaiser commented 2 years ago

I achieved my goal by copying the source code into the project and removing some code. Of course, it's ugly.

What kind of code did you removed? How much in size you win?

In addition, I tried user menu on package version 15.9.13 and the latest docker image, and found that this feature is invalid.. Maybe I used it improperly.

What exactly didn't work? Describe steps and errors you find.

Actually every time you renaming a file with F2 key - you are dealing with User Menu :), so if it doesn't work you can rename nothing. User Menu made so people can extend file manager in a way they like. So Cloud Commander was more like a framework.