diff --git a/README.md b/README.md index 73348e10..254fda47 100755 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ This repository contains a number of different things: 1. `packages/webamp`: The code for the [Webamp NPM module](https://www.npmjs.com/package/webamp) 2. `packages/webamp/demo`: The code for the demo site which lives at [webamp.org](https://webamp.org), see the next section for more details -3. `packages/webamp/examples`: A few small examples showing how to use the NPM module +3. `examples`: A few small examples showing how to use the NPM module 4. `packages/*`: A few small projects that are either related to Webamp, or may some day be a part of Webamp ## About the Demo Site @@ -47,70 +47,6 @@ Additionally, it makes use of some private Webamp APIs to add the following func - [Butterchun](https://github.com/jberg/butterchurn) integration to render [MilkDrop](https://en.wikipedia.org/wiki/MilkDrop) visualizations. We intend to make this part of the public API soon. - "Screenshot" mode `https://webamp.org/?screenshot=1` which can be used together with [Puppeteer](https://github.com/GoogleChrome/puppeteer) to automate the generation of Winamp skin screenshots -- - -## Development - -I do most development by starting the demo site in dev mode and iterating that way. The following commands will install all dependencies, run an initial development build and then start a local server. Every time you save a file, it will rebuild the bundle and automatically refresh the page. - - # Clone the repo - cd webamp - # __Note:__ Please use yarn over npm, since yarn will respect our `yarn.lock` file - yarn install - yarn start - -`http://localhost:8080/` should automatically open in your browser. - - # Run tests and lint checks - yarn test - -## Building the demo site (webamp.org) - -To do an optimized build of the demo site, you can run: - - yarn run build - -If you wish to test this build locally, run: - - yarn run serve - -Then open the local ip/port that is output to the console in your browser. - -## Building the NPM module - -The NPM module is built separately from the demo site. To build it run: - - yarn run build-library - -This will write files to `./built`. - -## Testing - - yarn test - -This will run the tests the linter and the type checker. - -To update snapshots run - - yarn test -u - -## Deploying the Demo Site - -[Netlify](https://www.netlify.com/) watches GitHub for new versions of master. When a new version is seen, it is automatically built using `npm run build` and pushed to the server. Additionally, Netlify will run a build on every pull request and include a link under the heading "Deploy preview ready!". This enables easy high level testing of pull requests. - -In short, deploying should be as simple as pushing a commit to master. - -Additionally, if you want to fork the project, deploying should be as simple as setting up a free Netlify account. - -### Advanced Usage - -There are some "feature flags" which you can manipulate by passing a specially crafted URL hash. Simply supply a JSON blob after the `#` of the URL to change these settings: - -- `skinUrl` (string) Url of the default skin to use. Note, this file must be served with the correct Allows Origin header. -- `audioUrl` (string) Url of the default audio file to use. Note, this file must be served with the correct Allows Origin header. -- `initialState` (object) Override the [initial Redux state](js/reducers/index.ts). Values from this object will be recursively merged into the actual default state. - -**Note:** These are intended mostly as development tools and are subject to change at any time. ## Community diff --git a/packages/webamp/docs/architecture.md b/docs/architecture.md similarity index 100% rename from packages/webamp/docs/architecture.md rename to docs/architecture.md diff --git a/packages/webamp/docs/music-credits.md b/docs/music-credits.md similarity index 100% rename from packages/webamp/docs/music-credits.md rename to docs/music-credits.md diff --git a/packages/webamp/docs/press.md b/docs/press.md similarity index 100% rename from packages/webamp/docs/press.md rename to docs/press.md diff --git a/packages/webamp/docs/usage.md b/docs/usage.md similarity index 100% rename from packages/webamp/docs/usage.md rename to docs/usage.md diff --git a/packages/webamp/examples/minimal/README.md b/examples/minimal/README.md similarity index 100% rename from packages/webamp/examples/minimal/README.md rename to examples/minimal/README.md diff --git a/packages/webamp/examples/minimal/index.html b/examples/minimal/index.html similarity index 100% rename from packages/webamp/examples/minimal/index.html rename to examples/minimal/index.html diff --git a/packages/webamp/examples/minimalMilkdrop/README.md b/examples/minimalMilkdrop/README.md similarity index 100% rename from packages/webamp/examples/minimalMilkdrop/README.md rename to examples/minimalMilkdrop/README.md diff --git a/packages/webamp/examples/minimalMilkdrop/index.html b/examples/minimalMilkdrop/index.html similarity index 100% rename from packages/webamp/examples/minimalMilkdrop/index.html rename to examples/minimalMilkdrop/index.html diff --git a/packages/babel-test/.gitignore b/examples/parcel/.gitignore similarity index 100% rename from packages/babel-test/.gitignore rename to examples/parcel/.gitignore diff --git a/packages/babel-test/index.html b/examples/parcel/index.html similarity index 100% rename from packages/babel-test/index.html rename to examples/parcel/index.html diff --git a/examples/parcel/index.js b/examples/parcel/index.js new file mode 100644 index 00000000..ab03d38b --- /dev/null +++ b/examples/parcel/index.js @@ -0,0 +1,4 @@ +import Webamp from "webamp"; + +const webamp = new Webamp(); +webamp.renderWhenReady(document.getElementById("app")); diff --git a/packages/babel-test/package.json b/examples/parcel/package.json similarity index 100% rename from packages/babel-test/package.json rename to examples/parcel/package.json diff --git a/packages/webamp/examples/readme.md b/examples/readme.md similarity index 87% rename from packages/webamp/examples/readme.md rename to examples/readme.md index de5a0db9..29899d1f 100644 --- a/packages/webamp/examples/readme.md +++ b/examples/readme.md @@ -4,6 +4,7 @@ This directory contains a number of examples of how to add Webamp to a project. - [Minimal](./minimal) Stick Webamp in a `