-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: typescript definition & allow mainPath opt. #79
feat: typescript definition & allow mainPath opt. #79
Conversation
…ainFile-option feat: typescript definition & allow mainPath opt.
fix: fix imports and installation
Thanks for this PR. TS has been a very popular requested feature! Yet, as I lack experience with TS, it might take me some time to have it merged. |
This release fixes the following issues: fixes: yan-foto#65 fixes: yan-foto#61
This release fixes: fixes: yan-foto#65 & fixes: yan-foto#61
I think if you don't want to use typescript but want to have a typescript compatibility. You must have a type declaration file See PR #84 for generating the declaration file only. |
@josheleonard I would prefer this solution and would really appreciate if you or @mackignacio could update this PR respectively. This way we also don't need a major update and a minor one would suffice. I suppose the best way is to generate the types on the fly using npm's
Its not a good idea to have two PRs doing the same thing! |
Also reversed args for hard reset handler - allows file-argument to be passed to electron in the correct order - usecase: opening file in electron app from cli fixes: yan-foto#65 & fixes: yan-foto#61
This version fixes the following issues: fixes: yan-foto#65 & fixes: yan-foto#61
@yan-foto @mackignacio See my latest commits top this PR. I have implemented my changes using @mackignacio 's PR as reference. I also swapped the concat order of the hard reset handler since files are typically the last launch argument when opening files to an electron app from cli. My use case for this is I have an app that is a file viewer, and can be opened by cli and passing in a file path to open/view. |
This suppresses ts errors about the declaration file. This release fixes: fixes: yan-foto#65 & fixes: yan-foto#61
fixes: yan-foto#65 & fixes: yan-foto#61
@josheleonard sorry for the delayed review. These times are some tough times for me 🤕 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments, feel free to give feedback, correct or contradict me.
package.json
Outdated
"lint:fix": "standard --fix" | ||
"lint": "./node_modules/.bin/standard", | ||
"lint:fix": "./node_modules/.bin/standard --fix", | ||
"build": "./node_modules/.bin/rimraf main.d.ts && npm run lint:fix && ./node_modules/.bin/tsc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove rimraf
please (see bellow). I suppose tsc
would overwrite the file and if not there is surely a flag to do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually tsc will not overwrite the .d.ts
as seen in this discussion microsoft/TypeScript#16749 . That is why I think he added the rimraf commands.
@yan-foto you can check my other PR for just adding declaration. It is simple and easy to implement. Also this PR tackles 2 issue. We can focus on the other issue with this PR and resolve the issue for typescript in my PR #84 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it to work without rimraf by adding the .d.ts to the exclude
rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you guys should work together. As might have already figured out, I am running very low on spare time so it's not feasible for me to attend similar PRs at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yan-foto Is the anything else you want changed? If so, @mackignacio do you want me to add you as a collaborator for my branch? I need to have #61 fixed so I can code my "main" file in typescript, then point the "mainFile" to my compiled .js file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josheleonard do you still need help for issue #61?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mackignacio #61 should be fixed, feel free to commit any changes you feel are needed.
also remove `rimraf` as it is no longer needed
@yan-foto The requested changes have been pushed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See latest commit for changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a minor change is withstanding. Otherwise we're ready to merge!
Sorry for late reviews/replies. I only have very limited time on weekends to take care of my private stuff (this project being one of them!). I really appreciate your patience and engagement. 🥇 |
fixes: yan-foto#65 & fixes: yan-foto#61
New changes are up :) |
fixes: yan-foto#65 & fixes: yan-foto#61
Any updates on this? |
@eugene-sh This PR is awaiting review. |
I think this library is not active anymore. We need a library that is more active that can be updated. Many users are needing this typescript support but this PR takes a long time to review. |
Feel free to use alternatives. Both this PR and those provided by you (#64 / #84) do not pass the quality assurance; for details see the comments. |
fixes: #65
&
fixes: #61
&
fixes: #87
This PR converts the project to use TypeScript and exposes the type definitions to consumers.
This also adds the
mainFile
property to theoptions
argument, allowing apps to declare which "main" file they would like to watch.appArgv
option added to allow sending custom launch arguments to your appelectronArgv
option added to pass launch arguments directly to electronmainFile
,appArgv
, &electronArgv
options usage example: