Skip to content

Commit acca3e3

Browse files
autofixes from Etherpad checkPlugin.js
1 parent c558280 commit acca3e3

6 files changed

Lines changed: 3603 additions & 2973 deletions

File tree

.github/workflows/backend-tests.yml

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ jobs:
2222
version: 1.0
2323
-
2424
name: Install etherpad core
25-
uses: actions/checkout@v6
25+
uses: actions/checkout@v4
2626
with:
2727
repository: ether/etherpad-lite
2828
path: etherpad-lite
29-
- uses: pnpm/action-setup@v5
29+
- uses: pnpm/action-setup@v3
3030
name: Install pnpm
3131
with:
32-
version: 8
32+
version: 10
3333
run_install: false
3434
- name: Get pnpm store directory
3535
shell: bash
3636
run: |
3737
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
38-
- uses: actions/cache@v5
38+
- uses: actions/cache@v4
3939
name: Setup pnpm cache
4040
with:
4141
path: ${{ env.STORE_PATH }}
@@ -44,49 +44,28 @@ jobs:
4444
${{ runner.os }}-pnpm-store-
4545
-
4646
name: Checkout plugin repository
47-
uses: actions/checkout@v6
47+
uses: actions/checkout@v4
4848
with:
4949
path: plugin
50-
-
51-
name: Determine plugin name
52-
id: plugin_name
53-
working-directory: ./plugin
54-
run: |
55-
npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
56-
-
57-
name: Link plugin directory
58-
working-directory: ./plugin
59-
run: |
60-
pnpm link --global
6150
- name: Remove tests
6251
working-directory: ./etherpad-lite
6352
run: rm -rf ./src/tests/backend/specs
6453
-
6554
name: Install Etherpad core dependencies
6655
working-directory: ./etherpad-lite
6756
run: bin/installDeps.sh
68-
- name: Link plugin to etherpad-lite
57+
- name: Install plugin
6958
working-directory: ./etherpad-lite
7059
run: |
71-
pnpm link --global $PLUGIN_NAME
72-
pnpm run install-plugins --path ../../plugin
73-
env:
74-
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
75-
- name: Link ep_etherpad-lite
76-
working-directory: ./etherpad-lite/src
77-
run: |
78-
pnpm link --global
79-
- name: Link etherpad to plugin
80-
working-directory: ./plugin
81-
run: |
82-
pnpm link --global ep_etherpad-lite
60+
pnpm run plugins i --path ../../plugin
8361
-
8462
name: Run the backend tests
85-
working-directory: ./etherpad-lite
63+
working-directory: ./etherpad-lite/src
8664
run: |
87-
res=$(find .. -path "./node_modules/ep_*/static/tests/backend/specs/**" | wc -l)
65+
shopt -s globstar
66+
res=$(find ./plugin_packages -path "*/static/tests/backend/specs/*" 2>/dev/null | wc -l)
8867
if [ $res -eq 0 ]; then
8968
echo "No backend tests found"
9069
else
91-
pnpm run test
70+
npx cross-env NODE_ENV=production mocha --import=tsx --timeout 120000 --recursive node_modules/ep_*/static/tests/backend/specs/**
9271
fi

.github/workflows/frontend-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ jobs:
1212
steps:
1313
-
1414
name: Check out Etherpad core
15-
uses: actions/checkout@v6
15+
uses: actions/checkout@v4
1616
with:
1717
repository: ether/etherpad-lite
18-
- uses: pnpm/action-setup@v5
18+
- uses: pnpm/action-setup@v3
1919
name: Install pnpm
2020
with:
21-
version: 8
21+
version: 10
2222
run_install: false
2323
- name: Get pnpm store directory
2424
shell: bash
2525
run: |
2626
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
27-
- uses: actions/cache@v5
27+
- uses: actions/cache@v4
2828
name: Setup pnpm cache
2929
with:
3030
path: ${{ env.STORE_PATH }}
@@ -33,7 +33,7 @@ jobs:
3333
${{ runner.os }}-pnpm-store-
3434
-
3535
name: Check out the plugin
36-
uses: actions/checkout@v6
36+
uses: actions/checkout@v4
3737
with:
3838
path: ./node_modules/__tmp
3939
-

.github/workflows/npmpublish.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# This workflow will run tests using node and then publish a package to the npm registry when a release is created
22
# 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
38

49
name: Node.js Package
510

@@ -9,19 +14,27 @@ on:
914
jobs:
1015
publish-npm:
1116
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write # for `git push --follow-tags` of the version bump
19+
id-token: write # for npm OIDC trusted publishing
1220
steps:
1321
- uses: actions/setup-node@v6
1422
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.
1526
node-version: 20
1627
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
1730
- name: Check out Etherpad core
1831
uses: actions/checkout@v6
1932
with:
2033
repository: ether/etherpad-lite
2134
- uses: pnpm/action-setup@v5
2235
name: Install pnpm
2336
with:
24-
version: 8
37+
version: 10
2538
run_install: false
2639
- name: Get pnpm store directory
2740
shell: bash
@@ -63,12 +76,10 @@ jobs:
6376
# already-used version number. By running `npm publish` after `git push`,
6477
# back-to-back merges will cause the first merge's workflow to fail but
6578
# 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}}
79+
#
80+
# Use `npm publish` directly (not `pnpm publish`) because OIDC trusted
81+
# publishing requires npm CLI >= 11.5.1 and `pnpm publish` shells out to
82+
# whichever `npm` is on PATH; calling `npm` directly avoids any shim
83+
# ambiguity.
84+
- name: Publish to npm via OIDC
85+
run: npm publish --provenance --access public

.github/workflows/test-and-release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Node.js Package
22
on: [push]
33

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
49

510
jobs:
611
backend:
@@ -14,5 +19,8 @@ jobs:
1419
needs:
1520
- backend
1621
- frontend
22+
permissions:
23+
contents: write # for the version bump push
24+
id-token: write # for npm OIDC trusted publishing
1725
uses: ./.github/workflows/npmpublish.yml
1826
secrets: inherit

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ep_dynamic_default_content",
3-
"version": "1.0.16",
3+
"version": "1.0.17",
44
"description": "Etherpad plugin to dynamically generate a pad's initial content.",
55
"type": "module",
66
"source": "./src/index.ts",
@@ -41,10 +41,10 @@
4141
},
4242
"homepage": "https://github.com/ether/ep_dynamic_default_content#readme",
4343
"devDependencies": {
44-
"eslint": "^8.57.0",
44+
"eslint": "^8.57.1",
4545
"eslint-config-etherpad": "^4.0.4",
4646
"microbundle": "^0.15.1",
47-
"typescript": "^6.0.2"
47+
"typescript": "^5.9.3"
4848
},
4949
"dependencies": {
5050
"ajv": "^8.18.0",

0 commit comments

Comments
 (0)