@theia/plugin-utils 1.75.0-next.28
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/README.md +30 -0
- package/lib/common/constants.d.ts +12 -0
- package/lib/common/constants.d.ts.map +1 -0
- package/lib/common/constants.js +30 -0
- package/lib/common/constants.js.map +1 -0
- package/lib/common/constants.spec.d.ts +2 -0
- package/lib/common/constants.spec.d.ts.map +1 -0
- package/lib/common/constants.spec.js +33 -0
- package/lib/common/constants.spec.js.map +1 -0
- package/lib/common/contribution-types.d.ts +648 -0
- package/lib/common/contribution-types.d.ts.map +1 -0
- package/lib/common/contribution-types.js +30 -0
- package/lib/common/contribution-types.js.map +1 -0
- package/lib/common/manifest-types.d.ts +105 -0
- package/lib/common/manifest-types.d.ts.map +1 -0
- package/lib/common/manifest-types.js +31 -0
- package/lib/common/manifest-types.js.map +1 -0
- package/lib/common/manifest-types.spec.d.ts +2 -0
- package/lib/common/manifest-types.spec.d.ts.map +1 -0
- package/lib/common/manifest-types.spec.js +35 -0
- package/lib/common/manifest-types.spec.js.map +1 -0
- package/lib/common/package-nls.d.ts +24 -0
- package/lib/common/package-nls.d.ts.map +1 -0
- package/lib/common/package-nls.js +82 -0
- package/lib/common/package-nls.js.map +1 -0
- package/lib/common/package-nls.spec.d.ts +2 -0
- package/lib/common/package-nls.spec.d.ts.map +1 -0
- package/lib/common/package-nls.spec.js +98 -0
- package/lib/common/package-nls.spec.js.map +1 -0
- package/lib/common/plugin-activation-events.d.ts +7 -0
- package/lib/common/plugin-activation-events.d.ts.map +1 -0
- package/lib/common/plugin-activation-events.js +95 -0
- package/lib/common/plugin-activation-events.js.map +1 -0
- package/lib/common/plugin-activation-events.spec.d.ts +2 -0
- package/lib/common/plugin-activation-events.spec.d.ts.map +1 -0
- package/lib/common/plugin-activation-events.spec.js +89 -0
- package/lib/common/plugin-activation-events.spec.js.map +1 -0
- package/lib/common/plugin-manifest.d.ts +10 -0
- package/lib/common/plugin-manifest.d.ts.map +1 -0
- package/lib/common/plugin-manifest.js +35 -0
- package/lib/common/plugin-manifest.js.map +1 -0
- package/lib/common/plugin-manifest.spec.d.ts +2 -0
- package/lib/common/plugin-manifest.spec.d.ts.map +1 -0
- package/lib/common/plugin-manifest.spec.js +83 -0
- package/lib/common/plugin-manifest.spec.js.map +1 -0
- package/lib/common/plugin-model.d.ts +33 -0
- package/lib/common/plugin-model.d.ts.map +1 -0
- package/lib/common/plugin-model.js +166 -0
- package/lib/common/plugin-model.js.map +1 -0
- package/lib/common/plugin-model.spec.d.ts +2 -0
- package/lib/common/plugin-model.spec.d.ts.map +1 -0
- package/lib/common/plugin-model.spec.js +204 -0
- package/lib/common/plugin-model.spec.js.map +1 -0
- package/lib/common/protocol-shims.d.ts +128 -0
- package/lib/common/protocol-shims.d.ts.map +1 -0
- package/lib/common/protocol-shims.js +29 -0
- package/lib/common/protocol-shims.js.map +1 -0
- package/lib/common/test-helpers.d.ts +5 -0
- package/lib/common/test-helpers.d.ts.map +1 -0
- package/lib/common/test-helpers.js +41 -0
- package/lib/common/test-helpers.js.map +1 -0
- package/lib/common/utils.d.ts +20 -0
- package/lib/common/utils.d.ts.map +1 -0
- package/lib/common/utils.js +74 -0
- package/lib/common/utils.js.map +1 -0
- package/lib/common/utils.spec.d.ts +2 -0
- package/lib/common/utils.spec.d.ts.map +1 -0
- package/lib/common/utils.spec.js +77 -0
- package/lib/common/utils.spec.js.map +1 -0
- package/lib/node/normalize-contributions.d.ts +54 -0
- package/lib/node/normalize-contributions.d.ts.map +1 -0
- package/lib/node/normalize-contributions.js +985 -0
- package/lib/node/normalize-contributions.js.map +1 -0
- package/lib/node/normalize-contributions.spec.d.ts +2 -0
- package/lib/node/normalize-contributions.spec.d.ts.map +1 -0
- package/lib/node/normalize-contributions.spec.js +850 -0
- package/lib/node/normalize-contributions.spec.js.map +1 -0
- package/lib/node/package-nls.d.ts +3 -0
- package/lib/node/package-nls.d.ts.map +1 -0
- package/lib/node/package-nls.js +45 -0
- package/lib/node/package-nls.js.map +1 -0
- package/lib/node/plugin-manifest.d.ts +6 -0
- package/lib/node/plugin-manifest.d.ts.map +1 -0
- package/lib/node/plugin-manifest.js +26 -0
- package/lib/node/plugin-manifest.js.map +1 -0
- package/lib/node/plugin-model.d.ts +5 -0
- package/lib/node/plugin-model.d.ts.map +1 -0
- package/lib/node/plugin-model.js +36 -0
- package/lib/node/plugin-model.js.map +1 -0
- package/lib/node/read-grammars.d.ts +10 -0
- package/lib/node/read-grammars.d.ts.map +1 -0
- package/lib/node/read-grammars.js +83 -0
- package/lib/node/read-grammars.js.map +1 -0
- package/lib/node/read-grammars.spec.d.ts +2 -0
- package/lib/node/read-grammars.spec.d.ts.map +1 -0
- package/lib/node/read-grammars.spec.js +109 -0
- package/lib/node/read-grammars.spec.js.map +1 -0
- package/package.json +42 -0
- package/src/common/constants.spec.ts +34 -0
- package/src/common/constants.ts +35 -0
- package/src/common/contribution-types.ts +677 -0
- package/src/common/manifest-types.spec.ts +36 -0
- package/src/common/manifest-types.ts +126 -0
- package/src/common/package-nls.spec.ts +122 -0
- package/src/common/package-nls.ts +95 -0
- package/src/common/plugin-activation-events.spec.ts +104 -0
- package/src/common/plugin-activation-events.ts +102 -0
- package/src/common/plugin-manifest.spec.ts +94 -0
- package/src/common/plugin-manifest.ts +44 -0
- package/src/common/plugin-model.spec.ts +246 -0
- package/src/common/plugin-model.ts +194 -0
- package/src/common/protocol-shims.ts +148 -0
- package/src/common/test-helpers.ts +44 -0
- package/src/common/utils.spec.ts +86 -0
- package/src/common/utils.ts +81 -0
- package/src/node/normalize-contributions.spec.ts +931 -0
- package/src/node/normalize-contributions.ts +1098 -0
- package/src/node/package-nls.ts +45 -0
- package/src/node/plugin-manifest.ts +30 -0
- package/src/node/plugin-model.ts +33 -0
- package/src/node/read-grammars.spec.ts +128 -0
- package/src/node/read-grammars.ts +97 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 Maksim Kachurin and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const fs = require("fs");
|
|
20
|
+
const os = require("os");
|
|
21
|
+
const path = require("path");
|
|
22
|
+
const constants_1 = require("./constants");
|
|
23
|
+
const plugin_model_1 = require("./plugin-model");
|
|
24
|
+
const plugin_model_2 = require("../node/plugin-model");
|
|
25
|
+
const test_helpers_1 = require("./test-helpers");
|
|
26
|
+
describe('plugin-model', () => {
|
|
27
|
+
describe('getPluginId', () => {
|
|
28
|
+
it('sanitizes publisher and name', () => {
|
|
29
|
+
(0, chai_1.expect)((0, plugin_model_1.getPluginId)({ publisher: 'dbaeumer', name: 'vscode-eslint' })).to.equal('dbaeumer_vscode_eslint');
|
|
30
|
+
});
|
|
31
|
+
it('uses unpublished publisher when publisher is missing', () => {
|
|
32
|
+
(0, chai_1.expect)((0, plugin_model_1.getPluginId)({ name: 'my-ext' })).to.equal((0, plugin_model_1.getPluginId)({ publisher: constants_1.UNPUBLISHED, name: 'my-ext' }));
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
describe('toPluginUrl', () => {
|
|
36
|
+
it('encodes each path segment and keeps separators for static hosting', () => {
|
|
37
|
+
const url = (0, plugin_model_1.toPluginUrl)({ publisher: 'vscode', name: 'theme-monokai' }, './themes/monokai-color-theme.json');
|
|
38
|
+
(0, chai_1.expect)(url).to.equal('hostedPlugin/vscode_theme_monokai/themes/monokai-color-theme.json');
|
|
39
|
+
});
|
|
40
|
+
it('encodes special characters inside a segment', () => {
|
|
41
|
+
(0, chai_1.expect)((0, plugin_model_1.toPluginUrl)({ publisher: 'acme', name: 'ext' }, 'media/my icon.png'))
|
|
42
|
+
.to.equal('hostedPlugin/acme_ext/media/my%20icon.png');
|
|
43
|
+
(0, chai_1.expect)((0, plugin_model_1.toPluginUrl)({ publisher: 'acme', name: 'ext' }, '$(folder)'))
|
|
44
|
+
.to.equal('hostedPlugin/acme_ext/%24(folder)');
|
|
45
|
+
});
|
|
46
|
+
it('resolves .. within the plugin root and ignores leading ..', () => {
|
|
47
|
+
(0, chai_1.expect)((0, plugin_model_1.toPluginUrl)({ publisher: 'acme', name: 'ext' }, 'themes/../icons/a.png'))
|
|
48
|
+
.to.equal('hostedPlugin/acme_ext/icons/a.png');
|
|
49
|
+
(0, chai_1.expect)((0, plugin_model_1.toPluginUrl)({ publisher: 'acme', name: 'ext' }, '../secret.json'))
|
|
50
|
+
.to.equal('hostedPlugin/acme_ext/secret.json');
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
describe('pickEngineType', () => {
|
|
54
|
+
it('prefers theiaPlugin over vscode when both are declared', () => {
|
|
55
|
+
(0, chai_1.expect)((0, plugin_model_1.pickEngineType)((0, test_helpers_1.manifest)({
|
|
56
|
+
name: 'both-engines',
|
|
57
|
+
engines: { vscode: '^1.0.0', theiaPlugin: '*' }
|
|
58
|
+
}))).to.equal('theiaPlugin');
|
|
59
|
+
});
|
|
60
|
+
it('returns vscode when only vscode engine is declared', () => {
|
|
61
|
+
(0, chai_1.expect)((0, plugin_model_1.pickEngineType)((0, test_helpers_1.manifest)({
|
|
62
|
+
name: 'vscode-only',
|
|
63
|
+
engines: { vscode: '^1.0.0' }
|
|
64
|
+
}))).to.equal('vscode');
|
|
65
|
+
});
|
|
66
|
+
it('throws when no supported engine is declared', () => {
|
|
67
|
+
(0, chai_1.expect)(() => (0, plugin_model_1.pickEngineType)((0, test_helpers_1.manifest)({ name: 'no-engine' }))).to.throw(/No vscode or theiaPlugin engine/);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
describe('applyTrustExtraction', () => {
|
|
71
|
+
it('copies untrusted workspace support when declared', () => {
|
|
72
|
+
const result = {};
|
|
73
|
+
(0, plugin_model_1.applyTrustExtraction)((0, test_helpers_1.manifest)({
|
|
74
|
+
name: 'trusted',
|
|
75
|
+
capabilities: { untrustedWorkspaces: { supported: 'limited' } }
|
|
76
|
+
}), result);
|
|
77
|
+
(0, chai_1.expect)(result.untrustedWorkspacesSupport).to.equal('limited');
|
|
78
|
+
});
|
|
79
|
+
it('leaves result unchanged when capabilities are absent', () => {
|
|
80
|
+
const result = {};
|
|
81
|
+
(0, plugin_model_1.applyTrustExtraction)((0, test_helpers_1.manifest)({ name: 'plain' }), result);
|
|
82
|
+
(0, chai_1.expect)(result.untrustedWorkspacesSupport).to.equal(undefined);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
describe('getPluginRootFileUrl', () => {
|
|
86
|
+
let tmpDir;
|
|
87
|
+
before(() => {
|
|
88
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'plugin-utils-root-'));
|
|
89
|
+
fs.writeFileSync(path.join(tmpDir, 'README.md'), '# Readme');
|
|
90
|
+
});
|
|
91
|
+
after(() => {
|
|
92
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
93
|
+
});
|
|
94
|
+
it('finds readme files case-insensitively', () => {
|
|
95
|
+
const url = (0, plugin_model_2.getPluginRootFileUrl)((0, test_helpers_1.manifest)({ name: 'docs', packagePath: tmpDir }), ['readme.md']);
|
|
96
|
+
(0, chai_1.expect)(url).to.equal('hostedPlugin/acme_docs/README.md');
|
|
97
|
+
});
|
|
98
|
+
it('returns undefined when directory is missing', () => {
|
|
99
|
+
(0, chai_1.expect)((0, plugin_model_2.getPluginRootFileUrl)((0, test_helpers_1.manifest)({ name: 'missing', packagePath: '/no/such/path' }), ['readme.md'])).to.equal(undefined);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
describe('buildEntryPointForTheia', () => {
|
|
103
|
+
it('maps theiaPlugin entry points and headless script', () => {
|
|
104
|
+
const entryPoint = (0, plugin_model_1.buildEntryPointForTheia)((0, test_helpers_1.manifest)({
|
|
105
|
+
name: 'theia-ext',
|
|
106
|
+
theiaPlugin: {
|
|
107
|
+
frontend: './lib/browser/main.js',
|
|
108
|
+
backend: './lib/node/main.js',
|
|
109
|
+
headless: './lib/headless.js'
|
|
110
|
+
}
|
|
111
|
+
}));
|
|
112
|
+
(0, chai_1.expect)(entryPoint).to.deep.equal({
|
|
113
|
+
frontend: './lib/browser/main.js',
|
|
114
|
+
backend: './lib/node/main.js',
|
|
115
|
+
headless: './lib/headless.js'
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
describe('buildEntryPointForVsCode', () => {
|
|
120
|
+
it('prefers browser entry for ui-only extensions in web mode', () => {
|
|
121
|
+
const entryPoint = (0, plugin_model_1.buildEntryPointForVsCode)((0, test_helpers_1.manifest)({
|
|
122
|
+
name: 'ui-extension',
|
|
123
|
+
browser: './dist/browser/extension.js',
|
|
124
|
+
main: './dist/node/extension.js',
|
|
125
|
+
extensionKind: ['ui']
|
|
126
|
+
}), { uiKind: 'web' });
|
|
127
|
+
(0, chai_1.expect)(entryPoint.frontend).to.equal('./dist/browser/extension.js');
|
|
128
|
+
(0, chai_1.expect)(entryPoint.backend).to.equal(undefined);
|
|
129
|
+
});
|
|
130
|
+
it('uses main as backend when browser is absent', () => {
|
|
131
|
+
const entryPoint = (0, plugin_model_1.buildEntryPointForVsCode)((0, test_helpers_1.manifest)({
|
|
132
|
+
name: 'workspace-extension',
|
|
133
|
+
main: './dist/node/extension.js'
|
|
134
|
+
}), { uiKind: 'web' });
|
|
135
|
+
(0, chai_1.expect)(entryPoint.backend).to.equal('./dist/node/extension.js');
|
|
136
|
+
(0, chai_1.expect)(entryPoint.frontend).to.equal(undefined);
|
|
137
|
+
});
|
|
138
|
+
it('prefers backend when both main and browser exist without ui-only web hint', () => {
|
|
139
|
+
const entryPoint = (0, plugin_model_1.buildEntryPointForVsCode)((0, test_helpers_1.manifest)({
|
|
140
|
+
name: 'hybrid',
|
|
141
|
+
browser: './dist/browser/extension.js',
|
|
142
|
+
main: './dist/node/extension.js',
|
|
143
|
+
extensionKind: ['workspace', 'ui']
|
|
144
|
+
}), { uiKind: 'web' });
|
|
145
|
+
(0, chai_1.expect)(entryPoint.backend).to.equal('./dist/node/extension.js');
|
|
146
|
+
(0, chai_1.expect)(entryPoint.frontend).to.equal(undefined);
|
|
147
|
+
});
|
|
148
|
+
it('forwards headless script from theiaPlugin section', () => {
|
|
149
|
+
const entryPoint = (0, plugin_model_1.buildEntryPointForVsCode)((0, test_helpers_1.manifest)({
|
|
150
|
+
name: 'headless',
|
|
151
|
+
main: './main.js',
|
|
152
|
+
theiaPlugin: { headless: './headless.js' }
|
|
153
|
+
}));
|
|
154
|
+
(0, chai_1.expect)(entryPoint.headless).to.equal('./headless.js');
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
describe('buildModel', () => {
|
|
158
|
+
it('builds theia plugin model with defaults', () => {
|
|
159
|
+
const model = (0, plugin_model_1.buildModelForTheia)((0, test_helpers_1.manifest)({
|
|
160
|
+
name: 'Sample',
|
|
161
|
+
publisher: 'Acme',
|
|
162
|
+
packageUri: 'hostedPlugin/acme_Sample/'
|
|
163
|
+
}));
|
|
164
|
+
(0, chai_1.expect)(model.id).to.equal('acme.sample');
|
|
165
|
+
(0, chai_1.expect)(model.engine).to.deep.equal({ type: 'theiaPlugin', version: '*' });
|
|
166
|
+
(0, chai_1.expect)(model.displayName).to.equal('Test Extension');
|
|
167
|
+
(0, chai_1.expect)(model.packageUri).to.equal('hostedPlugin/acme_Sample/');
|
|
168
|
+
});
|
|
169
|
+
it('builds vscode model with icon url and web entry point', () => {
|
|
170
|
+
const model = (0, plugin_model_1.buildModelForVsCode)((0, test_helpers_1.manifest)({
|
|
171
|
+
name: 'icon-ext',
|
|
172
|
+
icon: './media/icon.png',
|
|
173
|
+
browser: './browser.js',
|
|
174
|
+
extensionKind: ['ui'],
|
|
175
|
+
engines: { vscode: '^1.90.0' }
|
|
176
|
+
}), { uiKind: 'web' });
|
|
177
|
+
(0, chai_1.expect)(model.engine).to.deep.equal({ type: 'vscode', version: '^1.90.0' });
|
|
178
|
+
(0, chai_1.expect)(model.iconUrl).to.equal('hostedPlugin/acme_icon_ext/media/icon.png');
|
|
179
|
+
(0, chai_1.expect)(model.entryPoint.frontend).to.equal('./browser.js');
|
|
180
|
+
});
|
|
181
|
+
it('uses UNPUBLISHED publisher and displayName fallback', () => {
|
|
182
|
+
const model = (0, plugin_model_1.buildModel)((0, test_helpers_1.manifest)({ name: 'anon', publisher: undefined, displayName: undefined }), 'vscode');
|
|
183
|
+
(0, chai_1.expect)(model.publisher).to.equal(constants_1.UNPUBLISHED);
|
|
184
|
+
(0, chai_1.expect)(model.displayName).to.equal('anon');
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
describe('buildLifecycle', () => {
|
|
188
|
+
it('uses theia start/stop for theiaPlugin engine', () => {
|
|
189
|
+
const lifecycle = (0, plugin_model_1.buildLifecycle)((0, test_helpers_1.manifest)({ name: 'theia', publisher: 'acme' }), 'theiaPlugin');
|
|
190
|
+
(0, chai_1.expect)(lifecycle.startMethod).to.equal(constants_1.THEIA_PLUGIN_START_METHOD);
|
|
191
|
+
(0, chai_1.expect)(lifecycle.stopMethod).to.equal(constants_1.THEIA_PLUGIN_STOP_METHOD);
|
|
192
|
+
(0, chai_1.expect)(lifecycle.frontendModuleName).to.equal('acme_theia');
|
|
193
|
+
(0, chai_1.expect)(lifecycle.frontendInitPath).to.equal(undefined);
|
|
194
|
+
});
|
|
195
|
+
it('uses vscode activate/deactivate lifecycle', () => {
|
|
196
|
+
const lifecycle = (0, plugin_model_1.buildLifecycle)((0, test_helpers_1.manifest)({ name: 'sample', publisher: 'acme' }), 'vscode');
|
|
197
|
+
(0, chai_1.expect)(lifecycle.startMethod).to.equal(constants_1.VSCODE_EXTENSION_ACTIVATE);
|
|
198
|
+
(0, chai_1.expect)(lifecycle.stopMethod).to.equal(constants_1.VSCODE_EXTENSION_DEACTIVATE);
|
|
199
|
+
(0, chai_1.expect)(lifecycle.frontendInitPath).to.equal(constants_1.VSCODE_FRONTEND_INIT);
|
|
200
|
+
(0, chai_1.expect)(lifecycle.frontendModuleName).to.equal('acme_sample');
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
//# sourceMappingURL=plugin-model.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-model.spec.js","sourceRoot":"","sources":["../../src/common/plugin-model.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,iDAAiD;AACjD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,+BAA8B;AAC9B,yBAAyB;AACzB,yBAAyB;AACzB,6BAA6B;AAC7B,2CAOqB;AACrB,iDAWwB;AACxB,uDAA4D;AAC5D,iDAA0C;AAE1C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAE1B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QACzB,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;YACpC,IAAA,aAAM,EAAC,IAAA,0BAAW,EAAC,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,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,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,gCAAoB,CAAC,CAAC;YAClE,IAAA,aAAM,EAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural subset of `@theia/core` / `@theia/task` types used by normalize-contributions.
|
|
3
|
+
* Keep in sync with:
|
|
4
|
+
* `packages/core/src/common/json-schema.ts`,
|
|
5
|
+
* `packages/core/src/common/preferences/preference-schema.ts`,
|
|
6
|
+
* `packages/core/src/common/color.ts`,
|
|
7
|
+
* `packages/task/src/common/task-protocol.ts`.
|
|
8
|
+
*/
|
|
9
|
+
export type JSONPrimitive = boolean | number | string | null;
|
|
10
|
+
export type JSONValue = JSONPrimitive | JSONObject | JSONValue[];
|
|
11
|
+
export interface JSONObject {
|
|
12
|
+
[key: string]: JSONValue;
|
|
13
|
+
}
|
|
14
|
+
export type JsonType = 'string' | 'array' | 'number' | 'integer' | 'object' | 'boolean' | 'null';
|
|
15
|
+
export interface IJSONSchema {
|
|
16
|
+
id?: string;
|
|
17
|
+
$id?: string;
|
|
18
|
+
$schema?: string;
|
|
19
|
+
type?: JsonType | JsonType[];
|
|
20
|
+
owner?: string;
|
|
21
|
+
group?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
default?: JSONValue;
|
|
24
|
+
definitions?: IJSONSchemaMap;
|
|
25
|
+
description?: string;
|
|
26
|
+
properties?: IJSONSchemaMap;
|
|
27
|
+
patternProperties?: IJSONSchemaMap;
|
|
28
|
+
additionalProperties?: boolean | IJSONSchema;
|
|
29
|
+
minProperties?: number;
|
|
30
|
+
maxProperties?: number;
|
|
31
|
+
dependencies?: IJSONSchemaMap | {
|
|
32
|
+
[prop: string]: string[];
|
|
33
|
+
};
|
|
34
|
+
items?: IJSONSchema | IJSONSchema[];
|
|
35
|
+
prefixItems?: IJSONSchema[];
|
|
36
|
+
minItems?: number;
|
|
37
|
+
maxItems?: number;
|
|
38
|
+
uniqueItems?: boolean;
|
|
39
|
+
additionalItems?: boolean | IJSONSchema;
|
|
40
|
+
pattern?: string;
|
|
41
|
+
minLength?: number;
|
|
42
|
+
maxLength?: number;
|
|
43
|
+
minimum?: number;
|
|
44
|
+
maximum?: number;
|
|
45
|
+
exclusiveMinimum?: boolean | number;
|
|
46
|
+
exclusiveMaximum?: boolean | number;
|
|
47
|
+
multipleOf?: number;
|
|
48
|
+
required?: string[];
|
|
49
|
+
$ref?: string;
|
|
50
|
+
anyOf?: IJSONSchema[];
|
|
51
|
+
allOf?: IJSONSchema[];
|
|
52
|
+
oneOf?: IJSONSchema[];
|
|
53
|
+
not?: IJSONSchema;
|
|
54
|
+
enum?: JSONValue[];
|
|
55
|
+
format?: string;
|
|
56
|
+
const?: JSONValue;
|
|
57
|
+
contains?: IJSONSchema;
|
|
58
|
+
propertyNames?: IJSONSchema;
|
|
59
|
+
$comment?: string;
|
|
60
|
+
if?: IJSONSchema;
|
|
61
|
+
then?: IJSONSchema;
|
|
62
|
+
else?: IJSONSchema;
|
|
63
|
+
defaultSnippets?: IJSONSchemaSnippet[];
|
|
64
|
+
errorMessage?: string;
|
|
65
|
+
patternErrorMessage?: string;
|
|
66
|
+
deprecationMessage?: string;
|
|
67
|
+
markdownDeprecationMessage?: string;
|
|
68
|
+
enumItemLabels?: string[];
|
|
69
|
+
enumDescriptions?: string[];
|
|
70
|
+
markdownEnumDescriptions?: string[];
|
|
71
|
+
markdownDescription?: string;
|
|
72
|
+
doNotSuggest?: boolean;
|
|
73
|
+
allowComments?: boolean;
|
|
74
|
+
allowTrailingCommas?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface IJSONSchemaMap {
|
|
77
|
+
[name: string]: IJSONSchema;
|
|
78
|
+
}
|
|
79
|
+
export interface IJSONSchemaSnippet {
|
|
80
|
+
label?: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
body?: JSONValue;
|
|
83
|
+
bodyText?: string;
|
|
84
|
+
}
|
|
85
|
+
/** Keep numeric values aligned with `PreferenceScope` in `@theia/core`. */
|
|
86
|
+
export declare enum PreferenceScope {
|
|
87
|
+
Default = 0,
|
|
88
|
+
User = 1,
|
|
89
|
+
Workspace = 2,
|
|
90
|
+
Folder = 3
|
|
91
|
+
}
|
|
92
|
+
export interface PreferenceDataProperty extends IJSONSchema {
|
|
93
|
+
overridable?: boolean;
|
|
94
|
+
included?: boolean;
|
|
95
|
+
hidden?: boolean;
|
|
96
|
+
scope?: PreferenceScope;
|
|
97
|
+
typeDetails?: unknown;
|
|
98
|
+
tags?: string[];
|
|
99
|
+
}
|
|
100
|
+
export interface PreferenceSchema {
|
|
101
|
+
scope?: PreferenceScope;
|
|
102
|
+
title?: string;
|
|
103
|
+
defaultOverridable?: boolean;
|
|
104
|
+
properties: {
|
|
105
|
+
[name: string]: PreferenceDataProperty;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export interface ColorDefinition {
|
|
109
|
+
id: string;
|
|
110
|
+
defaults?: {
|
|
111
|
+
light: string;
|
|
112
|
+
dark: string;
|
|
113
|
+
hc: string;
|
|
114
|
+
};
|
|
115
|
+
description: string;
|
|
116
|
+
}
|
|
117
|
+
export interface TaskDefinition {
|
|
118
|
+
taskType: string;
|
|
119
|
+
source: string;
|
|
120
|
+
properties: {
|
|
121
|
+
required?: string[];
|
|
122
|
+
all: string[];
|
|
123
|
+
schema: IJSONSchema;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** Same segment as `CSSIcon.iconNameSegment` in `@theia/core`. */
|
|
127
|
+
export declare const ICON_NAME_SEGMENT = "[A-Za-z0-9]+";
|
|
128
|
+
//# sourceMappingURL=protocol-shims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-shims.d.ts","s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E;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,GAAG,EAAE,MAAM,EAAE,CAAC;QACd,MAAM,EAAE,WAAW,CAAC;KACvB,CAAC;CACL;AAED,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 Maksim Kachurin and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ICON_NAME_SEGMENT = exports.PreferenceScope = void 0;
|
|
19
|
+
/** Keep numeric values aligned with `PreferenceScope` in `@theia/core`. */
|
|
20
|
+
var PreferenceScope;
|
|
21
|
+
(function (PreferenceScope) {
|
|
22
|
+
PreferenceScope[PreferenceScope["Default"] = 0] = "Default";
|
|
23
|
+
PreferenceScope[PreferenceScope["User"] = 1] = "User";
|
|
24
|
+
PreferenceScope[PreferenceScope["Workspace"] = 2] = "Workspace";
|
|
25
|
+
PreferenceScope[PreferenceScope["Folder"] = 3] = "Folder";
|
|
26
|
+
})(PreferenceScope || (exports.PreferenceScope = PreferenceScope = {}));
|
|
27
|
+
/** Same segment as `CSSIcon.iconNameSegment` in `@theia/core`. */
|
|
28
|
+
exports.ICON_NAME_SEGMENT = '[A-Za-z0-9]+';
|
|
29
|
+
//# sourceMappingURL=protocol-shims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-shims.js","sourceRoot":"","sources":["../../src/common/protocol-shims.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,iDAAiD;AACjD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AA4FhF,2EAA2E;AAC3E,IAAY,eAKX;AALD,WAAY,eAAe;IACvB,2DAAW,CAAA;IACX,qDAAQ,CAAA;IACR,+DAAa,CAAA;IACb,yDAAU,CAAA;AACd,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B;AAkCD,kEAAkE;AACrD,QAAA,iBAAiB,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { NormalizeContributionsContext } from './contribution-types';
|
|
2
|
+
import type { PluginManifest } from './manifest-types';
|
|
3
|
+
export declare function manifest(partial: Partial<PluginManifest> & Pick<PluginManifest, 'name'>): PluginManifest;
|
|
4
|
+
export declare function createNormalizeCtx(pluginOverrides?: Partial<PluginManifest>, ctxOverrides?: Partial<NormalizeContributionsContext>): NormalizeContributionsContext;
|
|
5
|
+
//# sourceMappingURL=test-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../src/common/test-helpers.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG,cAAc,CAQxG;AAED,wBAAgB,kBAAkB,CAC9B,eAAe,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EACzC,YAAY,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,GACtD,6BAA6B,CAU/B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 Maksim Kachurin and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.manifest = manifest;
|
|
19
|
+
exports.createNormalizeCtx = createNormalizeCtx;
|
|
20
|
+
const plugin_model_1 = require("./plugin-model");
|
|
21
|
+
function manifest(partial) {
|
|
22
|
+
return {
|
|
23
|
+
version: '1.0.0',
|
|
24
|
+
publisher: 'acme',
|
|
25
|
+
packagePath: '/tmp/plugin',
|
|
26
|
+
displayName: 'Test Extension',
|
|
27
|
+
...partial
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function createNormalizeCtx(pluginOverrides, ctxOverrides) {
|
|
31
|
+
const plugin = manifest({ name: 'test-ext', ...pluginOverrides });
|
|
32
|
+
return {
|
|
33
|
+
plugin,
|
|
34
|
+
resolveUrl: relativePath => (0, plugin_model_1.toPluginUrl)(plugin, relativePath),
|
|
35
|
+
resolveUri: (pck, relativePath) => (0, plugin_model_1.toPluginUrl)(pck, relativePath),
|
|
36
|
+
onError: () => undefined,
|
|
37
|
+
onWarn: () => undefined,
|
|
38
|
+
...ctxOverrides
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=test-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-helpers.js","sourceRoot":"","sources":["../../src/common/test-helpers.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,iDAAiD;AACjD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAMhF,4BAQC;AAED,gDAaC;AAzBD,iDAA6C;AAE7C,SAAgB,QAAQ,CAAC,OAA+D;IACpF,OAAO;QACH,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,aAAa;QAC1B,WAAW,EAAE,gBAAgB;QAC7B,GAAG,OAAO;KACb,CAAC;AACN,CAAC;AAED,SAAgB,kBAAkB,CAC9B,eAAyC,EACzC,YAAqD;IAErD,MAAM,MAAM,GAAG,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE,CAAC,CAAC;IAClE,OAAO;QACH,MAAM;QACN,UAAU,EAAE,YAAY,CAAC,EAAE,CAAC,IAAA,0BAAW,EAAC,MAAM,EAAE,YAAY,CAAC;QAC7D,UAAU,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,CAAC,IAAA,0BAAW,EAAC,GAAG,EAAE,YAAY,CAAC;QACjE,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;QACxB,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS;QACvB,GAAG,YAAY;KAClB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare function isObject(value: unknown): value is Record<string, unknown>;
|
|
2
|
+
export declare function isStringArray(value: unknown): value is string[];
|
|
3
|
+
export declare function flatten<T>(arrays: readonly (readonly T[])[]): T[];
|
|
4
|
+
export declare function isColorDefaults(value: unknown): value is {
|
|
5
|
+
light: string;
|
|
6
|
+
dark: string;
|
|
7
|
+
highContrast: string;
|
|
8
|
+
};
|
|
9
|
+
interface Errno {
|
|
10
|
+
readonly code: string;
|
|
11
|
+
readonly errno: number;
|
|
12
|
+
}
|
|
13
|
+
declare const ENOENT: "ENOENT";
|
|
14
|
+
type ErrnoException = Error & Errno;
|
|
15
|
+
export declare function isENOENT(arg: unknown): arg is ErrnoException & Readonly<{
|
|
16
|
+
code: typeof ENOENT;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function deepClone<T>(obj: T): T;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/common/utils.ts"],"names":[],"mappings":"AAgBA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGzE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,EAAE,CAE/D;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAMjE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAK9G;AAED,UAAU,KAAK;IACX,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B;AAED,QAAA,MAAM,MAAM,EAAG,QAAiB,CAAC;AAEjC,KAAK,cAAc,GAAG,KAAK,GAAG,KAAK,CAAC;AASpC,wBAAgB,QAAQ,CACpB,GAAG,EAAE,OAAO,GACb,GAAG,IAAI,cAAc,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC,CAE3D;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAkBtC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 Maksim Kachurin and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.isObject = isObject;
|
|
19
|
+
exports.isStringArray = isStringArray;
|
|
20
|
+
exports.flatten = flatten;
|
|
21
|
+
exports.isColorDefaults = isColorDefaults;
|
|
22
|
+
exports.isENOENT = isENOENT;
|
|
23
|
+
exports.deepClone = deepClone;
|
|
24
|
+
function isObject(value) {
|
|
25
|
+
// eslint-disable-next-line no-null/no-null
|
|
26
|
+
return typeof value === 'object' && value !== null;
|
|
27
|
+
}
|
|
28
|
+
function isStringArray(value) {
|
|
29
|
+
return Array.isArray(value) && value.every(item => typeof item === 'string');
|
|
30
|
+
}
|
|
31
|
+
function flatten(arrays) {
|
|
32
|
+
const result = [];
|
|
33
|
+
for (const arr of arrays) {
|
|
34
|
+
result.push(...arr);
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
function isColorDefaults(value) {
|
|
39
|
+
return isObject(value)
|
|
40
|
+
&& typeof value.light === 'string'
|
|
41
|
+
&& typeof value.dark === 'string'
|
|
42
|
+
&& typeof value.highContrast === 'string';
|
|
43
|
+
}
|
|
44
|
+
const ENOENT = 'ENOENT';
|
|
45
|
+
function isErrnoException(arg) {
|
|
46
|
+
return arg instanceof Error
|
|
47
|
+
&& isObject(arg)
|
|
48
|
+
&& typeof arg.code === 'string'
|
|
49
|
+
&& typeof arg.errno === 'number';
|
|
50
|
+
}
|
|
51
|
+
function isENOENT(arg) {
|
|
52
|
+
return isErrnoException(arg) && arg.code === ENOENT;
|
|
53
|
+
}
|
|
54
|
+
function deepClone(obj) {
|
|
55
|
+
if (!isObject(obj)) {
|
|
56
|
+
return obj;
|
|
57
|
+
}
|
|
58
|
+
if (obj instanceof RegExp) {
|
|
59
|
+
return obj;
|
|
60
|
+
}
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
62
|
+
const result = Array.isArray(obj) ? [] : {};
|
|
63
|
+
Object.keys(obj).forEach((key) => {
|
|
64
|
+
const prop = obj[key];
|
|
65
|
+
if (isObject(prop)) {
|
|
66
|
+
result[key] = deepClone(prop);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
result[key] = prop;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/common/utils.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,iDAAiD;AACjD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,4BAGC;AAED,sCAEC;AAED,0BAMC;AAED,0CAKC;AAkBD,4BAIC;AAED,8BAkBC;AAhED,SAAgB,QAAQ,CAAC,KAAc;IACnC,2CAA2C;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACvD,CAAC;AAED,SAAgB,aAAa,CAAC,KAAc;IACxC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;AACjF,CAAC;AAED,SAAgB,OAAO,CAAI,MAAiC;IACxD,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAgB,eAAe,CAAC,KAAc;IAC1C,OAAO,QAAQ,CAAC,KAAK,CAAC;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C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.spec.d.ts","sourceRoot":"","sources":["../../src/common/utils.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 Maksim Kachurin and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const assert_1 = require("assert");
|
|
20
|
+
const fs_1 = require("fs");
|
|
21
|
+
const utils_1 = require("./utils");
|
|
22
|
+
describe('utils', () => {
|
|
23
|
+
describe('isObject', () => {
|
|
24
|
+
it('returns true for plain objects', () => {
|
|
25
|
+
(0, chai_1.expect)((0, utils_1.isObject)({})).to.equal(true);
|
|
26
|
+
(0, chai_1.expect)((0, utils_1.isObject)({ a: 1 })).to.equal(true);
|
|
27
|
+
});
|
|
28
|
+
it('returns false for null and primitives', () => {
|
|
29
|
+
// eslint-disable-next-line no-null/no-null
|
|
30
|
+
(0, chai_1.expect)((0, utils_1.isObject)(null)).to.equal(false);
|
|
31
|
+
(0, chai_1.expect)((0, utils_1.isObject)(undefined)).to.equal(false);
|
|
32
|
+
(0, chai_1.expect)((0, utils_1.isObject)('x')).to.equal(false);
|
|
33
|
+
});
|
|
34
|
+
it('returns true for arrays because they are objects in JavaScript', () => {
|
|
35
|
+
(0, chai_1.expect)((0, utils_1.isObject)([])).to.equal(true);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
describe('isStringArray', () => {
|
|
39
|
+
it('returns true only for string arrays', () => {
|
|
40
|
+
(0, chai_1.expect)((0, utils_1.isStringArray)(['a', 'b'])).to.equal(true);
|
|
41
|
+
(0, chai_1.expect)((0, utils_1.isStringArray)([])).to.equal(true);
|
|
42
|
+
});
|
|
43
|
+
it('returns false for mixed or non-array values', () => {
|
|
44
|
+
(0, chai_1.expect)((0, utils_1.isStringArray)(['a', 1])).to.equal(false);
|
|
45
|
+
(0, chai_1.expect)((0, utils_1.isStringArray)('a')).to.equal(false);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('isENOENT', () => {
|
|
49
|
+
it('detects fs ENOENT errors', async () => {
|
|
50
|
+
await (0, assert_1.rejects)(fs_1.promises.readFile('definitely-missing-' + Date.now()), reason => (0, utils_1.isENOENT)(reason));
|
|
51
|
+
});
|
|
52
|
+
it('returns false for plain errors and null', () => {
|
|
53
|
+
(0, chai_1.expect)((0, utils_1.isENOENT)(new Error('I am not ENOENT'))).to.equal(false);
|
|
54
|
+
// eslint-disable-next-line no-null/no-null
|
|
55
|
+
(0, chai_1.expect)((0, utils_1.isENOENT)(null)).to.equal(false);
|
|
56
|
+
});
|
|
57
|
+
it('returns false for other errno codes', async () => {
|
|
58
|
+
await (0, assert_1.rejects)(fs_1.promises.readdir(__filename), reason => !(0, utils_1.isENOENT)(reason));
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
describe('deepClone', () => {
|
|
62
|
+
it('clones nested objects without sharing references', () => {
|
|
63
|
+
const source = { nested: { value: 1 }, list: [1, 2] };
|
|
64
|
+
const clone = (0, utils_1.deepClone)(source);
|
|
65
|
+
(0, chai_1.expect)(clone).to.deep.equal(source);
|
|
66
|
+
(0, chai_1.expect)(clone).to.not.equal(source);
|
|
67
|
+
(0, chai_1.expect)(clone.nested).to.not.equal(source.nested);
|
|
68
|
+
(0, chai_1.expect)(clone.list).to.not.equal(source.list);
|
|
69
|
+
});
|
|
70
|
+
it('returns primitives and regexps unchanged', () => {
|
|
71
|
+
(0, chai_1.expect)((0, utils_1.deepClone)(42)).to.equal(42);
|
|
72
|
+
const re = /abc/;
|
|
73
|
+
(0, chai_1.expect)((0, utils_1.deepClone)(re)).to.equal(re);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=utils.spec.js.map
|