adminforth 1.2.66 → 1.2.68

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/basePlugin.ts CHANGED
@@ -32,10 +32,11 @@ export default class AdminForthPlugin implements IAdminForthPlugin {
32
32
  }
33
33
 
34
34
  modifyResourceConfig(adminforth: IAdminForth, resourceConfig: AdminForthResource) {
35
+ const seed = `af_pl_${this.constructor.name}_${resourceConfig.resourceId}_${this.instanceUniqueRepresentation(this.pluginOptions)}`;
35
36
  this.pluginInstanceId = crypto.createHash('sha256').update(
36
- `af_pl_${this.constructor.name}_${resourceConfig.resourceId}_${this.instanceUniqueRepresentation(this.pluginOptions)}`
37
+ seed
37
38
  ).digest('hex')
38
-
39
+ process.env.HEAVY_DEBUG && console.log(`🪲 AdminForthPlugin.modifyResourceConfig`, seed, 'id', this.pluginInstanceId);
39
40
  this.adminforth = adminforth;
40
41
  }
41
42
 
@@ -17,7 +17,9 @@ export default class AdminForthPlugin {
17
17
  return 'non-uniquely-identified';
18
18
  }
19
19
  modifyResourceConfig(adminforth, resourceConfig) {
20
- this.pluginInstanceId = crypto.createHash('sha256').update(`af_pl_${this.constructor.name}_${resourceConfig.resourceId}_${this.instanceUniqueRepresentation(this.pluginOptions)}`).digest('hex');
20
+ const seed = `af_pl_${this.constructor.name}_${resourceConfig.resourceId}_${this.instanceUniqueRepresentation(this.pluginOptions)}`;
21
+ this.pluginInstanceId = crypto.createHash('sha256').update(seed).digest('hex');
22
+ process.env.HEAVY_DEBUG && console.log(`🪲 AdminForthPlugin.modifyResourceConfig`, seed, 'id', this.pluginInstanceId);
21
23
  this.adminforth = adminforth;
22
24
  }
23
25
  componentPath(componentFile) {
package/dist/index.js CHANGED
@@ -56,8 +56,9 @@ class AdminForth {
56
56
  pluginInstance.modifyResourceConfig(this, resource);
57
57
  const plugin = this.activatedPlugins.find((p) => p.pluginInstanceId === pluginInstance.pluginInstanceId);
58
58
  if (plugin) {
59
+ process.env.HEAVY_DEBUG && console.log(`Current plugin pluginInstance.pluginInstanceId ${pluginInstance.pluginInstanceId}`);
59
60
  throw new Error(`Attempt to activate Plugin ${pluginInstance.constructor.name} second time for same resource, but plugin does not support it.
60
- Tu support multiple plugin instance pre one resource, plugin should return unique string values for each installation from instanceUniqueRepresentation`);
61
+ To support multiple plugin instance pre one resource, plugin should return unique string values for each installation from instanceUniqueRepresentation`);
61
62
  }
62
63
  this.activatedPlugins.push(pluginInstance);
63
64
  }
package/index.ts CHANGED
@@ -84,8 +84,10 @@ class AdminForth implements IAdminForth {
84
84
  pluginInstance.modifyResourceConfig(this, resource);
85
85
  const plugin = this.activatedPlugins.find((p) => p.pluginInstanceId === pluginInstance.pluginInstanceId);
86
86
  if (plugin) {
87
+ process.env.HEAVY_DEBUG && console.log(`Current plugin pluginInstance.pluginInstanceId ${pluginInstance.pluginInstanceId}`);
88
+
87
89
  throw new Error(`Attempt to activate Plugin ${pluginInstance.constructor.name} second time for same resource, but plugin does not support it.
88
- Tu support multiple plugin instance pre one resource, plugin should return unique string values for each installation from instanceUniqueRepresentation`);
90
+ To support multiple plugin instance pre one resource, plugin should return unique string values for each installation from instanceUniqueRepresentation`);
89
91
  }
90
92
  this.activatedPlugins.push(pluginInstance);
91
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.2.66",
3
+ "version": "1.2.68",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",