@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.
Files changed (122) hide show
  1. package/README.md +30 -0
  2. package/lib/common/constants.d.ts +12 -0
  3. package/lib/common/constants.d.ts.map +1 -0
  4. package/lib/common/constants.js +30 -0
  5. package/lib/common/constants.js.map +1 -0
  6. package/lib/common/constants.spec.d.ts +2 -0
  7. package/lib/common/constants.spec.d.ts.map +1 -0
  8. package/lib/common/constants.spec.js +33 -0
  9. package/lib/common/constants.spec.js.map +1 -0
  10. package/lib/common/contribution-types.d.ts +648 -0
  11. package/lib/common/contribution-types.d.ts.map +1 -0
  12. package/lib/common/contribution-types.js +30 -0
  13. package/lib/common/contribution-types.js.map +1 -0
  14. package/lib/common/manifest-types.d.ts +105 -0
  15. package/lib/common/manifest-types.d.ts.map +1 -0
  16. package/lib/common/manifest-types.js +31 -0
  17. package/lib/common/manifest-types.js.map +1 -0
  18. package/lib/common/manifest-types.spec.d.ts +2 -0
  19. package/lib/common/manifest-types.spec.d.ts.map +1 -0
  20. package/lib/common/manifest-types.spec.js +35 -0
  21. package/lib/common/manifest-types.spec.js.map +1 -0
  22. package/lib/common/package-nls.d.ts +24 -0
  23. package/lib/common/package-nls.d.ts.map +1 -0
  24. package/lib/common/package-nls.js +82 -0
  25. package/lib/common/package-nls.js.map +1 -0
  26. package/lib/common/package-nls.spec.d.ts +2 -0
  27. package/lib/common/package-nls.spec.d.ts.map +1 -0
  28. package/lib/common/package-nls.spec.js +98 -0
  29. package/lib/common/package-nls.spec.js.map +1 -0
  30. package/lib/common/plugin-activation-events.d.ts +7 -0
  31. package/lib/common/plugin-activation-events.d.ts.map +1 -0
  32. package/lib/common/plugin-activation-events.js +95 -0
  33. package/lib/common/plugin-activation-events.js.map +1 -0
  34. package/lib/common/plugin-activation-events.spec.d.ts +2 -0
  35. package/lib/common/plugin-activation-events.spec.d.ts.map +1 -0
  36. package/lib/common/plugin-activation-events.spec.js +89 -0
  37. package/lib/common/plugin-activation-events.spec.js.map +1 -0
  38. package/lib/common/plugin-manifest.d.ts +10 -0
  39. package/lib/common/plugin-manifest.d.ts.map +1 -0
  40. package/lib/common/plugin-manifest.js +35 -0
  41. package/lib/common/plugin-manifest.js.map +1 -0
  42. package/lib/common/plugin-manifest.spec.d.ts +2 -0
  43. package/lib/common/plugin-manifest.spec.d.ts.map +1 -0
  44. package/lib/common/plugin-manifest.spec.js +83 -0
  45. package/lib/common/plugin-manifest.spec.js.map +1 -0
  46. package/lib/common/plugin-model.d.ts +33 -0
  47. package/lib/common/plugin-model.d.ts.map +1 -0
  48. package/lib/common/plugin-model.js +166 -0
  49. package/lib/common/plugin-model.js.map +1 -0
  50. package/lib/common/plugin-model.spec.d.ts +2 -0
  51. package/lib/common/plugin-model.spec.d.ts.map +1 -0
  52. package/lib/common/plugin-model.spec.js +204 -0
  53. package/lib/common/plugin-model.spec.js.map +1 -0
  54. package/lib/common/protocol-shims.d.ts +128 -0
  55. package/lib/common/protocol-shims.d.ts.map +1 -0
  56. package/lib/common/protocol-shims.js +29 -0
  57. package/lib/common/protocol-shims.js.map +1 -0
  58. package/lib/common/test-helpers.d.ts +5 -0
  59. package/lib/common/test-helpers.d.ts.map +1 -0
  60. package/lib/common/test-helpers.js +41 -0
  61. package/lib/common/test-helpers.js.map +1 -0
  62. package/lib/common/utils.d.ts +20 -0
  63. package/lib/common/utils.d.ts.map +1 -0
  64. package/lib/common/utils.js +74 -0
  65. package/lib/common/utils.js.map +1 -0
  66. package/lib/common/utils.spec.d.ts +2 -0
  67. package/lib/common/utils.spec.d.ts.map +1 -0
  68. package/lib/common/utils.spec.js +77 -0
  69. package/lib/common/utils.spec.js.map +1 -0
  70. package/lib/node/normalize-contributions.d.ts +54 -0
  71. package/lib/node/normalize-contributions.d.ts.map +1 -0
  72. package/lib/node/normalize-contributions.js +985 -0
  73. package/lib/node/normalize-contributions.js.map +1 -0
  74. package/lib/node/normalize-contributions.spec.d.ts +2 -0
  75. package/lib/node/normalize-contributions.spec.d.ts.map +1 -0
  76. package/lib/node/normalize-contributions.spec.js +850 -0
  77. package/lib/node/normalize-contributions.spec.js.map +1 -0
  78. package/lib/node/package-nls.d.ts +3 -0
  79. package/lib/node/package-nls.d.ts.map +1 -0
  80. package/lib/node/package-nls.js +45 -0
  81. package/lib/node/package-nls.js.map +1 -0
  82. package/lib/node/plugin-manifest.d.ts +6 -0
  83. package/lib/node/plugin-manifest.d.ts.map +1 -0
  84. package/lib/node/plugin-manifest.js +26 -0
  85. package/lib/node/plugin-manifest.js.map +1 -0
  86. package/lib/node/plugin-model.d.ts +5 -0
  87. package/lib/node/plugin-model.d.ts.map +1 -0
  88. package/lib/node/plugin-model.js +36 -0
  89. package/lib/node/plugin-model.js.map +1 -0
  90. package/lib/node/read-grammars.d.ts +10 -0
  91. package/lib/node/read-grammars.d.ts.map +1 -0
  92. package/lib/node/read-grammars.js +83 -0
  93. package/lib/node/read-grammars.js.map +1 -0
  94. package/lib/node/read-grammars.spec.d.ts +2 -0
  95. package/lib/node/read-grammars.spec.d.ts.map +1 -0
  96. package/lib/node/read-grammars.spec.js +109 -0
  97. package/lib/node/read-grammars.spec.js.map +1 -0
  98. package/package.json +42 -0
  99. package/src/common/constants.spec.ts +34 -0
  100. package/src/common/constants.ts +35 -0
  101. package/src/common/contribution-types.ts +677 -0
  102. package/src/common/manifest-types.spec.ts +36 -0
  103. package/src/common/manifest-types.ts +126 -0
  104. package/src/common/package-nls.spec.ts +122 -0
  105. package/src/common/package-nls.ts +95 -0
  106. package/src/common/plugin-activation-events.spec.ts +104 -0
  107. package/src/common/plugin-activation-events.ts +102 -0
  108. package/src/common/plugin-manifest.spec.ts +94 -0
  109. package/src/common/plugin-manifest.ts +44 -0
  110. package/src/common/plugin-model.spec.ts +246 -0
  111. package/src/common/plugin-model.ts +194 -0
  112. package/src/common/protocol-shims.ts +148 -0
  113. package/src/common/test-helpers.ts +44 -0
  114. package/src/common/utils.spec.ts +86 -0
  115. package/src/common/utils.ts +81 -0
  116. package/src/node/normalize-contributions.spec.ts +931 -0
  117. package/src/node/normalize-contributions.ts +1098 -0
  118. package/src/node/package-nls.ts +45 -0
  119. package/src/node/plugin-manifest.ts +30 -0
  120. package/src/node/plugin-model.ts +33 -0
  121. package/src/node/read-grammars.spec.ts +128 -0
  122. package/src/node/read-grammars.ts +97 -0
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ <div align='center'>
2
+
3
+ <br />
4
+
5
+ <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
+
7
+ <h2>ECLIPSE THEIA - PLUGIN UTILS</h2>
8
+
9
+ <hr />
10
+
11
+ </div>
12
+
13
+ ## Description
14
+
15
+ The `@theia/plugin-utils` package provides shared utilities for plugin manifest normalization used by the application build and plugin hosting.
16
+
17
+ ## Additional Information
18
+
19
+ - [Theia - GitHub](https://github.com/eclipse-theia/theia)
20
+ - [Theia - Website](https://theia-ide.org/)
21
+
22
+ ## License
23
+
24
+ - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
25
+ - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
26
+
27
+ ## Trademark
28
+
29
+ "Theia" is a trademark of the Eclipse Foundation
30
+ <https://www.eclipse.org/theia>
@@ -0,0 +1,12 @@
1
+ export declare const PLUGINS_BASE_PATH = "hostedPlugin";
2
+ export declare const UNPUBLISHED = "<unpublished>";
3
+ export declare const DEFAULT_PLUGINS_DIR = "plugins";
4
+ export declare const LIST_JSON = "list.json";
5
+ export declare const VSCODE_BUILTIN_NAME_PREFIX = "@theia/vscode-builtin-";
6
+ export declare const VSCODE_FRONTEND_INIT = "plugin-vscode-init-fe.js";
7
+ export declare const THEIA_PLUGIN_START_METHOD = "start";
8
+ export declare const THEIA_PLUGIN_STOP_METHOD = "stop";
9
+ export declare const VSCODE_EXTENSION_ACTIVATE = "activate";
10
+ export declare const VSCODE_EXTENSION_DEACTIVATE = "deactivate";
11
+ export declare const PLUGIN_COPY_IGNORE: RegExp;
12
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AAEnE,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D,eAAO,MAAM,yBAAyB,UAAU,CAAC;AACjD,eAAO,MAAM,wBAAwB,SAAS,CAAC;AAE/C,eAAO,MAAM,yBAAyB,aAAa,CAAC;AACpD,eAAO,MAAM,2BAA2B,eAAe,CAAC;AAExD,eAAO,MAAM,kBAAkB,QAAuC,CAAC"}
@@ -0,0 +1,30 @@
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.PLUGIN_COPY_IGNORE = exports.VSCODE_EXTENSION_DEACTIVATE = exports.VSCODE_EXTENSION_ACTIVATE = exports.THEIA_PLUGIN_STOP_METHOD = exports.THEIA_PLUGIN_START_METHOD = exports.VSCODE_FRONTEND_INIT = exports.VSCODE_BUILTIN_NAME_PREFIX = exports.LIST_JSON = exports.DEFAULT_PLUGINS_DIR = exports.UNPUBLISHED = exports.PLUGINS_BASE_PATH = void 0;
19
+ exports.PLUGINS_BASE_PATH = 'hostedPlugin';
20
+ exports.UNPUBLISHED = '<unpublished>';
21
+ exports.DEFAULT_PLUGINS_DIR = 'plugins';
22
+ exports.LIST_JSON = 'list.json';
23
+ exports.VSCODE_BUILTIN_NAME_PREFIX = '@theia/vscode-builtin-';
24
+ exports.VSCODE_FRONTEND_INIT = 'plugin-vscode-init-fe.js';
25
+ exports.THEIA_PLUGIN_START_METHOD = 'start';
26
+ exports.THEIA_PLUGIN_STOP_METHOD = 'stop';
27
+ exports.VSCODE_EXTENSION_ACTIVATE = 'activate';
28
+ exports.VSCODE_EXTENSION_DEACTIVATE = 'deactivate';
29
+ exports.PLUGIN_COPY_IGNORE = /[/\\](\.git|node_modules)([/\\]|$)/;
30
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.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;;;AAEnE,QAAA,iBAAiB,GAAG,cAAc,CAAC;AAEnC,QAAA,WAAW,GAAG,eAAe,CAAC;AAE9B,QAAA,mBAAmB,GAAG,SAAS,CAAC;AAEhC,QAAA,SAAS,GAAG,WAAW,CAAC;AAExB,QAAA,0BAA0B,GAAG,wBAAwB,CAAC;AAEtD,QAAA,oBAAoB,GAAG,0BAA0B,CAAC;AAElD,QAAA,yBAAyB,GAAG,OAAO,CAAC;AACpC,QAAA,wBAAwB,GAAG,MAAM,CAAC;AAElC,QAAA,yBAAyB,GAAG,UAAU,CAAC;AACvC,QAAA,2BAA2B,GAAG,YAAY,CAAC;AAE3C,QAAA,kBAAkB,GAAG,oCAAoC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=constants.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.spec.d.ts","sourceRoot":"","sources":["../../src/common/constants.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
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 constants_1 = require("./constants");
20
+ describe('constants', () => {
21
+ describe('PLUGIN_COPY_IGNORE', () => {
22
+ it('skips git metadata and node_modules anywhere in the path', () => {
23
+ (0, chai_1.expect)(constants_1.PLUGIN_COPY_IGNORE.test('/plugin/.git/config')).to.equal(true);
24
+ (0, chai_1.expect)(constants_1.PLUGIN_COPY_IGNORE.test('/plugin/node_modules/pkg/index.js')).to.equal(true);
25
+ (0, chai_1.expect)(constants_1.PLUGIN_COPY_IGNORE.test('/plugin\\node_modules\\pkg')).to.equal(true);
26
+ });
27
+ it('allows regular plugin files', () => {
28
+ (0, chai_1.expect)(constants_1.PLUGIN_COPY_IGNORE.test('/plugin/dist/extension.js')).to.equal(false);
29
+ (0, chai_1.expect)(constants_1.PLUGIN_COPY_IGNORE.test('/plugin/media/icon.png')).to.equal(false);
30
+ });
31
+ });
32
+ });
33
+ //# sourceMappingURL=constants.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.spec.js","sourceRoot":"","sources":["../../src/common/constants.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,2CAAiD;AAEjD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IAEvB,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAChC,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;YAChE,IAAA,aAAM,EAAC,8BAAkB,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACtE,IAAA,aAAM,EAAC,8BAAkB,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpF,IAAA,aAAM,EAAC,8BAAkB,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACnC,IAAA,aAAM,EAAC,8BAAkB,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7E,IAAA,aAAM,EAAC,8BAAkB,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9E,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}