Skip to content

Commit

Permalink
Use built lib for demo application
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Lanchares committed Jan 11, 2017
1 parent 56872ee commit 31a676c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 58 deletions.
2 changes: 1 addition & 1 deletion config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module.exports = {
// in development "style" loader enables hot editing of CSS.
{
test: /\.css$/,
include: [paths.appSrc, paths.appNodeModules],
include: [paths.appSrc, paths.appLib, paths.appNodeModules],
loader: 'style!css!postcss?-import'
},
// JSON is not enabled by default in Webpack but both Node and Browserify
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module.exports = {
// in the main CSS file.
{
test: /\.css$/,
include: [paths.appSrc, paths.appNodeModules],
include: [paths.appSrc, paths.appLib, paths.appNodeModules],
// "?-autoprefixer" disables autoprefixer in css-loader itself:
// https://github.com/webpack/css-loader/issues/281
// We already have it thanks to postcss. We only pass this flag in
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A Kanban component in React",
"version": "0.0.6",
"author": "Eduardo Lanchares <[email protected]>",
"homepage": "https://github.com/edulan/react-virtual-kanban",
"homepage": "https://edulan.github.io/react-virtual-kanban/",
"main": "lib/index.js",
"repository": {
"type": "git",
Expand Down Expand Up @@ -100,7 +100,8 @@
"build": "npm run build:clean && npm run build:umd && npm run build:lib && npm run build:css && npm run build:demo",
"deploy": "gh-pages -d build",
"prepublish": "npm run build",
"start": "node ./scripts/start.js",
"postpublish": "npm run deploy",
"start": "npm run build:lib && node ./scripts/start.js",
"test": "jest"
},
"eslintConfig": {
Expand Down
51 changes: 0 additions & 51 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,56 +108,5 @@ function build(previousSizeMap) {
console.log('File sizes after gzip:');
console.log();
printFileSizes(stats, previousSizeMap);
console.log();

var openCommand = process.platform === 'win32' ? 'start' : 'open';
var homepagePath = require(paths.appPackageJson).homepage;
var publicPath = config.output.publicPath;
if (homepagePath && homepagePath.indexOf('.github.io/') !== -1) {
// "homepage": "http://user.github.io/project"
console.log('The project was built assuming it is hosted at ' + chalk.green(publicPath) + '.');
console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.');
console.log();
console.log('The ' + chalk.cyan('build') + ' folder is ready to be deployed.');
console.log('To publish it at ' + chalk.green(homepagePath) + ', run:');
console.log();
console.log(' ' + chalk.cyan('git') + ' commit -am ' + chalk.yellow('"Save local changes"'));
console.log(' ' + chalk.cyan('git') + ' checkout -B gh-pages');
console.log(' ' + chalk.cyan('git') + ' add -f build');
console.log(' ' + chalk.cyan('git') + ' commit -am ' + chalk.yellow('"Rebuild website"'));
console.log(' ' + chalk.cyan('git') + ' filter-branch -f --prune-empty --subdirectory-filter build');
console.log(' ' + chalk.cyan('git') + ' push -f origin gh-pages');
console.log(' ' + chalk.cyan('git') + ' checkout -');
console.log();
} else if (publicPath !== '/') {
// "homepage": "http://mywebsite.com/project"
console.log('The project was built assuming it is hosted at ' + chalk.green(publicPath) + '.');
console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.');
console.log();
console.log('The ' + chalk.cyan('build') + ' folder is ready to be deployed.');
console.log();
} else {
// no homepage or "homepage": "http://mywebsite.com"
console.log('The project was built assuming it is hosted at the server root.');
if (homepagePath) {
// "homepage": "http://mywebsite.com"
console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.');
console.log();
} else {
// no homepage
console.log('To override this, specify the ' + chalk.green('homepage') + ' in your ' + chalk.cyan('package.json') + '.');
console.log('For example, add this to build it for GitHub Pages:')
console.log();
console.log(' ' + chalk.green('"homepage"') + chalk.cyan(': ') + chalk.green('"http://myname.github.io/myapp"') + chalk.cyan(','));
console.log();
}
console.log('The ' + chalk.cyan('build') + ' folder is ready to be deployed.');
console.log('You may also serve it locally with a static server:')
console.log();
console.log(' ' + chalk.cyan('npm') + ' install -g pushstate-server');
console.log(' ' + chalk.cyan('pushstate-server') + ' build');
console.log(' ' + chalk.cyan(openCommand) + ' http://localhost:9000');
console.log();
}
});
}
2 changes: 1 addition & 1 deletion src/demo/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';

import { VirtualKanban } from '../';
import { VirtualKanban } from '../../lib';

import './App.css';

Expand Down
2 changes: 1 addition & 1 deletion src/demo/List.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import classnames from 'classnames';

import { decorators } from '../';
import { decorators } from '../../lib';

export default class List extends decorators.List {
render() {
Expand Down
2 changes: 1 addition & 1 deletion src/demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import Perf from 'react-addons-perf';

import '../styles.css';
import '../../lib/styles.css';

import { generateLists } from './utils/generateLists';

Expand Down

0 comments on commit 31a676c

Please sign in to comment.