Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metalsmith

Package Overview
Dependencies
Maintainers
5
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith - npm Package Compare versions

Comparing version 2.6.0 to 2.6.1

8

CHANGELOG.md

@@ -9,2 +9,10 @@ # Change Log

## [2.6.1] - 2023-07-10
- [`34239d9`](https://github.com/metalsmith/metalsmith/commit/34239d9) Documents metalsmith.watch() getter signature in TS
- [`a719025`](https://github.com/metalsmith/metalsmith/commit/a719025) Normalizes ms.watch().paths to an array, allows access to a subset of chokidar options as advertised
- [`5a516b2`](https://github.com/metalsmith/metalsmith/commit/5a516b2) Sets chokidar watchOption awaitWriteFinish to false, and batch timer to 0 to speed up watching
- [`23b0944`](https://github.com/metalsmith/metalsmith/commit/23b0944) Fixes #389: ensure not missing watcher ready event to successfully launch build
- [`05265ce`](https://github.com/metalsmith/metalsmith/commit/05265ce) Fixes formatting issue in types JSdoc comments
## [2.6.0] - 2023-05-30

@@ -11,0 +19,0 @@

9

lib/index.js

@@ -520,11 +520,12 @@ 'use strict'

if (isString(options) || Array.isArray(options)) options = { paths: options }
else if (options === true) options = { paths: this.source() }
else if (options === true) options = { paths: [this.source()] }
this[symbol.watch] = {
paths: options.paths,
paths: [this.source()],
awaitWriteFinish: false,
...options,
alwaysStat: false,
cwd: this.directory(),
ignored: this.ignore(),
ignoreInitial: true,
awaitWriteFinish: true
ignoreInitial: true
}

@@ -531,0 +532,0 @@ }

@@ -79,2 +79,6 @@ /* c8 ignore start */

// assume chokidar's ready event fires reliably
// the promise needs to be created immediately after watcher initialization to avoid missing the ready event
const watcherReady = new Promise((resolve) => watcher.on('ready', () => resolve()))
const eventqueue = []

@@ -135,3 +139,3 @@ // eslint-disable-next-line no-unused-vars

})
}, 1000)
}, 0)
})

@@ -142,3 +146,3 @@ return new Promise((resolve, reject) => {

if (!clean) lastHashmap = computeHashMap(files)
watcher.on('ready', () => {
watcherReady.then(() => {
onRebuild(null, files)

@@ -145,0 +149,0 @@ resolve(function closeWatcher() {

{
"name": "metalsmith",
"version": "2.6.0",
"version": "2.6.1",
"description": "An extremely simple, pluggable static site generator.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -7,2 +7,3 @@ /// <reference types="node" />

import { GrayMatterFile } from 'gray-matter';
import { WatchOptions } from 'chokidar';
import micromatch = require('micromatch');

@@ -19,3 +20,3 @@ declare class Metalsmith {

/**
* Return matter options to use for parsing & stringification
* Return matter options to use for parsing & stringification
* [API Docs](https://metalsmith.io/api/#Metalsmith+matter+options) | [Source code](https://github.com/metalsmith/metalsmith/blob/v2.6.0/lib/matter.js#L27)

@@ -25,3 +26,3 @@ */

/**
* Set matter options to use for parsing & stringification
* Set matter options to use for parsing & stringification
* [API Docs](https://metalsmith.io/api/#Metalsmith+matter+options) | [Source code](https://github.com/metalsmith/metalsmith/blob/v2.6.0/lib/matter.js#L27)

@@ -31,3 +32,3 @@ */

/**
* Parse a string or buffer for front matter and return it as a {@linkcode Metalsmith.File} object.
* Parse a string or buffer for front matter and return it as a {@linkcode Metalsmith.File} object.
* [API Docs](https://metalsmith.io/api/#Metalsmith+matter+parse) | [Source code](https://github.com/metalsmith/metalsmith/blob/v2.6.0/lib/matter.js#L37)

@@ -44,3 +45,3 @@ * @example

/**
* Stringify a {@linkcode Metalsmith.File} object to a string with frontmatter and contents
* Stringify a {@linkcode Metalsmith.File} object to a string with frontmatter and contents
* [API Docs](https://metalsmith.io/api/#Metalsmith+matter+stringify) | [Source code](https://github.com/metalsmith/metalsmith/blob/v2.6.0/lib/matter.js#L59)

@@ -61,3 +62,3 @@ * @example

/**
* Wrap stringified front-matter-compatible data with the matter delimiters
* Wrap stringified front-matter-compatible data with the matter delimiters
* [API Docs](https://metalsmith.io/api/#Metalsmith+matter+wrap) | [Source code](https://github.com/metalsmith/metalsmith/blob/v2.6.0/lib/matter.js#L69)

@@ -163,6 +164,19 @@ */

frontmatter(): boolean;
/** Consult [chokidar.watchOptions](https://github.com/paulmillr/chokidar#api) in use by `metalsmith.watch`.
* [API Docs](https://metalsmith.io/api/#Metalsmith+watch) | [Source code](https://github.com/metalsmith/metalsmith/blob/v2.6.0/lib/index.js#L510)
* @example
* metalsmith.watch()
* // {
* // paths: [metalsmith.source()],
* // ignoreInitial: true,
* // awaitWriteFinish: false,
* // ignore: metalsmith.ignore(),
* // alwaysStat: false
* // }
*/
watch(): false|WatchOptions
/**
* Set the list of paths to watch and trigger rebuilds on. The watch method will skip files ignored with {@linkcode Metalsmith.ignore}
* and will do partial (true) or full (false) rebuilds depending on the {@linkcode Metalsmith.clean} setting.
* It can be used both for rebuilding in-memory with {@linkcode Metalsmith.process} or writing to file system with {@linkcode Metalsmith.build},
* It can be used both for rebuilding in-memory with {@linkcode Metalsmith.process} or writing to file system with {@linkcode Metalsmith.build}.
* [API Docs](https://metalsmith.io/api/#Metalsmith+watch) | [Source code](https://github.com/metalsmith/metalsmith/blob/v2.6.0/lib/index.js#L510)

@@ -178,4 +192,4 @@ * @default false

watch(
/** `true` or `false` to watch {@linkcode Metalsmith.source}, or one or more paths/ globs */
watch: boolean|string|string[]
/** `true` or `false` to watch {@linkcode Metalsmith.source}, or one or more paths/ globs, or a subset of chokidar watchOptions */
watch: boolean|string|string[]|Omit<WatchOptions, 'ignoreInitial'|'ignored'|'alwaysStat'|'cwd'>
): Metalsmith;

@@ -219,3 +233,3 @@ /**

/**
* Assign values to the global `metadata` object.
* Assign values to the global `metadata` object.
* [API Docs](https://metalsmith.io/api/#Metalsmith+metadata) | [Source code](https://github.com/metalsmith/metalsmith/blob/v2.6.0/lib/index.js#L199)

@@ -230,3 +244,3 @@ * @example

/**
* Get the global `metadata` object.
* Get the global `metadata` object.
* [API Docs](https://metalsmith.io/api/#Metalsmith+metadata) | [Source code](https://github.com/metalsmith/metalsmith/blob/v2.6.0/lib/index.js#L199)

@@ -233,0 +247,0 @@ * @example

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc