Develop and Debug Atom Package - atom-editor

I have just began working on Atom.io Package development, and based on this tutorial, have learnt from how to create package development skelton file to how to publish your package.
However, I do not know how to check/debug/develop your package. I know I can use Jasmine via alt-cmd-I or Developer Console (for Atom is based on Chromium), still if you want to check the behavior of your package, do I have to re-publish or install your package manually every time?

When working on packages locally, here's the recommended workflow:
Clone your package from GitHub using apm develop <package-name>. This will clone the package's repo to your local ~/.atom/dev/packages/<package-name>
cd into this directory
Start Atom in this directory using atom -d .
Now you can work on the package, make changes, etc. Once you're ready to reload, you can use View > Developer > Reload Window to restart Atom with the changed package.
If you have your package sources locally on your machine, you can skip the first step (apm develop) and simply create a symbolic link from your sources to ~/.atom/dev/packages/<package-name.

Already have a local repo of the package?
To add to nwinkler's answer, if you already have a repo of the package locally, you can use
apm link --dev
to automatically create a symbolic link to the ~/.atom/dev/packages/ directory.
Make sure to completely restart atom in developer mode with
atom -d
or in View > Developer > Open In Dev Mode...
If you just want to use a local package (not in dev mode), you can use apm link directly. And apm unlink to remove the symbolic link to ~/.atom/packages.

Related

NuGet install tools package in Docker Apline

I am trying to install a NuGet tools package inside an Alpine Docker container.
In Windows I would do the following -
nuget install SomeToolPackage
Doing so would result in a new set of directories like -
tools\netcoreapp2.1\SomeTool.dll
tools\netcoreapp2.1\* many other files
Question
What is the equivalent in for Linux. I am aware that some people are using Mono to run the Windows nuget.exe file.
I can also use wget and unzip.
I hope there is a better way using the tools from Microsoft.
The path going forward is to use dotnet tools (see also dotnet core global tools overview and creating a global tool). However, it's not a 1:1 mapping with nuget.exe install, as the package must be authored as a tool, whereas nuget install allows you to "install" any package.

How To modify quantmod package with GIT

I currently have quantmod installed. I would like to modify the source code.
Do I need to uninstall the current version?
I currently was trying
(1) Installed GIT
(2) then I went to New Project>> Version Control >>create a new project form version control GIT and when I click that I get this error
"Git was not detected in the system path. to create projects from GIT repositories you should install GIT and then restart Rstudio. Not tha tif GIT is installed an not on the path then you can specify its location using the options dialog."
(3) So I went to the global options>>GIT/SVN>>Git executable and put this path
C:\Users\me\AppData\Local\Programs\Git\bin\git.exe
(4) then I restarted RSTUDIO and now I get further so when I go to
New Project>> Version Control >>create a new project form version control GIT>>CLONE GIT REPISITORY
Here it asks for a Repository URL, Project Directory name, and Create project as subdirectory of. Here is where I am unsure where I need to put this project so that the modification I make to the quantmod package will be picked up by my version of R
For Repository URL I was going ot put:
https://github.com/joshuaulrich/quantmod
For Project Directory I am unsure: can you advise??
For Create project as sub directory I am unsure: can you advise??
My R libraries are here: C:\Users\me\Documents\R-3.1.2\library
Also currently I have quantmod installed here:
C:\Users\me\Documents\R-3.1.2\library\quantmod
Do I need to uninstall that current version?
Appendix:
On My computer GIT is here: C:\Users\Me\AppData\Local\Programs\Git
On My computer R is here: C:\Users\Me\Documents\R-3.1.2
The project directory is just the name of the folder you will be putting the repo inside. Generally it is the name of package to make things clear. In your case quantmod.
The sub directory you can ignore unless you want to choose some other location (besides the current directory) for you code.
You don't need to uninstall the current version. My usual recommendation is to just increment the subversion of the package in the DESCRIPTION file. For example, increment:
Version: 1.0.1
to
Version: 1.0.2
Now when you rebuild and install you will have the new version. If you need the original again, you can just reinstall the old one (i.e. install.packages). Having both installed at the same time would likely result in conflicts between the packages and just causing a headache.

How to edit core files in Atom Editor

I want to edit the tree-view package in Atom. I want to add a new item to the context menu. But i can't file where are the files. I can open the config folder and I can see all the community packages I have installed, but where do I find the core files of the editor?
They are packed inside the app.asar file. This file is located at the following location in the OS X version.
Atom.app/Contents/Resources/app.asar
This file is generated by this build script.
Of course, this package is open-source, so you can view the code for tree-view on GitHub.
GitHub also has some documentation for developing on official Atom packages.
The first step is creating your own clone.
For example, if you want to make changes to the tree-view package,
fork the repo on your github account, then clone it:
> git clone git#github.com:your-username/tree-view.git
Next install all the dependencies:
> cd tree-view
> apm install
Installing modules ✓
Now you can link it to development mode so when you run an Atom window
with atom --dev, you will use your fork instead of the built in
package:
> apm link -d
Also, if all you want to do is add another menu item, I wouldn't be surprised if there is an API for doing so from another plugin.

Install R package from Atlassian Stash

I made an R package which is hosted on my employer's instance of Atlassian Stash. I have been telling other users to clone the repo and then use devtools::install("<path-to-repo>") to install the package.
How can I have users install the package without cloning the repository? Can I do this without hosting the code somewhere more accessible?
Using this solution as a starting point, I discovered that you can use devtools with a Stash ssh url:
devtools::install_git("ssh://git#stash.yourdomain.com:1234/project/repo.git")
That will install from the latest commit on the master branch. You can also install a specific branch:
devtools::install_git("ssh://git#stash.yourdomain.com:1234/project/repo.git", branch="develop")
or tag:
devtools::install_git("ssh://git#stash.yourdomain.com:1234/project/repo.git", branch="v1.0")
(note you don't need the tags/ prefix when using a tag)
This will only work if you have SSH keys for your machine on your Stash account. Using the http clone url will not work, because you can't authenticate properly.

RStudio project and git repository in subdirectory

When developing packages in RStudio.
By default RStudio assume your package directory is the project directory and it looks like that:
But you are allowed to point the package location to a subdirectory of the project directory and it looks like that:
This way you can have some part of your project files, kept in the root project directory, not included in the package. You don't need to set git ignore etc.
But if you want to add RStudio git repo features, you are not allowed to point your git repo in subdirectory, even if you have already created git repo in your package dir (not project dir) you cannot set it in RStudio. I'm stuck at:
Is there any way to enable git repo features in RStudio having git repository in the subdirectory of the RStudio project? Maybe some .Rproj config tweaks?
Very good question. I've experienced the same trouble and it also does not go away with the latest pre-test release. So there's likely no super quick solution to this inside rstudio. Though it might be worth a feature request.
Personally I use the console / git bash with git and rstudio. That is I create a project inside R studio and manually run git init outside rstudio. Also I add, commit, merge, push and pull outside rstudio. If you don't like to manage git via console there's https://windows.github.com/ and https://mac.github.com/ also the folks at Atlassian provide some GUI tool called source tree: https://www.atlassian.com/software/sourcetree/overview
Plus there are many others, like Tortoise Git which I haven't tested, but I think R Studio's current git support is fine for simple things, but a git tool (console or gui) is definitely the way to go if you want to be more flexible.
That being said, sublime text edit is a powerful and easy to hack and customizable text editor which also has quite some packages to extend it. It's not entirely free but sometimes it's a nice supplement to rstudio. And it has a cool resolve conflict package etc.

Resources