Skip to content

Commit

Permalink
Bumped deepmerge to 4.2.2.
Browse files Browse the repository at this point in the history
 - Removed the obsolete dependency from `@theia/monaco.`
 - Switched from `require` to ES `import`.

Signed-off-by: Akos Kitta <[email protected]>
Co-authored-by: Paul Marechal <[email protected]>
  • Loading branch information
Akos Kitta and paul-marechal committed Aug 26, 2021
1 parent e25f0e7 commit 5402ed2
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
3 changes: 2 additions & 1 deletion dev-packages/application-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
"test": "theiaext test"
},
"dependencies": {
"@types/deepmerge": "^2.2.0",
"@types/fs-extra": "^4.0.2",
"@types/request": "^2.0.3",
"@types/semver": "^5.4.0",
"@types/write-json-file": "^2.2.1",
"changes-stream": "^2.2.0",
"deepmerge": "2.0.1",
"deepmerge": "^4.2.2",
"fs-extra": "^4.0.2",
"is-electron": "^2.1.0",
"request": "^2.82.0",
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/application-package/src/application-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { NpmRegistry, NodePackage, PublishedNodePackage, sortByKey } from './npm
import { Extension, ExtensionPackage, ExtensionPackageOptions, RawExtensionPackage } from './extension-package';
import { ExtensionPackageCollector } from './extension-package-collector';
import { ApplicationProps } from './application-props';
const merge = require('deepmerge/dist/cjs');
import deepmerge = require('deepmerge');

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type ApplicationLog = (message?: any, ...optionalParams: any[]) => void;
Expand Down Expand Up @@ -86,7 +86,7 @@ export class ApplicationPackage {
theia.target = defaultTarget;
}

return this._props = merge(ApplicationProps.DEFAULT, theia);
return this._props = deepmerge(ApplicationProps.DEFAULT, theia);
}

protected _pck: NodePackage | undefined;
Expand Down
4 changes: 1 addition & 3 deletions dev-packages/application-package/src/application-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
********************************************************************************/

import type { BrowserWindowConstructorOptions } from 'electron';

/** `deepmerge/dist/cjs` */
export const merge = require('deepmerge/dist/cjs');
export import deepmerge = require('deepmerge');

export type RequiredRecursive<T> = {
[K in keyof T]-?: T[K] extends object ? RequiredRecursive<T[K]> : T[K]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { FrontendApplicationConfig, merge } from '@theia/application-package/lib/application-props';
import { FrontendApplicationConfig, deepmerge } from '@theia/application-package/lib/application-props';

export class FrontendApplicationConfigProvider {

Expand All @@ -35,7 +35,7 @@ export class FrontendApplicationConfigProvider {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const globalObject = window as any;
const key = FrontendApplicationConfigProvider.KEY;
globalObject[key] = merge(FrontendApplicationConfig.DEFAULT, config);
globalObject[key] = deepmerge(FrontendApplicationConfig.DEFAULT, config);
}

private static doGet(): FrontendApplicationConfig | undefined {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/node/backend-application-config-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { BackendApplicationConfig, merge } from '@theia/application-package/lib/application-props';
import { BackendApplicationConfig, deepmerge } from '@theia/application-package/lib/application-props';

export class BackendApplicationConfigProvider {

Expand All @@ -35,7 +35,7 @@ export class BackendApplicationConfigProvider {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const globalObject = global as any;
const key = BackendApplicationConfigProvider.KEY;
globalObject[key] = merge(BackendApplicationConfig.DEFAULT, config);
globalObject[key] = deepmerge(BackendApplicationConfig.DEFAULT, config);
}

private static doGet(): BackendApplicationConfig | undefined {
Expand Down
1 change: 0 additions & 1 deletion packages/monaco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@theia/monaco-editor-core": "0.23.0",
"@theia/outline-view": "1.16.0",
"@theia/workspace": "1.16.0",
"deepmerge": "2.0.1",
"fast-plist": "^0.1.2",
"idb": "^4.0.5",
"jsonc-parser": "^2.2.0",
Expand Down
15 changes: 11 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,13 @@
dependencies:
"@types/node" "*"

"@types/deepmerge@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@types/deepmerge/-/deepmerge-2.2.0.tgz#6f63896c217f3164782f52d858d9f3a927139f64"
integrity sha512-FEQYDHh6+Q+QXKSrIY46m+/lAmAj/bk4KpLaam+hArmzaVpMBHLcfwOH2Q2UOkWM7XsdY9PmZpGyPAjh/JRGhQ==
dependencies:
deepmerge "*"

"@types/diff@^3.2.2":
version "3.5.4"
resolved "https://registry.yarnpkg.com/@types/diff/-/diff-3.5.4.tgz#ddf2e7139bdf7082e446e963da70aa91432205d7"
Expand Down Expand Up @@ -3832,10 +3839,10 @@ deep-is@^0.1.3, deep-is@~0.1.3:
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=

deepmerge@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.0.1.tgz#25c1c24f110fb914f80001b925264dd77f3f4312"
integrity sha512-VIPwiMJqJ13ZQfaCsIFnp5Me9tnjURiaIFxfz7EH0Ci0dTSQpZtSLrqOicXqEd/z2r+z+Klk9GzmnRsgpgbOsQ==
deepmerge@*, deepmerge@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==

deepmerge@^4.2.2:
version "4.2.2"
Expand Down

0 comments on commit 5402ed2

Please sign in to comment.