diff --git a/dist/add-dist-header.d.ts b/dist/add-dist-header.d.ts index a763d99..153d5db 100644 --- a/dist/add-dist-header.d.ts +++ b/dist/add-dist-header.d.ts @@ -1,4 +1,4 @@ -//! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License +//! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License export type Settings = { allFiles: boolean; diff --git a/dist/add-dist-header.js b/dist/add-dist-header.js index 2ae4f43..44d775e 100644 --- a/dist/add-dist-header.js +++ b/dist/add-dist-header.js @@ -1,10 +1,9 @@ -//! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License +//! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License import { isBinary } from 'istextorbinary'; import chalk from 'chalk'; import fs from 'fs'; import log from 'fancy-log'; -import makeDir from 'make-dir'; import path from 'path'; import slash from 'slash'; const addDistHeader = { @@ -54,7 +53,7 @@ const addDistHeader = { const banner = [`${pkg.name} v${pkg.version}`, info, license].join(delimiter); const header = commentStyle[type].start + banner + commentStyle[type].end; const fixedDigits = { minimumFractionDigits: 2, maximumFractionDigits: 2 }; - const distFolder = makeDir.sync(settings.dist); + const distFolder = fs.mkdirSync(settings.dist, { recursive: true }) ?? settings.dist; const formatOptions = { dir: settings.dist, name: inputFile.name, ext: fileExt }; const outputPath = slash(path.format(formatOptions)); const isMinified = outputPath.includes('.min.') || out4.indexOf('\n') === out4.length - 1; diff --git a/package.json b/package.json index 57a7b0e..fd8b60d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "add-dist-header", - "version": "1.4.1", + "version": "1.4.2", "description": "Prepend a one-line banner comment (with license notice) to distribution files", "license": "MIT", "type": "module", diff --git a/spec/fixtures/target/cli/all/kebab.css b/spec/fixtures/target/cli/all/kebab.css index 88fd2aa..c4472e1 100644 --- a/spec/fixtures/target/cli/all/kebab.css +++ b/spec/fixtures/target/cli/all/kebab.css @@ -1,6 +1,6 @@ -/*! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License */ +/*! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License */ -.kebab { /* v1.4.1 */ +.kebab { /* v1.4.2 */ border: 2px solid firebrick; border-radius: 3px; } diff --git a/spec/fixtures/target/cli/all/kebab.html b/spec/fixtures/target/cli/all/kebab.html index 7fa60b6..2c8493c 100644 --- a/spec/fixtures/target/cli/all/kebab.html +++ b/spec/fixtures/target/cli/all/kebab.html @@ -1,11 +1,11 @@ - + Kebab • 🍒🍒🍒 -

Kebab v1.4.1

+

Kebab v1.4.2

diff --git a/spec/fixtures/target/cli/all/kebab.js b/spec/fixtures/target/cli/all/kebab.js index 7817a4a..2a72c48 100644 --- a/spec/fixtures/target/cli/all/kebab.js +++ b/spec/fixtures/target/cli/all/kebab.js @@ -1,8 +1,8 @@ -//! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License +//! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License -const toKebab = (camelStr) => { //v1.4.1 +const toKebab = (camelStr) => { //v1.4.2 const dash = (word) => '-' + word.toLowerCase(); return ('' + camelStr).replace(/([A-Z]+)/g, dash).replace(/\s|^-/g, ''); }; -export { toKebab }; //version: 1.4.1 +export { toKebab }; //version: 1.4.2 diff --git a/spec/fixtures/target/cli/all/kebab.min.js b/spec/fixtures/target/cli/all/kebab.min.js index 936e829..c0c083c 100644 --- a/spec/fixtures/target/cli/all/kebab.min.js +++ b/spec/fixtures/target/cli/all/kebab.min.js @@ -1,2 +1,2 @@ -//! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License +//! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License const toKebab=(c)=>{const d=(w)=>'-'+ w.toLowerCase();return(''+c).replace(/([A-Z]+)/g,d).replace(/\s|^-/g,'');};module.exports=toKebab; diff --git a/spec/fixtures/target/cli/all/kebab.ts b/spec/fixtures/target/cli/all/kebab.ts index b7b73b2..e319c52 100644 --- a/spec/fixtures/target/cli/all/kebab.ts +++ b/spec/fixtures/target/cli/all/kebab.ts @@ -1,9 +1,9 @@ -//! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License +//! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License //! This comment is important! -const toKebab = (camelStr: string): string => { //v1.4.1 +const toKebab = (camelStr: string): string => { //v1.4.2 const dash = (word: string) => '-' + word.toLowerCase(); return ('' + camelStr).replace(/([A-Z]+)/g, dash).replace(/\s|^-/g, ''); }; -export { toKebab }; //version: 1.4.1 +export { toKebab }; //version: 1.4.2 diff --git a/spec/fixtures/target/cli/all/kebab.xml b/spec/fixtures/target/cli/all/kebab.xml index 2aa5138..f1c42cb 100644 --- a/spec/fixtures/target/cli/all/kebab.xml +++ b/spec/fixtures/target/cli/all/kebab.xml @@ -1,5 +1,5 @@ - + diff --git a/spec/fixtures/target/cli/all/subfolder/pita-bread.js b/spec/fixtures/target/cli/all/subfolder/pita-bread.js index 71a48bb..75360cc 100644 --- a/spec/fixtures/target/cli/all/subfolder/pita-bread.js +++ b/spec/fixtures/target/cli/all/subfolder/pita-bread.js @@ -1,7 +1,7 @@ -//! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License +//! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License import { toKebab } from '../kebab'; -const pitaBread = (str) => `πŸ«“ ${toKebab(str)} πŸ«“`; //v1.4.1 +const pitaBread = (str) => `πŸ«“ ${toKebab(str)} πŸ«“`; //v1.4.2 export { pitaBread }; diff --git a/spec/fixtures/target/cli/ext/kebab.css b/spec/fixtures/target/cli/ext/kebab.css index 88fd2aa..c4472e1 100644 --- a/spec/fixtures/target/cli/ext/kebab.css +++ b/spec/fixtures/target/cli/ext/kebab.css @@ -1,6 +1,6 @@ -/*! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License */ +/*! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License */ -.kebab { /* v1.4.1 */ +.kebab { /* v1.4.2 */ border: 2px solid firebrick; border-radius: 3px; } diff --git a/spec/fixtures/target/cli/ext/kebab.js b/spec/fixtures/target/cli/ext/kebab.js index 7817a4a..2a72c48 100644 --- a/spec/fixtures/target/cli/ext/kebab.js +++ b/spec/fixtures/target/cli/ext/kebab.js @@ -1,8 +1,8 @@ -//! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License +//! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License -const toKebab = (camelStr) => { //v1.4.1 +const toKebab = (camelStr) => { //v1.4.2 const dash = (word) => '-' + word.toLowerCase(); return ('' + camelStr).replace(/([A-Z]+)/g, dash).replace(/\s|^-/g, ''); }; -export { toKebab }; //version: 1.4.1 +export { toKebab }; //version: 1.4.2 diff --git a/spec/fixtures/target/cli/ext/kebab.min.js b/spec/fixtures/target/cli/ext/kebab.min.js index 936e829..c0c083c 100644 --- a/spec/fixtures/target/cli/ext/kebab.min.js +++ b/spec/fixtures/target/cli/ext/kebab.min.js @@ -1,2 +1,2 @@ -//! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License +//! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License const toKebab=(c)=>{const d=(w)=>'-'+ w.toLowerCase();return(''+c).replace(/([A-Z]+)/g,d).replace(/\s|^-/g,'');};module.exports=toKebab; diff --git a/spec/fixtures/target/kebab.html b/spec/fixtures/target/kebab.html index 5353123..9530479 100644 --- a/spec/fixtures/target/kebab.html +++ b/spec/fixtures/target/kebab.html @@ -1,4 +1,4 @@ - + @@ -7,6 +7,6 @@ Kebab • 🍒🍒🍒 -

Kebab v1.4.1

+

Kebab v1.4.2

diff --git a/spec/fixtures/target/kebab.js b/spec/fixtures/target/kebab.js index 48dc487..04ac9a4 100644 --- a/spec/fixtures/target/kebab.js +++ b/spec/fixtures/target/kebab.js @@ -1,8 +1,8 @@ -//! add-dist-header v1.4.1 πŸ«“πŸ’πŸ«“ https://github.com/center-key/add-dist-header πŸ«“πŸ’πŸ«“ MIT License +//! add-dist-header v1.4.2 πŸ«“πŸ’πŸ«“ https://github.com/center-key/add-dist-header πŸ«“πŸ’πŸ«“ MIT License -const toKebab = (camelStr) => { //v1.4.1 +const toKebab = (camelStr) => { //v1.4.2 const dash = (word) => '-' + word.toLowerCase(); return ('' + camelStr).replace(/([A-Z]+)/g, dash).replace(/\s|^-/g, ''); }; -export { toKebab }; //version: 1.4.1 +export { toKebab }; //version: 1.4.2 diff --git a/spec/fixtures/target/kebab.min.css b/spec/fixtures/target/kebab.min.css index a10fc01..8dba3af 100644 --- a/spec/fixtures/target/kebab.min.css +++ b/spec/fixtures/target/kebab.min.css @@ -1,5 +1,5 @@ -/*! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License */ -.kebab { /* v1.4.1 */ +/*! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License */ +.kebab { /* v1.4.2 */ border: 2px solid firebrick; border-radius: 3px; } diff --git a/spec/fixtures/target/kebab.min.js b/spec/fixtures/target/kebab.min.js index 936e829..c0c083c 100644 --- a/spec/fixtures/target/kebab.min.js +++ b/spec/fixtures/target/kebab.min.js @@ -1,2 +1,2 @@ -//! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License +//! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License const toKebab=(c)=>{const d=(w)=>'-'+ w.toLowerCase();return(''+c).replace(/([A-Z]+)/g,d).replace(/\s|^-/g,'');};module.exports=toKebab; diff --git a/spec/fixtures/target/kebab.ts b/spec/fixtures/target/kebab.ts index fbdfa0a..d8bb4fd 100644 --- a/spec/fixtures/target/kebab.ts +++ b/spec/fixtures/target/kebab.ts @@ -1,4 +1,4 @@ -//! add-dist-header v1.4.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License +//! add-dist-header v1.4.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License //! This comment is important! const toKebab = (camelStr: string): string => { //v{{package.version}}