From 36241dea246f6ca78f1b89ce3b79f228a90daac5 Mon Sep 17 00:00:00 2001 From: nukeop <12746779+nukeop@users.noreply.github.com> Date: Mon, 30 Sep 2019 12:44:38 +0200 Subject: [PATCH] Convert to lerna monorepo (#485) * 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 --- .babelrc | 11 - .eslintrc.js | 8 +- .gitattributes | 2 + .../workflows/{build-linux.yml => build.yml} | 12 +- .travis.yml | 6 +- Dockerfile.dev | 1 + README.md | 43 +- docker-compose.yml | 11 +- lerna.json | 6 + package.json | 224 +----- packages/app/README.md | 11 + {app => packages/app/app}/App.js | 12 +- .../app/app}/actions/dashboard.js | 2 +- .../app/app}/actions/downloads.js | 0 .../app/app}/actions/equalizer.js | 0 .../app/app}/actions/favorites.js | 0 {app => packages/app/app}/actions/github.js | 0 {app => packages/app/app}/actions/helpers.js | 0 {app => packages/app/app}/actions/index.js | 2 +- {app => packages/app/app}/actions/local.js | 0 {app => packages/app/app}/actions/lyrics.js | 0 {app => packages/app/app}/actions/player.js | 0 .../app/app}/actions/playlists.injectable.js | 0 .../app/app}/actions/playlists.js | 0 {app => packages/app/app}/actions/plugins.js | 0 {app => packages/app/app}/actions/queue.js | 0 .../app/app}/actions/scrobbling.js | 2 +- {app => packages/app/app}/actions/settings.js | 0 {app => packages/app/app}/actions/tag.js | 2 +- {app => packages/app/app}/actions/toasts.js | 0 {app => packages/app/app}/app.global.scss | 0 {app => packages/app/app}/compact.scss | 0 .../components/AlbumCover/AlbumInfo/index.js | 0 .../AlbumCover/AlbumInfo/styles.css | 0 .../AlbumCover/AlbumOverlay/index.js | 0 .../AlbumCover/AlbumOverlay/styles.css | 0 .../app/app}/components/AlbumCover/index.js | 0 .../app/app}/components/AlbumCover/styles.css | 0 .../app/app}/components/AlbumList/index.js | 0 .../app/app}/components/AlbumList/styles.scss | 0 .../app/app}/components/AlbumView/index.js | 0 .../app/app}/components/AlbumView/styles.scss | 0 .../components/ArtistView/ArtistTags/index.js | 0 .../ArtistView/ArtistTags/styles.scss | 0 .../ArtistView/PopularTracks/index.js | 0 .../ArtistView/PopularTracks/styles.scss | 0 .../ArtistView/SimilarArtists/index.js | 0 .../ArtistView/SimilarArtists/styles.scss | 0 .../app/app}/components/ArtistView/index.js | 0 .../app}/components/ArtistView/styles.scss | 0 .../app/app}/components/Card/index.js | 0 .../app/app}/components/Card/styles.scss | 0 .../ContextPopup/PopupButton/index.js | 0 .../ContextPopup/PopupButton/styles.scss | 0 .../app/app}/components/ContextPopup/index.js | 0 .../app}/components/ContextPopup/styles.scss | 0 .../app/app}/components/Cover/index.js | 0 .../app/app}/components/Cover/styles.scss | 0 .../BestNewMusicContent/index.js | 0 .../BestNewMusicContent/styles.scss | 0 .../BestNewMusicCard/index.js | 0 .../BestNewMusicCard/styles.scss | 0 .../BestNewMusicTab/BestNewMusicMenu/index.js | 0 .../BestNewMusicMenu/styles.scss | 0 .../Dashboard/BestNewMusicTab/index.js | 0 .../Dashboard/BestNewMusicTab/styles.scss | 0 .../components/Dashboard/ChartsTab/index.js | 0 .../Dashboard/ChartsTab/styles.scss | 0 .../components/Dashboard/GenresTab/index.js | 0 .../Dashboard/GenresTab/mapGenres.js | 0 .../Dashboard/GenresTab/styles.scss | 0 .../Dashboard/NewsTab/NewsItem/index.js | 0 .../Dashboard/NewsTab/NewsItem/styles.scss | 0 .../components/Dashboard/NewsTab/index.js | 0 .../components/Dashboard/NewsTab/styles.scss | 0 .../app/app}/components/Dashboard/index.js | 0 .../app/app}/components/Dashboard/styles.scss | 0 .../Downloads/DownloadsHeader/index.js | 0 .../Downloads/DownloadsHeader/styles.scss | 0 .../Downloads/DownloadsItem/index.js | 0 .../Downloads/DownloadsItem/styles.scss | 0 .../Downloads/DownloadsList/index.js | 0 .../Downloads/DownloadsList/styles.scss | 0 .../app/app}/components/Downloads/index.js | 0 .../app/app}/components/Downloads/styles.scss | 0 .../app}/components/Equalizer/PreAmp/index.js | 0 .../components/Equalizer/PreAmp/index.scss | 0 .../app/app}/components/Equalizer/chart.js | 0 .../app/app}/components/Equalizer/index.js | 0 .../app/app}/components/Equalizer/styles.scss | 0 .../components/EqualizerPresetList/index.js | 0 .../EqualizerPresetList/styles.scss | 0 .../components/FavoriteAlbumsView/index.js | 0 .../components/FavoriteAlbumsView/styles.scss | 0 .../components/FavoriteTracksView/index.js | 0 .../components/FavoriteTracksView/styles.scss | 0 .../app/app}/components/Footer/index.js | 0 .../app/app}/components/Footer/styles.css | 0 .../app/app}/components/Header/index.js | 0 .../app/app}/components/Header/styles.scss | 0 .../app/app}/components/HelpButton/index.js | 0 .../app}/components/HelpButton/styles.scss | 0 .../app/app}/components/HelpModal/const.js | 0 .../app/app}/components/HelpModal/index.js | 0 .../app/app}/components/HelpModal/styles.scss | 0 .../app/app}/components/InputDialog/index.js | 0 .../app}/components/InputDialog/styles.scss | 0 .../LibraryView/EmptyState/index.js | 0 .../LibraryView/EmptyState/styles.scss | 0 .../components/LibraryView/NoApi/index.js | 0 .../components/LibraryView/NoApi/styles.scss | 0 .../app/app}/components/LibraryView/index.js | 0 .../app}/components/LibraryView/index.scss | 0 .../LyricsView/LyricsHeader/index.js | 0 .../LyricsView/LyricsHeader/styles.scss | 0 .../app/app}/components/LyricsView/index.js | 0 .../app}/components/LyricsView/styles.scss | 0 .../app/app}/components/MainLayout/index.js | 0 .../app}/components/MainLayout/styles.scss | 0 .../app/app}/components/NavButtons/index.js | 0 .../app}/components/NavButtons/styles.scss | 0 .../app/app}/components/Navbar/index.js | 0 .../app/app}/components/Navbar/styles.scss | 0 .../app/app}/components/OauthPopup/index.js | 0 .../components/PlayOptionsControls/index.js | 0 .../PlayOptionsControls/styles.scss | 0 .../components/PlayQueue/QueueItem/index.js | 0 .../PlayQueue/QueueItem/styles.scss | 0 .../QueueMenu/QueueMenuMore/index.js | 0 .../QueueMenu/QueueMenuMore/styles.scss | 0 .../components/PlayQueue/QueueMenu/index.js | 0 .../PlayQueue/QueueMenu/styles.scss | 0 .../app/app}/components/PlayQueue/index.js | 4 +- .../app/app}/components/PlayQueue/styles.scss | 0 .../PlayerControls/PlayPauseButton/index.js | 0 .../PlayPauseButton/styles.scss | 0 .../PlayerControls/PlayerButton/index.js | 0 .../PlayerControls/PlayerButton/styles.scss | 0 .../app}/components/PlayerControls/index.js | 0 .../components/PlayerControls/styles.scss | 0 .../app/app}/components/PlaylistView/index.js | 0 .../app}/components/PlaylistView/styles.scss | 0 .../components/Playlists/Playlist/index.js | 0 .../components/Playlists/Playlist/styles.scss | 0 .../app/app}/components/Playlists/index.js | 0 .../app/app}/components/Playlists/styles.scss | 0 .../app}/components/PlaylistsSubMenu/index.js | 0 .../components/PlaylistsSubMenu/styles.scss | 0 .../app/app}/components/PluginsView/index.js | 0 .../app}/components/PluginsView/styles.scss | 0 .../app/app}/components/QueuePopup/index.js | 0 .../app}/components/QueuePopup/styles.scss | 0 .../app/app}/components/SearchBox/index.js | 0 .../app/app}/components/SearchBox/styles.scss | 0 .../SearchResults/AllResults/index.js | 0 .../SearchResults/AllResults/styles.scss | 0 .../SearchResults/PlaylistResults/index.js | 0 .../SearchResults/PlaylistResults/styles.scss | 0 .../SearchResults/TracksResults/index.js | 0 .../SearchResults/TracksResults/styles.scss | 0 .../app}/components/SearchResults/index.js | 0 .../app}/components/SearchResults/styles.scss | 0 .../app/app}/components/Seekbar/index.js | 0 .../app/app}/components/Seekbar/styles.scss | 0 .../Settings/GithubSettings/index.js | 0 .../Settings/SocialIntegration/index.js | 0 .../Settings/SocialIntegration/styles.scss | 0 .../app/app}/components/Settings/index.js | 0 .../app/app}/components/Settings/styles.scss | 0 .../SidebarMenuCategoryHeader/index.js | 0 .../SidebarMenuCategoryHeader/styles.scss | 0 .../SidebarMenu/SidebarMenuItem/index.js | 0 .../SidebarMenu/SidebarMenuItem/styles.scss | 0 .../app/app}/components/SidebarMenu/index.js | 0 .../app}/components/SidebarMenu/styles.scss | 0 .../app/app}/components/Spacer/index.js | 0 .../app/app}/components/Spacer/styles.scss | 0 .../TagView/TagDescription/index.js | 0 .../TagView/TagDescription/styles.scss | 0 .../components/TagView/TagHeader/index.js | 0 .../components/TagView/TagHeader/styles.scss | 0 .../components/TagView/TagTopList/index.js | 0 .../components/TagView/TagTopList/styles.scss | 0 .../components/TagView/TagTopTracks/index.js | 0 .../TagView/TagTopTracks/styles.scss | 0 .../app/app}/components/TagView/index.js | 0 .../app/app}/components/TagView/styles.scss | 0 .../app}/components/ToastComponent/index.js | 2 +- .../components/ToastComponent/styles.scss | 0 .../app}/components/TrackDuration/index.js | 0 .../app}/components/TrackDuration/styles.scss | 0 .../app/app}/components/TrackInfo/index.js | 0 .../app/app}/components/TrackInfo/styles.scss | 0 .../app/app}/components/TrackRow/index.js | 0 .../app/app}/components/TrackRow/styles.scss | 0 .../app}/components/VerticalPanel/index.js | 0 .../app}/components/VerticalPanel/styles.css | 0 .../VolumeControls/VolumeSlider/index.js | 0 .../VolumeControls/VolumeSlider/styles.scss | 0 .../app}/components/VolumeControls/index.js | 0 .../components/VolumeControls/styles.scss | 0 .../WindowControls/WindowButton/index.js | 0 .../WindowControls/WindowButton/styles.css | 0 .../app}/components/WindowControls/index.js | 0 .../app}/components/WindowControls/styles.css | 0 .../app/app}/constants/propTypes.js | 0 .../app/app}/constants/settings.js | 0 .../app/app}/constants/settingsEnum.js | 0 .../containers/AlbumViewContainer/index.js | 0 .../containers/ArtistViewContainer/index.js | 0 .../BestNewMusicCardContainer/index.js | 0 .../containers/DashboardContainer/index.js | 0 .../containers/DownloadsContainer/index.js | 0 .../EqualizerViewContainer/index.js | 0 .../EqualizerViewContainer/styles.scss | 0 .../app}/containers/ErrorBoundary/index.js | 0 .../containers/FavoritesContainer/index.js | 0 .../app/app}/containers/HttpApiUrl/index.js | 0 .../app}/containers/HttpApiUrl/styles.scss | 0 .../app/app}/containers/IpcContainer/index.js | 0 .../containers/LibraryViewContainer/index.js | 0 .../app}/containers/LyricsContainer/index.js | 0 .../containers/MainContentContainer/index.js | 0 .../containers/PlayQueueContainer/index.js | 0 .../containers/PlaylistViewContainer/index.js | 0 .../containers/PlaylistsContainer/index.js | 0 .../app}/containers/PluginsContainer/index.js | 0 .../containers/SearchBoxContainer/index.js | 0 .../SearchResultsContainer/index.js | 0 .../containers/SettingsContainer/index.js | 0 .../containers/ShortcutsContainer/index.js | 0 .../containers/SoundContainer/autoradio.js | 2 +- .../app}/containers/SoundContainer/index.js | 2 +- .../app}/containers/TagViewContainer/index.js | 0 .../app}/containers/ToastContainer/index.js | 0 .../containers/TrackPopupContainer/index.js | 0 {app => packages/app/app}/globals.js | 0 {app => packages/app/app}/i18n.js | 0 {app => packages/app/app}/index.js | 0 {app => packages/app/app}/locales/de.json | 0 {app => packages/app/app}/locales/dk.json | 0 {app => packages/app/app}/locales/en.json | 0 {app => packages/app/app}/locales/es.json | 0 {app => packages/app/app}/locales/fr.json | 0 {app => packages/app/app}/locales/id.json | 0 {app => packages/app/app}/locales/it.json | 0 {app => packages/app/app}/locales/nl.json | 0 {app => packages/app/app}/locales/pl.json | 0 {app => packages/app/app}/locales/pt_br.json | 0 {app => packages/app/app}/locales/ru.json | 0 {app => packages/app/app}/locales/tr.json | 0 {app => packages/app/app}/locales/zh.json | 0 {app => packages/app/app}/mixin.scss | 0 {app => packages/app/app}/mocks/queueMock.js | 0 {app => packages/app/app}/mpris.js | 0 .../app/app}/persistence/store.js | 0 {app => packages/app/app}/plugins/config.js | 0 .../app/app}/plugins/lyrics/simple.js | 0 .../app/app}/plugins/lyricsProvider.js | 0 .../app/app}/plugins/metaProvider.js | 0 {app => packages/app/app}/plugins/plugin.js | 0 .../app/app}/plugins/stream/JamendoPlugin.js | 0 .../app/app}/plugins/stream/LocalPlugin.js | 0 .../app}/plugins/stream/SoundcloudPlugin.js | 0 .../app/app}/plugins/stream/YoutubePlugin.js | 0 .../app/app}/plugins/stream/index.js | 0 .../app/app}/plugins/streamProvider.js | 0 .../app/app}/reducers/dashboard.js | 0 .../app/app}/reducers/downloads.js | 0 .../app/app}/reducers/equalizer.js | 0 .../app/app}/reducers/favorites.js | 0 {app => packages/app/app}/reducers/github.js | 0 {app => packages/app/app}/reducers/index.js | 0 {app => packages/app/app}/reducers/local.js | 0 {app => packages/app/app}/reducers/lyrics.js | 0 {app => packages/app/app}/reducers/player.js | 0 .../app/app}/reducers/playlists.js | 0 {app => packages/app/app}/reducers/plugins.js | 0 {app => packages/app/app}/reducers/queue.js | 0 .../app/app}/reducers/scrobbling.js | 0 {app => packages/app/app}/reducers/search.js | 0 .../app/app}/reducers/settings.js | 0 {app => packages/app/app}/reducers/tag.js | 0 {app => packages/app/app}/reducers/toasts.js | 0 {app => packages/app/app}/rest/Billboard.js | 0 .../app/app}/rest/CoverArtArchive.js | 0 {app => packages/app/app}/rest/Discogs.js | 0 {app => packages/app/app}/rest/Github.js | 0 {app => packages/app/app}/rest/Jamendo.js | 0 {app => packages/app/app}/rest/Local.js | 0 {app => packages/app/app}/rest/Musicbrainz.js | 0 {app => packages/app/app}/rest/Nuclear.js | 0 {app => packages/app/app}/rest/Soundcloud.js | 0 {app => packages/app/app}/rest/Youtube.js | 2 +- .../app/app}/rest/youtube-search.js | 0 .../app/app}/selectors/favorites.js | 0 .../app/app}/store/configureStore.js | 0 {app => packages/app/app}/structs/artist.js | 0 {app => packages/app/app}/styles.scss | 0 {app => packages/app/app}/utils.js | 0 {app => packages/app/app}/vars.scss | 0 packages/app/babel.config.js | 12 + {build => packages/app/build}/512.png | Bin {build => packages/app/build}/icon.icns | Bin {build => packages/app/build}/icon.png | Bin {common => packages/app/common}/settings.js | 0 .../app/common}/settingsEnum.js | 0 index.html => packages/app/index.html | 0 .../app/index.prod.html | 0 packages/app/lib/app.js | 7 + packages/app/lib/nuclear-app.js | 7 + loader.css => packages/app/loader.css | 0 packages/app/package.json | 241 +++++++ .../app/resources}/bin/linux/fpcalc | Bin .../app/resources}/bin/mac/fpcalc | Bin .../app/resources}/bin/win/fpcalc.exe | Bin .../app/resources}/media/1024x1024.png | Bin .../app/resources}/media/512x512.png | Bin .../app/resources}/media/art_placeholder.png | Bin .../app/resources}/media/icon.icns | Bin .../app/resources}/media/icon.png | Bin .../app/resources}/media/icon_512x512x32.png | Bin .../app/resources}/media/icon_apple.png | Bin .../app/resources}/media/logo_full_light.png | Bin .../media/presskit/Press Statement.txt | 0 .../media/presskit/icons/color/1024.png | Bin .../media/presskit/icons/color/128.png | Bin .../media/presskit/icons/color/16.png | Bin .../media/presskit/icons/color/24.png | Bin .../media/presskit/icons/color/256.png | Bin .../media/presskit/icons/color/32.png | Bin .../media/presskit/icons/color/48.png | Bin .../media/presskit/icons/color/512.png | Bin .../media/presskit/icons/color/64.png | Bin .../media/presskit/icons/color/96.png | Bin .../presskit/icons/greyscale/dark/1024.png | Bin .../presskit/icons/greyscale/dark/128.png | Bin .../presskit/icons/greyscale/dark/24.png | Bin .../presskit/icons/greyscale/dark/256.png | Bin .../presskit/icons/greyscale/dark/32.png | Bin .../presskit/icons/greyscale/dark/48.png | Bin .../presskit/icons/greyscale/dark/512.png | Bin .../presskit/icons/greyscale/dark/64.png | Bin .../presskit/icons/greyscale/dark/96.png | Bin .../presskit/icons/greyscale/light/1024.png | Bin .../presskit/icons/greyscale/light/128.png | Bin .../presskit/icons/greyscale/light/16.png | Bin .../presskit/icons/greyscale/light/24.png | Bin .../presskit/icons/greyscale/light/256.png | Bin .../presskit/icons/greyscale/light/32.png | Bin .../presskit/icons/greyscale/light/48.png | Bin .../presskit/icons/greyscale/light/512.png | Bin .../presskit/icons/greyscale/light/64.png | Bin .../presskit/icons/greyscale/light/96.png | Bin .../icons/scalable/nuclear-icon-mono-dark.svg | 0 .../scalable/nuclear-icon-mono-light.svg | 0 .../presskit/icons/scalable/nuclear-icon.svg | 0 .../media/presskit/logo/logo-large.png | Bin .../media/presskit/logo/logo-medium.png | Bin .../media/presskit/logo/logo-small.png | Bin .../media/presskit/logo/scalable/logo.svg | 0 .../screenshots/Screenshot-Album-Display.png | Bin .../screenshots/Screenshot-Album-Search.png | Bin .../screenshots/Screenshot-Artist-View.png | Bin .../Screenshot-Dashboard-Best-New-Music.png | Bin .../Screenshot-Dashboard-Genres.png | Bin .../screenshots/Screenshot-Equalizer-View.png | Bin .../screenshots/Screenshot-Lyrics-View.png | Bin .../screenshots/Screenshot-Playlist-view.png | Bin .../screenshots/Screenshot-Settings.png | Bin .../musicgenresicons/color/80's.svg | 0 .../musicgenresicons/color/90's.svg | 0 .../resources}/musicgenresicons/color/R&B.svg | 0 .../musicgenresicons/color/acoustic.svg | 0 .../musicgenresicons/color/blues.svg | 0 .../color/childrens_music.svg | 0 .../musicgenresicons/color/chill_out.svg | 0 .../color/christmas_carols.svg | 0 .../musicgenresicons/color/classical.svg | 0 .../musicgenresicons/color/country.svg | 0 .../musicgenresicons/color/disco.svg | 0 .../resources}/musicgenresicons/color/edm.svg | 0 .../musicgenresicons/color/ethnic.svg | 0 .../musicgenresicons/color/exercise.svg | 0 .../musicgenresicons/color/gospel.svg | 0 .../musicgenresicons/color/hip_hop.svg | 0 .../musicgenresicons/color/hippie.svg | 0 .../musicgenresicons/color/indie.svg | 0 .../musicgenresicons/color/jazz.svg | 0 .../musicgenresicons/color/k-pop.svg | 0 .../musicgenresicons/color/latin.svg | 0 .../musicgenresicons/color/metal.svg | 0 .../resources}/musicgenresicons/color/pop.svg | 0 .../musicgenresicons/color/punk.svg | 0 .../musicgenresicons/color/reggae.svg | 0 .../musicgenresicons/color/rock.svg | 0 .../musicgenresicons/color/romantic.svg | 0 .../musicgenresicons/color/tango.svg | 0 .../musicgenresicons/color/trending.svg | 0 .../musicgenresicons/color/vocal.svg | 0 .../musicgenresicons/outline/80's.svg | 0 .../musicgenresicons/outline/90's.svg | 0 .../musicgenresicons/outline/R&B.svg | 0 .../musicgenresicons/outline/acoustic.svg | 0 .../musicgenresicons/outline/blues.svg | 0 .../outline/childrens_music.svg | 0 .../musicgenresicons/outline/chill_out.svg | 0 .../outline/christmas_carols.svg | 0 .../musicgenresicons/outline/classical.svg | 0 .../musicgenresicons/outline/country.svg | 0 .../musicgenresicons/outline/disco.svg | 0 .../musicgenresicons/outline/edm.svg | 0 .../musicgenresicons/outline/ethnic.svg | 0 .../musicgenresicons/outline/exercise.svg | 0 .../musicgenresicons/outline/gospel.svg | 0 .../musicgenresicons/outline/hip_hop.svg | 0 .../musicgenresicons/outline/hippie.svg | 0 .../musicgenresicons/outline/indie.svg | 0 .../musicgenresicons/outline/jazz.svg | 0 .../musicgenresicons/outline/k-pop.svg | 0 .../musicgenresicons/outline/latin.svg | 0 .../musicgenresicons/outline/metal.svg | 0 .../musicgenresicons/outline/pop.svg | 0 .../musicgenresicons/outline/punk.svg | 0 .../musicgenresicons/outline/reggae.svg | 0 .../musicgenresicons/outline/rock.svg | 0 .../musicgenresicons/outline/romantic.svg | 0 .../musicgenresicons/outline/tango.svg | 0 .../musicgenresicons/outline/trending.svg | 0 .../musicgenresicons/outline/vocal.svg | 0 {server => packages/app/server}/.eslintrc | 0 {server => packages/app/server}/downloads.js | 0 .../app/server}/http/api/equalizer.js | 0 .../app/server}/http/api/index.js | 0 .../app/server}/http/api/localfile.js | 0 .../app/server}/http/api/player.js | 0 .../app/server}/http/api/playlist.js | 0 .../app/server}/http/api/queue.js | 0 .../app/server}/http/api/settings.js | 0 .../app/server}/http/api/swagger.js | 0 .../app/server}/http/api/window.js | 0 .../app/server}/http/middlewares.js | 0 .../app/server}/http/schema.js | 0 .../app/server}/http/server.js | 0 .../app/server}/http/swagger.js | 0 .../app/server}/lib/acousticId.js | 0 .../app/server}/lib/binaries.js | 0 {server => packages/app/server}/lib/fpcalc.js | 0 .../app/server}/local-files.js | 0 {server => packages/app/server}/main.dev.js | 0 {server => packages/app/server}/main.prod.js | 0 .../app/server}/main.prod.linux.js | 0 {server => packages/app/server}/mpris.js | 0 {server => packages/app/server}/store.js | 0 .../app/test}/enzyme.albumcover.test.js | 0 .../app/test}/enzyme.albumlist.test.js | 0 .../app/test}/enzyme.card.test.js | 0 .../test}/enzyme.favoritetracksview.test.js | 0 .../app/test}/enzyme.header.test.js | 0 .../app/test}/enzyme.helpmodal.test.js | 0 .../app/test}/enzyme.lyricsview.test.js | 0 .../app/test}/enzyme.navbar.test.js | 0 .../app/test}/enzyme.navbuttons.test.js | 0 .../app/test}/enzyme.playercontrols.test.js | 0 .../app/test}/enzyme.queuemenumore.test.js | 0 .../app/test}/enzyme.verticalpanel.js | 0 .../app/test}/enzyme.windowcontrols.test.js | 0 {test => packages/app/test}/pitchfork.test.js | 0 {test => packages/app/test}/playlists.test.js | 0 .../app/test}/selectors/favorites.test.js | 0 {test => packages/app/test}/setup.js | 0 .../app/test}/soundcloud.test.js | 0 .../app/test}/structs.artist.test.js | 0 {test => packages/app/test}/testHelper.js | 0 {test => packages/app/test}/utils.test.js | 0 .../app/webpack.config.dev.js | 18 +- .../app/webpack.config.electron.js | 0 .../app/webpack.config.electron.prod.js | 0 .../app/webpack.config.js | 0 .../app/webpack.config.prod.js | 10 + packages/core/.babelrc | 9 + packages/core/LICENSE | 661 ++++++++++++++++++ packages/core/README.md | 11 + packages/core/index.js | 1 + packages/core/lib/core.js | 7 + packages/core/lib/index.js | 2 + packages/core/lib/rest/lastfm.js | 162 +++++ packages/core/package.json | 55 ++ packages/core/test/lastfm.test.js | 65 ++ packages/core/webpack.config.js | 3 + packages/core/webpack.config.prod.js | 32 + packages/ui/.babelrc | 9 + packages/ui/.storybook/config.js | 9 + packages/ui/.storybook/webpack.config.js | 39 ++ packages/ui/LICENSE | 661 ++++++++++++++++++ packages/ui/README.md | 11 + packages/ui/index.js | 1 + packages/ui/lib/common.scss | 57 ++ packages/ui/lib/components/Cover/index.js | 23 + packages/ui/lib/components/Cover/styles.scss | 13 + packages/ui/lib/components/Loader/index.js | 31 + packages/ui/lib/components/Loader/styles.scss | 105 +++ packages/ui/lib/components/QueueItem/index.js | 76 ++ .../ui/lib/components/QueueItem/styles.scss | 95 +++ packages/ui/lib/components/Seekbar/index.js | 42 ++ .../ui/lib/components/Seekbar/styles.scss | 13 + .../components/ToastContainer/Toast/index.js | 72 ++ .../ToastContainer/Toast/styles.scss | 65 ++ .../ui/lib/components/ToastContainer/index.js | 53 ++ .../lib/components/ToastContainer/styles.scss | 6 + packages/ui/lib/index.js | 7 + packages/ui/lib/ui.js | 7 + packages/ui/lib/utils.js | 22 + packages/ui/package.json | 86 +++ packages/ui/resources/Lato-latin-ext.woff2 | Bin 0 -> 5296 bytes packages/ui/resources/Lato-latin.woff2 | Bin 0 -> 23316 bytes packages/ui/resources/Lato.css | 16 + packages/ui/stories/index.js | 9 + packages/ui/stories/index.stories.js | 164 +++++ packages/ui/stories/styles.scss | 9 + packages/ui/stories/toasts.stories.js | 135 ++++ packages/ui/stories/toasts.styles.scss | 17 + packages/ui/test/enzyme.cover.test.js | 18 + packages/ui/test/helpers/setup.js | 21 + 524 files changed, 3275 insertions(+), 287 deletions(-) delete mode 100644 .babelrc create mode 100644 .gitattributes rename .github/workflows/{build-linux.yml => build.yml} (64%) create mode 100644 lerna.json create mode 100644 packages/app/README.md rename {app => packages/app/app}/App.js (99%) rename {app => packages/app/app}/actions/dashboard.js (99%) rename {app => packages/app/app}/actions/downloads.js (100%) rename {app => packages/app/app}/actions/equalizer.js (100%) rename {app => packages/app/app}/actions/favorites.js (100%) rename {app => packages/app/app}/actions/github.js (100%) rename {app => packages/app/app}/actions/helpers.js (100%) rename {app => packages/app/app}/actions/index.js (99%) rename {app => packages/app/app}/actions/local.js (100%) rename {app => packages/app/app}/actions/lyrics.js (100%) rename {app => packages/app/app}/actions/player.js (100%) rename {app => packages/app/app}/actions/playlists.injectable.js (100%) rename {app => packages/app/app}/actions/playlists.js (100%) rename {app => packages/app/app}/actions/plugins.js (100%) rename {app => packages/app/app}/actions/queue.js (100%) rename {app => packages/app/app}/actions/scrobbling.js (98%) rename {app => packages/app/app}/actions/settings.js (100%) rename {app => packages/app/app}/actions/tag.js (97%) rename {app => packages/app/app}/actions/toasts.js (100%) rename {app => packages/app/app}/app.global.scss (100%) rename {app => packages/app/app}/compact.scss (100%) rename {app => packages/app/app}/components/AlbumCover/AlbumInfo/index.js (100%) rename {app => packages/app/app}/components/AlbumCover/AlbumInfo/styles.css (100%) rename {app => packages/app/app}/components/AlbumCover/AlbumOverlay/index.js (100%) rename {app => packages/app/app}/components/AlbumCover/AlbumOverlay/styles.css (100%) rename {app => packages/app/app}/components/AlbumCover/index.js (100%) rename {app => packages/app/app}/components/AlbumCover/styles.css (100%) rename {app => packages/app/app}/components/AlbumList/index.js (100%) rename {app => packages/app/app}/components/AlbumList/styles.scss (100%) rename {app => packages/app/app}/components/AlbumView/index.js (100%) rename {app => packages/app/app}/components/AlbumView/styles.scss (100%) rename {app => packages/app/app}/components/ArtistView/ArtistTags/index.js (100%) rename {app => packages/app/app}/components/ArtistView/ArtistTags/styles.scss (100%) rename {app => packages/app/app}/components/ArtistView/PopularTracks/index.js (100%) rename {app => packages/app/app}/components/ArtistView/PopularTracks/styles.scss (100%) rename {app => packages/app/app}/components/ArtistView/SimilarArtists/index.js (100%) rename {app => packages/app/app}/components/ArtistView/SimilarArtists/styles.scss (100%) rename {app => packages/app/app}/components/ArtistView/index.js (100%) rename {app => packages/app/app}/components/ArtistView/styles.scss (100%) rename {app => packages/app/app}/components/Card/index.js (100%) rename {app => packages/app/app}/components/Card/styles.scss (100%) rename {app => packages/app/app}/components/ContextPopup/PopupButton/index.js (100%) rename {app => packages/app/app}/components/ContextPopup/PopupButton/styles.scss (100%) rename {app => packages/app/app}/components/ContextPopup/index.js (100%) rename {app => packages/app/app}/components/ContextPopup/styles.scss (100%) rename {app => packages/app/app}/components/Cover/index.js (100%) rename {app => packages/app/app}/components/Cover/styles.scss (100%) rename {app => packages/app/app}/components/Dashboard/BestNewMusicTab/BestNewMusicContent/index.js (100%) rename {app => packages/app/app}/components/Dashboard/BestNewMusicTab/BestNewMusicContent/styles.scss (100%) rename {app => packages/app/app}/components/Dashboard/BestNewMusicTab/BestNewMusicMenu/BestNewMusicCard/index.js (100%) rename {app => packages/app/app}/components/Dashboard/BestNewMusicTab/BestNewMusicMenu/BestNewMusicCard/styles.scss (100%) rename {app => packages/app/app}/components/Dashboard/BestNewMusicTab/BestNewMusicMenu/index.js (100%) rename {app => packages/app/app}/components/Dashboard/BestNewMusicTab/BestNewMusicMenu/styles.scss (100%) rename {app => packages/app/app}/components/Dashboard/BestNewMusicTab/index.js (100%) rename {app => packages/app/app}/components/Dashboard/BestNewMusicTab/styles.scss (100%) rename {app => packages/app/app}/components/Dashboard/ChartsTab/index.js (100%) rename {app => packages/app/app}/components/Dashboard/ChartsTab/styles.scss (100%) rename {app => packages/app/app}/components/Dashboard/GenresTab/index.js (100%) rename {app => packages/app/app}/components/Dashboard/GenresTab/mapGenres.js (100%) rename {app => packages/app/app}/components/Dashboard/GenresTab/styles.scss (100%) rename {app => packages/app/app}/components/Dashboard/NewsTab/NewsItem/index.js (100%) rename {app => packages/app/app}/components/Dashboard/NewsTab/NewsItem/styles.scss (100%) rename {app => packages/app/app}/components/Dashboard/NewsTab/index.js (100%) rename {app => packages/app/app}/components/Dashboard/NewsTab/styles.scss (100%) rename {app => packages/app/app}/components/Dashboard/index.js (100%) rename {app => packages/app/app}/components/Dashboard/styles.scss (100%) rename {app => packages/app/app}/components/Downloads/DownloadsHeader/index.js (100%) rename {app => packages/app/app}/components/Downloads/DownloadsHeader/styles.scss (100%) rename {app => packages/app/app}/components/Downloads/DownloadsItem/index.js (100%) rename {app => packages/app/app}/components/Downloads/DownloadsItem/styles.scss (100%) rename {app => packages/app/app}/components/Downloads/DownloadsList/index.js (100%) rename {app => packages/app/app}/components/Downloads/DownloadsList/styles.scss (100%) rename {app => packages/app/app}/components/Downloads/index.js (100%) rename {app => packages/app/app}/components/Downloads/styles.scss (100%) rename {app => packages/app/app}/components/Equalizer/PreAmp/index.js (100%) rename {app => packages/app/app}/components/Equalizer/PreAmp/index.scss (100%) rename {app => packages/app/app}/components/Equalizer/chart.js (100%) rename {app => packages/app/app}/components/Equalizer/index.js (100%) rename {app => packages/app/app}/components/Equalizer/styles.scss (100%) rename {app => packages/app/app}/components/EqualizerPresetList/index.js (100%) rename {app => packages/app/app}/components/EqualizerPresetList/styles.scss (100%) rename {app => packages/app/app}/components/FavoriteAlbumsView/index.js (100%) rename {app => packages/app/app}/components/FavoriteAlbumsView/styles.scss (100%) rename {app => packages/app/app}/components/FavoriteTracksView/index.js (100%) rename {app => packages/app/app}/components/FavoriteTracksView/styles.scss (100%) rename {app => packages/app/app}/components/Footer/index.js (100%) rename {app => packages/app/app}/components/Footer/styles.css (100%) rename {app => packages/app/app}/components/Header/index.js (100%) rename {app => packages/app/app}/components/Header/styles.scss (100%) rename {app => packages/app/app}/components/HelpButton/index.js (100%) rename {app => packages/app/app}/components/HelpButton/styles.scss (100%) rename {app => packages/app/app}/components/HelpModal/const.js (100%) rename {app => packages/app/app}/components/HelpModal/index.js (100%) rename {app => packages/app/app}/components/HelpModal/styles.scss (100%) rename {app => packages/app/app}/components/InputDialog/index.js (100%) rename {app => packages/app/app}/components/InputDialog/styles.scss (100%) rename {app => packages/app/app}/components/LibraryView/EmptyState/index.js (100%) rename {app => packages/app/app}/components/LibraryView/EmptyState/styles.scss (100%) rename {app => packages/app/app}/components/LibraryView/NoApi/index.js (100%) rename {app => packages/app/app}/components/LibraryView/NoApi/styles.scss (100%) rename {app => packages/app/app}/components/LibraryView/index.js (100%) rename {app => packages/app/app}/components/LibraryView/index.scss (100%) rename {app => packages/app/app}/components/LyricsView/LyricsHeader/index.js (100%) rename {app => packages/app/app}/components/LyricsView/LyricsHeader/styles.scss (100%) rename {app => packages/app/app}/components/LyricsView/index.js (100%) rename {app => packages/app/app}/components/LyricsView/styles.scss (100%) rename {app => packages/app/app}/components/MainLayout/index.js (100%) rename {app => packages/app/app}/components/MainLayout/styles.scss (100%) rename {app => packages/app/app}/components/NavButtons/index.js (100%) rename {app => packages/app/app}/components/NavButtons/styles.scss (100%) rename {app => packages/app/app}/components/Navbar/index.js (100%) rename {app => packages/app/app}/components/Navbar/styles.scss (100%) rename {app => packages/app/app}/components/OauthPopup/index.js (100%) rename {app => packages/app/app}/components/PlayOptionsControls/index.js (100%) rename {app => packages/app/app}/components/PlayOptionsControls/styles.scss (100%) rename {app => packages/app/app}/components/PlayQueue/QueueItem/index.js (100%) rename {app => packages/app/app}/components/PlayQueue/QueueItem/styles.scss (100%) rename {app => packages/app/app}/components/PlayQueue/QueueMenu/QueueMenuMore/index.js (100%) rename {app => packages/app/app}/components/PlayQueue/QueueMenu/QueueMenuMore/styles.scss (100%) rename {app => packages/app/app}/components/PlayQueue/QueueMenu/index.js (100%) rename {app => packages/app/app}/components/PlayQueue/QueueMenu/styles.scss (100%) rename {app => packages/app/app}/components/PlayQueue/index.js (97%) rename {app => packages/app/app}/components/PlayQueue/styles.scss (100%) rename {app => packages/app/app}/components/PlayerControls/PlayPauseButton/index.js (100%) rename {app => packages/app/app}/components/PlayerControls/PlayPauseButton/styles.scss (100%) rename {app => packages/app/app}/components/PlayerControls/PlayerButton/index.js (100%) rename {app => packages/app/app}/components/PlayerControls/PlayerButton/styles.scss (100%) rename {app => packages/app/app}/components/PlayerControls/index.js (100%) rename {app => packages/app/app}/components/PlayerControls/styles.scss (100%) rename {app => packages/app/app}/components/PlaylistView/index.js (100%) rename {app => packages/app/app}/components/PlaylistView/styles.scss (100%) rename {app => packages/app/app}/components/Playlists/Playlist/index.js (100%) rename {app => packages/app/app}/components/Playlists/Playlist/styles.scss (100%) rename {app => packages/app/app}/components/Playlists/index.js (100%) rename {app => packages/app/app}/components/Playlists/styles.scss (100%) rename {app => packages/app/app}/components/PlaylistsSubMenu/index.js (100%) rename {app => packages/app/app}/components/PlaylistsSubMenu/styles.scss (100%) rename {app => packages/app/app}/components/PluginsView/index.js (100%) rename {app => packages/app/app}/components/PluginsView/styles.scss (100%) rename {app => packages/app/app}/components/QueuePopup/index.js (100%) rename {app => packages/app/app}/components/QueuePopup/styles.scss (100%) rename {app => packages/app/app}/components/SearchBox/index.js (100%) rename {app => packages/app/app}/components/SearchBox/styles.scss (100%) rename {app => packages/app/app}/components/SearchResults/AllResults/index.js (100%) rename {app => packages/app/app}/components/SearchResults/AllResults/styles.scss (100%) rename {app => packages/app/app}/components/SearchResults/PlaylistResults/index.js (100%) rename {app => packages/app/app}/components/SearchResults/PlaylistResults/styles.scss (100%) rename {app => packages/app/app}/components/SearchResults/TracksResults/index.js (100%) rename {app => packages/app/app}/components/SearchResults/TracksResults/styles.scss (100%) rename {app => packages/app/app}/components/SearchResults/index.js (100%) rename {app => packages/app/app}/components/SearchResults/styles.scss (100%) rename {app => packages/app/app}/components/Seekbar/index.js (100%) rename {app => packages/app/app}/components/Seekbar/styles.scss (100%) rename {app => packages/app/app}/components/Settings/GithubSettings/index.js (100%) rename {app => packages/app/app}/components/Settings/SocialIntegration/index.js (100%) rename {app => packages/app/app}/components/Settings/SocialIntegration/styles.scss (100%) rename {app => packages/app/app}/components/Settings/index.js (100%) rename {app => packages/app/app}/components/Settings/styles.scss (100%) rename {app => packages/app/app}/components/SidebarMenu/SidebarMenuCategoryHeader/index.js (100%) rename {app => packages/app/app}/components/SidebarMenu/SidebarMenuCategoryHeader/styles.scss (100%) rename {app => packages/app/app}/components/SidebarMenu/SidebarMenuItem/index.js (100%) rename {app => packages/app/app}/components/SidebarMenu/SidebarMenuItem/styles.scss (100%) rename {app => packages/app/app}/components/SidebarMenu/index.js (100%) rename {app => packages/app/app}/components/SidebarMenu/styles.scss (100%) rename {app => packages/app/app}/components/Spacer/index.js (100%) rename {app => packages/app/app}/components/Spacer/styles.scss (100%) rename {app => packages/app/app}/components/TagView/TagDescription/index.js (100%) rename {app => packages/app/app}/components/TagView/TagDescription/styles.scss (100%) rename {app => packages/app/app}/components/TagView/TagHeader/index.js (100%) rename {app => packages/app/app}/components/TagView/TagHeader/styles.scss (100%) rename {app => packages/app/app}/components/TagView/TagTopList/index.js (100%) rename {app => packages/app/app}/components/TagView/TagTopList/styles.scss (100%) rename {app => packages/app/app}/components/TagView/TagTopTracks/index.js (100%) rename {app => packages/app/app}/components/TagView/TagTopTracks/styles.scss (100%) rename {app => packages/app/app}/components/TagView/index.js (100%) rename {app => packages/app/app}/components/TagView/styles.scss (100%) rename {app => packages/app/app}/components/ToastComponent/index.js (91%) rename {app => packages/app/app}/components/ToastComponent/styles.scss (100%) rename {app => packages/app/app}/components/TrackDuration/index.js (100%) rename {app => packages/app/app}/components/TrackDuration/styles.scss (100%) rename {app => packages/app/app}/components/TrackInfo/index.js (100%) rename {app => packages/app/app}/components/TrackInfo/styles.scss (100%) rename {app => packages/app/app}/components/TrackRow/index.js (100%) rename {app => packages/app/app}/components/TrackRow/styles.scss (100%) rename {app => packages/app/app}/components/VerticalPanel/index.js (100%) rename {app => packages/app/app}/components/VerticalPanel/styles.css (100%) rename {app => packages/app/app}/components/VolumeControls/VolumeSlider/index.js (100%) rename {app => packages/app/app}/components/VolumeControls/VolumeSlider/styles.scss (100%) rename {app => packages/app/app}/components/VolumeControls/index.js (100%) rename {app => packages/app/app}/components/VolumeControls/styles.scss (100%) rename {app => packages/app/app}/components/WindowControls/WindowButton/index.js (100%) rename {app => packages/app/app}/components/WindowControls/WindowButton/styles.css (100%) rename {app => packages/app/app}/components/WindowControls/index.js (100%) rename {app => packages/app/app}/components/WindowControls/styles.css (100%) rename {app => packages/app/app}/constants/propTypes.js (100%) rename {app => packages/app/app}/constants/settings.js (100%) rename {app => packages/app/app}/constants/settingsEnum.js (100%) rename {app => packages/app/app}/containers/AlbumViewContainer/index.js (100%) rename {app => packages/app/app}/containers/ArtistViewContainer/index.js (100%) rename {app => packages/app/app}/containers/BestNewMusicCardContainer/index.js (100%) rename {app => packages/app/app}/containers/DashboardContainer/index.js (100%) rename {app => packages/app/app}/containers/DownloadsContainer/index.js (100%) rename {app => packages/app/app}/containers/EqualizerViewContainer/index.js (100%) rename {app => packages/app/app}/containers/EqualizerViewContainer/styles.scss (100%) rename {app => packages/app/app}/containers/ErrorBoundary/index.js (100%) rename {app => packages/app/app}/containers/FavoritesContainer/index.js (100%) rename {app => packages/app/app}/containers/HttpApiUrl/index.js (100%) rename {app => packages/app/app}/containers/HttpApiUrl/styles.scss (100%) rename {app => packages/app/app}/containers/IpcContainer/index.js (100%) rename {app => packages/app/app}/containers/LibraryViewContainer/index.js (100%) rename {app => packages/app/app}/containers/LyricsContainer/index.js (100%) rename {app => packages/app/app}/containers/MainContentContainer/index.js (100%) rename {app => packages/app/app}/containers/PlayQueueContainer/index.js (100%) rename {app => packages/app/app}/containers/PlaylistViewContainer/index.js (100%) rename {app => packages/app/app}/containers/PlaylistsContainer/index.js (100%) rename {app => packages/app/app}/containers/PluginsContainer/index.js (100%) rename {app => packages/app/app}/containers/SearchBoxContainer/index.js (100%) rename {app => packages/app/app}/containers/SearchResultsContainer/index.js (100%) rename {app => packages/app/app}/containers/SettingsContainer/index.js (100%) rename {app => packages/app/app}/containers/ShortcutsContainer/index.js (100%) rename {app => packages/app/app}/containers/SoundContainer/autoradio.js (99%) rename {app => packages/app/app}/containers/SoundContainer/index.js (99%) rename {app => packages/app/app}/containers/TagViewContainer/index.js (100%) rename {app => packages/app/app}/containers/ToastContainer/index.js (100%) rename {app => packages/app/app}/containers/TrackPopupContainer/index.js (100%) rename {app => packages/app/app}/globals.js (100%) rename {app => packages/app/app}/i18n.js (100%) rename {app => packages/app/app}/index.js (100%) rename {app => packages/app/app}/locales/de.json (100%) rename {app => packages/app/app}/locales/dk.json (100%) rename {app => packages/app/app}/locales/en.json (100%) rename {app => packages/app/app}/locales/es.json (100%) rename {app => packages/app/app}/locales/fr.json (100%) rename {app => packages/app/app}/locales/id.json (100%) rename {app => packages/app/app}/locales/it.json (100%) rename {app => packages/app/app}/locales/nl.json (100%) rename {app => packages/app/app}/locales/pl.json (100%) rename {app => packages/app/app}/locales/pt_br.json (100%) rename {app => packages/app/app}/locales/ru.json (100%) rename {app => packages/app/app}/locales/tr.json (100%) rename {app => packages/app/app}/locales/zh.json (100%) rename {app => packages/app/app}/mixin.scss (100%) rename {app => packages/app/app}/mocks/queueMock.js (100%) rename {app => packages/app/app}/mpris.js (100%) rename {app => packages/app/app}/persistence/store.js (100%) rename {app => packages/app/app}/plugins/config.js (100%) rename {app => packages/app/app}/plugins/lyrics/simple.js (100%) rename {app => packages/app/app}/plugins/lyricsProvider.js (100%) rename {app => packages/app/app}/plugins/metaProvider.js (100%) rename {app => packages/app/app}/plugins/plugin.js (100%) rename {app => packages/app/app}/plugins/stream/JamendoPlugin.js (100%) rename {app => packages/app/app}/plugins/stream/LocalPlugin.js (100%) rename {app => packages/app/app}/plugins/stream/SoundcloudPlugin.js (100%) rename {app => packages/app/app}/plugins/stream/YoutubePlugin.js (100%) rename {app => packages/app/app}/plugins/stream/index.js (100%) rename {app => packages/app/app}/plugins/streamProvider.js (100%) rename {app => packages/app/app}/reducers/dashboard.js (100%) rename {app => packages/app/app}/reducers/downloads.js (100%) rename {app => packages/app/app}/reducers/equalizer.js (100%) rename {app => packages/app/app}/reducers/favorites.js (100%) rename {app => packages/app/app}/reducers/github.js (100%) rename {app => packages/app/app}/reducers/index.js (100%) rename {app => packages/app/app}/reducers/local.js (100%) rename {app => packages/app/app}/reducers/lyrics.js (100%) rename {app => packages/app/app}/reducers/player.js (100%) rename {app => packages/app/app}/reducers/playlists.js (100%) rename {app => packages/app/app}/reducers/plugins.js (100%) rename {app => packages/app/app}/reducers/queue.js (100%) rename {app => packages/app/app}/reducers/scrobbling.js (100%) rename {app => packages/app/app}/reducers/search.js (100%) rename {app => packages/app/app}/reducers/settings.js (100%) rename {app => packages/app/app}/reducers/tag.js (100%) rename {app => packages/app/app}/reducers/toasts.js (100%) rename {app => packages/app/app}/rest/Billboard.js (100%) rename {app => packages/app/app}/rest/CoverArtArchive.js (100%) rename {app => packages/app/app}/rest/Discogs.js (100%) rename {app => packages/app/app}/rest/Github.js (100%) rename {app => packages/app/app}/rest/Jamendo.js (100%) rename {app => packages/app/app}/rest/Local.js (100%) rename {app => packages/app/app}/rest/Musicbrainz.js (100%) rename {app => packages/app/app}/rest/Nuclear.js (100%) rename {app => packages/app/app}/rest/Soundcloud.js (100%) rename {app => packages/app/app}/rest/Youtube.js (98%) rename {app => packages/app/app}/rest/youtube-search.js (100%) rename {app => packages/app/app}/selectors/favorites.js (100%) rename {app => packages/app/app}/store/configureStore.js (100%) rename {app => packages/app/app}/structs/artist.js (100%) rename {app => packages/app/app}/styles.scss (100%) rename {app => packages/app/app}/utils.js (100%) rename {app => packages/app/app}/vars.scss (100%) create mode 100644 packages/app/babel.config.js rename {build => packages/app/build}/512.png (100%) rename {build => packages/app/build}/icon.icns (100%) rename {build => packages/app/build}/icon.png (100%) rename {common => packages/app/common}/settings.js (100%) rename {common => packages/app/common}/settingsEnum.js (100%) rename index.html => packages/app/index.html (100%) rename index.prod.html => packages/app/index.prod.html (100%) create mode 100644 packages/app/lib/app.js create mode 100644 packages/app/lib/nuclear-app.js rename loader.css => packages/app/loader.css (100%) create mode 100644 packages/app/package.json rename {resources => packages/app/resources}/bin/linux/fpcalc (100%) rename {resources => packages/app/resources}/bin/mac/fpcalc (100%) rename {resources => packages/app/resources}/bin/win/fpcalc.exe (100%) rename {resources => packages/app/resources}/media/1024x1024.png (100%) rename {resources => packages/app/resources}/media/512x512.png (100%) rename {resources => packages/app/resources}/media/art_placeholder.png (100%) rename {resources => packages/app/resources}/media/icon.icns (100%) rename {resources => packages/app/resources}/media/icon.png (100%) rename {resources => packages/app/resources}/media/icon_512x512x32.png (100%) rename {resources => packages/app/resources}/media/icon_apple.png (100%) rename {resources => packages/app/resources}/media/logo_full_light.png (100%) rename {resources => packages/app/resources}/media/presskit/Press Statement.txt (100%) rename {resources => packages/app/resources}/media/presskit/icons/color/1024.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/color/128.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/color/16.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/color/24.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/color/256.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/color/32.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/color/48.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/color/512.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/color/64.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/color/96.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/dark/1024.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/dark/128.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/dark/24.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/dark/256.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/dark/32.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/dark/48.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/dark/512.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/dark/64.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/dark/96.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/light/1024.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/light/128.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/light/16.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/light/24.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/light/256.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/light/32.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/light/48.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/light/512.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/light/64.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/greyscale/light/96.png (100%) rename {resources => packages/app/resources}/media/presskit/icons/scalable/nuclear-icon-mono-dark.svg (100%) rename {resources => packages/app/resources}/media/presskit/icons/scalable/nuclear-icon-mono-light.svg (100%) rename {resources => packages/app/resources}/media/presskit/icons/scalable/nuclear-icon.svg (100%) rename {resources => packages/app/resources}/media/presskit/logo/logo-large.png (100%) rename {resources => packages/app/resources}/media/presskit/logo/logo-medium.png (100%) rename {resources => packages/app/resources}/media/presskit/logo/logo-small.png (100%) rename {resources => packages/app/resources}/media/presskit/logo/scalable/logo.svg (100%) rename {resources => packages/app/resources}/media/presskit/screenshots/Screenshot-Album-Display.png (100%) rename {resources => packages/app/resources}/media/presskit/screenshots/Screenshot-Album-Search.png (100%) rename {resources => packages/app/resources}/media/presskit/screenshots/Screenshot-Artist-View.png (100%) rename {resources => packages/app/resources}/media/presskit/screenshots/Screenshot-Dashboard-Best-New-Music.png (100%) rename {resources => packages/app/resources}/media/presskit/screenshots/Screenshot-Dashboard-Genres.png (100%) rename {resources => packages/app/resources}/media/presskit/screenshots/Screenshot-Equalizer-View.png (100%) rename {resources => packages/app/resources}/media/presskit/screenshots/Screenshot-Lyrics-View.png (100%) rename {resources => packages/app/resources}/media/presskit/screenshots/Screenshot-Playlist-view.png (100%) rename {resources => packages/app/resources}/media/presskit/screenshots/Screenshot-Settings.png (100%) rename {resources => packages/app/resources}/musicgenresicons/color/80's.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/90's.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/R&B.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/acoustic.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/blues.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/childrens_music.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/chill_out.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/christmas_carols.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/classical.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/country.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/disco.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/edm.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/ethnic.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/exercise.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/gospel.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/hip_hop.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/hippie.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/indie.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/jazz.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/k-pop.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/latin.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/metal.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/pop.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/punk.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/reggae.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/rock.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/romantic.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/tango.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/trending.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/color/vocal.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/80's.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/90's.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/R&B.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/acoustic.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/blues.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/childrens_music.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/chill_out.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/christmas_carols.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/classical.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/country.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/disco.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/edm.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/ethnic.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/exercise.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/gospel.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/hip_hop.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/hippie.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/indie.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/jazz.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/k-pop.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/latin.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/metal.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/pop.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/punk.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/reggae.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/rock.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/romantic.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/tango.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/trending.svg (100%) rename {resources => packages/app/resources}/musicgenresicons/outline/vocal.svg (100%) rename {server => packages/app/server}/.eslintrc (100%) rename {server => packages/app/server}/downloads.js (100%) rename {server => packages/app/server}/http/api/equalizer.js (100%) rename {server => packages/app/server}/http/api/index.js (100%) rename {server => packages/app/server}/http/api/localfile.js (100%) rename {server => packages/app/server}/http/api/player.js (100%) rename {server => packages/app/server}/http/api/playlist.js (100%) rename {server => packages/app/server}/http/api/queue.js (100%) rename {server => packages/app/server}/http/api/settings.js (100%) rename {server => packages/app/server}/http/api/swagger.js (100%) rename {server => packages/app/server}/http/api/window.js (100%) rename {server => packages/app/server}/http/middlewares.js (100%) rename {server => packages/app/server}/http/schema.js (100%) rename {server => packages/app/server}/http/server.js (100%) rename {server => packages/app/server}/http/swagger.js (100%) rename {server => packages/app/server}/lib/acousticId.js (100%) rename {server => packages/app/server}/lib/binaries.js (100%) rename {server => packages/app/server}/lib/fpcalc.js (100%) rename {server => packages/app/server}/local-files.js (100%) rename {server => packages/app/server}/main.dev.js (100%) rename {server => packages/app/server}/main.prod.js (100%) rename {server => packages/app/server}/main.prod.linux.js (100%) rename {server => packages/app/server}/mpris.js (100%) rename {server => packages/app/server}/store.js (100%) rename {test => packages/app/test}/enzyme.albumcover.test.js (100%) rename {test => packages/app/test}/enzyme.albumlist.test.js (100%) rename {test => packages/app/test}/enzyme.card.test.js (100%) rename {test => packages/app/test}/enzyme.favoritetracksview.test.js (100%) rename {test => packages/app/test}/enzyme.header.test.js (100%) rename {test => packages/app/test}/enzyme.helpmodal.test.js (100%) rename {test => packages/app/test}/enzyme.lyricsview.test.js (100%) rename {test => packages/app/test}/enzyme.navbar.test.js (100%) rename {test => packages/app/test}/enzyme.navbuttons.test.js (100%) rename {test => packages/app/test}/enzyme.playercontrols.test.js (100%) rename {test => packages/app/test}/enzyme.queuemenumore.test.js (100%) rename {test => packages/app/test}/enzyme.verticalpanel.js (100%) rename {test => packages/app/test}/enzyme.windowcontrols.test.js (100%) rename {test => packages/app/test}/pitchfork.test.js (100%) rename {test => packages/app/test}/playlists.test.js (100%) rename {test => packages/app/test}/selectors/favorites.test.js (100%) rename {test => packages/app/test}/setup.js (100%) rename {test => packages/app/test}/soundcloud.test.js (100%) rename {test => packages/app/test}/structs.artist.test.js (100%) rename {test => packages/app/test}/testHelper.js (100%) rename {test => packages/app/test}/utils.test.js (100%) rename webpack.config.dev.js => packages/app/webpack.config.dev.js (83%) rename webpack.config.electron.js => packages/app/webpack.config.electron.js (100%) rename webpack.config.electron.prod.js => packages/app/webpack.config.electron.prod.js (100%) rename webpack.config.js => packages/app/webpack.config.js (100%) rename webpack.config.prod.js => packages/app/webpack.config.prod.js (90%) create mode 100644 packages/core/.babelrc create mode 100644 packages/core/LICENSE create mode 100644 packages/core/README.md create mode 100644 packages/core/index.js create mode 100644 packages/core/lib/core.js create mode 100644 packages/core/lib/index.js create mode 100644 packages/core/lib/rest/lastfm.js create mode 100644 packages/core/package.json create mode 100644 packages/core/test/lastfm.test.js create mode 100644 packages/core/webpack.config.js create mode 100644 packages/core/webpack.config.prod.js create mode 100644 packages/ui/.babelrc create mode 100644 packages/ui/.storybook/config.js create mode 100644 packages/ui/.storybook/webpack.config.js create mode 100644 packages/ui/LICENSE create mode 100644 packages/ui/README.md create mode 100644 packages/ui/index.js create mode 100644 packages/ui/lib/common.scss create mode 100644 packages/ui/lib/components/Cover/index.js create mode 100644 packages/ui/lib/components/Cover/styles.scss create mode 100644 packages/ui/lib/components/Loader/index.js create mode 100644 packages/ui/lib/components/Loader/styles.scss create mode 100644 packages/ui/lib/components/QueueItem/index.js create mode 100644 packages/ui/lib/components/QueueItem/styles.scss create mode 100644 packages/ui/lib/components/Seekbar/index.js create mode 100644 packages/ui/lib/components/Seekbar/styles.scss create mode 100644 packages/ui/lib/components/ToastContainer/Toast/index.js create mode 100644 packages/ui/lib/components/ToastContainer/Toast/styles.scss create mode 100644 packages/ui/lib/components/ToastContainer/index.js create mode 100644 packages/ui/lib/components/ToastContainer/styles.scss create mode 100644 packages/ui/lib/index.js create mode 100644 packages/ui/lib/ui.js create mode 100644 packages/ui/lib/utils.js create mode 100644 packages/ui/package.json create mode 100644 packages/ui/resources/Lato-latin-ext.woff2 create mode 100644 packages/ui/resources/Lato-latin.woff2 create mode 100644 packages/ui/resources/Lato.css create mode 100644 packages/ui/stories/index.js create mode 100644 packages/ui/stories/index.stories.js create mode 100644 packages/ui/stories/styles.scss create mode 100644 packages/ui/stories/toasts.stories.js create mode 100644 packages/ui/stories/toasts.styles.scss create mode 100644 packages/ui/test/enzyme.cover.test.js create mode 100644 packages/ui/test/helpers/setup.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 60869e9af5..0000000000 --- a/.babelrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "presets": [ - "@babel/preset-env", - "@babel/preset-react" - ], - "plugins": [ - ["@babel/plugin-proposal-decorators", { "legacy": true }], - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-object-rest-spread", - ] -} diff --git a/.eslintrc.js b/.eslintrc.js index 41c6cdab37..38615be5a8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,7 +6,8 @@ module.exports = { }, "globals": { "process": true, - "Raven": true + "Raven": true, + "_": true }, "extends": ["eslint:recommended", "plugin:node/recommended"], "parser": "babel-eslint", @@ -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 } }; diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..b28e0ab7bc --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# never EVER use CRLF, Windows +* text eol=lf diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build.yml similarity index 64% rename from .github/workflows/build-linux.yml rename to .github/workflows/build.yml index 53eb0bb968..a6ddf5f530 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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} diff --git a/.travis.yml b/.travis.yml index 97c14332d2..cd2890b904 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/Dockerfile.dev b/Dockerfile.dev index 44bbd96964..4e69a16687 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -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 diff --git a/README.md b/README.md index 8c678b2550..49e6b1e4ea 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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. @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 67f0b2e0b5..5895deaa55 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,9 +7,9 @@ services: dockerfile: ./Dockerfile.dev volumes: - .:/nuclear + working_dir: /nuclear command: bash -xc " - cd /nuclear; - npm install " + lerna bootstrap" dev: build: @@ -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: diff --git a/lerna.json b/lerna.json new file mode 100644 index 0000000000..d6707ca0cd --- /dev/null +++ b/lerna.json @@ -0,0 +1,6 @@ +{ + "packages": [ + "packages/*" + ], + "version": "0.0.0" +} diff --git a/package.json b/package.json index 0d960038be..6e30f461c5 100644 --- a/package.json +++ b/package.json @@ -2,29 +2,6 @@ "name": "nuclear", "version": "0.5.1", "description": "Streaming music player that finds music sources automatically.", - "main": "main.js", - "scripts": { - "start": "npm-run-all --parallel watch electron:dev", - "electron:dev": "webpack --progress --colors --config=webpack.config.electron.js && electron ./bundle.electron.js", - "electron:prod:linux": "npm run build:electron:linux && electron ./dist/bundle.electron.js", - "electron:prod": "npm run build:electron && electron ./dist/bundle.electron.js", - "electron:docker": "docker run --rm --net=host --env=\"DISPLAY\" --volume=\"$HOME/.Xauthority:/root/.Xauthority:rw\" --device /dev/snd nuclear", - "watch": "webpack-dev-server --inline --progress --env=dev", - "build:dist": "webpack --progress --colors --env=prod && cp loader.css dist", - "build:dist:windows": "webpack --progress --colors --env=prod && copy loader.css dist", - "build:electron:linux": "webpack --progress --colors --env.LINUX=true --config=webpack.config.electron.prod.js", - "build:electron": "webpack --progress --colors --config=webpack.config.electron.prod.js", - "build:docker": "docker build -t nuclear .", - "test": "mocha --require ./test/testHelper.js --require @babel/register --require regenerator-runtime --timeout 10000 --prof --recursive", - "pack": "electron-builder --dir -c.extraMetadata.main=dist/bundle.electron.js", - "dist": "babel-node electron-builder -c.extraMetadata.main=dist/bundle.electron.js", - "build:linux": "electron-builder -c.extraMetadata.main=dist/bundle.electron.js --linux --publish always", - "build:windows": "electron-builder -c.extraMetadata.main=dist/bundle.electron.js --windows --publish always", - "build:macos": "electron-builder -c.extraMetadata.main=dist/bundle.electron.js --macos --publish always", - "build:all": "electron-builder -c.extraMetadata.main=dist/bundle.electron.js -mwl", - "lint": "eslint app test", - "i18n": "sync-i18n --files 'app/locales/*.json' --primary en --languages fr nl de dk es pl zh ru tr id --space 2" - }, "repository": { "type": "git", "url": "git+https://github.com/nukeop/nuclear.git" @@ -43,198 +20,17 @@ "url": "https://github.com/nukeop/nuclear/issues" }, "homepage": "https://github.com/nukeop/nuclear#readme", - "dependencies": { - "billboard-top-100": "^2.0.8", - "bluebird": "^3.5.3", - "body-parser": "^1.18.3", - "chart.js": "^2.8.0", - "cheerio": "^1.0.0-rc.2", - "concat-stream": "^2.0.0", - "cors": "^2.8.5", - "d3-drag": "^1.2.3", - "d3-selection": "^1.4.0", - "electron-dl": "^1.14.0", - "electron-platform": "^1.2.0", - "electron-store": "^2.0.0", - "electron-timber": "^0.5.1", - "electron-util": "^0.11.0", - "event-stream": "^4.0.1", - "express": "^4.16.4", - "express-json-validator-middleware": "^1.2.3", - "fast-levenshtein": "^2.0.6", - "font-awesome": "^4.7.0", - "get-artist-title": "^1.1.1", - "get-port": "^5.0.0", - "glob": "^7.1.3", - "i18next": "^17.0.1", - "md5": "^2.2.1", - "moment": "^2.20.1", - "mousetrap": "^1.6.2", - "music-metadata": "^3.5.3", - "nuclear-core": "0.0.5", - "nuclear-ui": "0.0.6", - "numeral": "^2.0.6", - "pitchfork-bnm": "^1.0.3", - "react": "^16.8.6", - "react-beautiful-dnd": "^9.0.0", - "react-dom": "^16.8.6", - "react-hifi": "^2.1.2", - "react-i18next": "^10.11.0", - "react-image": "^2.1.1", - "react-image-smooth-loading": "^2.0.0", - "react-range-progress": "^4.0.3", - "react-redux": "^7.1.0", - "react-toastify": "^4.5.2", - "recompose": "^0.30.0", - "redux": "^4.0.4", - "regenerator-runtime": "^0.13.2", - "semantic-ui-react": "^0.82.1", - "simple-get-lyrics": "0.0.4", - "stream-filter": "^2.1.0", - "stream-reduce": "^1.0.3", - "styled-components": "^3.2.6", - "swagger-spec-express": "^2.0.15", - "uuid": "^3.3.2", - "webpack-cli": "^3.0.8", - "youtube-playlist": "^1.0.2", - "ytdl-core": "^0.29.5" + "scripts": { + "postinstall": "lerna bootstrap --no-ci", + "test": "lerna run test", + "lint:fix": "lerna run lint:fix", + "storybook": "cd packages/ui && npm run storybook", + "build": "cd packages/app && npm run build:dist && npm run build:electron && npm run pack", + "build:win": "cd packages/app && npm run build:dist:windows && npm run build:electron && npm run pack", + "build:all": "cd packages/app && npm run build:dist && npm run build:electron && npm run build:all" }, + "dependencies": {}, "devDependencies": { - "@babel/core": "^7.5.5", - "@babel/plugin-proposal-class-properties": "^7.5.5", - "@babel/plugin-proposal-decorators": "^7.4.4", - "@babel/plugin-proposal-object-rest-spread": "^7.5.5", - "@babel/polyfill": "^7.4.4", - "@babel/preset-env": "^7.5.5", - "@babel/preset-react": "^7.0.0", - "@babel/register": "^7.5.5", - "babel-eslint": "^10.0.1", - "babel-loader": "^8.0.6", - "bufferutil": "^4.0.1", - "chai": "^4.1.2", - "chai-spies": "^1.0.0", - "classnames": "^2.2.5", - "css-loader": "^1.0.0", - "electron": "^4.0.2", - "electron-builder": "^20.44.4", - "electron-devtools-installer": "^2.2.4", - "enzyme": "^3.3.0", - "enzyme-adapter-react-16": "^1.3.1", - "eslint": "^5.12.1", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-node": "^9.1.0", - "eslint-plugin-react": "^7.12.4", - "eslint-plugin-react-hooks": "^1.6.1", - "extract-text-webpack-plugin": "^3.0.2", - "file-loader": "^1.1.6", - "html-webpack-plugin": "^3.2.0", - "i18next-json-sync": "^2.3.1", - "ignore-styles": "^5.0.1", - "isomorphic-fetch": "^2.2.1", - "jsdom": "^12.0.0", - "lodash": "^4.17.5", - "mocha": "^5.0.0", - "node-loader": "^0.6.0", - "node-sass": "^4.8.3", - "nodebrainz": "^2.1.1", - "npm-run-all": "^4.1.2", - "proxyquire": "^2.1.1", - "react-debounce-input": "^3.2.0", - "react-fontawesome": "^1.6.1", - "react-hot-loader": "4.8", - "react-router": "^4.2.0", - "react-router-dom": "^4.2.2", - "react-router-redux": "^4.0.8", - "redux-promise": "^0.6.0", - "redux-thunk": "^2.2.0", - "remote-redux-devtools": "^0.5.16", - "sass-loader": "^7.0.1", - "style-loader": "^0.23.0", - "svg-inline-loader": "^0.8.0", - "url-loader": "^1.0.1", - "utf-8-validate": "^5.0.2", - "webpack": "^4.12.1", - "webpack-dev-server": "^3.1.4", - "webpack-node-externals": "^1.7.2" - }, - "optionalDependencies": { - "7zip-bin-mac": "^1.0.1" - }, - "build": { - "appId": "nuclear", - "productName": "nuclear", - "artifactName": "${productName}-${env.GITHASH}.${ext}", - "directories": { - "output": "release" - }, - "files": [ - "dist/", - "dist/electron.bundle.js", - "package.json" - ], - "extraFiles": [ - "resources" - ], - "releaseInfo": { - "releaseName": "Nuclear ${env.GITHASH}" - }, - "linux": { - "desktop": { - "Name": "Nuclear", - "Name[es]": "Reproductor de música Nuclear", - "Comment[es]": "Reproductor que retransmite música desde fuentes encontradas automáticamente." - }, - "target": [ - "AppImage", - "deb", - "tar.gz", - "snap" - ], - "category": "Audio;AudioVideo;Network;Player;Music", - "extraFiles": [ - { - "from": "resources/bin/linux", - "to": "Resources/bin", - "filter": [ - "**/*" - ] - } - ] - }, - "mac": { - "category": "public.app-category.music", - "target": [ - "zip", - "pkg", - "dmg" - ], - "extraFiles": [ - { - "from": "resources/bin/mac", - "to": "Resources/bin", - "filter": [ - "**/*" - ] - } - ] - }, - "win": { - "target": [ - "nsis", - "portable" - ], - "extraFiles": [ - { - "from": "resources/bin/win", - "to": "Resources/bin", - "filter": [ - "**/*" - ] - } - ] - }, - "nsis": { - "artifactName": "${productName} Setup ${env.GITHASH}.${ext}" - } + "lerna": "^3.16.4" } } diff --git a/packages/app/README.md b/packages/app/README.md new file mode 100644 index 0000000000..48f4ec474d --- /dev/null +++ b/packages/app/README.md @@ -0,0 +1,11 @@ +# `@nuclear/app` + +> TODO: description + +## Usage + +``` +const app = require('@nuclear/app'); + +// TODO: DEMONSTRATE API +``` diff --git a/app/App.js b/packages/app/app/App.js similarity index 99% rename from app/App.js rename to packages/app/app/App.js index 5c46228428..074c452202 100644 --- a/app/App.js +++ b/packages/app/app/App.js @@ -45,7 +45,7 @@ import ToastContainer from './containers/ToastContainer'; import ShortcutsContainer from './containers/ShortcutsContainer'; import ErrorBoundary from './containers/ErrorBoundary'; -import ui from 'nuclear-ui'; +import ui from '@nuclear/ui'; import NavButtons from './components/NavButtons'; import PlayerControls from './components/PlayerControls'; import Seekbar from './components/Seekbar'; @@ -66,7 +66,7 @@ class App extends React.Component { componentDidMount() { this.props.actions.loadPlaylists(); } - + togglePlayback () { if (this.props.player.playbackStatus === Sound.status.PAUSED) { this.scrobbleLastFmIfAble(); @@ -185,7 +185,7 @@ class App extends React.Component { + /> { links.map( link => this.renderNavLink(link.name, link.path, link.icon) @@ -262,9 +262,9 @@ class App extends React.Component { currentTrackStream, 'duration' ); - + const timeToEnd = currentTrackDuration - this.props.player.seek; - + return ( ); } - + renderCover () { return ( + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 0000000000..8807296537 --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,11 @@ +# `@nuclear/core` + +> TODO: description + +## Usage + +``` +const core = require('@nuclear/core'); + +// TODO: DEMONSTRATE API +``` diff --git a/packages/core/index.js b/packages/core/index.js new file mode 100644 index 0000000000..bb0a047c4f --- /dev/null +++ b/packages/core/index.js @@ -0,0 +1 @@ +module.exports = require('./lib'); diff --git a/packages/core/lib/core.js b/packages/core/lib/core.js new file mode 100644 index 0000000000..1c5729e2b3 --- /dev/null +++ b/packages/core/lib/core.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = core; + +function core() { + // TODO +} diff --git a/packages/core/lib/index.js b/packages/core/lib/index.js new file mode 100644 index 0000000000..a8d0953813 --- /dev/null +++ b/packages/core/lib/index.js @@ -0,0 +1,2 @@ +import 'isomorphic-fetch'; +export { default as LastFmApi } from './rest/lastfm'; diff --git a/packages/core/lib/rest/lastfm.js b/packages/core/lib/rest/lastfm.js new file mode 100644 index 0000000000..fc20e89ada --- /dev/null +++ b/packages/core/lib/rest/lastfm.js @@ -0,0 +1,162 @@ +import md5 from 'md5'; + +const scrobblingApiUrl = 'http://ws.audioscrobbler.com/2.0/'; + +class LastFmApi { + constructor(key, secret) { + this.key = key; + this.secret = secret; + } + + sign(url) { + let tokens = decodeURIComponent((url.split('?')[1].split('&').sort().join()).replace(/,/g, '').replace(/=/g, '')); + + return md5(tokens + this.secret); + } + + prepareUrl(url) { + let withApiKey = `${url}&api_key=${this.key}`; + return `${withApiKey}&api_sig=${this.sign(withApiKey)}` ; + } + + addApiKey(url) { + return `${url}&api_key=${this.key}`; + } + + lastFmLoginConnect() { + return fetch(this.prepareUrl(scrobblingApiUrl + '?method=auth.getToken&format=json')); + } + + lastFmLogin(authToken) { + return fetch(this.prepareUrl(scrobblingApiUrl + '?method=auth.getSession&token=' + authToken)+'&format=json'); + } + + scrobble(artist, track, session) { + return fetch(this.prepareUrl( + scrobblingApiUrl + + '?method=track.scrobble&sk=' + + session + + '&artist=' + + encodeURIComponent(artist) + + '&track=' + + encodeURIComponent(track) + + '×tamp=' + + (Math.floor(new Date()/1000 - 540))), + { + method: 'POST' + } + ); + } + + updateNowPlaying(artist, track, session) { + return fetch(this.prepareUrl( + scrobblingApiUrl + + '?method=track.updateNowPlaying&sk=' + + session + + '&artist=' + + encodeURIComponent(artist) + + '&track=' + + encodeURIComponent(track)), + { + method: 'POST' + } + ); + } + + getArtistInfo(artist) { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=artist.getinfo&artist=' + + encodeURIComponent(artist) + + '&format=json' + )); + } + + getArtistTopTracks(artist) { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=artist.gettoptracks&artist=' + + encodeURIComponent(artist) + + '&format=json' + )); + } + + getTopTags() { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=tag.getTopTags&format=json' + )); + } + + getTopTracks() { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=chart.getTopTracks&format=json' + )); + } + + getTagInfo(tag) { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=tag.getInfo&format=json&tag=' + + tag + )); + } + + getTagTracks(tag) { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=tag.getTopTracks&format=json&tag=' + + tag + )); + } + + getTagAlbums(tag) { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=tag.getTopAlbums&format=json&tag=' + + tag + )); + } + + getTagArtists(tag) { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=tag.getTopArtists&format=json&tag=' + + tag + )); + } + + getSimilarTags(tag) { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=tag.getSimilar&format=json&tag=' + + tag + )); + } + + getSimilarTracks(artist, track, limit=100) { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=track.getSimilar&format=json&artist=' + + artist + + '&track=' + + track + + '&limit=' + + limit + )); + } + + searchTracks(terms, limit=30) { + return fetch(this.addApiKey( + scrobblingApiUrl + + '?method=track.search&format=json&track=' + + encodeURIComponent(terms) + + '&limit=' + + limit + )); + } + +} + +export default LastFmApi; diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 0000000000..c63e7afb61 --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,55 @@ +{ + "name": "@nuclear/core", + "version": "0.5.1", + "description": "Nuclear - core functionality", + "author": "nukeop ", + "homepage": "https://github.com/nukeop/nuclear/tree/master/packages/core#readme", + "license": "AGPL-3.0", + "repository": { + "type": "git", + "url": "git+https://github.com/nukeop/nuclear.git" + }, + "scripts": { + "lint:fix": "eslint lib --fix", + "test": "eslint lib && ava -v" + }, + "bugs": { + "url": "https://github.com/nukeop/nuclear/issues" + }, + "devDependencies": { + "@babel/core": "^7.6.2", + "@babel/plugin-proposal-object-rest-spread": "^7.6.2", + "@babel/polyfill": "^7.6.0", + "@babel/preset-env": "^7.6.2", + "@babel/preset-react": "^7.0.0", + "@babel/register": "^7.6.2", + "ava": "^2.4.0", + "babel-eslint": "^10.0.3", + "babel-loader": "^7.1.5", + "eslint": "^5.16.0", + "eslint-plugin-node": "^10.0.0", + "eslint-plugin-react": "^7.14.3", + "eslint-plugin-react-hooks": "^2.1.1", + "webpack": "^4.16.3", + "webpack-cli": "^3.1.0", + "webpack-dev-server": "^3.1.5" + }, + "dependencies": { + "isomorphic-fetch": "^2.2.1", + "lodash": "^4.17.10", + "md5": "^2.2.1" + }, + "ava": { + "babel": { + "testOptions": { + "plugins": [ + "@babel/plugin-proposal-object-rest-spread" + ] + } + }, + "require": [ + "@babel/register", + "@babel/polyfill" + ] + } +} diff --git a/packages/core/test/lastfm.test.js b/packages/core/test/lastfm.test.js new file mode 100644 index 0000000000..0aa6e5698b --- /dev/null +++ b/packages/core/test/lastfm.test.js @@ -0,0 +1,65 @@ +import test from 'ava'; +import {LastFmApi} from '..'; + +const setupLastFmApi = (key, secret) => { + return new LastFmApi(key, secret); +}; + +test('add api key to url', t => { + let api = setupLastFmApi('test', 'test'); + let url = 'http://example.com?test=test1&test2=test3'; + let withKey = api.addApiKey(url); + + t.is(withKey, 'http://example.com?test=test1&test2=test3&api_key=test'); +}); + +test('sign url', t => { + let api = setupLastFmApi('test', 'test'); + let url = 'http://example.com?test=test1&test2=test3'; + let signed = api.sign(url); + + t.is(signed, '4dd7efc68ff9d7c293ac0f71eb133ace'); +}); + +test('prepare url', t => { + let api = setupLastFmApi('test', 'test'); + let url = 'http://example.com?test=test1&test2=test3'; + let prepared = api.prepareUrl(url); + + t.is(prepared, 'http://example.com?test=test1&test2=test3&api_key=test&api_sig=cd28b8fd248073c89aad9b77dd069567'); +}); + +test('get top tracks', async t => { + let api = setupLastFmApi('2b75dcb291e2b0c9a2c994aca522ac14', + '2ee49e35f08b837d43b2824198171fc8'); + + let data = await api.getTopTracks(); + data = await data.json(); + + t.is(typeof data.tracks, 'object'); + t.true(data.tracks.track instanceof Array); +}); + +test('search tracks', async t => { + let api = setupLastFmApi('2b75dcb291e2b0c9a2c994aca522ac14', + '2ee49e35f08b837d43b2824198171fc8'); + + let data = await api.searchTracks('billie jean'); + data = await data.json(); + + t.is(typeof data.results, 'object'); + t.true(data.results.trackmatches.track instanceof Array); + t.true(data.results.trackmatches.track.length > 0); +}); + +test('get similar tracks', async t => { + let api = setupLastFmApi('2b75dcb291e2b0c9a2c994aca522ac14', + '2ee49e35f08b837d43b2824198171fc8'); + + let data = await api.searchTracks('michael jackson', 'billie jean'); + data = await data.json(); + + t.is(typeof data.results, 'object'); + t.true(data.results.trackmatches.track instanceof Array); + t.true(data.results.trackmatches.track.length > 0); +}); diff --git a/packages/core/webpack.config.js b/packages/core/webpack.config.js new file mode 100644 index 0000000000..b06a3ba379 --- /dev/null +++ b/packages/core/webpack.config.js @@ -0,0 +1,3 @@ +module.exports = function(env) { + return require(`./webpack.config.${env}.js`); +}; diff --git a/packages/core/webpack.config.prod.js b/packages/core/webpack.config.prod.js new file mode 100644 index 0000000000..0f2eae3f90 --- /dev/null +++ b/packages/core/webpack.config.prod.js @@ -0,0 +1,32 @@ +const webpack = require('webpack'); +const path = require('path'); + +const BUILD_DIR = path.resolve(__dirname, 'dist'); +const LIB_DIR = path.resolve(__dirname, 'lib'); + + +module.exports = { + entry: path.resolve(LIB_DIR, 'index.js'), + output: { + path: BUILD_DIR, + filename: 'bundle.js', + publicPath: BUILD_DIR, + libraryTarget: 'commonjs2', + libraryExport: 'default' + }, + mode: 'production', + optimization: { + namedModules: true + }, + module: { + rules: [ + { + test: /.jsx?$/, + use: 'babel-loader', + exclude: /node_modules/ + } + ] + }, + devtool: 'source-map', + target: 'electron-renderer' +}; diff --git a/packages/ui/.babelrc b/packages/ui/.babelrc new file mode 100644 index 0000000000..a0157f25a1 --- /dev/null +++ b/packages/ui/.babelrc @@ -0,0 +1,9 @@ +{ + 'presets': [ + '@babel/preset-env', + '@babel/preset-react' + ], + 'plugins': [ + '@babel/plugin-proposal-object-rest-spread' + ] +} diff --git a/packages/ui/.storybook/config.js b/packages/ui/.storybook/config.js new file mode 100644 index 0000000000..b98cb4736a --- /dev/null +++ b/packages/ui/.storybook/config.js @@ -0,0 +1,9 @@ +import { configure } from '@storybook/react'; + +// automatically import all files ending in *.stories.js +const req = require.context('../stories', true, /.stories.js$/); +function loadStories() { + req.keys().forEach(filename => req(filename)); +} + +configure(loadStories, module); diff --git a/packages/ui/.storybook/webpack.config.js b/packages/ui/.storybook/webpack.config.js new file mode 100644 index 0000000000..a8acefa6b2 --- /dev/null +++ b/packages/ui/.storybook/webpack.config.js @@ -0,0 +1,39 @@ +const path = require('path'); + +module.exports = { + module: { + rules: [ + { + test: /\.s?css$/, + use: [ + 'style-loader', + 'css-loader?importLoaders=1&modules=true&localIdentName=[local]', + 'sass-loader' + ], + include: [ + path.resolve(__dirname, '../lib'), + path.resolve(__dirname, '../stories') + ] + }, + { + test: /\.(ttf|eot|woff|woff2|svg)$/, + loader: 'url-loader', + include: [ + path.resolve(__dirname, '../resources'), + path.resolve(__dirname, '../node_modules/boxicons') + ] + }, + { + test: /\.css$/, + use: [ + 'style-loader', + 'css-loader?importLoaders=1&modules=true&localIdentName=[local]' + ], + include: [ + path.resolve(__dirname, '../resources'), + path.resolve(__dirname, '../node_modules/boxicons') + ] + } + ] + } +}; diff --git a/packages/ui/LICENSE b/packages/ui/LICENSE new file mode 100644 index 0000000000..dbbe355815 --- /dev/null +++ b/packages/ui/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/packages/ui/README.md b/packages/ui/README.md new file mode 100644 index 0000000000..dafb3dab02 --- /dev/null +++ b/packages/ui/README.md @@ -0,0 +1,11 @@ +# `@nuclear/ui` + +> TODO: description + +## Usage + +``` +const ui = require('@nuclear/ui'); + +// TODO: DEMONSTRATE API +``` diff --git a/packages/ui/index.js b/packages/ui/index.js new file mode 100644 index 0000000000..bb0a047c4f --- /dev/null +++ b/packages/ui/index.js @@ -0,0 +1 @@ +module.exports = require('./lib'); diff --git a/packages/ui/lib/common.scss b/packages/ui/lib/common.scss new file mode 100644 index 0000000000..379634dd90 --- /dev/null +++ b/packages/ui/lib/common.scss @@ -0,0 +1,57 @@ +$background: #282a36; +$background2: #44475a; +$background3: #21222c; +$lightbg: #7E83A6; +$grey: #f8f8f2; +$blue: #6272a4; +$cyan: #8be9fd; +$green: #50fa7b; +$orange: #ffb86c; +$pink: #ff79c6; +$purple: #bd93f9; +$red: #ff5555; +$yellow: #f1fa8c; +$white: #FAFAFA; +$black: #202020; + +@mixin roundCorners { + border-radius: 0.25em; +} + +@mixin circle { + border-radius: 50%; + overflow: hidden; +} + +@mixin transition { + transition: 0.25s; +} + +@mixin center { + align-items: center; + justify-content: center; +} + +@mixin ellipsis { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +@mixin shadow { + box-shadow: 0 0 38px rgba(0,0,0,0.30), 0 0 12px rgba(0,0,0,0.22); +} + +.nuclear { + font-family: 'Lato'; + color: $white; +} + +@keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} diff --git a/packages/ui/lib/components/Cover/index.js b/packages/ui/lib/components/Cover/index.js new file mode 100644 index 0000000000..28ae1abe09 --- /dev/null +++ b/packages/ui/lib/components/Cover/index.js @@ -0,0 +1,23 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import cx from 'classnames'; + +import common from '../../common.scss'; +import styles from './styles.scss'; + +const Cover = props => { + return ( +
+ +
+ ); +}; + +Cover.propTypes = { + cover: PropTypes.string.isRequired +}; + +export default Cover; diff --git a/packages/ui/lib/components/Cover/styles.scss b/packages/ui/lib/components/Cover/styles.scss new file mode 100644 index 0000000000..6fde06f9f0 --- /dev/null +++ b/packages/ui/lib/components/Cover/styles.scss @@ -0,0 +1,13 @@ +@import '../../common.scss'; + +.nuclear.cover_container { + width: 76px; + height: 76px; + + flex: 0 0 auto; +} + +.nuclear.cover_container img { + width: 76px; + height: 76px; +} diff --git a/packages/ui/lib/components/Loader/index.js b/packages/ui/lib/components/Loader/index.js new file mode 100644 index 0000000000..869b201eda --- /dev/null +++ b/packages/ui/lib/components/Loader/index.js @@ -0,0 +1,31 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import cx from 'classnames'; + +import common from '../../common.scss'; +import styles from './styles.scss'; + +const Loader = props => { + return ( + + + + + + + ); +}; + +Loader.propTypes = { + type: PropTypes.string +}; + +Loader.defaultProps = { + type: 'default' +}; + +export default Loader; diff --git a/packages/ui/lib/components/Loader/styles.scss b/packages/ui/lib/components/Loader/styles.scss new file mode 100644 index 0000000000..55b64b56b0 --- /dev/null +++ b/packages/ui/lib/components/Loader/styles.scss @@ -0,0 +1,105 @@ +@import '../../common.scss'; + +.loader { + @include roundCorners; + position: relative; + display: block; + + width: 5em; + height: 5em; + + &.default { + @include shadow; + background: linear-gradient(45deg, #43CBFF 0%, #9708CC 100%); + background-size: 100% 100%; + border-radius: 1em; + + span { + position: absolute; + width: 0; + height: 0; + border-top: 1.5em solid $white; + border-left: 1em solid transparent; + border-right: 1em solid transparent; + } + + span:nth-child(1) { + left: 1.5em; + top: 1em; + animation: triangle-anim 1s ease infinite; + } + + span:nth-child(2) { + top: 2.5em; + left: 0.5em; + animation: triangle-anim 1s ease infinite 0.66s; + } + + span:nth-child(3) { + top: 2.5em; + right: 0.5em; + animation: triangle-anim 1s ease infinite 0.33s; + } + + span:nth-child(4) { + display: none; + } + + @keyframes triangle-anim { + 0%, 100% { + opacity: 1; + } + + 50% { + opacity: 0.5; + } + } + } + + &.circle { + span:first-child { + display: flex; + width: 100%; + height: 100%; + border-radius: 50%; + border-top: 5px solid $white; + border-bottom: 5px solid $white; + border-right: 5px solid $white; + border-left: 5px solid transparent; + animation: circle-anim 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite; + } + + + } + + &.small { + display: flex; + justify-content: center; + align-items: center; + width: 2em; + height: 2em; + + span:first-child { + display: flex; + width: 100%; + height: 100%; + box-sizing: border-box; + border-radius: 50%; + border-top: 5px solid $white; + border-bottom: 5px solid $white; + border-right: 5px solid $white; + border-left: 5px solid transparent; + animation: circle-anim 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite; + } + } +} + +@keyframes circle-anim { + 0% { + + } + + 100% { + transform: rotate(360deg); + } +} diff --git a/packages/ui/lib/components/QueueItem/index.js b/packages/ui/lib/components/QueueItem/index.js new file mode 100644 index 0000000000..dc4d3371e5 --- /dev/null +++ b/packages/ui/lib/components/QueueItem/index.js @@ -0,0 +1,76 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import cx from 'classnames'; + +import Loader from '../Loader'; +import common from '../../common.scss'; +import styles from './styles.scss'; + +const QueueItem = props => { + let { + isLoading, + isCurrent, + index, + track, + duration, + selectSong, + removeFromQueue + } = props; + + return ( +
selectSong(index)} + > +
+ { + isLoading + ? + : + } + +
removeFromQueue(index)} + > + +
+
+ +
+
+ {track.name} +
+
+ {track.artist} +
+
+ +
+
+ { duration } +
+
+
+ ); +}; + +QueueItem.propTypes = { + isLoading: PropTypes.bool, + isCurrent: PropTypes.bool, + track: PropTypes.shape({ + thumbnail: PropTypes.string, + name: PropTypes.string, + artist: PropTypes.string + }), + index: PropTypes.number, + duration: PropTypes.string, + selectSong: PropTypes.func, + removeFromQueue: PropTypes.func +}; + +export default QueueItem; diff --git a/packages/ui/lib/components/QueueItem/styles.scss b/packages/ui/lib/components/QueueItem/styles.scss new file mode 100644 index 0000000000..db5405f142 --- /dev/null +++ b/packages/ui/lib/components/QueueItem/styles.scss @@ -0,0 +1,95 @@ +@import '../../common.scss'; + +.queue_item { + @include transition; + @include roundCorners; + + display: flex; + flex-flow: row; + flex: 0 0 auto; + height: 4em; + margin: 0.5em; + background-color: rgba($background2, 0.5); + + animation: queue_item_fade_in 0.5s; + + .thumbnail { + @include center; + @include circle; + + position: relative; + display: flex; + width: 3em; + height: 3em; + margin: 0.5em; + } + + .thumbnail_overlay { + @include center; + @include circle; + @include transition; + + position: absolute; + display: flex; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: $black; + color: $white; + opacity: 0; + cursor: pointer; + + &:hover { + opacity: 0.85; + } + } +} + +.item_info_container { + @include ellipsis; + + display: flex; + margin: 0.25em; + flex: 1 1 auto; + flex-flow: column; + justify-content: center; + + .name_container { + @include ellipsis; + margin-bottom: 0.25 em; + } + + .artist_container { + @include ellipsis; + color: rgba($white, 0.5); + } +} + +.item_duration_container { + display: flex; + overflow: hidden; + flex: 0 0 auto; + flex-flow: column; + justify-content: center; + + margin: 0 0.5em; + + .item_duration { + color: rgba($white, 0.5); + } +} + +.current_song { + background: rgba($green, 0.3); +} + +@keyframes queue_item_fade_in { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} diff --git a/packages/ui/lib/components/Seekbar/index.js b/packages/ui/lib/components/Seekbar/index.js new file mode 100644 index 0000000000..326fc2a23b --- /dev/null +++ b/packages/ui/lib/components/Seekbar/index.js @@ -0,0 +1,42 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import cx from 'classnames'; + +import common from '../../common.scss'; +import styles from './styles.scss'; + +const handleClick = (seek, queue) => { + return event => { + let percent = (event.pageX - event.target.offsetLeft)/document.body.clientWidth; + let duration = queue.queueItems[queue.currentSong].streams[0].duration; + seek(percent * duration * 1000); + }; +}; + +const Seekbar = props => { + return ( +
+
+
+ ); +}; + +Seekbar.propTypes = { + fill: PropTypes.string, + seek: PropTypes.func, + queue: PropTypes.object +}; + +export default Seekbar; diff --git a/packages/ui/lib/components/Seekbar/styles.scss b/packages/ui/lib/components/Seekbar/styles.scss new file mode 100644 index 0000000000..2c25328582 --- /dev/null +++ b/packages/ui/lib/components/Seekbar/styles.scss @@ -0,0 +1,13 @@ +@import '../../common.scss'; + +.seekbar_container { + height: 4px; + cursor: pointer; + background-color: transparent; + flex: 0 0 auto; +} + +.seekbar_fill { + height: 100%; + background-color: $pink; +} diff --git a/packages/ui/lib/components/ToastContainer/Toast/index.js b/packages/ui/lib/components/ToastContainer/Toast/index.js new file mode 100644 index 0000000000..4f8cea4f8f --- /dev/null +++ b/packages/ui/lib/components/ToastContainer/Toast/index.js @@ -0,0 +1,72 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import cx from 'classnames'; + +import common from '../../../common.scss'; +import styles from './styles.scss'; + +const TOAST_HEIGHT_PADDED = '5.5em'; + +const Toast = props => { + return ( +
+
+ { + props.icon && +
+ { props.icon } +
+ } +
+
{ props.title }
+
{ props.details }
+
+
+
+ ); +}; + +Toast.propTypes = { + error: PropTypes.bool, + warning: PropTypes.bool, + info: PropTypes.bool, + success: PropTypes.bool, + icon: PropTypes.node, + title: PropTypes.string, + details: PropTypes.string, + onClick: PropTypes.func, + offset: PropTypes.arrayOf(PropTypes.number) +}; + +Toast.defaultProps = { + error: false, + warning: false, + info: false, + success: null, + icon: null, + title: '', + details: '', + onClick: () => {}, + offset: [0, 0] +}; + +export default Toast; diff --git a/packages/ui/lib/components/ToastContainer/Toast/styles.scss b/packages/ui/lib/components/ToastContainer/Toast/styles.scss new file mode 100644 index 0000000000..695257b903 --- /dev/null +++ b/packages/ui/lib/components/ToastContainer/Toast/styles.scss @@ -0,0 +1,65 @@ +@import '../../../common.scss'; + +.toast { + @include roundCorners; + @include transition; + @include shadow; + position: absolute; + background: $background2; + padding: 1em; + animation: fade-in 0.5s normal forwards ease-in-out; + user-select: none; + -moz-user-select: none; + cursor: pointer; + + bottom: 1em; + right: 1em; + height: 2.5em; + + .toast_content { + display: flex; + flex-flow: row; + height: 100%; + } + + .toast_icon { + display: flex; + height: 100%; + margin-right: 1em; + + * { + height: 100%; + width: auto; + } + } + + .toast_text { + display: flex; + flex-flow: column; + } + + .title { + color: $white; + font-weight: bold; + } + + .details { + color: rgba($white, 0.7); + } + + &.error { + background: $red; + } + + &.warning { + background: darken($orange, 15%); + } + + &.info { + background: $blue; + } + + &.success { + background: darken($green, 25%); + } +} diff --git a/packages/ui/lib/components/ToastContainer/index.js b/packages/ui/lib/components/ToastContainer/index.js new file mode 100644 index 0000000000..e7430a99de --- /dev/null +++ b/packages/ui/lib/components/ToastContainer/index.js @@ -0,0 +1,53 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import cx from 'classnames'; +import Toast from './Toast'; + +import common from '../../common.scss'; +import styles from './styles.scss'; + +const ToastContainer = props => { + return ( +
+ { props.toasts.map((toast, i) => { + return ( + + ); + })} +
+ ); +}; + +ToastContainer.propTypes = { + toasts: PropTypes.arrayOf( + PropTypes.shape({ + title: PropTypes.string, + details: PropTypes.string, + error: PropTypes.bool, + warning: PropTypes.bool, + info: PropTypes.bool + }) + ) +}; + +ToastContainer.defaultProps = { + toasts: [] +}; + +export default ToastContainer; diff --git a/packages/ui/lib/components/ToastContainer/styles.scss b/packages/ui/lib/components/ToastContainer/styles.scss new file mode 100644 index 0000000000..a18234bfe3 --- /dev/null +++ b/packages/ui/lib/components/ToastContainer/styles.scss @@ -0,0 +1,6 @@ +.toast_container { + position: absolute; + display: flex; + width: 100%; + height: 100%; +} diff --git a/packages/ui/lib/index.js b/packages/ui/lib/index.js new file mode 100644 index 0000000000..6561438621 --- /dev/null +++ b/packages/ui/lib/index.js @@ -0,0 +1,7 @@ +import '../resources/Lato.css'; + +export { default as Cover } from './components/Cover'; +export { default as Loader } from './components/Loader'; +export { default as QueueItem } from './components/QueueItem'; +export { default as Seekbar } from './components/Seekbar'; +export { default as ToastContainer } from './components/ToastContainer'; diff --git a/packages/ui/lib/ui.js b/packages/ui/lib/ui.js new file mode 100644 index 0000000000..326cf320c0 --- /dev/null +++ b/packages/ui/lib/ui.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = ui; + +function ui() { + // TODO +} diff --git a/packages/ui/lib/utils.js b/packages/ui/lib/utils.js new file mode 100644 index 0000000000..a646973677 --- /dev/null +++ b/packages/ui/lib/utils.js @@ -0,0 +1,22 @@ +export function formatDuration(duration) { + let sec_num = parseInt(duration, 10); + let hours = Math.floor(sec_num / 3600); + let minutes = Math.floor((sec_num - (hours * 3600)) / 60); + let seconds = sec_num - (hours * 3600) - (minutes * 60); + + if (hours < 10) { + hours = '0' + hours; + } + if (minutes < 10) { + minutes = '0' + minutes; + } + if (seconds < 10) { + seconds = '0' + seconds; + } + + if (hours === '00') { + return minutes+':'+seconds; + } else { + return hours+':'+minutes+':'+seconds; + } +} diff --git a/packages/ui/package.json b/packages/ui/package.json new file mode 100644 index 0000000000..f3ac87fda9 --- /dev/null +++ b/packages/ui/package.json @@ -0,0 +1,86 @@ +{ + "name": "@nuclear/ui", + "version": "0.5.1", + "description": "Nuclear - UI components", + "author": "nukeop ", + "homepage": "https://github.com/nukeop/nuclear/tree/master/packages/ui#readme", + "license": "AGPL-3.0", + "scripts": { + "storybook": "start-storybook -p 9001 -c .storybook", + "lint:fix": "eslint lib --fix", + "test": "eslint lib && ava" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/nukeop/nuclear.git" + }, + "bugs": { + "url": "https://github.com/nukeop/nuclear/issues" + }, + "devDependencies": { + "@babel/core": "^7.6.2", + "@babel/plugin-proposal-object-rest-spread": "^7.6.2", + "@babel/polyfill": "^7.6.0", + "@babel/preset-env": "^7.6.2", + "@babel/preset-react": "^7.0.0", + "@babel/register": "^7.6.2", + "@storybook/addon-actions": "^3.4.12", + "@storybook/addon-knobs": "^3.4.12", + "@storybook/addon-links": "^3.4.10", + "@storybook/cli": "^5.2.1", + "@storybook/react": "^5.2.1", + "ava": "^2.4.0", + "babel-eslint": "^7.2.3", + "babel-loader": "^8.0.6", + "css-loader": "^1.0.0", + "enzyme": "^3.10.0", + "enzyme-adapter-react-16": "^1.1.1", + "eslint": "^5.16.0", + "eslint-plugin-import": "^2.14.0", + "eslint-plugin-node": "^10.0.0", + "eslint-plugin-react": "^7.11.0", + "eslint-plugin-react-hooks": "^2.1.1", + "ignore-styles": "^5.0.1", + "jsdom": "^11.12.0", + "mini-css-extract-plugin": "^0.4.1", + "node-sass": "^4.9.2", + "optimize-css-assets-webpack-plugin": "^5.0.0", + "react-hot-loader": "^4.3.4", + "sass-loader": "^7.0.3", + "style-loader": "^0.21.0", + "uglifyjs-webpack-plugin": "^1.2.7", + "webpack": "^4.16.3", + "webpack-cli": "^3.1.0", + "webpack-dev-server": "^3.1.5" + }, + "dependencies": { + "classnames": "^2.2.6", + "prop-types": "^15.6.2", + "react": "^16.4.1", + "react-dom": "^16.4.1" + }, + "ava": { + "babel": { + "testOptions": { + "presets": [ + "@babel/preset-react" + ], + "plugins": [ + "@babel/plugin-syntax-jsx", + "@babel/plugin-proposal-object-rest-spread" + ] + } + }, + "require": [ + "@babel/register", + "@babel/polyfill", + "ignore-styles" + ], + "files": [ + "!test/helpers" + ] + } +} diff --git a/packages/ui/resources/Lato-latin-ext.woff2 b/packages/ui/resources/Lato-latin-ext.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..d57c27a378d4b96c774434f6586931ae3fe45e89 GIT binary patch literal 5296 zcmV;h6i@4SPew8T0RR9102HtQ5C8xG04%To02EdL0RR9100000000000000000000 z0000Rfi4^>24DbW2rdbYWf2Stx_GxN3swLDHUcCAfgS`P1%(&~f({Hz8*eEy1Hr}t z1lV^bvj6hH93m$Epj{D&#wKEO+wnEc>=E1Mmn&!T9fc$O zS*H8ix-z_lm~}9G^sSS?fDV>FIE;{F7XJJ9XP^62)uktKH_snQpSV9zrU3vu0>H4> zgeLB6mNVz(Xq-BM98H)z~|5a6| zlnM_I=chC zT?QbW5Ev#^-{x(YIYS_f<}?l@+sAM6=ED!Y?zpqOTL^4;4Mm>f(Cei~W%ru21is{v zyMk}XW%9&);%KL5Fq|o^>iv66wT1-g3yA=r-FCD73%-zFtJ^3Ue(rE{pwBh?%%f2O zia6<;Idx^^nsQiU3&6Jk{O{=qSa5(t;su)=5%zWBd2MXZ-Vs!^r+5{pREyQOo`*ua zQYv31>b~{$Tz9Mg{QqEedUbp?u=)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-dO4eJf&2()b3IoVk@)1 zla!V9o@(>Tx&>=F!38;RGeFW4f_(REw$PNv-jBkL-F?ZA^_{P~BrI7o%pUpLNY^sq_`E`H45>4 z8Ux91<-OIC^U#5 z;3QgyR)XJ8kYWbUmow-h?^Yf=5(P0Bq#-f6Zm+45TOS>=An(A9okWT+L!aUc$Z-;< zm|Fu0AxG0{Tyt;*bgbNe^SiqGo*o_b_ew42cLac6eXF>+J^kNTmd5{U>#@QGpkV+A z%1>500L?C3%CR8ohn?OKxSkii0qO1JUvs7+5b1v67Jr~SLp-^;^mzsHvz14uii=4D z9V&?dm;-J)vqZeyrpcRMeKb$76v#djy3&w4E%NguA~ zkem6RI8B=MXjQ9Pjdloza!d#j0U-fyDU)lDDANPcu7^gG2Bi!tAXGZkE7isb5znYr zrHbdx2u83RH;p+R-M#}h(t{cM)TB4HQKree=4Qg4}JadxC%nXNd|2ayu&C< zI0DL&xGX6mACaz^uN7?9r3pvZNhY+ZrRO7rcz;!+=ww2*jsW}G8m=YpdY&SM0Q3bZ zuv_iR?xA;&Qw;?qWDq&Mr?=xI1GYo)wc7d?$5II}ze$JIa8(n5adE7*_NRGLe0-so z&jGEOC$!<2j%&dCqP0H%N%Eyjq~ZVo>vrAh*Y^d048u7?C`^=Si8AOE>6N2`|MS0+ zGJoQ&TvgT7@fY56La_Q8Xvp9A$PjglIjpw5VHShB+(Fp;$&BU zpJQ%7<=p_G+!vnzu^AHQ>RRQM_R}?6$8vw$raH;Dy@mg-leIc=6T^#f+TX^XPYwVl C-#>}~ literal 0 HcmV?d00001 diff --git a/packages/ui/resources/Lato-latin.woff2 b/packages/ui/resources/Lato-latin.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..b14c76cab32daeac6287bfad409cfd73c63504d5 GIT binary patch literal 23316 zcmY)VV~{R9(*+8T_Sm-e*!Emw+qP}nwr$(CZQHi7XTJM+Pt|woBtKF~Ro6;-b-L0? z$4yR@2?!YIzoLZ-g!sSqDi{bzv+e&G`(OY6TX2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BP8nbEe)E4$FeJd_#{xh=)%|`ct9%ubgui=rR{T+#doAh9qw@eOn8~YawNa`z zlG^8ZAJHUQiS*T0`|8tI>u+q2Ti-+Sx~;?L_F+gKiDou6FYKV(fCw?2i)3sX&imt^ zCX|OzG}Endh<1<&f%a-<(Fw^TRc3N@)dh;{1aQ7(xEpq^AAeY<;@cn;D2XPEtnsxq z07dq~A=>eioxW0BFDXQ!A2NIHg**x-U&rzycujbY(FZ5X; zFY8mw!Rje6{$qd12PXH;8?6Lm1#WBYCtG3{RvdtDPpuIgf7#%EpaD$prnI?RRK0hr z*MWDNd5w2F&kI|Am3sEuteozDGBT-Ara(TuatOgRLLfxKi-3o%SrM-0s`)^yMD$KpkahoBHol+yzx!U9w;U_O=>ZOJ3Jt5JnA8sf-? zMO$0t(m4_woE4f&z%o(YES!6;NH}8wevRhC5n|%A2KaZXwVJT)1W?MW=s|6bxWHOpFR)R zpxcsrK91XM`OhztdPjfsy*arwhG_jv=LbKz;uXJ?=SK4@cg=V5eOTi+zxb8jYj5>1 zC{U`u+@$6#rUjWn=^R~TGjvn literal 0 HcmV?d00001 diff --git a/packages/ui/resources/Lato.css b/packages/ui/resources/Lato.css new file mode 100644 index 0000000000..bb2d4e5934 --- /dev/null +++ b/packages/ui/resources/Lato.css @@ -0,0 +1,16 @@ +/* latin-ext */ +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 400; + src: local('Lato Regular'), local('Lato-Regular'), url(./Lato-latin-ext.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 400; + src: local('Lato Regular'), local('Lato-Regular'), url(./Lato-latin.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} diff --git a/packages/ui/stories/index.js b/packages/ui/stories/index.js new file mode 100644 index 0000000000..d6d73007a3 --- /dev/null +++ b/packages/ui/stories/index.js @@ -0,0 +1,9 @@ +import React from 'react'; +import { storiesOf } from '@storybook/react'; + +import {Cover} from '@nuclear/ui'; + +storiesOf('Cover', module) + .add('Basic', () => ( + + )); diff --git a/packages/ui/stories/index.stories.js b/packages/ui/stories/index.stories.js new file mode 100644 index 0000000000..3ee87471c5 --- /dev/null +++ b/packages/ui/stories/index.stories.js @@ -0,0 +1,164 @@ +import React from 'react'; +import { storiesOf } from '@storybook/react'; + +import {Cover, Seekbar, QueueItem, Loader} from '..'; +import { formatDuration } from '../lib/utils'; +import './styles.scss'; + +storiesOf('Cover', module) + .add('Basic', () => ( + + )); + +storiesOf('Seekbar', module) + .add('Basic', () => { + return ( +

+ Seekbars filled to various levels. +

+ 60%: + +
+ 70%: + +
+ 80%: + +
+ 30%: + +
+ 10%: + +
+
+ ); + }); + +storiesOf('QueueItem', module) + .add('Basic', () => { + return ( +
+ { + alert('Item selected'); + }} + removeFromQueue={() => { + alert('Item removed from queue'); + }} + /> +
+ ); + }) + .add('Loading', () => { + return ( +
+ { + alert('Item selected'); + }} + removeFromQueue={() => { + alert('Item removed from queue'); + }} + /> +
+ ); + }) + .add('Current', () => { + return ( +
+ { + alert('Item selected'); + }} + removeFromQueue={() => { + alert('Item removed from queue'); + }} + /> +
+ ); + }); + + +storiesOf('Loader', module) + .add('Default', () => { + return ( +
+ +
+ ); + }) + .add('Circle', () => { + return ( +
+ +
+ ); + }) + .add('Small', () => { + return ( +
+ +
+ ); + }); diff --git a/packages/ui/stories/styles.scss b/packages/ui/stories/styles.scss new file mode 100644 index 0000000000..4e3d41cb19 --- /dev/null +++ b/packages/ui/stories/styles.scss @@ -0,0 +1,9 @@ +html, +body, +.sb-main { + height: 100%; + width: 100%; + margin: 0; + box-sizing: border-box; +} + diff --git a/packages/ui/stories/toasts.stories.js b/packages/ui/stories/toasts.stories.js new file mode 100644 index 0000000000..093d5b0957 --- /dev/null +++ b/packages/ui/stories/toasts.stories.js @@ -0,0 +1,135 @@ +import React from 'react'; +import _ from 'lodash'; +import { storiesOf } from '@storybook/react'; + +import {ToastContainer} from '..'; +import './toasts.styles.scss'; + +storiesOf('Toasts', module) + .add('Toast types', () => { + return ( +
+ + }, + { + title: 'Error notification', + details: 'Error notification description', + error: true + }, + { + title: 'Warning notification', + details: 'Warning notification description', + warning: true + }, + { + title: 'Example info toast', + details: 'Toast notification description', + icon: , + info: true + }, + { + title: 'Example success toast', + details: 'Toast notification description', + icon: , + success: true + } + ]} + /> +
+ ); + }) + .add('With add/remove button', () => { + class Demo extends React.Component { + constructor(props) { + super(props); + this.state = { + toasts: [] + }; + } + + addToast() { + const newToasts = Object.assign([], this.state.toasts); + newToasts.push({ + title: 'Example toast', + details: 'Example toast description' + }); + this.setState({toasts: newToasts}); + return false; + } + + removeToast() { + const newToasts = Object.assign([], this.state.toasts); + newToasts.shift(); + this.setState({toasts: newToasts}); + return false; + } + + render() { + return ( + + ); + } + } + + return ; + }) + .add('Clickable toasts', () => { + + return ( +
+ alert('You clicked me') + } + ]} + /> +
+ ); + }); diff --git a/packages/ui/stories/toasts.styles.scss b/packages/ui/stories/toasts.styles.scss new file mode 100644 index 0000000000..f9bdc938bf --- /dev/null +++ b/packages/ui/stories/toasts.styles.scss @@ -0,0 +1,17 @@ +.buttons { + position: absolute; + display: flex; + flex-flow: column; + + width: 200px; + z-index: 2; +} + +.toast-button { + background: #44475a; + color: #FAFAFA; + text-decoration: none; + padding: 1em 1.5em; + margin: 1em; + cursor: pointer; +} diff --git a/packages/ui/test/enzyme.cover.test.js b/packages/ui/test/enzyme.cover.test.js new file mode 100644 index 0000000000..0176b423da --- /dev/null +++ b/packages/ui/test/enzyme.cover.test.js @@ -0,0 +1,18 @@ +import test from 'ava'; +import React from 'react'; +import { shallow, configure } from 'enzyme'; +import Adapter from 'enzyme-adapter-react-16'; + +import './helpers/setup'; +import {Cover} from '..'; + +configure({ adapter: new Adapter() }); + +test('shallow', (t) => { + const wrapper = shallow(); + t.is(wrapper.containsMatchingElement( +
+ +
+ ), true); +}); diff --git a/packages/ui/test/helpers/setup.js b/packages/ui/test/helpers/setup.js new file mode 100644 index 0000000000..1bb92e0a17 --- /dev/null +++ b/packages/ui/test/helpers/setup.js @@ -0,0 +1,21 @@ +const { JSDOM } = require('jsdom'); + +const jsdom = new JSDOM(''); +const { window } = jsdom; + +function copyProps(src, target) { + const props = Object.getOwnPropertyNames(src) + .filter(prop => typeof target[prop] === 'undefined') + .reduce((result, prop) => ({ + ...result, + [prop]: Object.getOwnPropertyDescriptor(src, prop) + }), {}); + Object.defineProperties(target, props); +} + +global.window = window; +global.document = window.document; +global.navigator = { + userAgent: 'node.js' +}; +copyProps(window, global);