Skip to content

Fix #513 Use Request and Response from @enonic-types #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group = com.enonic.lib
projectName = lib-static
xpVersion = 7.14.0
xpVersion = 7.15.0
version = 2.0.1-SNAPSHOT
160 changes: 51 additions & 109 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
},
"homepage": "https://developer.enonic.com/docs/lib-static",
"devDependencies": {
"@enonic-types/core": "^7.14.2",
"@enonic-types/global": "^7.14.4",
"@enonic-types/lib-io": "^7.15.0",
"@enonic-types/lib-portal": "^7.15.0",
"@enonic-types/core": "^7.15.0",
"@enonic-types/global": "7.15.0",
"@enonic-types/lib-io": "7.15.0",
"@enonic-types/lib-portal": "7.15.0",
"@enonic-types/lib-vhost": "^7.15.0",
"@enonic/eslint-config": "^2.0.1",
"@eslint/js": "^9.22.0",
Expand Down
7 changes: 4 additions & 3 deletions src/bun/features/requestHandler.feature.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import type {StepDefinitions} from 'jest-cucumber';
import type {
Request,
RequestHandlerOptions,
Response,
} from '@enonic-types/core';
import type {
RequestHandlerOptions,
} from '../../main/resources/lib/enonic/static/types';
import type {App, DoubleUnderscore, Log} from '../../jest/global.d';

import {describe} from '@jest/globals';
import {
expect,
test,
// @ts-expect-error Not using types: bun to avoid Duplicate identifier 'fetch'
} from 'bun:test';
import {
autoBindSteps,
Expand Down Expand Up @@ -189,7 +190,7 @@ export const steps: StepDefinitions = ({
// if (value === 'null') {
// value = null;
// }
expect(response.headers[header]).toStrictEqual(v);
expect(response.headers[header]).toStrictEqual(v as string | number | (string | number)[]);
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/bun/setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type {ScriptValue} from '@enonic-types/core';
import type {AssetUrlParams} from '@enonic-types/lib-portal';
import type {App, DoubleUnderscore, Log} from '../jest/global.d';

Expand All @@ -6,7 +7,6 @@ import {
// jest,
mock,
// test as it
// @ts-expect-error Not using types: bun to avoid Duplicate identifier 'fetch'
} from 'bun:test';
import {stringify} from 'q-i';
import {isObject} from '../jest/isObject';
Expand Down
2 changes: 1 addition & 1 deletion src/jest/expectations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {Log} from './global.d';
import type {
Request,
Response
} from '../main/resources/lib/enonic/static/types';
} from '@enonic-types/core';

import {
expect,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {Request} from '/lib/enonic/static/types';
import type {Request} from '@enonic-types/core';

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

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

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

import {getPathError} from '/lib/enonic/static/path/getPathError';
import {isDev} from '/lib/enonic/static/runMode';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {Request} from '../../types'; // Keep this relative for @enonic-types/lib-static to be correct.
import type {Request} from '@enonic-types/core';

import {isStringLiteral} from '/lib/enonic/static/util/isStringLiteral';
import {stringStartsWith} from '../../util/stringStartsWith';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {Request} from '../../types'; // Keep this relative for @enonic-types/lib-static to be correct.
import type {Request} from '@enonic-types/core';

import {getRelative} from '/lib/enonic/static/resource/path/getRelative';
import {isStringLiteral} from '/lib/enonic/static/util/isStringLiteral';
Expand Down
Loading