Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Show Changes in Watched Files #19

Closed
igorbenic opened this issue Jan 23, 2018 · 8 comments
Closed

Show Changes in Watched Files #19

igorbenic opened this issue Jan 23, 2018 · 8 comments
Assignees

Comments

@igorbenic
Copy link

I am not sure if this is a bug or an intended behavior but I when I start the script "npm start", I do get a message in my terminal that the files are being watched.

Currently, whenever I save a file (.js), I don't get any feedback on the terminal if the files have been successfully generated/compiled. So, I just assume that it was a success and need to load the browser and check the console if there are any errors.

I do see that "npm run build" would show the status of the compiled files.

If that's intended, then nevermind this ;)

@ahmadawais
Copy link
Owner

@igorbenic you didn't post a screenshot so I can't tell what you are looking at.

When you run npm start you should see this ↓

image

This clearly says

✅ Compiled successfully!

Then it suggests that it is

Watching for changes... (Press CTRL + C to stop).

And finally more info on why this is not a production build and you should do this

Note that the development build is not optimized.
To create a production build, use npm run build

There's actually a step that runs here but gets cleared very quickly and it says

✔ Building and compiling blocks...

I think there can be a better workflow here. Let me do something. I'll be sending an update to the cgb-scripts in an hour. Then test it for me?

@igorbenic
Copy link
Author

Yes, that's the one.

screen shot 2018-01-23 at 16 14 04

Ok, maybe it's due to a quick compile I did not notice it that it will say "Building and compiling" on each save. Would probably notice it if I had a second screen and the terminal placed there.

Nvm then. It is fine;)

I can test it later today (in about 7 hours).

@ahmadawais
Copy link
Owner

Great, I have an awesome improvement coming here. A spinner for watch process. About to push the code.

@ahmadawais
Copy link
Owner

ahmadawais commented Jan 23, 2018

@igorbenic

🚀 Go ahead create a new block plugin to test the changes in v1.9.2 or update https://www.npmjs.com/package/cgb-scriptscgb-scripts in your current block's package.json and run npm install again.
Looking forward!

@igorbenic
Copy link
Author

Hi @ahmadawais, the spinner is a great addition.

I've also noticed that when I save a changed file, the watching part blinks a bit. I guess it does that because it re-compiled & refreshed the terminal screen (so fast it looks like a blink). Or is that also a change?

However it is, it's great. :)

@ahmadawais
Copy link
Owner

That's all intentional and the blink is not a blink but a reload :) it's just so fast at the moment that you don't notice a delay.

Fixed!

Props @ahmadawais @igorbenichttps://github.com/ahmadawais/create-guten-block/blob/master/CHANGELOG.md#-version-192

@ahmadawais
Copy link
Owner

image

@diegoversiani
Copy link

Hi Ahmad,

I'm starting to use create-guten-block and I actually spent about half and hour trying to figure out why this screen wasn't updating when I changed files. Now I get it!

I suggest 2 improvements:

  1. It would be clearer if the screen updated in a similar fashion as gulp watch and other such tools; or
  2. Add a timestamp which updates every time a build completes. I usually have my terminal out of sight, if a timestamp is applied I can get back and check it once in a while.

Best,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants