Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4822b8e
Showing
68 changed files
with
8,177 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"presets": ["react", "es2015", "stage-0"], | ||
|
||
"plugins": [ | ||
"transform-runtime", | ||
"add-module-exports", | ||
"transform-decorators-legacy", | ||
"transform-react-display-name" | ||
], | ||
|
||
"env": { | ||
"development": { | ||
"plugins": [ | ||
"typecheck", | ||
["react-transform", { | ||
"transforms": [{ | ||
"transform": "react-transform-catch-errors", | ||
"imports": ["react", "redbox-react"] | ||
} | ||
] | ||
}] | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
webpack/* | ||
karma.conf.js | ||
tests.webpack.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"extends": "airbnb", | ||
"env": { | ||
"es6": true, | ||
"browser": true, | ||
"node": true, | ||
"mocha": true, | ||
"jasmine": true, | ||
"protractor": true, | ||
}, | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"react/jsx-closing-bracket-location": 0, | ||
"valid-jsdoc": 2, | ||
"require-jsdoc": ["error", { | ||
"require": { | ||
"FunctionDeclaration": true, | ||
"MethodDefinition": true, | ||
"ClassDeclaration": true, | ||
} | ||
}], | ||
}, | ||
"globals": { | ||
"root": true, | ||
"__DEVELOPMENT__": true, | ||
"__CLIENT__": true, | ||
"__SERVER__": true, | ||
"__DISABLE_SSR__": true, | ||
"__DEVTOOLS__": true, | ||
"socket": true, | ||
"webpackIsomorphicTools": true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Node | ||
node_modules | ||
coverage | ||
jsdoc | ||
webpack-assets.json | ||
webpack-stats.json | ||
npm-debug.log | ||
dist | ||
|
||
# Other | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
loglevel="warn" | ||
save-exact=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Mosaic Editor | ||
============= | ||
|
||
### Installation | ||
|
||
**Prerequisites** | ||
* [Node.js](https://nodejs.org/) | ||
* [Git](http://git-scm.com/) | ||
|
||
**Install dependencies** | ||
|
||
npm install | ||
|
||
### Development | ||
|
||
npm run dev | ||
|
||
## Testing | ||
|
||
$ npm run test | ||
$ npm run test:unit | ||
$ npm run test:e2e | ||
|
||
If chromedriver could not be found, make sure to update with: | ||
|
||
./node_modules/protractor/bin/webdriver-manager update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Module for the backend API. | ||
* @module api | ||
*/ | ||
|
||
import express from 'express'; | ||
|
||
const app = express(); | ||
|
||
export { app }; | ||
|
||
app.get('/home', (req, res) => { | ||
res.json({ | ||
content: { | ||
title: 'Welcome to Plone', | ||
description: 'This is the description', | ||
body: '<p>Some body text with <b>markup</b></p>', | ||
}, | ||
layout: [ | ||
[ | ||
{ | ||
width: 4, | ||
content: 'Tile 1', | ||
}, | ||
{ | ||
width: 8, | ||
content: 'Tile 2', | ||
}, | ||
], | ||
[ | ||
{ | ||
width: 12, | ||
content: 'Tile 3', | ||
} | ||
], | ||
], | ||
}); | ||
}); | ||
|
||
app.get('/about', (req, res) => { | ||
res.json({ | ||
content: { | ||
title: 'About page', | ||
description: 'This is the about description', | ||
body: '<p>About body text with <b>markup</b></p>', | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env node | ||
require('../server.babel'); // babel registration (runtime transpilation for node) | ||
var path = require('path'); | ||
var rootDir = path.resolve(__dirname, '..'); | ||
/** | ||
* Define isomorphic constants. | ||
*/ | ||
global.__CLIENT__ = false; | ||
global.__SERVER__ = true; | ||
global.__DISABLE_SSR__ = false; // <----- DISABLES SERVER SIDE RENDERING FOR ERROR DEBUGGING | ||
global.__DEVELOPMENT__ = process.env.NODE_ENV !== 'production'; | ||
|
||
if (__DEVELOPMENT__) { | ||
if (!require('piping')({ | ||
hook: true, | ||
ignore: /(\/\.|~$|\.json|\.scss$)/i | ||
})) { | ||
return; | ||
} | ||
} | ||
|
||
// https://github.com/halt-hammerzeit/webpack-isomorphic-tools | ||
var WebpackIsomorphicTools = require('webpack-isomorphic-tools'); | ||
global.webpackIsomorphicTools = new WebpackIsomorphicTools(require('../webpack/webpack-isomorphic-tools')) | ||
.development(__DEVELOPMENT__) | ||
.server(rootDir, function() { | ||
require('../src/server'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"tags": { | ||
"allowUnknownTags": true | ||
}, | ||
"source": { | ||
"include": ["./src"], | ||
"includePattern": ".+\\.js$", | ||
"excludePattern": ".+\\.(spec|e2e)\\.js$" | ||
}, | ||
"opts": { | ||
"encoding": "utf8", | ||
"destination": "jsdoc", | ||
"recurse": true, | ||
"verbose": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
var webpack = require('webpack'); | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
|
||
browsers: ['PhantomJS'], | ||
|
||
singleRun: false, | ||
|
||
frameworks: [ 'mocha' ], | ||
|
||
files: [ | ||
'./node_modules/phantomjs-polyfill/bind-polyfill.js', | ||
'tests.webpack.js', | ||
], | ||
|
||
preprocessors: { | ||
'tests.webpack.js': [ 'webpack', 'sourcemap' ], | ||
'src/**/*.js': [ 'webpack' ], | ||
}, | ||
|
||
reporters: [ 'mocha', 'coverage' ], | ||
|
||
plugins: [ | ||
require("karma-webpack"), | ||
require("karma-mocha"), | ||
require("karma-mocha-reporter"), | ||
require("karma-phantomjs-launcher"), | ||
require("karma-sourcemap-loader"), | ||
require("karma-coverage"), | ||
], | ||
|
||
coverageReporter: { | ||
dir: 'coverage/', | ||
reporters: [ | ||
{ type: 'html', subdir: 'report-html' }, | ||
{ type: 'lcov', subdir: 'report-lcov' }, | ||
{ type: 'text-summary' }, | ||
] | ||
}, | ||
|
||
webpack: { | ||
devtool: 'inline-source-map', | ||
module: { | ||
loaders: [ | ||
{ test: /\.(jpe?g|png|gif|svg)$/, loader: 'url', query: {limit: 10240} }, | ||
{ test: /\.js$/, exclude: /node_modules/, loaders: ['babel']}, | ||
{ test: /\.json$/, loader: 'json-loader' }, | ||
{ test: /\.less$/, loader: 'style!css!less' }, | ||
{ test: /\.scss$/, loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap' }, | ||
], | ||
}, | ||
resolve: { | ||
modulesDirectories: [ | ||
'src', | ||
'node_modules' | ||
], | ||
extensions: ['', '.json', '.js'], | ||
}, | ||
plugins: [ | ||
new webpack.IgnorePlugin(/\.json$/), | ||
new webpack.NoErrorsPlugin(), | ||
new webpack.DefinePlugin({ | ||
__CLIENT__: true, | ||
__SERVER__: false, | ||
__DEVELOPMENT__: true, | ||
__DEVTOOLS__: false | ||
}), | ||
], | ||
}, | ||
|
||
webpackServer: { | ||
noInfo: true, | ||
} | ||
|
||
}); | ||
}; |
Oops, something went wrong.