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

1.0.0 #19

Merged
merged 2 commits into from
May 8, 2015
Merged

1.0.0 #19

merged 2 commits into from
May 8, 2015

Conversation

MoOx
Copy link
Collaborator

@MoOx MoOx commented May 4, 2015

Changes

  • Fixed: metalsmith-collections are now correctly adjusted to avoid
    duplicates entries after rebuilds)
  • Removed: pattern option has been remove. Please use the new paths
    option
  • Added: paths option allows you to specify a map to trigger rebuilds
    (closes #4 and
    #13)
  • Added: log option to be able to control watcher logs
  • Added: when a JavaScript file is changed, the corresponding cache in
    node/iojs cache is refreshed.
    This is particularly handy when working with plain JavaScript template
    (eg: react template made with
    metalsmith-react)

Technical changes

  • source written using babel
  • switch from jshint to eslint
  • move changelog in it's own file
  • add license
  • added myself as an author
  • use tape for test instead of mocha

Closes #4
Closes #13
Closes #17
Closes #18

- Fixed: metalsmith-collections are now correctly adjusted to avoid
duplicates entries after rebuilds)
- Removed: `pattern` option has been remove. Please use the new `paths`
option
- Added: `paths` option allows you to specify a map to trigger rebuilds
(closes [#4](#4) and
[#13](#13))
- Added: `log` option to be able to control watcher logs
- Added: when a JavaScript file is changed, the corresponding cache in
node/iojs cache is refreshed.
This is particularly handy when working with plain JavaScript template
(eg: react template made with
[metalsmith-react](https://github.com/MoOx/metalsmith-react))

Closes #4
Closes #13
Closes #17
Closes #18
@JoshConley
Copy link

Using the paths documented like this doesn't trigger a rebuild of everything:

'${source}/**/*': true
'partials/**/*': '**/*'

As you can see here:

[metalsmith-server] ✔︎ partials/header.html changed
[metalsmith-server] - Updating 0 file...

When using:

'${source}/**/*': true
'partials/**/*': true

...the partial rebuilds but the source doesn't, of course, so it doesn't update the source with the new partial.

Is this intended? I'm trying to get the source to rebuild so it includes the updated partial.

@MoOx
Copy link
Collaborator Author

MoOx commented May 7, 2015

Recent metalsmith release introduced a breaking change in run() method. So this branch is kind of broken.
That's why I didn't merge this. I have this fix this shit somehow... :/

@MoOx
Copy link
Collaborator Author

MoOx commented May 8, 2015

Ok I said some shit previously my bad. This is supposed to work @JoshConley.
I will push more tests to be sure.

@JoshConley
Copy link

Thanks for the update! Has something changed to make it work?

@MoOx
Copy link
Collaborator Author

MoOx commented May 8, 2015

No I didn't change anything for now, I was having local changes that make me think something was wrong.
Can you provide more informations on you setup so I can double check what is wrong ? (eg: folders structures, metalsmith dir, source, dest)

@JoshConley
Copy link

Yes! Essentially, folders are structured like this:

  • /src
  • /partials

When the partials change, the watch script recognizes the file changed, but doesn't rebuild the source file.

Using this config:

'${source}/**/*': true
'partials/**/*': '**/*'

Again, I get the same as I commented above (partials/header.html changed, updating 0 files). When the partial loads, the source should be rebuilt. Same thing happens if I use 'partials/**/*': '${source}/**/*'. The source isn't rebuilding, it's only rebuilding changed files.

@MoOx
Copy link
Collaborator Author

MoOx commented May 8, 2015

I guess the / is considered to be your metalsmith root amarite ?
The weird part is "updating 0 files", at this stage the glob specified for 'partials/**/*' (so this -> '**/*') is used in the metalsmith.source folder (so /src). You should get the number of all your files in this folder.
Can you share more stuff like your all metalsmith build script ?

@JoshConley
Copy link

Yup! I don't have access to it at the moment but I can share the build script with you tomorrow. Thanks for your help.

- paths normalization for rebuild (to prevent rebuild of 0 files?)
- brutal cache invalidation (when a js file changed, all js files of
metalsmith dir are cleaned)
- log prefix is [metalsmith-watch]
- execute metalsmith callback when it’s appropriate.

tests have been exploded to make them easier to use.
MoOx added a commit that referenced this pull request May 8, 2015
@MoOx MoOx merged commit 8c05608 into master May 8, 2015
@MoOx MoOx deleted the 1.0.0 branch May 8, 2015 11:16
@FWeinb
Copy link
Owner

FWeinb commented May 8, 2015

Awesome! Work thank you so much for this! 🎆

@MoOx
Copy link
Collaborator Author

MoOx commented May 8, 2015

blink

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.

Rebuild not starts if changes were done in included template file Watch multiple directories
3 participants