UNPKG

@metalsmith/default-values

Version:

A metalsmith plugin for setting default values to file metadata.

164 lines (120 loc) 14.7 kB
### Changelog All notable changes to this project will be documented in this file. Dates are displayed in UTC. Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### [v4.0.1](https://github.com/metalsmith/default-values/compare/v4.0.0...v4.0.1) - Updates dlv 3.1.3 -> 3.1.4, fixes security vulns [`d93c72c`](https://github.com/metalsmith/default-values/commit/d93c72cf61946c3df1f35dad8cc74d45a0421e92) - Documents potential pitfall when setting default object [`46b2db9`](https://github.com/metalsmith/default-values/commit/46b2db92db8c066bc93662b746c882f181a3bc85) - Changes set_defaults to return change delta, improves debug logs [`88a49da`](https://github.com/metalsmith/default-values/commit/88a49da6ea7e8b8d9d8a8b9e52a380284bb7d6b3) ### [v4.0.0](https://github.com/metalsmith/default-values/compare/v3.3.0...v4.0.0) > 20 March 2024 - Provides dual ESM/CJS module and aligns repo setup with other core plugins [`5d23dbd`](https://github.com/metalsmith/default-values/commit/5d23dbd1091e8d09030bdd9b2d6c945e6cd80476) - test: migrate test coverage from nyc -> c8, tests from CJS to ESM [`e03aacf`](https://github.com/metalsmith/default-values/commit/e03aacf7b4956a962258d791027782fe34953aa2) - Moves to more permissive LGPL license [`294f77f`](https://github.com/metalsmith/default-values/commit/294f77ffff73f848064dccb2d1817d484e9853c5) - Provides access to metalsmith.metadata() within default setter functions [`d4a5723`](https://github.com/metalsmith/default-values/commit/d4a57232bb7942ef001ec348a5f44350990f43a2) - Swaps out lodash.get/set for resp. dlv/dset & fixes security vulnerability [`1c27fd3`](https://github.com/metalsmith/default-values/commit/1c27fd330d854529f7d11b084135fd7ac64d3f36) - Clarifies default setting at keypaths and buffer conversion [`6c363de`](https://github.com/metalsmith/default-values/commit/6c363de5f777046a03c7432ac425fbf6af089d9f) - Adds 'strategy' option to allow overwriting existing values [`6e61e96`](https://github.com/metalsmith/default-values/commit/6e61e9653e7bee8d425324805bbc6e88c9fb7a0a) - Transforms default value into buffer if target type is already a buffer [`7287c08`](https://github.com/metalsmith/default-values/commit/7287c08aa94ef7cd7bdbceb58687acdfdfbc533b) - Adds generics for file & global metadata to Typescript types [`fb81838`](https://github.com/metalsmith/default-values/commit/fb818381d1246fa023f57f2ee4adaaa53428866f) - test: adds TS test [`f00280c`](https://github.com/metalsmith/default-values/commit/f00280c89eb01cafd59875e605060a597aae56f0) - Minor performance enhancement in calling setDefaults [`9dd6a84`](https://github.com/metalsmith/default-values/commit/9dd6a843b8acd413b0d2323f5b056248e74313ae) - Drops support for Node.js < 14.18.0, updates CI [`fbfa2c7`](https://github.com/metalsmith/default-values/commit/fbfa2c7897368cd272a19d3038d0b98c69a78574) - Updates dset 3.1.2 -> 3.1.3 [`d9a8d1e`](https://github.com/metalsmith/default-values/commit/d9a8d1e5805f4ccb49c80bec36196d45f87ce7fd) #### [v3.3.0](https://github.com/metalsmith/default-values/compare/v3.2.1...v3.3.0) > 26 November 2022 - Allow setting default contents when buffer is empty [`5d41d17`](https://github.com/metalsmith/default-values/commit/5d41d1790b1d4bc6a2905c08d028ab67c83221f4) - Docs: Add elaborate example with other plugins + single defaults set usage [`bb50253`](https://github.com/metalsmith/default-values/commit/bb502537ffb476208cb032570b3d7c4f4db98847) - Drops support for Metalsmith < 2.5.0, replaces debug with metalsmith.debug [`b5191b4`](https://github.com/metalsmith/default-values/commit/b5191b471b1d6a3742b57b5eb33629ed32acc12e) - Adds Typescript support [`3b1b438`](https://github.com/metalsmith/default-values/commit/3b1b438243b0638d0d25db69f55999a97a302f08) - Document features in README.md [`12102c8`](https://github.com/metalsmith/default-values/commit/12102c81d729d766d7b9be904aa601023b893426) - Log a warning when pattern matches no files [`c62cbc9`](https://github.com/metalsmith/default-values/commit/c62cbc98f19fa5ac2fe8529996d832895a2cdf93) - Allows passing a single defaults set as shorthand for [defaultsSet] [`39df8f7`](https://github.com/metalsmith/default-values/commit/39df8f749d22899aaaf4cd1adad5080ae821c193) - Renames default export initDefaultValues -> defaultValues [`30fc0c5`](https://github.com/metalsmith/default-values/commit/30fc0c5c54392cf21d3ced7eabdab209aac0e26d) #### [v3.2.1](https://github.com/metalsmith/default-values/compare/v3.2.0...v3.2.1) > 1 August 2022 - Fixes #24: use ms.match(pattern, files) signature for branch/watch compat [`#24`](https://github.com/metalsmith/default-values/issues/24) - Updates debug 4.3.3 -> 4.3.4. Upgrades package-lock.json to v2 & fixes security issue [`67a968b`](https://github.com/metalsmith/default-values/commit/67a968b4d3799d6c95d98f2eb2472796c1b59b98) - Enhancement: add JSDoc example + better options doc [`93b52f2`](https://github.com/metalsmith/default-values/commit/93b52f22b8bf969fa7eb8a7ea10dd8c201c99f91) #### [v3.2.0](https://github.com/metalsmith/default-values/compare/v3.1.0...v3.2.0) > 2 May 2022 - Removed console log from code [`#21`](https://github.com/metalsmith/default-values/pull/21) - Drops Node < 12 support, adds metalsmith as peer & devDep [`7262bf6`](https://github.com/metalsmith/default-values/commit/7262bf604d9d41774bbb13443fd384c3f3d136e1) - Removes multimatch, uses metalsmith.match. Simplified & refactored [`d6f8407`](https://github.com/metalsmith/default-values/commit/d6f84076e6fe91ca3205c1ed2c14a7cca4694b98) - Removed Joi options validation in favor of allowing options to be undefined [`19e5f23`](https://github.com/metalsmith/default-values/commit/19e5f23c11cdf2104d6ccce4027ff27728922775) #### [v3.1.0](https://github.com/metalsmith/default-values/compare/v3.0.2...v3.1.0) > 30 January 2022 - Updated packages [`#18`](https://github.com/metalsmith/default-values/pull/18) - Align plugin with other core plugins. Update package.json, generate changelog, fix debug namespace [`cae2058`](https://github.com/metalsmith/default-values/commit/cae2058d73a736adf519f9b83b93b7879ad1a45e) #### [v3.0.2](https://github.com/metalsmith/default-values/compare/v3.0.1...v3.0.2) > 7 September 2020 - Updated Packages [`#17`](https://github.com/metalsmith/default-values/pull/17) - Package updated [`8ae7cf2`](https://github.com/metalsmith/default-values/commit/8ae7cf224db67eb65c239fc473225149f1ab2670) - Package updated [`0e582de`](https://github.com/metalsmith/default-values/commit/0e582de4de19581ea02792415195395ad646c299) - Removed outdated badges [`2afcd0e`](https://github.com/metalsmith/default-values/commit/2afcd0e915c27ba7f91538042504160fb47edeb1) - Removed Node version warning [`f4a6327`](https://github.com/metalsmith/default-values/commit/f4a6327babaa2696062fad1f89d69033b1ee18a4) #### [v3.0.1](https://github.com/metalsmith/default-values/compare/v3.0.0...v3.0.1) > 7 September 2020 - Org switch to Metalsmith scope [`#16`](https://github.com/metalsmith/default-values/pull/16) - Greenkeeper: removed ignore as Node.js v4 support is no longer required [`4b846f5`](https://github.com/metalsmith/default-values/commit/4b846f51e4072aabb2e51271a26742b6a6abde40) ### [v3.0.0](https://github.com/metalsmith/default-values/compare/v2.1.0...v3.0.0) > 11 September 2018 - Packages updated [`#15`](https://github.com/metalsmith/default-values/pull/15) - Update debug to the latest version 🚀 [`#14`](https://github.com/metalsmith/default-values/pull/14) - Update eslint-config-prettier to the latest version 🚀 [`#12`](https://github.com/metalsmith/default-values/pull/12) - Travis: Removed testing for v4-5 as they're no longer maintained [`6277b21`](https://github.com/metalsmith/default-values/commit/6277b2161445bb915eef68bfb242f5ebc223596d) - fix(package): update debug to version 4.0.0 [`7f38589`](https://github.com/metalsmith/default-values/commit/7f38589494cd1d96e1f59f85543f91cf8dcf691a) - chore(package): update eslint-config-prettier to version 3.0.0 [`ac8689a`](https://github.com/metalsmith/default-values/commit/ac8689ad3d97fe55b43bbef6639c252158a5387d) - Travis: Added v10 to test [`d3b01e3`](https://github.com/metalsmith/default-values/commit/d3b01e33a35e5d6a7ea78b6dee27f9823cafeb0a) #### [v2.1.0](https://github.com/metalsmith/default-values/compare/v2.0.1...v2.1.0) > 19 July 2018 - default value with a function [`#10`](https://github.com/metalsmith/default-values/pull/10) - Update dependencies to enable Greenkeeper 🌴 [`#11`](https://github.com/metalsmith/default-values/pull/11) - Revered packages and ignored with greenkeeper [`5e7645c`](https://github.com/metalsmith/default-values/commit/5e7645c6de8d23278f91b6160ec813921d2f16ac) - Removed BitHound Badges :( [`7b255a9`](https://github.com/metalsmith/default-values/commit/7b255a9e3a861d06744542febfcfa5b31da9f747) - Added badge [`210c7f9`](https://github.com/metalsmith/default-values/commit/210c7f9dbe4946685f7636ae87505334843fba2b) - chore(package): update dependencies [`d587d71`](https://github.com/metalsmith/default-values/commit/d587d7103483bd7a5b68d75707e1164f765763d1) - Update README.md [`e9de8d3`](https://github.com/metalsmith/default-values/commit/e9de8d3493943221012737a2583c760cc81bcca0) - Badges: updated [`fd0d488`](https://github.com/metalsmith/default-values/commit/fd0d4887a2178ff689ad7333bed9d2872e33de7b) - Updated package scripts [`4c26c3d`](https://github.com/metalsmith/default-values/commit/4c26c3d0110cc2ed99700ae7d7e30cb83dfd7b8b) - docs(readme): add Greenkeeper badge [`489007a`](https://github.com/metalsmith/default-values/commit/489007ae174d55f6ef375a0fe5984461286e3ca0) - Update README.md [`9d82281`](https://github.com/metalsmith/default-values/commit/9d82281a72a774c08c0c53f8d4ed4a4c8957e1f8) #### [v2.0.1](https://github.com/metalsmith/default-values/compare/v2.0.0...v2.0.1) > 24 January 2018 - Dependencies: Updated Fixes #4 and general maintenance [`#8`](https://github.com/metalsmith/default-values/pull/8) - Merge pull request #8 from woodyrew/fix-dependencies [`#4`](https://github.com/metalsmith/default-values/issues/4) - Dependencies: Updated Fixes #4 and general maintenance [`#4`](https://github.com/metalsmith/default-values/issues/4) [`#7`](https://github.com/metalsmith/default-values/issues/7) [`#6`](https://github.com/metalsmith/default-values/issues/6) [`#3`](https://github.com/metalsmith/default-values/issues/3) [`#5`](https://github.com/metalsmith/default-values/issues/5) - Extra information and examples [`ae84ed0`](https://github.com/metalsmith/default-values/commit/ae84ed0d8d926695efb890150781489f7c3e1352) - All the badges [`df8316f`](https://github.com/metalsmith/default-values/commit/df8316f62a4658110eb8596f30f3635d7a4bc9de) - README: Formatting [`cfa537f`](https://github.com/metalsmith/default-values/commit/cfa537fa3f93ac2b8e4c65c7aeec95c72a0deb98) - Updated Dependencies [`412293b`](https://github.com/metalsmith/default-values/commit/412293be44b6c9d0beee54b590e02ea64c61a2ec) - Dependencies: Downgraded Joi to 12 for Node <6 compatibility [`4df7f3c`](https://github.com/metalsmith/default-values/commit/4df7f3c70b75e09f876006dbae97582eb49f7d4d) ### [v2.0.0](https://github.com/metalsmith/default-values/compare/v1.0.1...v2.0.0) > 7 August 2017 - Dependancies: Upgraded [`#1`](https://github.com/metalsmith/default-values/pull/1) - Require typo: Corrected; Fixes #2 [`#2`](https://github.com/metalsmith/default-values/issues/2) - npm 5 - Added package-lock.json [`c3be173`](https://github.com/metalsmith/default-values/commit/c3be173fe482521ad7cd8bbaebb3249a02df0db5) - ES6 - Converted to modern JS; Also added allownUnknown for config [`4e9373a`](https://github.com/metalsmith/default-values/commit/4e9373a6f0a64b96a2f4077da6a9e473abc822b9) - Updated dev dependancies and switched to TAP [`2abbc83`](https://github.com/metalsmith/default-values/commit/2abbc8386f5e79a0c963b3b49de5f763d1b03360) - Removed unecessary test index file [`914e71e`](https://github.com/metalsmith/default-values/commit/914e71e068ce535cc18a7d09a135a02820ab6184) - Added engines and updated travis node versions [`616c5f7`](https://github.com/metalsmith/default-values/commit/616c5f769e86a02582a7bb7aca5970fd8dc59c6d) - Dependencies updated [`b6574a2`](https://github.com/metalsmith/default-values/commit/b6574a2770da152cfbeea66bc1e39dc859128fd2) #### [v1.0.1](https://github.com/metalsmith/default-values/compare/v1.0.0...v1.0.1) > 27 August 2016 - Dependancies: Upgraded [`498e2d4`](https://github.com/metalsmith/default-values/commit/498e2d488bda5ca69906e7e804ad0bb174bc6752) - Travis: Limited to NodeJS v4 and above. [`c724323`](https://github.com/metalsmith/default-values/commit/c72432396611a6e9c9d812471e825ca96f0b4a42) - Travis: Removed 4.0 [`c58c6b7`](https://github.com/metalsmith/default-values/commit/c58c6b7f760fd544c52c88b6c49386e7eb430632) #### v1.0.0 > 27 August 2016 - Initial commit [`5238b14`](https://github.com/metalsmith/default-values/commit/5238b1401b34e384592239730e55f9a14367b313) - Plugin inital state: open sourced for <3 [`18844b6`](https://github.com/metalsmith/default-values/commit/18844b615993777b5183a63cc9321c4f4e38adf1) - Testing: Added basic tests and updated readme. [`d290ca5`](https://github.com/metalsmith/default-values/commit/d290ca5bd892d92cd58bd1e43d66aed7f923760e) - Error: Returns error properly [`b72f12a`](https://github.com/metalsmith/default-values/commit/b72f12a7c2569c25b50970791392746cba4eea22) - Travis: Added [`2fa32ab`](https://github.com/metalsmith/default-values/commit/2fa32ab1d40903ac23ea5a198b8a7ae4c4160c4c) - NPM & Travis Icons: added [`6f0e103`](https://github.com/metalsmith/default-values/commit/6f0e1034743b02b5346ddc37a16add84ff208625) - Added dependencies badge [`cea37af`](https://github.com/metalsmith/default-values/commit/cea37af6d04265ded7b01168faa957972e6ee0f3) - Readme: fix require statement [`d4225f2`](https://github.com/metalsmith/default-values/commit/d4225f2a5533d4d7a567935a1529e7b4bac60f57) - ESLint: update to default - duplicate key [`8668a5a`](https://github.com/metalsmith/default-values/commit/8668a5aaa14eff117d738d9150906abcc43de5a2) - ESLint Verson: Set [`d685194`](https://github.com/metalsmith/default-values/commit/d6851941ab931fc870f4192274b280c630ae0265) - Legacy compatibility: Switched to Joi 6.x [`7c1f1ea`](https://github.com/metalsmith/default-values/commit/7c1f1ea675aff4ffc4402300c9e6582fe5430166) - Update defaults to remove duplicate [`429b664`](https://github.com/metalsmith/default-values/commit/429b664e4d98805e811f9d776252b2c3a88c9a5f) - Travis: Renamed to correct name [`88b0688`](https://github.com/metalsmith/default-values/commit/88b0688a6745255efe5470287106d7ed2a5ecba1)