Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big various updates #40

Merged
merged 147 commits into from
Aug 31, 2018
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
1401d37
📦 🔨 Update build task deps and sizeReporter
marcofugaro Jan 24, 2018
6e16516
🆙 Update the start script with create-react-app one
marcofugaro Jan 25, 2018
34f483e
⚙️ Make webpack-dev-server configurable, fixes #24
marcofugaro Jan 25, 2018
31292af
😅
marcofugaro Jan 25, 2018
2f32e5d
🎊 Fix issue with ascii logo on small consoles, fixes #36
marcofugaro Jan 25, 2018
cf37f21
🚜 📦 Refactor and make more standard the packags.jsons
marcofugaro Feb 6, 2018
07bee66
🐠 Add babel-preset-accurapp! 🎊 fixes #22
marcofugaro Feb 6, 2018
a0cd71f
💦 Some more polishes
marcofugaro Feb 6, 2018
adb97c0
📦 Upgrade a lot of edgy deps
marcofugaro Feb 7, 2018
1d8a58a
🚜 📦 Grezzo refactor and update the webpack preset
marcofugaro Feb 14, 2018
09e00cf
😓 Transpile with babel also node_modules
marcofugaro Feb 16, 2018
77dd897
📦 🐠 Upgrade babel deps
marcofugaro Feb 16, 2018
7a0c29b
🚜 💠 Refactor and polish webpack's config
marcofugaro Feb 16, 2018
37052fb
🌲 Add support for .env file
marcofugaro Feb 19, 2018
9c743e5
🐛 Fix issue with PUBLIC_URL not having trailing slash
marcofugaro Feb 19, 2018
1117512
🗂 Add csv loader, fixes #18
marcofugaro Feb 19, 2018
fc9c49f
📊 Add svg loader mockup
marcofugaro Feb 21, 2018
cee9093
🔝 Updated build process to match the new yarn version
marcofugaro Feb 21, 2018
4051a82
📦 Upgrade code and packages to latest webpack versions
marcofugaro Feb 22, 2018
c5d9f5f
📦 🚨 Upgrade eslint and its deps versions
marcofugaro Feb 23, 2018
6cb0908
🚨 Add new eslint rules 🔥
marcofugaro Feb 23, 2018
02e0041
🚨 🚚 Update a lot of eslint rules and add new ones
marcofugaro Feb 26, 2018
c269e77
🔨 Minor code refinements
marcofugaro Feb 26, 2018
b3959ec
🐠 Add babel-preset-accurapp to checked packages
marcofugaro Feb 26, 2018
86b837e
v4.0.0
marcofugaro Feb 26, 2018
f42f138
📦 Upgrade webpack dependencies
marcofugaro Feb 26, 2018
8f3d6bd
🦉 Support css nesting via postcss
marcofugaro Feb 26, 2018
82a4aa4
🚨 Add flat ternaries to eslint rules
marcofugaro Feb 27, 2018
d4797de
v4.0.1
marcofugaro Feb 27, 2018
166044c
🐈 Require yarn 1.2.1
marcofugaro Feb 28, 2018
dd2f2f1
🔫 Remove react/destructuring-assignment rule because is stupid
marcofugaro Mar 2, 2018
7ed8967
v4.0.2
marcofugaro Mar 2, 2018
568d263
📦 Upgrade deps
marcofugaro Mar 6, 2018
678efb7
🐶 Fix and update lerna publish script
marcofugaro Mar 7, 2018
482f8f3
✝️ Remove resolved uglify issues
marcofugaro Mar 12, 2018
622026d
📦 Upgrade deps
marcofugaro Mar 12, 2018
ca0a03e
🐛 🔥 Fix issue with build process, now this accurapp version builds!
marcofugaro Mar 13, 2018
65d01d9
v3.0.1
marcofugaro Mar 13, 2018
39ffa2f
🚨 Fix rule lines-between-class-members
marcofugaro Mar 19, 2018
df9714e
v4.0.3
marcofugaro Mar 19, 2018
80090a5
📦 Upgrade deps
marcofugaro Mar 20, 2018
d7483af
🔪 Enable vendor and app splitting and remove useless sideEffects: false
marcofugaro Mar 20, 2018
3a1713e
🚜 📦 Big refactor of webpack file and staging procedure
marcofugaro Apr 12, 2018
ee56f16
👀 Add json5 webpack loader
marcofugaro Apr 12, 2018
39ec572
🐛 Fix bug with double error logged and some minor improvements
marcofugaro Apr 12, 2018
1034e45
📂 Make copying public folder optional
marcofugaro Apr 13, 2018
1c66d92
🔖 Write a lot of docs
marcofugaro Apr 23, 2018
50267f5
🐛 Fix issues with mobx and class properties
marcofugaro Apr 23, 2018
886c209
🤖 Use .env.example in CI
marcofugaro Apr 23, 2018
aa4f95f
🤓 Write some more README
marcofugaro Apr 23, 2018
3f24504
Revert "🐛 Fix issues with mobx and class properties"
marcofugaro Apr 23, 2018
9a5919b
❌ Disable svgLoader for now
marcofugaro Apr 23, 2018
94c081c
Revert "Revert "🐛 Fix issues with mobx and class properties""
marcofugaro Apr 23, 2018
d51d78d
📦 Upgrade deps
marcofugaro Apr 23, 2018
0b83e3e
❌ Remove BSD license part since facebook switched to MIT also
marcofugaro Apr 23, 2018
4676a2b
📖 Add README to every package, closes #15
marcofugaro Apr 24, 2018
44fbe5c
🖥 Update browserslist to exclude IE11 based on https://jamie.build/l…
marcofugaro Apr 27, 2018
cd3ed3d
📖 Add migration guide docs
marcofugaro Apr 27, 2018
cb108cd
🐛 Fix unset flag with Babel decorators
marcofugaro Apr 27, 2018
a814778
🖥 Add process.env.BROWSERSLIST variable
marcofugaro May 2, 2018
8e00efd
🔥 Add postcss-fuss
marcofugaro May 4, 2018
fc94851
🚄 Add CI and info for netlify
marcofugaro May 4, 2018
f0491c5
😎 Last small fixes and upgrades
marcofugaro May 8, 2018
7f46f9e
❓ FAQ about hot reloading
marcofugaro May 8, 2018
63ac3f0
🔑 📝 Add keywords for every published package.json
marcofugaro May 9, 2018
994c82d
📦 Upgrade deps
marcofugaro May 14, 2018
237aff2
🚨 Add react/no-typos rule
marcofugaro May 14, 2018
bc5a214
Publish
marcofugaro May 14, 2018
04f9640
⚡️ Add tachyons in every new project
marcofugaro May 18, 2018
3a44328
🐛 Fix issue with postcss
marcofugaro May 18, 2018
14b3034
Publish
marcofugaro May 18, 2018
31e36c4
🐛 Fix issue with postcss-loader
marcofugaro May 21, 2018
220cb10
🐈 Add missing yarn.lock
marcofugaro May 21, 2018
8c1c549
Publish
marcofugaro May 21, 2018
7800c72
🌲 Add LATEST_COMMIT and LATEST_COMMIT_TIMESTAMP env variables
marcofugaro May 24, 2018
e8a1587
𝕱 Add missing support for otf font
marcofugaro May 29, 2018
7f29595
🐛 🐍 Fix PUBLIC_URL issues
marcofugaro Jun 4, 2018
974a41f
Publish
marcofugaro Jun 4, 2018
65ac6e2
😎 Simplify PUBLIC_URL condition
marcofugaro Jun 5, 2018
d7b3d52
Publish
marcofugaro Jun 5, 2018
b09a92d
🌈 Add support for color-mod function in css
marcofugaro Jun 6, 2018
e5919b2
🚩 Add boolean env flag to transpile node modules
marcofugaro Jun 7, 2018
b24dae8
Publish
marcofugaro Jun 7, 2018
abaca14
🚜 Refactor webpack a bit using when()
marcofugaro Jun 8, 2018
917091c
⏱ Add time to successful compilation messages
marcofugaro Jun 8, 2018
9415a7c
📖 Add TRANSPILE_NODE_MODULES to readme
marcofugaro Jun 8, 2018
b6b8703
🥅 Add catch to git retriever code
marcofugaro Jun 8, 2018
1f8835a
⚙️ Optimize thread loader
marcofugaro Jun 8, 2018
e2d4458
📦 Upgrade deps
marcofugaro Jun 8, 2018
bfc0db5
🐛 Add thread-loader optimization only in development
marcofugaro Jun 8, 2018
9cd8587
📸 Move css in the <head> to avoid FOUC
marcofugaro Jun 8, 2018
8b82128
🚨 Add lint command
marcofugaro Jun 8, 2018
740c313
Publish
marcofugaro Jun 8, 2018
008b6cb
🐛 Fix version with newer babel version
marcofugaro Jun 11, 2018
a432d8d
⚙️ Add create-test-app-build command
marcofugaro Jun 11, 2018
df93ef2
🐛 Fix typo
marcofugaro Jun 11, 2018
9d242e4
👩‍🎤 Add prettier config files and script
marcofugaro Jun 11, 2018
7ce84b8
Publish
marcofugaro Jun 11, 2018
a25450a
Revert "🐛 Fix version with newer babel version"
marcofugaro Jun 12, 2018
0ac5ca7
📦 Upgrade babel deps
marcofugaro Jun 12, 2018
3c78645
🐛 Add core-js as a direct dependency to attempt to solve core-js vers…
marcofugaro Jun 12, 2018
519a49e
Publish
marcofugaro Jun 12, 2018
38a16b2
🐛 Fixed version of webpack because newer one breaks errors
marcofugaro Jun 12, 2018
d01aadf
Publish
marcofugaro Jun 12, 2018
2a9cffb
Revert "🐛 Fixed version of webpack because newer one breaks errors"
marcofugaro Jun 15, 2018
9009d77
🐛 Fix issue with imported fonts
marcofugaro Jun 15, 2018
e323f89
📖 Add more info about repo creation in README
marcofugaro Jun 15, 2018
53b236e
💎 Add the react svg loader
marcofugaro Jun 18, 2018
d2719ed
🐛 Remove unused svgr options
marcofugaro Jun 18, 2018
edd8925
🐛 Fix bug with eslint
marcofugaro Jun 20, 2018
70ab701
Publish
marcofugaro Jun 20, 2018
b6ff75d
🖼 🎨 Add ascii art of logo in readme
marcofugaro Jun 21, 2018
e3ef8cf
🐛 Show localhost message also with warnings
marcofugaro Jun 26, 2018
541ba0b
📝 Better docs about typescript
marcofugaro Jun 26, 2018
f219385
🚨 Upgrade eslint to 5 and add the new rules
marcofugaro Jun 26, 2018
ba377b4
🐛 Fix svgo issue when importing svgs
marcofugaro Jun 27, 2018
498d2e9
📝 Update readme about typescript
marcofugaro Jun 27, 2018
8833b72
Publish
marcofugaro Jun 27, 2018
042b941
🐛 Update react-dev-utils to fix some bugs
marcofugaro Jun 28, 2018
2ba285c
Publish
marcofugaro Jun 28, 2018
bde359b
📦 Upgrade deps
marcofugaro Jul 10, 2018
33d82b7
🐠 Update babel config to latest babel version
marcofugaro Jul 10, 2018
d0032fb
🐛 Fix error with error messages being trimmed
marcofugaro Jul 10, 2018
7226d8e
Publish
marcofugaro Jul 10, 2018
ff28939
📖 Update the tsconfig in readme
marcofugaro Jul 12, 2018
c177075
📦 Upgrade deps
marcofugaro Jul 12, 2018
525f357
Publish
marcofugaro Jul 12, 2018
6bfc69e
🐛 Downgrade babel because of issue with new version
marcofugaro Jul 13, 2018
da15bd7
Publish
marcofugaro Jul 13, 2018
5536b3e
Publish
marcofugaro Jul 13, 2018
4037cbb
Publish
marcofugaro Jul 13, 2018
ecbc8f4
Publish
marcofugaro Jul 13, 2018
cb96329
🐛 add babel/plugin-transform-react-contant-element to fix svgr's issue
marcofugaro Aug 1, 2018
1a166ac
Publish
marcofugaro Aug 1, 2018
e48ea38
🐛 🌳 Add .env file generation during CI
marcofugaro Aug 8, 2018
6edfc7c
📦 Use new version of fuss
marcofugaro Aug 8, 2018
3b23d19
Publish
marcofugaro Aug 8, 2018
442841e
🐛 Use .env.example during CI
marcofugaro Aug 9, 2018
bbcfca2
🌳 Force the CI env variable on netlify
marcofugaro Aug 9, 2018
92ae313
🐛 Fix env requires order
marcofugaro Aug 22, 2018
96b0e4f
Publish
marcofugaro Aug 22, 2018
e9fcb6c
🐠 Upgrade babel to 7
marcofugaro Aug 28, 2018
a41ffe8
📦 Upgrade eslint and scripts packages
marcofugaro Aug 28, 2018
a8c7dd1
📦 upgrade webpack deps
marcofugaro Aug 28, 2018
316f4cc
📦 ⚛️ Upgrade webpack blocks and some other deps
marcofugaro Aug 29, 2018
5f2d828
📦 Upgrade lerna version
marcofugaro Aug 30, 2018
bf6a963
Publish
marcofugaro Aug 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,17 @@ module.exports = buildWebpackConfig([
])
```

To add a loader, for example, TypeScript Loader:

For example, this is the way to customize the webpack-dev-server options.
```js
const buildWebpackConfig = require('webpack-preset-accurapp')

function tsLoader() {
return (context, { addLoader }) => addLoader({
test: /\.tsx?$/,
loader: 'ts-loader',
})
}
const { env, devServer } = require('webpack-blocks')

module.exports = buildWebpackConfig([
tsLoader(),
env('development', [
devServer({
// your custom options here
}),
]),
])
```

Expand Down
38 changes: 20 additions & 18 deletions packages/accurapp-scripts/bin/scripts.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
#!/usr/bin/env node
if (parseFloat(process.versions.node) < 6.5) throw new Error('Sorry, Node 6.5+ is required! Tip: use `nvm` for painless upgrades.')
if (parseFloat(process.versions.node) < 7) throw new Error('Sorry, Node 7+ is required! Tip: use `nvm` for painless upgrades.')

// warn if any accurapp package is outdated
const latestVersion = require('latest-version')
const semver = require('semver')
const { createOutdatedMessage, yellowBox } = require('../scripts/_utils')
if (!process.env.CI) {
const latestVersion = require('latest-version')
const semver = require('semver')
const { createOutdatedMessage, yellowBox } = require('../scripts/_utils')

const currentDeps = [
require('../package.json'),
require('../../eslint-config-accurapp/package.json'),
require('../../webpack-preset-accurapp/package.json'),
]
const currentDeps = [
require('../package.json'),
require('../../eslint-config-accurapp/package.json'),
require('../../webpack-preset-accurapp/package.json'),
]

Promise.all(currentDeps.map((dep) => latestVersion(dep.name)))
.then((npmVersions) => {
const latestDeps = npmVersions.map((version, i) => Object.assign({}, currentDeps[i], { version }))
const outdatedDeps = currentDeps.filter((dep, i) => semver.lt(dep.version, latestDeps[i].version))
Promise.all(currentDeps.map((dep) => latestVersion(dep.name)))
.then((npmVersions) => {
const latestDeps = npmVersions.map((version, i) => Object.assign({}, currentDeps[i], { version }))
const outdatedDeps = currentDeps.filter((dep, i) => semver.lt(dep.version, latestDeps[i].version))

if (outdatedDeps.length > 0) {
const message = createOutdatedMessage(outdatedDeps, latestDeps)
console.log(yellowBox(message))
}
})
if (outdatedDeps.length > 0) {
const message = createOutdatedMessage(outdatedDeps, latestDeps)
console.log(yellowBox(message))
}
})
}

// start the designated script
const script = process.argv[2]
Expand Down
27 changes: 16 additions & 11 deletions packages/accurapp-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "accurapp-scripts",
"version": "3.2.10",
"description": "Scripts for AccurApp.",
"description": "Scripts for AccurApp",
"repository": "accurat/accurapp",
"license": "MIT",
"engines": {
"node": ">=6.5"
"node": ">=7"
},
"files": [
"bin",
Expand All @@ -15,18 +15,23 @@
"accurapp-scripts": "./bin/scripts.js"
},
"dependencies": {
"boxen": "^1.2.1",
"chalk": "^2.1.0",
"cross-spawn": "^5.1.0",
"detect-port": "^1.2.0",
"boxen": "^1.3.0",
"chalk": "^2.3.0",
"columnify": "^1.5.4",
"cross-spawn": "^6.0.3",
"detect-port": "^1.2.2",
"dotenv": "^4.0.0",
"figlet": "^1.2.0",
"fs-extra": "^4.0.1",
"filesize": "^3.5.11",
"fs-extra": "^5.0.0",
"gzip-size": "^4.1.0",
"indent-string": "^3.2.0",
"latest-version": "^3.1.0",
"outdent": "^0.4.1",
"path": "^0.12.7",
"react-dev-utils": "^4.0.1",
"semver": "^5.4.1",
"webpack": "^3.5.6",
"webpack-dev-server": "^2.7.1"
"react-dev-utils": "6.0.0-next.9754a231",
"semver": "^5.5.0",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.11.1"
}
}
76 changes: 71 additions & 5 deletions packages/accurapp-scripts/scripts/_utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
const path = require('path')
const fs = require('fs')
const webpack = require('webpack')
const chalk = require('chalk')
const figlet = require('figlet')
const boxen = require('boxen')
const outdent = require('outdent')
const filesize = require('filesize')
const gzipSize = require('gzip-size').sync
const indentString = require('indent-string')
const columnify = require('columnify')
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages')

const log = {
Expand All @@ -15,6 +21,11 @@ const log = {
function noop() {}

function coloredBanner(text, colors = ['blue', 'red']) {
// If the console is small, we show only the logo
if (text.includes(' accurapp') && process.stdout.columns < 125) {
text = text.slice(0, -' accurapp'.length)
}

const bannerText = text.replace(/\|/g, 'l') // In BigMoney font, 'l' (lowercase L) are much nicer than '|' (pipes)
const bannerColors = { '$': colors[0], '_': colors[1], '|': colors[1], '\\': colors[1], '/': colors[1] }
const banner = figlet.textSync(bannerText, { font: 'Big Money-nw' })
Expand All @@ -38,11 +49,11 @@ function createOutdatedMessage(outdatedDeps, latestDeps) {
return `${chalk.blue(dep.name)} ${chalk.gray(dep.version)} → ${chalk.green(updatedDep.version)}`
})

return `
${chalk.yellow('Hey, an update for accurapp is available!')}
${outdatedMessages.join('\n')}
${chalk.yellow('Run')} ${chalk.cyan('yarn upgrade-interactive --latest')} ${chalk.yellow('to update')}
`
return outdent`
${chalk.yellow('Hey, an update for accurapp is available!')}
${outdatedMessages.join('\n')}
${chalk.yellow('Run')} ${chalk.cyan('yarn upgrade-interactive --latest')} ${chalk.yellow('to update')}
`
}

function indent(text, prepend = ' ', firstLinePrepend = prepend) {
Expand Down Expand Up @@ -108,6 +119,60 @@ function createWebpackCompiler(onFirstReadyCallback = noop, onError = noop) {
return compiler
}

function printFileSizes(webpackStats, appBuild, maxBundleGzipSize = 512 * 1024) {
const assets = (webpackStats.stats || [webpackStats])
.map(stats =>
stats
.toJson()
.assets.filter(asset => /\.(js|css)$/.test(asset.name))
.map(asset => {
const fileContents = fs.readFileSync(path.join(appBuild, asset.name))
const size = fs.statSync(path.join(appBuild, asset.name)).size
const sizeGzip = gzipSize(fileContents)

return {
folder: path.join(path.basename(appBuild), path.dirname(asset.name)),
name: path.basename(asset.name),
size,
sizeGzip,
}
})
)
.reduce((single, all) => all.concat(single), [])

assets.sort((a, b) => b.size - a.size)

const isLarge = asset => path.extname(asset.name) === '.js' && asset.size > maxBundleGzipSize

const columnData = assets.reduce((columnObj, asset) => {
const sizeLabel = `${filesize(asset.size)} ${chalk.dim(`(${filesize(asset.sizeGzip)} gzipped)`)}`
const firstColumn = isLarge(asset) ? chalk.yellow(sizeLabel) : sizeLabel
const secondColumn = `${chalk.dim(`${asset.folder}${path.sep}`)}${chalk.cyan(asset.name)}`

columnObj[firstColumn] = secondColumn
return columnObj
}, {})

console.log(
indentString(
columnify(columnData, {
showHeaders: false,
columnSplitter: ' ',
}),
3
)
)

if (assets.some(isLarge)) {
console.log()
console.log(chalk.yellow(outdent`
The bundle size is significantly larger than recommended.
Consider reducing it with code splitting: https://goo.gl/9VhYWB
You can also analyze the project dependencies: https://goo.gl/sDmR4n
`))
}
}

module.exports = {
log,
noop,
Expand All @@ -118,4 +183,5 @@ module.exports = {
listLine,
readWebpackConfig,
createWebpackCompiler,
printFileSizes,
}
22 changes: 9 additions & 13 deletions packages/accurapp-scripts/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ require('dotenv').config({ silent: true })
const chalk = require('chalk')
const path = require('path')
const fs = require('fs-extra')
const { measureFileSizesBeforeBuild, printFileSizesAfterBuild } = require('react-dev-utils/FileSizeReporter')
const { log, createWebpackCompiler, readWebpackConfig, coloredBanner } = require('./_utils')
const { log, createWebpackCompiler, readWebpackConfig, coloredBanner, printFileSizes } = require('./_utils')

const appDir = process.cwd()
const config = readWebpackConfig()
Expand Down Expand Up @@ -57,15 +56,12 @@ function build() {

console.log(coloredBanner('/||||/| accurapp', ['cyan', 'magenta']))

measureFileSizesBeforeBuild(appBuild)
.then((previousFileSizes) => {
clearBuildFolder()
copyPublicFolder()
build()
.then((stats) => {
log.info('File sizes after gzip:')
console.log()
printFileSizesAfterBuild(stats, previousFileSizes, appBuild)
console.log()
})
clearBuildFolder()
copyPublicFolder()
build()
.then((stats) => {
log.info('File sizes:')
console.log()
printFileSizes(stats, appBuild)
console.log()
})
32 changes: 13 additions & 19 deletions packages/accurapp-scripts/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,35 @@ const detect = require('detect-port')
const WebpackDevServer = require('webpack-dev-server')
const openOrRefreshBrowser = require('react-dev-utils/openBrowser')
const { prepareUrls } = require('react-dev-utils/WebpackDevServerUtils')
const { log, createWebpackCompiler, coloredBanner } = require('./_utils')
const { log, createWebpackCompiler, readWebpackConfig, coloredBanner } = require('./_utils')

const HOST = process.env.HOST || '0.0.0.0'
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 8000

function buildDevServerConfig(lanUrl) {
return {
compress: true,
clientLogLevel: 'none',
historyApiFallback: true,
hot: true,
contentBase: './public/',
quiet: true,
watchOptions: {
ignored: /node_modules/,
},
host: HOST,
overlay: false,
public: lanUrl,
}
}

function runDevServer(port) {
const urls = prepareUrls('http', HOST, port)
const compiler = createWebpackCompiler(() => {
log.info(`The app is running at: ${chalk.cyan(urls.localUrlForTerminal)}`)
log.info(`Or on your network at: ${chalk.cyan(urls.lanUrlForTerminal)}`)
})
const devServerConfig = buildDevServerConfig(urls.lanUrlForConfig)

const devServerConfig = Object.assign({
host: HOST,
public: urls.lanUrlForConfig,
}, readWebpackConfig().devServer)
const devServer = new WebpackDevServer(compiler, devServerConfig)
devServer.listen(port, HOST, err => {
if (err) return log.err(err)
log.info('Starting the development server...')
openOrRefreshBrowser(urls.localUrlForBrowser)
})

const shutDownServer = () => {
devServer.close()
process.exit()
}
process.on('SIGINT', shutDownServer)
process.on('SIGTERM', shutDownServer)
}

console.log(coloredBanner('/||||/| accurapp'))
Expand Down
4 changes: 4 additions & 0 deletions packages/create-accurapp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ const packageJson = {
start: 'accurapp-scripts start',
build: 'accurapp-scripts build',
},
browserslist: {
production: ['last 2 versions', 'ie 11'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a read over this blog post: https://jamie.build/last-2-versions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markov00 already done, check the Files Changed not the commits please. This is outdated

development: ['last 1 Chrome version'],
},
}
if (isRealRun) writePackageJson(appDir, packageJson)

Expand Down
2 changes: 1 addition & 1 deletion packages/create-accurapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"repository": "accurat/accurapp",
"license": "MIT",
"engines": {
"node": ">=6.5"
"node": ">=7"
},
"files": [
"index.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/eslint-config-accurapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"description": "ESLint configuration used by Accurat",
"repository": "accurat/accurapp",
"license": "MIT",
"engines": {
"node": ">=7"
},
"files": [
"index.js"
],
"dependencies": {
"babel-eslint": "^7.2.2",
"eslint": "^3.19.0",
Expand Down
14 changes: 12 additions & 2 deletions packages/webpack-preset-accurapp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const {
createConfig,
addPlugins,
customConfig,
devServer,
entryPoint,
setOutput,
env,
Expand Down Expand Up @@ -91,10 +92,19 @@ function accuPreset(config = []) {
//
env('development', [
prependEntry('react-dev-utils/webpackHotDevClient'),
devServer({
compress: true,
clientLogLevel: 'none',
contentBase: './public/',
watchContentBase: true,
quiet: true,
watchOptions: {
ignored: /node_modules/,
},
overlay: false,
}),
eslintLoader(),
addPlugins([
// This is necessary to emit hot updates (currently CSS only)
new webpack.HotModuleReplacementPlugin(),
// Automatic rediscover of packages after `npm install`
new WatchMissingNodeModulesPlugin('node_modules'),
]),
Expand Down
Loading