ep_button_link 1.0.57 → 1.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.
@@ -49,7 +49,7 @@ jobs:
49
49
  - uses: pnpm/action-setup@v6.1.1
50
50
  name: Install pnpm
51
51
  with:
52
- version: 10
52
+ package_json_file: ./etherpad-lite/package.json
53
53
  run_install: false
54
54
  - name: Get pnpm store directory
55
55
  shell: bash
@@ -43,7 +43,7 @@ jobs:
43
43
  - uses: pnpm/action-setup@v6.1.1
44
44
  name: Install pnpm
45
45
  with:
46
- version: 10
46
+ package_json_file: ./etherpad-lite/package.json
47
47
  run_install: false
48
48
  - name: Get pnpm store directory
49
49
  shell: bash
@@ -14,6 +14,17 @@ jobs:
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:
@@ -21,7 +32,9 @@ jobs:
21
32
  - uses: pnpm/action-setup@v6.1.1
22
33
  name: Install pnpm
23
34
  with:
24
- version: 10
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('**/pnpm-lock.yaml') }}
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
@@ -38,6 +38,9 @@ jobs:
38
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 i --frozen-lockfile
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
- 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);")
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}"
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ ![Publish Status](https://github.com/ether/ep_button_link/workflows/Node.js%20Package/badge.svg) ![Backend Tests Status](https://github.com/ether/ep_button_link/workflows/Backend%20tests/badge.svg)
2
+
1
3
  ![Demo](demo.gif) [![Backend Tests Status](https://github.com/ether/ep_button_link/actions/workflows/test-and-release.yml/badge.svg)](https://github.com/ether/ep_button_link/actions/workflows/test-and-release.yml)
2
4
 
3
5
  # Toolbar Button Links for Etherpad
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ep_button_link",
3
3
  "description": "Adds a button to the toolbar that links out to a new window",
4
- "version": "1.0.57",
4
+ "version": "1.0.58",
5
5
  "author": "johnyma22 (John McLear) <john@mclear.co.uk>",
6
6
  "engines": {
7
7
  "node": ">=22.0.0"