ep_disable_reset_authorship_colours 0.0.56 → 0.0.58

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.
@@ -2,6 +2,12 @@ name: Dependabot Automerge
2
2
  permissions:
3
3
  contents: write
4
4
  pull-requests: write
5
+ # `actions: write` lets the post-merge step kick off Node.js Package on
6
+ # the default branch via `gh workflow run`. Without this, automerge'd
7
+ # PRs land on main but the on-push release job never fires (GitHub
8
+ # Actions intentionally suppresses on:push triggers when the push is
9
+ # authenticated with GITHUB_TOKEN).
10
+ actions: write
5
11
  on:
6
12
  workflow_run:
7
13
  workflows:
@@ -21,6 +27,7 @@ jobs:
21
27
  uses: actions/checkout@v6
22
28
 
23
29
  - name: Automerge
30
+ id: automerge
24
31
  uses: "pascalgn/automerge-action@v0.16.4"
25
32
  env:
26
33
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -28,3 +35,11 @@ jobs:
28
35
  MERGE_LABELS: ""
29
36
  MERGE_RETRY_SLEEP: "100000"
30
37
 
38
+ - name: Trigger release on default branch
39
+ # `pascalgn/automerge-action` exits 0 whether or not it merged. Skip
40
+ # the dispatch when nothing was actually merged so we don't kick a
41
+ # phantom release run on every Dependabot Automerge invocation.
42
+ if: steps.automerge.outputs.mergeResult == 'merged'
43
+ env:
44
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45
+ run: gh workflow run test-and-release.yml --ref ${{ github.event.repository.default_branch }}
@@ -26,6 +26,10 @@ jobs:
26
26
  with:
27
27
  repository: ether/etherpad-lite
28
28
  path: etherpad-lite
29
+ - uses: actions/setup-node@v4
30
+ name: Install Node.js
31
+ with:
32
+ node-version: 22
29
33
  - uses: pnpm/action-setup@v6
30
34
  name: Install pnpm
31
35
  with:
@@ -15,6 +15,11 @@ jobs:
15
15
  uses: actions/checkout@v6
16
16
  with:
17
17
  repository: ether/etherpad-lite
18
+ path: etherpad-lite
19
+ - uses: actions/setup-node@v4
20
+ name: Install Node.js
21
+ with:
22
+ node-version: 22
18
23
  - uses: pnpm/action-setup@v6
19
24
  name: Install pnpm
20
25
  with:
@@ -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
+ # ep.json declares `disables: ["@feature:clear-authorship"]`,
74
+ # so the helper runs two passes — regression (everything not
75
+ # tagged @feature:clear-authorship must pass) + honesty (every
76
+ # test tagged @feature:clear-authorship must FAIL because the
77
+ # plugin disables the clear-authorship-colours button).
78
+ # See doc/PLUGIN_FEATURE_DISABLES.md.
79
+ ../bin/run-frontend-tests-with-disables.sh -- --project=chromium
@@ -1,5 +1,11 @@
1
1
  name: Node.js Package
2
- on: [push]
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.
package/ep.json CHANGED
@@ -1,4 +1,5 @@
1
1
  {
2
+ "disables": ["@feature:clear-authorship"],
2
3
  "parts":[
3
4
  {
4
5
  "name": "disable_reset_authorship_colours",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ep_disable_reset_authorship_colours",
3
3
  "description": "Disable The reset authorship colours button",
4
- "version": "0.0.56",
4
+ "version": "0.0.58",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/ether/ep_disable_reset_authorship_colours.git"
@@ -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_reset_authorship_colours', () => {
9
+ test('pad loads with plugin installed', async ({page}) => {
10
+ const padBody = await getPadBody(page);
11
+ await expect(padBody).toBeVisible();
12
+ });
13
+ });