Skip to content

Commit

Permalink
Release v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Jul 31, 2023
1 parent 1367193 commit d09aa33
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
3 changes: 1 addition & 2 deletions dist/rev-web-assets.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! rev-web-assets v1.2.0 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License
//! rev-web-assets v1.3.0 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License

export type Settings = {
cd: string | null;
Expand Down Expand Up @@ -31,7 +31,6 @@ export type Results = {
manifest: Manifest;
};
declare const revWebAssets: {
readFolderRecursive(folder: string): string[];
manifest(source: string, target: string): ManifestDetail[];
hashFilename(filename: string, hash: string | null): string;
calcAssetHash(detail: ManifestDetail): ManifestDetail;
Expand Down
18 changes: 5 additions & 13 deletions dist/rev-web-assets.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
//! rev-web-assets v1.2.0 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License
//! rev-web-assets v1.3.0 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License

import crypto from 'crypto';
import fs from 'fs';
import path from 'path';
import slash from 'slash';
const revWebAssets = {
readFolderRecursive(folder) {
const files = [];
const process = (item) => {
if (fs.statSync(item).isFile())
files.push(slash(item));
else
fs.readdirSync(item).forEach((nestedItem) => process(path.join(item, nestedItem)));
};
process(path.normalize(folder));
return files.sort();
},
manifest(source, target) {
const files = revWebAssets.readFolderRecursive(source);
const files = fs.readdirSync(source, { recursive: true })
.map(file => path.join(source, file.toString()))
.filter(file => fs.statSync(file).isFile())
.sort();
const process = (file) => {
const fileExtension = path.extname(file).toLowerCase();
const isHtml = ['.html', '.htm', '.php'].includes(fileExtension);
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rev-web-assets",
"version": "1.2.0",
"version": "1.3.0",
"description": "Revision web asset filenames with cache busting content hash fingerprints",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -82,12 +82,12 @@
"devDependencies": {
"@types/fancy-log": "~2.0",
"@types/node": "~20.4",
"@typescript-eslint/eslint-plugin": "~6.0",
"@typescript-eslint/parser": "~6.0",
"@typescript-eslint/eslint-plugin": "~6.2",
"@typescript-eslint/parser": "~6.2",
"add-dist-header": "~1.1",
"assert-deep-strict-equal": "~1.1",
"copy-file-util": "~1.1",
"eslint": "~8.44",
"eslint": "~8.46",
"jshint": "~2.13",
"mocha": "~10.2",
"rimraf": "~5.0",
Expand Down

0 comments on commit d09aa33

Please sign in to comment.