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

Hoist ava to the root #276

Merged
merged 6 commits into from
May 9, 2018
Merged

Hoist ava to the root #276

merged 6 commits into from
May 9, 2018

Conversation

vlad-zhukov
Copy link
Collaborator

And also update it to the latest.

@vlad-zhukov vlad-zhukov changed the base branch from master to release-2.0 May 8, 2018 18:08
@vlad-zhukov vlad-zhukov requested review from andywer and zcei May 8, 2018 19:40
@vlad-zhukov vlad-zhukov added this to the 2.0.0 milestone May 8, 2018
@@ -3,11 +3,11 @@
"scripts": {
"lint": "eslint \"**/*.js\"",
"format": "prettier \"**/*.{js,ts,tsx}\" --write --loglevel warn",
"test": "prettier \"**/*.{js,ts,tsx}\" --list-different && yarn lint && lerna run test"
"test": "prettier \"**/*.{js,ts,tsx}\" --list-different && yarn lint && ava"
Copy link
Owner

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 a posttest script? Might make the scripts easier readable. Thoughts?

Copy link
Collaborator Author

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.

Copy link
Owner

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.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

{
  "test": "prettier \"**/*.{js,ts,tsx}\" --list-different && yarn lint && ava"
}

vs

{
  "pretest": "prettier \"**/*.{js,ts,tsx}\" --list-different && yarn lint",
  "test": "ava"
}

It barely improves anything 😄 If you want to make it shorter I can replace --list-different with -l.

Copy link
Owner

Choose a reason for hiding this comment

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

Ahhh, keep it 😅

@@ -9,33 +9,16 @@ Generated by [AVA](https://ava.li).
> Snapshot 1

{
devServer: {
Copy link
Owner

Choose a reason for hiding this comment

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

Is that correct? ... 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It changed when I only updated ava from 0.22.0 to 0.25.0 before doing any other changes. I couldn't find any release notes related to it.

I'll have look on how to fix it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed by setting NODE_ENV to development. This was broken because since 0.23.0 ava sets NODE_ENV to test.

@@ -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, {
Copy link
Owner

@andywer andywer May 8, 2018

Choose a reason for hiding this comment

The 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 :) )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because I made a change in packages/sample-app/webpack.config.babel.js:

-  typescript(),
+  typescript({ configFileName: path.resolve(__dirname, './tsconfig.json') }),

@@ -5,10 +5,6 @@
"main": "lib/index",
"license": "MIT",
"author": "Andy Wermke <andy@dev.next-step-software.com>",
"scripts": {
"test": "ava",
"prepublishOnly": "yarn test"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still get tests prior to release?

Copy link
Collaborator Author

@vlad-zhukov vlad-zhukov May 9, 2018

Choose a reason for hiding this comment

The 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.

  • Publishing single packages leads to version inconsistencies and bugs. For instance the uglify block was publish separately as 1.0.0 and later as 1.1.0, when other blocks used to be v1.0.0-beta. Then with the 1.0 release the uglify was republished and its version 1.0.0 was tagged as latest. What that means is if you run yarn add @webpack-blocks/uglify now, you will get 1.0.0 instead of 1.1.0. (I am sorry I haven't reported it before 😅)
  • Some blocks have no unit but instead have related e2e tests. I believe they are more important to have and we can focus on writing more of them.

Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

@@ -1,4 +1,4 @@
# Snapshot report for `__tests__/webpack-config.test.js`
# Snapshot report for `packages\sample-app\__tests__\webpack-config.test.js`
Copy link
Collaborator

Choose a reason for hiding this comment

The 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

Copy link
Collaborator Author

@vlad-zhukov vlad-zhukov May 9, 2018

Choose a reason for hiding this comment

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

Nice catch! I've just regenerated snapshots from my Mac.

@vlad-zhukov vlad-zhukov merged commit c8a0d4c into andywer:release-2.0 May 9, 2018
@vlad-zhukov vlad-zhukov deleted the ava branch May 9, 2018 21:14
@vlad-zhukov vlad-zhukov mentioned this pull request May 9, 2018
17 tasks
andywer pushed a commit that referenced this pull request Jun 19, 2018
marcofugaro pushed a commit to marcofugaro/webpack-blocks that referenced this pull request Sep 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants