Skip to content

Commit 0d93949

Browse files
committed
update to rfc9702, eslint@9
1 parent 954a10d commit 0d93949

35 files changed

+697
-2994
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ jobs:
5151
node-version: ${{ matrix.node-version }}
5252
- run: npm ci
5353
# test code
54-
- run: npm run standard
54+
- run: npm run lint
5555
- run: npm run validate
5656
- run: npm run c8
5757
# Test global install of the package
5858
- run: npm pack .
5959
- run: npm install -g solid-server-*.tgz
60+
# Run the Solid test-suite
61+
- run: bash test/surface/run-solid-test-suite.sh $BRANCH_NAME $REPO_NAME
6062
- name: Save build
6163
# if: matrix.node-version == '20.x'
6264
uses: actions/upload-artifact@v5
@@ -67,16 +69,9 @@ jobs:
6769
!node_modules
6870
retention-days: 1
6971

70-
test-suite:
71-
needs: build
72-
runs-on: ${{ matrix.os }}
73-
steps:
74-
# Run the Solid test-suite
75-
- run: bash test/surface/run-solid-test-suite.sh $BRANCH_NAME $REPO_NAME
76-
7772
# The pipeline automate publication to npm, so that the docker build gets the correct version
7873
npm-publish-build:
79-
needs: [build, test-suite]
74+
needs: [build]
8075
name: Publish to npm
8176
runs-on: ubuntu-latest
8277
steps:
@@ -85,7 +80,7 @@ jobs:
8580
name: build
8681
- uses: actions/setup-node@v6
8782
with:
88-
node-version: 20.x
83+
node-version: 22.x
8984
- uses: rlespinasse/github-slug-action@v3.x
9085
- name: Append commit hash to package version
9186
run: 'sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json'
@@ -98,7 +93,7 @@ jobs:
9893
tag: ${{ env.GITHUB_REF_SLUG }}
9994

10095
npm-publish-latest:
101-
needs: [build, test-suite, npm-publish-build]
96+
needs: [build, npm-publish-build]
10297
runs-on: ubuntu-latest
10398
if: github.ref == 'refs/heads/main'
10499
steps:

common/js/auth-buttons.mjs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,41 @@
1717
'account-settings',
1818
'loggedIn',
1919
'profileLink'
20-
].map(id => document.getElementById(id) || document.createElement('a'));
21-
loginButton.addEventListener('click', login);
22-
logoutButton.addEventListener('click', logout);
23-
registerButton.addEventListener('click', register);
20+
].map(id => document.getElementById(id) || document.createElement('a'))
21+
loginButton.addEventListener('click', login)
22+
logoutButton.addEventListener('click', logout)
23+
registerButton.addEventListener('click', register)
2424

2525
// Track authentication status and update UI
2626
auth.trackSession(session => {
27-
const loggedIn = !!session;
28-
const isOwner = loggedIn && new URL(session.webId).origin === location.origin;
29-
loginButton.classList.toggle('hidden', loggedIn);
30-
logoutButton.classList.toggle('hidden', !loggedIn);
31-
registerButton.classList.toggle('hidden', loggedIn);
32-
accountSettings.classList.toggle('hidden', !isOwner);
33-
loggedInContainer.classList.toggle('hidden', !loggedIn);
27+
const loggedIn = !!session
28+
const isOwner = loggedIn && new URL(session.webId).origin === location.origin
29+
loginButton.classList.toggle('hidden', loggedIn)
30+
logoutButton.classList.toggle('hidden', !loggedIn)
31+
registerButton.classList.toggle('hidden', loggedIn)
32+
accountSettings.classList.toggle('hidden', !isOwner)
33+
loggedInContainer.classList.toggle('hidden', !loggedIn)
3434
if (session) {
35-
profileLink.href = session.webId;
36-
profileLink.innerText = session.webId;
35+
profileLink.href = session.webId
36+
profileLink.innerText = session.webId
3737
}
38-
});
38+
})
3939

4040
// Log the user in on the client and the server
4141
async function login () {
42-
alert(`login from this page is no more possible.\n\nYou must ask the pod owner to modify this page or remove it.`);
42+
alert(`login from this page is no more possible.\n\nYou must ask the pod owner to modify this page or remove it.`)
4343
// Deprecated code omitted
4444
}
4545

4646
// Log the user out from the client and the server
4747
async function logout () {
48-
await auth.logout();
49-
location.reload();
48+
await auth.logout()
49+
location.reload()
5050
}
5151

5252
// Redirect to the registration page
5353
function register () {
54-
const registration = new URL('/register', location);
55-
location.href = registration;
54+
const registration = new URL('/register', location)
55+
location.href = registration
5656
}
57-
})(solid);
57+
})(solid)

common/js/index-buttons.mjs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
// ESM version of index-buttons.js
2-
'use strict';
3-
const keyname = 'SolidServerRootRedirectLink';
4-
function register() {
5-
alert(2);
6-
window.location.href = "/register";
7-
}
8-
document.addEventListener('DOMContentLoaded', async function() {
9-
const authn = UI.authn;
10-
const authSession = UI.authn.authSession;
2+
'use strict'
3+
const keyname = 'SolidServerRootRedirectLink'
4+
/* function register () {
5+
alert(2)
6+
window.location.href = '/register'
7+
} */
8+
document.addEventListener('DOMContentLoaded', async function () {
9+
const authn = UI.authn
10+
const authSession = UI.authn.authSession
1111

12-
if (!authn.currentUser()) await authn.checkUser();
13-
let user = authn.currentUser();
12+
if (!authn.currentUser()) await authn.checkUser()
13+
const user = authn.currentUser()
1414

1515
// IF LOGGED IN: SET SolidServerRootRedirectLink. LOGOUT
1616
if (user) {
17-
window.localStorage.setItem(keyname, user.uri);
18-
await authSession.logout();
17+
window.localStorage.setItem(keyname, user.uri)
18+
await authSession.logout()
1919
} else {
20-
let webId = window.localStorage.getItem(keyname);
20+
const webId = window.localStorage.getItem(keyname)
2121
// IF NOT LOGGED IN AND COOKIE EXISTS: REMOVE COOKIE, HIDE WELCOME, SHOW LINK TO PROFILE
2222
if (webId) {
23-
window.localStorage.removeItem(keyname);
24-
document.getElementById('loggedIn').style.display = "block";
25-
document.getElementById('loggedIn').innerHTML = `<p>Your WebID is : <a href="${webId}">${webId}</a>.</p> <p>Visit your profile to log into your Pod.</p>`;
26-
}
23+
window.localStorage.removeItem(keyname)
24+
document.getElementById('loggedIn').style.display = 'block'
25+
document.getElementById('loggedIn').innerHTML = `<p>Your WebID is : <a href="${webId}">${webId}</a>.</p> <p>Visit your profile to log into your Pod.</p>`
26+
2727
// IF NOT LOGGED IN AND COOKIE DOES NOT EXIST
2828
// SHOW WELCOME, SHOW LOGIN BUTTON
2929
// HIDE LOGIN BUTTON, ADD REGISTER BUTTON
30-
else {
31-
let loginArea = document.getElementById('loginStatusArea');
32-
let html = `<input type="button" onclick="window.location.href='/register'" value="Register to get a Pod" class="register-button" style="padding: 1em; border-radius:0.2em; font-size: 100%;margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important;background-color: #efe;">`;
33-
let span = document.createElement("span");
34-
span.innerHTML = html;
35-
loginArea.appendChild(span);
36-
loginArea.appendChild(UI.login.loginStatusBox(document, null, {}));
37-
const logInButton = loginArea.querySelectorAll('input')[1];
38-
logInButton.value = "Log in to see your WebID";
39-
const signUpButton = loginArea.querySelectorAll('input')[2];
40-
signUpButton.style.display = "none";
30+
} else {
31+
const loginArea = document.getElementById('loginStatusArea')
32+
const html = `<input type="button" onclick="window.location.href='/register'" value="Register to get a Pod" class="register-button" style="padding: 1em; border-radius:0.2em; font-size: 100%;margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important;background-color: #efe;">`
33+
const span = document.createElement('span')
34+
span.innerHTML = html
35+
loginArea.appendChild(span)
36+
loginArea.appendChild(UI.login.loginStatusBox(document, null, {}))
37+
const logInButton = loginArea.querySelectorAll('input')[1]
38+
logInButton.value = 'Log in to see your WebID'
39+
const signUpButton = loginArea.querySelectorAll('input')[2]
40+
signUpButton.style.display = 'none'
4141
}
4242
}
43-
});
43+
})

common/js/solid.mjs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
// global: owaspPasswordStrengthTest, TextEncoder, crypto, fetch
33

44
(function () {
5-
'use strict';
5+
'use strict'
66

77
const PasswordValidator = function (passwordField, repeatedPasswordField) {
88
if (
99
passwordField === null || passwordField === undefined ||
1010
repeatedPasswordField === null || repeatedPasswordField === undefined
1111
) {
12-
return;
12+
return
1313
}
1414

15-
this.passwordField = passwordField;
16-
this.repeatedPasswordField = repeatedPasswordField;
15+
this.passwordField = passwordField
16+
this.repeatedPasswordField = repeatedPasswordField
1717

18-
this.fetchDomNodes();
19-
this.bindEvents();
18+
this.fetchDomNodes()
19+
this.bindEvents()
2020

21-
this.currentStrengthLevel = 0;
22-
this.errors = [];
23-
};
21+
this.currentStrengthLevel = 0
22+
this.errors = []
23+
}
2424

2525
const FEEDBACK_SUCCESS = 'success'
2626
const FEEDBACK_WARNING = 'warning'
@@ -452,5 +452,5 @@
452452
new PasswordValidator(
453453
document.getElementById('password'),
454454
document.getElementById('repeat_password')
455-
);
456-
})();
455+
)
456+
})()

config/defaults.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ export default {
1919
// "host": "proxy.example.com",
2020
// "port": 12345
2121
// }
22-
};
22+
}

index.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import startCli from './bin/lib/cli.mjs'
88
let exported
99
const canAttach = (ldnode && (typeof ldnode === 'object' || typeof ldnode === 'function'))
1010
if (canAttach) {
11-
try {
12-
if (!ldnode.createServer) ldnode.createServer = createServer
13-
if (!ldnode.startCli) ldnode.startCli = startCli
14-
exported = ldnode
15-
} catch (e) {
16-
exported = { default: ldnode, createServer, startCli }
17-
}
11+
try {
12+
if (!ldnode.createServer) ldnode.createServer = createServer
13+
if (!ldnode.startCli) ldnode.startCli = startCli
14+
exported = ldnode
15+
} catch (e) {
16+
exported = { default: ldnode, createServer, startCli }
17+
}
1818
} else {
19-
exported = { default: ldnode, createServer, startCli }
19+
exported = { default: ldnode, createServer, startCli }
2020
}
2121

2222
export default exported

lib/acl-checker.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
/* eslint-disable node/no-deprecated-api */
32

43
import { dirname } from 'path'
54
import rdf from 'rdflib'

lib/handlers/copy.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable node/no-deprecated-api */
2-
31
import debug from '../debug.mjs'
42
import HTTPError from '../http-error.mjs'
53
import ldpCopy from '../ldp-copy.mjs'

lib/handlers/cors-proxy.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable node/no-deprecated-api */
2-
31
import { createProxyMiddleware } from 'http-proxy-middleware'
42
import cors from 'cors'
53
import debug from '../debug.mjs'

lib/handlers/get.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function hasReadPermissions (file, req, res, callback) {
240240
if (!ldp.webid) {
241241
// FIXME: what is the rule that causes
242242
// "Unexpected literal in error position of callback" in `npm run standard`?
243-
// eslint-disable-next-line
243+
244244
return callback(true)
245245
}
246246

@@ -249,6 +249,6 @@ function hasReadPermissions (file, req, res, callback) {
249249
res.locals.path = relativePath
250250
// FIXME: what is the rule that causes
251251
// "Unexpected literal in error position of callback" in `npm run standard`?
252-
// eslint-disable-next-line
252+
253253
allow('Read')(req, res, err => callback(!err))
254254
}

0 commit comments

Comments
 (0)