-
Notifications
You must be signed in to change notification settings - Fork 94
Hoist ava to the root #276
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
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ | |
"main": "lib/index", | ||
"license": "MIT", | ||
"author": "Andy Wermke <[email protected]>", | ||
"scripts": { | ||
"test": "ava", | ||
"prepublishOnly": "yarn test" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still get tests prior to release? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, manual only for now. I would like to tickle it in another PR.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh okay. Then we should just create a small doc to refer to when publishing. Like that we only publish "whole monorepo", not standalone. |
||
}, | ||
"engines": { | ||
"node": ">= 6.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ | |
"main": "lib/index", | ||
"license": "MIT", | ||
"author": "Andy Wermke <[email protected]>", | ||
"scripts": { | ||
"test": "ava", | ||
"prepublishOnly": "yarn test" | ||
}, | ||
"engines": { | ||
"node": ">= 6.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ | |
"main": "lib/index", | ||
"license": "MIT", | ||
"author": "Andy Wermke <[email protected]>", | ||
"scripts": { | ||
"test": "ava", | ||
"prepublishOnly": "yarn test" | ||
}, | ||
"keywords": [ | ||
"webpack", | ||
"webpack-blocks", | ||
|
@@ -19,24 +15,6 @@ | |
"engines": { | ||
"node": ">= 6.0" | ||
}, | ||
"ava": { | ||
"babel": { | ||
"plugins": [ | ||
[ | ||
"transform-object-rest-spread", | ||
{ | ||
"useBuiltIns": true | ||
} | ||
] | ||
], | ||
"presets": [ | ||
"@ava/stage-4" | ||
] | ||
}, | ||
"require": [ | ||
"babel-register" | ||
] | ||
}, | ||
"repository": "andywer/webpack-blocks", | ||
"bugs": "https://github.com/andywer/webpack-blocks/issues", | ||
"dependencies": { | ||
|
@@ -45,10 +23,6 @@ | |
"webpack-merge": "^4.1.2" | ||
}, | ||
"devDependencies": { | ||
"@ava/babel-preset-stage-4": "^1.1.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-register": "^6.26.0", | ||
"sinon": "^5.0.2", | ||
"webpack": "^4.6.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ | |
"main": "index.js", | ||
"license": "MIT", | ||
"author": "Dmytro Meleshko <[email protected]>", | ||
"scripts": { | ||
"test": "ava", | ||
"prepublishOnly": "yarn test" | ||
}, | ||
"engines": { | ||
"node": ">= 6.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ | |
"main": "lib/index", | ||
"license": "MIT", | ||
"author": "Andy Wermke <[email protected]>", | ||
"scripts": { | ||
"test": "ava", | ||
"prepublishOnly": "yarn test" | ||
}, | ||
"engines": { | ||
"node": ">= 6.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ | |
"main": "lib/index", | ||
"license": "MIT", | ||
"author": "Andy Wermke <[email protected]>", | ||
"scripts": { | ||
"test": "ava", | ||
"prepublishOnly": "yarn test" | ||
}, | ||
"engines": { | ||
"node": ">= 6.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Snapshot report for `__tests__/webpack-config.test.js` | ||
# Snapshot report for `packages\sample-app\__tests__\webpack-config.test.js` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you running the tests from a windows machine? Wondering because (back)slashes keeps changing back & forth There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch! I've just regenerated snapshots from my Mac. |
||
|
||
The actual snapshot is saved in `webpack-config.test.js.snap`. | ||
|
||
|
@@ -9,33 +9,16 @@ Generated by [AVA](https://ava.li). | |
> Snapshot 1 | ||
|
||
{ | ||
devServer: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that correct? ... 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It changed when I only updated I'll have look on how to fix it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed by setting |
||
clientLogLevel: 'error', | ||
historyApiFallback: true, | ||
hot: true, | ||
hotOnly: true, | ||
inline: true, | ||
proxy: { | ||
'/api/*': { | ||
target: 'http://localhost:4000', | ||
}, | ||
}, | ||
stats: 'errors-only', | ||
}, | ||
devtool: 'cheap-module-source-map', | ||
entry: { | ||
main: [ | ||
'./src/index.dev.js', | ||
], | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(ts|tsx)$/, | ||
use: [ | ||
{ | ||
loader: 'awesome-typescript-loader', | ||
options: {}, | ||
options: { | ||
configFileName: '<REPLACED>', | ||
}, | ||
}, | ||
], | ||
}, | ||
|
@@ -70,16 +53,11 @@ Generated by [AVA](https://ava.li). | |
}, | ||
], | ||
}, | ||
performance: { | ||
maxAssetSize: 1500000, | ||
maxEntrypointSize: 1500000, | ||
}, | ||
plugins: [ | ||
'CheckerPlugin', | ||
'PathPlugin', | ||
'HtmlWebpackPlugin', | ||
'DefinePlugin', | ||
'HotModuleReplacementPlugin', | ||
], | ||
resolve: { | ||
extensions: [ | ||
|
@@ -114,7 +92,9 @@ Generated by [AVA](https://ava.li). | |
use: [ | ||
{ | ||
loader: 'awesome-typescript-loader', | ||
options: {}, | ||
options: { | ||
configFileName: '<REPLACED>', | ||
}, | ||
}, | ||
], | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,23 @@ const configFile = require.resolve('../webpack.config.babel') | |
|
||
test('it exports the development config', t => { | ||
const originalConfig = requireConfig() | ||
const module = Object.assign({}, originalConfig.module, { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't really expect that change here. It's surely not wrong, but it there a background story why you added this just now? (Just curious :) ) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because I made a change in - typescript(),
+ typescript({ configFileName: path.resolve(__dirname, './tsconfig.json') }), |
||
rules: originalConfig.module.rules.map(rule => { | ||
if (rule.test.toString() === /\.(ts|tsx)$/.toString()) { | ||
return Object.assign({}, rule, { | ||
use: rule.use.map(use => | ||
Object.assign({}, use, { | ||
options: { configFileName: '<REPLACED>' } | ||
}) | ||
) | ||
}) | ||
} | ||
|
||
return rule | ||
}) | ||
}) | ||
const config = Object.assign({}, originalConfig, { | ||
module, | ||
plugins: originalConfig.plugins.map(p => p.constructor.name) | ||
}) | ||
t.snapshot(config) | ||
|
@@ -32,6 +48,16 @@ test('it exports the production config', t => { | |
}) | ||
} | ||
|
||
if (rule.test.toString() === /\.(ts|tsx)$/.toString()) { | ||
return Object.assign({}, rule, { | ||
use: rule.use.map(use => | ||
Object.assign({}, use, { | ||
options: { configFileName: '<REPLACED>' } | ||
}) | ||
) | ||
}) | ||
} | ||
|
||
return rule | ||
}) | ||
}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ | |
"main": "lib/index", | ||
"license": "MIT", | ||
"author": "Andy Wermke <[email protected]>", | ||
"scripts": { | ||
"test": "ava", | ||
"prepublishOnly": "yarn test" | ||
}, | ||
"engines": { | ||
"node": ">= 6.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ | |
"main": "index", | ||
"license": "MIT", | ||
"author": "Artem Sapegin <[email protected]>", | ||
"scripts": { | ||
"test": "ava", | ||
"prepublishOnly": "yarn test" | ||
}, | ||
"engines": { | ||
"node": ">= 6.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,6 @@ | |
"description": "Webpack block for the webpack 2.x base configuration.", | ||
"license": "MIT", | ||
"author": "Andy Wermke <[email protected]>", | ||
"scripts": { | ||
"test": "ava", | ||
"prepublishOnly": "yarn test" | ||
}, | ||
"engines": { | ||
"node": ">= 6.0" | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, it's not exactly the scope of this PR, but:
How about moving
yarn lint
, for instance, into aposttest
script? Might make the scripts easier readable. Thoughts?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linting is a lot faster than running tests but it often catches errors. I think it's good to fail early.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving it to
pretest
then? 😉(Btw, this is just a minor nitpick. I just thought it might be a tiny improvement. Feel free to disagree.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vs
It barely improves anything 😄 If you want to make it shorter I can replace
--list-different
with-l
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, keep it 😅