Skip to content
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

Fix/logg stability #684

Closed
wants to merge 8 commits into from
Closed
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
17 changes: 17 additions & 0 deletions .changeset/odd-lies-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@ui5-language-assistant/vscode-ui5-language-assistant-bas-ext": patch
"vscode-ui5-language-assistant": patch
"@ui5-language-assistant/language-server": patch
"@ui5-language-assistant/semantic-model": patch
"@ui5-language-assistant/logic-utils": patch
"@ui5-language-assistant/binding": patch
"@ui5-language-assistant/context": patch
"@ui5-language-assistant/xml-views-completion": patch
"@ui5-language-assistant/xml-views-validation": patch
"@ui5-language-assistant/xml-views-tooltip": patch
"@ui5-language-assistant/fe": patch
"@ui5-language-assistant/test-utils": patch
"@ui5-language-assistant/test-framework": patch
---

Add logger package
2 changes: 0 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const { join } = require("path");

module.exports = {
preset: "ts-jest",
testEnvironment: "node",
Expand Down
3 changes: 1 addition & 2 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
jest.setTimeout(120000); // 2 min

jest.setTimeout(420000); // 7 min
// add all jest-extended matchers
const matchers = require("jest-extended");
expect.extend(matchers);
1 change: 0 additions & 1 deletion packages/binding/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const defaultConfig = require("../../jest.config");

module.exports = {
...defaultConfig,
setupFilesAfterEnv: ["./jest.setup.js"],
globals: {
"ts-jest": {
tsconfig: join(__dirname, "tsconfig-test.json"),
Expand Down
5 changes: 0 additions & 5 deletions packages/binding/jest.setup.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/binding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"license": "Apache-2.0",
"dependencies": {
"@ui5-language-assistant/binding-parser": "1.0.6",
"@ui5-language-assistant/logger": "0.0.1",
"@ui5-language-assistant/context": "4.0.20",
"@ui5-language-assistant/logic-utils": "4.0.14",
"@ui5-language-assistant/xml-views-completion": "4.0.20",
Expand Down
1 change: 1 addition & 0 deletions packages/binding/src/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export const AGGREGATION_BINDING_INFO =
export const Binding_Mode = "sap.ui.model.BindingMode";
export const PARTS = "parts";
export const FILTER_OPERATOR = "FilterOperator";
export const PACKAGE_NAME = "@ui5-language-assistant/binding";
24 changes: 3 additions & 21 deletions packages/binding/src/utils/logger.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
import {
getLogger as logger,
ILogger,
} from "@ui5-language-assistant/logic-utils";

const getPackageName = (): string => {
let meta: { name: string };
try {
meta = require("../../package.json");
} catch (e) {
meta = require("../../../package.json");
}

if (!meta) {
return "";
}
// eslint-disable-next-line @typescript-eslint/no-var-requires -- Using `require` for .json file as this gets bundled with webpack correctly.
return meta.name;
};
import { getLogger as logger, ILogger } from "@ui5-language-assistant/logger";
import { PACKAGE_NAME } from "../constant";

export const getLogger = (): ILogger => {
const name = getPackageName();
return logger(name);
return logger(PACKAGE_NAME);
};
Loading