ep_stats 0.0.52 → 0.0.54

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.
@@ -13,7 +13,7 @@ jobs:
13
13
  automerge:
14
14
  if: >
15
15
  github.event.workflow_run.conclusion == 'success' &&
16
- github.event.workflow_run.event == 'pull_request' &&
16
+ github.event.workflow_run.event == 'push' &&
17
17
  github.event.workflow_run.actor.login == 'dependabot[bot]'
18
18
  runs-on: ubuntu-latest
19
19
  steps:
@@ -22,11 +22,11 @@ jobs:
22
22
  version: 1.0
23
23
  -
24
24
  name: Install etherpad core
25
- uses: actions/checkout@v4
25
+ uses: actions/checkout@v6
26
26
  with:
27
27
  repository: ether/etherpad-lite
28
28
  path: etherpad-lite
29
- - uses: pnpm/action-setup@v3
29
+ - uses: pnpm/action-setup@v6
30
30
  name: Install pnpm
31
31
  with:
32
32
  version: 10
@@ -35,7 +35,7 @@ jobs:
35
35
  shell: bash
36
36
  run: |
37
37
  echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
38
- - uses: actions/cache@v4
38
+ - uses: actions/cache@v5
39
39
  name: Setup pnpm cache
40
40
  with:
41
41
  path: ${{ env.STORE_PATH }}
@@ -44,7 +44,7 @@ jobs:
44
44
  ${{ runner.os }}-pnpm-store-
45
45
  -
46
46
  name: Checkout plugin repository
47
- uses: actions/checkout@v4
47
+ uses: actions/checkout@v6
48
48
  with:
49
49
  path: plugin
50
50
  - name: Remove tests
@@ -12,10 +12,10 @@ jobs:
12
12
  steps:
13
13
  -
14
14
  name: Check out Etherpad core
15
- uses: actions/checkout@v4
15
+ uses: actions/checkout@v6
16
16
  with:
17
17
  repository: ether/etherpad-lite
18
- - uses: pnpm/action-setup@v3
18
+ - uses: pnpm/action-setup@v6
19
19
  name: Install pnpm
20
20
  with:
21
21
  version: 10
@@ -24,7 +24,7 @@ jobs:
24
24
  shell: bash
25
25
  run: |
26
26
  echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
27
- - uses: actions/cache@v4
27
+ - uses: actions/cache@v5
28
28
  name: Setup pnpm cache
29
29
  with:
30
30
  path: ${{ env.STORE_PATH }}
@@ -33,7 +33,7 @@ jobs:
33
33
  ${{ runner.os }}-pnpm-store-
34
34
  -
35
35
  name: Check out the plugin
36
- uses: actions/checkout@v4
36
+ uses: actions/checkout@v6
37
37
  with:
38
38
  path: ./node_modules/__tmp
39
39
  -
@@ -31,7 +31,7 @@ jobs:
31
31
  uses: actions/checkout@v6
32
32
  with:
33
33
  repository: ether/etherpad-lite
34
- - uses: pnpm/action-setup@v5
34
+ - uses: pnpm/action-setup@v6
35
35
  name: Install pnpm
36
36
  with:
37
37
  version: 10
@@ -59,12 +59,20 @@ jobs:
59
59
  [ "${NEW_COMMITS}" -gt 0 ] || exit 0
60
60
  git config user.name 'github-actions[bot]'
61
61
  git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
62
- pnpm i
62
+ pnpm i --frozen-lockfile
63
63
  # `pnpm version patch` bumps package.json, makes a commit, and creates
64
64
  # a `v<new-version>` tag. Capture the new tag name from package.json
65
65
  # rather than parsing pnpm's output, which has historically varied.
66
- pnpm version patch
67
- NEW_TAG="v$(node -p "require('./package.json').version")"
66
+ # Bump the patch component directly with Node. pnpm/action-setup@v6
67
+ # sometimes installs pnpm 11 pre-releases even when version: 10.x is
68
+ # requested (pnpm/action-setup#225); those pre-releases either skip
69
+ # the git commit/tag or reject --no-git-tag-version as unknown.
70
+ # Doing the bump in Node sidesteps both failure modes.
71
+ NEW_VERSION=$(node -e "const fs=require('fs');const p=require('./package.json');const v=p.version.split('.');v[2]=String(Number(v[2])+1);p.version=v.join('.');fs.writeFileSync('./package.json',JSON.stringify(p,null,2)+'\n');console.log(p.version);")
72
+ NEW_TAG="v${NEW_VERSION}"
73
+ git add package.json
74
+ git commit -m "${NEW_TAG}"
75
+ git tag -a "${NEW_TAG}" -m "${NEW_TAG}"
68
76
  # CRITICAL: use --atomic so the branch update and the tag update
69
77
  # succeed (or fail) as a single transaction on the server. The old
70
78
  # `git push --follow-tags` was non-atomic per ref: if a concurrent
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ![Publish Status](https://github.com/ether/ep_stats/workflows/Node.js%20Package/badge.svg) [![Backend Tests Status](https://github.com/ether/ep_stats/actions/workflows/test-and-release.yml/badge.svg)](https://github.com/ether/ep_stats/actions/workflows/test-and-release.yml)
1
+ ![Demo](demo.gif) [![Backend Tests Status](https://github.com/ether/ep_stats/actions/workflows/test-and-release.yml/badge.svg)](https://github.com/ether/ep_stats/actions/workflows/test-and-release.yml)
2
2
 
3
3
  Pad Stats in Etherpad
4
4
  =====================
@@ -18,3 +18,20 @@ todo
18
18
  * All the things
19
19
 
20
20
  Contact me to sponsor dev.
21
+
22
+ ## Installation
23
+
24
+ Install from the Etherpad admin UI (**Admin → Manage Plugins**,
25
+ search for `ep_stats` and click *Install*), or from the Etherpad
26
+ root directory:
27
+
28
+ ```sh
29
+ pnpm run plugins install ep_stats
30
+ ```
31
+
32
+ > ⚠️ Don't run `npm i` / `npm install` yourself from the Etherpad
33
+ > source tree — Etherpad tracks installed plugins through its own
34
+ > plugin-manager, and hand-editing `package.json` can leave the
35
+ > server unable to start.
36
+
37
+ After installing, restart Etherpad.
package/demo.gif ADDED
Binary file
package/demo.png ADDED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ep_stats",
3
3
  "description": "See pad Stats in Etherpad",
4
- "version": "0.0.52",
4
+ "version": "0.0.54",
5
5
  "author": {
6
6
  "name": "John McLear",
7
7
  "email": "john@mclear.co.uk",
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "eslint": "^8.57.1",
31
- "eslint-config-etherpad": "^4.0.4",
32
- "typescript": "^6.0.2"
31
+ "eslint-config-etherpad": "^4.0.5",
32
+ "typescript": "^6.0.3"
33
33
  },
34
34
  "scripts": {
35
35
  "lint": "eslint .",
@@ -4,6 +4,11 @@
4
4
  bottom:0;
5
5
  right:20px;
6
6
  width:300px;
7
+ /* Etherpad's toolbar dropdowns and popups use z-index values of 150–500
8
+ (see core pad/toolbar.css and pad/icons.css). Stay below that range so
9
+ menu dropdowns rendered on top of the pad aren't hidden behind the
10
+ stats overlay (#10). */
11
+ z-index: 10;
7
12
  background-color: var(--bg-color);
8
13
  color:#000;
9
14
  padding:20px;
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ const assert = require('assert').strict;
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+
7
+ const cssPath = path.resolve(
8
+ __dirname, '..', '..', '..', '..', 'static', 'css', 'stats.css');
9
+
10
+ describe(__filename, function () {
11
+ it('stats overlay uses a z-index below Etherpad toolbar popups (#10)', function () {
12
+ // Etherpad's toolbar dropdowns / popups use z-index values in the
13
+ // 150–500 range (see core pad/toolbar.css and pad/icons.css). The
14
+ // stats overlay is position:fixed, so without a lower explicit
15
+ // z-index menu dropdowns that extend into the stats area get hidden
16
+ // behind it.
17
+ const src = fs.readFileSync(cssPath, 'utf8');
18
+ const statsBlock = src.match(/#stats\s*\{[\s\S]*?\}/);
19
+ assert(statsBlock, 'expected an `#stats {}` block in stats.css');
20
+ const zIndexMatch = statsBlock[0].match(/z-index:\s*(-?\d+)/);
21
+ assert(zIndexMatch, '#stats must declare a z-index so it stacks below dropdowns');
22
+ const z = parseInt(zIndexMatch[1], 10);
23
+ assert(z < 150,
24
+ `#stats z-index (${z}) must be below Etherpad's dropdown/popup z-indexes (≥150)`);
25
+ });
26
+ });