From e10855ed2f56237223a19cf4b9661bb121d8f1f9 Mon Sep 17 00:00:00 2001 From: dpilafian Date: Wed, 17 Apr 2024 05:18:06 -0700 Subject: [PATCH] Release v1.2.6 --- .github/workflows/release-on-vtag.yaml | 9 +++++---- .github/workflows/run-spec-on-push.yaml | 5 +++-- dist/replacer.d.ts | 2 +- dist/replacer.js | 5 +++-- package.json | 14 +++++++------- replacer.ts | 2 +- 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 +- 15 files changed, 32 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release-on-vtag.yaml b/.github/workflows/release-on-vtag.yaml index b323781..a9c87bf 100644 --- a/.github/workflows/release-on-vtag.yaml +++ b/.github/workflows/release-on-vtag.yaml @@ -1,15 +1,16 @@ -name: release +name: Create Release + on: push: tags: - 'v*' + jobs: build: - name: Create Release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 #see: https://github.com/actions/checkout/releases - - uses: actions/create-release@v1 + - uses: actions/checkout@v4 #see: https://github.com/actions/checkout/releases + - uses: actions/create-release@v1 #see: https://github.com/actions/create-release/releases env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} with: diff --git a/.github/workflows/run-spec-on-push.yaml b/.github/workflows/run-spec-on-push.yaml index 7e80991..3f8814c 100644 --- a/.github/workflows/run-spec-on-push.yaml +++ b/.github/workflows/run-spec-on-push.yaml @@ -1,8 +1,9 @@ -name: build +name: Build and Run Specifications + on: [push] + jobs: build: - name: Run Specifications runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 #see: https://github.com/actions/checkout/releases diff --git a/dist/replacer.d.ts b/dist/replacer.d.ts index 6f2bb73..a056809 100644 --- a/dist/replacer.d.ts +++ b/dist/replacer.d.ts @@ -1,4 +1,4 @@ -//! replacer-util v1.2.5 ~~ https://github.com/center-key/replacer-util ~~ MIT License +//! replacer-util v1.2.6 ~~ 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 d7fb607..a30359c 100644 --- a/dist/replacer.js +++ b/dist/replacer.js @@ -1,4 +1,4 @@ -//! replacer-util v1.2.5 ~~ https://github.com/center-key/replacer-util ~~ MIT License +//! replacer-util v1.2.6 ~~ https://github.com/center-key/replacer-util ~~ MIT License import { globSync } from 'glob'; import { isBinary } from 'istextorbinary'; @@ -86,7 +86,8 @@ const replacer = { const parsedPath = path.parse(origin); const dir = slash(parsedPath.dir); const filePath = dir + '/' + slash(parsedPath.base); - return { ...parsedPath, dir: dir, path: filePath }; + const folder = path.basename(dir); + return { ...parsedPath, dir: dir, folder: folder, path: filePath }; }; const getWebRoot = (origin) => { const depth = origin.substring(source.length).split('/').length - 2; diff --git a/package.json b/package.json index 9b28a48..1659d3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "replacer-util", - "version": "1.2.5", + "version": "1.2.6", "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", @@ -87,23 +87,23 @@ "fancy-log": "~2.0", "glob": "~10.3", "istextorbinary": "~9.5", - "liquidjs": "~10.10", + "liquidjs": "~10.11", "slash": "~5.1" }, "devDependencies": { "@fortawesome/fontawesome-free": "~6.5", "@types/fancy-log": "~2.0", - "@types/node": "~20.11", - "@typescript-eslint/eslint-plugin": "~7.4", - "@typescript-eslint/parser": "~7.4", + "@types/node": "~20.12", + "@typescript-eslint/eslint-plugin": "~7.7", + "@typescript-eslint/parser": "~7.7", "add-dist-header": "~1.4", "assert-deep-strict-equal": "~1.2", "copy-file-util": "~1.2", - "eslint": "~8.57", + "eslint": "8.57.0", "fetch-json": "~3.3", "highlight.js": "~11.9", "jshint": "~2.13", - "mocha": "~10.3", + "mocha": "~10.4", "pretty-print-json": "~3.0", "rimraf": "~5.0", "run-scripts-util": "~1.2", diff --git a/replacer.ts b/replacer.ts index 289fd70..50854a4 100644 --- a/replacer.ts +++ b/replacer.ts @@ -141,7 +141,7 @@ const replacer = { webRoot: getWebRoot(file.origin), }; globals['pkg'] = pkg; //pkg global is deprecated - const engine = new Liquid({ globals }); + const engine = new Liquid({ globals }); const versionFormatter = (numIds: number) => (str: string): string => str.replace(/[^0-9]*/, '').split('.').slice(0, numIds).join('.'); engine.registerFilter('version', versionFormatter(3)); diff --git a/spec/fixtures/target/bundle.js b/spec/fixtures/target/bundle.js index fd2eb25..dbfdcfb 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.2.5 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.2.6 🔍🔍🔍', 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.2.5 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.2.6 🔍🔍🔍', 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"}', diff --git a/spec/fixtures/target/mock1.html b/spec/fixtures/target/mock1.html index 3e12452..d71b07a 100644 --- a/spec/fixtures/target/mock1.html +++ b/spec/fixtures/target/mock1.html @@ -17,7 +17,7 @@

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

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

    -
  • Release: v1.2.5
  • +
  • Release: v1.2.6
  • Minor: v1.2
  • Major: v1
@@ -28,7 +28,7 @@

Find and replace strings or template outputs in text files (CLI tool designe let τ2 = 2 * π2; const info2 = { - banner: '🔍🔍🔍 replacer-util v1.2.5 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.2.6 🔍🔍🔍', 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"}', diff --git a/spec/fixtures/target/mock1.js b/spec/fixtures/target/mock1.js index 7394699..2e6fa4c 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.2.5 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.2.6 🔍🔍🔍', 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 4d4b230..a489e08 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.

    -
  • Release: v1.2.5
  • +
  • Release: v1.2.6
  • Minor: v1.2
  • Major: v1
diff --git a/spec/fixtures/target/subfolder-a/mock2.js b/spec/fixtures/target/subfolder-a/mock2.js index adf6cc3..e970d5e 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.2.5 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.2.6 🔍🔍🔍', 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"}', diff --git a/spec/fixtures/target/web/index.html b/spec/fixtures/target/web/index.html index b04f7ab..fc0aee4 100644 --- a/spec/fixtures/target/web/index.html +++ b/spec/fixtures/target/web/index.html @@ -17,7 +17,7 @@

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

I, for one, welcome our new insect overlords.

    -
  • Release: v1.2.5
  • +
  • Release: v1.2.6
  • Minor: v1.2
  • Major: v1
@@ -28,7 +28,7 @@

Find and replace strings or template outputs in text files (CLI tool designe let τ2 = 2 * π2; const info2 = { - banner: '🔍🔍🔍 replacer-util v1.2.5 🔍🔍🔍', + banner: '🔍🔍🔍 replacer-util v1.2.6 🔍🔍🔍', 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"}', diff --git a/spec/fixtures/target/web/subfolder-a/index.html b/spec/fixtures/target/web/subfolder-a/index.html index 830a2c7..d26366d 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.2.5
  • +
  • Release: v1.2.6
  • Minor: v1.2
  • Major: v1
diff --git a/spec/fixtures/target/web/subfolder-b/index.html b/spec/fixtures/target/web/subfolder-b/index.html index d45e2a7..492c685 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.2.5
  • +
  • Release: v1.2.6
  • Minor: v1.2
  • 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 8ca22d3..8c86c8a 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.2.5
  • +
  • Release: v1.2.6
  • Minor: v1.2
  • Major: v1