Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
nimaa77 committed Apr 25, 2020
2 parents ecd1ee4 + bd78149 commit c3422de
Show file tree
Hide file tree
Showing 27 changed files with 425 additions and 112 deletions.
4 changes: 2 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"npmClient": "npm",
"allowBranch": [
"master",
"canary"
"next"
],
"registry": "https://registry.npmjs.org/"
}
Expand All @@ -34,5 +34,5 @@
},
"cacheDir": ".changelog"
},
"version": "3.1.0-canary.6"
"version": "3.1.0-canary.9"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"devDependencies": {
"eslint": "^6.8.0",
"got": "^11.0.2",
"husky": "^4.2.3",
"jest": "^25.1.0",
"lerna": "^3.20.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-razzle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-preset-razzle",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"description": "Babel presets for Razzle",
"main": "index.js",
"author": "jaredpalmer",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-razzle-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-razzle-app",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"description": "CLI tool to bootstrap Razzle applications with no configuration",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/razzle-dev-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle-dev-utils",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"description": "Utilities and helpers for Razzle",
"author": "Jared Palmer <jared@palmer.net>",
"repository": "git@github.com:jaredpalmer/razzle.git",
Expand Down
9 changes: 7 additions & 2 deletions packages/razzle-dev-utils/printErrors.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ const chalk = require('chalk');
* @param {string} summary Summary of error
* @param {Array<Error>} errors Array of Errors
*/
function printErrors(summary, errors) {
function printErrors(summary, errors, verbose) {
console.log(chalk.red(summary));
console.log();
errors.forEach(err => {
console.log(err.message || err);
if (verbose) {
console.log(err);
}
else {
console.log(err.message || err);
}
console.log();
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/razzle-plugin-css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle-plugin-css",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"main": "index.js",
"license": "MIT"
}
4 changes: 2 additions & 2 deletions packages/razzle-plugin-elm/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "razzle-plugin-elm",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"main": "index.js",
"license": "MIT",
"dependencies": {
"elm-hot-loader": "^0.5.4",
"elm-webpack-loader": "4.5.0",
"razzle-dev-utils": "^3.1.0-canary.1"
"razzle-dev-utils": "^3.1.0-canary.9"
}
}
2 changes: 1 addition & 1 deletion packages/razzle-plugin-eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle-plugin-eslint",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"main": "index.js",
"license": "MIT",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/razzle-plugin-inferno/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle-plugin-inferno",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"main": "index.js",
"license": "MIT"
}
2 changes: 1 addition & 1 deletion packages/razzle-plugin-less/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle-plugin-less",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"main": "index.js",
"license": "MIT"
}
4 changes: 2 additions & 2 deletions packages/razzle-plugin-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle-plugin-mdx",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"description": "Use mdx with Razzle",
"main": "index.js",
"repository": "git@github.com:jaredpalmer/razzle.git",
Expand All @@ -14,6 +14,6 @@
"@mdx-js/mdx": "^0.15.0-0"
},
"devDependencies": {
"razzle": "^3.1.0-canary.1"
"razzle": "^3.1.0-canary.9"
}
}
4 changes: 2 additions & 2 deletions packages/razzle-plugin-php/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "razzle-plugin-php",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"main": "index.js",
"license": "MIT",
"dependencies": {
"babel-preset-php": "^1.2.0",
"razzle-dev-utils": "^3.1.0-canary.1"
"razzle-dev-utils": "^3.1.0-canary.9"
}
}
2 changes: 1 addition & 1 deletion packages/razzle-plugin-preact/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle-plugin-preact",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"main": "index.js",
"license": "MIT"
}
2 changes: 1 addition & 1 deletion packages/razzle-plugin-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle-plugin-react",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"main": "index.js",
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/razzle-plugin-scss/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ module.exports = (
use: isServer
? [
{
loader: require.resolve('css-loader/locals'),
loader: require.resolve('css-loader'),
options: Object.assign({}, options.css[constantEnv], {
onlyLocals: true,
modules: true,
localIdentName: '[name]__[local]___[hash:base64:5]',
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/razzle-plugin-scss/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle-plugin-scss",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"description": "Use SCSS/SASS with Razzle",
"main": "index.js",
"repository": "git@github.com:jaredpalmer/razzle.git",
Expand All @@ -20,6 +20,6 @@
},
"devDependencies": {
"jest": "^23.1.0",
"razzle": "^3.1.0-canary.1"
"razzle": "^3.1.0-canary.9"
}
}
4 changes: 2 additions & 2 deletions packages/razzle-plugin-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle-plugin-typescript",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"description": "Use TypeScript with Razzle",
"main": "index.js",
"repository": "git@github.com:jaredpalmer/razzle.git",
Expand All @@ -14,7 +14,7 @@
"ts-loader": "^5.2.1"
},
"devDependencies": {
"razzle": "^3.1.0-canary.1"
"razzle": "^3.1.0-canary.9"
},
"peerDependencies": {
"typescript": ">=2.4.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/razzle-plugin-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "razzle-plugin-vue",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"main": "index.js",
"license": "MIT",
"dependencies": {
"css-loader": "^0.28.11",
"razzle-dev-utils": "^3.1.0-canary.1",
"razzle-dev-utils": "^3.1.0-canary.9",
"vue": "^2.5.16",
"vue-loader": "^15.2.4",
"vue-style-loader": "^4.1.0",
Expand Down
23 changes: 23 additions & 0 deletions packages/razzle/config/razzleDevServer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#! /usr/bin/env node
'use strict';

const devServer = require('webpack-dev-server');

class razzleDevServer extends devServer {

constructor(compiler, options = {}, _log) {
const verbose = options.verbose || false;
delete options['verbose'];
super(compiler, options, _log);
this.verbose = verbose;
}

showStatus() {
if (this.verbose) {
super.showStatus();
}
}

}

module.exports = razzleDevServer;
6 changes: 3 additions & 3 deletions packages/razzle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razzle",
"version": "3.1.0-canary.1",
"version": "3.1.0-canary.9",
"description": "Create server-rendered universal JavaScript applications with no configuration",
"repository": "git@github.com:jaredpalmer/razzle.git",
"author": "Jared Palmer <jared@palmer.net>",
Expand Down Expand Up @@ -33,7 +33,7 @@
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.6",
"babel-preset-razzle": "^3.1.0-canary.1",
"babel-preset-razzle": "^3.1.0-canary.9",
"chalk": "^3.0.0",
"css-loader": "^3.4.2",
"dotenv": "8.2.0",
Expand All @@ -49,7 +49,7 @@
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.7.0",
"postcss-safe-parser": "^4.0.2",
"razzle-dev-utils": "^3.1.0-canary.1",
"razzle-dev-utils": "^3.1.0-canary.9",
"react-dev-utils": "^10.2.0",
"react-error-overlay": "^6.0.6",
"sade": "^1.4.2",
Expand Down
10 changes: 7 additions & 3 deletions packages/razzle/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const mri = require('mri');
const webpack = require('webpack');
const paths = require('../config/paths');
const createConfig = require('../config/createConfig');
const devServer = require('webpack-dev-server');
const devServer = require('../config/razzleDevServer');
const printErrors = require('razzle-dev-utils/printErrors');
const clearConsole = require('react-dev-utils/clearConsole');
const logger = require('razzle-dev-utils/logger');
Expand All @@ -29,6 +29,8 @@ process.env.INSPECT = cliArgs.inspect || '';
// Capture the type (isomorphic or single-page) as an environment variable
process.env.BUILD_TYPE = cliArgs.type;

const verbose = cliArgs.verbose || false;

const clientOnly = cliArgs.type === 'spa';

function main() {
Expand Down Expand Up @@ -116,7 +118,9 @@ function main() {

// Create a new instance of Webpack-dev-server for our client assets.
// This will actually run on a different port than the users app.
const clientDevServer = new devServer(clientCompiler, clientConfig.devServer);
const clientDevServer = new devServer(clientCompiler,
Object.assign(clientConfig.devServer, { verbose: verbose }));

// Start Webpack-dev-server
clientDevServer.listen(port, err => {
if (err) {
Expand All @@ -131,7 +135,7 @@ function compile(config) {
try {
compiler = webpack(config);
} catch (e) {
printErrors('Failed to compile.', [e]);
printErrors('Failed to compile.', [e], verbose);
process.exit(1);
}
return compiler;
Expand Down
Loading

0 comments on commit c3422de

Please sign in to comment.