Skip to content

Commit

Permalink
🚚 0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
abdennour committed Dec 9, 2016
1 parent 7f99b7d commit 046e672
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .npmignore
@@ -1,3 +1,6 @@
src/
test/
coverage/
docs-site/
server.js
webpack.docs.config.js
Empty file added docs-site/bundle.js
Empty file.
18 changes: 18 additions & 0 deletions docs-site/index.html
@@ -0,0 +1,18 @@
<html>

<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>publish-decorator</title>
<meta charset="UTF-8">
<meta name="description" content="@publish makes class/method global ">
<meta name="keywords" content="publish-decorator, es7">
</head>

<body>
<div id="app"></div>

<!-- vendors -->
<script src="bundle.js" type="text/javascript"></script>
</body>

</html>
14 changes: 14 additions & 0 deletions docs-site/src/app.jsx
@@ -0,0 +1,14 @@
import React from 'react';

class App extends React.Component {

componentDidMount() {
document.body.setAttribute('dir','rtl');
}

render() {
return (<h1>Ω‡Ψ§Ψ¬Ψ±</h1>);
}
}

export default App;
5 changes: 5 additions & 0 deletions docs-site/src/boot.jsx
@@ -0,0 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './app';

ReactDOM.render(<App />, document.getElementById('app'));
2 changes: 2 additions & 0 deletions docs-site/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.js
@@ -1 +1 @@
module.exports = require(`lib/`);
module.exports = require('./lib/index.js');
16 changes: 13 additions & 3 deletions package.json
@@ -1,13 +1,13 @@
{
"name": "publish-decorator",
"version": "0.0.3",
"version": "0.0.4",
"description": "@publish decorator makes classes and/or methods accessible globally",
"main": "index.js",
"scripts": {
"compile": "babel --presets es2015,stage-1,react -d lib/ src/",
"prepublish": "npm run compile",
"start": "node server",
"pretest": "npm run compile",
"test2": "node_modules/.bin/_mocha test",
"test": "node_modules/.bin/babel-node node_modules/.bin/babel-istanbul cover node_modules/.bin/_mocha -- test/*spec.js",
"coverage": "istanbul cover _mocha -- --ui bdd -R spec -t 5000;open ./coverage/lcov-report/index.html",
"cover": "node_modules/.bin/babel-node node_modules/.bin/babel-istanbul cover node_modules/.bin/_mocha",
Expand Down Expand Up @@ -38,6 +38,7 @@
"babel-cli": "^6.18.0",
"babel-core": "^6.18.2",
"babel-istanbul": "^0.11.0",
"babel-loader": "^6.2.8",
"babel-plugin-react-html-attrs": "^2.0.0",
"babel-plugin-syntax-decorators": "^6.13.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
Expand All @@ -48,15 +49,24 @@
"babel-preset-stage-1": "^6.16.0",
"console-info": "0.0.4",
"coveralls": "^2.11.15",
"css-loader": "^0.26.1",
"enzyme": "^2.6.0",
"expect": "^1.20.2",
"extract-text-webpack-plugin": "^1.0.1",
"isparta-loader": "^2.0.0",
"jsdom": "9.8.3",
"jsdom-global": "2.1.0",
"mocha": "^3.2.0",
"mocha-lcov-reporter": "^1.2.0",
"react": "^15.4.1",
"react-addons-test-utils": "^15.4.1",
"react-dom": "^15.4.1",
"sinon": "^1.17.6"
"sass-loader": "^4.0.2",
"sinon": "^1.17.6",
"style-loader": "^0.13.1",
"webpack": "^1.13.3",
"webpack-dev-middleware": "^1.8.4",
"webpack-dev-server": "^1.16.2",
"webpack-hot-middleware": "^2.13.2"
}
}
32 changes: 32 additions & 0 deletions server.js
@@ -0,0 +1,32 @@
var express = require('express')
var webpack = require('webpack')
var merge = require('lodash/merge')
var config = merge({}, require('./webpack.docs.config'))

config.devtool = 'cheap-module-eval-source-map'
config.entry.unshift('webpack-hot-middleware/client')
config.plugins.push(
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
)

var app = express()
var compiler = webpack(config)

app.use(require('webpack-dev-middleware')(compiler, {
noInfo: true,
publicPath: config.output.publicPath
}))

app.use(require('webpack-hot-middleware')(compiler))

app.use(express.static('docs-site'))

app.listen(8008, 'localhost', function (err) {
if (err) {
console.log(err)
return
}
console.log(`...running πŸƒπŸΏ πŸƒπŸ» `);
console.log('🌏 Listening at http://localhost:8008 πŸ‘ πŸ‘ πŸ‘Œ ');
})
38 changes: 38 additions & 0 deletions webpack.docs.config.js
@@ -0,0 +1,38 @@
var path = require('path')
var webpack = require('webpack')
var ExtractTextPlugin = require('extract-text-webpack-plugin')

module.exports = {
entry: [
'./docs-site/src/boot'
],
output: {
path: path.resolve('./docs-site/'),
filename: 'bundle.js',
publicPath: '/'
},
resolve: {
extensions: ['', '.js', '.jsx'],

// Needed to direct the docs to the local version of the datepicker, this is not needed for
// normal setup.
alias: {
'publish-decorator': path.resolve('./src/index.js')
}
},
module: {
loaders: [
{ test: /\.js/, loader: 'babel', exclude: /node_modules/ },
{ test: /\.scss/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader') },
{ test: /\.css/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }
]
},
node: { Buffer: false },
plugins: [
new webpack.optimize.DedupePlugin(),
new ExtractTextPlugin('style.css', { allChunks: true }),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
]
}

0 comments on commit 046e672

Please sign in to comment.