diff --git a/.github/workflows/release-on-vtag.yaml b/.github/workflows/release-on-vtag.yaml index faed059..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@v3 - - 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 463ef8d..3f8814c 100644 --- a/.github/workflows/run-spec-on-push.yaml +++ b/.github/workflows/run-spec-on-push.yaml @@ -1,11 +1,12 @@ -name: build +name: Build and Run Specifications + on: [push] + jobs: build: - name: Run Specifications runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 #see: https://github.com/actions/checkout/releases + - uses: actions/setup-node@v4 #see: https://github.com/actions/setup-node/releases - run: npm install - run: npm test diff --git a/README.md b/README.md index 491405e..9ddf7aa 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ _Revision web asset filenames with cache busting content hash fingerprints_ [![License:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/center-key/rev-web-assets/blob/main/LICENSE.txt) [![npm](https://img.shields.io/npm/v/rev-web-assets.svg)](https://www.npmjs.com/package/rev-web-assets) -[![Build](https://github.com/center-key/rev-web-assets/workflows/build/badge.svg)](https://github.com/center-key/rev-web-assets/actions/workflows/run-spec-on-push.yaml) +[![Build](https://github.com/center-key/rev-web-assets/actions/workflows/run-spec-on-push.yaml/badge.svg)](https://github.com/center-key/rev-web-assets/actions/workflows/run-spec-on-push.yaml) **rev-web-assets** updates the asset filenames of a website to contain a eight-digit hex hash.  The command's console output includes a timestamp and formatting helpful in build systems. diff --git a/dist/rev-web-assets.d.ts b/dist/rev-web-assets.d.ts index e176e02..f4ca355 100644 --- a/dist/rev-web-assets.d.ts +++ b/dist/rev-web-assets.d.ts @@ -1,4 +1,4 @@ -//! rev-web-assets v1.3.4 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License +//! rev-web-assets v1.3.5 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License export type Settings = { cd: string | null; diff --git a/dist/rev-web-assets.js b/dist/rev-web-assets.js index 1762099..0f03898 100644 --- a/dist/rev-web-assets.js +++ b/dist/rev-web-assets.js @@ -1,4 +1,4 @@ -//! rev-web-assets v1.3.4 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License +//! rev-web-assets v1.3.5 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License import chalk from 'chalk'; import crypto from 'crypto'; @@ -68,11 +68,12 @@ const revWebAssets = { assetDetail.references++; if (assetDetail && !assetDetail.usedIn.includes(detail.canonical)) assetDetail.usedIn.push(detail.canonical); + const trailingSlashes = /\/*$/; + const absoluteUrl = () => settings.metaContentBase.replace(trailingSlashes, '/') + + assetDetail?.canonicalFolder + '/' + assetDetail?.hashedFilename; const hashedUri = () => { - const hashed = revWebAssets.hashFilename(uri, assetDetail.hash); const noBase = !settings.metaContentBase || !pre.startsWith('