Skip to content

Commit 16e98e9

Browse files
authored
Fix #513 Use Request and Response from @enonic-types (#514)
1 parent cf28e84 commit 16e98e9

25 files changed

+264
-407
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
group = com.enonic.lib
22
projectName = lib-static
3-
xpVersion = 7.14.0
3+
xpVersion = 7.15.0
44
version = 2.0.1-SNAPSHOT

package-lock.json

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

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
},
3030
"homepage": "https://developer.enonic.com/docs/lib-static",
3131
"devDependencies": {
32-
"@enonic-types/core": "^7.14.2",
33-
"@enonic-types/global": "^7.14.4",
34-
"@enonic-types/lib-io": "^7.15.0",
35-
"@enonic-types/lib-portal": "^7.15.0",
32+
"@enonic-types/core": "^7.15.0",
33+
"@enonic-types/global": "7.15.0",
34+
"@enonic-types/lib-io": "7.15.0",
35+
"@enonic-types/lib-portal": "7.15.0",
3636
"@enonic-types/lib-vhost": "^7.15.0",
3737
"@enonic/eslint-config": "^2.0.1",
3838
"@eslint/js": "^9.22.0",

src/bun/features/requestHandler.feature.test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import type {StepDefinitions} from 'jest-cucumber';
22
import type {
33
Request,
4-
RequestHandlerOptions,
54
Response,
5+
} from '@enonic-types/core';
6+
import type {
7+
RequestHandlerOptions,
68
} from '../../main/resources/lib/enonic/static/types';
79
import type {App, DoubleUnderscore, Log} from '../../jest/global.d';
810

911
import {describe} from '@jest/globals';
1012
import {
1113
expect,
1214
test,
13-
// @ts-expect-error Not using types: bun to avoid Duplicate identifier 'fetch'
1415
} from 'bun:test';
1516
import {
1617
autoBindSteps,
@@ -189,7 +190,7 @@ export const steps: StepDefinitions = ({
189190
// if (value === 'null') {
190191
// value = null;
191192
// }
192-
expect(response.headers[header]).toStrictEqual(v);
193+
expect(response.headers[header]).toStrictEqual(v as string | number | (string | number)[]);
193194
});
194195
});
195196

src/bun/setup.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type {ScriptValue} from '@enonic-types/core';
12
import type {AssetUrlParams} from '@enonic-types/lib-portal';
23
import type {App, DoubleUnderscore, Log} from '../jest/global.d';
34

@@ -6,7 +7,6 @@ import {
67
// jest,
78
mock,
89
// test as it
9-
// @ts-expect-error Not using types: bun to avoid Duplicate identifier 'fetch'
1010
} from 'bun:test';
1111
import {stringify} from 'q-i';
1212
import {isObject} from '../jest/isObject';

src/jest/expectations.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {Log} from './global.d';
22
import type {
33
Request,
44
Response
5-
} from '../main/resources/lib/enonic/static/types';
5+
} from '@enonic-types/core';
66

77
import {
88
expect,

src/jest/lib/enonic/static/resource/path/getRelative.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Request} from '/lib/enonic/static/types';
1+
import type {Request} from '@enonic-types/core';
22

33
import {
44
describe,

src/main/resources/lib/enonic/static/request/getLowerCasedHeaders.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Request} from '../types'; // Keep this relative for @enonic-types/lib-static to be correct.
1+
import type {Request} from '@enonic-types/core';
22

33
import {lcKeys} from '/lib/enonic/static/util/lcKeys';
44

src/main/resources/lib/enonic/static/resource/path/checkPath.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Response} from '../../types'; // Keep this relative for @enonic-types/lib-static to be correct.
1+
import type {Response} from '@enonic-types/core';
22

33
import {getPathError} from '/lib/enonic/static/path/getPathError';
44
import {isDev} from '/lib/enonic/static/runMode';

src/main/resources/lib/enonic/static/resource/path/getRelative.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Request} from '../../types'; // Keep this relative for @enonic-types/lib-static to be correct.
1+
import type {Request} from '@enonic-types/core';
22

33
import {isStringLiteral} from '/lib/enonic/static/util/isStringLiteral';
44
import {stringStartsWith} from '../../util/stringStartsWith';

src/main/resources/lib/enonic/static/resource/path/mappedRelativePath.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Request} from '../../types'; // Keep this relative for @enonic-types/lib-static to be correct.
1+
import type {Request} from '@enonic-types/core';
22

33
import {getRelative} from '/lib/enonic/static/resource/path/getRelative';
44
import {isStringLiteral} from '/lib/enonic/static/util/isStringLiteral';

0 commit comments

Comments
 (0)