GithubHelp home page GithubHelp logo

Comments (17)

malept avatar malept commented on July 24, 2024

When I think of an electron-forge clean command, that action is definitely not what I think of. I would expect it to delete the output directory, if anything (where package and make put their artifacts).

from forge.

deepak avatar deepak commented on July 24, 2024

When I think of an electron-forge clean command, that action is definitely not what I think of

now that you mention it, i agree :-)

it would be nice if electron-forge and all its dependencies create their cache & temporary files inside a .electron/cache folder inside the project. so that we can just delete it for a clean build

also, it would be nice if the electron builds in the ~/.electron/ folder
are not subject to that rule
because downloading the bigger files every time on every build would be a pain

from forge.

malept avatar malept commented on July 24, 2024

Temporary files should not go into a cache folder. I don't know the details about how electron-compile works, but if it's truly a cache and not just temporary files, it should also live in a cache folder. But that bug should be filed there, not here.

Having a shared cache folder (like ~/.electron/cache as you suggest) would be problematic. What if two different Electron-related modules had the same name for a file?

FWIW, the download cache is moving to a more appropriate folder soon: electron/get#37

from forge.

deepak avatar deepak commented on July 24, 2024

Having a shared cache folder (like ~/.electron/cache as you suggest) would be problematic.
What if two different Electron-related modules had the same name for a file?

am suggesting that the cache should not be shared
so if my electron project is at ~/code/electron-todo
then the cache is inside my project ie. ~/code/elecron-todo/.electron/cache

benefit is that there is one cache folder, which we can delete,
to clean up the build.

also, it would be nice if the electron builds in the ~/.electron/ folder
are not subject to that rule
because downloading the bigger files every time on every build would be a pain

the second part was that, the electron distribution which electron-packager (i think)
downloads to the ~/.electron folder on OSX should not be subject to that rule
ie. it should still be global at ~/.electron and not be inside ~/code/elecron-todo/.electron/cache
as per the above example.
am saying this because, the file sizes here are relatively huge
this is more like an installed dependency.

on my machine the ~/.electron folder looks like

➜  .electron ls -al
total 851784
drwxr-xr-x   17 deepak  staff       578 Jan 11 15:17 .
drwxr-xr-x+ 123 deepak  staff      4182 Jan 21 10:29 ..
-rw-r--r--    1 deepak  staff      6335 Jan 10 11:50 SHASUMS256.txt-1.4.0
-rw-r--r--    1 deepak  staff      2878 Jan  2 17:06 SHASUMS256.txt-1.4.12
-rw-r--r--    1 deepak  staff      2877 Dec 21 17:22 SHASUMS256.txt-1.4.13
-rw-r--r--    1 deepak  staff      2878 Jan 11 15:17 SHASUMS256.txt-1.4.14
-rw-r--r--    1 deepak  staff   3373197 Jan 10 11:50 chromedriver-v2.21-darwin-x64.zip
-rw-r--r--    1 deepak  staff  42111540 Jan  2 17:06 electron-v1.4.12-darwin-x64.zip
-rw-r--r--    1 deepak  staff  41156049 Jan  4 16:04 electron-v1.4.12-mas-x64.zip
-rw-r--r--    1 deepak  staff  42118362 Dec 21 17:22 electron-v1.4.13-darwin-x64.zip
-rw-r--r--    1 deepak  staff  37762216 Dec 28 15:36 electron-v1.4.13-linux-armv7l.zip
-rw-r--r--    1 deepak  staff  44550484 Dec 28 15:23 electron-v1.4.13-linux-ia32.zip
-rw-r--r--    1 deepak  staff  43350836 Dec 28 15:29 electron-v1.4.13-linux-x64.zip
-rw-r--r--    1 deepak  staff  41161005 Dec 28 15:31 electron-v1.4.13-mas-x64.zip
-rw-r--r--    1 deepak  staff  44030471 Dec 28 15:27 electron-v1.4.13-win32-ia32.zip
-rw-r--r--    1 deepak  staff  54339658 Dec 28 15:34 electron-v1.4.13-win32-x64.zip
-rw-r--r--    1 deepak  staff  42116998 Jan 11 15:17 electron-v1.4.14-darwin-x64.zip

from forge.

malept avatar malept commented on July 24, 2024

By shared, I mean between different Electron tools. For example (and this is hypothetical), imagine if Electron Packager had a cached file named metadata.json with one JSON data structure and electron-winstaller used the same file name but with a different data structure.

Anyway, you would need to get all of the dependencies of Electron Forge that use cached files to use this cache directory, as necessary. (As you mention, having electron-download do that would be a bad idea.)

from forge.

deepak avatar deepak commented on July 24, 2024

By shared, I mean between different Electron tools. For example (and this is hypothetical), imagine > if Electron Packager had a cached file named metadata.json with one JSON data structure and
electron-winstaller used the same file name but with a different data structure.

agree :-)
can it be namespaced by the name of the tool ?

for example,
the root path is still the project, ie. ~/code/elecron-todo/.electron/cache as per the above example

but electron-packager stores it's temporary files in ~/code/elecron-todo/.electron/cache/electron-packager/metadata.json and electron-winstaller in ~/code/elecron-todo/.electron/cache/electron-winstaller/metadata.json

from forge.

MarshallOfSound avatar MarshallOfSound commented on July 24, 2024

Closing this out until a more definitive spec for a "clean" command can be presented. Currently this is all a bit vague and more of a discussion than a concrete idea for a new command.

from forge.

philcockfield avatar philcockfield commented on July 24, 2024

I'm getting referenced modules not updating - and older versions seem to be cached somewhere in the build.

Seems somewhat related to this. In the absence of the clean method - what folder can I blow away manually to have this start fresh?

Thanks.

from forge.

malept avatar malept commented on July 24, 2024

According to this:

https://github.com/electron-userland/electron-compile/blob/936524356a1868500d3afcf220fe1ad356728fc5/src/config-parser.js#L86

...your app's compiled files (via electron-compile) are in the .cache directory in your app's top-level directory.

from forge.

philcockfield avatar philcockfield commented on July 24, 2024

Oh that's helpful - thanks @malept! I can't see a .cache folder, but now I can see the code, I'll go take a look around and see where it might be putting it. I'm using the typescript variant, so might be putting things somewhere different.

from forge.

danielo515 avatar danielo515 commented on July 24, 2024

I can't see the cache folder and I am not able to find it either.Could you please help me ?

from forge.

malept avatar malept commented on July 24, 2024

The .cache folder (note the leading period) only exists in packaged apps. In dev mode, it's in a temporary directory.

from forge.

danielo515 avatar danielo515 commented on July 24, 2024

My problem is that I am packaging the app and always getting the same icon despite my efforts for changing it. That's why I think it is a cache problem.
I am looking for the cache file including the period, of course, but I don't see to find any. Maybe it is at a different place, or on some random node_modules subfolder, but deleting node_modules does not help either.

from forge.

malept avatar malept commented on July 24, 2024

Which icon are you referring to? If it's the one in your dock/taskbar, that is cached by the OS.

from forge.

danielo515 avatar danielo515 commented on July 24, 2024

I mean the icon on the file explorer (finder on my case) on the osx installation prompt and yes, also in the dock/taskbar (I'm on OSx by the way).
How can the OS cache the icon if I totally destroy the app and rebuild it ? Should I change the code in order to "invalidate" that cache ?

from forge.

malept avatar malept commented on July 24, 2024

I think the icon's keyed to something in the app metadata.

At any rate, this is off-topic for this GitHub issue. If you need more assistance, please use one of the community forums.

from forge.

danielo515 avatar danielo515 commented on July 24, 2024

Thanks malept. I am getting the same icon over and over again and I though it was related with the caching mechanism (if there is any) that is why I was asking here.
I'll take a look into the community forums.
Thanks

from forge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.