@lvce-editor/extension-management-worker 4.89.0 → 4.90.1

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.
@@ -2848,7 +2848,7 @@ const byId = new Map();
2848
2848
  const keyFor = (extensionId, clientId, application) => JSON.stringify([application?.applicationGeneration ?? null, extensionId, clientId]);
2849
2849
  const create = async (extensionId, clientId, options, application) => {
2850
2850
  if (application) assertCurrentApplication(application);
2851
- if (!Number.isSafeInteger(clientId) || clientId < 1 || !Array.isArray(options?.roots) || options.roots.length === 0 || options.recursive !== undefined && typeof options.recursive !== 'boolean' || options.roots.some(uri => typeof uri !== 'string' || !uri.startsWith('file://')) || options.exclude !== undefined && (!Array.isArray(options.exclude) || options.exclude.some(name => typeof name !== 'string'))) {
2851
+ if (!Number.isSafeInteger(clientId) || clientId < 1 || !Array.isArray(options?.roots) || options.roots.length === 0 || options.childNames !== undefined && (options.recursive !== false || !Array.isArray(options.childNames) || options.childNames.some(name => typeof name !== 'string' || !name || /[\\/]/.test(name))) || options.recursive !== undefined && typeof options.recursive !== 'boolean' || options.roots.some(uri => typeof uri !== 'string' || !uri.startsWith('file://')) || options.exclude !== undefined && (!Array.isArray(options.exclude) || options.exclude.some(name => typeof name !== 'string'))) {
2852
2852
  throw new Error('File watchers require disk roots and a valid registration id');
2853
2853
  }
2854
2854
  // Application hosts can expose virtual disk paths through browser callbacks;
@@ -2867,6 +2867,9 @@ const create = async (extensionId, clientId, options, application) => {
2867
2867
  byId.set(registration.id, registration);
2868
2868
  try {
2869
2869
  await invoke$2('FileWatcher.watchExtension', registration.id, {
2870
+ ...(options.childNames !== undefined && {
2871
+ childNames: options.childNames
2872
+ }),
2870
2873
  ...(options.recursive === false && {
2871
2874
  depth: 0
2872
2875
  }),
@@ -3644,6 +3647,42 @@ const createWebViewWorkerRpc = async (rpcInfo, port) => {
3644
3647
  });
3645
3648
  };
3646
3649
 
3650
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
3651
+
3652
+ const instances = Object.create(null);
3653
+ const set$1 = (uid, instance) => {
3654
+ instances[uid] = instance;
3655
+ };
3656
+ const get$1 = uid => {
3657
+ return instances[uid];
3658
+ };
3659
+ const getEntries = () => {
3660
+ return Object.entries(instances).map(([uid, instance]) => ({
3661
+ instance,
3662
+ uid: Number(uid)
3663
+ }));
3664
+ };
3665
+ const remove = uid => {
3666
+ delete instances[uid];
3667
+ };
3668
+ const invalidateRpc = rpc => {
3669
+ for (const {
3670
+ instance,
3671
+ uid
3672
+ } of getEntries()) {
3673
+ if (instance.status === 'ready' && instance.rpc === rpc) {
3674
+ set$1(uid, {
3675
+ error: {
3676
+ message: 'Extension runtime disposed',
3677
+ name: 'Error'
3678
+ },
3679
+ status: 'error',
3680
+ viewId: instance.viewId
3681
+ });
3682
+ }
3683
+ }
3684
+ };
3685
+
3647
3686
  const disposeIsolatedExtensionHostWorker = async (extensionId, invoke = invoke$2) => {
3648
3687
  unregister(extensionId);
3649
3688
  const rpc = remove$1(extensionId);
@@ -3651,6 +3690,7 @@ const disposeIsolatedExtensionHostWorker = async (extensionId, invoke = invoke$2
3651
3690
  await disposeOwner(extensionId);
3652
3691
  return false;
3653
3692
  }
3693
+ invalidateRpc(rpc);
3654
3694
  resetExtensionActivation(extensionId);
3655
3695
  resetExtensionRuntimeState(extensionId);
3656
3696
  // Close all owned resources even if one backend fails during teardown.
@@ -5061,25 +5101,6 @@ const readOutputChannel = async (extensionsState, uri) => {
5061
5101
  return logs;
5062
5102
  };
5063
5103
 
5064
- /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
5065
-
5066
- const instances = Object.create(null);
5067
- const set$1 = (uid, instance) => {
5068
- instances[uid] = instance;
5069
- };
5070
- const get$1 = uid => {
5071
- return instances[uid];
5072
- };
5073
- const getEntries = () => {
5074
- return Object.entries(instances).map(([uid, instance]) => ({
5075
- instance,
5076
- uid: Number(uid)
5077
- }));
5078
- };
5079
- const remove = uid => {
5080
- delete instances[uid];
5081
- };
5082
-
5083
5104
  const serializeError = error => {
5084
5105
  if (error instanceof Error) {
5085
5106
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-management-worker",
3
- "version": "4.89.0",
3
+ "version": "4.90.1",
4
4
  "description": "Webworker for the Extension Management functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"