-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
67 changed files
with
845 additions
and
504 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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
blueprints/**/files/** | ||
bin | ||
blueprints | ||
coverage/** | ||
node_modules/** | ||
dist/** | ||
*.spec.js | ||
src/index.html | ||
config | ||
build | ||
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
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
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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import fs from 'fs-extra' | ||
import _debug from 'debug' | ||
import webpackCompiler from '../build/webpack-compiler' | ||
import webpackConfig from '../build/webpack.config' | ||
import config from '../config' | ||
import fs from 'fs-extra'; | ||
import _debug from 'debug'; | ||
import webpackCompiler from '../build/webpack-compiler'; | ||
import webpackConfig from '../build/webpack.config'; | ||
import config from '../config'; | ||
|
||
const debug = _debug('app:bin:compile') | ||
const debug = _debug('app:bin:compile'); | ||
const paths = config.utils_paths | ||
|
||
;(async function () { | ||
try { | ||
debug('Run compiler') | ||
const stats = await webpackCompiler(webpackConfig) | ||
debug('Run compiler'); | ||
const stats = await webpackCompiler(webpackConfig); | ||
if (stats.warnings.length && config.compiler_fail_on_warning) { | ||
debug('Config set to fail on warning, exiting with status code "1".') | ||
process.exit(1) | ||
debug('Config set to fail on warning, exiting with status code "1".'); | ||
process.exit(1); | ||
} | ||
debug('Copy static assets to dist folder.') | ||
fs.copySync(paths.client('static'), paths.dist()) | ||
debug('Copy static assets to dist folder.'); | ||
fs.copySync(paths.client('static'), paths.dist()); | ||
} catch (e) { | ||
debug('Compiler encountered an error.', e) | ||
process.exit(1) | ||
debug('Compiler encountered an error.', e); | ||
process.exit(1); | ||
} | ||
})() | ||
})(); |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import config from '../config' | ||
import server from '../server/main' | ||
import _debug from 'debug' | ||
import config from '../config'; | ||
import server from '../server/main'; | ||
import _debug from 'debug'; | ||
|
||
const debug = _debug('app:bin:server') | ||
const port = config.server_port | ||
const host = config.server_host | ||
const debug = _debug('app:bin:server'); | ||
const port = config.server_port; | ||
const host = config.server_host; | ||
|
||
server.listen(port) | ||
debug(`Server is now running at http://${host}:${port}.`) | ||
debug(`Server accessible via localhost:${port} if you are using the project defaults.`) | ||
server.listen(port); | ||
debug(`Server is now running at http://${host}:${port}.`); | ||
debug(`Server accessible via localhost:${port} if you are using the project defaults.`); |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
module.exports = { | ||
description () { | ||
return 'generates a blueprint and definition' | ||
description() { | ||
return 'generates a blueprint and definition'; | ||
}, | ||
|
||
beforeInstall () { | ||
console.log('Before installation hook!') | ||
beforeInstall() { | ||
console.log('Before installation hook!'); | ||
}, | ||
|
||
afterInstall () { | ||
console.log('After installation hook!') | ||
} | ||
} | ||
afterInstall() { | ||
console.log('After installation hook!'); | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
description () { | ||
return 'generates a redux duck' | ||
} | ||
} | ||
description() { | ||
return 'generates a redux duck'; | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
description () { | ||
return 'generates a dumb (pure) component' | ||
} | ||
} | ||
description() { | ||
return 'generates a dumb (pure) component'; | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
description () { | ||
return 'generates a connected redux-form form component' | ||
} | ||
} | ||
description() { | ||
return 'generates a connected redux-form form component'; | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
description () { | ||
return 'generates a functional layout component' | ||
} | ||
} | ||
description() { | ||
return 'generates a functional layout component'; | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
module.exports = { | ||
description () { | ||
return 'generates a smart (container) component' | ||
description() { | ||
return 'generates a smart (container) component'; | ||
}, | ||
|
||
fileMapTokens () { | ||
fileMapTokens() { | ||
return { | ||
__smart__: (options) => { | ||
return options.settings.getSetting('smartPath') | ||
} | ||
} | ||
} | ||
} | ||
return options.settings.getSetting('smartPath'); | ||
}, | ||
}; | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
description () { | ||
return 'generates a view component' | ||
} | ||
} | ||
description() { | ||
return 'generates a view component'; | ||
}, | ||
}; |
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
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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
import webpack from 'webpack' | ||
import _debug from 'debug' | ||
import config from '../config' | ||
import webpack from 'webpack'; | ||
import _debug from 'debug'; | ||
import config from '../config'; | ||
|
||
const debug = _debug('app:build:webpack-compiler') | ||
const DEFAULT_STATS_FORMAT = config.compiler_stats | ||
const debug = _debug('app:build:webpack-compiler'); | ||
const DEFAULT_STATS_FORMAT = config.compiler_stats; | ||
|
||
export default function webpackCompiler (webpackConfig, statsFormat = DEFAULT_STATS_FORMAT) { | ||
export default function webpackCompiler(webpackConfig, statsFormat = DEFAULT_STATS_FORMAT) { | ||
return new Promise((resolve, reject) => { | ||
const compiler = webpack(webpackConfig) | ||
const compiler = webpack(webpackConfig); | ||
|
||
compiler.run((err, stats) => { | ||
const jsonStats = stats.toJson() | ||
const jsonStats = stats.toJson(); | ||
|
||
debug('Webpack compile completed.') | ||
debug(stats.toString(statsFormat)) | ||
debug('Webpack compile completed.'); | ||
debug(stats.toString(statsFormat)); | ||
|
||
if (err) { | ||
debug('Webpack compiler encountered a fatal error.', err) | ||
return reject(err) | ||
debug('Webpack compiler encountered a fatal error.', err); | ||
return reject(err); | ||
} else if (jsonStats.errors.length > 0) { | ||
debug('Webpack compiler encountered errors.') | ||
debug(jsonStats.errors.join('\n')) | ||
return reject(new Error('Webpack compiler encountered errors')) | ||
debug('Webpack compiler encountered errors.'); | ||
debug(jsonStats.errors.join('\n')); | ||
return reject(new Error('Webpack compiler encountered errors')); | ||
} else if (jsonStats.warnings.length > 0) { | ||
debug('Webpack compiler encountered warnings.') | ||
debug(jsonStats.warnings.join('\n')) | ||
debug('Webpack compiler encountered warnings.'); | ||
debug(jsonStats.warnings.join('\n')); | ||
} else { | ||
debug('No errors or warnings encountered.') | ||
debug('No errors or warnings encountered.'); | ||
} | ||
resolve(jsonStats) | ||
}) | ||
}) | ||
resolve(jsonStats); | ||
}); | ||
}); | ||
} | ||
|
Oops, something went wrong.