Showing posts with label burn. Show all posts
Showing posts with label burn. Show all posts

Wednesday, January 01, 2020

Nested Git repository support for Atom editor

Our 200 repository project for Chef consist of many nested repositories (one 'base' repo with essentials, which in turn contains 'cookbooks'). This was quite big frustration and super-inconvenient to use editors neither of which were supporting nested Git repos in full. Atom has in general good Chef support (via extensions), but nested Git repositories still not supported (at least by the time this article is written).

This is especially frustrating when several cookbooks modified and there are no indicators of what's already committed, what files were touched added, removed or modified in the end.

So, I've modified 'tree-view' component - one of core components Atom has, which is responsible for showing directory view on the left, so that now it shows statuses of all nested repositories (no matter how deep nesting is) giving good overview on the changes being made.

Here is example how it looks:

repo_highlights


Unfortunately Atom maintainers in the end closed suggested Pull Request -
https://github.com/atom/tree-view/pull/469

Reasoning is unclear and vague.
However, I've made release of tree-view from own fork.

Notes:

Works quite well even with >200 nested .git repos, though with some minor limitations:
  1. If there are a lot of nested. git repos then start-up time might noticeably increase(with ~200 repos it was 10 sec). The reason is that GitRepository object seems to be not fully async while refreshing status.
  2. Status refresh of GitRepositry objects on window_focus event is disabled, so if repos changed out of the Atom it might reflect wrong status. But there is option (right-click or assign shortcut) to force-refresh status of a subtree (recursively) or specific repo.

    or via command palette.



Download tree-view:
https://github.com/jarig/tree-view/releases/download/0.228.0-jarig/tree-view.zip

Installation instructions:
  • Unpack contents to ~\.atom\packages\tree-view
    (on windows C:\Users\[username]\.atom\packages\tree-view)
  • Re-open Atom
Atom might show bug icon in the status bar, asking to rebuild packages - do that in this case and tree-view will appear after Atom reload (ctrl+k to toggle tree-view back).




Verified to be working with Atom version 1.42.0


Monday, December 23, 2019

Vue + Electron + TypeORM, nice combo with small tricks


Found very neat combination of modern technologies that makes cross-platform desktop app development much easier:
- VueJS
- Electron
- TypeORM

VueJS actually has tutorial for creation of simple project, quick steps are:

$ npm install -g @vue/cli @vue/cli-init
$ vue init simulatedgreg/electron-vue test-electron-app

However, once I combined all of that together couldn't make TypeORM to work as it appeared it does mocking if thinks it works in 'browser' mode and disables all its drivers.

Symptom of this is the following error:

TypeError: this.driver.connect is not a function

Spent few days on that, and eventually found resolution. You need to change vue.config.js (which is webpack representative for Vue) and mark typeorm + whatever driver package you use as externals in this way -

  "transpileDependencies": [
    "vuetify"
  ],
  configureWebpack: config => {
    config.externals = {
      typeorm: "require('typeorm')",
      mysql: "require('mysql')"
    }
  }
}

After that all those packages combined will work as expected, giving you all flexbility of Vue, cross-platform and desktop support of Electron as well as powerful ORM with whatever database you've.