Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 98bd62b

Browse files
committedDec 6, 2024··
Upgrade base curveball configuration + dependencies.
1 parent d5d9889 commit 98bd62b

File tree

6 files changed

+32
-148
lines changed

6 files changed

+32
-148
lines changed
 

‎package-lock.json

+14-136
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,12 @@
4949
"@curveball/kernel": "^1.0.0",
5050
"@curveball/validator": "^1",
5151
"@eslint/js": "^9.16.0",
52-
"@types/markdown-it": "^13.0.7",
52+
"@types/markdown-it": "^14.1.2",
5353
"@types/node": "^18.19.67",
5454
"@types/react": "^18.0.12",
5555
"@types/react-dom": "^18.0.5",
5656
"html-form-enhancer": "^0.1.9",
5757
"jsdom": "^23.2.0",
58-
"sinon": "^17.0.1",
5958
"tsx": "^4.19.2",
6059
"typescript": "^5.7.2",
6160
"typescript-eslint": "^8.17.0"

‎src/index.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { Middleware, invokeMiddlewares } from '@curveball/kernel';
22
import generateHtmlIndex from './html-index.js';
3-
import { NavigationLinkMap, Options } from './types.js';
3+
import { Options, NavigationLinkMap } from './types.js';
44
import staticMw from '@curveball/static';
55
import { fileURLToPath } from 'node:url';
66
import { join } from 'node:path';
77

8+
export type { Options } from './types.js';
9+
810
export const supportedContentTypes = [
911
'application/json',
1012
'application/hal+json',
@@ -16,6 +18,7 @@ export const supportedContentTypes = [
1618
'application/vnd.siren+json',
1719
];
1820

21+
1922
/*
2023
* Wanted links support
2124
*
@@ -107,8 +110,6 @@ const defaultNavigationLinks: NavigationLinkMap = {
107110
'search': true,
108111
};
109112

110-
export { Options } from './types.js';
111-
112113
const assetsPath = join(fileURLToPath(new URL(import.meta.url)),'../../assets');
113114

114115
export default function browser(options?: Partial<Options>): Middleware {

‎test/json-test.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Application } from '@curveball/kernel';
22
import browser from '../src/index.js';
3-
import { expect } from 'chai';
3+
import { strict as assert } from 'node:assert';
4+
import { describe, it } from 'node:test';
45

56
describe('Browser middleware integration test', () => {
67

@@ -19,9 +20,9 @@ describe('Browser middleware integration test', () => {
1920
Accept: 'text/html'
2021
});
2122

22-
expect(resp.status).to.equal(200);
23-
expect(resp.is('html')).to.equal(true);
24-
expect(resp.body).to.contain('<html><head>');
23+
assert.equal(resp.status, 200);
24+
assert.ok(resp.is('html'));
25+
assert.ok(resp.body.includes('<html><head>'));
2526

2627
});
2728

‎test/templated-uri.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { getFieldsFromTemplatedUri } from '../src/util.js';
2-
import { expect } from 'chai';
2+
import { describe, it } from 'node:test';
3+
import { strict as assert } from 'node:assert';
34

45
describe('Templated URI parser', () => {
56

@@ -50,7 +51,10 @@ describe('Templated URI parser', () => {
5051

5152
it(`should correctly parse "${input}"`, () => {
5253

53-
expect(getFieldsFromTemplatedUri(input)).to.eql(expected);
54+
assert.deepEqual(
55+
getFieldsFromTemplatedUri(input),
56+
expected
57+
);
5458

5559
});
5660

‎tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"DOM",
2020
"ES2022"
2121
],
22-
"declaration": true
22+
"declaration": true,
23+
"jsx": "React"
2324
},
2425
"include": [
2526
"src/**/*"

0 commit comments

Comments
 (0)
Please sign in to comment.