Comments (4)
Actually it looks like the package.json
file is what is missing. Can you confirm that your package.json is actually inside of the pakcage that's uploaded to npm?
What is the name of the plugin?
from electron-plugins.
i am working on it in my developer enviroment so is not on npm yet, could this be an issue?. The behaviour is:
- It works if all is under the root:
- if i move my index.html and index.js to another folder to give structure to my project, it fails to find the root package.json, as it expect it to be at the same folder level
Please find the code taged here
If I add a second package.json containing only name and plugins, it will actually overcome the issue. but I dont know if this is the expected bahaviour,
from electron-plugins.
I see what you're saying. Yeah this line:
https://github.com/EvolveLabs/electron-plugins/blob/master/index.js#L69
It will use the dir of the root module of the current process, I would have thought that would always be the same level as the app root but I haven't really tried it.
I guess what I would recommend is putting index.html
, index.js
and main.js
all in the root directory. I would also recommend renaming src
to lib
. By convention src
is reserved for native code for nodejs modules.
Also, if you know of a fix for this issue I'd be happy to accept it. The trick is finding out where the root directory of the main app is.
I suppose it should be using this api instead really:
app.getAppPath()
from electron-plugins.
thanks for the answer, actually that is what i have end up doing. Probably it will be a nice to have till anyone can work on this, on the readme.md have a section similar to the one in the electron-updater to have a reference to this small threads that relates to behaviours.
My personal opinion is that it should be recursively go backwards from the current directory to the app directory. I will explain myself, imagine the next project structure:
+root
package.json
+lib
+controls
package.json
+themes
package.json
+data
package.json
I can see the power of handling at a certain directory level. You could handle quite different type of plugins without actually have to test them. Does this make sense?. But again I will defend the recursive case because if you have only one type of plugins, most probably you want to consolidate having just a package.json.
I will definetly give a deeper look on the code soon, and if i find a good solution I will do a pull request.
PS. thanks the tips, i have been working in a few diferent languages and i still need to get used to the conventions for javascript.
from electron-plugins.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-plugins.