ep_offline_edit 0.0.39 → 0.0.50

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.
@@ -22,11 +22,11 @@ jobs:
22
22
  version: 1.0
23
23
  -
24
24
  name: Install etherpad core
25
- uses: actions/checkout@v6
25
+ uses: actions/checkout@v4
26
26
  with:
27
27
  repository: ether/etherpad-lite
28
28
  path: etherpad-lite
29
- - uses: pnpm/action-setup@v5
29
+ - uses: pnpm/action-setup@v3
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@v5
38
+ - uses: actions/cache@v4
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@v6
47
+ uses: actions/checkout@v4
48
48
  with:
49
49
  path: plugin
50
50
  - name: Remove tests
@@ -62,6 +62,7 @@ jobs:
62
62
  name: Run the backend tests
63
63
  working-directory: ./etherpad-lite/src
64
64
  run: |
65
+ shopt -s globstar
65
66
  res=$(find ./plugin_packages -path "*/static/tests/backend/specs/*" 2>/dev/null | wc -l)
66
67
  if [ $res -eq 0 ]; then
67
68
  echo "No backend tests found"
@@ -12,10 +12,10 @@ jobs:
12
12
  steps:
13
13
  -
14
14
  name: Check out Etherpad core
15
- uses: actions/checkout@v6
15
+ uses: actions/checkout@v4
16
16
  with:
17
17
  repository: ether/etherpad-lite
18
- - uses: pnpm/action-setup@v5
18
+ - uses: pnpm/action-setup@v3
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@v5
27
+ - uses: actions/cache@v4
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@v6
36
+ uses: actions/checkout@v4
37
37
  with:
38
38
  path: ./node_modules/__tmp
39
39
  -
@@ -1,5 +1,10 @@
1
1
  # This workflow will run tests using node and then publish a package to the npm registry when a release is created
2
2
  # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
+ #
4
+ # Publishing uses npm Trusted Publishing (OIDC) — no NPM_TOKEN secret is
5
+ # required. Each package must have a trusted publisher configured on npmjs.com
6
+ # pointing at this workflow file. See:
7
+ # https://docs.npmjs.com/trusted-publishers
3
8
 
4
9
  name: Node.js Package
5
10
 
@@ -9,11 +14,19 @@ on:
9
14
  jobs:
10
15
  publish-npm:
11
16
  runs-on: ubuntu-latest
17
+ permissions:
18
+ contents: write # for the atomic version-bump push (branch + tag)
19
+ id-token: write # for npm OIDC trusted publishing
12
20
  steps:
13
21
  - uses: actions/setup-node@v6
14
22
  with:
23
+ # OIDC trusted publishing needs npm >= 11.5.1, which requires
24
+ # Node >= 20.17.0. setup-node's `20` resolves to the latest
25
+ # 20.x, which satisfies that.
15
26
  node-version: 20
16
27
  registry-url: https://registry.npmjs.org/
28
+ - name: Upgrade npm to >=11.5.1 (required for trusted publishing)
29
+ run: npm install -g npm@latest
17
30
  - name: Check out Etherpad core
18
31
  uses: actions/checkout@v6
19
32
  with:
@@ -47,8 +60,22 @@ jobs:
47
60
  git config user.name 'github-actions[bot]'
48
61
  git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
49
62
  pnpm i
63
+ # `pnpm version patch` bumps package.json, makes a commit, and creates
64
+ # a `v<new-version>` tag. Capture the new tag name from package.json
65
+ # rather than parsing pnpm's output, which has historically varied.
50
66
  pnpm version patch
51
- git push --follow-tags
67
+ NEW_TAG="v$(node -p "require('./package.json').version")"
68
+ # CRITICAL: use --atomic so the branch update and the tag update
69
+ # succeed (or fail) as a single transaction on the server. The old
70
+ # `git push --follow-tags` was non-atomic per ref: if a concurrent
71
+ # publish run won the race, the branch fast-forward would be rejected
72
+ # but the tag push would still land — leaving a dangling tag with no
73
+ # matching commit on the branch. Subsequent runs would then forever
74
+ # try to bump to the same already-existing tag and fail with
75
+ # `tag 'vN+1' already exists`. With --atomic, a rejected branch push
76
+ # rejects the tag push too, and the next workflow tick can retry
77
+ # cleanly against the up-to-date refs.
78
+ git push --atomic origin "${GITHUB_REF_NAME}" "${NEW_TAG}"
52
79
  # This is required if the package has a prepare script that uses something
53
80
  # in dependencies or devDependencies.
54
81
  -
@@ -63,12 +90,10 @@ jobs:
63
90
  # already-used version number. By running `npm publish` after `git push`,
64
91
  # back-to-back merges will cause the first merge's workflow to fail but
65
92
  # the second's will succeed.
66
- -
67
- run: pnpm publish
68
- env:
69
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
70
- #-
71
- # name: Add package to etherpad organization
72
- # run: pnpm access grant read-write etherpad:developers
73
- # env:
74
- # NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
93
+ #
94
+ # Use `npm publish` directly (not `pnpm publish`) because OIDC trusted
95
+ # publishing requires npm CLI >= 11.5.1 and `pnpm publish` shells out to
96
+ # whichever `npm` is on PATH; calling `npm` directly avoids any shim
97
+ # ambiguity.
98
+ - name: Publish to npm via OIDC
99
+ run: npm publish --provenance --access public
@@ -1,6 +1,11 @@
1
1
  name: Node.js Package
2
2
  on: [push]
3
3
 
4
+ # id-token: write must be granted here so the reusable npmpublish workflow
5
+ # can request an OIDC token for npm trusted publishing.
6
+ permissions:
7
+ contents: write
8
+ id-token: write
4
9
 
5
10
  jobs:
6
11
  backend:
@@ -14,5 +19,8 @@ jobs:
14
19
  needs:
15
20
  - backend
16
21
  - frontend
22
+ permissions:
23
+ contents: write # for the version bump push
24
+ id-token: write # for npm OIDC trusted publishing
17
25
  uses: ./.github/workflows/npmpublish.yml
18
26
  secrets: inherit
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ![Publish Status](https://github.com/ether/ep_offline_edit/workflows/Node.js%20Package/badge.svg) ![Backend Tests Status](https://github.com/ether/ep_offline_edit/workflows/Backend%20tests/badge.svg)
1
+ ![Publish Status](https://github.com/ether/ep_offline_edit/workflows/Node.js%20Package/badge.svg) [![Backend Tests Status](https://github.com/ether/ep_offline_edit/actions/workflows/test-and-release.yml/badge.svg)](https://github.com/ether/ep_offline_edit/actions/workflows/test-and-release.yml)
2
2
 
3
3
  # Allows you to see your document if you get disconnected from the Internet.
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ep_offline_edit",
3
- "version": "0.0.39",
3
+ "version": "0.0.50",
4
4
  "description": "View your pad data even if you are disconnected from the Internets",
5
5
  "author": {
6
6
  "name": "John McLear",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "https://github.com/JohnMcLear/ep_offline_edit.git"
15
+ "url": "https://github.com/ether/ep_offline_edit.git"
16
16
  },
17
17
  "readmeFilename": "README.md",
18
18
  "funding": {
@@ -22,10 +22,10 @@
22
22
  "devDependencies": {
23
23
  "eslint": "^8.57.1",
24
24
  "eslint-config-etherpad": "^4.0.4",
25
- "typescript": "^6.0.2"
25
+ "typescript": "^5.9.3"
26
26
  },
27
27
  "scripts": {
28
28
  "lint": "eslint .",
29
29
  "lint:fix": "eslint --fix ."
30
30
  }
31
- }
31
+ }