Skip to content
This repository was archived by the owner on Jun 3, 2022. It is now read-only.

Commit 149bc2b

Browse files
committed
Merge branch 'release/v1.0.0' into stable
2 parents fadf699 + d175245 commit 149bc2b

File tree

10 files changed

+179
-59
lines changed

10 files changed

+179
-59
lines changed

.lesshintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"fileExtensions": [".less", ".css"],
3+
"idSelector": false,
4+
"importantRule": false,
5+
"zeroUnit": false
6+
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.0
2+
3+
Remixer v1.0.0 Release.
4+
15
## 0.7.0
26

37
Note: Versioning bumped in sync with [material-remixer](https://www.npmjs.com/package/material-remixer) dependency.

README.md

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,33 @@
44

55
[![Build Status](https://travis-ci.org/material-foundation/material-remixer-remote-web.svg?branch=develop)](https://travis-ci.org/material-foundation/material-remixer-remote-web) [![npm version](https://badge.fury.io/js/material-remixer-remote-web.svg)](https://badge.fury.io/js/material-remixer-remote-web)
66

7-
If enabled, the variables defined in your app will be exposed on a remote controller website that you can set up using Firebase hosting. Share the link to this site with your teammates from within the Remixer overlay or by emailing them. The remote controller allows updating the defined variables, and changes will be propagated in real-time across associated apps.
8-
9-
If you are interested in using Remixer in another platform, you may want to check out the [iOS](https://github.com/material-foundation/material-remixer-ios), [Android](https://github.com/material-foundation/material-remixer-android), and [JavaScript](https://github.com/material-foundation/material-remixer-js) repos. With any of the three platforms you can use this Remote Controller to change the variables from a web dashboard.
10-
11-
**New to Remixer?** Visit our [main repo](https://github.com/material-foundation/material-remixer) to get a full description of what it is and how it works.
7+
The Remixer variables defined in your app can be exposed on a remote controller
8+
website that you can set up using Firebase hosting. The remote controller allows
9+
updating your defined variables, and changes will be propagated in real-time
10+
across associated apps. Share the link to this site with your teammates from
11+
within the Remixer overlay or by emailing them.
12+
13+
If you are interested in using Remixer on another platform, you may want to
14+
check out the [iOS](https://github.com/material-foundation/material-remixer-ios),
15+
[Android](https://github.com/material-foundation/material-remixer-android),
16+
and [JavaScript](https://github.com/material-foundation/material-remixer-js)
17+
repos. You can use this Remote Controller with any of these three platforms to
18+
change the variables from a web dashboard.
19+
20+
**New to Remixer?** Visit our [main repo](https://github.com/material-foundation/material-remixer)
21+
to get a full description of what it is and how it works.
1222
- - -
1323

1424
## Quickstart
1525

1626
#### 1. Sign up for Firebase.
1727

18-
Remixer remote will work with any new or existing Firebase account. It will use the [Firebase Hosting](https://firebase.google.com/docs/hosting/) feature to host this remote controller. If you don't have an existing Firebase account you wish to use, you can signup following instructions [here](https://firebase.google.com).
28+
Remixer remote will work with any new or existing Firebase account. It will use
29+
the [Firebase Hosting](https://firebase.google.com/docs/hosting/) feature to
30+
host this remote controller. If you don't have an existing Firebase account you
31+
wish to use, you can signup following instructions [here](https://firebase.google.com).
1932

20-
#### 2. Use `npm` to install the necessary dependencies.
33+
#### 2. Use [`npm`](https://www.npmjs.com/) to install the necessary dependencies.
2134

2235
```bash
2336
# Run the following script from root of this repo
@@ -26,7 +39,8 @@ npm install
2639

2740
#### 3. Add your Firebase credentials.
2841

29-
Add your Firebase credentials to the `index.html` file located in the `src` folder.
42+
Add your Firebase credentials to the `index.html` file located in the `src`
43+
folder.
3044

3145
```javascript
3246
// TODO: Replace with your project's info.
@@ -39,10 +53,12 @@ var config = {
3953

4054
#### 4. Build and deploy the library to your Firebase Hosting account.
4155

42-
Running the following script will generate a new `public` folder first with all of the required files. It will then copy these files to your Firebase Hosting storage.
56+
Running the following script will generate a new `public` folder first with all
57+
of the required files. It will then copy these files to your Firebase Hosting
58+
storage.
4359

4460
```bash
45-
# Run the following script from root of this repo
61+
# Run the following script from root of this repo.
4662
npm run deploy -- --project=<PROJECT_ID>
4763
```
4864

@@ -53,13 +69,22 @@ The Remixer remote controller will now be available at:
5369
https://<PROJECT_ID>.firebaseapp.com/<REMOTE_ID>
5470
```
5571

56-
## Is material-foundation affiliated with Google?
72+
## Contributing to Remixer Remote for Web
73+
74+
We're excited you want to contribute to the project! Please read these docs so
75+
we can get your contributions submitted quickly.
5776

58-
Yes, the [material-foundation](https://github.com/material-foundation) organization is one of Google's new homes for tools and frameworks related to our [Material Design](https://material.io) system. Please check out our blog post [Design is Never Done](https://design.google.com/articles/design-is-never-done/) for more information regarding Material Design and how Remixer integrates with the system.
77+
- [Contribution policy and guidelines](https://github.com/material-foundation/material-remixer-remote-web/blob/develop/CONTRIBUTING.md)
78+
- [Developing Remixer Remote for Web](https://github.com/material-foundation/material-remixer-remote-web/blob/develop/docs/developing.md)
5979

60-
## Contributing
80+
## Is material-foundation affiliated with Google?
6181

62-
We gladly welcome contributions! If you have found a bug, have questions, or wish to contribute, please follow our [Contributing Guidelines](https://github.com/material-foundation/material-remixer-remote-web/blob/develop/CONTRIBUTING.md).
82+
Yes, the [material-foundation](https://github.com/material-foundation)
83+
organization is one of Google's new homes for tools and frameworks related to
84+
our [Material Design](https://material.io) system. Please check out our blog
85+
post [Design is Never Done](https://design.google.com/articles/design-is-never-done/)
86+
for more information regarding Material Design and how Remixer integrates with
87+
the system.
6388

6489
## License
6590

docs/developing.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Developing Remixer Remote for Web
2+
3+
### Setting up your development environment
4+
5+
First you'll need a recent version of [Node.js](https://nodejs.org) to work
6+
with Remixer Remote.
7+
8+
Once node is installed, simply clone our repo (or your fork of it) and
9+
run `npm install`.
10+
11+
```bash
12+
git clone [email protected]:material-foundation/material-remixer-remote-web.git
13+
cd material-remixer-remote-web && npm install
14+
```
15+
16+
### Typescript
17+
18+
The source code for Remixer Remote is written in
19+
[Typescript](https://www.typescriptlang.org), and compiled to es5 javascript for
20+
distribution.
21+
22+
### Building Remixer
23+
24+
Use any of the following npm scripts to build dev or prod versions of Remixer
25+
Remote.
26+
27+
```bash
28+
# Builds an unminified version of Remixer Remote within the build folder.
29+
npm run build:dev
30+
31+
# Builds a minified version.
32+
npm run build:prod
33+
34+
# Builds both unminified and minified versions.
35+
npm run build
36+
```
37+
38+
### Running the development server
39+
40+
We use [weback dev server](https://webpack.js.org/configuration/dev-server) for
41+
hosting and live-reloading of any code changes.
42+
43+
```bash
44+
npm run dev
45+
open http://localhost:9000
46+
```
47+
48+
### Linting
49+
50+
```bash
51+
# Lint both CSS/LESS using lesshint.
52+
npm run lint:css
53+
54+
# Lint typescript using tslint.
55+
npm run lint:ts
56+
57+
# Lints both css and ts.
58+
npm run lint
59+
```
60+
61+
### Testing and Code Coverage
62+
63+
Testing uses the [karma](https://karma-runner.github.io) test runner with
64+
[mocha](https://mochajs.org/) flavored testing framework. Code coverage
65+
is reported by [istanbul](https://www.npmjs.com/package/istanbul-instrumenter-loader).
66+
67+
```bash
68+
# Run tests and code coverage once.
69+
npm run test
70+
71+
# Run with auto-watch indefinitely.
72+
npm run test:watch
73+
```

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "material-remixer-remote-web",
3-
"version": "0.7.0",
3+
"version": "1.0.0",
44
"description": "A hosted remote controller for a Remixer target app.",
55
"homepage": "https://github.com/material-foundation/material-remixer",
66
"author": "The Material Remixer Authors (see AUTHORS)",
@@ -29,7 +29,11 @@
2929
"deploy": "npm run dist && firebase deploy",
3030
"dev": "npm run clean:build && npm run build && cross-env RMX_ENV=production webpack-dev-server",
3131
"dist": "npm run clean && npm run build && npm run copy",
32-
"test": "karma start"
32+
"lint:ts": "tslint --fix --force 'src/**/*.ts?(x)'",
33+
"lint:css": "lesshint src/*.css",
34+
"lint": "npm-run-all --parallel lint:*",
35+
"test": "karma start",
36+
"test:watch": "karma start --no-single-run"
3337
},
3438
"devDependencies": {
3539
"@types/chai": "^3.4.35",
@@ -57,18 +61,20 @@
5761
"karma-webpack": "^2.0.2",
5862
"less": "^2.7.2",
5963
"less-loader": "^4.0.2",
64+
"lesshint": "^3.1.1",
6065
"mkdirp": "^0.5.1",
6166
"mocha": "^3.2.0",
6267
"npm-run-all": "^4.0.2",
6368
"react-addons-test-utils": "^15.4.2",
6469
"style-loader": "^0.16.1",
6570
"ts-loader": "^2.0.3",
6671
"tslint": "^4.0.2",
72+
"tslint-react": "^2.5.0",
6773
"typescript": "^2.1.6",
6874
"webpack": "^2.3.2",
6975
"webpack-dev-server": "^2.4.2"
7076
},
7177
"dependencies": {
72-
"material-remixer": "^0.7.0"
78+
"material-remixer": "^1.0.0"
7379
}
7480
}

src/PageLayout.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
* under the License.
1515
*/
1616

17-
import * as React from "react";
17+
import * as React from 'react';
1818

1919
/** Returns a stateless page layout template. */
2020
export function PageLayout(props: any) {
2121
return (
22-
<div className="mdl-layout mdl-js-layout mdl-layout--fixed-header">
23-
<header className="mdl-layout__header">
24-
<div className="mdl-layout__header-row">
25-
<img src="remixer.svg" alt="Remixer Remote" />
22+
<div className='mdl-layout mdl-js-layout mdl-layout--fixed-header'>
23+
<header className='mdl-layout__header'>
24+
<div className='mdl-layout__header-row'>
25+
<img src='remixer.svg' alt='Remixer Remote' />
2626
</div>
2727
</header>
28-
<main className="mdl-layout__content">
29-
<div className="page-content">
28+
<main className='mdl-layout__content'>
29+
<div className='page-content'>
3030
{props.children}
3131
</div>
3232
</main>

src/RemoteController.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
* under the License.
1515
*/
1616

17-
import * as React from "react";
18-
import * as ReactDOM from "react-dom";
17+
import * as React from 'react';
18+
import * as ReactDOM from 'react-dom';
1919

20-
import "../node_modules/material-remixer/src/ui/styles/overlay.less";
20+
import '../node_modules/material-remixer/src/ui/styles/overlay.less';
2121

22-
import { remixer } from "../node_modules/material-remixer/src/core/Remixer";
23-
import { ConstraintType, DataType } from "../node_modules/material-remixer/src/lib/Constants";
24-
import { LocalStorage } from "../node_modules/material-remixer/src/lib/LocalStorage";
25-
import { OverlayController } from "../node_modules/material-remixer/src/ui/OverlayController";
26-
import { PageLayout } from "./PageLayout";
27-
import { Variable } from "../node_modules/material-remixer/src/core/variables/Variable";
22+
import { remixer } from '../node_modules/material-remixer/src/core/Remixer';
23+
import { Variable } from '../node_modules/material-remixer/src/core/variables/Variable';
24+
import { ConstraintType, DataType } from '../node_modules/material-remixer/src/lib/Constants';
25+
import { LocalStorage } from '../node_modules/material-remixer/src/lib/LocalStorage';
26+
import { OverlayController } from '../node_modules/material-remixer/src/ui/OverlayController';
27+
import { PageLayout } from './PageLayout';
2828

2929
/** The globally exposed library MDL exposes as `window['componentHandler']`. */
3030
declare var componentHandler: any;
@@ -71,14 +71,14 @@ class RemoteController {
7171
* @static
7272
*/
7373
static start(): void {
74-
let instance = this._sharedInstance;
74+
const instance = this._sharedInstance;
7575

7676
// Get remoteId from pathname.
7777
// (ie. https://<PROJECT-ID>.firebaseapp.com/<REMOTE-ID>)
78-
let remoteId = location.pathname.split("/")[1];
78+
const remoteId = location.pathname.split('/')[1];
7979

8080
instance.dbReference = firebase.database().ref(`remixer/${remoteId}`);
81-
instance.dbReference.on("value", (data: any) => {
81+
instance.dbReference.on('value', (data: any) => {
8282
instance.syncData(data.val());
8383
});
8484
}
@@ -90,8 +90,8 @@ class RemoteController {
9090
*/
9191
private syncData(data: any): void {
9292
this.variables = [];
93-
for (let key in data) {
94-
let variable = LocalStorage.deserialize(data[key]);
93+
for (const key of Object.keys(data)) {
94+
const variable = LocalStorage.deserialize(data[key]);
9595
if (variable instanceof Variable) {
9696
this.variables.push(variable);
9797
}
@@ -119,7 +119,7 @@ class RemoteController {
119119

120120
/** Renders the remote controller to the DOM. */
121121
private redraw(): void {
122-
const overlayWrapper = document.getElementById("remixer-remote");
122+
const overlayWrapper = document.getElementById('remixer-remote');
123123
ReactDOM.render(
124124
<div>
125125
<PageLayout>

src/__tests__/RemoteController_test.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import * as React from "react";
2-
import * as TestUtils from "react-addons-test-utils";
3-
import * as chai from "chai";
1+
import * as chai from 'chai';
2+
import * as React from 'react';
3+
import * as TestUtils from 'react-addons-test-utils';
44

5-
import { remixer } from "../../node_modules/material-remixer/src/core/Remixer";
6-
import { CSS } from "../../node_modules/material-remixer/src/lib/Constants";
7-
import { TextFieldControl } from "../../node_modules/material-remixer/src/ui/controls/TextFieldControl";
8-
import { Variable } from "../../node_modules/material-remixer/src/core/variables/Variable";
5+
import { remixer } from '../../node_modules/material-remixer/src/core/Remixer';
6+
import { Variable } from '../../node_modules/material-remixer/src/core/variables/Variable';
7+
import { CSS } from '../../node_modules/material-remixer/src/lib/Constants';
8+
import { TextFieldControl } from '../../node_modules/material-remixer/src/ui/controls/TextFieldControl';
99

1010
const expect = chai.expect;
1111

12-
describe("TextFieldControl", () => {
13-
const key: string = "test_variable";
14-
const initialValue: string = "test string value";
12+
describe('TextFieldControl', () => {
13+
const key: string = 'test_variable';
14+
const initialValue: string = 'test string value';
1515
let variable: Variable;
1616

1717
beforeEach(() => {
@@ -21,21 +21,21 @@ describe("TextFieldControl", () => {
2121
<TextFieldControl
2222
variable={variable}
2323
updateVariable={null}
24-
/>
24+
/>,
2525
);
2626
});
2727

28-
it("should render with proper class name", () => {
29-
let control = TestUtils.findRenderedDOMComponentWithClass(
30-
this.component, CSS.RMX_TEXTFIELD
28+
it('should render with proper class name', () => {
29+
const control = TestUtils.findRenderedDOMComponentWithClass(
30+
this.component, CSS.RMX_TEXTFIELD,
3131
);
3232

3333
expect(TestUtils.isDOMComponent(control)).to.be.true;
3434
});
3535

36-
it("have correct innertext checked value", () => {
37-
let textField = TestUtils.findRenderedDOMComponentWithClass(
38-
this.component, "mdl-textfield__input"
36+
it('have correct innertext checked value', () => {
37+
const textField = TestUtils.findRenderedDOMComponentWithClass(
38+
this.component, 'mdl-textfield__input',
3939
) as HTMLInputElement;
4040

4141
expect(textField.value).to.equal(initialValue);

src/remote-style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ body {
1919
}
2020

2121
.mdl-layout__header {
22+
background-color: #ffffff;
2223
color: rgba(0, 0, 0, 0.8);
23-
background-color: #fff;
2424
}
2525

2626
.mdl-layout__header-row {
@@ -36,7 +36,7 @@ body {
3636
}
3737

3838
#remixer-remote .mdl-card {
39-
background-color: #fff;
39+
background-color: #ffffff;
4040
}
4141

4242
.mdl-card__title {

0 commit comments

Comments
 (0)