ep_table_of_contents 0.4.12 → 0.4.14
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.
- package/.github/dependabot.yml +4 -0
- package/.github/workflows/backend-tests.yml +19 -3
- package/.github/workflows/codeql.yml +3 -3
- package/.github/workflows/frontend-tests.yml +39 -4
- package/.github/workflows/lint.yml +20 -5
- package/.github/workflows/npmpublish.yml +39 -9
- package/.github/workflows/test-and-release.yml +7 -1
- package/eslint.config.mjs +37 -0
- package/package.json +4 -4
- package/.eslintrc.cjs +0 -34
package/.github/dependabot.yml
CHANGED
|
@@ -11,8 +11,23 @@ jobs:
|
|
|
11
11
|
if: |
|
|
12
12
|
(github.event_name != 'pull_request')
|
|
13
13
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
|
14
|
-
name: with Plugins
|
|
14
|
+
name: with Plugins (Node ${{ matrix.node }} / core ${{ matrix.core_ref || 'develop' }})
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
# Plugin floor is engines.node >=22 but current Etherpad core
|
|
19
|
+
# requires >=24 (engineStrict). Each cell pairs a Node version
|
|
20
|
+
# with a core ref that actually allows it: Node 22 against the
|
|
21
|
+
# last tag whose core floor was 22 (v2.7.3); Node 24 / 26 against
|
|
22
|
+
# current develop.
|
|
23
|
+
matrix:
|
|
24
|
+
include:
|
|
25
|
+
- node: '22'
|
|
26
|
+
core_ref: 'v2.7.3'
|
|
27
|
+
- node: '24'
|
|
28
|
+
core_ref: ''
|
|
29
|
+
- node: '26'
|
|
30
|
+
core_ref: ''
|
|
16
31
|
steps:
|
|
17
32
|
-
|
|
18
33
|
name: Install libreoffice
|
|
@@ -25,12 +40,13 @@ jobs:
|
|
|
25
40
|
uses: actions/checkout@v7
|
|
26
41
|
with:
|
|
27
42
|
repository: ether/etherpad-lite
|
|
43
|
+
ref: ${{ matrix.core_ref }}
|
|
28
44
|
path: etherpad-lite
|
|
29
45
|
- uses: actions/setup-node@v7
|
|
30
46
|
name: Install Node.js
|
|
31
47
|
with:
|
|
32
|
-
node-version:
|
|
33
|
-
- uses: pnpm/action-setup@v6.1.
|
|
48
|
+
node-version: ${{ matrix.node }}
|
|
49
|
+
- uses: pnpm/action-setup@v6.1.1
|
|
34
50
|
name: Install pnpm
|
|
35
51
|
with:
|
|
36
52
|
package_json_file: ./etherpad-lite/package.json
|
|
@@ -27,15 +27,15 @@ jobs:
|
|
|
27
27
|
uses: actions/checkout@v7
|
|
28
28
|
|
|
29
29
|
- name: Initialize CodeQL
|
|
30
|
-
uses: github/codeql-action/init@v4.39.
|
|
30
|
+
uses: github/codeql-action/init@v4.39.5
|
|
31
31
|
with:
|
|
32
32
|
languages: ${{ matrix.language }}
|
|
33
33
|
queries: +security-and-quality
|
|
34
34
|
|
|
35
35
|
- name: Autobuild
|
|
36
|
-
uses: github/codeql-action/autobuild@v4.39.
|
|
36
|
+
uses: github/codeql-action/autobuild@v4.39.5
|
|
37
37
|
|
|
38
38
|
- name: Perform CodeQL Analysis
|
|
39
|
-
uses: github/codeql-action/analyze@v4.39.
|
|
39
|
+
uses: github/codeql-action/analyze@v4.39.5
|
|
40
40
|
with:
|
|
41
41
|
category: "/language:${{ matrix.language }}"
|
|
@@ -7,7 +7,26 @@ on:
|
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
9
|
test-frontend:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
10
|
+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
|
|
11
|
+
name: Playwright (Node ${{ matrix.node }} / core ${{ matrix.core_ref || 'develop' }})
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
# Plugin floor is engines.node >=22 but current Etherpad core
|
|
15
|
+
# requires >=24 (engineStrict). Each cell pairs a Node version
|
|
16
|
+
# with a core ref that actually allows it: Node 22 against the
|
|
17
|
+
# last tag whose core floor was 22 (v2.7.3); Node 24 / 26 against
|
|
18
|
+
# current develop.
|
|
19
|
+
matrix:
|
|
20
|
+
include:
|
|
21
|
+
- node: '22'
|
|
22
|
+
core_ref: 'v2.7.3'
|
|
23
|
+
# ubuntu-latest is now 26.04, and the Playwright pinned by core
|
|
24
|
+
# v2.7.3 refuses to install chromium there.
|
|
25
|
+
os: ubuntu-24.04
|
|
26
|
+
- node: '24'
|
|
27
|
+
core_ref: ''
|
|
28
|
+
- node: '26'
|
|
29
|
+
core_ref: ''
|
|
11
30
|
|
|
12
31
|
steps:
|
|
13
32
|
-
|
|
@@ -15,12 +34,13 @@ jobs:
|
|
|
15
34
|
uses: actions/checkout@v7
|
|
16
35
|
with:
|
|
17
36
|
repository: ether/etherpad-lite
|
|
37
|
+
ref: ${{ matrix.core_ref }}
|
|
18
38
|
path: etherpad-lite
|
|
19
39
|
- uses: actions/setup-node@v7
|
|
20
40
|
name: Install Node.js
|
|
21
41
|
with:
|
|
22
|
-
node-version:
|
|
23
|
-
- uses: pnpm/action-setup@v6.1.
|
|
42
|
+
node-version: ${{ matrix.node }}
|
|
43
|
+
- uses: pnpm/action-setup@v6.1.1
|
|
24
44
|
name: Install pnpm
|
|
25
45
|
with:
|
|
26
46
|
package_json_file: ./etherpad-lite/package.json
|
|
@@ -52,6 +72,17 @@ jobs:
|
|
|
52
72
|
- name: Create settings.json
|
|
53
73
|
working-directory: ./etherpad-lite
|
|
54
74
|
run: cp ./src/tests/settings.json settings.json
|
|
75
|
+
# Etherpad v2.7.x added a "severely outdated" version-badge that polls
|
|
76
|
+
# GitHub for the latest release and renders an absolutely-positioned
|
|
77
|
+
# banner at top-right when the running core is a full major behind.
|
|
78
|
+
# On the core v2.7.3 matrix cell that banner intercepts pointer
|
|
79
|
+
# events (e.g. #chaticon) and Playwright clicks time out. Set
|
|
80
|
+
# updates.tier=off so the badge stays hidden. Harmless no-op on cores
|
|
81
|
+
# without the updater or with the tier already off.
|
|
82
|
+
- name: Disable updater poll in test settings
|
|
83
|
+
working-directory: ./etherpad-lite
|
|
84
|
+
run: |
|
|
85
|
+
node -e 'const fs=require("fs");const s=JSON.parse(fs.readFileSync("settings.json","utf8"));s.updates={...(s.updates||{}),tier:"off"};fs.writeFileSync("settings.json",JSON.stringify(s,null,2));'
|
|
55
86
|
- name: Run the frontend tests
|
|
56
87
|
working-directory: ./etherpad-lite
|
|
57
88
|
shell: bash
|
|
@@ -69,4 +100,8 @@ jobs:
|
|
|
69
100
|
done
|
|
70
101
|
cd src
|
|
71
102
|
pnpm exec playwright install chromium --with-deps
|
|
72
|
-
|
|
103
|
+
# On the core v2.7.3 cell run only this plugin's own specs. Core
|
|
104
|
+
# v2.7.3's specs predate fixes that let them coexist with plugins
|
|
105
|
+
# that change the pad layout (enter.spec, a11y_dialogs.spec), and
|
|
106
|
+
# the develop cells already run the full core suite with the plugin.
|
|
107
|
+
pnpm run test-ui --project=chromium ${{ matrix.core_ref && 'plugin_packages/ --pass-with-no-tests' || '' }}
|
|
@@ -7,21 +7,34 @@ jobs:
|
|
|
7
7
|
lint:
|
|
8
8
|
name: ESLint
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
|
-
# `eslint .` executes .
|
|
10
|
+
# `eslint .` executes eslint.config.mjs and every installed ESLint plugin, so
|
|
11
11
|
# don't hand it the caller's contents:write / id-token:write token.
|
|
12
12
|
permissions:
|
|
13
13
|
contents: read
|
|
14
14
|
steps:
|
|
15
15
|
- name: Check out plugin repository
|
|
16
16
|
uses: actions/checkout@v7
|
|
17
|
+
with:
|
|
18
|
+
path: plugin
|
|
19
|
+
# Only core's package.json is needed: its packageManager field sets the
|
|
20
|
+
# pnpm version, the same one the backend and frontend test workflows use.
|
|
21
|
+
- name: Check out Etherpad core's package.json
|
|
22
|
+
uses: actions/checkout@v7
|
|
23
|
+
with:
|
|
24
|
+
repository: ether/etherpad
|
|
25
|
+
path: core
|
|
26
|
+
sparse-checkout: /package.json
|
|
27
|
+
sparse-checkout-cone-mode: false
|
|
17
28
|
- uses: actions/setup-node@v7
|
|
18
29
|
name: Install Node.js
|
|
19
30
|
with:
|
|
20
|
-
node-version:
|
|
21
|
-
- uses: pnpm/action-setup@v6.1.
|
|
31
|
+
node-version: 26
|
|
32
|
+
- uses: pnpm/action-setup@v6.1.1
|
|
22
33
|
name: Install pnpm
|
|
23
34
|
with:
|
|
24
|
-
version
|
|
35
|
+
# No `version:`: pnpm comes from core's packageManager, so it follows
|
|
36
|
+
# core and never clashes with a version input.
|
|
37
|
+
package_json_file: ./core/package.json
|
|
25
38
|
run_install: false
|
|
26
39
|
- name: Get pnpm store directory
|
|
27
40
|
shell: bash
|
|
@@ -30,10 +43,12 @@ jobs:
|
|
|
30
43
|
name: Setup pnpm cache
|
|
31
44
|
with:
|
|
32
45
|
path: ${{ env.STORE_PATH }}
|
|
33
|
-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('
|
|
46
|
+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('plugin/pnpm-lock.yaml') }}
|
|
34
47
|
restore-keys: |
|
|
35
48
|
${{ runner.os }}-pnpm-store-
|
|
36
49
|
- name: Install dependencies
|
|
50
|
+
working-directory: plugin
|
|
37
51
|
run: pnpm install --ignore-scripts
|
|
38
52
|
- name: Run ESLint
|
|
53
|
+
working-directory: plugin
|
|
39
54
|
run: pnpm run lint
|
|
@@ -20,12 +20,12 @@ jobs:
|
|
|
20
20
|
steps:
|
|
21
21
|
- uses: actions/setup-node@v7
|
|
22
22
|
with:
|
|
23
|
-
# OIDC trusted publishing needs npm >= 11.5.1. Node
|
|
24
|
-
# line
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
node-version:
|
|
23
|
+
# OIDC trusted publishing needs npm >= 11.5.1. Node 26 is the
|
|
24
|
+
# Active LTS line and bundles npm 11.x, so the pinned upgrade below
|
|
25
|
+
# stays on the same npm major. Avoid odd non-LTS lines (Node 25):
|
|
26
|
+
# npm 12 requires ^22.22.2 || ^24.15.0 || >=26.0.0 and the upgrade
|
|
27
|
+
# step dies there with EBADENGINE.
|
|
28
|
+
node-version: 26
|
|
29
29
|
registry-url: https://registry.npmjs.org/
|
|
30
30
|
# Pinned to a range rather than @latest: the next npm major dropping
|
|
31
31
|
# this Node line would silently break publishing fleet-wide again.
|
|
@@ -35,9 +35,12 @@ jobs:
|
|
|
35
35
|
uses: actions/checkout@v7
|
|
36
36
|
with:
|
|
37
37
|
repository: ether/etherpad-lite
|
|
38
|
-
- uses: pnpm/action-setup@v6.1.
|
|
38
|
+
- uses: pnpm/action-setup@v6.1.1
|
|
39
39
|
name: Install pnpm
|
|
40
40
|
with:
|
|
41
|
+
# No `version:`: the core checkout above puts core's package.json at
|
|
42
|
+
# the workspace root, so pnpm comes from core's packageManager, like
|
|
43
|
+
# every other plugin workflow.
|
|
41
44
|
run_install: false
|
|
42
45
|
- name: Get pnpm store directory
|
|
43
46
|
shell: bash
|
|
@@ -73,7 +76,13 @@ jobs:
|
|
|
73
76
|
fi
|
|
74
77
|
git config user.name 'github-actions[bot]'
|
|
75
78
|
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
|
76
|
-
pnpm
|
|
79
|
+
# Not every plugin commits a pnpm-lock.yaml, and --frozen-lockfile
|
|
80
|
+
# fails outright without one.
|
|
81
|
+
if [ -f pnpm-lock.yaml ]; then
|
|
82
|
+
pnpm i --frozen-lockfile
|
|
83
|
+
else
|
|
84
|
+
pnpm i
|
|
85
|
+
fi
|
|
77
86
|
# `pnpm version patch` bumps package.json, makes a commit, and creates
|
|
78
87
|
# a `v<new-version>` tag. Capture the new tag name from package.json
|
|
79
88
|
# rather than parsing pnpm's output, which has historically varied.
|
|
@@ -82,7 +91,28 @@ jobs:
|
|
|
82
91
|
# requested (pnpm/action-setup#225); those pre-releases either skip
|
|
83
92
|
# the git commit/tag or reject --no-git-tag-version as unknown.
|
|
84
93
|
# Doing the bump in Node sidesteps both failure modes.
|
|
85
|
-
|
|
94
|
+
# Same rules as `semver inc patch`: 1.2.3 -> 1.2.4, and a prerelease
|
|
95
|
+
# such as 1.2.3-beta.1 is released as 1.2.3. Splitting on dots and
|
|
96
|
+
# calling Number() on the patch part would give NaN for prereleases.
|
|
97
|
+
NEW_VERSION=$(node <<'EOF'
|
|
98
|
+
const fs = require('fs');
|
|
99
|
+
const p = require('./package.json');
|
|
100
|
+
// The regex from semver.org: no leading zeros, no empty identifiers.
|
|
101
|
+
const id = '(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)';
|
|
102
|
+
const m = new RegExp(
|
|
103
|
+
'^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)' +
|
|
104
|
+
`(-${id}(?:\\.${id})*)?` +
|
|
105
|
+
'(\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$').exec(p.version);
|
|
106
|
+
if (m == null) {
|
|
107
|
+
console.error(`package.json version '${p.version}' is not valid semver`);
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
const patch = m[4] ? Number(m[3]) : Number(m[3]) + 1;
|
|
111
|
+
p.version = `${m[1]}.${m[2]}.${patch}`;
|
|
112
|
+
fs.writeFileSync('./package.json', `${JSON.stringify(p, null, 2)}\n`);
|
|
113
|
+
console.log(p.version);
|
|
114
|
+
EOF
|
|
115
|
+
) || exit 1
|
|
86
116
|
NEW_TAG="v${NEW_VERSION}"
|
|
87
117
|
git add package.json
|
|
88
118
|
git commit -m "${NEW_TAG}"
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
name: Node.js Package
|
|
2
|
-
on:
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
# Invoked by automerge.yml after a Dependabot PR is merged. GitHub
|
|
5
|
+
# Actions doesn't fire on:push when the push is authored by GITHUB_TOKEN
|
|
6
|
+
# (the automerge action's only available identity), so without this
|
|
7
|
+
# dispatch trigger the release job never runs after auto-merges.
|
|
8
|
+
workflow_dispatch:
|
|
3
9
|
|
|
4
10
|
# id-token: write must be granted here so the reusable npmpublish workflow
|
|
5
11
|
# can request an OIDC token for npm trusted publishing.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import browser from 'eslint-config-etherpad/flat/browser.js';
|
|
2
|
+
import etherpad from 'eslint-config-etherpad/flat/plugin.js';
|
|
3
|
+
|
|
4
|
+
// The globals of the shared browser profile (browser, jQuery, ES2017).
|
|
5
|
+
const browserGlobals = Object.assign({}, ...browser.map((c) => c.languageOptions?.globals ?? {}));
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{
|
|
9
|
+
// Third-party code, not linted.
|
|
10
|
+
ignores: ['static/js/scrollTo.js'],
|
|
11
|
+
},
|
|
12
|
+
...etherpad,
|
|
13
|
+
{
|
|
14
|
+
// `globalThis` is standard in every runtime this plugin targets (Node >= 22
|
|
15
|
+
// and all supported browsers), but it is not in the environments that
|
|
16
|
+
// eslint-config-etherpad selects.
|
|
17
|
+
languageOptions: {globals: {globalThis: 'readonly'}},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
// eslint-config-etherpad has no profile for Playwright specs: it lints
|
|
21
|
+
// `static/tests/**` as CommonJS mocha running under Node. These specs are
|
|
22
|
+
// ES modules that run in Playwright's runner, so give them their own
|
|
23
|
+
// parser options and globals.
|
|
24
|
+
files: ['static/tests/frontend-new/specs/**/*.js'],
|
|
25
|
+
languageOptions: {
|
|
26
|
+
ecmaVersion: 'latest',
|
|
27
|
+
sourceType: 'module',
|
|
28
|
+
globals: {...browserGlobals, $: 'readonly'},
|
|
29
|
+
},
|
|
30
|
+
rules: {
|
|
31
|
+
'strict': ['error', 'never'],
|
|
32
|
+
'n/no-missing-require': 'off',
|
|
33
|
+
'n/no-unpublished-import': 'off',
|
|
34
|
+
'mocha/no-exports': 'off',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ep_table_of_contents",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.14",
|
|
4
4
|
"description": "View a table of contents for your pad",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "John McLear",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"url": "https://etherpad.org/"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"ep_plugin_helpers": "^0.6.
|
|
29
|
+
"ep_plugin_helpers": "^0.6.11"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"eslint": "^
|
|
33
|
-
"eslint-config-etherpad": "^5.0.
|
|
32
|
+
"eslint": "^9.39.5",
|
|
33
|
+
"eslint-config-etherpad": "^5.0.4",
|
|
34
34
|
"typescript": "~6.0.3"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
package/.eslintrc.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// This is a workaround for https://github.com/eslint/eslint/issues/3458
|
|
4
|
-
require('eslint-config-etherpad/patch/modern-module-resolution');
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
root: true,
|
|
8
|
-
// `globalThis` is standard in every runtime this plugin targets (Node >= 22
|
|
9
|
-
// and all supported browsers), but it is not in the `env`s that
|
|
10
|
-
// eslint-config-etherpad selects.
|
|
11
|
-
globals: {globalThis: 'readonly'},
|
|
12
|
-
extends: 'etherpad/plugin',
|
|
13
|
-
ignorePatterns: [
|
|
14
|
-
'/static/js/scrollTo.js',
|
|
15
|
-
],
|
|
16
|
-
overrides: [
|
|
17
|
-
{
|
|
18
|
-
// eslint-config-etherpad has no profile for Playwright specs: it lints
|
|
19
|
-
// `static/tests/**` as CommonJS mocha running under Node. These specs are
|
|
20
|
-
// ES modules that run in Playwright's runner, so give them their own
|
|
21
|
-
// parser options and globals.
|
|
22
|
-
files: ['static/tests/frontend-new/specs/**/*'],
|
|
23
|
-
parserOptions: {ecmaVersion: 'latest', sourceType: 'module'},
|
|
24
|
-
env: {browser: true, node: true},
|
|
25
|
-
globals: {$: 'readonly'},
|
|
26
|
-
rules: {
|
|
27
|
-
strict: ['error', 'never'],
|
|
28
|
-
'n/no-missing-require': 'off',
|
|
29
|
-
'n/no-unpublished-import': 'off',
|
|
30
|
-
'mocha/no-exports': 'off',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
};
|