ep_disable_chat 0.0.38 → 0.0.40

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.
@@ -26,7 +26,11 @@ jobs:
26
26
  with:
27
27
  repository: ether/etherpad-lite
28
28
  path: etherpad-lite
29
- - uses: pnpm/action-setup@v3
29
+ - uses: actions/setup-node@v4
30
+ name: Install Node.js
31
+ with:
32
+ node-version: 22
33
+ - uses: pnpm/action-setup@v6
30
34
  name: Install pnpm
31
35
  with:
32
36
  version: 10
@@ -35,7 +39,7 @@ jobs:
35
39
  shell: bash
36
40
  run: |
37
41
  echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
38
- - uses: actions/cache@v4
42
+ - uses: actions/cache@v5
39
43
  name: Setup pnpm cache
40
44
  with:
41
45
  path: ${{ env.STORE_PATH }}
@@ -15,7 +15,12 @@ jobs:
15
15
  uses: actions/checkout@v6
16
16
  with:
17
17
  repository: ether/etherpad-lite
18
- - uses: pnpm/action-setup@v3
18
+ path: etherpad-lite
19
+ - uses: actions/setup-node@v4
20
+ name: Install Node.js
21
+ with:
22
+ node-version: 22
23
+ - uses: pnpm/action-setup@v6
19
24
  name: Install pnpm
20
25
  with:
21
26
  version: 10
@@ -24,7 +29,7 @@ jobs:
24
29
  shell: bash
25
30
  run: |
26
31
  echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
27
- - uses: actions/cache@v4
32
+ - uses: actions/cache@v5
28
33
  name: Setup pnpm cache
29
34
  with:
30
35
  path: ${{ env.STORE_PATH }}
@@ -32,63 +37,43 @@ jobs:
32
37
  restore-keys: |
33
38
  ${{ runner.os }}-pnpm-store-
34
39
  -
35
- name: Check out the plugin
40
+ name: Checkout plugin repository
36
41
  uses: actions/checkout@v6
37
42
  with:
38
- path: ./node_modules/__tmp
39
- -
40
- name: export GIT_HASH to env
41
- id: environment
42
- run: |
43
- cd ./node_modules/__tmp
44
- echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})"
45
- -
46
- name: Determine plugin name
47
- id: plugin_name
48
- run: |
49
- cd ./node_modules/__tmp
50
- npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
51
- -
52
- name: Rename plugin directory
53
- env:
54
- PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
55
- run: |
56
- mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}"
57
- -
58
- name: Install plugin dependencies
59
- env:
60
- PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
61
- run: |
62
- cd ./node_modules/"${PLUGIN_NAME}"
63
- pnpm i
64
- # Etherpad core dependencies must be installed after installing the
65
- # plugin's dependencies, otherwise npm will try to hoist common
66
- # dependencies by removing them from src/node_modules and installing them
67
- # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
68
- # to be buggy, because it sometimes removes dependencies from
69
- # src/node_modules but fails to add them to the top-level node_modules.
70
- # Even if npm correctly hoists the dependencies, the hoisting seems to
71
- # confuse tools such as `npm outdated`, `npm update`, and some ESLint
72
- # rules.
43
+ path: plugin
73
44
  -
74
45
  name: Install Etherpad core dependencies
46
+ working-directory: ./etherpad-lite
75
47
  run: bin/installDeps.sh
48
+ - name: Install plugin
49
+ working-directory: ./etherpad-lite
50
+ run: |
51
+ pnpm run plugins i --path ../../plugin
76
52
  - name: Create settings.json
53
+ working-directory: ./etherpad-lite
77
54
  run: cp ./src/tests/settings.json settings.json
78
55
  - name: Run the frontend tests
56
+ working-directory: ./etherpad-lite
79
57
  shell: bash
80
58
  run: |
81
59
  pnpm run dev &
82
60
  connected=false
83
61
  can_connect() {
84
- curl -sSfo /dev/null http://localhost:9001/ || return 1
85
- connected=true
62
+ curl -sSfo /dev/null http://localhost:9001/ || return 1
63
+ connected=true
86
64
  }
87
65
  now() { date +%s; }
88
66
  start=$(now)
89
- while [ $(($(now) - $start)) -le 15 ] && ! can_connect; do
90
- sleep 1
67
+ while [ $(($(now) - $start)) -le 30 ] && ! can_connect; do
68
+ sleep 1
91
69
  done
92
70
  cd src
93
- pnpm exec playwright install chromium --with-deps
94
- pnpm run test-ui --project=chromium
71
+ pnpm exec playwright install chromium --with-deps
72
+ # Use the declared-disables helper instead of plain test-ui:
73
+ # this plugin's ep.json declares `disables: ["@feature:chat"]`,
74
+ # so the helper runs two passes — regression (everything not
75
+ # tagged @feature:chat must pass) + honesty (every test
76
+ # tagged @feature:chat must FAIL because the plugin really
77
+ # does disable chat). Both must succeed for CI to be green.
78
+ # See ether/etherpad-lite#7648 / doc/PLUGIN_FEATURE_DISABLES.md.
79
+ ../bin/run-frontend-tests-with-disables.sh -- --project=chromium
@@ -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
@@ -3,3 +3,20 @@
3
3
  # Disable Chat Etherpad
4
4
 
5
5
  Disables Chat and the Settings to show chat.
6
+
7
+ ## Installation
8
+
9
+ Install from the Etherpad admin UI (**Admin → Manage Plugins**,
10
+ search for `ep_disable_chat` and click *Install*), or from the Etherpad
11
+ root directory:
12
+
13
+ ```sh
14
+ pnpm run plugins install ep_disable_chat
15
+ ```
16
+
17
+ > ⚠️ Don't run `npm i` / `npm install` yourself from the Etherpad
18
+ > source tree — Etherpad tracks installed plugins through its own
19
+ > plugin-manager, and hand-editing `package.json` can leave the
20
+ > server unable to start.
21
+
22
+ After installing, restart Etherpad.
package/ep.json CHANGED
@@ -1,5 +1,5 @@
1
-
2
1
  {
2
+ "disables": ["@feature:chat"],
3
3
  "parts":[
4
4
  {
5
5
  "name": "ep_disable_chat",
package/package.json CHANGED
@@ -9,15 +9,15 @@
9
9
  "deprecated": false,
10
10
  "description": "Disable Chat in Etherpad",
11
11
  "name": "ep_disable_chat",
12
- "version": "0.0.38",
12
+ "version": "0.0.40",
13
13
  "funding": {
14
14
  "type": "individual",
15
15
  "url": "https://etherpad.org/"
16
16
  },
17
17
  "devDependencies": {
18
18
  "eslint": "^8.57.1",
19
- "eslint-config-etherpad": "^4.0.4",
20
- "typescript": "^6.0.2"
19
+ "eslint-config-etherpad": "^4.0.5",
20
+ "typescript": "^6.0.3"
21
21
  },
22
22
  "scripts": {
23
23
  "lint": "eslint .",
@@ -0,0 +1,13 @@
1
+ import {expect, test} from '@playwright/test';
2
+ import {getPadBody, goToNewPad} from 'ep_etherpad-lite/tests/frontend-new/helper/padHelper';
3
+
4
+ test.beforeEach(async ({page}) => {
5
+ await goToNewPad(page);
6
+ });
7
+
8
+ test.describe('ep_disable_chat', () => {
9
+ test('pad loads with plugin installed', async ({page}) => {
10
+ const padBody = await getPadBody(page);
11
+ await expect(padBody).toBeVisible();
12
+ });
13
+ });