@theia/plugin-utils 1.77.0-next.1 → 1.77.0-next.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/constants.js +12 -15
- package/lib/common/constants.js.map +1 -1
- package/lib/common/constants.spec.js +7 -9
- package/lib/common/constants.spec.js.map +1 -1
- package/lib/common/contribution-types.d.ts +3 -3
- package/lib/common/contribution-types.d.ts.map +1 -1
- package/lib/common/contribution-types.js +4 -7
- package/lib/common/contribution-types.js.map +1 -1
- package/lib/common/manifest-types.d.ts +1 -1
- package/lib/common/manifest-types.d.ts.map +1 -1
- package/lib/common/manifest-types.js +7 -11
- package/lib/common/manifest-types.js.map +1 -1
- package/lib/common/manifest-types.spec.js +7 -9
- package/lib/common/manifest-types.spec.js.map +1 -1
- package/lib/common/package-nls.js +6 -11
- package/lib/common/package-nls.js.map +1 -1
- package/lib/common/package-nls.spec.js +23 -24
- package/lib/common/package-nls.spec.js.map +1 -1
- package/lib/common/plugin-activation-events.d.ts +1 -1
- package/lib/common/plugin-activation-events.d.ts.map +1 -1
- package/lib/common/plugin-activation-events.js +14 -17
- package/lib/common/plugin-activation-events.js.map +1 -1
- package/lib/common/plugin-activation-events.spec.js +14 -16
- package/lib/common/plugin-activation-events.spec.js.map +1 -1
- package/lib/common/plugin-manifest.d.ts +1 -1
- package/lib/common/plugin-manifest.d.ts.map +1 -1
- package/lib/common/plugin-manifest.js +8 -12
- package/lib/common/plugin-manifest.js.map +1 -1
- package/lib/common/plugin-manifest.spec.js +21 -22
- package/lib/common/plugin-manifest.spec.js.map +1 -1
- package/lib/common/plugin-model.d.ts +1 -1
- package/lib/common/plugin-model.d.ts.map +1 -1
- package/lib/common/plugin-model.js +23 -37
- package/lib/common/plugin-model.js.map +1 -1
- package/lib/common/plugin-model.spec.js +66 -68
- package/lib/common/plugin-model.spec.js.map +1 -1
- package/lib/common/protocol-shims.js +3 -6
- package/lib/common/protocol-shims.js.map +1 -1
- package/lib/common/test-helpers.d.ts +2 -2
- package/lib/common/test-helpers.d.ts.map +1 -1
- package/lib/common/test-helpers.js +5 -9
- package/lib/common/test-helpers.js.map +1 -1
- package/lib/common/utils.js +6 -14
- package/lib/common/utils.js.map +1 -1
- package/lib/common/utils.spec.js +25 -27
- package/lib/common/utils.spec.js.map +1 -1
- package/lib/node/normalize-contributions.d.ts +3 -3
- package/lib/node/normalize-contributions.d.ts.map +1 -1
- package/lib/node/normalize-contributions.js +86 -126
- package/lib/node/normalize-contributions.js.map +1 -1
- package/lib/node/normalize-contributions.spec.js +158 -160
- package/lib/node/normalize-contributions.spec.js.map +1 -1
- package/lib/node/package-nls.d.ts +1 -1
- package/lib/node/package-nls.d.ts.map +1 -1
- package/lib/node/package-nls.js +9 -11
- package/lib/node/package-nls.js.map +1 -1
- package/lib/node/plugin-manifest.d.ts +2 -2
- package/lib/node/plugin-manifest.d.ts.map +1 -1
- package/lib/node/plugin-manifest.js +6 -8
- package/lib/node/plugin-manifest.js.map +1 -1
- package/lib/node/plugin-model.d.ts +1 -1
- package/lib/node/plugin-model.d.ts.map +1 -1
- package/lib/node/plugin-model.js +5 -8
- package/lib/node/plugin-model.js.map +1 -1
- package/lib/node/read-grammars.d.ts +2 -2
- package/lib/node/read-grammars.d.ts.map +1 -1
- package/lib/node/read-grammars.js +8 -11
- package/lib/node/read-grammars.js.map +1 -1
- package/lib/node/read-grammars.spec.js +25 -26
- package/lib/node/read-grammars.spec.js.map +1 -1
- package/package.json +10 -2
- package/src/common/constants.spec.ts +1 -1
- package/src/common/contribution-types.ts +3 -3
- package/src/common/manifest-types.spec.ts +1 -1
- package/src/common/manifest-types.ts +2 -2
- package/src/common/package-nls.spec.ts +4 -3
- package/src/common/package-nls.ts +1 -1
- package/src/common/plugin-activation-events.spec.ts +2 -2
- package/src/common/plugin-activation-events.ts +2 -2
- package/src/common/plugin-manifest.spec.ts +6 -5
- package/src/common/plugin-manifest.ts +3 -3
- package/src/common/plugin-model.spec.ts +4 -4
- package/src/common/plugin-model.ts +2 -2
- package/src/common/test-helpers.ts +3 -3
- package/src/common/utils.spec.ts +2 -2
- package/src/node/normalize-contributions.spec.ts +5 -5
- package/src/node/normalize-contributions.ts +5 -5
- package/src/node/package-nls.ts +4 -3
- package/src/node/plugin-manifest.ts +4 -3
- package/src/node/plugin-model.ts +1 -1
- package/src/node/read-grammars.spec.ts +3 -2
- package/src/node/read-grammars.ts +5 -4
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { expect } from 'chai';
|
|
18
|
-
import { rawContributes } from './manifest-types';
|
|
18
|
+
import { rawContributes } from './manifest-types.js';
|
|
19
19
|
|
|
20
20
|
describe('manifest-types', () => {
|
|
21
21
|
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { isObject } from './utils';
|
|
18
|
-
import type { NormalizedPluginContribution, PluginManifestContribution } from './contribution-types';
|
|
17
|
+
import { isObject } from './utils.js';
|
|
18
|
+
import type { NormalizedPluginContribution, PluginManifestContribution } from './contribution-types.js';
|
|
19
19
|
|
|
20
20
|
export const PLUGIN_HOST_BACKEND = 'main' as const;
|
|
21
21
|
export const PLUGIN_HOST_FRONTEND = 'frontend' as const;
|
|
@@ -15,11 +15,12 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { expect } from 'chai';
|
|
18
|
-
|
|
18
|
+
// A CommonJS module whose exports cannot be detected statically, so it is imported as a whole.
|
|
19
|
+
import fs from 'fs-extra';
|
|
19
20
|
import * as os from 'os';
|
|
20
21
|
import * as path from 'path';
|
|
21
|
-
import { coerceLocalizations, localizePackage, localizeWithResolver } from './package-nls';
|
|
22
|
-
import { loadPackageTranslations } from '../node/package-nls';
|
|
22
|
+
import { coerceLocalizations, localizePackage, localizeWithResolver } from './package-nls.js';
|
|
23
|
+
import { loadPackageTranslations } from '../node/package-nls.js';
|
|
23
24
|
|
|
24
25
|
describe('package-nls', () => {
|
|
25
26
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { isObject } from './utils';
|
|
17
|
+
import { isObject } from './utils.js';
|
|
18
18
|
|
|
19
19
|
export interface PackageTranslation {
|
|
20
20
|
translation?: Record<string, string>;
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { expect } from 'chai';
|
|
18
|
-
import { updateActivationEvents } from './plugin-activation-events';
|
|
19
|
-
import type { PluginManifest } from './manifest-types';
|
|
18
|
+
import { updateActivationEvents } from './plugin-activation-events.js';
|
|
19
|
+
import type { PluginManifest } from './manifest-types.js';
|
|
20
20
|
|
|
21
21
|
function manifest(partial: Pick<PluginManifest, 'contributes' | 'activationEvents'>): Pick<PluginManifest, 'contributes' | 'activationEvents'> {
|
|
22
22
|
return {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { flatten, isObject, isStringArray } from './utils';
|
|
18
|
-
import { rawContributes, type PluginManifest } from './manifest-types';
|
|
17
|
+
import { flatten, isObject, isStringArray } from './utils.js';
|
|
18
|
+
import { rawContributes, type PluginManifest } from './manifest-types.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Most activation events can be automatically deduced from the package manifest.
|
|
@@ -15,11 +15,12 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { expect } from 'chai';
|
|
18
|
-
import { UNPUBLISHED, VSCODE_BUILTIN_NAME_PREFIX } from './constants';
|
|
19
|
-
import { prepareLoadedManifest, stripVscodeBuiltinNamePrefix } from './plugin-manifest';
|
|
20
|
-
import { loadManifest } from '../node/plugin-manifest';
|
|
21
|
-
import type { PluginManifest } from './manifest-types';
|
|
22
|
-
|
|
18
|
+
import { UNPUBLISHED, VSCODE_BUILTIN_NAME_PREFIX } from './constants.js';
|
|
19
|
+
import { prepareLoadedManifest, stripVscodeBuiltinNamePrefix } from './plugin-manifest.js';
|
|
20
|
+
import { loadManifest } from '../node/plugin-manifest.js';
|
|
21
|
+
import type { PluginManifest } from './manifest-types.js';
|
|
22
|
+
// A CommonJS module whose exports cannot be detected statically, so it is imported as a whole.
|
|
23
|
+
import fs from 'fs-extra';
|
|
23
24
|
import * as os from 'os';
|
|
24
25
|
import * as path from 'path';
|
|
25
26
|
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { UNPUBLISHED, VSCODE_BUILTIN_NAME_PREFIX } from './constants';
|
|
18
|
-
import type { PluginManifest } from './manifest-types';
|
|
19
|
-
import { updateActivationEvents } from './plugin-activation-events';
|
|
17
|
+
import { UNPUBLISHED, VSCODE_BUILTIN_NAME_PREFIX } from './constants.js';
|
|
18
|
+
import type { PluginManifest } from './manifest-types.js';
|
|
19
|
+
import { updateActivationEvents } from './plugin-activation-events.js';
|
|
20
20
|
|
|
21
21
|
export interface PrepareLoadedManifestOptions {
|
|
22
22
|
/** @default true */
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
VSCODE_FRONTEND_INIT,
|
|
27
27
|
THEIA_PLUGIN_START_METHOD,
|
|
28
28
|
THEIA_PLUGIN_STOP_METHOD
|
|
29
|
-
} from './constants';
|
|
29
|
+
} from './constants.js';
|
|
30
30
|
import {
|
|
31
31
|
applyTrustExtraction,
|
|
32
32
|
buildEntryPointForTheia,
|
|
@@ -40,9 +40,9 @@ import {
|
|
|
40
40
|
pickEngineType,
|
|
41
41
|
toPluginUri,
|
|
42
42
|
toPluginUrl
|
|
43
|
-
} from './plugin-model';
|
|
44
|
-
import { getPluginRootFileUrl } from '../node/plugin-model';
|
|
45
|
-
import { manifest } from './test-helpers';
|
|
43
|
+
} from './plugin-model.js';
|
|
44
|
+
import { getPluginRootFileUrl } from '../node/plugin-model.js';
|
|
45
|
+
import { manifest } from './test-helpers.js';
|
|
46
46
|
|
|
47
47
|
describe('plugin-model', () => {
|
|
48
48
|
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
VSCODE_EXTENSION_ACTIVATE,
|
|
24
24
|
VSCODE_EXTENSION_DEACTIVATE,
|
|
25
25
|
VSCODE_FRONTEND_INIT
|
|
26
|
-
} from './constants';
|
|
26
|
+
} from './constants.js';
|
|
27
27
|
import type {
|
|
28
28
|
PluginEntryPoint,
|
|
29
29
|
PluginLifecycle,
|
|
30
30
|
PluginModel,
|
|
31
31
|
PluginManifest,
|
|
32
32
|
PluginPackageCapabilities
|
|
33
|
-
} from './manifest-types';
|
|
33
|
+
} from './manifest-types.js';
|
|
34
34
|
|
|
35
35
|
export interface PluginIdentifierSource {
|
|
36
36
|
publisher?: string;
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import type { NormalizeContributionsContext } from './contribution-types';
|
|
18
|
-
import type { PluginManifest } from './manifest-types';
|
|
19
|
-
import { toPluginUrl } from './plugin-model';
|
|
17
|
+
import type { NormalizeContributionsContext } from './contribution-types.js';
|
|
18
|
+
import type { PluginManifest } from './manifest-types.js';
|
|
19
|
+
import { toPluginUrl } from './plugin-model.js';
|
|
20
20
|
|
|
21
21
|
export function manifest(partial: Partial<PluginManifest> & Pick<PluginManifest, 'name'>): PluginManifest {
|
|
22
22
|
return {
|
package/src/common/utils.spec.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { expect } from 'chai';
|
|
18
18
|
import { rejects } from 'assert';
|
|
19
19
|
import { promises as fs } from 'fs';
|
|
20
|
-
import { deepClone, isENOENT, isObject, isStringArray } from './utils';
|
|
20
|
+
import { deepClone, isENOENT, isObject, isStringArray } from './utils.js';
|
|
21
21
|
|
|
22
22
|
describe('utils', () => {
|
|
23
23
|
|
|
@@ -63,7 +63,7 @@ describe('utils', () => {
|
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
it('returns false for other errno codes', async () => {
|
|
66
|
-
await rejects(fs.readdir(
|
|
66
|
+
await rejects(fs.readdir(import.meta.filename), reason => !isENOENT(reason));
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { expect } from 'chai';
|
|
18
|
-
import { CustomEditorPriority, type GrammarsContribution, type PluginUiTheme, type WalkthroughContribution } from '../common/contribution-types';
|
|
19
|
-
import { PreferenceScope } from '../common/protocol-shims';
|
|
18
|
+
import { CustomEditorPriority, type GrammarsContribution, type PluginUiTheme, type WalkthroughContribution } from '../common/contribution-types.js';
|
|
19
|
+
import { PreferenceScope } from '../common/protocol-shims.js';
|
|
20
20
|
import {
|
|
21
21
|
deriveDefaultForType,
|
|
22
22
|
extractPluginViewsIds,
|
|
@@ -47,9 +47,9 @@ import {
|
|
|
47
47
|
readWalkthroughs,
|
|
48
48
|
toSchema,
|
|
49
49
|
transformIconUrl
|
|
50
|
-
} from './normalize-contributions';
|
|
51
|
-
import { createNormalizeCtx, manifest } from '../common/test-helpers';
|
|
52
|
-
import type { PluginManifest } from '../common/manifest-types';
|
|
50
|
+
} from './normalize-contributions.js';
|
|
51
|
+
import { createNormalizeCtx, manifest } from '../common/test-helpers.js';
|
|
52
|
+
import type { PluginManifest } from '../common/manifest-types.js';
|
|
53
53
|
|
|
54
54
|
describe('normalize-contributions', () => {
|
|
55
55
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { promises as fs } from 'fs';
|
|
20
20
|
import * as path from 'path';
|
|
21
21
|
import * as jsoncparser from 'jsonc-parser';
|
|
22
|
-
import { deepClone, isColorDefaults, isENOENT, isObject, isStringArray } from '../common/utils';
|
|
22
|
+
import { deepClone, isColorDefaults, isENOENT, isObject, isStringArray } from '../common/utils.js';
|
|
23
23
|
import {
|
|
24
24
|
ICON_NAME_SEGMENT,
|
|
25
25
|
type ColorDefinition,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
type PreferenceSchema,
|
|
31
31
|
PreferenceScope,
|
|
32
32
|
type TaskDefinition,
|
|
33
|
-
} from '../common/protocol-shims';
|
|
33
|
+
} from '../common/protocol-shims.js';
|
|
34
34
|
import {
|
|
35
35
|
CustomEditorPriority,
|
|
36
36
|
type AutoClosingPair,
|
|
@@ -77,9 +77,9 @@ import {
|
|
|
77
77
|
type WalkthroughStepContribution,
|
|
78
78
|
type WalkthroughStepMedia,
|
|
79
79
|
type PluginPackageWalkthroughStepMedia,
|
|
80
|
-
} from '../common/contribution-types';
|
|
81
|
-
import { rawContributes, type PluginManifest } from '../common/manifest-types';
|
|
82
|
-
import { UNPUBLISHED } from '../common/constants';
|
|
80
|
+
} from '../common/contribution-types.js';
|
|
81
|
+
import { rawContributes, type PluginManifest } from '../common/manifest-types.js';
|
|
82
|
+
import { UNPUBLISHED } from '../common/constants.js';
|
|
83
83
|
|
|
84
84
|
function isPluginUiTheme(value: unknown): value is PluginUiTheme {
|
|
85
85
|
return value === 'vs' || value === 'vs-dark' || value === 'hc-black' || value === 'hc-light';
|
package/src/node/package-nls.ts
CHANGED
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as path from 'path';
|
|
18
|
-
|
|
19
|
-
import
|
|
18
|
+
// A CommonJS module whose exports cannot be detected statically, so it is imported as a whole.
|
|
19
|
+
import fs from 'fs-extra';
|
|
20
|
+
import { isENOENT } from '../common/utils.js';
|
|
20
21
|
import {
|
|
21
22
|
coerceLocalizations,
|
|
22
23
|
type PackageTranslation,
|
|
23
|
-
} from '../common/package-nls';
|
|
24
|
+
} from '../common/package-nls.js';
|
|
24
25
|
|
|
25
26
|
export async function loadPackageTranslations(pluginPath: string, locale?: string): Promise<PackageTranslation> {
|
|
26
27
|
const defaultPath = path.join(pluginPath, 'package.nls.json');
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as path from 'path';
|
|
18
|
-
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
18
|
+
// A CommonJS module whose exports cannot be detected statically, so it is imported as a whole.
|
|
19
|
+
import fs from 'fs-extra';
|
|
20
|
+
import type { PluginManifest } from '../common/manifest-types.js';
|
|
21
|
+
import { prepareLoadedManifest, type PrepareLoadedManifestOptions } from '../common/plugin-manifest.js';
|
|
21
22
|
|
|
22
23
|
type LoadedManifest = Pick<PluginManifest, 'name' | 'publisher' | 'contributes' | 'activationEvents'>;
|
|
23
24
|
|
package/src/node/plugin-model.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { readdirSync } from 'fs';
|
|
18
|
-
import { toPluginUrl, type PluginIdentifierSource } from '../common/plugin-model';
|
|
18
|
+
import { toPluginUrl, type PluginIdentifierSource } from '../common/plugin-model.js';
|
|
19
19
|
|
|
20
20
|
export function getPluginRootFileUrl(manifest: PluginIdentifierSource & { packagePath: string }, names: string[]): string | undefined {
|
|
21
21
|
const nameSet = new Set(names.map(n => n.toLowerCase()));
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { expect } from 'chai';
|
|
18
|
-
|
|
18
|
+
// A CommonJS module whose exports cannot be detected statically, so it is imported as a whole.
|
|
19
|
+
import fs from 'fs-extra';
|
|
19
20
|
import * as os from 'os';
|
|
20
21
|
import * as path from 'path';
|
|
21
|
-
import { readGrammarFromDisk, getGrammarContributionValidationError } from './read-grammars';
|
|
22
|
+
import { readGrammarFromDisk, getGrammarContributionValidationError } from './read-grammars.js';
|
|
22
23
|
|
|
23
24
|
describe('readGrammarFromDisk', () => {
|
|
24
25
|
|
|
@@ -15,15 +15,16 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as path from 'path';
|
|
18
|
-
|
|
19
|
-
import
|
|
18
|
+
// A CommonJS module whose exports cannot be detected statically, so it is imported as a whole.
|
|
19
|
+
import fs from 'fs-extra';
|
|
20
|
+
import { isObject } from '../common/utils.js';
|
|
20
21
|
import type {
|
|
21
22
|
GrammarsContribution,
|
|
22
23
|
NormalizeContributionsContext,
|
|
23
24
|
PluginPackageGrammarsContribution,
|
|
24
|
-
} from '../common/contribution-types';
|
|
25
|
+
} from '../common/contribution-types.js';
|
|
25
26
|
|
|
26
|
-
export type { GrammarsContribution } from '../common/contribution-types';
|
|
27
|
+
export type { GrammarsContribution } from '../common/contribution-types.js';
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Returns a validation error message, or `undefined` if the contribution is valid.
|