@tryghost/cache-purge 0.3.4 → 0.3.5

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.
Files changed (2) hide show
  1. package/README.md +20 -6
  2. package/package.json +7 -5
package/README.md CHANGED
@@ -1,32 +1,46 @@
1
1
  # Cache Purge
2
2
 
3
+ Purge Fastly cache entries through Ghost(Pro)'s signed cache purge endpoint.
4
+ Pass an HMAC key, the purge service host, and either an `id` or `domain` plus a
5
+ cache `type`; the package signs the request with `@tryghost/signed-request`.
6
+
3
7
  ## Install
4
8
 
5
9
  `npm install @tryghost/cache-purge --save`
6
10
 
7
11
  or
8
12
 
9
- `yarn add @tryghost/cache-purge`
13
+ `pnpm add @tryghost/cache-purge`
10
14
 
11
15
  ## Usage
12
16
 
17
+ ```js
18
+ const cachePurge = require('@tryghost/cache-purge');
19
+
20
+ await cachePurge(hmacKey, 'cache.example.com', {
21
+ domain: 'example.com',
22
+ type: 'site',
23
+ source: 'admin',
24
+ });
25
+ ```
26
+
13
27
  ## Develop
14
28
 
15
- This is a mono repository, managed with [lerna](https://lernajs.io/).
29
+ This is a monorepo package, managed from the repo root.
16
30
 
17
31
  Follow the instructions for the top-level repo.
18
32
 
19
33
  1. `git clone` this repo & `cd` into it as usual
20
- 2. Run `yarn` to install top-level dependencies.
34
+ 2. Run `pnpm install` to install top-level dependencies.
21
35
 
22
36
  ## Run
23
37
 
24
- - `yarn dev`
38
+ - `pnpm --filter @tryghost/cache-purge dev`
25
39
 
26
40
  ## Test
27
41
 
28
- - `yarn lint` run just eslint
29
- - `yarn test` run lint and tests
42
+ - `pnpm --filter @tryghost/cache-purge lint` runs lint
43
+ - `pnpm --filter @tryghost/cache-purge test` runs lint and tests
30
44
 
31
45
  # Copyright & License
32
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/cache-purge",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "license": "MIT",
5
5
  "author": "Ghost Foundation",
6
6
  "repository": {
@@ -14,16 +14,18 @@
14
14
  ],
15
15
  "main": "./lib/cache-purge.js",
16
16
  "dependencies": {
17
- "@tryghost/signed-request": "^0.3.4"
17
+ "@tryghost/signed-request": "^0.3.5"
18
18
  },
19
19
  "devDependencies": {
20
- "mocha": "11.7.5",
21
20
  "should": "13.2.3",
22
- "sinon": "21.0.3"
21
+ "sinon": "22.0.0"
22
+ },
23
+ "engines": {
24
+ "node": ">=20.20.0"
23
25
  },
24
26
  "scripts": {
25
27
  "dev": "echo \"Implement me!\"",
26
- "test": "NODE_ENV=testing mocha './test/**/*.test.js'",
28
+ "test": "NODE_ENV=testing vitest run --coverage",
27
29
  "lint": "oxlint -c ../../.oxlintrc.json .",
28
30
  "posttest": "pnpm lint"
29
31
  }