Skip to content

Commit

Permalink
Convert to lerna monorepo (#485)
Browse files Browse the repository at this point in the history
* Migrate app, ui, and core to lerna-managed monorepo

* Import packagesfrom the monorepo insteadof published ones

* Re-export package contents; webpack loaders

* Working monorepo config

* Working prod config for webpack

* lerna in docker

* Update packages, add missing storybook files

* Rebuild binaries inside the container

* Test setup, some useful scripts

* Storybook setup for ui

* Fix ui and storybook exports/imports

* Update storybook

* Update readme; add build scripts

* Make all tests pass in all packages

* Update actions setup

* Update eslint packages

* Add babel-eslint

* Add postinstall bootstrap

* Tweak build instructions

* Don't use npm ci

* Never use CRLF

* Remove boxicons dependency, add multiple platforms to github action

* Use bash in all environments

* Resolve ui path with node
  • Loading branch information
nukeop authored Sep 30, 2019
1 parent c6f8c92 commit 36241de
Show file tree
Hide file tree
Showing 524 changed files with 3,275 additions and 287 deletions.
11 changes: 0 additions & 11 deletions .babelrc

This file was deleted.

8 changes: 6 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
},
"globals": {
"process": true,
"Raven": true
"Raven": true,
"_": true
},
"extends": ["eslint:recommended", "plugin:node/recommended"],
"parser": "babel-eslint",
Expand Down Expand Up @@ -99,6 +100,9 @@ module.exports = {
"node/no-unpublished-require": 0,
"node/no-unsupported-features/es-syntax": 0,
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
"react-hooks/exhaustive-deps": "warn",

// Node
"node/no-unpublished-import": 0
}
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# never EVER use CRLF, Windows
* text eol=lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ on: [push]
jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@master
Expand All @@ -17,8 +20,7 @@ jobs:
run: |
npm install
npm test
npm run build:dist
npm run build:electron:linux
npm run build:linux
env:
npm run build
shell: bash
env:
GITHASH: ${GITHUB_SHA}
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ before_install:
- if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install libdbus-1-dev -y; fi

script:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then npm test && npm run build:dist && npm run build:electron:linux && npm run build:linux; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then npm test && npm run build:dist:windows && npm run build:electron && npm run build:windows; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then npm test && npm run build:dist && npm run build:electron && npm run build:macos; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then npm test && npm run build; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then npm test && npm run build:win; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then npm test && npm run build; fi


cache:
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM node

RUN apt-get update && apt-get install -y libnss3 libgtk-3-0 libx11-xcb1 libxss1 libasound2
RUN npm install -g lerna

RUN mkdir -p /nuclear
WORKDIR /nuclear
Expand Down
43 changes: 17 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ See [this](docs/electron.md).
- List of favorite tracks
- Listening from local library

## Manual and docs
https://nuclearmusic.rtfd.io/

## Community-maintained packages

Here's a list of packages maintained by third parties. We would like to thank the maintainers for their work.

We do not control these and cannot be held responsible for their contents, but if any of these appear suspicious to you, feel free to open an issue so we can reach out to the maintainers.

| Package type | Link | Maintainer |
|:------------:|:------------------------------------------------------:|:---------------------------------------------:|
| AUR (Arch) | https://aur.archlinux.org/packages/nuclear-player-bin/ | [mikelpint](https://github.com/mikelpint) |
| Choco (Win) | https://chocolatey.org/packages/nuclear/ | [JourneyOver](https://github.com/JourneyOver) |

## Community translations
Nuclear has already been translated to several languages, and we're always looking for contributors who would like to add more. Below is a list of currently available languages, along with contributors who helped to translate Nuclear to that language.

Expand All @@ -57,20 +71,6 @@ Nuclear has already been translated to several languages, and we're always looki
| Turkish | [3DShark](https://github.com/3DShark) |
| Italian | [gello94](https://github.com/gello94) |

## Manual and docs
https://nuclearmusic.rtfd.io/

## Community-maintained packages

Here's a list of packages maintained by third parties. We would like to thank the maintainers for their work.

We do not control these and cannot be held responsible for their contents, but if any of these appear suspicious to you, feel free to open an issue so we can reach out to the maintainers.

| Package type | Link | Maintainer |
|:------------:|:------------------------------------------------------:|:---------------------------------------------:|
| AUR (Arch) | https://aur.archlinux.org/packages/nuclear-player-bin/ | [mikelpint](https://github.com/mikelpint) |
| Choco (Win) | https://chocolatey.org/packages/nuclear/ | [JourneyOver](https://github.com/JourneyOver) |

## Screenshots
This will be updated as the program evolves.

Expand Down Expand Up @@ -101,24 +101,15 @@ $ sudo docker-compose up dev

A new window should open that will load the web app and run Nuclear.

---
To run production version:

```bash
$ npm run build:dist
$ npm run electron:prod
```
---
To build for current operating system:
```bash
$ npm run build:dist
$ npm run build:electron
$ npm run pack
$ npm run build
```

Instead of `pack` you can use `build:all` to build for all operating systems or `build:[system]` to build for a particular system (see package.json).
Instead of `build` you can use `build:all` to build for all operating systems. The binaries will be in `packages/app/release`

In case of errors with dbus/mpris, try removing optional dependencies from package.json and node_modules.
In case of errors with dbus/mpris, try removing optional dependencies from `packages/app/package.json` and node_modules.

## License

Expand Down
11 changes: 6 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ services:
dockerfile: ./Dockerfile.dev
volumes:
- .:/nuclear
working_dir: /nuclear
command: bash -xc "
cd /nuclear;
npm install "
lerna bootstrap"

dev:
build:
Expand All @@ -20,10 +20,11 @@ services:
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- .:/nuclear
working_dir: /nuclear
command: bash -xc "
cd /nuclear;
npm install;
npm start "
lerna bootstrap;
lerna exec npm rebuild node-sass;
lerna run start "
devices:
- "/dev/snd"
environment:
Expand Down
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "0.0.0"
}
Loading

0 comments on commit 36241de

Please sign in to comment.