From 4c20794db46e8f78fe25b43adf6ac1ff63026d5f Mon Sep 17 00:00:00 2001 From: dpilafian Date: Mon, 12 Aug 2024 20:38:36 -0700 Subject: [PATCH] Release v1.3.1 --- dist/replacer.d.ts | 2 +- dist/replacer.js | 13 ++++++++----- package.json | 4 ++-- spec/fixtures/target/bundle.js | 4 ++-- spec/fixtures/target/mock1.html | 4 ++-- spec/fixtures/target/mock1.js | 2 +- spec/fixtures/target/subfolder-a/mock2.html | 2 +- spec/fixtures/target/subfolder-a/mock2.js | 2 +- spec/fixtures/target/web/index.html | 4 ++-- spec/fixtures/target/web/subfolder-a/index.html | 2 +- spec/fixtures/target/web/subfolder-b/index.html | 2 +- .../target/web/subfolder-b/subfolder-bb/index.html | 2 +- 12 files changed, 23 insertions(+), 20 deletions(-) diff --git a/dist/replacer.d.ts b/dist/replacer.d.ts index 2588027..79785aa 100644 --- a/dist/replacer.d.ts +++ b/dist/replacer.d.ts @@ -1,4 +1,4 @@ -//! replacer-util v1.3.0 ~~ https://github.com/center-key/replacer-util ~~ MIT License +//! replacer-util v1.3.1 ~~ https://github.com/center-key/replacer-util ~~ MIT License export type Settings = { cd: string | null; diff --git a/dist/replacer.js b/dist/replacer.js index c85fe07..a9c819e 100644 --- a/dist/replacer.js +++ b/dist/replacer.js @@ -1,4 +1,4 @@ -//! replacer-util v1.3.0 ~~ https://github.com/center-key/replacer-util ~~ MIT License +//! replacer-util v1.3.1 ~~ https://github.com/center-key/replacer-util ~~ MIT License import { globSync } from 'glob'; import { isBinary } from 'istextorbinary'; @@ -25,9 +25,9 @@ const task = { }; Object.keys(pkgObj).forEach(unhide); }; - if (pkg?.dependencies) + if (pkg.dependencies) fixHiddenKeys(pkg.dependencies); - if (pkg?.devDependencies) + if (pkg.devDependencies) fixHiddenKeys(pkg.devDependencies); return pkg; }, @@ -63,7 +63,7 @@ const replacer = { missingFind ? 'Must specify search text with --find or --regex' : null; if (errorMessage) - throw Error('[replacer-util] ' + errorMessage); + throw new Error('[replacer-util] ' + errorMessage); const globFiles = () => exts.map(ext => globSync(source + '/**/*' + ext)).flat().sort(); const keep = (file) => !settings.exclude || !file.includes(settings.exclude); const relativeFolders = (file) => file.substring(source.length, file.length - path.basename(file).length); @@ -87,7 +87,10 @@ const replacer = { const dir = slash(parsedPath.dir); const filePath = dir + '/' + slash(parsedPath.base); const folder = path.basename(dir); - return { ...parsedPath, dir: dir, folder: folder, path: filePath }; + const date = fs.statSync(origin).mtime; + const dateFormat = { day: 'numeric', month: 'long', year: 'numeric' }; + const modified = date.toLocaleString([], dateFormat); + return { ...parsedPath, dir: dir, folder: folder, path: filePath, date, modified }; }; const getWebRoot = (origin) => { const depth = origin.substring(source.length).split('/').length - 2; diff --git a/package.json b/package.json index 39c8bd3..50bea0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "replacer-util", - "version": "1.3.0", + "version": "1.3.1", "description": "Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)", "license": "MIT", "type": "module", @@ -88,7 +88,7 @@ "rimraf": "~6.0", "run-scripts-util": "~1.3", "typescript": "~5.5", - "typescript-eslint": "~8.0", + "typescript-eslint": "~8.1", "w3c-html-validator": "~1.8" } } diff --git a/spec/fixtures/target/bundle.js b/spec/fixtures/target/bundle.js index f50fb34..79d0212 100644 --- a/spec/fixtures/target/bundle.js +++ b/spec/fixtures/target/bundle.js @@ -6,7 +6,7 @@ let π1 = 3.14; let τ1 = 2 * π1; const info1 = { - banner: '🔍🔍🔍 replacer-util v1.3.0 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.3.1 🔍🔍🔍', description: 'Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)', list1: 'insect, insect, insect', list2: 'insect, iNsEcT, INSECT, insect', @@ -23,7 +23,7 @@ let π2 = 3.14; let τ2 = 2 * π2; const info2 = { - banner: '🔍🔍🔍 replacer-util v1.3.0 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.3.1 🔍🔍🔍', description: 'Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)', code: 'mock2', file: '{"root":"","dir":"spec/fixtures/source/subfolder-a","base":"mock2.js","ext":".js","name":"mock2","folder":"subfolder-a","path":"spec/fixtures/source/subfolder-a/mock2.js","date":"2024-02-02T15:02:19.837Z","modified":"February 2, 2024"}', diff --git a/spec/fixtures/target/mock1.html b/spec/fixtures/target/mock1.html index dd4ca81..dbbe801 100644 --- a/spec/fixtures/target/mock1.html +++ b/spec/fixtures/target/mock1.html @@ -19,7 +19,7 @@

Weekday: Monday

I, for one, welcome our new A.I. module overlords.

@@ -30,7 +30,7 @@

Weekday: Monday

let τ2 = 2 * π2; const info2 = { - banner: '🔍🔍🔍 replacer-util v1.3.0 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.3.1 🔍🔍🔍', description: 'Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)', code: 'mock1', file: '{"root":"","dir":"spec/fixtures/source","base":"mock1.html","ext":".html","name":"mock1","folder":"source","path":"spec/fixtures/source/mock1.html","date":"2024-08-13T03:31:37.663Z","modified":"August 12, 2024"}', diff --git a/spec/fixtures/target/mock1.js b/spec/fixtures/target/mock1.js index b487893..4793b92 100644 --- a/spec/fixtures/target/mock1.js +++ b/spec/fixtures/target/mock1.js @@ -5,7 +5,7 @@ let π1 = 3.14; let τ1 = 2 * π1; const info1 = { - banner: '🔍🔍🔍 replacer-util v1.3.0 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.3.1 🔍🔍🔍', description: 'Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)', list1: 'A.I. module, A.I. module, A.I. module', list2: 'A.I. module, iNsEcT, INSECT, A.I. module', diff --git a/spec/fixtures/target/subfolder-a/mock2.html b/spec/fixtures/target/subfolder-a/mock2.html index eb7cf44..882badf 100644 --- a/spec/fixtures/target/subfolder-a/mock2.html +++ b/spec/fixtures/target/subfolder-a/mock2.html @@ -12,7 +12,7 @@

🔍🔍🔍 replacer-util 🔍🔍🔍

Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)

I, for one, welcome our new A.I. module overlords.

diff --git a/spec/fixtures/target/subfolder-a/mock2.js b/spec/fixtures/target/subfolder-a/mock2.js index a8c9332..bab568c 100644 --- a/spec/fixtures/target/subfolder-a/mock2.js +++ b/spec/fixtures/target/subfolder-a/mock2.js @@ -5,7 +5,7 @@ let π2 = 3.14; let τ2 = 2 * π2; const info2 = { - banner: '🔍🔍🔍 replacer-util v1.3.0 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.3.1 🔍🔍🔍', description: 'Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)', code: 'mock2', file: '{"root":"","dir":"spec/fixtures/source/subfolder-a","base":"mock2.js","ext":".js","name":"mock2","folder":"subfolder-a","path":"spec/fixtures/source/subfolder-a/mock2.js","date":"2024-02-02T15:02:19.837Z","modified":"February 2, 2024"}', diff --git a/spec/fixtures/target/web/index.html b/spec/fixtures/target/web/index.html index 83431f8..e7ce009 100644 --- a/spec/fixtures/target/web/index.html +++ b/spec/fixtures/target/web/index.html @@ -19,7 +19,7 @@

Weekday: Monday

I, for one, welcome our new insect overlords.

    -
  • Release: v1.3.0
  • +
  • Release: v1.3.1
  • Minor: v1.3
  • Major: v1
@@ -30,7 +30,7 @@

Weekday: Monday

let τ2 = 2 * π2; const info2 = { - banner: '🔍🔍🔍 replacer-util v1.3.0 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.3.1 🔍🔍🔍', description: 'Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)', code: 'mock1', file: '{"root":"","dir":"spec/fixtures/source","base":"mock1.html","ext":".html","name":"mock1","folder":"source","path":"spec/fixtures/source/mock1.html","date":"2024-08-13T03:31:37.663Z","modified":"August 12, 2024"}', diff --git a/spec/fixtures/target/web/subfolder-a/index.html b/spec/fixtures/target/web/subfolder-a/index.html index 8ad9547..43947d0 100644 --- a/spec/fixtures/target/web/subfolder-a/index.html +++ b/spec/fixtures/target/web/subfolder-a/index.html @@ -12,7 +12,7 @@

🔍🔍🔍 replacer-util 🔍🔍🔍

Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)

I, for one, welcome our new insect overlords.

    -
  • Release: v1.3.0
  • +
  • Release: v1.3.1
  • Minor: v1.3
  • Major: v1
diff --git a/spec/fixtures/target/web/subfolder-b/index.html b/spec/fixtures/target/web/subfolder-b/index.html index 00adc53..328c393 100644 --- a/spec/fixtures/target/web/subfolder-b/index.html +++ b/spec/fixtures/target/web/subfolder-b/index.html @@ -15,7 +15,7 @@

Find and replace strings or template outputs in text files (CLI tool designe

I, for one, welcome our new insect overlords.

    -
  • Release: v1.3.0
  • +
  • Release: v1.3.1
  • Minor: v1.3
  • Major: v1
diff --git a/spec/fixtures/target/web/subfolder-b/subfolder-bb/index.html b/spec/fixtures/target/web/subfolder-b/subfolder-bb/index.html index da10663..7821b0a 100644 --- a/spec/fixtures/target/web/subfolder-b/subfolder-bb/index.html +++ b/spec/fixtures/target/web/subfolder-b/subfolder-bb/index.html @@ -15,7 +15,7 @@

Find and replace strings or template outputs in text files (CLI tool designe

I, for one, welcome our new insect overlords.

    -
  • Release: v1.3.0
  • +
  • Release: v1.3.1
  • Minor: v1.3
  • Major: v1