Permalink
Browse files

initial commit

  • Loading branch information...
Alexander Pushkov
Alexander Pushkov committed Nov 12, 2016
0 parents commit 129685d37eadb8cb6cbb26a6294e85a1b53b9caa
@@ -0,0 +1,8 @@
[*]
end_of_line = lf
insert_final_newline = true
[*.{js,jsx,json}]
charset = utf-8
indent_style = space
indent_size = 2
@@ -0,0 +1,2 @@
node_modules
dist
@@ -0,0 +1,9 @@
# Contributor Code of Conduct
This project adheres to No Code of Conduct. We are all adults. We accept
anyone's contributions. Nothing else matters.
For more information please visit the
[No Code of Conduct](https://github.com/domgetter/NCoC) homepage.
Contact email: <ale@songbee.net>.
@@ -0,0 +1,34 @@
This project is [unlicensed](http://unlicense.org/). If you want to contribute,
you have to [sign the Copyright wavier][CLA]. Fortunately, it's a matter
of seconds as we use CLAHub: you'll just need to sign in with GitHub and
fill in a few fields (email, name, type “I ARGEE”, and info about if your
employer would be mad at you if you joined our little project).
Here's what you're signing:
---
### Copyright waiver
**for https://github.com/Songbee/desktop**
I dedicate any and all copyright interest in this software to the
public domain. I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors. I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
To the best of my knowledge and belief, my contributions are either
originally authored by me or are derived from prior works which I have
verified are also in the public domain and are not subject to claims
of copyright by other parties.
To the best of my knowledge and belief, no individual, business,
organization, government, or other entity has any copyright interest
in my contributions, and I affirm that I will not make contributions
that are otherwise encumbered.
---
[Click here][CLA] to sign it on CLAHub.
[CLA]: https://www.clahub.com/agreements/Songbee/desktop
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>
@@ -0,0 +1,42 @@
# Songbee
Songbee will be a post-cloud music streaming app, similar
to [Spotify][] or [Deezer][]. The key difference is: it's free and
decentralized, powered by peer-to-peer networks like BitTorrent.
**Status:** nothing works yet. We have an (un-)fancy UI, though.
### Why?
Why not?
### But this is piracy!
Technically, this violates the DMCA, you're right. However, we will cover
for that with optional Bitcoin-powered donations. This would work much like
[Flattr][]: say, you pay $10 per month and listen to Ruby My Dear tracks
15 times and to [sabufaizu][] 20 times this month. Ruby My Dear gets
$10 * (15/35) = $4.28 and sabufaizu gets the rest.
### If the donations are optional, nobody would donate!
Those who don't want to pay wouldn't have paid if Songbee didn't exist.
### Still, this is illegal. Music labels will sue you!
Yeah, well, look at the [Popcorn Time][].
### Okay, copyright fighter, so what's the license?
[Unlicense][]. I wanted to use MIT, but it doesn't really make sense.
If you want to contribute to this project, you'll have to sign
a Copyright wavier — see [CONTRIBUTING](CONTRIBUTING.md).
[Spotify]: https://spotify.com/
[Deezer]: https://deezer.com/
[Flattr]: https://flattr.com/
[sabufaizu]: https://soundcloud.com/sabufaizu
[Unlicense]: http://unlicense.org/
@@ -0,0 +1,23 @@
const gulp = require("gulp");
const rollup = require("gulp-rollup");
const sourcemaps = require("gulp-sourcemaps");
const babel = require("rollup-plugin-babel");
gulp.task("js", () => {
gulp.src("./src/**/*.js")
.pipe(sourcemaps.init())
.pipe(rollup({
entry: ["src/app.js", "src/main.js"],
format: "cjs",
plugins: [babel()]
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest("./dist"));
});
gulp.task("html", () => {
gulp.src("./src/index.html")
.pipe(gulp.dest("./dist"));
});
gulp.task("default", ["html", "js"]);
@@ -0,0 +1,103 @@
{
"name": "songbee-desktop",
"version": "0.1.0",
"description": "A minimal Electron application",
"main": "dist/main.js",
"scripts": {
"start": "electron .",
"build": "gulp"
},
"repository": "https://github.com/Songbee/desktop",
"author": "The Songbee Team",
"license": "SEE LICENSE IN LICENSE.md",
"babel": {
"presets": [
"es2015-rollup",
"es2016",
"es2017",
"stage-0",
"react"
],
"plugins": [
[
"transform-react-jsx",
{
"pragma": "h"
}
]
]
},
"xo": {
"esnext": true,
"extends": "xo-react",
"envs": [
"browser",
"node"
],
"space": 2,
"rules": {
"curly": [
2,
"multi"
],
"quotes": [
1,
"double",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"react/jsx-space-before-closing": [
1,
"always"
],
"react/no-unknown-property": [
2,
{
"ignore": [
"class"
]
}
],
"unicorn/filename-case": [
0
],
"import/no-named-as-default": [
0
]
},
"settings": {
"react": {
"pragma": "h"
}
}
},
"devDependencies": {
"babel-preset-es2015-rollup": "^1.2.0",
"babel-preset-es2016": "^6.16.0",
"babel-preset-es2017": "^6.16.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-0": "^6.16.0",
"electron": "^1.4.1",
"eslint-config-xo-react": "^0.10.0",
"eslint-plugin-react": "^6.6.0",
"gulp": "^3.9.1",
"gulp-rollup": "^2.5.1",
"gulp-sourcemaps": "^2.2.0",
"rollup-plugin-babel": "^2.6.1",
"rollup-stream": "^1.14.0",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"xo": "^0.17.0"
},
"dependencies": {
"disconnect": "^1.0.1",
"history": "^4.4.0",
"photon": "connors/photon",
"preact": "^6.4.0",
"preact-photon": "^1.3.0",
"preact-router": "^2.3.0",
"rollup": "^0.36.3"
}
}
@@ -0,0 +1 @@
@@ -0,0 +1,8 @@
import {h, render} from "preact";
import App from "./components/App";
import createHistory from "history/createMemoryHistory";
const history = window._history = createHistory();
history.getCurrentLocation = () => history.location; // XXX: preact-router needs this
render(<App history={history} />, document.body);
@@ -0,0 +1,27 @@
import {h} from "preact";
import Router from "preact-router";
import {AppHeader, AppSidebar, AppFooter} from "./chrome";
import Home from "./views/Home";
export default ({history}) => (
<div class="window">
<AppHeader />
<section class="window-content">
<div class="pane-group">
<div class="pane-sm sidebar">
<AppSidebar />
</div>
<div class="pane">
<Router history={history}>
<Home path="/" name="Home" />
<Home path="/memes" name="Memes" />
</Router>
</div>
</div>
</section>
<AppFooter />
</div>
);
@@ -0,0 +1,35 @@
/* eslint react/prop-types: [0] */
import {h, Component} from "preact";
class RouteAwareLink extends Component {
constructor(props) {
super(props);
this._history = window._history; // XXX
this.setState({active: false});
}
componentDidMount() {
this._history.listen(this.checkPath);
this.checkPath(this._history.location);
}
checkPath = location => {
const url = `${location.pathname || ""}${location.search || ""}`;
this.setState({
active: url === this.props.href || location.pathname === this.props.href
});
}
render({children, href, className, activeClass, ...props}) {
return (
<a
className={`${props.class} ${className} ${this.state.active ? activeClass : ""}`}
href={href}
{...props}
>{ children }</a>
);
}
}
export default RouteAwareLink;
@@ -0,0 +1,53 @@
import {h} from "preact";
import {Header, Footer} from "preact-photon";
import RouteAwareLink from "./RouteAwareLink";
const AppHeader = () => (
<Header>
<div class="toolbar-actions">
<div class="btn-group">
<button class="btn btn-default">
<span class="icon icon-left-dir" />
</button>
<button class="btn btn-default">
<span class="icon icon-right-dir" />
</button>
</div>
<input class="form-control toolbar-form-control" type="text" placeholder="Search" />
</div>
</Header>
);
const AppSidebar = () => (
<nav class="nav-group">
<h5 class="nav-group-title">Favorites</h5>
<RouteAwareLink href="/" class="nav-group-item" activeClass="active">
<span class="icon icon-home" />
Home
</RouteAwareLink>
<RouteAwareLink href="/memes" class="nav-group-item" activeClass="active">
<span class="icon icon-download" />
Memes
</RouteAwareLink>
<RouteAwareLink href="/memes" class="nav-group-item" activeClass="active">
<span class="icon icon-download" />
Downloads
</RouteAwareLink>
</nav>
);
const AppFooter = () => (
<Footer>
<div class="toolbar-actions">
<button class="btn btn-default">
Cancel
</button>
<button class="btn btn-primary pull-right">
Save
</button>
</div>
</Footer>
);
export {AppHeader, AppSidebar, AppFooter};
No changes.
Oops, something went wrong.

0 comments on commit 129685d

Please sign in to comment.