Rename module

This commit is contained in:
Jordan Eldredge 2018-04-14 10:01:16 -07:00
parent 9afd9bc3d9
commit 6b4859d43b
10 changed files with 33 additions and 33 deletions

View file

@ -3,9 +3,9 @@ node_js:
- node
script: >
npm run travis-tests # &&
# gzip -c built/winamp.js > built/winamp.js.gz &&
# python node_modules/travis-weigh-in/weigh_in.py built/winamp.js &&
# python node_modules/travis-weigh-in/weigh_in.py built/winamp.js.gz
# gzip -c built/webamp.bundle.min.js > built/webamp.bundle.min.js.gz &&
# python node_modules/travis-weigh-in/weigh_in.py built/webamp.bundle.min.js &&
# python node_modules/travis-weigh-in/weigh_in.py built/webamp.bundle.min.js.gz
after_success:
- bash <(curl -s https://codecov.io/bash)
before_deploy: echo webamp.org > built/CNAME

View file

@ -42,8 +42,8 @@ module.exports = {
// directory, and injects a tag into the gererated index.html file
// it also, applies cache-busting for all the icons.
new WebpackPwaManifest({
name: "Winamp",
short_name: "Winamp", // eslint-disable-line camelcase
name: "Webamp",
short_name: "Webamp", // eslint-disable-line camelcase
description: "Winamp 2.9 reimplemented in HTML5 and JavaScript",
start_url: "./?utm_source=web_app_manifest", // eslint-disable-line camelcase
scope: "./",
@ -70,7 +70,7 @@ module.exports = {
})
],
entry: {
winamp: ["./js/index.js"]
webamp: ["./js/index.js"]
},
output: {
filename: "[name]-[hash].js",

View file

@ -45,12 +45,12 @@ module.exports = {
})
],
entry: {
bundle: "./js/winamp.js",
"bundle.min": "./js/winamp.js"
bundle: "./js/webamp.js",
"bundle.min": "./js/webamp.js"
},
output: {
path: path.resolve(__dirname, "../built"),
filename: "winamp.[name].js",
filename: "webamp.[name].js",
library: "Webamp",
libraryTarget: "umd"
}

View file

@ -33,6 +33,6 @@ const config = merge(common, {
]
});
config.entry.winamp.unshift("./js/googleAnalytics.min.js");
config.entry.webamp.unshift("./js/googleAnalytics.min.js");
module.exports = config;

View file

@ -5,7 +5,7 @@
This repository contains both an NPM module, and a demo page, found at <https://webamp.org>. The NPM module's goal is to provide a widget which can be embedded in any website, where as the demo page depends upon the library, and provides the canonical usage. You can find more information about the library's API in the [usage](./usage.md) document.
* The entry point for the demo page is [index.js](../js/index.js)
* The entry point for the NPM modules is [winamp.js](../js/winamp.js)
* The entry point for the NPM modules is [webamp.js](../js/webamp.js)
## Redux

View file

@ -21,7 +21,7 @@ Or, you can include it via a script tag:
```html
<!-- You can use this URL, or download it and check it into your own project -->
<script src="https://unpkg.com/webamp@0.0.6/built/winamp.bundle.min.js"></script>
<script src="https://unpkg.com/webamp@0.0.6/built/webamp.bundle.min.js"></script>
```
## Create a container
@ -66,7 +66,7 @@ webamp.renderWhenReady(document.getElementById('winamp-container'));
## API
Many methods on the winamp instance deal with `track`s. Here is the shape of a `track`:
Many methods on the webamp instance deal with `track`s. Here is the shape of a `track`:
```JavaScript
const track = {
@ -151,19 +151,19 @@ const options = {
requiresNetwork: true
}]
};
const winamp = new Winamp(options);
const webamp = new Webamp(options);
```
## Instance Methods
The `Winamp` class has the following _instance_ methods:
The `Webamp` class has the following _instance_ methods:
### `appendTracks(tracks)`
Add an array of `track`s (see above) to the end of the playlist.
```JavaScript
winamp.appendTracks([
webamp.appendTracks([
{url: 'https://example.com/track1.mp3'},
{url: 'https://example.com/track2.mp3'},
{url: 'https://example.com/track3.mp3'}
@ -175,7 +175,7 @@ winamp.appendTracks([
Replace the playlist with an array of `track`s (see above) and begin playing the first track.
```JavaScript
winamp.setTracksToPlay([
webamp.setTracksToPlay([
{url: 'https://example.com/track1.mp3'},
{url: 'https://example.com/track2.mp3'},
{url: 'https://example.com/track3.mp3'}
@ -188,8 +188,8 @@ Webamp will wait until it has fetch the skin and fully parsed it, and then rende
```JavaScript
const container = document.getElementById('winamp-container');
winamp.renderWhenReady(container).then(() => {
console.log('rendered winamp!');
webamp.renderWhenReady(container).then(() => {
console.log('rendered webamp!');
});
```
@ -198,8 +198,8 @@ winamp.renderWhenReady(container).then(() => {
A callback which will be called when Webamp is closed. Returns an "unsubscribe" function.
```JavaScript
const unsubscribe = winamp.onClose(() => {
console.log("Winamp closed");
const unsubscribe = webamp.onClose(() => {
console.log("Webamp closed");
});
// If at some point in the future you want to stop listening to these events:
@ -211,8 +211,8 @@ unsubscribe();
A callback which will be called when Webamp is minimized. Returns an "unsubscribe" function.
```JavaScript
const unsubscribe = winamp.onClose(() => {
console.log("Winamp closed");
const unsubscribe = webamp.onClose(() => {
console.log("Webamp closed");
});
// If at some point in the future you want to stop listening to these events:

View file

@ -7,9 +7,9 @@
<body>
<div id='app'></div>
<script src="https://unpkg.com/webamp@0.0.6/built/winamp.bundle.min.js"></script>
<script src="https://unpkg.com/webamp@0.0.6/built/webamp.bundle.min.js"></script>
<script>
const Winamp = window.Webamp;
const Webamp = window.Webamp;
new Webamp({
initialTracks: [{
metaData: {

View file

@ -8,7 +8,7 @@ import visor from "../skins/Vizor1-01.wsz";
import xmms from "../skins/XMMS-Turquoise.wsz";
import zaxon from "../skins/ZaxonRemake1-0.wsz";
import green from "../skins/Green-Dimension-V2.wsz";
import Winamp from "./winamp";
import Webamp from "./webamp";
import {
STEP_MARQUEE,
UPDATE_TIME_ELAPSED,
@ -104,13 +104,13 @@ Raven.context(() => {
if (hideAbout) {
document.getElementsByClassName("about")[0].style.visibility = "hidden";
}
if (!Winamp.browserIsSupported()) {
if (!Webamp.browserIsSupported()) {
document.getElementById("browser-compatibility").style.display = "block";
document.getElementById("app").style.visibility = "hidden";
return;
}
const winamp = new Winamp({
const webamp = new Webamp({
initialSkin: {
url: skinUrl
},
@ -142,5 +142,5 @@ Raven.context(() => {
__customMiddlewares: [analyticsMiddleware, ravenMiddleware]
});
winamp.renderWhenReady(document.getElementById("app"));
webamp.renderWhenReady(document.getElementById("app"));
});

View file

@ -2,10 +2,10 @@
"name": "webamp",
"version": "0.0.6",
"description": "Winamp 2 implemented in HTML5 and JavaScript",
"main": "built/winamp.bundle.js",
"main": "built/webamp.bundle.js",
"files": [
"built/winamp.bundle.js",
"built/winamp.bundle.min.js"
"built/webamp.bundle.js",
"built/webamp.bundle.min.js"
],
"scripts": {
"lint": "eslint .",
@ -14,7 +14,7 @@
"prepublishOnly": "npm run build-library",
"serve": "http-server ./built",
"start": "webpack-dev-server --config=config/webpack.dev.js",
"weight": "echo 'FIXME: Need to find cache-busted file' || (npm run build && gzip-size built/winamp.js)",
"weight": "echo 'FIXME: Need to find cache-busted file' || (npm run build && gzip-size built/webamp.bundle.min.js)",
"test": "jest --coverage",
"travis-tests": "jest --coverage && npm run build",
"tdd": "jest --watch",