Skip to content

Commit

Permalink
[added] experiments package
Browse files Browse the repository at this point in the history
Reviewers: featherless, O2 Material Motion

Reviewed By: featherless, O2 Material Motion

Tags: #material_motion

Differential Revision: http://codereview.cc/D1816
  • Loading branch information
appsforartists committed Nov 1, 2016
1 parent 71d636c commit b19d922
Show file tree
Hide file tree
Showing 5 changed files with 2,698 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/experiments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## License ##

[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0)
95 changes: 95 additions & 0 deletions packages/experiments/devServer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/** @license
* Copyright 2016 - present The Material Motion Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* @flow
*/

// Quick and dirty Webpack config for prototyping. Eventually, we'll have a
// proper build system and can reevaluate whether or not to use Webpack for
// prototyping.

const Webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');

const HOST = 'localhost';
const PORT = 8080;

const settings = {
devtool: 'cheap-module-eval-source-map',

entry: {
parallax: [
// 'react-hot-loader/patch',
'webpack-dev-server/client?http://' + HOST + ':' + PORT,
'webpack/hot/dev-server',
'./src/domain-mapping/examples/parallax/main.ts',
],
},

resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},

module: {
loaders: [
{
test: /\.tsx?$/, loader: 'ts-loader',
},
],
},

output: {
filename: '[name].js',
// publicPath: `http://${ HOST }:${ PORT }/`,
pathinfo: true,
},

plugins: [
new Webpack.HotModuleReplacementPlugin(),

new Webpack.DefinePlugin(
{
'process.env': {
NODE_ENV: '"local"',
},
}
),
],
};


// Webpack is a pain-in-the-ass to configure correctly, so we follow the
// example of the great Dan Abramov:
// https://github.com/gaearon/react-hot-boilerplate/blob/f134ff335d26f1b0369e65a9309b4ec1a38a2581/server.js

module.exports = new WebpackDevServer(
Webpack(settings),
{
// publicPath: settings.output.publicPath,
hot: true,
historyApiFallback: true,
}
).listen(
PORT,
HOST,

function(error, result) {
if (error) {
return console.log(error);
}

console.info(`Starting Webpack Dev Server on ${ HOST }:${ PORT }…`);
}
);
48 changes: 48 additions & 0 deletions packages/experiments/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "material-motion-experiments",
"version": "0.0.0",
"description": "Experimental features for Material Motion, that may eventually graduate to supported features.",
"main": "dist/index.js",
"types": "src/index.ts",
"scripts": {
"build": "$(npm bin)/tsickle",
"start": "node ./devServer.js"
},
"dependencies": {
"material-motion-runtime": "1.0.0"
},
"devDependencies": {
"lerna": "2.0.0-beta.30",
"ts-loader": "^0.9.5",
"tsickle": "0.2.0",
"typescript": "2.0.3",
"webpack": "2.1.0-beta.25",
"webpack-dev-server": "2.1.0-beta.9"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com:material-motion/material-motion-js.git"
},
"keywords": [
"animation",
"gestures",
"interactive",
"material",
"motion",
"multitouch",
"observables",
"odeon",
"parallax",
"physics",
"springs",
"touch",
"transitions",
"tweens"
],
"author": "The Material Motion Authors (see AUTHORS)",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/material-motion/material-motion-js/issues/"
},
"homepage": "https://github.com/material-motion/material-motion-js/#readme"
}
23 changes: 23 additions & 0 deletions packages/experiments/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"//": [
"This is a copy of material-motion-runtime's tsconfig. Eventually,",
"we should consolidate them at the project root.",
"https://github.com/material-motion/material-motion-experiments-js/issues/70"
],
"include": ["./src/**/*"],
"exclude": ["**/*.test.*"],
"compilerOptions": {
"lib": [
"es2015",
"dom"
],
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitThis": true,
"outDir": "dist",
"sourceMap": true,
"strictNullChecks": true,
"target": "es6"
}
}
Loading

0 comments on commit b19d922

Please sign in to comment.