rev-web-assets
Advanced tools
Comparing version 0.0.5 to 0.1.0
@@ -1,2 +0,2 @@ | ||
//! rev-web-assets v0.0.5 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License | ||
//! rev-web-assets v0.1.0 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License | ||
@@ -30,3 +30,3 @@ export declare type Settings = { | ||
declare const revWebAssets: { | ||
readDirSyncRecursive(folder: string): string[]; | ||
readFolderRecursive(folder: string): string[]; | ||
manifest(source: string, target: string): { | ||
@@ -33,0 +33,0 @@ origin: string; |
@@ -1,9 +0,9 @@ | ||
//! rev-web-assets v0.0.5 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License | ||
//! rev-web-assets v0.1.0 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License | ||
import crypto from 'crypto'; | ||
import fs from 'fs-extra'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import slash from 'slash'; | ||
const revWebAssets = { | ||
readDirSyncRecursive(folder) { | ||
readFolderRecursive(folder) { | ||
const files = []; | ||
@@ -20,3 +20,3 @@ const process = (item) => { | ||
manifest(source, target) { | ||
const files = revWebAssets.readDirSyncRecursive(source); | ||
const files = revWebAssets.readFolderRecursive(source); | ||
const process = (file) => { | ||
@@ -85,3 +85,3 @@ const fileExtension = path.extname(file).toLowerCase(); | ||
detail.destPath = detail.destFolder + '/' + detail.filename; | ||
fs.ensureDirSync(detail.destFolder); | ||
fs.mkdirSync(detail.destFolder, { recursive: true }); | ||
fs.writeFileSync(detail.destPath, hashedContent); | ||
@@ -99,3 +99,3 @@ }; | ||
detail.destPath = detail.destFolder + '/' + ((_a = detail.hashedFilename) !== null && _a !== void 0 ? _a : detail.filename); | ||
fs.ensureDirSync(detail.destFolder); | ||
fs.mkdirSync(detail.destFolder, { recursive: true }); | ||
fs.writeFileSync(detail.destPath, hashedContent); | ||
@@ -109,3 +109,3 @@ }; | ||
detail.destPath = detail.destFolder + '/' + ((_a = detail.hashedFilename) !== null && _a !== void 0 ? _a : detail.filename); | ||
fs.ensureDirSync(detail.destFolder); | ||
fs.mkdirSync(detail.destFolder, { recursive: true }); | ||
fs.copyFileSync(detail.origin, detail.destPath); | ||
@@ -128,7 +128,7 @@ }; | ||
if (targetFolder) | ||
fs.ensureDirSync(target); | ||
fs.mkdirSync(target, { recursive: true }); | ||
const errorMessage = !sourceFolder ? 'Must specify the source folder path.' : | ||
!targetFolder ? 'Must specify the target folder path.' : | ||
!fs.pathExistsSync(source) ? 'Source folder does not exist: ' + source : | ||
!fs.pathExistsSync(target) ? 'Target folder cannot be created: ' + target : | ||
!fs.existsSync(source) ? 'Source folder does not exist: ' + source : | ||
!fs.existsSync(target) ? 'Target folder cannot be created: ' + target : | ||
!fs.statSync(source).isDirectory() ? 'Source is not a folder: ' + source : | ||
@@ -135,0 +135,0 @@ !fs.statSync(target).isDirectory() ? 'Target is not a folder: ' + target : |
{ | ||
"name": "rev-web-assets", | ||
"version": "0.0.5", | ||
"version": "0.1.0", | ||
"description": "Revision web asset filenames with cache busting content hash fingerprints", | ||
@@ -76,3 +76,2 @@ "license": "MIT", | ||
"fancy-log": "~2.0", | ||
"fs-extra": "~10.1", | ||
"slash": "~5.0" | ||
@@ -82,7 +81,6 @@ }, | ||
"@types/fancy-log": "~2.0", | ||
"@types/fs-extra": "~9.0", | ||
"@types/node": "~18.7", | ||
"@types/node": "~18.8", | ||
"@typescript-eslint/eslint-plugin": "~5.38", | ||
"@typescript-eslint/parser": "~5.38", | ||
"add-dist-header": "~0.2", | ||
"add-dist-header": "~0.3", | ||
"assert-deep-strict-equal": "~1.0", | ||
@@ -89,0 +87,0 @@ "copy-file-util": "~0.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
3
14
29609
- Removedfs-extra@~10.1
- Removedfs-extra@10.1.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedjsonfile@6.1.0(transitive)
- Removeduniversalify@2.0.1(transitive)