Skip to content

Commit 0aeee3f

Browse files
authored
Update dependencies, Node 18, port to ESM (#87)
1 parent 01b1c1d commit 0aeee3f

File tree

18 files changed

+1501
-908
lines changed

18 files changed

+1501
-908
lines changed

.github/workflows/browser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v2
1414
- uses: actions/setup-node@v1
1515
with:
16-
node-version: 14.x
16+
node-version: 22.x
1717
- run: npm install && cd example/browser && npm install
1818
- run: docker run --name seq -d -p 5341:80 -e ACCEPT_EULA=Y datalust/seq:latest
1919
- run: cd example/browser && npm run test:html

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [14.x, 16.x, 18.x, 20.x]
19+
node-version: [18.x, 20.x, 22.x]
2020
os: [ubuntu-latest, windows-latest, macOS-latest]
2121

2222
steps:

.github/workflows/npm-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v2
1616
- uses: actions/setup-node@v1
1717
with:
18-
node-version: 14
18+
node-version: 18
1919
- run: npm ci
2020
- run: npm test
2121

@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/checkout@v2
2727
- uses: actions/setup-node@v1
2828
with:
29-
node-version: 14
29+
node-version: 18
3030
registry-url: https://registry.npmjs.org/
3131
- run: npm ci
3232
- run: npm publish

browser.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
"use strict";
22

3-
let Logger = require('./seq_logger')(Blob, fetch, typeof AbortController !== 'undefined' ? AbortController : require('abort-controller'));
3+
// Variable used to force testing fallback modules
4+
// This should remain false, but can be changed in testing
5+
const fallback = false;
46

5-
module.exports = {Logger};
7+
const Logger = (await import('./seq_logger.js')).DefineLogger(
8+
Blob,
9+
fetch,
10+
!fallback && typeof AbortController !== 'undefined' ? AbortController : (await import('abort-controller')).AbortController
11+
);
12+
13+
export { Logger };

example/browser/cypress.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
video: false,
5+
e2e: {
6+
setupNodeEvents(on, config) {
7+
return require('./cypress/plugins/index.js')(on, config)
8+
},
9+
},
10+
})

example/browser/cypress.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
File renamed without changes.

example/browser/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"seq-logging": "file:../../"
1313
},
1414
"devDependencies": {
15-
"@cypress/webpack-dev-server": "^1.3",
16-
"cypress": "^7.5",
17-
"html-loader": "^2.1",
18-
"html-webpack-plugin": "^5.3",
19-
"webpack": "^5.38",
20-
"webpack-cli": "^4.7",
21-
"webpack-dev-server": "^3.11"
15+
"@cypress/webpack-dev-server": "^4.0.2",
16+
"cypress": "^14.3.2",
17+
"html-loader": "^5.1.0",
18+
"html-webpack-plugin": "^5.6.3",
19+
"webpack": "^5.99.7",
20+
"webpack-cli": "^6.0.1",
21+
"webpack-dev-server": "^5.2.1"
2222
}
2323
}

example/browser/src/log.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
Create a logger that can write events to Seq.
33
*/
44

5-
import seq from 'seq-logging/browser';
5+
import { Logger as SeqLogger } from 'seq-logging/browser';
66
import status from './status';
77

88
export default (messageTemplate) => {
99
// Connect to the Seq server
10-
const logger = new seq.Logger({ serverUrl: 'http://localhost:5341' });
10+
const logger = new SeqLogger({ serverUrl: 'http://localhost:5341' });
1111

1212
// When the button is hit, send an event to Seq
1313
document.getElementById('log-event').addEventListener('click', () => {

0 commit comments

Comments
 (0)