eleventy-auto-cache-buster 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,8 +6,12 @@ on:
6
6
  - "*"
7
7
 
8
8
  jobs:
9
+ test:
10
+ uses: ./.github/workflows/test.yml
11
+
9
12
  github-release:
10
13
  runs-on: ubuntu-latest
14
+ needs: [test]
11
15
  permissions:
12
16
  contents: write
13
17
  steps:
@@ -25,6 +29,7 @@ jobs:
25
29
 
26
30
  npm-publish:
27
31
  runs-on: ubuntu-latest
32
+ needs: [test]
28
33
  steps:
29
34
  - uses: actions/checkout@v3
30
35
 
@@ -0,0 +1,15 @@
1
+ name: Run tests
2
+
3
+ on: [push, pull_request, workflow_call]
4
+ jobs:
5
+ test:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v4
9
+
10
+ - uses: actions/setup-node@v4
11
+ with:
12
+ node-version: 20
13
+
14
+ - run: yarn install --immutable
15
+ - run: yarn test
@@ -103,7 +103,7 @@ module.exports = function(eleventyConfig, options=defaultOptions) {
103
103
  assetHash = assetHash.substring(0, hashTruncate);
104
104
  }
105
105
 
106
- outputData = outputData.replace(assetPath, assetPath + "?v=" + assetHash);
106
+ outputData = outputData.replaceAll(assetPath, `${assetPath}?v=${assetHash}`);
107
107
  outputChanged = true;
108
108
 
109
109
  } else {
package/package.json CHANGED
@@ -1,12 +1,20 @@
1
1
  {
2
2
  "name": "eleventy-auto-cache-buster",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Busts cache using ?v= with minimal configuration!",
5
5
  "main": "11tyAutoCacheBuster.js",
6
6
  "repository": "https://github.com/Denperidge/eleventy-auto-cache-buster.git",
7
7
  "author": "Denperidge",
8
8
  "license": "MIT",
9
+ "scripts": {
10
+ "test": "ava tests/*.mjs"
11
+ },
9
12
  "dependencies": {
10
13
  "glob": "^10.3.10"
14
+ },
15
+ "devDependencies": {
16
+ "@11ty/eleventy": "^2.0.1",
17
+ "ava": "^6.1.3",
18
+ "jsdom": "^24.1.0"
11
19
  }
12
20
  }