Skip to content

Commit

Permalink
Merge pull request #31 from catalystneuro/refactor/fix-build-issues
Browse files Browse the repository at this point in the history
Refactor/fix build issues
  • Loading branch information
nathan-vm authored Jul 12, 2024
2 parents 226d36a + f320932 commit 93a3d30
Show file tree
Hide file tree
Showing 160 changed files with 8,058 additions and 68,756 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
out
.gitignore
19 changes: 5 additions & 14 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'@electron-toolkit/eslint-config-ts/recommended',
'@electron-toolkit/eslint-config-prettier'
]
}
29 changes: 16 additions & 13 deletions .github/workflows/Build-and-deploy-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ name: Build and Deploy — Linux
run-name: ${{ github.actor }} is building a Linux release

on:
# push:
# branches: ["latest"]

workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: write
actions: write
contents: write
packages: write

jobs:
deploy-on-linux:
Expand All @@ -23,22 +27,21 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"

- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: vame-desktop
environment-file: environment.yml
auto-activate-base: false
- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"

- name: Install dependencies
run: npm install

- name: Build and deploy on Linux
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run build -- --publish
run: npm run build:linux -- --publish=onTagOrDraft
26 changes: 14 additions & 12 deletions .github/workflows/Build-and-deploy-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ run-name: ${{ github.actor }} is building a Mac release

on:
push:
branches: ["latest"]

workflow_dispatch:

branches:
- main
pull_request:
branches:
- main

permissions:
contents: write
actions: write
contents: write
packages: write

jobs:
deploy-on-mac:
Expand All @@ -24,13 +27,12 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"

- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: vame-desktop
environment-file: environment.yml
auto-activate-base: false
- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- uses: actions/setup-node@v4
with:
Expand All @@ -50,4 +52,4 @@ jobs:
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_ID_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
run: npm run build -- --publish
run: npm run build:mac -- --publish=onTagOrDraft
27 changes: 15 additions & 12 deletions .github/workflows/Build-and-deploy-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ run-name: ${{ github.actor }} is building a Windows release

on:
push:
branches: ["latest"]

workflow_dispatch:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: write
actions: write
contents: write
packages: write

jobs:
deploy-on-windows:
Expand All @@ -23,22 +27,21 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"

- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: vame-desktop
environment-file: environment.yml
auto-activate-base: false
- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"

- name: Install dependencies
run: npm install

- name: Build and deploy on Windows
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run build -- --publish
run: npm run build:win -- --publish=onTagOrDraft
11 changes: 4 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
venv/*

# Demo
demo_output
data/*.mp4

# Python
venv
__pycache__

# Commoners Output
.commoners

# Python Service Output
build
*.spec
resources/python/build
resources/python/main

# Logs
logs
Expand All @@ -25,6 +21,7 @@ lerna-debug.log*

node_modules
dist
out
dist-ssr
*.local

Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
electron_mirror=https://npmmirror.com/mirrors/electron/
electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
out
dist
pnpm-lock.yaml
LICENSE.md
tsconfig.json
tsconfig.*.json
4 changes: 4 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
singleQuote: true
semi: false
printWidth: 100
trailingComma: none
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11.9
58 changes: 51 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
# VAME Desktop
A desktop application for the Variational Animal Motion Encoding (VAME) project.

> **Note:** VAME Desktop has been built on [commoners](http://github.com/neuralinterfaces/commoners) for distribution as a cross-platform desktop application. However, the project is still in development and is not yet ready for distribution. **You will need to follow the local installation instructions below to run the app.**
## Overview
VAME Desktop has been designed to run each step of a VAME project **only once**. This is to ensure that the project is reproducible and that the data is not accidentally overwritten.


## Installation
### Python
You will need to have [miniconda](https://docs.conda.io/en/latest/miniconda.html) installed on your machine.
You will need to have [miniconda](https://docs.conda.io/en/latest/miniconda.html) installed on your machine OR [pyenv](https://github.com/pyenv/pyenv).

#### with pyenv:

```bash
pyenv local
```

```bash
python -m venv venv
```

Unix system (linux or macos):
```bash
source ./venv/bin/activate
```

Windows:
```sh
.\venv\Scripts\activate.bat
```

This will install all the necessary Python dependencies for the project.

```bash
python -m pip install -r requiremente.txt
```

#### with conda:
Create the Conda environment for the project by running the following command:

```bash
Expand All @@ -24,7 +48,8 @@ conda activate vame-desktop
```

### Node.js
You will need to have [Node.js](https://nodejs.org/en/) installed on your machine.
You will need to have [Node.js 20](https://nodejs.org/en/) installed on your machine.
You also can use [nvm](https://github.com/nvm-sh/nvm) or [n](https://github.com/tj/n) to select versions.

Install Node modules by running the following command:
```bash
Expand All @@ -36,7 +61,26 @@ This only needs to be run once at project initialization and when the `package.j
## Running the App
To run the app, you will need to run the following command:
```bash
npm run start
npm run dev
```

This will start the Electron app.
This will start the Electron app on developer mode.

## Build:

The build process will create a `.exe`, `.dmg` or `.deb` depend on OS. Run differents command on incompatible OS will result on error.

MacOS
```bash
npm run build:mac
```

Windows
```bash
npm run build:win
```

Linux Debian
```bash
npm run build:linux
```
67 changes: 0 additions & 67 deletions commoners.config.ts

This file was deleted.

Loading

0 comments on commit 93a3d30

Please sign in to comment.