Skip to content

Commit

Permalink
Remove obsolete "main" field from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Jan 25, 2024
1 parent a7fff6d commit 1e89a54
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 47 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# replacer-util
<img src=https://centerkey.com/graphics/center-key-logo.svg align=right width=200 alt=logo>

_Find and replace strings, regex patterns, or template outputs in text files (CLI tool designed for use in npm scripts)_
_Find and replace strings, regex patterns, or template outputs in text files (CLI tool designed for use in npm package.json scripts)_

[![License:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/center-key/replacer-util/blob/main/LICENSE.txt)
[![npm](https://img.shields.io/npm/v/replacer-util.svg)](https://www.npmjs.com/package/replacer-util)
Expand All @@ -20,7 +20,7 @@ $ npm install --save-dev replacer-util
```

## B) Usage
### 1. npm scripts
### 1. npm package.json scripts
Run `replacer` from the `"scripts"` section of your **package.json** file.

Parameters:
Expand Down Expand Up @@ -154,7 +154,7 @@ Example outputs and formatters:
| `{{file.name}}` | `password-reset` | Source filename without the file extension |
| `{{file.path}}` | `web/password-reset.html` | Full path to source file |
| `<a href={{webRoot}}>Home</a>` | `<a href=../..>Home</a>` | Link is relative to the source folder |
| `{{"now"\|date:"%Y-%m-%d"}}` | `2023-09-28` | Build date timestamp |
| `{{"now"\|date:"%Y-%m-%d"}}` | `2024-01-21` | Build date timestamp |
| `{{myVariable\|upcase}}` | `DARK MODE` | Custom variable set with: `{% assign myVariable = 'dark mode' %}` |

_**Note:** Use the `--no-liquid` flag if characters in your source files are inadvertently being interpreted as templating commands and causing errors._
Expand Down Expand Up @@ -209,7 +209,7 @@ See the **TypeScript Declarations** at the top of [replacer.ts](replacer.ts) for
- 🪺 [recursive-exec](https://github.com/center-key/recursive-exec):&nbsp; _Run a command on each file in a folder and its subfolders_
- 🔍 [replacer-util](https://github.com/center-key/replacer-util):&nbsp; _Find and replace strings or template outputs in text files_
- 🔢 [rev-web-assets](https://github.com/center-key/rev-web-assets):&nbsp; _Revision web asset filenames with cache busting content hash fingerprints_
- 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util):&nbsp; _Organize npm scripts into named groups of easy to manage commands_
- 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util):&nbsp; _Organize npm package.json scripts into named groups of easy to manage commands_
- 🚦 [w3c-html-validator](https://github.com/center-key/w3c-html-validator):&nbsp; _Check the markup validity of HTML files using the W3C validator_

Feel free to submit questions at:<br>
Expand Down
20 changes: 7 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
{
"name": "replacer-util",
"version": "1.2.5",
"description": "Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)",
"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",
"module": "dist/replacer.js",
"main": "dist/replacer.js",
"types": "dist/replacer.d.ts",
"exports": "./dist/replacer.js",
"files": [
"dist"
],
"exports": {
".": {
"import": "./dist/replacer.js"
},
"./": "./dist/"
},
"bin": {
"replacer": "bin/cli.js",
"replacer-util": "bin/cli.js"
Expand Down Expand Up @@ -99,18 +93,18 @@
"devDependencies": {
"@fortawesome/fontawesome-free": "~6.5",
"@types/fancy-log": "~2.0",
"@types/node": "~20.10",
"@typescript-eslint/eslint-plugin": "~6.17",
"@typescript-eslint/parser": "~6.17",
"@types/node": "~20.11",
"@typescript-eslint/eslint-plugin": "~6.19",
"@typescript-eslint/parser": "~6.19",
"add-dist-header": "~1.3",
"assert-deep-strict-equal": "~1.1",
"copy-file-util": "~1.1",
"eslint": "~8.56",
"fetch-json": "~3.2",
"fetch-json": "~3.3",
"highlight.js": "~11.9",
"jshint": "~2.13",
"mocha": "~10.2",
"pretty-print-json": "~2.1",
"pretty-print-json": "~3.0",
"rimraf": "~5.0",
"run-scripts-util": "~1.2",
"typescript": "~5.3",
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/target/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions spec/fixtures/target/mock1.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<head>
<meta charset=utf-8>
<title>🔍🔍🔍 replacer-util 🔍🔍🔍</title>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5/css/all.min.css>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.2/dist/fetch-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.3/dist/fetch-json.min.js></script>
<script defer src=https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9/build/highlight.min.js></script>
</head>
<body>
<header>
<h1>🔍🔍🔍 replacer-util 🔍🔍🔍</h1>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)</h2>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)</h2>
</header>
<main>
<p>I, for one, welcome our new A.I. module overlords.</p>
Expand All @@ -29,7 +29,7 @@ <h2>Find and replace strings or template outputs in text files (CLI tool designe

const info2 = {
banner: '🔍🔍🔍 replacer-util v1.2.5 🔍🔍🔍',
description: 'Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)',
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","path":"spec/fixtures/source/mock1.html"}',
year: '2024',
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/target/mock1.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let τ1 = 2 * π1;

const info1 = {
banner: '🔍🔍🔍 replacer-util v1.2.5 🔍🔍🔍',
description: 'Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)',
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',
math: { π1, τ1 },
Expand Down
8 changes: 4 additions & 4 deletions spec/fixtures/target/subfolder-a/mock2.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset=utf-8>
<title>🔍🔍🔍 replacer-util 🔍🔍🔍</title>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/css/pretty-print-json.css>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.2/dist/fetch-json.min.js></script>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/css/pretty-print-json.css>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.3/dist/fetch-json.min.js></script>
</head>
<body>
<h1>🔍🔍🔍 replacer-util 🔍🔍🔍</h1>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)</h2>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)</h2>
<p>I, for one, welcome our new A.I. module overlords.</p>
<ul>
<li>Release: v1.2.5</li>
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/target/subfolder-a/mock2.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let τ2 = 2 * π2;

const info2 = {
banner: '🔍🔍🔍 replacer-util v1.2.5 🔍🔍🔍',
description: 'Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)',
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","path":"spec/fixtures/source/subfolder-a/mock2.js"}',
year: '2024',
Expand Down
10 changes: 5 additions & 5 deletions spec/fixtures/target/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<head>
<meta charset=utf-8>
<title>🔍🔍🔍 replacer-util 🔍🔍🔍</title>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5/css/all.min.css>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.2/dist/fetch-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.3/dist/fetch-json.min.js></script>
<script defer src=https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9/build/highlight.min.js></script>
</head>
<body>
<header>
<h1>🔍🔍🔍 replacer-util 🔍🔍🔍</h1>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)</h2>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)</h2>
</header>
<main>
<p>I, for one, welcome our new insect overlords.</p>
Expand All @@ -29,7 +29,7 @@ <h2>Find and replace strings or template outputs in text files (CLI tool designe

const info2 = {
banner: '🔍🔍🔍 replacer-util v1.2.5 🔍🔍🔍',
description: 'Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)',
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","path":"spec/fixtures/source/mock1.html"}',
year: '2024',
Expand Down
8 changes: 4 additions & 4 deletions spec/fixtures/target/web/subfolder-a/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset=utf-8>
<title>🔍🔍🔍 replacer-util 🔍🔍🔍</title>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/css/pretty-print-json.css>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.2/dist/fetch-json.min.js></script>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/css/pretty-print-json.css>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.3/dist/fetch-json.min.js></script>
</head>
<body>
<h1>🔍🔍🔍 replacer-util 🔍🔍🔍</h1>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)</h2>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)</h2>
<p>I, for one, welcome our new insect overlords.</p>
<ul>
<li>Release: v1.2.5</li>
Expand Down
8 changes: 4 additions & 4 deletions spec/fixtures/target/web/subfolder-b/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<head>
<meta charset=utf-8>
<title>🔍🔍🔍 replacer-util 🔍🔍🔍</title>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/css/pretty-print-json.css>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.2/dist/fetch-json.min.js></script>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/css/pretty-print-json.css>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.3/dist/fetch-json.min.js></script>
</head>
<body>
<header>
<h1>🔍🔍🔍 replacer-util 🔍🔍🔍</h1>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)</h2>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)</h2>
</header>
<main>
<p>I, for one, welcome our new insect overlords.</p>
Expand Down
8 changes: 4 additions & 4 deletions spec/fixtures/target/web/subfolder-b/subfolder-bb/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<head>
<meta charset=utf-8>
<title>🔍🔍🔍 replacer-util 🔍🔍🔍</title>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/css/pretty-print-json.css>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.2/dist/fetch-json.min.js></script>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/css/pretty-print-json.css>
<script src=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/pretty-print-json.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/fetch-json@3.3/dist/fetch-json.min.js></script>
</head>
<body>
<header>
<h1>🔍🔍🔍 replacer-util 🔍🔍🔍</h1>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm scripts)</h2>
<h2>Find and replace strings or template outputs in text files (CLI tool designed for use in npm package.json scripts)</h2>
</header>
<main>
<p>I, for one, welcome our new insect overlords.</p>
Expand Down

0 comments on commit 1e89a54

Please sign in to comment.