Skip to content

Commit

Permalink
Release v1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Nov 10, 2023
1 parent 6838b66 commit 265e9de
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,26 @@ Command-line flags:
| `--summary` | Only print out the single line summary message. | N/A |

Examples:
- `rev-web-assets web/source web/target`<br>
Revisions the files in the **web/source** folder and saves the new files to the **web/target** folder.

- `rev-web-assets --cd=web source target`<br>
Same as: `rev-web-assets web/source web/target`
Identical to the previous example.

- `rev-web-assets source target --quiet`<br>
Displays no output.

- `rev-web-assets source target --summary`<br>
Displays the summary but not the individual filenames.

- `rev-web-assets source 'target/Web Files' --summary`<br>
Save the target files to a folder that has a space in its name.

- `rev-web-assets source target --meta-content-base=https://example.net`<br>
Prepends the base to `<meta>` URLs.

_**Note:** Single quotes in commands are normalized so they work cross-platform and avoid the errors often encountered on Microsoft Windows._

URLs in `<meta>` tag `content` attributes generally need to be absolute URLs.&nbsp;
Setting the `--meta-content-base` flag to `https://example.net` will transform the line of HTML from:
```html
Expand Down
6 changes: 5 additions & 1 deletion dist/rev-web-assets.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! rev-web-assets v1.3.2 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License
//! rev-web-assets v1.3.3 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License

export type Settings = {
cd: string | null;
Expand Down Expand Up @@ -29,6 +29,9 @@ export type Results = {
duration: number;
manifest: Manifest;
};
export type ReporterSettings = {
summaryOnly: boolean;
};
declare const revWebAssets: {
manifest(source: string, target: string): ManifestDetail[];
hashFilename(filename: string, hash: string | null): string;
Expand All @@ -39,5 +42,6 @@ declare const revWebAssets: {
processCss(manifest: ManifestDetail[], settings: Settings): void;
copyAssets(manifest: ManifestDetail[]): void;
revision(sourceFolder: string, targetFolder: string, options?: Partial<Settings>): Results;
reporter(results: Results, options?: Partial<ReporterSettings>): Results;
};
export { revWebAssets };
25 changes: 24 additions & 1 deletion dist/rev-web-assets.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
//! rev-web-assets v1.3.2 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License
//! rev-web-assets v1.3.3 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License

import chalk from 'chalk';
import crypto from 'crypto';
import fs from 'fs';
import log from 'fancy-log';
import path from 'path';
import slash from 'slash';
const revWebAssets = {
Expand Down Expand Up @@ -155,5 +157,26 @@ const revWebAssets = {
manifest: manifest,
};
},
reporter(results, options) {
const defaults = {
summaryOnly: false,
};
const settings = { ...defaults, ...options };
const name = chalk.gray('rev-web-assets');
const source = chalk.blue.bold(results.source);
const target = chalk.magenta(results.target);
const arrow = { big: chalk.gray.bold(' ⟹ '), little: chalk.gray.bold('→') };
const infoColor = results.count ? chalk.white : chalk.red.bold;
const info = infoColor(`(files: ${results.count}, ${results.duration}ms)`);
log(name, source, arrow.big, target, info);
const logDetail = (detail) => {
const origin = chalk.white(detail.origin.substring(results.source.length + 1));
const dest = chalk.green(detail.destPath.substring(results.target.length + 1));
log(name, origin, arrow.little, dest);
};
if (!settings.summaryOnly)
results.manifest.forEach(logDetail);
return results;
},
};
export { revWebAssets };
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rev-web-assets",
"version": "1.3.2",
"version": "1.3.3",
"description": "Revision web asset filenames with cache busting content hash fingerprints",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -86,18 +86,18 @@
},
"devDependencies": {
"@types/fancy-log": "~2.0",
"@types/node": "~20.6",
"@typescript-eslint/eslint-plugin": "~6.7",
"@typescript-eslint/parser": "~6.7",
"@types/node": "~20.9",
"@typescript-eslint/eslint-plugin": "~6.10",
"@typescript-eslint/parser": "~6.10",
"add-dist-header": "~1.3",
"assert-deep-strict-equal": "~1.1",
"copy-file-util": "~1.1",
"eslint": "~8.50",
"eslint": "~8.53",
"jshint": "~2.13",
"mocha": "~10.2",
"rimraf": "~5.0",
"run-scripts-util": "~1.2",
"typescript": "~5.2",
"w3c-html-validator": "~1.5"
"w3c-html-validator": "~1.6"
}
}
2 changes: 1 addition & 1 deletion task-runner.sh.command
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ releaseInstructions() {
echo "When ready to do the next release:"
echo
echo " === Increment version ==="
echo " Edit pacakge.json to bump $version to next version number"
echo " Edit package.json to bump $version to next version number"
echo " $projectHome/package.json"
}
nextActionCommitTagPub() {
Expand Down

0 comments on commit 265e9de

Please sign in to comment.