Giter Site home page Giter Site logo

starfixdev / starfix Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 21.0 2.79 MB

Utility to easily open and operator on source code via url links from your browser

License: Apache License 2.0

Java 79.88% Shell 2.92% Batchfile 0.69% JavaScript 11.98% CSS 1.05% HTML 2.27% AppleScript 1.21%

starfix's Issues

browser extension

  • A browser extension to embed the "Open in Editor" button on Web Page(Github).
  • should then stimulate the ide-handler which in turn should lead to the starfish app.
  • should be able to register protocol in the browser using navigator.registerProtocolHandler
  • support all modern web browsers(at least chrome and firefox )
  • this will play a very important role in integration web browser responses to desktop apps using prortocol handler as a glue

Build failing on Windows

Hello, I'm new to the project and while running the ./mvnw compile quarkus:dev maven command on Windows 10, the test testEcho() fails when the assertion seems to be satisfied with the same values. Does the assertion want the values to be different? I'm confused.

Please find below the error log:

2023-01-27 22:48:48,036 ERROR [io.qua.test] (Test runner thread) ==================== TEST REPORT #1 ====================
2023-01-27 22:48:48,041 ERROR [io.qua.test] (Test runner thread) Test StarfixTest#testEcho() failed
: org.opentest4j.AssertionFailedError: Echo Random String ==> expected: <This is some random String that I want to Echo

but was: <This is some random String that I want to Echo

    at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
    at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
    at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
    at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1152)
    at dev.starfix.StarfixTest.testEcho(StarfixTest.java:43)

Thanks!

Patch for Windows Installer

  • Move installer->starfix.cmd to installer->Starfix->starfix.cmd
  • I have already resolved this but would create a separate PR after the PR for renaming is merged(merge confic may occur otherwise )

The browser extension doesn't do anything if the default configuration have not been set.

Description

Without initially setting the two Starfix configurable properties:- cloning path and preferred editor, using the starfix config command, the browser extension doesn't actually do anything.

Implementation ideas

Starfix should be first configured. i.e. If you click on the link Open in IDE in the browser, it should open a window to configure your IDE and preferred editor first before going ahead.

Versioning and Changelogs

Setup mechanism for tracking the changelogs(feature updates, bug fixes ) for each release and maintaining it with version history. Would be good if the latest changelog is included in the readme file under a heading like [What's New @v2.1.1]

About Section

  • The About Section of Repository needs to be updated and should probably have a quick summary of Starfix.
  • I don't have privileges to modify the About section so @maxandersen you'll have to do it your self or grant me the privileges .

Config should allow us to change only the IDE.

  • Suppose you just want to modify the preferred IDE but if you open the config it'll ask to enter the preferred cloning path as well.
  • It Should allow to changes the IDE only and retain the clone path present in the config file .
  • This should work either way i.e if we only want to change the preferred cloning path and not the editor .

starfix fails on urls with github line info or any other #argument

starfix https://github.com/hexsum/Mojo-Webqq/blob/master/script/check_dependencies.pl#L17

fails with

 starfix https://github.com/hexsum/Mojo-Webqq/blob/master/script/check_dependencies.pl#L17
java.lang.IllegalArgumentException: Not a valid URI for git repository
	at dev.starfix.Starfix.cloneCmd(Starfix.java:53)
	at dev.starfix.Starfix.run(Starfix.java:131)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1919)
	at picocli.CommandLine.access$1100(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)

shuold not fail optimally open on that line if possible.

docs

  • basic guide
  • help
  • troubleshooting

Support for SSH

  • Currently, the Browser extension generates only an https link for the repository and thus starfish supports only https.
  • To enable support for ssh the Browser extension must give an option to choose between https and ssh and thus generated the respective link accordingly.

Custom Launch Command for IDE

  • Shouldn't starfix support a custom IDE launch command .
  • Currently, while configuring preferred IDE/Editor we display to user a limited set of IDE and ask to chose from them . What if user wants to use some other Ide/editor .
  • We can try to accept custom input from user (Eg user can entercode if he wants to use VSCode) in addition to the existing Ide . Offcourse, then we need to think about the launch command format in that case . For that we can use use a common launch format (ide_name path/to/directory) which is used by most of the Ide/Editor. If there's even more robust solution to this then we could use that too .

Unable to execute config command on the generated Native Binary after merging jbangify PR .

Unable to execute config command on the generated Native Binary after merging the jbagify [PR] (#50) from @maxandersen .
On Screen Logs :

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class dev.starfix.Starfix$Config and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
	at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1277)
	at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4407)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:3602)
	at dev.starfix.Starfix.editConfig(Starfix.java:196)
	at dev.starfix.Starfix.config(Starfix.java:39)
	at java.lang.reflect.Method.invoke(Method.java:566)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1952)
	at picocli.CommandLine.access$1100(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at io.quarkus.picocli.runtime.PicocliRunner$EventExecutionStrategy.execute(PicocliRunner.java:26)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at io.quarkus.picocli.runtime.PicocliRunner.run(PicocliRunner.java:39)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:113)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
	at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:30)

Failed to run Starfix (Native Binary )

I tried to run Starfix Native Binary using : ./starfix (on : macOS Catalina, Version 10.15.7)
It failed to run and gave the following .

./starfix config
2021-08-06 17:26:12,435 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.NoSuchMethodException: dev.starfix.YAMLDefaultProvider.<init>()
   at java.lang.Class.getConstructor0(DynamicHub.java:3349)
   at java.lang.Class.getDeclaredConstructor(DynamicHub.java:2553)
   at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5489)
   at io.quarkus.picocli.runtime.PicocliBeansFactory.create(PicocliBeansFactory.java:16)
   at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5512)
   at picocli.CommandLine$DefaultFactory.createDefaultValueProvider(CommandLine.java:5503)
   at picocli.CommandLine$Model$CommandSpec.initDefaultValueProvider(CommandLine.java:7229)
   at picocli.CommandLine$Model$CommandSpec.updateCommandAttributes(CommandLine.java:7218)
   at picocli.CommandLine$Model$CommandReflection.extractCommandSpec(CommandLine.java:11392)
   at picocli.CommandLine$Model$CommandSpec.forAnnotatedObject(CommandLine.java:6202)
   at picocli.CommandLine.<init>(CommandLine.java:227)
   at picocli.CommandLine.<init>(CommandLine.java:221)
   at io.quarkus.picocli.runtime.DefaultPicocliCommandLineFactory.create(DefaultPicocliCommandLineFactory.java:43)
   at io.quarkus.picocli.runtime.DefaultPicocliCommandLineFactory_ClientProxy.create(DefaultPicocliCommandLineFactory_ClientProxy.zig:155)
   at io.quarkus.picocli.runtime.PicocliCommandLineProducer.picocliCommandLine(PicocliCommandLineProducer.java:23)
   at io.quarkus.picocli.runtime.PicocliCommandLineProducer_ProducerMethod_picocliCommandLine_9215511af8bf79a5b9761758f9829960bca3fec0_Bean.create(PicocliCommandLineProducer_ProducerMethod_picocliCommandLine_9215511af8bf79a5b9761758f9829960bca3fec0_Bean.zig:161)
   at io.quarkus.picocli.runtime.PicocliCommandLineProducer_ProducerMethod_picocliCommandLine_9215511af8bf79a5b9761758f9829960bca3fec0_Bean.get(PicocliCommandLineProducer_ProducerMethod_picocliCommandLine_9215511af8bf79a5b9761758f9829960bca3fec0_Bean.zig:191)
   at io.quarkus.picocli.runtime.PicocliCommandLineProducer_ProducerMethod_picocliCommandLine_9215511af8bf79a5b9761758f9829960bca3fec0_Bean.get(PicocliCommandLineProducer_ProducerMethod_picocliCommandLine_9215511af8bf79a5b9761758f9829960bca3fec0_Bean.zig:226)
   at io.quarkus.picocli.runtime.PicocliRunner_Bean.create(PicocliRunner_Bean.zig:212)
   at io.quarkus.picocli.runtime.PicocliRunner_Bean.get(PicocliRunner_Bean.zig:270)
   at io.quarkus.picocli.runtime.PicocliRunner_Bean.get(PicocliRunner_Bean.zig:305)
   at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:433)
   at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:446)
   at io.quarkus.arc.impl.BeanManagerImpl.getReference(BeanManagerImpl.java:59)
   at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:119)
   at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
   at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
   at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:30)

ide protocol handler

  • A Protocol handler is needed the handles URI of form ide://..
  • The handler should fire up the starfish application with the passed argument.
  • Should Work on all three platforms(windows, macos, and linux)
  • Example:
    ide://https://github.com/user-name/repo.git
    on launching this URI, starfish should launch and it should receive the arguments.

move to use jbang style quarkus cli app

with jbang v0.47 we can now write apps with multiple source files and resources.

starfix is at t he right level of small app that could benefit from this + would give jbang a nice usecase to see what works what does not.

will try collect what we use from maven that we absolutely need and which we can throw away.

expand ide:// protocol to do more than just clone

right now we just have ide://<url to clone>, but would be interesting to have stuff like ide://clone?repo=<url> and ide://open?path=<url-to-file> where open would clone if needed and open the file - if repo already cloned just open the file.

Similar could add things like ide://open?path=<url-to-file>&line=27 to open file and go to line 27.

idea: open stacktrace links

Imagine the following:

you run an app or build in your terminal, ie. mvn package and an error occurs and a stacktrace is shown.

Exception in thread "main" java.lang.NoClassDefFoundError: com/atlassian/fugue/Effect
        at com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClientFactory.doCreate(DefaultHttpClientFactory.java:68)
        at com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClientFactory.create(DefaultHttpClientFactory.java:35)
        at com.atlassian.jira.rest.client.internal.async.AsynchronousHttpClientFactory.createClient(AsynchronousHttpClientFactory.java:63)

now in iterm2 you can actually setup regular expression to turn these stacktraces into hyperlinks.

would be interesting if we could support something like:

ide://open-stack-trace?stackline="com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClientFactory.doCreate(DefaultHttpClientFactory.java:68)"

which would tell the IDE to search for DefaultHttpClientFactory.java and open it on line 68.

Not all editors would support this but at least eclipse, netbeans and vscode should technically be capable of doing it.

Adding URI registry in windows from java

To create URI registry in windows we can create a starfish.reg file and run 'reg import starfish.reg' from cmd but it requires administrator rights
we can run following code from java program
Runtime.getRuntime().exec("reg import starfish.reg");
but it failed
I've tried multiple methods as
https://serverfault.com/questions/427368/command-line-switch-to-administrator-mode
https://superuser.com/questions/694761/how-to-run-cmd-with-admin-privileges-using-command-line
but failed

Add Tests

  • for testing file name with spaces
  • verifying url pattern for blobs

error installing starfix in linux

Hi, I am Ajeet and I have been looking around in order to install this Starfix tool as I find it very useful to clone and open a GitHub repo in a single command.

I read the installation instruction for Linux but I can't find the starfix-linux.zip file anywhere to download. I found the install file that was mentioned in the instructions inside /starfix/cli/installer/linux/installer/ . I executed the ./install command and it shows the error:-

Screenshot_2021-07-14_18-22-49

I also want to contribute to this project, and this will be my first open-source contribution so forgive me if there is any format mistake in creating the issues. Any guideline tips for contributing would help me a lot.

Regards,
Ajeet.

starfix logs too much and gives no info on help etc.

output of runner is:

./target/starfix-1.0.0-SNAPSHOT-runner
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2020-08-15 22:48:51,912 INFO  [io.quarkus] (main) starfix 1.0.0-SNAPSHOT (powered by Quarkus 1.4.2.Final) started in 0.008s.
2020-08-15 22:48:51,912 INFO  [io.quarkus] (main) Profile prod activated.
2020-08-15 22:48:51,912 INFO  [io.quarkus] (main) Installed features: [cdi]
No input provided!!
2020-08-15 22:48:51,912 INFO  [io.quarkus] (main) starfix stopped in 0.000s

it should just be like a cli - thus need to turn of the logging and instead of No input provided!! give a standard cli help output, something similar to:

Usage: starfix ...
Opens your file and project in any ide/editor.
  -h, --help       Display help/info
Commands: 
  ...
  ...

can use picocli to make this happen automatically.

.config missing on windows.

  • The .conifg directory we are using to store starfix configs (.config/starfix.yaml) may not be present on windows.
  • On installing starfix on windows and running starfix config I got the following:
 -New  configuration file will be created at: C:\Users\fahad\.config\starfix.yaml

java.io.IOException: The system cannot find the path specified
        at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST:Ljava_io_IOException_2_0002e_0003cinit_0003e_00028Ljava_lang_String_2_00029V(JNIJavaCallWrappers.java:0)
        at java.io.WinNTFileSystem.createFileExclusively(WinNTFileSystem.java)
        at java.io.File.createNewFile(File.java:1026)
        at dev.starfix.Starfix.editConfig(Starfix.java:154)
        at dev.starfix.Starfix.config(Starfix.java:52)
        at java.lang.reflect.Method.invoke(Method.java:566)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1972)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at io.quarkus.picocli.runtime.PicocliRunner$EventExecutionStrategy.execute(PicocliRunner.java:26)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at io.quarkus.picocli.runtime.PicocliRunner.run(PicocliRunner.java:39)
        at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:123)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
        at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:30)
  • The simplest solution is to create .config directory if not exist while creating config .

Installation failed in windows.

I followed the steps, but its not working, when i am typing starfix on command promt, its showing 'starfix' is not recognized as an internal or external command.

Setup release mechanism to Homebrew/Sdkman after a stable release

  • After starfix is working fine and we've made a stable release, we can make it avialable via HomeBrew/Sdkman.
    Quoting a conversation with @maxandersen for future references :

> once that is in place use of jreleaser which makes such publishing easily can be explored.
> one challenge is ensuring the url protocol handler gets configured so sdkman might not be able to do that. would need exploration.

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.